Class ParagraphView
java.lang.Object
javax.swing.text.View
javax.swing.text.CompositeView
javax.swing.text.BoxView
javax.swing.text.FlowView
javax.swing.text.ParagraphView
javax.swing.text.html.ParagraphView
- All Implemented Interfaces:
- SwingConstants,- TabExpander
Displays the paragraph and uses CSS attributes for its
 configuration.
- 
Nested Class SummaryNested classes/interfaces declared in class javax.swing.text.FlowViewFlowView.FlowStrategy
- 
Field SummaryFields declared in class javax.swing.text.ParagraphViewfirstLineIndentFields declared in class javax.swing.text.FlowViewlayoutPool, layoutSpan, strategyFields declared in class javax.swing.text.ViewBadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXISFields declared in interface javax.swing.SwingConstantsBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
- 
Constructor SummaryConstructorsConstructorDescriptionParagraphView(Element elem) Constructs a ParagraphView for the given element.
- 
Method SummaryModifier and TypeMethodDescriptionprotected SizeRequirementscalculateMinorAxisRequirements(int axis, SizeRequirements r) Calculate the needs for the paragraph along the minor axis.Fetches the attributes to use when rendering.floatgetMaximumSpan(int axis) Determines the maximum span for this view along an axis.floatgetMinimumSpan(int axis) Determines the minimum span for this view along an axis.floatgetPreferredSpan(int axis) Determines the preferred span for this view.protected StyleSheetConvenient method to get the StyleSheet.booleanIndicates whether or not this view should be displayed.voidRenders using the given rendering surface and area on that surface.voidEstablishes the parent view for this view.protected voidSets up the paragraph from css attributes instead of the values found in StyleConstants (i.e. which are used by the superclass).Methods declared in class javax.swing.text.ParagraphViewbreakView, changedUpdate, createRow, findOffsetToCharactersInString, flipEastAndWestAtEnds, getAlignment, getBreakWeight, getClosestPositionTo, getFlowSpan, getFlowStart, getLayoutView, getLayoutViewCount, getNextNorthSouthVisualPositionFrom, getPartialSize, getTabBase, getTabSet, nextTabStop, setFirstLineIndent, setJustification, setLineSpacingMethods declared in class javax.swing.text.FlowViewgetFlowAxis, getViewIndexAtPosition, insertUpdate, layout, loadChildren, removeUpdateMethods declared in class javax.swing.text.BoxViewbaselineLayout, 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, viewToModelMethods declared in class javax.swing.text.CompositeViewgetBottomInset, getInsideAllocation, getLeftInset, getNextEastWestVisualPositionFrom, getNextVisualPositionFrom, getRightInset, getTopInset, getView, getViewAtPosition, getViewCount, getViewIndex, modelToView, setInsets, setParagraphInsetsMethods declared in class javax.swing.text.Viewappend, breakView, createFragment, forwardUpdateToView, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getStartOffset, getToolTipText, getViewFactory, getViewIndex, insert, modelToView, remove, removeAll, updateChildren, updateLayout, viewToModel
- 
Constructor Details- 
ParagraphViewConstructs a ParagraphView for the given element.- Parameters:
- elem- the element that this view is responsible for
 
 
- 
- 
Method Details- 
setParentEstablishes the parent view for this view. This is guaranteed to be called before any other methods if the parent view is functioning properly.This is implemented to forward to the superclass as well as call the setPropertiesFromAttributesmethod 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.- Overrides:
- setParentin class- CompositeView
- Parameters:
- parent- the new parent, or null if the view is being removed from a parent it was previously added to
 
- 
getAttributesFetches the attributes to use when rendering. This is implemented to multiplex the attributes specified in the model with a StyleSheet.- Overrides:
- getAttributesin class- View
- Returns:
- the attributes to use when rendering
 
- 
setPropertiesFromAttributesprotected void setPropertiesFromAttributes()Sets up the paragraph from css attributes instead of the values found in StyleConstants (i.e. which are used by the superclass). Since- Overrides:
- setPropertiesFromAttributesin class- ParagraphView
 
- 
getStyleSheetConvenient method to get the StyleSheet.- Returns:
- the StyleSheet
 
- 
calculateMinorAxisRequirementsCalculate the needs for the paragraph along the minor axis.If size requirements are explicitly specified for the paragraph, use that requirements. Otherwise, use the requirements of the superclass ParagraphView.If the axisparameter is neitherView.X_AXISnorView.Y_AXIS,IllegalArgumentExceptionis thrown. If therparameter isnull,a newSizeRequirementsobject is created, otherwise the suppliedSizeRequirementsobject is returned.- Overrides:
- calculateMinorAxisRequirementsin class- ParagraphView
- Parameters:
- axis- the minor axis
- r- the input- SizeRequirementsobject
- Returns:
- the new or adjusted SizeRequirementsobject
- Throws:
- IllegalArgumentException- if the- axisparameter is invalid
- See Also:
 
- 
isVisiblepublic boolean isVisible()Indicates whether or not this view should be displayed. If none of the children wish to be displayed and the only visible child is the break that ends the paragraph, the paragraph will not be considered visible. Otherwise, it will be considered visible and return true.
- 
paintRenders using the given rendering surface and area on that surface. This is implemented to delegate to the superclass after stashing the base coordinate for tab calculations.- Overrides:
- paintin class- ParagraphView
- Parameters:
- g- the rendering surface to use
- a- the allocated region to render into
- See Also:
 
- 
getPreferredSpanpublic float getPreferredSpan(int axis) Determines the preferred span for this view. Returns 0 if the view is not visible, otherwise it calls the superclass method to get the preferred span. axis.- Overrides:
- getPreferredSpanin class- BoxView
- Parameters:
- axis- may be either View.X_AXIS or View.Y_AXIS
- Returns:
- the span the view would like to be rendered into; typically the view is told to render into the span that is returned, although there is no guarantee; the parent may choose to resize or break the view
- See Also:
 
- 
getMinimumSpanpublic float getMinimumSpan(int axis) Determines the minimum span for this view along an axis. Returns 0 if the view is not visible, otherwise it calls the superclass method to get the minimum span.- Overrides:
- getMinimumSpanin class- BoxView
- Parameters:
- axis- may be either- View.X_AXISor- View.Y_AXIS
- Returns:
- the minimum span the view can be rendered into
- See Also:
 
- 
getMaximumSpanpublic float getMaximumSpan(int axis) Determines the maximum span for this view along an axis. Returns 0 if the view is not visible, otherwise it calls the superclass method ot get the maximum span.- Overrides:
- getMaximumSpanin class- BoxView
- Parameters:
- axis- may be either- View.X_AXISor- View.Y_AXIS
- Returns:
- the maximum span the view can be rendered into
- See Also:
 
 
-