Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » a problem of drawing line
a problem of drawing line [message #173768] Mon, 28 March 2005 08:38 Go to next message
Eclipse UserFriend
Originally posted by: tranfy.hotmail.com

Hi, all
I draw a line in paintFigure() of my figure that inherited from Figure,
shown as followed:

Rectangle bounds = getBounds().getCopy();
graphics.drawLine(bounds.getTopLeft(),bounds.getBottomRight( ));

I wonder why the line is not straight ,but is curvaceous. It is only
straight when i draw that vertically or horizonally.
Why is the line not straight?
Thanks !
Re: a problem of drawing line [message #174065 is a reply to message #173768] Mon, 28 March 2005 22:01 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
What GEF and SWT versions are you using and on what platform? Got a
screenshot? I'm thinking maybe this is being caused by the advanced
functionality that was added in SWT in 3.1M5a.

BTW, since you're not modifying the bounds, only referring to them, you
don't need to make a copy in your code.

"tranfy" <tranfy@hotmail.com> wrote in message
news:3c05d13b8b84ba4f81d57bd1ed47fbc7$1@www.eclipse.org...
>
> Hi, all
> I draw a line in paintFigure() of my figure that inherited from Figure,
> shown as followed:
>
> Rectangle bounds = getBounds().getCopy();
> graphics.drawLine(bounds.getTopLeft(),bounds.getBottomRight( ));
>
> I wonder why the line is not straight ,but is curvaceous. It is only
> straight when i draw that vertically or horizonally.
> Why is the line not straight?
> Thanks !
>
Re: a problem of drawing line [message #174080 is a reply to message #174065] Tue, 29 March 2005 01:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tranfy.hotmail.com

I am using GEF 3.0.1 , SWT 3.0.1 and win2000 platform. I found that in
gef flow example , the line is not straight when drawing is not horizonal
or vertical.
Re: a problem of drawing line [message #174090 is a reply to message #174080] Tue, 29 March 2005 01:50 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Let's see a screenshot.

"tranfy" <tranfy@hotmail.com> wrote in message
news:09de08bedc56c8c12699554eaeb828a9$1@www.eclipse.org...
>
> I am using GEF 3.0.1 , SWT 3.0.1 and win2000 platform. I found that in
> gef flow example , the line is not straight when drawing is not horizonal
> or vertical.
>
Re: a problem of drawing line [message #174103 is a reply to message #174090] Tue, 29 March 2005 19:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tranfy.hotmail.com

Pls see attachment.

"Pratik Shah" <ppshah@us.ibm.com> д
  • Attachment: line1.gif
    (Size: 1.72KB, Downloaded 142 times)
  • Attachment: line2.gif
    (Size: 1.48KB, Downloaded 150 times)
Re: a problem of drawing line [message #174170 is a reply to message #174103] Tue, 29 March 2005 14:08 Go to previous messageGo to next message
Donna Gresh is currently offline Donna GreshFriend
Messages: 30
Registered: July 2009
Member
This is a multipart message in MIME format.
--=_alternative 004D934885256FD3_=
Content-Type: text/plain; charset="US-ASCII"

Are you referring to the "staircase" effect in the lower picture? That is
aliasing, due to the finite pixels of the display.
--=_alternative 004D934885256FD3_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Are you referring to the &quot;staircase&quot;
effect in the lower picture? That is aliasing, due to the finite pixels
of the display. </font>
--=_alternative 004D934885256FD3_=--
Re: a problem of drawing line [message #174216 is a reply to message #174170] Tue, 29 March 2005 15:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This is a multi-part message in MIME format.

------=_NextPart_000_0078_01C5344B.69F8C5F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

lol
<gresh@us.ibm.com> wrote in message =
news:d2bng5$e93$1@news.eclipse.org...

Are you referring to the "staircase" effect in the lower picture? That =
is aliasing, due to the finite pixels of the display.
------=_NextPart_000_0078_01C5344B.69F8C5F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2604" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>lol</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>&lt;<A href=3D"mailto:gresh@us.ibm.com">gresh@us.ibm.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:d2bng5$e93$1@news.eclipse.org">news:d2bng5$e93$1@news.eclips=
e.org</A>...</DIV><BR><FONT=20
face=3Dsans-serif size=3D2>Are you referring to the "staircase" effect =
in the=20
lower picture? That is aliasing, due to the finite pixels of the =
display.=20
</FONT></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0078_01C5344B.69F8C5F0--
Re: a problem of drawing line [message #174262 is a reply to message #174170] Tue, 29 March 2005 16:50 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_0310_01C53455.90CFF720
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

The good news is that SWT is introducing anti-aliasing in 3.1 and so the =
lines will look better on there.
<gresh@us.ibm.com> wrote in message =
news:d2bng5$e93$1@news.eclipse.org...

Are you referring to the "staircase" effect in the lower picture? That =
is aliasing, due to the finite pixels of the display.
------=_NextPart_000_0310_01C53455.90CFF720
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1491" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>The good news is that SWT is =
introducing=20
anti-aliasing in 3.1 and so the lines will look better on =
there.</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>&lt;<A href=3D"mailto:gresh@us.ibm.com">gresh@us.ibm.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:d2bng5$e93$1@news.eclipse.org">news:d2bng5$e93$1@news.eclips=
e.org</A>...</DIV><BR><FONT=20
face=3Dsans-serif size=3D2>Are you referring to the "staircase" effect =
in the=20
lower picture? That is aliasing, due to the finite pixels of the =
display.=20
</FONT></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0310_01C53455.90CFF720--
Re: a problem of drawing line [message #174321 is a reply to message #174216] Tue, 29 March 2005 19:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gslade.no.spam.us.ibm.com

Rats, I was looking forward to seeing a "curvaceous" line


Randy Hudson wrote:
> lol
>
> <gresh@us.ibm.com <mailto:gresh@us.ibm.com>> wrote in message
> news:d2bng5$e93$1@news.eclipse.org...
>
> Are you referring to the "staircase" effect in the lower picture?
> That is aliasing, due to the finite pixels of the display.
Re: a problem of drawing line [message #174360 is a reply to message #174262] Wed, 30 March 2005 01:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tranfy.hotmail.com

yes. What i referred to is "staircase" effect. Then how can i draw a
straight line ? may you give me a good method to do that?
Thanks.
Re: a problem of drawing line [message #174365 is a reply to message #174216] Wed, 30 March 2005 01:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tranfy.hotmail.com

yes. What i referred to is "staircase" effect. Then how can i draw a
straight line ? do you have any good method to do that?
Thanks.
Re: a problem of drawing line [message #174381 is a reply to message #174360] Wed, 30 March 2005 01:48 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Yikes, there's still more explaining to do here. It IS a straight line. It
just appears choppy. Like I said, with anti-aliasing in 3.1, it will look
better. Until then, you can't do anything.

"tranfy" <tranfy@hotmail.com> wrote in message
news:2030be816827efa6a049b5cfa909ca43$1@www.eclipse.org...
>
> yes. What i referred to is "staircase" effect. Then how can i draw a
> straight line ? may you give me a good method to do that?
> Thanks.
>
Re: a problem of drawing line [message #174399 is a reply to message #174381] Wed, 30 March 2005 01:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tranfy.hotmail.com

i c. thanks a lot.
looking for GEF test examples [message #178069 is a reply to message #174080] Mon, 18 April 2005 08:46 Go to previous message
benedict heal is currently offline benedict healFriend
Messages: 28
Registered: July 2009
Junior Member
Can anyone point me to examples of JUnit tests for GEF-based plugins?
I'd love to see how it is meant to be done.
Benedict
Previous Topic:How to make different figures share same model and part
Next Topic:how does GEF interpret user actions to REQUESTs?
Goto Forum:
  


Current Time: Thu Dec 26 18:37:16 GMT 2024

Powered by FUDForum. Page generated in 0.03230 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top