Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Different colours for nodes
Different colours for nodes [message #204109] Mon, 01 September 2008 12:27 Go to next message
Eclipse UserFriend
Originally posted by: thomasgrimson.yahoo.com

Hello,

Say I've got only one type of node (e.g. a rectangle), and I want each
rectangle that I place on the editor to have a specific colour:

- say I've got 10 colours and I can place up to 10 nodes on the diagram-
is it possible 1st node to be 1st colour, 2nd node to be 2nd colour, etc?

- if yes, a more complicated case: I've got 10 colours and more than 10
nodes- is it possible nodes 1-10 to have colours 1-10, and then nodes
11-20 to have also colours 1-10 respectively, nodes 21-30 also colours
1-10 respectively, etc.

I can define a fixed background rectangle colour in gmpgraph, but no
constraints (or at least couldn't figure out how to), and also different
facets for the nodes, but no facets related to colour... any suggestions?

Best wishes,
Tom
Re: Different colours for nodes [message #204168 is a reply to message #204109] Tue, 02 September 2008 05:54 Go to previous message
Eclipse UserFriend
Tom wrote:
> Hello,
>
> Say I've got only one type of node (e.g. a rectangle), and I want each
> rectangle that I place on the editor to have a specific colour:

Modify (or override and provide by your custom plugged provider)
the XXXViewFactory class. In this factory put:

@Override
protected void initializeFromPreferences(View view) {
super.initializeFromPreferences(view);
... set view's colors and other attributes here...
}

Maybe you would like to use a preference page to preset those colors. As
the name says, this is a very good place to do that.

--
Greetings,
Seweryn
Previous Topic:FeedBack connection between ConnectionEditPart and LabelEditPart
Next Topic:EclipseCon 2008 code?
Goto Forum:
  


Current Time: Sat May 10 12:04:43 EDT 2025

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

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

Back to the top