Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Add min/max handle to node with compartment
Add min/max handle to node with compartment [message #150847] Fri, 14 September 2007 18:11 Go to next message
Eclipse UserFriend
Originally posted by: arvinder.birdi.ca.com

We have nested diagram nodes with compartments. I’m trying to create a
minimize/maximize handle for our diagram nodes. The effect should be just
like the user manually expanded the top level shape with the compartment
and stretched it to fill the visible canvas area. I would really
appreciate it if someone could guide me in the right direction.

1) Should I add the handle to the top level node which inherits from
“ShapeNodeEditPart” or should I add the handle to the compartment which
inherits from “ShapeCompartmentEditPart”. The compartment also has a
CompartmentCollapseHandle.

2) Can I reuse certain EditPolicies like ResizeableEditPolicy or
ResizableCompartmentEditPolicy with the PRIMARY_DRAG_ROLE?

3) If I don’t want the min/max state to be persisted does it make it any
easier? I’m assuming the location and size info are stored in SizeImpl and
LocationImpl notational model objects. Should I add a model object called
minimized to keep track of the state?

4) Would it be easier to add a decorator and make this a style instead? To
me the handles seem to be easy enough. The hard part is the rest of it.

5) Is there a way to determine the size of the viewable canvas?

Thanks in advance,
-Arvinder Birdi
Re: Add min/max handle to node with compartment [message #150848 is a reply to message #150847] Fri, 14 September 2007 18:43 Go to previous messageGo to next message
Nicolai Kamenzky is currently offline Nicolai KamenzkyFriend
Messages: 82
Registered: July 2009
Member
Hello Arvinder Birdi!

I can't answer your questions directly because I am lacking
knowledge. But as a matter of fact you will need to add a lot of
manual written code to your editor in order to implement a min/max
handle. None the less I think it is possible to construct what you
are looking for.
It may be beneficial to think about a different approach:
I think you want the user to be able to maximize a specific node in
order to focus on a part of the diagram. In UML jargon you give the
user different views on the same diagram. Thereto the diagram is
partitioned into more or less overlapping parts which can be viewed
and edited independently.
This diagram partitioning is also possible in GMF. You create a
different editor for each view and use them to edit different parts
of the same diagram. In your case you would have the editor you
currently have and you would add a second one which enables editing
the contents of the compartment of the node you wanted to enrich
with a min/max handle. Using the different approch the user would
double-click the node instead of maximizing it. Then a second window
opens and the contents can be edited using the second editor.
If you want to give it a try read one of my previous posts called
"Solution by diagram partitioning (Sample code available!) -
Was:...". The advantage of this approach is that you won't have to
add manual written code. But there are still some obstacles to
overcome.
Regards,
Nicolai


--

I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo
Re: Add min/max handle to node with compartment [message #151972 is a reply to message #150848] Fri, 21 September 2007 19:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arvinder.birdi.ca.com

Thanks for your reply. You have a good point. My team wants to bale able
to add more functionality in the future and this maximize is viewed as a
stepping stone!

I found out where the expand/collapse figure logic lives:
org.eclipse.gmf.runtime.draw2d.ui.internal.figures
AnimatableScrollPane.getPreferredSize(int wHint, int hHint)

-Arvinder
Re: Add min/max handle to node with compartment [message #152032 is a reply to message #151972] Mon, 24 September 2007 10:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sandip.sahoo1980.gmail.com

Hi Arvinder,

But I want to change the triangle figure which handles the collapse and
expand of the compartment,
instead of that I need to put max and min images so that it will look good
and also on the top right of the compartment.

Would you plz reflect on the above?

Regards
Sandip


"Arvinder Birdi" <arvinder.birdi@ca.com> wrote in message
news:a84f94db7c3e3cbdfccb435e81ada534$1@www.eclipse.org...
> Thanks for your reply. You have a good point. My team wants to bale able
> to add more functionality in the future and this maximize is viewed as a
> stepping stone!
>
> I found out where the expand/collapse figure logic lives:
> org.eclipse.gmf.runtime.draw2d.ui.internal.figures
> AnimatableScrollPane.getPreferredSize(int wHint, int hHint)
> -Arvinder
>
>
>
Re: Add min/max handle to node with compartment [message #152159 is a reply to message #152032] Tue, 25 September 2007 15:54 Go to previous message
Eclipse UserFriend
Originally posted by: arvinder.birdi.ca.com

To add Min/Max icons look at:
org.eclipse.gmf.runtime.diagram.ui.internal.figures.Collapse Figure.fillShape()
You also have to create your own CollapseHandle.

I had many side effects when I tried to add the handle to a compartment.
I'll try and add it to the outer node.

-Arvinder
Previous Topic:Java Application
Next Topic:More figures :)
Goto Forum:
  


Current Time: Fri Dec 27 06:22:49 GMT 2024

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

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

Back to the top