Changing background color and location's node [message #666120] |
Tue, 19 April 2011 08:22 |
nicolas h Messages: 60 Registered: February 2011 Location: Grenoble, France |
Member |
|
|
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
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03166 seconds