Changing background color and location's node [message #666120] |
Tue, 19 April 2011 04:22  |
Eclipse User |
|
|
|
Hi there,
I need to modify background color and location's node programmatically.
To do this I found on this forum some helps. But I don't have any "ComponentImpl" and I don't know where I can find it.
Finally, I use ShapeNodeEditPart#getNodeFigure().setLocation(Point p) and setBackgroundColor(Color bg) like this :
protected void handleNotificationEvent(Notification notification) {
super.handleNotificationEvent(notification);
Point rect = new Point (100,100);
System.out.println ("change background and location");
this.getNodeFigure().setLocation(rect);
Color bgColor = new Color (null, 255,0,0);
bgColor.dispose();
this.getNodeFigure().setBackgroundColor(bgColor);
refreshBackgroundColor();
refreshChildren();
if (AmDiagramEditorUtil.dEditPart != null)
AmDiagramEditorUtil.dEditPart.refresh();
}
The handle function is executed, however, nothing happens.
Does anyone have an idea about this ?
Regards,
--
Nicolas
|
|
|
|
|
Re: Changing background color and location's node [message #687795 is a reply to message #666187] |
Thu, 23 June 2011 04:55  |
Eclipse User |
|
|
|
Hi, I need you help urgently. I have the same problem. But I can't solve it after seeing the reply. Could you tell me how to achieve it in DETAIL? Because I can't find the function or class you mentioned in the question and I don't know where I should put the code! Thank you very much.
Best Regards,
Vincent
|
|
|
Powered by
FUDForum. Page generated in 0.03403 seconds