public class ParagraphView extends ParagraphView
FlowView.FlowStrategy
firstLineIndent
layoutPool, layoutSpan, strategy
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor and Description |
---|
ParagraphView(Element elem)
Constructs a ParagraphView for the given element.
|
Modifier and Type | Method and Description |
---|---|
protected SizeRequirements |
calculateMinorAxisRequirements(int axis,
SizeRequirements r)
Calculate the needs for the paragraph along the minor axis.
|
AttributeSet |
getAttributes()
Fetches the attributes to use when rendering.
|
float |
getMaximumSpan(int axis)
Determines the maximum span for this view along an
axis.
|
float |
getMinimumSpan(int axis)
Determines the minimum span for this view along an
axis.
|
float |
getPreferredSpan(int axis)
Determines the preferred span for this view.
|
protected StyleSheet |
getStyleSheet() |
boolean |
isVisible()
Indicates whether or not this view should be
displayed.
|
void |
paint(Graphics g,
Shape a)
Renders using the given rendering surface and area on that
surface.
|
void |
setParent(View parent)
Establishes the parent view for this view.
|
protected void |
setPropertiesFromAttributes()
Sets up the paragraph from css attributes instead of
the values found in StyleConstants (i.e.
|
breakView, changedUpdate, createRow, findOffsetToCharactersInString, flipEastAndWestAtEnds, getAlignment, getBreakWeight, getClosestPositionTo, getFlowSpan, getFlowStart, getLayoutView, getLayoutViewCount, getNextNorthSouthVisualPositionFrom, getPartialSize, getTabBase, getTabSet, nextTabStop, setFirstLineIndent, setJustification, setLineSpacing
getFlowAxis, getViewIndexAtPosition, insertUpdate, layout, loadChildren, removeUpdate
baselineLayout, baselineRequirements, calculateMajorAxisRequirements, childAllocation, forwardUpdate, getAxis, getChildAllocation, getHeight, getOffset, getResizeWeight, getSpan, getViewAtPoint, getWidth, isAfter, isAllocationValid, isBefore, isLayoutValid, layoutChanged, layoutMajorAxis, layoutMinorAxis, modelToView, paintChild, preferenceChanged, replace, setAxis, setSize, viewToModel
getBottomInset, getInsideAllocation, getLeftInset, getNextEastWestVisualPositionFrom, getNextVisualPositionFrom, getRightInset, getTopInset, getView, getViewAtPosition, getViewCount, getViewIndex, modelToView, setInsets, setParagraphInsets
append, breakView, createFragment, forwardUpdateToView, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getStartOffset, getToolTipText, getViewFactory, getViewIndex, insert, modelToView, remove, removeAll, updateChildren, updateLayout, viewToModel
public ParagraphView(Element elem)
elem
- the element that this view is responsible forpublic void setParent(View parent)
This is implemented
to forward to the superclass as well as call the
setPropertiesFromAttributes
method to set the paragraph properties from the css
attributes. The call is made at this time to ensure
the ability to resolve upward through the parents
view attributes.
public AttributeSet getAttributes()
getAttributes
in class View
protected void setPropertiesFromAttributes()
setPropertiesFromAttributes
in class ParagraphView
protected StyleSheet getStyleSheet()
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r)
If size requirements are explicitly specified for the paragraph,
use that requirements. Otherwise, use the requirements of the
superclass ParagraphView
.
If the axis
parameter is neither View.X_AXIS
nor
View.Y_AXIS
, IllegalArgumentException
is thrown. If the
r
parameter is null,
a new SizeRequirements
object is created, otherwise the supplied SizeRequirements
object is returned.
calculateMinorAxisRequirements
in class ParagraphView
axis
- the minor axisr
- the input SizeRequirements
objectSizeRequirements
objectIllegalArgumentException
- if the axis
parameter is invalidSizeRequirements
public boolean isVisible()
public void paint(Graphics g, Shape a)
paint
in class ParagraphView
g
- the rendering surface to usea
- the allocated region to render intoView.paint(java.awt.Graphics, java.awt.Shape)
public float getPreferredSpan(int axis)
getPreferredSpan
in class BoxView
axis
- may be either View.X_AXIS or View.Y_AXISBoxView.getPreferredSpan(int)
public float getMinimumSpan(int axis)
getMinimumSpan
in class BoxView
axis
- may be either View.X_AXIS
or
View.Y_AXIS
BoxView.getMinimumSpan(int)
public float getMaximumSpan(int axis)
getMaximumSpan
in class BoxView
axis
- may be either View.X_AXIS
or
View.Y_AXIS
BoxView.getMaximumSpan(int)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2012, Oracle and/or its affiliates. All rights reserved.