Package org.eclipse.draw2d.text
Class BlockFlow
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.draw2d.text.FlowFigure
org.eclipse.draw2d.text.BlockFlow
- All Implemented Interfaces:
IFigure
- Direct Known Subclasses:
FlowPage
A
FlowFigure
represented by a single BlockBox
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 foundation for a
paragraph.
BlockFlows must be parented by a FlowFigure
. FlowPage
can be used as a "root" block and can be parented by normal Figures.
Only FlowFigure
s 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/interfaces inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator, Figure.IdentitySearch, Figure.ReverseFigureChildrenIterator
Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
IFigure.NoInsets
-
Field Summary
Fields inherited from class org.eclipse.draw2d.text.FlowFigure
selectionStart
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
Creates the default layout managerprotected BlockBox
Returns the BlockBox associated with this.int
Returns the effective horizontal alignment.int
Returns the horizontal alignment set on this block.int
Returns the orientation set on this block.int
Returns this block's Bidi orientation.void
paintBorder
(Graphics graphics) Paints the border associated with this Figure, if one exists.void
Called after validate has occurred.void
Invalidates this figure and revalidates() its parent.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
setHorizontalAligment
(int value) Sets the horitontal aligment of the block.void
setOrientation
(int orientation) Sets the orientation for this block.protected boolean
Returnstrue
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, remove, setBidiInfo, setBounds, setFlowContext, setSelection
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, getChildrenRevIterable, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getListenersIterable, getLocalBackgroundColor, getLocalFont, 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, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, optimizeClip, paint, paintChildren, paintClientArea, paintFigure, primTranslate, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, setBackgroundColor, setBorder, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, 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
-
Constructor Details
-
BlockFlow
public BlockFlow()Constructs a new BlockFlow.
-
-
Method Details
-
contributeBidi
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 classFlowFigure
- Parameters:
proc
- the BidiProcessor to which contributions should be made- See Also:
-
createDefaultFlowLayout
Description copied from class:FlowFigure
Creates the default layout manager- Specified by:
createDefaultFlowLayout
in classFlowFigure
- Returns:
- The default layout
- See Also:
-
getBlockBox
Returns the BlockBox associated with this.- Returns:
- This BlockFlow's BlockBox
-
getHorizontalAligment
public int getHorizontalAligment()Returns the effective horizontal alignment. This method will never returnPositionConstants.NONE
. If the value is none, it will return the inherited alignment. If no alignment was inherited, it will return the default alignment (PositionConstants.LEFT
).- Returns:
- the effective alignment
-
getLocalOrientation
public int getLocalOrientation()Returns the orientation set on this block.- Returns:
- LTR, RTL or NONE
- Since:
- 3.1
- See Also:
-
getLocalHorizontalAlignment
public int getLocalHorizontalAlignment()Returns the horizontal alignment set on this block.- Returns:
- LEFT, RIGHT, ALWAYS_LEFT, ALWAYS_RIGHT, NONE
- Since:
- 3.1
- See Also:
-
getOrientation
public int getOrientation()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.RIGHT_TO_LEFT if mirrored; SWT.LEFT_TO_RIGHT otherwise).- Returns:
- SWT.RIGHT_TO_LEFT or SWT.LEFT_TO_RIGHT
- Since:
- 3.1
- See Also:
-
paintBorder
Description copied from class:Figure
Paints the border associated with this Figure, if one exists.- Overrides:
paintBorder
in classFigure
- Parameters:
graphics
- The Graphics used to paint- See Also:
-
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 classFlowFigure
- See Also:
-
revalidate
public void revalidate()Description copied from interface:IFigure
Invalidates this figure and revalidates() its parent. If a figure does not have a parent, it will request a validation from it UpdateManager. Calling this method does not guarantee that a repaint will occur.- Specified by:
revalidate
in interfaceIFigure
- Overrides:
revalidate
in classFigure
- See Also:
-
revalidateBidi
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 classFlowFigure
- Parameters:
origin
- the figure that was revalidated- See Also:
-
setHorizontalAligment
public void setHorizontalAligment(int value) Sets the horitontal aligment of the block. Valid values are:NONE
- (default) Alignment is inherited from parent. If a parent is not found then LEFT is used.PositionConstants.LEFT
- Alignment is with leading edgePositionConstants.RIGHT
- Alignment is with trailing edgePositionConstants.CENTER
PositionConstants.ALWAYS_LEFT
- Left, irrespective of orientationPositionConstants.ALWAYS_RIGHT
- Right, irrespective of orientation
- Parameters:
value
- the aligment- See Also:
-
setOrientation
public void setOrientation(int orientation) Sets the orientation for this block. Orientation can be one of:SWT.LEFT_TO_RIGHT
SWT.RIGHT_TO_LEFT
SWT.NONE
(default)
NONE
is used to indicate that orientation should be inherited from the encompassing block.- Parameters:
orientation
- LTR, RTL or NONE- Since:
- 3.1
- See Also:
-
useLocalCoordinates
protected boolean useLocalCoordinates()Description copied from class:Figure
Returnstrue
if this Figure uses local coordinates. This means its children are placed relative to this Figure's top-left corner.- Overrides:
useLocalCoordinates
in classFigure
- Returns:
true
if this Figure uses local coordinates- See Also:
-
validate
public void validate()Re-evaluate the Bidi state of all the fragments if it has been invalidated.
-