Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Is it possible to show different nodefigures for one element?
Is it possible to show different nodefigures for one element? [message #82098] Fri, 01 December 2006 11:58 Go to next message
Eclipse UserFriend
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 16:33 Go to previous message
Eclipse UserFriend
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
Previous Topic:Persisting gmf model in rdb
Next Topic:Canvas Link Mapping from Node (Child Reference)
Goto Forum:
  


Current Time: Sat Oct 19 10:53:12 GMT 2024

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

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

Back to the top