Eclipse Draw2d
2.1

org.eclipse.draw2d.text
Class FlowFigure

java.lang.Object
  |
  +--org.eclipse.draw2d.Figure
        |
        +--org.eclipse.draw2d.text.FlowFigure
All Implemented Interfaces:
IFigure
Direct Known Subclasses:
BlockFlow, InlineFlow

public abstract class FlowFigure
extends Figure

The base implementation for text flow figures. A flow figure is used to render a document in which elements are laid out horizontally within a "line" until that line is filled. Layout continues on the next line.

WARNING: This class is not intended to be subclassed by clients. Future versions may contain additional abstract methods.

Since:
2.1

Nested Class Summary
 
Nested classes inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator
 
Nested classes inherited from class org.eclipse.draw2d.IFigure
IFigure.NoInsets
 
Field Summary
 
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Constructor Summary
FlowFigure()
          Constructs a new FlowFigure.
 
Method Summary
 void add(IFigure child, Object constraint, int index)
          If the child is a FlowFigure, its FlowContext is passed to it.
protected abstract  FlowFigureLayout createDefaultFlowLayout()
          Creates the default layout manager
protected  void paintFigure(Graphics g)
          Paints this Figure's primary representation, or background.
abstract  void postValidate()
          Called after validate has occurred.
 void setBounds(Rectangle r)
          FlowFigures override setBounds() to prevent translation of children.
 void setFlowContext(FlowContext flowContext)
          Sets the flow context.
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, addAncestorListener, addFigureListener, addFocusListener, addKeyListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isEnabled, isFocusTraversable, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeFigureListener, removeFocusListener, removeKeyListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowFigure

public FlowFigure()
Constructs a new FlowFigure.

Method Detail

add

public void add(IFigure child,
                Object constraint,
                int index)
If the child is a FlowFigure, its FlowContext is passed to it.

Specified by:
add in interface IFigure
Overrides:
add in class Figure
See Also:
IFigure.add(IFigure, Object, int)

createDefaultFlowLayout

protected abstract FlowFigureLayout createDefaultFlowLayout()
Creates the default layout manager

Returns:
The default layout

paintFigure

protected void paintFigure(Graphics g)
Description copied from class: Figure
Paints this Figure's primary representation, or background. Changes made to the graphics to the graphics current state will not affect the subsequent calls to Figure.paintClientArea(Graphics) and Figure.paintBorder(Graphics). Furthermore, it is safe to call graphics.restoreState() within this method, and doing so will restore the graphics to its original state upon entry.

Overrides:
paintFigure in class Figure
Parameters:
g - The Graphics used to paint
See Also:
Figure.paintFigure(Graphics)

postValidate

public abstract void postValidate()
Called after validate has occurred. This is used to update the bounds of the FlowFigure to encompass its new flow boxed created during validate.


setBounds

public void setBounds(Rectangle r)
FlowFigures override setBounds() to prevent translation of children. "bounds" is a derived property for FlowFigures, calculated from the fragments that make up the FlowFigure.

Specified by:
setBounds in interface IFigure
Overrides:
setBounds in class Figure
Parameters:
r - The new bounds
See Also:
Figure.setBounds(Rectangle)

setFlowContext

public void setFlowContext(FlowContext flowContext)
Sets the flow context.

Parameters:
flowContext - the flow context for this flow figure

Eclipse Draw2d
2.1

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