Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Custom Figure with simple label under the figure
Custom Figure with simple label under the figure [message #149481] Fri, 07 September 2007 21:28 Go to next message
Eclipse UserFriend
I have created a custom figure and I want it to have a label positioned
directly beneath the custom figure. I don't want the user to be able to
move the label by itself. I would like the label to travel with the figure
if the figure is moved. Essentially, I want the figure and the label to
be treated as a single unit. Dragging the text will also drag the custom
figure and vice versa. It would even be sufficient to be able to drag the
custom figure only if it would still move the label. I also need to have
the custom figure and the text centered.

Is there any way to accomplish this? It seems like a pretty common
requirement but I can't get it to work that way.
Re: Custom Figure with simple label under the figure [message #149695 is a reply to message #149481] Mon, 10 September 2007 08:02 Go to previous message
Eclipse UserFriend
Hello Jay,

To solve the issue of movement of the labels you may take the following
approach :

If you see the LabelEditpart you would find that for the
EditPolicy.PRIMARY_DRAG_ROLE is installed the policy
NonResizableLabelEditPolicy().

All you need to do is make your own editPolicy that extends the
NonResizableLabelEditPolicy override the method getMoveCommand() in the
following manner and then install it in your Labeleditpart -

protected Command getMoveCommand(ChangeBoundsRequest request) {
return UnexecutableCommand.Instance;
}

I hope this should fix the problem.

cheers,
-Arpit
Previous Topic:[Announce][Epsilon] Prototype tool support for user-defined wizards in GMF-based editors
Next Topic:rearrange nodes in compartment
Goto Forum:
  


Current Time: Mon Sep 15 13:24:50 EDT 2025

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

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

Back to the top