Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Dynamic Colour change on Node
Dynamic Colour change on Node [message #123330] Wed, 02 May 2007 08:12 Go to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Hi,

I like a node with no connections to be say red boarded BUT once a
connection is made from it I would like it to change to grey.

Any help would be great (even if its - stu this is not possible),

Stu
Re: Dynamic Colour change on Node [message #126903 is a reply to message #123330] Wed, 16 May 2007 23:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

I guess that means no knows how to do this one :-)

Ok maybe put it another way.

I want to highlight when a node is a leaf node (no connections FROM) and it
changes if a FROM connection is created.

Has anyone done anything around this area ?

Stu

"Stu" <evaandoli@dodo.com.au> wrote in message
news:f19v7f$25i$1@build.eclipse.org...
> Hi,
>
> I like a node with no connections to be say red boarded BUT once a
> connection is made from it I would like it to change to grey.
>
> Any help would be great (even if its - stu this is not possible),
>
> Stu
>
Re: Dynamic Colour change on Node [message #127376 is a reply to message #126903] Fri, 18 May 2007 14:34 Go to previous messageGo to next message
Eclipse UserFriend
Stu,

Take a look at ShapeNodeEditPart.handleNotificationEvent(Notification
notification). You'll set that when connections are added or removed
you will receive notification in this method and refresh the
source/target connections. I suggest you hook into this and figure out
if you have any connections remaining and then set the background color
of your shape's figure.

Regards,
Cherie

Stu wrote:
> I guess that means no knows how to do this one :-)
>
> Ok maybe put it another way.
>
> I want to highlight when a node is a leaf node (no connections FROM) and it
> changes if a FROM connection is created.
>
> Has anyone done anything around this area ?
>
> Stu
>
> "Stu" <evaandoli@dodo.com.au> wrote in message
> news:f19v7f$25i$1@build.eclipse.org...
>> Hi,
>>
>> I like a node with no connections to be say red boarded BUT once a
>> connection is made from it I would like it to change to grey.
>>
>> Any help would be great (even if its - stu this is not possible),
>>
>> Stu
>>
>
>
<solved>Re: Dynamic Colour change on Node [message #130503 is a reply to message #127376] Sun, 27 May 2007 11:49 Go to previous message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Thought I'd post the code that I used in teh end to solve this issue. Maybe
it might help someone else:-
The code is implemented in the <NodeYou WishToBeDynamic>EditPart in the
diagram project. It overrides a super class method.



protected void refreshSourceConnections() {

super.refreshSourceConnections();

if
(((ActionNodeImpl)((NodeImpl)getModel()).getElement()).getWh ereNextConnection()==null)
{

getContentPane().setForegroundColor(new Color(null, 255, 150, 150));

} else {

getContentPane().setForegroundColor(null);

}

}


"Cherie Revells" <crevells@ca.ibm.com> wrote in message
news:f2krlc$nsh$1@build.eclipse.org...
> Stu,
>
> Take a look at ShapeNodeEditPart.handleNotificationEvent(Notification
> notification). You'll set that when connections are added or removed you
> will receive notification in this method and refresh the source/target
> connections. I suggest you hook into this and figure out if you have any
> connections remaining and then set the background color of your shape's
> figure.
>
> Regards,
> Cherie
>
> Stu wrote:
>> I guess that means no knows how to do this one :-)
>>
>> Ok maybe put it another way.
>>
>> I want to highlight when a node is a leaf node (no connections FROM) and
>> it changes if a FROM connection is created.
>>
>> Has anyone done anything around this area ?
>>
>> Stu
>>
>> "Stu" <evaandoli@dodo.com.au> wrote in message
>> news:f19v7f$25i$1@build.eclipse.org...
>>> Hi,
>>>
>>> I like a node with no connections to be say red boarded BUT once a
>>> connection is made from it I would like it to change to grey.
>>>
>>> Any help would be great (even if its - stu this is not possible),
>>>
>>> Stu
>>>
>>
Previous Topic:Changing the colour of a node
Next Topic:How can I render a figure like Rational Rose style?
Goto Forum:
  


Current Time: Sat Jul 19 07:53:41 EDT 2025

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

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

Back to the top