Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.swing.text.html
Class BlockView  view BlockView download BlockView.java

java.lang.Object
  extended byjavax.swing.text.View
      extended byjavax.swing.text.CompositeView
          extended byjavax.swing.text.BoxView
              extended byjavax.swing.text.html.BlockView
All Implemented Interfaces:
javax.swing.SwingConstants
Direct Known Subclasses:
ListView

public class BlockView
extends javax.swing.text.BoxView


Field Summary
 
Fields inherited from class javax.swing.text.BoxView
 
Fields inherited from class javax.swing.text.CompositeView
 
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
BlockView(javax.swing.text.Element elem, int axis)
          Creates a new view that represents an html box.
 
Method Summary
protected  javax.swing.SizeRequirements calculateMajorAxisRequirements(int axis, javax.swing.SizeRequirements r)
          Calculates the requirements along the major axis.
protected  javax.swing.SizeRequirements calculateMinorAxisRequirements(int axis, javax.swing.SizeRequirements r)
          Calculates the requirements along the minor axis.
 void changedUpdate(javax.swing.event.DocumentEvent ev, java.awt.Shape a, javax.swing.text.ViewFactory f)
          Gives notification from the document that attributes were changed in a location that this view is responsible for.
 float getAlignment(int axis)
          Gets the alignment.
 javax.swing.text.AttributeSet getAttributes()
          Fetches the attributes to use when painting.
 float getMaximumSpan(int axis)
          Determines the maximum span along the axis.
 float getMinimumSpan(int axis)
          Determines the minimum span along the axis.
 float getPreferredSpan(int axis)
          Determines the preferred span along the axis.
 int getResizeWeight(int axis)
          Gets the resize weight.
protected  StyleSheet getStyleSheet()
          Gets the default style sheet.
protected  void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
          Lays out the box along the minor axis (the axis that is perpendicular to the axis that it represents).
 void paint(java.awt.Graphics g, java.awt.Shape a)
          Paints using the given graphics configuration and shape.
 void setParent(javax.swing.text.View parent)
          Creates the parent view for this.
protected  void setPropertiesFromAttributes()
          Updates any cached values that come from attributes.
 
Methods inherited from class javax.swing.text.BoxView
baselineLayout, baselineRequirements, childAllocation, flipEastAndWestAtEnds, forwardUpdate, getAxis, getChildAllocation, getHeight, getOffset, getSpan, getViewAtPoint, getWidth, isAfter, isAllocationValid, isBefore, isLayoutValid, layout, layoutChanged, layoutMajorAxis, modelToView, paintChild, preferenceChanged, replace, setAxis, setSize, viewToModel
 
Methods inherited from class javax.swing.text.CompositeView
getBottomInset, getInsideAllocation, getLeftInset, getNextEastWestVisualPositionFrom, getNextNorthSouthVisualPositionFrom, getNextVisualPositionFrom, getRightInset, getTopInset, getView, getViewAtPosition, getViewCount, getViewIndex, getViewIndexAtPosition, loadChildren, modelToView, setInsets, setParagraphInsets
 
Methods inherited from class javax.swing.text.View
append, breakView, createFragment, dump, forwardUpdateToView, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getStartOffset, getToolTipText, getViewFactory, getViewIndex, insert, insertUpdate, isVisible, modelToView, remove, removeAll, removeUpdate, updateChildren, updateLayout, viewToModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockView

public BlockView(javax.swing.text.Element elem,
                 int axis)
Creates a new view that represents an html box. This can be used for a number of elements.

Method Detail

setParent

public void setParent(javax.swing.text.View parent)
Creates the parent view for this. It is called before any other methods, if the parent view is working properly. Implemented to forward to the superclass and call setPropertiesFromAttributes to set the paragraph properties.


calculateMajorAxisRequirements

protected javax.swing.SizeRequirements calculateMajorAxisRequirements(int axis,
                                                                      javax.swing.SizeRequirements r)
Calculates the requirements along the major axis. This is implemented to call the superclass and then adjust it if the CSS width or height attribute is specified and applicable.


calculateMinorAxisRequirements

protected javax.swing.SizeRequirements calculateMinorAxisRequirements(int axis,
                                                                      javax.swing.SizeRequirements r)
Calculates the requirements along the minor axis. This is implemented to call the superclass and then adjust it if the CSS width or height attribute is specified and applicable.


layoutMinorAxis

protected void layoutMinorAxis(int targetSpan,
                               int axis,
                               int[] offsets,
                               int[] spans)
Lays out the box along the minor axis (the axis that is perpendicular to the axis that it represents). The results of the layout are placed in the given arrays which are the allocations to the children along the minor axis.


paint

public void paint(java.awt.Graphics g,
                  java.awt.Shape a)
Paints using the given graphics configuration and shape. This delegates to the css box painter to paint the border and background prior to the interior.


getAttributes

public javax.swing.text.AttributeSet getAttributes()
Fetches the attributes to use when painting.


getResizeWeight

public int getResizeWeight(int axis)
                    throws java.lang.IllegalArgumentException
Gets the resize weight.


getAlignment

public float getAlignment(int axis)
Gets the alignment.


changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent ev,
                          java.awt.Shape a,
                          javax.swing.text.ViewFactory f)
Gives notification from the document that attributes were changed in a location that this view is responsible for.


getPreferredSpan

public float getPreferredSpan(int axis)
                       throws java.lang.IllegalArgumentException
Determines the preferred span along the axis.


getMinimumSpan

public float getMinimumSpan(int axis)
                     throws java.lang.IllegalArgumentException
Determines the minimum span along the axis.


getMaximumSpan

public float getMaximumSpan(int axis)
                     throws java.lang.IllegalArgumentException
Determines the maximum span along the axis.


setPropertiesFromAttributes

protected void setPropertiesFromAttributes()
Updates any cached values that come from attributes.


getStyleSheet

protected StyleSheet getStyleSheet()
Gets the default style sheet.