Eclipse Draw2d
2.1

org.eclipse.draw2d.text
Class FlowFigureLayout

java.lang.Object
  |
  +--org.eclipse.draw2d.AbstractLayout
        |
        +--org.eclipse.draw2d.text.FlowFigureLayout
All Implemented Interfaces:
LayoutManager
Direct Known Subclasses:
FlowContainerLayout, TextLayout

public abstract class FlowFigureLayout
extends AbstractLayout

A LayoutManager for use with FlowFigure.

WARNING: This class is not intended to be subclassed by clients.

Since:
2.1

Field Summary
protected  FlowContext context
          The flow context in which this LayoutManager exists.
protected  boolean invalid
          true if the context has changed, and a layout is needed.
 
Fields inherited from class org.eclipse.draw2d.AbstractLayout
preferredSize
 
Constructor Summary
protected FlowFigureLayout(FlowFigure flowfigure)
          Constructs a new FlowFigureLayout with the given FlowFigure.
 
Method Summary
 Dimension calculatePreferredSize(IFigure f, int w, int h)
          TextFlowLayouts do not calculate a preferred size because it is too expensive.
protected  FlowFigure getFlowFigure()
           
 void invalidate()
          Marks this layout as invalid.
protected abstract  void layout()
          Called during layout(IFigure).
 void layout(IFigure figure)
          Lays out the given figure.
 void setFlowContext(FlowContext flowContext)
          Sets the context for this layout manager.
 
Methods inherited from class org.eclipse.draw2d.AbstractLayout
calculatePreferredSize, getBorderPreferredSize, getConstraint, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, invalidate, remove, setConstraint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

invalid

protected boolean invalid
true if the context has changed, and a layout is needed.


context

protected FlowContext context
The flow context in which this LayoutManager exists.

Constructor Detail

FlowFigureLayout

protected FlowFigureLayout(FlowFigure flowfigure)
Constructs a new FlowFigureLayout with the given FlowFigure.

Parameters:
flowfigure - the FlowFigure
Method Detail

calculatePreferredSize

public Dimension calculatePreferredSize(IFigure f,
                                        int w,
                                        int h)
TextFlowLayouts do not calculate a preferred size because it is too expensive. FlowPage will actually layout itself in order to calculate preferredSize.

Specified by:
calculatePreferredSize in class AbstractLayout
Parameters:
f - The figure
w - The width hint
h - The height hint
Returns:
The preferred size
See Also:
AbstractLayout.calculatePreferredSize(IFigure)

getFlowFigure

protected FlowFigure getFlowFigure()
Returns:
the FlowFigure

invalidate

public void invalidate()
Marks this layout as invalid.

Specified by:
invalidate in interface LayoutManager
Overrides:
invalidate in class AbstractLayout
See Also:
LayoutManager.invalidate()

layout

public final void layout(IFigure figure)
Description copied from interface: LayoutManager
Lays out the given figure.

Parameters:
figure - The figure
See Also:
LayoutManager.layout(IFigure)

layout

protected abstract void layout()
Called during layout(IFigure). The invalid flag is reset after this method is called.


setFlowContext

public void setFlowContext(FlowContext flowContext)
Sets the context for this layout manager.

Parameters:
flowContext - the context of this layout

Eclipse Draw2d
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.