Eclipse Draw2d
2.1

org.eclipse.draw2d.text
Class ParagraphTextLayout

java.lang.Object
  |
  +--org.eclipse.draw2d.AbstractLayout
        |
        +--org.eclipse.draw2d.text.FlowFigureLayout
              |
              +--org.eclipse.draw2d.text.TextLayout
                    |
                    +--org.eclipse.draw2d.text.ParagraphTextLayout
All Implemented Interfaces:
LayoutManager

public class ParagraphTextLayout
extends TextLayout

The layout for TextFlow.

Since:
2.1

Field Summary
static int WORD_WRAP_HARD
          Wrapping will ONLY occur at valid line breaks
static int WORD_WRAP_SOFT
          Wrapping will always occur at the end of the available space, breaking in the middle of a word.
static int WORD_WRAP_TRUNCATE
          Wrapping will always occur at the end of available space, truncating a word if it doesn't fit.
 
Fields inherited from class org.eclipse.draw2d.text.FlowFigureLayout
context, invalid
 
Fields inherited from class org.eclipse.draw2d.AbstractLayout
preferredSize
 
Constructor Summary
ParagraphTextLayout(TextFlow flow)
          Consturcts a new ParagraphTextLayout on the specified TextFlow.
ParagraphTextLayout(TextFlow flow, int style)
          Constructs the layout with the specified TextFlow and wrapping style.
 
Method Summary
protected  float getAverageCharWidth(TextFragmentBox fragment)
          Returns the average character width of given TextFragmentbox
protected  void layout()
          Called during FlowFigureLayout.layout(IFigure).
 
Methods inherited from class org.eclipse.draw2d.text.TextLayout
getFragment
 
Methods inherited from class org.eclipse.draw2d.text.FlowFigureLayout
calculatePreferredSize, getFlowFigure, invalidate, layout, setFlowContext
 
Methods inherited from class org.eclipse.draw2d.AbstractLayout
calculatePreferredSize, getBorderPreferredSize, getConstraint, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, invalidate, remove, setConstraint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WORD_WRAP_HARD

public static final int WORD_WRAP_HARD
Wrapping will ONLY occur at valid line breaks

See Also:
Constant Field Values

WORD_WRAP_SOFT

public static final int WORD_WRAP_SOFT
Wrapping will always occur at the end of the available space, breaking in the middle of a word.

See Also:
Constant Field Values

WORD_WRAP_TRUNCATE

public static final int WORD_WRAP_TRUNCATE
Wrapping will always occur at the end of available space, truncating a word if it doesn't fit.

See Also:
Constant Field Values
Constructor Detail

ParagraphTextLayout

public ParagraphTextLayout(TextFlow flow)
Consturcts a new ParagraphTextLayout on the specified TextFlow.

Parameters:
flow - the TextFlow

ParagraphTextLayout

public ParagraphTextLayout(TextFlow flow,
                           int style)
Constructs the layout with the specified TextFlow and wrapping style. The wrapping style must be one of:

Parameters:
flow - the textflow
style - the style of wrapping
Method Detail

getAverageCharWidth

protected float getAverageCharWidth(TextFragmentBox fragment)
Returns the average character width of given TextFragmentbox

Parameters:
fragment - the TextFragmentBox
Returns:
the average character width

layout

protected void layout()
Description copied from class: FlowFigureLayout
Called during FlowFigureLayout.layout(IFigure). The FlowFigureLayout.invalid flag is reset after this method is called.

Specified by:
layout in class FlowFigureLayout
See Also:
FlowFigureLayout.layout()

Eclipse Draw2d
2.1

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