Can't see connections with Mac OS X [message #171036] |
Tue, 08 March 2005 21:12 |
Eclipse User |
|
|
|
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 |
Pratik Shah 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 #171923 is a reply to message #171775] |
Tue, 15 March 2005 18:41 |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.02112 seconds