Home » openjdk-7 » javax » swing » text » html » [javadoc | source]
javax.swing.text.html
public class: BlockView [javadoc | source]
java.lang.Object
   javax.swing.text.View
      javax.swing.text.CompositeView
         javax.swing.text.BoxView
            javax.swing.text.html.BlockView

All Implemented Interfaces:
    SwingConstants

Direct Known Subclasses:
    TableRowView, ListView, CellView, NoFramesTagView, NoFramesView, BodyBlockView, TableTagView, TableCellView

A view implementation to display a block (as a box) with CSS specifications.
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 BlockView(Element elem,
    int axis) 
    Creates a new view that represents an html box. This can be used for a number of elements.
    Parameters:
    elem - the element to create a view for
    axis - either View.X_AXIS or View.Y_AXIS
Method from javax.swing.text.html.BlockView Summary:
calculateMajorAxisRequirements,   calculateMinorAxisRequirements,   changedUpdate,   getAlignment,   getAttributes,   getMaximumSpan,   getMinimumSpan,   getPreferredSpan,   getResizeWeight,   getStyleSheet,   isPercentage,   layoutMinorAxis,   paint,   setParent,   setPropertiesFromAttributes,   spanSetFromAttributes
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.BlockView Detail:
 protected SizeRequirements calculateMajorAxisRequirements(int axis,
    SizeRequirements r) 
    Calculate the requirements of the block along the major axis (i.e. the axis along with it tiles). This is implemented to provide the superclass behavior and then adjust it if the CSS width or height attribute is specified and applicable to the axis.
 protected SizeRequirements calculateMinorAxisRequirements(int axis,
    SizeRequirements r) 
    Calculate the requirements of the block along the minor axis (i.e. the axis orthoginal to the axis along with it tiles). This is implemented to provide the superclass behavior and then adjust it if the CSS width or height attribute is specified and applicable to the axis.
 public  void changedUpdate(DocumentEvent changes,
    Shape a,
    ViewFactory f) 
 public float getAlignment(int axis) 
    Gets the alignment.
 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.
 public float getMinimumSpan(int axis) 
    Determines the minimum span for this view along an axis.
 public float getPreferredSpan(int axis) 
    Determines the preferred span for this view along an axis.
 public int getResizeWeight(int axis) 
    Gets the resize weight.
 protected StyleSheet getStyleSheet() 
 boolean isPercentage(int axis,
    AttributeSet a) 
 protected  void layoutMinorAxis(int targetSpan,
    int axis,
    int[] offsets,
    int[] spans) 
    Performs layout for the minor axis of the box (i.e. the axis orthoginal to the axis that it represents). The results of the layout (the offset and span for each children) are placed in the given arrays which represent the allocations to the children along the minor axis.
 public  void paint(Graphics g,
    Shape allocation) 
    Renders using the given rendering surface and area on that surface. This is implemented to delegate to the css box painter to paint the border and background prior to the interior.
 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() 
    Update any cached values that come from attributes.
 static boolean spanSetFromAttributes(int axis,
    SizeRequirements r,
    LengthValue cssWidth,
    LengthValue cssHeight) 
    Adjust the given requirements to the CSS width or height if it is specified along the applicable axis. Return true if the size is exactly specified, false if the span is not specified in an attribute or the size specified is a percentage.