Home » openjdk-7 » javax » swing » text » html » [javadoc | source]
javax.swing.text.html
public class: ParagraphView [javadoc | source]
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:
    TabExpander, SwingConstants

Direct Known Subclasses:
    LineView

Displays the a paragraph, and uses css attributes for its configuration.
Fields inherited from javax.swing.text.ParagraphView:
firstLineIndent,  i18nStrategy,  tabChars,  tabDecimalChars
Fields inherited from javax.swing.text.FlowView:
layoutSpan,  layoutPool,  strategy
Fields inherited from javax.swing.text.BoxView:
majorAxis,  majorSpan,  minorSpan,  majorReqValid,  minorReqValid,  majorRequest,  minorRequest,  majorAllocValid,  majorOffsets,  majorSpans,  minorAllocValid,  minorOffsets,  minorSpans,  tempRect
Fields inherited from javax.swing.text.View:
BadBreakWeight,  GoodBreakWeight,  ExcellentBreakWeight,  ForcedBreakWeight,  X_AXIS,  Y_AXIS,  sharedBiasReturn
Constructor:
 public ParagraphView(Element elem) 
    Constructs a ParagraphView for the given element.
    Parameters:
    elem - the element that this view is responsible for
Method from javax.swing.text.html.ParagraphView Summary:
calculateMinorAxisRequirements,   getAttributes,   getMaximumSpan,   getMinimumSpan,   getPreferredSpan,   getStyleSheet,   isVisible,   paint,   setParent,   setPropertiesFromAttributes
Methods from javax.swing.text.ParagraphView:
breakView,   calculateMinorAxisRequirements,   changedUpdate,   createRow,   findOffsetToCharactersInString,   flipEastAndWestAtEnds,   getAlignment,   getBreakWeight,   getClosestPositionTo,   getFlowSpan,   getFlowStart,   getLayoutView,   getLayoutViewCount,   getNextNorthSouthVisualPositionFrom,   getPartialSize,   getTabBase,   getTabSet,   nextTabStop,   paint,   setFirstLineIndent,   setJustification,   setLineSpacing,   setPropertiesFromAttributes
Methods from javax.swing.text.FlowView:
calculateMinorAxisRequirements,   changedUpdate,   createRow,   getFlowAxis,   getFlowSpan,   getFlowStart,   getViewIndexAtPosition,   insertUpdate,   layout,   loadChildren,   removeUpdate,   setParent
Methods from javax.swing.text.BoxView:
baselineLayout,   baselineRequirements,   calculateMajorAxisRequirements,   calculateMinorAxisRequirements,   checkRequests,   childAllocation,   flipEastAndWestAtEnds,   forwardUpdate,   getAlignment,   getAxis,   getChildAllocation,   getHeight,   getMaximumSpan,   getMinimumSpan,   getOffset,   getPreferredSpan,   getResizeWeight,   getSpan,   getSpanOnAxis,   getViewAtPoint,   getWidth,   isAfter,   isAllocationValid,   isBefore,   isLayoutValid,   layout,   layoutChanged,   layoutMajorAxis,   layoutMinorAxis,   modelToView,   paint,   paintChild,   preferenceChanged,   replace,   setAxis,   setSize,   setSpanOnAxis,   updateChildSizes,   updateLayoutArray,   viewToModel
Methods from javax.swing.text.CompositeView:
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
Methods from javax.swing.text.View:
append,   breakView,   changedUpdate,   createFragment,   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
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.html.ParagraphView Detail:
 protected SizeRequirements calculateMinorAxisRequirements(int axis,
    SizeRequirements r) 
    Calculate 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 javax.swing.text.ParagraphView .

    If the {@code axis} parameter is neither {@code View.X_AXIS} nor {@code View.Y_AXIS}, IllegalArgumentException is thrown. If the {@code r} parameter is {@code null,} a new {@code SizeRequirements} object is created, otherwise the supplied {@code SizeRequirements} object is returned.

 public AttributeSet getAttributes() 
    Fetches the attributes to use when rendering. This is implemented to multiplex the attributes specified in the model with a StyleSheet.
 public 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.
 public 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.
 public 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.
 protected StyleSheet getStyleSheet() 
 public 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.
 public  void paint(Graphics g,
    Shape a) 
    Renders using the given rendering surface and area on that surface. This is implemented to delgate to the superclass after stashing the base coordinate for tab calculations.
 public  void setParent(View parent) 
    Establishes 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 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.

 protected  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