Query Regarding Custom Layout [message #154323] |
Fri, 15 October 2004 20:52  |
Eclipse User |
|
|
|
Originally posted by: zenilnh.infotech.stph.net
Hi ,
I am trying to implement this feautre. I got a GEF editor containing
Collapsible containers.These containers can have other containers and leaf
elments.Take for example
RootContainer
SubContainer1[Minimized state]
LeafElement1
SubContainer11
SubContainer2..[maximized state]
LeafElement2
SubContainer21
Now when i expand SubContainer1,i want SubContainer2 to move out from its
position relative to Subcontainer1,(sort of make way for
SubContainer1),and when i collapse it Subcontainer2(along with all its
children) should come back to its position relative to SubContainer1..
Right now when i expand/collapse a container,it overlaps on other elemnts
nearby(using XYLayout now)..Can XYlayout be customized to do this
behaviour??Or should i write a custom layout??If so what should i
concentrate on??
Thanks
Zenil
|
|
|
|
Re: Query Regarding Custom Layout [message #154487 is a reply to message #154421] |
Mon, 18 October 2004 16:24   |
Eclipse User |
|
|
|
Originally posted by: zenilnh.infotech.stph.net
Hi Randy,
I need some more inputs.I have attached a screen shot explaining what i am
trying to do.
Does this specify the problem better??Now for solving this problem
should i go for a)try to customize some exisitng layouts b)creating my own
layout from scratch [if none of the existing layouts can be customized]
c)instead of using layouts,use an XYLayout,listen for expansion/collapsion
events,and try to compute the constraints and place my figures accordingly..
Thanks
Zenil
"Randy Hudson" <none@us.ibm.com> wrote in message
news:cl0shi$vtt$1@eclipse.org...
> It's hard to imagine what you want these two containers to look like, but
> you may be able to use existing layout managers. For example, the Palette
> drawers are implemented using some of the included layouts in draw2d.
> "Zenil" <zenilnh@infotech.stph.net> wrote in message
> news:ckprca$j15$1@eclipse.org...
> > Hi ,
> >
> > I am trying to implement this feautre. I got a GEF editor containing
> > Collapsible containers.These containers can have other containers and
leaf
> > elments.Take for example
> > RootContainer
> > SubContainer1[Minimized state]
> > LeafElement1
> > SubContainer11
> > SubContainer2..[maximized state]
> > LeafElement2
> > SubContainer21
> >
> > Now when i expand SubContainer1,i want SubContainer2 to move out from
its
> > position relative to Subcontainer1,(sort of make way for
> > SubContainer1),and when i collapse it Subcontainer2(along with all its
> > children) should come back to its position relative to SubContainer1..
> >
> > Right now when i expand/collapse a container,it overlaps on other
elemnts
> > nearby(using XYLayout now)..Can XYlayout be customized to do this
> > behaviour??Or should i write a custom layout??If so what should i
> > concentrate on??
> >
> > Thanks
> > Zenil
> >
>
>
Attachment: problem.GIF
(Size: 148.41KB, Downloaded 111 times)
|
|
|
|
|
|
|
Re: Query Regarding Custom Layout [message #156150 is a reply to message #155718] |
Fri, 29 October 2004 19:11  |
Eclipse User |
|
|
|
Originally posted by: zenilnh.infotech.stph.net
Hi Dhiraj and Randy,
Thanks for the inputs..Dhiraj,the ToolbarLayout solution is okey,but again
its in one direction..vertical/horizontal...
And I dont want to use CompoundedDirectedGraphLayout as i dont want to
layout things fully..And i dont want to write heavy-duty layout schemes like
FormLayout..
So here's what I am doing..As soon as user minimizes/maximizes a figure,i
based on a set of rules,recompute the positions of other figures in the
same parent.and lays it out.My goal is when u minimize,i want other figures
which are to the right/bottom of the minimized figure to "close in" near to
the mnimized figure.And when u maximize,i want figures to right/bottom to
"move out" in their respective directions if their current location
intersects with the bounds of the maximised figure..
Basically I think its just a set of computations that i should get
right,calculate each figure's initial state,each figure's final state,
pass it to the GraphAnimation routine in Flow example,and there..I get a
fantastic animated layout ..:)-[Infact i have almost achieved my goals..]
Cheers to GEF...
Rgds,
Zenil
"Randy Hudson" <none@us.ibm.com> wrote in message
news:cllph0$fgt$1@eclipse.org...
> He needs the figures to push things away in multiple directions on a
plane,
> not just in one direction such as the palette drawers.
>
> One solution might be to use a CompoundDirectedGraphLayout. But this
> wouldn't give users as much freedom to position nodes.
>
> "Dhiraj" <dhiraj@gmail.com> wrote in message
> news:clkmse$459$1@eclipse.org...
> > Hi Zenil,
> > Maybe it's a long time since you posted it. But hope it helps.
> > We had a similar requirement and we did solve it using the basic
> > ToolbarLayout provided by Draw2D. For this we extended the basic
> > Figure class (I'll call this MinimizableFigure) and overrode the
> > computeSize() method to return the size depending on it's state
> > (maximized or minimized). So the new Figure would return (0,0)
> > if it is collapsed size else the normal size.
> > So each of the figures would be instances of this
> > MinimizableFigure and when you want to collapse you would set
> > the state of the MinizimizableFigure to "Collapsed" and would
> > hide it. All the siblings at one level would be arranged using
> > ToolbarLayout vertically.
> >
> >
> > Zenil wrote:
> >
> > > Thanks Randy,
> > > Something for me to move forward with..
> >
> > > Randy Hudson wrote:
> >
> > > > That looks like a tough problem and one that I haven't seen solved.
> > Perhaps
> > > > you could use something like SWT's FormLayout. So instead of
> generating XY
> > > > constriants, you are generating attachements and offsets to nearby
> objects.
> > > > When the attachment moves, it pushes the other objects away.
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.06498 seconds