Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [Draw2d] Can we draw a dot line in draw2d
[Draw2d] Can we draw a dot line in draw2d [message #169514] Thu, 24 February 2005 06:55 Go to next message
zhangbw is currently offline zhangbwFriend
Messages: 26
Registered: July 2009
Junior Member
Hello all,
My problem is:
I want to draw a dot line with Draw2d.(It seems that I cannot upload a
sample line jpeg file which is drawed by awt). I know there's a line
type(LINE_DOT) in draw2d. But I feel the space between 2 dots is too
large(for example: . . . . . ), what I want is (.....). So can I draw it
myself(not to use LINE_DOT type), and how to realize it?

Thanks in advance

BR,
zbw
Re: [Draw2d] Can we draw a dot line in draw2d [message #169571 is a reply to message #169514] Thu, 24 February 2005 15:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

SWT does not support this yet. The DOT style is 3 pixels long. If you
overlay two of them with XOR, you can get 1 pixel appearance.

"zbw" <zbw001091@yahoo.com.cn> wrote in message
news:cvjto0$h3v$1@www.eclipse.org...
> Hello all,
> My problem is: I want to draw a dot line with Draw2d.(It seems that I
> cannot upload a sample line jpeg file which is drawed by awt). I know
> there's a line type(LINE_DOT) in draw2d. But I feel the space between 2
> dots is too large(for example: . . . . . ), what I want is (.....). So can
> I draw it myself(not to use LINE_DOT type), and how to realize it?
>
> Thanks in advance
>
> BR,
> zbw
>
Re: [Draw2d] Can we draw a dot line in draw2d [message #169650 is a reply to message #169571] Fri, 25 February 2005 07:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

Randy Hudson wrote:
> SWT does not support this yet. The DOT style is 3 pixels long. If you
> overlay two of them with XOR, you can get 1 pixel appearance.

I think that it's possible since SWT 3.1m5; there is a new
SWT.LINE_CUSTOM style )))

>
> "zbw" <zbw001091@yahoo.com.cn> wrote in message
> news:cvjto0$h3v$1@www.eclipse.org...
>
>>Hello all,
>>My problem is: I want to draw a dot line with Draw2d.(It seems that I
>>cannot upload a sample line jpeg file which is drawed by awt). I know
>>there's a line type(LINE_DOT) in draw2d. But I feel the space between 2
>>dots is too large(for example: . . . . . ), what I want is (.....). So can
>>I draw it myself(not to use LINE_DOT type), and how to realize it?
>>
>>Thanks in advance
>>
>>BR,
>>zbw
>>
>
>
>
Re: [Draw2d] Can we draw a dot line in draw2d [message #169658 is a reply to message #169571] Fri, 25 February 2005 09:01 Go to previous messageGo to next message
zhangbw is currently offline zhangbwFriend
Messages: 26
Registered: July 2009
Junior Member
Hi,Randy
I tried as your advice, but setXOR(true) seems not working the right way.
I use a Polyline, the following is my code:

public class myFigure extends Polyline
{
public myFigure()
{
super();
/**
* Polyline
*/
setLineStyle(Graphics.LINE_DOT);
setLineWidth(1);
Point point1 = new Point(0,100);
Point point2 = new Point(100,100);
setEndpoints(point1,point2);
setForegroundColor(ColorConstants.blue);

Polyline pl = new Polyline();
pl.setLineStyle(Graphics.LINE_DOT);
pl.setLineWidth(1);
pl.setEndpoints(new Point(1,100),new Point(101,100));
pl.setForegroundColor(ColorConstants.blue);
add(pl);
}
......
}

Then, In editpart:

myFigure figure = new myFigure();
figure.setXOR(true);

BUT the result is not what I want!
I don't think I'm right here, but I really don't know how to.
Can u please advice more or point out the wrong thing?

Thanks in advance

BR,
zbw
Re: [Draw2d] Can we draw a dot line in draw2d [message #170944 is a reply to message #169658] Tue, 08 March 2005 05:40 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Look at GuideLineFigure. Also, make sure you don't run into these bugs:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=85876

"zbw" <zbw001091@yahoo.com.cn> wrote in message
news:cvmpgg$4tt$1@www.eclipse.org...
> Hi,Randy
> I tried as your advice, but setXOR(true) seems not working the right way.
> I use a Polyline, the following is my code:
>
> public class myFigure extends Polyline
> {
> public myFigure()
> {
> super();
> /**
> * Polyline
> */
> setLineStyle(Graphics.LINE_DOT);
> setLineWidth(1);
> Point point1 = new Point(0,100);
> Point point2 = new Point(100,100);
> setEndpoints(point1,point2);
> setForegroundColor(ColorConstants.blue);
>
> Polyline pl = new Polyline();
> pl.setLineStyle(Graphics.LINE_DOT);
> pl.setLineWidth(1);
> pl.setEndpoints(new Point(1,100),new Point(101,100));
> pl.setForegroundColor(ColorConstants.blue);
> add(pl);
> }
> ......
> }
>
> Then, In editpart:
>
> myFigure figure = new myFigure();
> figure.setXOR(true);
>
> BUT the result is not what I want!
> I don't think I'm right here, but I really don't know how to.
> Can u please advice more or point out the wrong thing?
>
> Thanks in advance
>
> BR,
> zbw
>
Previous Topic:Open new Editor from Selected Figure
Next Topic:Text displayed in a thumbnail
Goto Forum:
  


Current Time: Thu Apr 18 02:53:40 GMT 2024

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

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

Back to the top