Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » collapse/expand nested container problem
collapse/expand nested container problem [message #151993] Fri, 24 September 2004 22:39 Go to next message
Eclipse UserFriend
Originally posted by: zenilnh.infotech.stph.net

Hi All,

I have a problem,already discussed in message
http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg0 6060.html.

The problem is stated verbatim from that message:

""""""""""""""""""""""""""""
I want to allow the application users to create scrolled containers which
can contain several nodes.The users can create connections beetween the
nodes, which can be in the
same container or in different containers.

The users can collapse/extand the containers.
When a user collapse a container, all his children (nodes) are invisible.
I have overridden the method getModelChildren() in my ContainerEditPart,
where I return an
empty list.

1 - When the user collapse a container that contain a source node, the
node is not "visible",
and the connection towards a node in another container begin into space !
I want this connection to begin on the border of my container.

2 - When the user collapse a container that contain a TARGET node, the
node is not "visible",
and the connection that begin on a node in another container finish into
space !
I want this connection to finish on the border of my container.

3 - If both containers are collapsed, I want the connection to begin on
the border of the first one
, and to finish on the border of the second.
""""""""""""""""""""""""""""

I understand the solution discussed, but it seems like a roundabout way of
doing things..
Whenver i collapse a container,got to remove all its children( and also all
the connections each of the child may have to elements in another
container).And then recalculate these connections and draw it between the
collapsed container to other containers.
Wheneve i expand a container,i got to add all its children back,remove all
conncetions,recalculte connections wrt the children
and draw it again. Doesnt this slow things down and (maybe) cause some
flickering?? Isn't there a better way of doing it??

I consider my composite figure something like a Tree wrapped in a
TreeViewer?? When i collapse a Tree,does the TreeViewer remove all the
items??
When i expand it back,does TreeViewer recreate all the items??I dont think
it does..So the TreeViewer/Tree is able to "maintain" the effect of
expansion/collapsion without actually modifying its children.. Is something
similar possible here??
If i can do something like a TreeViewer for my CompositeFigure,then i dont
have to worry about uncessearily managing its children,and all i have to
think about is recaculating connections[for which i dont think there is any
shortcuts..]

I may be wrong in my assumptions.. Can anyone clarify??

Thanks
Zenil
Re: collapse/expand nested container problem [message #152219 is a reply to message #151993] Mon, 27 September 2004 20:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This is probably the easiest way to do it. You should just try it and
address performance issues as the come up.

"Certive" <zenilnh@infotech.stph.net> wrote in message
news:cj27m1$g07$1@eclipse.org...
> Hi All,
>
> I have a problem,already discussed in message
> http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg0 6060.html.
>
> The problem is stated verbatim from that message:
>
> """"""""""""""""""""""""""""
> I want to allow the application users to create scrolled containers which
> can contain several nodes.The users can create connections beetween the
> nodes, which can be in the
> same container or in different containers.
>
> The users can collapse/extand the containers.
> When a user collapse a container, all his children (nodes) are invisible.
> I have overridden the method getModelChildren() in my ContainerEditPart,
> where I return an
> empty list.
>
> 1 - When the user collapse a container that contain a source node, the
> node is not "visible",
> and the connection towards a node in another container begin into space !
> I want this connection to begin on the border of my container.
>
> 2 - When the user collapse a container that contain a TARGET node, the
> node is not "visible",
> and the connection that begin on a node in another container finish into
> space !
> I want this connection to finish on the border of my container.
>
> 3 - If both containers are collapsed, I want the connection to begin on
> the border of the first one
> , and to finish on the border of the second.
> """"""""""""""""""""""""""""
>
> I understand the solution discussed, but it seems like a roundabout way of
> doing things..
> Whenver i collapse a container,got to remove all its children( and also
all
> the connections each of the child may have to elements in another
> container).And then recalculate these connections and draw it between the
> collapsed container to other containers.
> Wheneve i expand a container,i got to add all its children back,remove all

> conncetions,recalculte connections wrt the children
> and draw it again. Doesnt this slow things down and (maybe) cause some
> flickering?? Isn't there a better way of doing it??
>
> I consider my composite figure something like a Tree wrapped in a
> TreeViewer?? When i collapse a Tree,does the TreeViewer remove all the
> items??
> When i expand it back,does TreeViewer recreate all the items??I dont think
> it does..So the TreeViewer/Tree is able to "maintain" the effect of
> expansion/collapsion without actually modifying its children.. Is
something
> similar possible here??
> If i can do something like a TreeViewer for my CompositeFigure,then i dont
> have to worry about uncessearily managing its children,and all i have to
> think about is recaculating connections[for which i dont think there is
any
> shortcuts..]
>
> I may be wrong in my assumptions.. Can anyone clarify??
>
> Thanks
> Zenil
>
>
Re: collapse/expand nested container problem [message #152230 is a reply to message #152219] Mon, 27 September 2004 23:10 Go to previous message
Eclipse UserFriend
Originally posted by: zenilnh.infotech.stph.net

Hi Randy,

Thanks for the answer.I will start doing it this way.As you said it
seems the best way.

Rgds,
Zenil

Randy Hudson wrote:

> This is probably the easiest way to do it. You should just try it and
> address performance issues as the come up.

> "Certive" <zenilnh@infotech.stph.net> wrote in message
> news:cj27m1$g07$1@eclipse.org...
> > Hi All,
> >
> > I have a problem,already discussed in message
> > http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg0 6060.html.
> >
> > The problem is stated verbatim from that message:
> >
> > """"""""""""""""""""""""""""
> > I want to allow the application users to create scrolled containers which
> > can contain several nodes.The users can create connections beetween the
> > nodes, which can be in the
> > same container or in different containers.
> >
> > The users can collapse/extand the containers.
> > When a user collapse a container, all his children (nodes) are invisible.
> > I have overridden the method getModelChildren() in my ContainerEditPart,
> > where I return an
> > empty list.
> >
> > 1 - When the user collapse a container that contain a source node, the
> > node is not "visible",
> > and the connection towards a node in another container begin into space !
> > I want this connection to begin on the border of my container.
> >
> > 2 - When the user collapse a container that contain a TARGET node, the
> > node is not "visible",
> > and the connection that begin on a node in another container finish into
> > space !
> > I want this connection to finish on the border of my container.
> >
> > 3 - If both containers are collapsed, I want the connection to begin on
> > the border of the first one
> > , and to finish on the border of the second.
> > """"""""""""""""""""""""""""
> >
> > I understand the solution discussed, but it seems like a roundabout way of
> > doing things..
> > Whenver i collapse a container,got to remove all its children( and also
> all
> > the connections each of the child may have to elements in another
> > container).And then recalculate these connections and draw it between the
> > collapsed container to other containers.
> > Wheneve i expand a container,i got to add all its children back,remove all

> > conncetions,recalculte connections wrt the children
> > and draw it again. Doesnt this slow things down and (maybe) cause some
> > flickering?? Isn't there a better way of doing it??
> >
> > I consider my composite figure something like a Tree wrapped in a
> > TreeViewer?? When i collapse a Tree,does the TreeViewer remove all the
> > items??
> > When i expand it back,does TreeViewer recreate all the items??I dont think
> > it does..So the TreeViewer/Tree is able to "maintain" the effect of
> > expansion/collapsion without actually modifying its children.. Is
> something
> > similar possible here??
> > If i can do something like a TreeViewer for my CompositeFigure,then i dont
> > have to worry about uncessearily managing its children,and all i have to
> > think about is recaculating connections[for which i dont think there is
> any
> > shortcuts..]
> >
> > I may be wrong in my assumptions.. Can anyone clarify??
> >
> > Thanks
> > Zenil
> >
> >
Previous Topic:Sharing zoom action between different editors
Next Topic:Does GEF support a hierarchical layout of nested subgraphs?
Goto Forum:
  


Current Time: Fri Apr 26 14:52:03 GMT 2024

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

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

Back to the top