Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » CircuitFigure Logic Editor question
CircuitFigure Logic Editor question [message #58361] Mon, 27 January 2003 14:32 Go to next message
Eclipse User
Originally posted by: oro7d3.netscape.net

In the CircuitFigure of the Logic Editor, it has a pane (for the content
pane) and then there is a scrollpane (a child of the CircuitFigure). Can
someone please tell me Why there are 2 panes? and why they use different
layout? one is FreeFormLayout() and one is StackLayout()?

And when I add more figure to the CiruitFigure, how come it can add scroll
bar automatically?It is based on the size of the ScrollPane or the Panel?
How does the ScrollPanel know if it needs to add scroll bar or not?

Thank you.

ScrollPane scrollpane = new ScrollPane();

pane = new FreeformLayer();

pane.setLayoutManager(new FreeformLayout());

setLayoutManager(new StackLayout());

add(scrollpane);

scrollpane.setViewport(new FreeformViewport());

scrollpane.setView(pane);
Re: CircuitFigure Logic Editor question [message #59450 is a reply to message #58361] Wed, 29 January 2003 11:27 Go to previous message
Eclipse User
Originally posted by: none.us.ibm.com

"oro" <oro7d3@netscape.net> wrote in message
news:b140a7$i9d$1@rogue.oti.com...
> In the CircuitFigure of the Logic Editor, it has a pane (for the content
> pane) and then there is a scrollpane (a child of the CircuitFigure). Can
> someone please tell me Why there are 2 panes? and why they use different
> layout? one is FreeFormLayout() and one is StackLayout()?

It is possible to implement CircuitFigure by subclassing ScrollPane.
CircuitFigure is a simple figure containing the circuit's border, with a
Scrollpane positioned inside that border. StackLayout is the layout that
places a child inside its parent such that it fills the "clientArea". (the
region inside the border).

>
> And when I add more figure to the CiruitFigure, how come it can add scroll
> bar automatically?It is based on the size of the ScrollPane or the Panel?
> How does the ScrollPanel know if it needs to add scroll bar or not?

By asking the Viewport its preferredSize(), which in turn asks its contents
for its preferredSize. The contentPane is in XYLayout (FreeformLayout), and
XYLayout calculates preferred size correctly by unioning all of the
Rectangle constraints.

>
> Thank you.
>
> ScrollPane scrollpane = new ScrollPane();
>
> pane = new FreeformLayer();
>
> pane.setLayoutManager(new FreeformLayout());
>
> setLayoutManager(new StackLayout());
>
> add(scrollpane);
>
> scrollpane.setViewport(new FreeformViewport());
>
> scrollpane.setView(pane);
>
>
Previous Topic:Scroll Bar in logic Editor example
Next Topic:Cannot add figures to my application
Goto Forum:
  


Current Time: Sat Apr 19 18:52:26 EDT 2014

Powered by FUDForum. Page generated in 0.01596 seconds