Is it possible to show different nodefigures for one element? [message #82098] |
Fri, 01 December 2006 06:58  |
Eclipse User |
|
|
|
Originally posted by: snej_NO-SPAM_.esuark.de
Hi there,
i would like to show a checkbox node figure which shows the state
specified in the model. So if the attribute "checked" in the model is
true, i want to show a checked checkbox otherwise an unchecked one.
Is this possible? I currently change the position information in the
model if the graph node is moved, so the other direction must also be
possible, isn't it? Is there something like the
handleNotificationEvent() method where i could shange the figure if the
state changes?
regards
jens
|
|
|
Re: Is it possible to show different nodefigures for one element? [message #82143 is a reply to message #82098] |
Fri, 01 December 2006 11:33  |
Eclipse User |
|
|
|
Originally posted by: jan.herriger.gmx.de
Hi Jens,
my Editor shows different images for "Process" nodes, depending on
"ProcessType". In the corresponding edit part's figure, I set the image
path depending on the process type (it's an attribute of the semantic
element).
To get the image updated on type changes, the edit part notifies the
parent edit part like this:
#####
handleNotificationEvent(Notification notification) {
if (notification.getFeature().equals(
OrgmlProcessPackage.eINSTANCE.getProcess_Type())
{
((ProcessDiagramEditPart) getParent()).notifyChanged(notification);
}
....
#####
The parent edit part handles this notification like this:
###
protected void handleNotificationEvent(Notification notification) {
if (notification.getFeature().equals(
OrgmlProcessPackage.eINSTANCE.getProcess_Type()
{
refreshChild((GraphicalEditPart) findEditPart(this,
(EObject) notification.getNotifier()));
} else
super.handleNotificationEvent(notification);
}
###
Jens Krause schrieb:
> Hi there,
>
> i would like to show a checkbox node figure which shows the state
> specified in the model. So if the attribute "checked" in the model is
> true, i want to show a checked checkbox otherwise an unchecked one.
>
> Is this possible? I currently change the position information in the
> model if the graph node is moved, so the other direction must also be
> possible, isn't it? Is there something like the
> handleNotificationEvent() method where i could shange the figure if the
> state changes?
>
> regards
> jens
|
|
|
Powered by
FUDForum. Page generated in 0.08253 seconds