Package 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,- FlowAdapter,- InlineFlow
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 SummaryNested classes/interfaces inherited from class org.eclipse.draw2d.FigureFigure.FigureIterator, Figure.IdentitySearch, Figure.ReverseFigureChildrenIteratorNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigureIFigure.NoInsets
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected intinteger indicating whether selection should be displayed.Fields inherited from class org.eclipse.draw2d.FigurebgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipFields inherited from interface org.eclipse.draw2d.IFigureMAX_DIMENSION, MIN_DIMENSION, NO_INSETS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidIf the child is aFlowFigure, its FlowContext is passed to it.booleanaddLeadingWordRequirements(int[] width) Calculates the width of text before the next line-break is encountered.protected voidcontributeBidi(BidiProcessor proc) FlowFigures can contribute text for their block to the givenBidiProcessor, which will process the contributions to determine Bidi levels and shaping requirements.protected abstract FlowFigureLayoutCreates the default layout managerabstract voidCalled after validate has occurred.voidOverridden to revalidateBidi when fragments are removed.protected voidrevalidateBidi(IFigure origin) This method should be invoked whenever a change that can potentially affect the Bidi evaluation is made (eg., adding or removing children, changing text, etc.).voidsetBidiInfo(BidiInfo info) Sets the bidi information for this figure.voidFlowFigures override setBounds() to prevent translation of children.voidsetFlowContext(FlowContext flowContext) Sets the flow context.voidsetSelection(int start, int end) Sets the selection or a range of selection.Methods inherited from class org.eclipse.draw2d.Figureadd, 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, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, 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, useLocalCoordinates, validate
- 
Field Details- 
selectionStartprotected int selectionStartinteger indicating whether selection should be displayed.
 
- 
- 
Constructor Details- 
FlowFigurepublic FlowFigure()Constructs a new FlowFigure.
 
- 
- 
Method Details- 
addIf the child is aFlowFigure, its FlowContext is passed to it.
- 
addLeadingWordRequirementspublic boolean addLeadingWordRequirements(int[] width) Calculates the width of text before the next line-break is encountered.Default implementation treats each FlowFigure as a line-break. It adds no width and returns true. Sub-classes should override as needed.- Parameters:
- width- the width before the next line-break (if one's found; all the width, otherwise) will be added on to the first int in the given array
- Returns:
- boolean indicating whether or not a line-break was found
- Since:
- 3.1
 
- 
contributeBidiFlowFigures can contribute text for their block to the givenBidiProcessor, which will process the contributions to determine Bidi levels and shaping requirements.This method is invoked as part of validating Bidi. Sub-classes that cache the BidiInfo and/or the bidi level in ContentBoxes should clear the cached values when this method is invoked. - Parameters:
- proc- the BidiProcessor to which contributions should be made
- Since:
- 3.1
- See Also:
 
- 
createDefaultFlowLayoutCreates the default layout manager- Returns:
- The default layout
 
- 
postValidatepublic 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.
- 
removeOverridden to revalidateBidi when fragments are removed.
- 
revalidateBidiThis method should be invoked whenever a change that can potentially affect the Bidi evaluation is made (eg., adding or removing children, changing text, etc.).The default implementation delegates the revalidation task to the parent. Only blocksperform the actual revalidation.The given IFigure is the one that triggered the revalidation. This can be used to optimize bidi evaluation. - Parameters:
- origin- the figure that was revalidated
- Since:
- 3.1
 
- 
setBidiInfoSets the bidi information for this figure. A flow figure contributes bidi text incontributeBidi(BidiProcessor). If the figure contributes text associated with it, this method is called back to indicate the bidi properties for that text within its block.- Parameters:
- info- the BidiInfo for this figure
- Since:
- 3.1
 
- 
setBoundsFlowFigures override setBounds() to prevent translation of children. "bounds" is a derived property for FlowFigures, calculated from the fragments that make up the FlowFigure.
- 
setFlowContextSets the flow context.- Parameters:
- flowContext- the flow context for this flow figure
 
- 
setSelectionpublic void setSelection(int start, int end) Sets the selection or a range of selection. A start value of -1 is used to indicate no selection. A start value >=0 indicates show selection. A start and end value can be used to represent a range of offsets which should render selection.- Parameters:
- start- the start offset
- end- the end offset
- Since:
- 3.1
 
 
-