Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Can't see connections with Mac OS X
Can't see connections with Mac OS X [message #171036] Tue, 08 March 2005 21:12 Go to next message
Eclipse UserFriend
Originally posted by: usenet.jevopi.de

I have a strange problem with connections. I've implemented a GEF based
editor as an Eclipse plugin using Windows XP. Everything is working
fine there. Now I tested this plugin on Mac OS X, everything is working
fine there too except connection lines are not visible. It's the same
code!
I can see the line decorators, but not the line itself. Moving the
source or target node changes the direction of the decorator, but still
no line. I even can select the connection - and then I see it - and can
add bendpoints, but without selection, I don't see anything. (BTW: It's
hard do select a line which is not visible ;) ) I also exported the
drawing as a JPG-image, but the lines are not visible in the exported
bitmap image. Oh.. printing isn't working at all - but the same code
can print on Windows XP.

I'm using the same GEF and Eclipse versions on both systems (3.0.1).
I'm pretty sure that it worked on Mac OS X, but I can't tell what I've
changed since. Maybe I have installed a new Java update (1.4.2b or
something like that..., the current version is 1.4.2_05). I have
written another small editor and this one displays the connection
lines. Do you have any ideas?

Since I can see the decorators, it's not a layer problem. This is my
connection figure:

public class GeneralizationFigure extends PolylineConnection {
public GeneralizationFigure() {
setLineStyle(SWT.LINE_SOLID);
setLineWidth(1);

PolygonDecoration dec = new PolygonDecoration();
PointList decPointList = new PointList();
decPointList.addPoint(0,0);
decPointList.addPoint(-87,-50);
decPointList.addPoint(-87, 50);
dec.setScale(0.1, 0.1);
dec.setTemplate(decPointList);
dec.setBackgroundColor(ColorConstants.white);

setTargetDecoration(dec);
setConnectionRouter(new BendpointConnectionRouter());
}
}

The decoration is visible, but not the line. I also tried another
router (none), but this doesn't help. Also I tried to draw a thicker
line (setLineWidth(3), but this didn't helped neither. Since it's
working with Windows XP, I assume it's a Mac OS X /SWT problem. Maybe
this is the wrong place for this kind of problem. But I hope that there
are some OS X users here, too. Is there a special OS X - SWT newsgroup?

Jens
Re: Can't see connections with Mac OS X [message #171323 is a reply to message #171036] Fri, 11 March 2005 05:30 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Try setting the polyline's foreground color.

"Jens v. P." <usenet@jevopi.de> wrote in message
news:d0l4j5$ean$1@www.eclipse.org...
> I have a strange problem with connections. I've implemented a GEF based
> editor as an Eclipse plugin using Windows XP. Everything is working
> fine there. Now I tested this plugin on Mac OS X, everything is working
> fine there too except connection lines are not visible. It's the same
> code!
> I can see the line decorators, but not the line itself. Moving the
> source or target node changes the direction of the decorator, but still
> no line. I even can select the connection - and then I see it - and can
> add bendpoints, but without selection, I don't see anything. (BTW: It's
> hard do select a line which is not visible ;) ) I also exported the
> drawing as a JPG-image, but the lines are not visible in the exported
> bitmap image. Oh.. printing isn't working at all - but the same code
> can print on Windows XP.
>
> I'm using the same GEF and Eclipse versions on both systems (3.0.1).
> I'm pretty sure that it worked on Mac OS X, but I can't tell what I've
> changed since. Maybe I have installed a new Java update (1.4.2b or
> something like that..., the current version is 1.4.2_05). I have
> written another small editor and this one displays the connection
> lines. Do you have any ideas?
>
> Since I can see the decorators, it's not a layer problem. This is my
> connection figure:
>
> public class GeneralizationFigure extends PolylineConnection {
> public GeneralizationFigure() {
> setLineStyle(SWT.LINE_SOLID);
> setLineWidth(1);
>
> PolygonDecoration dec = new PolygonDecoration();
> PointList decPointList = new PointList();
> decPointList.addPoint(0,0);
> decPointList.addPoint(-87,-50);
> decPointList.addPoint(-87, 50);
> dec.setScale(0.1, 0.1);
> dec.setTemplate(decPointList);
> dec.setBackgroundColor(ColorConstants.white);
>
> setTargetDecoration(dec);
> setConnectionRouter(new BendpointConnectionRouter());
> }
> }
>
> The decoration is visible, but not the line. I also tried another
> router (none), but this doesn't help. Also I tried to draw a thicker
> line (setLineWidth(3), but this didn't helped neither. Since it's
> working with Windows XP, I assume it's a Mac OS X /SWT problem. Maybe
> this is the wrong place for this kind of problem. But I hope that there
> are some OS X users here, too. Is there a special OS X - SWT newsgroup?
>
> Jens
>
Re: Can't see connections with Mac OS X [message #171383 is a reply to message #171036] Fri, 11 March 2005 15:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Are your lines painting using XOR? XOR doesn't work on the Mac.
Re: Can't see connections with Mac OS X [message #171490 is a reply to message #171383] Sun, 13 March 2005 12:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: usenet.jevopi.de

On 2005-03-11 16:42:33 +0100, "Randy Hudson" <none@us.ibm.com> said:

> Are your lines painting using XOR? XOR doesn't work on the Mac.

No.


On 2005-03-11 06:30:11 +0100, "Pratik Shah" <ppshah@us.ibm.com> said:

> Try setting the polyline's foreground color.

I tried that without success.


I'm going to examine that in detail next week.

Jens
Re: Can't see connections with Mac OS X [message #171775 is a reply to message #171036] Mon, 14 March 2005 22:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

SWT is not rendering line width == 0 correctly on the Mac. The selection
editpolicy sets the linewidth to 0 when it is not selected. You can select
the connection using the "/" key
Re: Can't see connections with Mac OS X [message #171923 is a reply to message #171775] Tue, 15 March 2005 18:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: usenet.jevopi.de

On 2005-03-14 23:07:15 +0100, "Randy Hudson" <none@us.ibm.com> said:

> SWT is not rendering line width == 0 correctly on the Mac. The
> selection editpolicy sets the linewidth to 0 when it is not selected.
> You can select the connection using the "/" key

Hmm.. IMHO a line with line width == 0 should be invisible...

But I'm setting the line width to 1 in the constructor of my subclassed
PolylineConnection:

public class GeneralizationFigure extends PolylineConnection {
public GeneralizationFigure() {
setLineStyle(SWT.LINE_SOLID);
setLineWidth(1);
...

Does the editpolicy change that setting even if the connection is never
selected?

Jens
Re: Can't see connections with Mac OS X [message #172069 is a reply to message #171923] Wed, 16 March 2005 05:33 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=88059

Yes, the EditPolicy updates the selection state/feedback as soon as it is
activated.

On all platforms other than Mac, lineWidth of 0 means the actual width is 1
pixel, with no scaling...while a width of 1 means the line would get thicker
as you zoom in.

"Jens v. P." <usenet@jevopi.de> wrote in message
news:d17ad5$mij$1@www.eclipse.org...
> On 2005-03-14 23:07:15 +0100, "Randy Hudson" <none@us.ibm.com> said:
>
> > SWT is not rendering line width == 0 correctly on the Mac. The
> > selection editpolicy sets the linewidth to 0 when it is not selected.
> > You can select the connection using the "/" key
>
> Hmm.. IMHO a line with line width == 0 should be invisible...
>
> But I'm setting the line width to 1 in the constructor of my subclassed
> PolylineConnection:
>
> public class GeneralizationFigure extends PolylineConnection {
> public GeneralizationFigure() {
> setLineStyle(SWT.LINE_SOLID);
> setLineWidth(1);
> ...
>
> Does the editpolicy change that setting even if the connection is never
> selected?
>
> Jens
>
Previous Topic:connections problem
Next Topic:Figure selection in a ViewPart
Goto Forum:
  


Current Time: Thu Mar 28 08:28:34 GMT 2024

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

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

Back to the top