Eclipse Draw2d
3.0

org.eclipse.draw2d.text
Class BlockFlow

java.lang.Object
  extended byorg.eclipse.draw2d.Figure
      extended byorg.eclipse.draw2d.text.FlowFigure
          extended byorg.eclipse.draw2d.text.BlockFlow
All Implemented Interfaces:
IFigure
Direct Known Subclasses:
FlowPage

public class BlockFlow
extends FlowFigure

A FlowFigure represented by a single BlockBox fragment containing one or more lines. A BlockFlow is a creator of LineBoxes, which its children require during layout. A BlockFlow can be thought of as a paragraph.

BlockFlows should be nested inside other BlockFlows, but it is also valid to place them in InlineFlows. FlowPage can be used as a "root" block and can be added to normal draw2d Figures.

Only FlowFigures can be added to a BlockFlow.

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

Since:
2.1

Nested Class Summary
 
Nested classes inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator, Figure.IdentitySearch
 
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
BlockFlow()
          Constructs a new BlockFlow.
 
Method Summary
protected  void contributeBidi(BidiProcessor proc)
          BlockFlows contribute a paragraph separator so as to keep the Bidi state of the text on either side of this block from affecting each other.
protected  FlowFigureLayout createDefaultFlowLayout()
          Creates the default layout manager
 int getBidiOrientation()
          Returns this block's Bidi orientation.
protected  BlockBox getBlockBox()
          Returns the BlockBox associated with this.
 int getHorizontalAligment()
          Returns the horizontal aligment.
protected  void invalidateBidi()
          Overridden to do nothing since a BlockFlow is unaffected by changes in its containing block.
 void postValidate()
          Called after validate has occurred.
protected  void revalidateBidi(IFigure origin)
          A Block will invalidate the Bidi state of all its children, so that it is re-evaluated when this block is next validated.
 void setBidiOrientation(int newOrientation)
          Sets the Bidi orientation for this block.
 void setHorizontalAligment(int value)
          Sets the horitontal aligment of the block.
protected  boolean useLocalCoordinates()
          Returns true if this Figure uses local coordinates.
 void validate()
          Re-evaluate the Bidi state of all the fragments if it has been invalidated.
 
Methods inherited from class org.eclipse.draw2d.text.FlowFigure
add, addLeadingWordRequirements, getBidiValues, remove, setAppendJoiner, setBidiValues, setBounds, setFlowContext, setPrependJoiner
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, 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, isCoordinateSystem, isEnabled, isFocusTraversable, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockFlow

public BlockFlow()
Constructs a new BlockFlow.

Method Detail

contributeBidi

protected void contributeBidi(BidiProcessor proc)
BlockFlows contribute a paragraph separator so as to keep the Bidi state of the text on either side of this block from affecting each other. Since each block is like a different paragraph, it does not contribute any actual text to its containing block.

Overrides:
contributeBidi in class FlowFigure
Parameters:
proc - the BidiProcessor to which contributions should be made
See Also:
FlowFigure.contributeBidi(org.eclipse.draw2d.text.BidiProcessor)

createDefaultFlowLayout

protected FlowFigureLayout createDefaultFlowLayout()
Description copied from class: FlowFigure
Creates the default layout manager

Specified by:
createDefaultFlowLayout in class FlowFigure
Returns:
The default layout
See Also:
FlowFigure.createDefaultFlowLayout()

getBidiOrientation

public int getBidiOrientation()
Returns this block's Bidi orientation. If none was set on this block, it will inherit the one from its containing block. If there is no containing block, it will return the default orientation (SWT.LEFT_TO_RIGHT).

Returns:
SWT.RIGHT_TO_LEFT or SWT.LEFT_TO_RIGHT
Since:
3.1
See Also:
setBidiOrientation(int)

getBlockBox

protected BlockBox getBlockBox()
Returns the BlockBox associated with this.

Returns:
This BlockFlow's BlockBox

getHorizontalAligment

public int getHorizontalAligment()
Returns the horizontal aligment.

Returns:
the hotizontal aligment

invalidateBidi

protected void invalidateBidi()
Overridden to do nothing since a BlockFlow is unaffected by changes in its containing block.

Overrides:
invalidateBidi in class FlowFigure
See Also:
FlowFigure.invalidateBidi()

postValidate

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

Specified by:
postValidate in class FlowFigure
See Also:
FlowFigure.postValidate()

revalidateBidi

protected void revalidateBidi(IFigure origin)
A Block will invalidate the Bidi state of all its children, so that it is re-evaluated when this block is next validated.

Overrides:
revalidateBidi in class FlowFigure
Parameters:
origin - the figure that was revalidated
See Also:
FlowFigure.revalidateBidi(org.eclipse.draw2d.IFigure)

setBidiOrientation

public void setBidiOrientation(int newOrientation)
Sets the Bidi orientation for this block. To make a block inherit its containing block's orientation, set it to SWT.NONE.

Parameters:
newOrientation - SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT or SWT.NONE (inherit from containing block)
Since:
3.1

setHorizontalAligment

public void setHorizontalAligment(int value)
Sets the horitontal aligment of the block. Valid values are: Blocks with a Bidi orientation of SWT.RIGHT_TO_LEFT will be right-aligned if their horizontal alignment is PositionConstants.LEFT, and left-aligned if their alignment is PositionConstants.RIGHT.

Parameters:
value - the aligment

useLocalCoordinates

protected boolean useLocalCoordinates()
Description copied from class: Figure
Returns true if this Figure uses local coordinates. This means its children are placed relative to this Figure's top-left corner.

Overrides:
useLocalCoordinates in class Figure
Returns:
true if this Figure uses local coordinates
See Also:
Figure.useLocalCoordinates()

validate

public void validate()
Re-evaluate the Bidi state of all the fragments if it has been invalidated.

Specified by:
validate in interface IFigure
Overrides:
validate in class Figure
See Also:
IFigure.validate()

Eclipse Draw2d
3.0

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