Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.swing.text.View
javax.swing.text.CompositeView
javax.swing.text.BoxView
javax.swing.text.FlowView
javax.swing.text.ParagraphView
FlowView
that flows it's children horizontally and boxes the rows
vertically.
Nested Class Summary |
Nested classes/interfaces inherited from class javax.swing.text.FlowView | |
FlowView.FlowStrategy |
Field Summary | |
protected int |
|
Fields inherited from class javax.swing.text.FlowView | |
layoutPool , layoutSpan , strategy |
Fields inherited from class javax.swing.text.View | |
BadBreakWeight , ExcellentBreakWeight , ForcedBreakWeight , GoodBreakWeight , X_AXIS , Y_AXIS |
Fields inherited from interface javax.swing.SwingConstants | |
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
Constructor Summary | |
|
Method Summary | |
protected void |
|
View | |
void |
|
protected View |
|
protected int |
|
float |
|
int |
|
protected int |
|
protected View |
|
protected int |
|
protected float |
|
protected float |
|
protected TabSet |
|
float |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
Methods inherited from class javax.swing.text.FlowView | |
calculateMinorAxisRequirements , changedUpdate , createRow , getFlowAxis , getFlowSpan , getFlowStart , getViewIndexAtPosition , insertUpdate , layout , loadChildren , removeUpdate |
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public ParagraphView(Element element)
Creates a newParagraphView
for the givenElement
.
- Parameters:
element
- the element that is rendered by this ParagraphView
public void changedUpdate(DocumentEvent ev, Shape a, ViewFactory vf)
Receives notification when some attributes of the displayed element changes. This triggers a refresh of the cached attributes of this paragraph.
- Overrides:
- changedUpdate in interface FlowView
- Parameters:
ev
- the document eventa
- the allocation of this viewvf
- the view factory to use for creating new child views
protected View createRow()
Creates a new view that represents a row within a flow.
- Returns:
- a view for a new row
protected int findOffsetToCharactersInString(char[] string, int start)
Finds the next offset in the document that has one of the characters specified instring
. If there is no such character found, this returns -1.
- Parameters:
string
- the characters to search forstart
- the start offset
- Returns:
- the next offset in the document that has one of the characters specified in
string
public float getAlignment(int axis)
Returns the alignment for this paragraph view for the specified axis. For the X_AXIS the paragraph view will be aligned at it's left edge (0.0F). For the Y_AXIS the paragraph view will be aligned at the center of it's first row.
- Overrides:
- getAlignment in interface BoxView
- Parameters:
axis
- the axis which is examined
- Returns:
- the alignment for this paragraph view for the specified axis
protected int getClosestPositionTo(int pos, Position.Bias bias, Shape a, int direction, Position.Bias[] biasRet, int rowIndex, int x) throws BadLocationException
protected View getLayoutView(int i)
Returns the i-th view from the logical views, before breaking into rows.
- Parameters:
i
- the index of the logical view to return
- Returns:
- the i-th view from the logical views, before breaking into rows
protected int getLayoutViewCount()
Returns the number of logical child views.
- Returns:
- the number of logical child views
protected float getPartialSize(int startOffset, int endOffset)
Returns the size that is used by this view (or it's child views) betweenstartOffset
andendOffset
. If the child views implement theTabableView
interface, then this is used to determine the span, otherwise we use the preferred span of the child views.
- Parameters:
startOffset
- the start offsetendOffset
- the end offset
- Returns:
- the span used by the view between
startOffset
andendOffset
protected float getTabBase()
Returns the location where the tabs are calculated from. This returns0.0F
by default.
- Returns:
- the location where the tabs are calculated from
protected TabSet getTabSet()
Returns the TabSet used by this ParagraphView.
- Returns:
- the TabSet used by this ParagraphView
public float nextTabStop(float x, int tabOffset)
- Specified by:
- nextTabStop in interface TabExpander
protected void setFirstLineIndent(float i)
Sets the indentation of the first line of the paragraph.
- Parameters:
i
- the indentation to set
protected void setJustification(int j)
Sets the justification of the paragraph.
- Parameters:
j
- the justification to set
protected void setLineSpacing(float s)
Sets the line spacing for this paragraph.
- Parameters:
s
- the line spacing to set
protected void setPropertiesFromAttributes()
Fetches the cached properties from the element's attributes.