Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Changing figures at runtime
Changing figures at runtime [message #189097] Mon, 25 July 2005 18:26 Go to next message
Eclipse UserFriend
Originally posted by: rmeschi.us.ibm.com

Hi Guys,

I have a model that can be rendered in both a collapsed and an
un-collapsed state. In a collapsed state, the model looks like a single
node (similar to the Or Gate in the logic example). When un-collapsed, it
looks like a border with other nodes contained within it (similar to the
Circuit Node in the logic example). Does anyone know how to do this?
Please note that it may be a better idea to create a new edit part for
each, as the two nodes behave differently....but if I simply try to
refresh, gef will recognize that the specified model already has an edit
part and not bother to create a new one.


thanks in advance,
-Rouben Meschian
Re: Changing figures at runtime [message #189120 is a reply to message #189097] Mon, 25 July 2005 18:42 Go to previous message
Eclipse UserFriend
Originally posted by: zx.us.ibm.com

Did something like this a couple of weeks ago.

1) Attatch mouse listener to the figure that represents the +/-
....
private MouseListener mouseListener = new MouseListener() {

public void mousePressed(MouseEvent me) {
handleActionPerformed(me);
}
....

2) Based on the action of that figured, create convenience methods to
show/hide content. This requires a wrapper figure that holds the
contents. The contents consist of a root compartment that holds other
compartments. When you hide, remove the root compartment, when you show
toss it back in. make sure to revalidate() when doing so.

It would be fantastic if we had a repository of reusable editparts, like
a GEF Corner (similar to EMF corner).

I feel like people are recreating functionality everywhere.

Cheers,

~ Chris
Previous Topic:Rulers & Guides- how long will they be internal?
Next Topic:Moving a Figure, Resizing Its Parent
Goto Forum:
  


Current Time: Thu Apr 25 13:03:13 GMT 2024

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

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

Back to the top