Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public class ParagraphView
extends ParagraphView
ParagraphView
with some adjustments for
understanding stylesheets.
Nested Class Summary |
Nested classes/interfaces inherited from class javax.swing.text.FlowView | |
FlowView.FlowStrategy |
Field Summary |
Fields inherited from class javax.swing.text.ParagraphView | |
firstLineIndent |
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 SizeRequirements |
|
AttributeSet |
|
float |
|
float |
|
float |
|
protected StyleSheet |
|
boolean |
|
void | |
void | |
protected void |
|
Methods inherited from class javax.swing.text.ParagraphView | |
adjustRow , breakView , changedUpdate , createRow , findOffsetToCharactersInString , getAlignment , getBreakWeight , getClosestPositionTo , getLayoutView , getLayoutViewCount , getPartialSize , getTabBase , getTabSet , nextTabStop , setFirstLineIndent , setJustification , setLineSpacing , setPropertiesFromAttributes |
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 new ParagraphView for the specified element.
- Parameters:
element
- the element
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r)
Calculates the minor axis requirements of this view. This is implemented to return the super class'es requirements and modifies the minimumSpan slightly so that it is not smaller than the length of the longest word.
- Overrides:
- calculateMinorAxisRequirements in interface FlowView
- Parameters:
axis
- the axisr
- the SizeRequirements object to be used as return parameter; ifnull
a new one will be created
- Returns:
- the requirements along the minor layout axis
public AttributeSet getAttributes()
Returns the attributes used by this view. This is implemented to multiplex the attributes of the model with the attributes of the stylesheet.
- Overrides:
- getAttributes in interface View
public float getMaximumSpan(int axis)
Returns the maximum span of this view. If this view is not visible, we return0
, otherwise the super class is called.
- Overrides:
- getMaximumSpan in interface BoxView
- Parameters:
axis
- the axis
- Returns:
- the maximum span of this view
public float getMinimumSpan(int axis)
Returns the minimum span of this view. If this view is not visible, we return0
, otherwise the super class is called.
- Overrides:
- getMinimumSpan in interface BoxView
- Parameters:
axis
- the axis
- Returns:
- the minimum span of this view
public float getPreferredSpan(int axis)
Returns the preferred span of this view. If this view is not visible, we return0
, otherwise the super class is called.
- Overrides:
- getPreferredSpan in interface BoxView
- Parameters:
axis
- the axis
- Returns:
- the preferred span of this view
protected StyleSheet getStyleSheet()
Returns the stylesheet used by this view.
- Returns:
- the stylesheet used by this view
public boolean isVisible()
Determines if this view is visible or not. If none of the children is visible and the only visible child is the break that ends the paragraph, this paragraph is not considered to be visible.
- Returns:
- the visibility of this paragraph
public void paint(Graphics g, Shape a)
Paints this view. This paints the box using the stylesheet's box painter for this view and delegates to the super class paint() afterwards.
- Parameters:
g
- the graphics objecta
- the current allocation of this view
public void setParent(View parent)
Sets the parent of this view. This is implemented to call the parent functionality and then triggersetPropertiesFromAttributes()
in order to load the stylesheet attributes.
- Overrides:
- setParent in interface CompositeView
- Parameters:
parent
- the parent view to set
protected void setPropertiesFromAttributes()
Loads the visual properties of the ParagraphView from the element's attributes and the stylesheet of the HTML document.
- Overrides:
- setPropertiesFromAttributes in interface ParagraphView