Skip to main content



      Home
Home » Eclipse Projects » GEF » LayoutManager overview?
LayoutManager overview? [message #79194] Wed, 14 May 2003 00:09 Go to next message
Eclipse UserFriend
Originally posted by: bonevich.covad.net

Does there exist any overall overview of LayoutManagers in draw2d/gef?
Before I start slogging through source code to decodce what each mgr
does, thought I would ask first...

....and if anyone knows how to get a PageFlow figure (or BlockFlow) to
expand in size to fit the width/length of the text flows contained
therein, please tell!

jeff

--
Jeffrey Bonevich
Ann Arbor, Michigan
bonevich at covad dot net
jeff at bonevich dot com
http://www.bonevich.com

"Make me a fire and I'm warm for a night. Set me
on fire and I'm warm for the rest of my life."
- Ancient Didactical Saying
Re: LayoutManager overview? [message #79322 is a reply to message #79194] Wed, 14 May 2003 10:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Have you seen org.eclipse.draw2d.examples.TextFlowExample in the project
"org.eclipse.draw2d.examples"?

This project can be checked out via CVS anonymous connection to
dev.eclipse.org, folder "/home/tools"

"Jeffrey Bonevich" <bonevich@covad.net> wrote in message
news:b9sfp5$5ic$1@rogue.oti.com...
> Does there exist any overall overview of LayoutManagers in draw2d/gef?
> Before I start slogging through source code to decodce what each mgr
> does, thought I would ask first...
>
> ...and if anyone knows how to get a PageFlow figure (or BlockFlow) to
> expand in size to fit the width/length of the text flows contained
> therein, please tell!
>
> jeff
>
> --
> Jeffrey Bonevich
> Ann Arbor, Michigan
> bonevich at covad dot net
> jeff at bonevich dot com
> http://www.bonevich.com
>
> "Make me a fire and I'm warm for a night. Set me
> on fire and I'm warm for the rest of my life."
> - Ancient Didactical Saying
>
Re: LayoutManager overview? [message #79381 is a reply to message #79194] Wed, 14 May 2003 10:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

What is the context (parent figure) in which you are using a PageFlow.

Here is some more info. if you ask pageflow.getPreferredSize(-1, -1), the
page will extend as much as needed horizontally. Therefore, you need to put
it inside a context in which its width hint is constrained.

"Jeffrey Bonevich" <bonevich@covad.net> wrote in message
news:b9sfp5$5ic$1@rogue.oti.com...
> Does there exist any overall overview of LayoutManagers in draw2d/gef?
> Before I start slogging through source code to decodce what each mgr
> does, thought I would ask first...
>
> ...and if anyone knows how to get a PageFlow figure (or BlockFlow) to
> expand in size to fit the width/length of the text flows contained
> therein, please tell!
>
> jeff
>
> --
> Jeffrey Bonevich
> Ann Arbor, Michigan
> bonevich at covad dot net
> jeff at bonevich dot com
> http://www.bonevich.com
>
> "Make me a fire and I'm warm for a night. Set me
> on fire and I'm warm for the rest of my life."
> - Ancient Didactical Saying
>
Re: LayoutManager overview? [message #79532 is a reply to message #79322] Wed, 14 May 2003 18:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: user.domain.invalid

Yes, I have. These examples, however, do not demonstrate the full depth
and breadth of the layouts available, nor do they replace good old
documentation. Since there is no online javadoc (that I have found so
far), I guess I just need to consult the source. If I do develop a
document, I will post it here.

jeff

Randy Hudson wrote:
> Have you seen org.eclipse.draw2d.examples.TextFlowExample in the project
> "org.eclipse.draw2d.examples"?
>
> This project can be checked out via CVS anonymous connection to
> dev.eclipse.org, folder "/home/tools"
>
> "Jeffrey Bonevich" <bonevich@covad.net> wrote in message
> news:b9sfp5$5ic$1@rogue.oti.com...
>
>>Does there exist any overall overview of LayoutManagers in draw2d/gef?
>>Before I start slogging through source code to decodce what each mgr
>>does, thought I would ask first...
>>
>>...and if anyone knows how to get a PageFlow figure (or BlockFlow) to
>>expand in size to fit the width/length of the text flows contained
>>therein, please tell!
>>
>>jeff
>>
>>--
>>Jeffrey Bonevich
>>Ann Arbor, Michigan
>>bonevich at covad dot net
>>jeff at bonevich dot com
>>http://www.bonevich.com
>>
>>"Make me a fire and I'm warm for a night. Set me
>>on fire and I'm warm for the rest of my life."
>>- Ancient Didactical Saying
>>
>
>
>
Re: LayoutManager overview? [message #79547 is a reply to message #79381] Wed, 14 May 2003 18:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: user.domain.invalid

I think I figured it out. I am adding this to a GEF editor, so it goes
in the FreeFormLayer returned by my model editpart. Did a bit more
poking around and found that if I override the setLayoutConstraint
method to always set a constraint Rectangle(x,y,-1,-1), that does the
trick too. I will try your method, but calling a getter with arguments
which apparently sets something seems counterintuitive to me. Is
getPreferredSize(int,int) supposed to mean "return the preferred size of
this figure, unless it is null in which case return Dimension(-1,-1)"?

jeff

Randy Hudson wrote:
> What is the context (parent figure) in which you are using a PageFlow.
>
> Here is some more info. if you ask pageflow.getPreferredSize(-1, -1), the
> page will extend as much as needed horizontally. Therefore, you need to put
> it inside a context in which its width hint is constrained.
>
> "Jeffrey Bonevich" <bonevich@covad.net> wrote in message
> news:b9sfp5$5ic$1@rogue.oti.com...
>
>>Does there exist any overall overview of LayoutManagers in draw2d/gef?
>>Before I start slogging through source code to decodce what each mgr
>>does, thought I would ask first...
>>
>>...and if anyone knows how to get a PageFlow figure (or BlockFlow) to
>>expand in size to fit the width/length of the text flows contained
>>therein, please tell!
>>
>>jeff
>>
>>--
>>Jeffrey Bonevich
>>Ann Arbor, Michigan
>>bonevich at covad dot net
>>jeff at bonevich dot com
>>http://www.bonevich.com
>>
>>"Make me a fire and I'm warm for a night. Set me
>>on fire and I'm warm for the rest of my life."
>>- Ancient Didactical Saying
>>
>
>
>
Re: LayoutManager overview? [message #79562 is a reply to message #79381] Wed, 14 May 2003 18:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bonevich.covad.net

I think I figured it out. I am adding this to a GEF editor, so it goes
in the FreeFormLayer returned by my model editpart. Did a bit more
poking around and found that if I override the setLayoutConstraint
method in my GraphicalEditLayer to always set a constraint
Rectangle(x,y,-1,-1), that does the trick too:

public void setLayoutConstraint(EditPart child, IFigure node, Object
constraint)
{
Rectangle rect = (Rectangle) constraint;
Rectangle newConstraint = new Rectangle(
rect.getLocation(),
new Dimension(-1,-1)
);
super.setLayoutConstraint(child, node, newConstraint);
}


I will try your method, but calling a getter with arguments which
apparently sets something seems counterintuitive to me. Is
getPreferredSize(int,int) supposed to mean "return the preferred size of
this figure, unless it is null in which case return Dimension(-1,-1)"?

Thanx for the pointers!

jeff

Randy Hudson wrote:
> What is the context (parent figure) in which you are using a PageFlow.
>
> Here is some more info. if you ask pageflow.getPreferredSize(-1, -1), the
> page will extend as much as needed horizontally. Therefore, you need to put
> it inside a context in which its width hint is constrained.
>
> "Jeffrey Bonevich" <bonevich@covad.net> wrote in message
> news:b9sfp5$5ic$1@rogue.oti.com...
>
>>Does there exist any overall overview of LayoutManagers in draw2d/gef?
>>Before I start slogging through source code to decodce what each mgr
>>does, thought I would ask first...
>>
>>...and if anyone knows how to get a PageFlow figure (or BlockFlow) to
>>expand in size to fit the width/length of the text flows contained
>>therein, please tell!
>>
>>jeff
>>
>>--
>>Jeffrey Bonevich
>>Ann Arbor, Michigan
>>bonevich at covad dot net
>>jeff at bonevich dot com
>>http://www.bonevich.com
>>
>>"Make me a fire and I'm warm for a night. Set me
>>on fire and I'm warm for the rest of my life."
>>- Ancient Didactical Saying
>>
>
>
>

--
Jeffrey Bonevich
Ann Arbor, Michigan
bonevich at covad dot net
jeff at bonevich dot com
http://www.bonevich.com

"Make me a fire and I'm warm for a night. Set me
on fire and I'm warm for the rest of my life."
- Ancient Didactical Saying
Re: LayoutManager overview? [message #79591 is a reply to message #79532] Wed, 14 May 2003 22:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

There is JavaDoc. Choose Help->Help Contents from the Workbench in which
you installed GEF.
LayoutManagers in draw2d operate the same way as layout managers in AWT.
But, the set of available choices is different.

<user@domain.invalid> wrote in message news:b9ug43$vin$1@rogue.oti.com...
> Yes, I have. These examples, however, do not demonstrate the full depth
> and breadth of the layouts available, nor do they replace good old
> documentation. Since there is no online javadoc (that I have found so
> far), I guess I just need to consult the source. If I do develop a
> document, I will post it here.
>
> jeff
>
> Randy Hudson wrote:
> > Have you seen org.eclipse.draw2d.examples.TextFlowExample in the project
> > "org.eclipse.draw2d.examples"?
> >
> > This project can be checked out via CVS anonymous connection to
> > dev.eclipse.org, folder "/home/tools"
> >
> > "Jeffrey Bonevich" <bonevich@covad.net> wrote in message
> > news:b9sfp5$5ic$1@rogue.oti.com...
> >
> >>Does there exist any overall overview of LayoutManagers in draw2d/gef?
> >>Before I start slogging through source code to decodce what each mgr
> >>does, thought I would ask first...
> >>
> >>...and if anyone knows how to get a PageFlow figure (or BlockFlow) to
> >>expand in size to fit the width/length of the text flows contained
> >>therein, please tell!
> >>
> >>jeff
> >>
> >>--
> >>Jeffrey Bonevich
> >>Ann Arbor, Michigan
> >>bonevich at covad dot net
> >>jeff at bonevich dot com
> >>http://www.bonevich.com
> >>
> >>"Make me a fire and I'm warm for a night. Set me
> >>on fire and I'm warm for the rest of my life."
> >>- Ancient Didactical Saying
> >>
> >
> >
> >
>
Re: LayoutManager overview? [message #79606 is a reply to message #79562] Wed, 14 May 2003 22:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Jeffrey Bonevich" <bonevich@covad.net> wrote in message
news:b9ugmd$vsn$1@rogue.oti.com...
> I think I figured it out. I am adding this to a GEF editor, so it goes
> in the FreeFormLayer returned by my model editpart. Did a bit more
> poking around and found that if I override the setLayoutConstraint
> method in my GraphicalEditLayer to always set a constraint
> Rectangle(x,y,-1,-1), that does the trick too:
>
> public void setLayoutConstraint(EditPart child, IFigure node, Object
> constraint)
> {
> Rectangle rect = (Rectangle) constraint;
> Rectangle newConstraint = new Rectangle(
> rect.getLocation(),
> new Dimension(-1,-1)
> );
> super.setLayoutConstraint(child, node, newConstraint);
> }
>
>
> I will try your method, but calling a getter with arguments which
> apparently sets something seems counterintuitive to me. Is

the getters don't set anything. The parent asks "try to fit within this
width", and the result says, "OK, I need this much width and height". Based
on that result, the flowpage is then given a new bounds via setBounds().
The final layout of the flowpage is based on its bounds, not on the hints.
most of time, its new bounds will match the hints passed in previously.

> getPreferredSize(int,int) supposed to mean "return the preferred size of
> this figure, unless it is null in which case return Dimension(-1,-1)"?
>
> Thanx for the pointers!
>
> jeff
>
> Randy Hudson wrote:
> > What is the context (parent figure) in which you are using a PageFlow.
> >
> > Here is some more info. if you ask pageflow.getPreferredSize(-1, -1),
the
> > page will extend as much as needed horizontally. Therefore, you need to
put
> > it inside a context in which its width hint is constrained.
> >
> > "Jeffrey Bonevich" <bonevich@covad.net> wrote in message
> > news:b9sfp5$5ic$1@rogue.oti.com...
> >
> >>Does there exist any overall overview of LayoutManagers in draw2d/gef?
> >>Before I start slogging through source code to decodce what each mgr
> >>does, thought I would ask first...
> >>
> >>...and if anyone knows how to get a PageFlow figure (or BlockFlow) to
> >>expand in size to fit the width/length of the text flows contained
> >>therein, please tell!
> >>
> >>jeff
> >>
> >>--
> >>Jeffrey Bonevich
> >>Ann Arbor, Michigan
> >>bonevich at covad dot net
> >>jeff at bonevich dot com
> >>http://www.bonevich.com
> >>
> >>"Make me a fire and I'm warm for a night. Set me
> >>on fire and I'm warm for the rest of my life."
> >>- Ancient Didactical Saying
> >>
> >
> >
> >
>
> --
> Jeffrey Bonevich
> Ann Arbor, Michigan
> bonevich at covad dot net
> jeff at bonevich dot com
> http://www.bonevich.com
>
> "Make me a fire and I'm warm for a night. Set me
> on fire and I'm warm for the rest of my life."
> - Ancient Didactical Saying
>
Re: LayoutManager overview? [message #79635 is a reply to message #79591] Thu, 15 May 2003 08:10 Go to previous message
Eclipse UserFriend
Originally posted by: bonevich.covad.net

D'oh! Missed that because I had used the version of gef that came with
Omondo's EclipseUML tool - no documentation included for gef or draw2d!
Just went and grabbed them from the regular distribution. Thanx, Randy!

jeff

Randy Hudson wrote:
> There is JavaDoc. Choose Help->Help Contents from the Workbench in which
> you installed GEF.
> LayoutManagers in draw2d operate the same way as layout managers in AWT.
> But, the set of available choices is different.
>

--
Jeffrey Bonevich
Ann Arbor, Michigan
bonevich at covad dot net
jeff at bonevich dot com
http://www.bonevich.com

"Make me a fire and I'm warm for a night. Set me
on fire and I'm warm for the rest of my life."
- Ancient Didactical Saying
Previous Topic:Draw2d documentation
Next Topic:PrinterGraphics - scale text
Goto Forum:
  


Current Time: Tue May 13 01:11:36 EDT 2025

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

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

Back to the top