javax.swing.text.html
Class TableView.CellView

java.lang.Object
  extended byjavax.swing.text.View
      extended byjavax.swing.text.CompositeView
          extended byjavax.swing.text.BoxView
              extended byjavax.swing.text.html.BlockView
                  extended byjavax.swing.text.html.TableView.CellView
All Implemented Interfaces:
SwingConstants
Enclosing class:
TableView

class TableView.CellView
extends BlockView

Default view of an html table cell. This needs to be moved somewhere else.


Field Summary
 
Fields inherited from class javax.swing.text.html.BlockView
 
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
TableView.CellView(Element elem)
          Constructs a TableCell for the given element.
 
Method Summary
protected  SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements r)
          Calculate the requirements needed along the major axis.
protected  void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
          Perform layout for the major axis of the box (i.e. the axis that it represents).
 
Methods inherited from class javax.swing.text.html.BlockView
calculateMinorAxisRequirements, changedUpdate, getAlignment, getAttributes, getMaximumSpan, getMinimumSpan, getPreferredSpan, getResizeWeight, getStyleSheet, isPercentage, layoutMinorAxis, paint, setParent, setPropertiesFromAttributes, spanSetFromAttributes
 
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, 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, 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

TableView.CellView

public TableView.CellView(Element elem)
Constructs a TableCell for the given element.

Parameters:
elem - the element that this view is responsible for
Method Detail

layoutMajorAxis

protected void layoutMajorAxis(int targetSpan,
                               int axis,
                               int[] offsets,
                               int[] spans)
Perform layout for the major axis of the box (i.e. the axis that it represents). The results of the layout should be placed in the given arrays which represent the allocations to the children along the major axis. This is called by the superclass to recalculate the positions of the child views when the layout might have changed.

This is implemented to delegate to the superclass to tile the children. If the target span is greater than was needed, the offsets are adjusted to align the children (i.e. position according to the html valign attribute).

Overrides:
layoutMajorAxis in class BoxView
Parameters:
targetSpan - the total span given to the view, which whould be used to layout the children
axis - the axis being layed out
offsets - the offsets from the origin of the view for each of the child views; this is a return value and is filled in by the implementation of this method
spans - the span of each child view; this is a return value and is filled in by the implementation of this method
Returns:
the offset and span for each child view in the offsets and spans parameters

calculateMajorAxisRequirements

protected SizeRequirements calculateMajorAxisRequirements(int axis,
                                                          SizeRequirements r)
Calculate the requirements needed along the major axis. This is called by the superclass whenever the requirements need to be updated (i.e. a preferenceChanged was messaged through this view).

This is implemented to delegate to the superclass, but indicate the maximum size is very large (i.e. the cell is willing to expend to occupy the full height of the row).

Overrides:
calculateMajorAxisRequirements in class BlockView
Parameters:
axis - the axis being layed out.
r - the requirements to fill in. If null, a new one should be allocated.