|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.View
javax.swing.text.CompositeView
javax.swing.text.BoxView
javax.swing.text.FlowView
javax.swing.text.ParagraphView
public class ParagraphView
A 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 |
firstLineIndent
The indentation of the first line of the paragraph. |
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 | |
---|---|
ParagraphView(Element element)
Creates a new ParagraphView for the given
Element . |
Method Summary | |
---|---|
protected void |
adjustRow(javax.swing.text.ParagraphView.Row r,
int desiredSpan,
int x)
|
View |
breakView(int axis,
float len,
Shape a)
|
void |
changedUpdate(DocumentEvent ev,
Shape a,
ViewFactory vf)
Receives notification when some attributes of the displayed element changes. |
protected View |
createRow()
Creates a new view that represents a row within a flow. |
protected int |
findOffsetToCharactersInString(char[] string,
int start)
Finds the next offset in the document that has one of the characters specified in string . |
float |
getAlignment(int axis)
Returns the alignment for this paragraph view for the specified axis. |
int |
getBreakWeight(int axis,
float len)
|
protected int |
getClosestPositionTo(int pos,
Position.Bias bias,
Shape a,
int direction,
Position.Bias[] biasRet,
int rowIndex,
int x)
|
protected View |
getLayoutView(int i)
Returns the i-th view from the logical views, before breaking into rows. |
protected int |
getLayoutViewCount()
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) between startOffset and endOffset . |
protected float |
getTabBase()
Returns the location where the tabs are calculated from. |
protected TabSet |
getTabSet()
Returns the TabSet used by this ParagraphView. |
float |
nextTabStop(float x,
int tabOffset)
|
protected void |
setFirstLineIndent(float i)
Sets the indentation of the first line of the paragraph. |
protected void |
setJustification(int j)
Sets the justification of the paragraph. |
protected void |
setLineSpacing(float s)
Sets the line spacing for this paragraph. |
protected void |
setPropertiesFromAttributes()
Fetches the cached properties from the element's attributes. |
Methods inherited from class javax.swing.text.FlowView |
---|
calculateMinorAxisRequirements, getFlowAxis, getFlowSpan, getFlowStart, getViewIndexAtPosition, insertUpdate, layout, loadChildren, removeUpdate |
Methods inherited from class javax.swing.text.BoxView |
---|
baselineLayout, baselineRequirements, calculateMajorAxisRequirements, childAllocation, flipEastAndWestAtEnds, forwardUpdate, getAxis, getChildAllocation, getHeight, getMaximumSpan, getMinimumSpan, getOffset, getPreferredSpan, getResizeWeight, getSpan, getViewAtPoint, getWidth, isAfter, isAllocationValid, isBefore, isLayoutValid, layoutChanged, layoutMajorAxis, layoutMinorAxis, modelToView, paint, paintChild, preferenceChanged, replace, setAxis, setSize, viewToModel |
Methods inherited from class javax.swing.text.CompositeView |
---|
getBottomInset, getInsideAllocation, getLeftInset, getNextEastWestVisualPositionFrom, getNextNorthSouthVisualPositionFrom, getNextVisualPositionFrom, getRightInset, getTopInset, getView, getViewAtPosition, getViewCount, getViewIndex, modelToView, setInsets, setParagraphInsets, setParent |
Methods inherited from class javax.swing.text.View |
---|
append, breakView, createFragment, dump, forwardUpdateToView, getAttributes, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getStartOffset, getToolTipText, getViewFactory, getViewIndex, insert, isVisible, modelToView, remove, removeAll, updateChildren, updateLayout, viewToModel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int firstLineIndent
Constructor Detail |
---|
public ParagraphView(Element element)
ParagraphView
for the given
Element
.
element
- the element that is rendered by this ParagraphViewMethod Detail |
---|
public float nextTabStop(float x, int tabOffset)
nextTabStop
in interface TabExpander
protected View createRow()
createRow
in class FlowView
public float getAlignment(int axis)
getAlignment
in class BoxView
axis
- the axis which is examined
public void changedUpdate(DocumentEvent ev, Shape a, ViewFactory vf)
changedUpdate
in class FlowView
ev
- the document eventa
- the allocation of this viewvf
- the view factory to use for creating new child viewsprotected void setPropertiesFromAttributes()
protected void setFirstLineIndent(float i)
i
- the indentation to setprotected void setJustification(int j)
j
- the justification to setprotected void setLineSpacing(float s)
s
- the line spacing to setprotected View getLayoutView(int i)
i
- the index of the logical view to return
protected int getLayoutViewCount()
protected TabSet getTabSet()
protected int findOffsetToCharactersInString(char[] string, int start)
string
. If there is no such character found,
this returns -1.
string
- the characters to search forstart
- the start offset
string
protected int getClosestPositionTo(int pos, Position.Bias bias, Shape a, int direction, Position.Bias[] biasRet, int rowIndex, int x) throws BadLocationException
BadLocationException
protected float getPartialSize(int startOffset, int endOffset)
startOffset
and endOffset
. If the child views
implement the TabableView
interface, then this is used to
determine the span, otherwise we use the preferred span of the child
views.
startOffset
- the start offsetendOffset
- the end offset
startOffset
and
endOffset
protected float getTabBase()
0.0F
by default.
protected void adjustRow(javax.swing.text.ParagraphView.Row r, int desiredSpan, int x)
public View breakView(int axis, float len, Shape a)
public int getBreakWeight(int axis, float len)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |