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 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/interfaces inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator, Figure.IdentitySearch, Figure.ReverseFigureChildrenIteratorNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
IFigure.NoInsets -
Field Summary
Fields inherited from class org.eclipse.draw2d.text.FlowFigure
selectionStartFields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipFields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcontributeBidi(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 FlowFigureLayoutCreates the default layout managerprotected BlockBoxReturns the BlockBox associated with this.intReturns the effective horizontal alignment.intReturns the horizontal alignment set on this block.intReturns the orientation set on this block.intReturns this block's Bidi orientation.voidpaintBorder(Graphics graphics) Paints the border associated with this Figure, if one exists.voidCalled after validate has occurred.voidInvalidates this figure and revalidates() its parent.protected voidrevalidateBidi(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.voidsetHorizontalAligment(int value) Sets the horitontal aligment of the block.voidsetOrientation(int orientation) Sets the orientation for this block.protected booleanReturnstrueif this Figure uses local coordinates.voidvalidate()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, setSelectionMethods inherited from class org.eclipse.draw2d.Figure
add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, 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, handleMouseWheelScrolled, 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, removeMouseWheelListener, 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:
contributeBidiin classFlowFigure- Parameters:
proc- the BidiProcessor to which contributions should be made- See Also:
-
createDefaultFlowLayout
Description copied from class:FlowFigureCreates the default layout manager- Specified by:
createDefaultFlowLayoutin 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:FigurePaints the border associated with this Figure, if one exists.- Overrides:
paintBorderin classFigure- Parameters:
graphics- The Graphics used to paint- See Also:
-
postValidate
public void postValidate()Description copied from class:FlowFigureCalled 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:
postValidatein classFlowFigure- See Also:
-
revalidate
public void revalidate()Description copied from interface:IFigureInvalidates 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:
revalidatein interfaceIFigure- Overrides:
revalidatein 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:
revalidateBidiin 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.CENTERPositionConstants.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_RIGHTSWT.RIGHT_TO_LEFTSWT.NONE(default)
NONEis 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:FigureReturnstrueif this Figure uses local coordinates. This means its children are placed relative to this Figure's top-left corner.- Overrides:
useLocalCoordinatesin classFigure- Returns:
trueif 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.
-