Dynamic Colour change on Node [message #123330] |
Wed, 02 May 2007 08:12  |
Eclipse User |
|
|
|
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
|
|
|
|
|
<solved>Re: Dynamic Colour change on Node [message #130503 is a reply to message #127376] |
Sun, 27 May 2007 11:49  |
Eclipse User |
|
|
|
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
>>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03804 seconds