javax.swing.text
Class ParagraphView
- SwingConstants, TabExpander
A
FlowView
that flows it's children horizontally and boxes the rows
vertically.
protected int | firstLineIndent - The indentation of the first line of the paragraph.
|
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
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.
|
calculateMinorAxisRequirements , changedUpdate , createRow , getFlowAxis , getFlowSpan , getFlowStart , getViewIndexAtPosition , insertUpdate , layout , loadChildren , removeUpdate |
baselineLayout , baselineRequirements , calculateMajorAxisRequirements , calculateMinorAxisRequirements , childAllocation , flipEastAndWestAtEnds , forwardUpdate , getAlignment , getAxis , getChildAllocation , getHeight , getMaximumSpan , getMinimumSpan , getOffset , getPreferredSpan , getResizeWeight , getSpan , getViewAtPoint , getWidth , isAfter , isAllocationValid , isBefore , isLayoutValid , layout , layoutChanged , layoutMajorAxis , layoutMinorAxis , modelToView , paint , paintChild , preferenceChanged , replace , setAxis , setSize , viewToModel |
childAllocation , flipEastAndWestAtEnds , getBottomInset , getChildAllocation , getInsideAllocation , getLeftInset , getNextEastWestVisualPositionFrom , getNextNorthSouthVisualPositionFrom , getNextVisualPositionFrom , getRightInset , getTopInset , getView , getViewAtPoint , getViewAtPosition , getViewCount , getViewIndex , getViewIndexAtPosition , isAfter , isBefore , loadChildren , modelToView , modelToView , replace , setInsets , setParagraphInsets , setParent , viewToModel |
append , breakView , changedUpdate , createFragment , dump , forwardUpdate , forwardUpdateToView , getAlignment , getAttributes , getBreakWeight , getChildAllocation , getContainer , getDocument , getElement , getEndOffset , getGraphics , getMaximumSpan , getMinimumSpan , getNextVisualPositionFrom , getParent , getPreferredSpan , getResizeWeight , getStartOffset , getToolTipText , getView , getViewCount , getViewFactory , getViewIndex , getViewIndex , insert , insertUpdate , isVisible , modelToView , modelToView , modelToView , paint , preferenceChanged , remove , removeAll , removeUpdate , replace , setParent , setSize , updateChildren , updateLayout , viewToModel , viewToModel |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
firstLineIndent
protected int firstLineIndent
The indentation of the first line of the paragraph.
ParagraphView
public ParagraphView(Element element)
Creates a new ParagraphView
for the given
Element
.
element
- the element that is rendered by this ParagraphView
adjustRow
protected void adjustRow(javax.swing.text.ParagraphView.Row r,
int desiredSpan,
int x)
changedUpdate
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.
- changedUpdate in interface FlowView
ev
- the document eventa
- the allocation of this viewvf
- the view factory to use for creating new child views
findOffsetToCharactersInString
protected int findOffsetToCharactersInString(char[] string,
int start)
Finds the next offset in the document that has one of the characters
specified in string
. If there is no such character found,
this returns -1.
string
- the characters to search forstart
- the start offset
- the next offset in the document that has one of the characters
specified in
string
getAlignment
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.
- getAlignment in interface BoxView
axis
- the axis which is examined
- the alignment for this paragraph view for the specified axis
getLayoutView
protected View getLayoutView(int i)
Returns the i-th view from the logical views, before breaking into rows.
i
- the index of the logical view to return
- the i-th view from the logical views, before breaking into rows
getLayoutViewCount
protected int getLayoutViewCount()
Returns the number of logical child views.
- the number of logical child views
getPartialSize
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
. 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
- the span used by the view between
startOffset
and
endOffset
getTabBase
protected float getTabBase()
Returns the location where the tabs are calculated from. This returns
0.0F
by default.
- the location where the tabs are calculated from
getTabSet
protected TabSet getTabSet()
Returns the TabSet used by this ParagraphView.
- the TabSet used by this ParagraphView
setFirstLineIndent
protected void setFirstLineIndent(float i)
Sets the indentation of the first line of the paragraph.
i
- the indentation to set
setJustification
protected void setJustification(int j)
Sets the justification of the paragraph.
j
- the justification to set
setLineSpacing
protected void setLineSpacing(float s)
Sets the line spacing for this paragraph.
s
- the line spacing to set
ParagraphView.java -- A composite View
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.