Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Once again: How to change the color of a polyline connection
Once again: How to change the color of a polyline connection [message #134127] Tue, 25 May 2004 18:15 Go to next message
Eclipse UserFriend
Originally posted by: Alexander.Eiken.post.rwth-aachen.de

Hello,

once again I have to ask the question how to change the color of a
polyline connection. I know there have been several threads about this
topic, but everything I read about this hasn't solved the problem.

All polyline connections are drawn in a gray color, but the decorations
of the polyline have the correct color. It seems to be a general
problem, because I have the same problem with ellipse figures.

I tried to set the color of the connection only once and I did it in the
method refreshVisuals() of the EditPart.

I extend the class PolylineConnection in order to add some decorations
and a label to a polyline. May this be the problem?

Any suggestions would be appreciated.

Thanks, Alexander.
Re: Once again: How to change the color of a polyline connection [message #134155 is a reply to message #134127] Tue, 25 May 2004 20:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Figures.setForegroundColor(color);

"Alexander Eiken" <Alexander.Eiken@post.rwth-aachen.de> wrote in message
news:c90238$9gl$1@eclipse.org...
> Hello,
>
> once again I have to ask the question how to change the color of a
> polyline connection. I know there have been several threads about this
> topic, but everything I read about this hasn't solved the problem.
>
> All polyline connections are drawn in a gray color, but the decorations
> of the polyline have the correct color. It seems to be a general
> problem, because I have the same problem with ellipse figures.
>
> I tried to set the color of the connection only once and I did it in the
> method refreshVisuals() of the EditPart.
>
> I extend the class PolylineConnection in order to add some decorations
> and a label to a polyline. May this be the problem?
>
> Any suggestions would be appreciated.
>
> Thanks, Alexander.
Re: Once again: How to change the color of a polyline connection [message #134363 is a reply to message #134155] Wed, 26 May 2004 07:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Alexander.Eiken.post.rwth-aachen.de

Randy Hudson schrieb:
> Figures.setForegroundColor(color);
>

I know. But this doesn't work for my subclass of PolylineConnection. The
subclass is simple and jeust adds some decorations and a label to the
connection. The line doesn't change the color, even if I put the code of
the subclass in comments.

If I use just a PolylineConnection, the line has the correct color.

What might be the problem, when I extend PolylineConnection?
Am I allowed to extend PolylineConnection?

Thanks, Alexander.
Re: Once again: How to change the color of a polyline connection [message #134387 is a reply to message #134363] Wed, 26 May 2004 12:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

I have tried something similar here for me and it works here, the line =

changes its color...that's strange it doesn't work for you...
I have a subclass of PolylineConnection like you and I set the foregroun=
d =

color in the constructor.

Maybe you could try to make some tests like overriding the outline (?) =

method like that
public void outline(Graphics g)
{
System.out.println(g.getForegroundColor());
super.outline(g);
}
just to see wich color is really used by the Graphics object to paint th=
e =

line ?
If it is not the one you choosed, probably the method getForegroundColor=
() =

called on the subclass of polylineconnection doesn't return the good =

color, so you could search in that direction...and if it is the one you =
=

choose...then I don't know...call an exorcist :D !

good luck,

r=E9gis

On Wed, 26 May 2004 09:19:12 +0200, Alexander Eiken =

<Alexander.Eiken@post.rwth-aachen.de> wrote:

> Randy Hudson schrieb:
>> Figures.setForegroundColor(color);
>>
>
> I know. But this doesn't work for my subclass of PolylineConnection. T=
he =

> subclass is simple and jeust adds some decorations and a label to the =
=

> connection. The line doesn't change the color, even if I put the code =
of =

> the subclass in comments.
>
> If I use just a PolylineConnection, the line has the correct color.
>
> What might be the problem, when I extend PolylineConnection?
> Am I allowed to extend PolylineConnection?
>
> Thanks, Alexander.
>



-- =

Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Re: Once again: How to change the color of a polyline connection [message #134397 is a reply to message #134387] Wed, 26 May 2004 14:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Alexander.Eiken.post.rwth-aachen.de

Hi, regis!

Thanks for your idea. I finally solved the problem!!!

The graphics object had indeed the wrong foreground color. So I added a
call g.setForegroundColor() with the correct color and now it works...

Alexander

rlemaigr@ulb.ac.be schrieb:
> I have tried something similar here for me and it works here, the line
> changes its color...that's strange it doesn't work for you...
> I have a subclass of PolylineConnection like you and I set the
> foreground color in the constructor.
>
> Maybe you could try to make some tests like overriding the outline (?)
> method like that
> public void outline(Graphics g)
> {
> System.out.println(g.getForegroundColor());
> super.outline(g);
> }
> just to see wich color is really used by the Graphics object to paint
> the line ?
> If it is not the one you choosed, probably the method
> getForegroundColor() called on the subclass of polylineconnection
> doesn't return the good color, so you could search in that
> direction...and if it is the one you choose...then I don't know...call
> an exorcist :D !
>
> good luck,
>
> régis
Re: Once again: How to change the color of a polyline connection [message #134419 is a reply to message #134397] Wed, 26 May 2004 15:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Ok !
But that's still very strange...

A similar problem is I can't set at the same time the style AND the widt=
h =

of a polyline.
For example, I can't get a bold and dash polyline.
I write in the constructor of my subclass of PolylineConnection:
....
this.setLineWidth(2);
this.setLineStyle(SWT.LINE_DOT);
....
but it doesn't work.
It seems that this two lines can't stand each other !
Psychology of code lines is something strange, sometimes...they have =

feelings too, you know...

r=E9gis

On Wed, 26 May 2004 16:15:07 +0200, Alexander Eiken =

<Alexander.Eiken@post.rwth-aachen.de> wrote:

> Hi, regis!
>
> Thanks for your idea. I finally solved the problem!!!
>
> The graphics object had indeed the wrong foreground color. So I added =
a =

> call g.setForegroundColor() with the correct color and now it works...=

>
> Alexander
>
> rlemaigr@ulb.ac.be schrieb:
>> I have tried something similar here for me and it works here, the lin=
e =

>> changes its color...that's strange it doesn't work for you...
>> I have a subclass of PolylineConnection like you and I set the =

>> foreground color in the constructor.
>> Maybe you could try to make some tests like overriding the outline =

>> (?) method like that
>> public void outline(Graphics g)
>> {
>> System.out.println(g.getForegroundColor());
>> super.outline(g);
>> }
>> just to see wich color is really used by the Graphics object to paint=
=

>> the line ?
>> If it is not the one you choosed, probably the method =

>> getForegroundColor() called on the subclass of polylineconnection =

>> doesn't return the good color, so you could search in that =

>> direction...and if it is the one you choose...then I don't know...ca=
ll =

>> an exorcist :D !
>> good luck,
>> r=E9gis



-- =

Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Re: Once again: How to change the color of a polyline connection [message #134458 is a reply to message #134419] Wed, 26 May 2004 16:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

It's not as strange as you think..
https://bugs.eclipse.org/bugs/show_bug.cgi?id=4853

Feel free to vote.

<rlemaigr@ulb.ac.be> wrote in message
news:opr8l3y5sxxn9g2u@xn--pcrgis-dva.mshome.net...
Ok !
But that's still very strange...

A similar problem is I can't set at the same time the style AND the width
of a polyline.
For example, I can't get a bold and dash polyline.
I write in the constructor of my subclass of PolylineConnection:
....
this.setLineWidth(2);
this.setLineStyle(SWT.LINE_DOT);
....
but it doesn't work.
It seems that this two lines can't stand each other !
Psychology of code lines is something strange, sometimes...they have
feelings too, you know...

r
Re: Once again: How to change the color of a polyline connection [message #134496 is a reply to message #134458] Wed, 26 May 2004 16:56 Go to previous message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Ok so that's a known bug...thank you for your link...
I don't exactly know what it means to vote for it but I did it (I guess =
it =

increases the priority of the bug)...

r=E9gis


On Wed, 26 May 2004 11:18:43 -0500, Whitney Sorenson <none@us.ibm.com> =

wrote:

> It's not as strange as you think..
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D4853
>
> Feel free to vote.
>
> <rlemaigr@ulb.ac.be> wrote in message
> news:opr8l3y5sxxn9g2u@xn--pcrgis-dva.mshome.net...
> Ok !
> But that's still very strange...
>
> A similar problem is I can't set at the same time the style AND the wi=
dth
> of a polyline.
> For example, I can't get a bold and dash polyline.
> I write in the constructor of my subclass of PolylineConnection:
> ...
> this.setLineWidth(2);
> this.setLineStyle(SWT.LINE_DOT);
> ...
> but it doesn't work.
> It seems that this two lines can't stand each other !
> Psychology of code lines is something strange, sometimes...they have
> feelings too, you know...
>
> r=E9gis
>
> On Wed, 26 May 2004 16:15:07 +0200, Alexander Eiken
> <Alexander.Eiken@post.rwth-aachen.de> wrote:
>
>> Hi, regis!
>>
>> Thanks for your idea. I finally solved the problem!!!
>>
>> The graphics object had indeed the wrong foreground color. So I added=
a
>> call g.setForegroundColor() with the correct color and now it works..=
..
>>
>> Alexander
>>
>> rlemaigr@ulb.ac.be schrieb:
>>> I have tried something similar here for me and it works here, the li=
ne
>>> changes its color...that's strange it doesn't work for you...
>>> I have a subclass of PolylineConnection like you and I set the
>>> foreground color in the constructor.
>>> Maybe you could try to make some tests like overriding the outline
>>> (?) method like that
>>> public void outline(Graphics g)
>>> {
>>> System.out.println(g.getForegroundColor());
>>> super.outline(g);
>>> }
>>> just to see wich color is really used by the Graphics object to pain=
t
>>> the line ?
>>> If it is not the one you choosed, probably the method
>>> getForegroundColor() called on the subclass of polylineconnection
>>> doesn't return the good color, so you could search in that
>>> direction...and if it is the one you choose...then I don't know...c=
all
>>> an exorcist :D !
>>> good luck,
>>> r=E9gis
>
>
>



-- =

Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Previous Topic:Label + DirectEdit
Next Topic:HelloGef example
Goto Forum:
  


Current Time: Sat Apr 27 01:14:03 GMT 2024

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

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

Back to the top