Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » polyline connection color
polyline connection color [message #153373] Thu, 04 October 2007 08:52 Go to next message
Eclipse UserFriend
Originally posted by: 14.08.99.gmx.de

Hi,

I want to change the color of a polyline connection, but it doesn't work
the 2 ways I tried (wich I found in former posts of this ng):
- adding an "Foreground Color RGB Color" to the Figure Descriptor in the
*.gmfgraph
- adding the code snippet below to the <MyPolyline>ViewFactory-Class
***
LineStyle lineStyle = (LineStyle)
view.getStyle(NotationPackage.Literals.LINE_STYLE);
if (lineStyle != null) {
lineStyle.setLineColor(FigureUtilities.RGBToInteger(
new RGB(255, 0, 0)).intValue());
}
***
Maybe it's bcause I'm new ;)
I'm using Eclipse 3.3, GMF Europa 2.0.0.

Regards,
Guido
Re: polyline connection color [message #153469 is a reply to message #153373] Thu, 04 October 2007 13:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jakub.jurkiewicz.gmail.com

Hi Guido,

I tried the first way you described (and which I think that is better)
and it worked well.
Remember that after changing the gmfgraph file, you have to regenerate
the generatol model (gmfgen) and (later) regenerate the diagram code.

Hope this helps,
Jakub Jurkiewicz
http://eclipser-blog.blogspot.com/

Guido Schwab pisze:
> Hi,
>
> I want to change the color of a polyline connection, but it doesn't work
> the 2 ways I tried (wich I found in former posts of this ng):
> - adding an "Foreground Color RGB Color" to the Figure Descriptor in the
> *.gmfgraph
> - adding the code snippet below to the <MyPolyline>ViewFactory-Class
> ***
> LineStyle lineStyle = (LineStyle)
> view.getStyle(NotationPackage.Literals.LINE_STYLE);
> if (lineStyle != null) {
> lineStyle.setLineColor(FigureUtilities.RGBToInteger(
> new RGB(255, 0, 0)).intValue());
> }
> ***
> Maybe it's bcause I'm new ;)
> I'm using Eclipse 3.3, GMF Europa 2.0.0.
>
> Regards,
> Guido
Re: polyline connection color [message #153492 is a reply to message #153469] Thu, 04 October 2007 14:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 14.08.99.gmx.de

Hi,

I regenerated both (gmfgen and diagram code).
I wonder about the background-thing, because this works the way I
expected it. But this doesn't change the color of the connection (junst
the decoration). So there has to be another problem with it.

This is the part of the gmfgraph:
********
<descriptors
name="MyPolylineConnectionFigure">
<actualFigure
xsi:type="gmfgraph:PolylineConnection"
name="MyPolylineConnectionFigure">
<foregroundColor
xsi:type="gmfgraph:RGBColor"
red="255"/>
<targetDecoration
xsi:type="gmfgraph:PolylineDecoration"

href=" ../../../plugin/org.eclipse.gmf.graphdef/models/classDiagram .gmfgraph#//@figures.0/@figures.2 "/>
</actualFigure>
</descriptors>
********
I tried it without decoration but still no effect...

Regards,
Guido
Re: polyline connection color [message #153751 is a reply to message #153373] Fri, 05 October 2007 11:33 Go to previous message
Eclipse UserFriend
Originally posted by: 14.08.99.gmx.de

Solution:

"-c" as runtime-arg...

D'oh!
Previous Topic:Proper Way To Hook Into Event Model
Next Topic:how to add copy paste action to the context menu
Goto Forum:
  


Current Time: Sat Aug 17 11:35:29 GMT 2024

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

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

Back to the top