javax.swing.text
Class TableView.TableRow

java.lang.Object
  extended by javax.swing.text.View
      extended by javax.swing.text.CompositeView
          extended by javax.swing.text.BoxView
              extended by javax.swing.text.TableView.TableRow
All Implemented Interfaces:
SwingConstants
Enclosing class:
TableView

public class TableView.TableRow
extends BoxView

A view implementation that renders a row of a TableView. This is implemented as a horizontal box that contains the actual cells of the table.


Field Summary
 
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.TableRow(Element el)
          Creates a new instance of TableRow.
 
Method Summary
 int getResizeWeight(int axis)
          Determines the resizeability of this view along the specified axis.
protected  View getViewAtPosition(int pos, Rectangle a)
          Returns the child view that represents the specified position in the model.
protected  void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
          Lays out the box's child views along the major axis.
protected  void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
          Lays out the box's child views along the minor axis (the orthogonal axis to the major axis).
 void replace(int offset, int length, View[] views)
          Replaces some child views with a new set of child views.
 
Methods inherited from class javax.swing.text.BoxView
baselineLayout, baselineRequirements, calculateMajorAxisRequirements, calculateMinorAxisRequirements, childAllocation, flipEastAndWestAtEnds, forwardUpdate, getAlignment, getAxis, getChildAllocation, getHeight, getMaximumSpan, getMinimumSpan, getOffset, getPreferredSpan, getSpan, getViewAtPoint, getWidth, isAfter, isAllocationValid, isBefore, isLayoutValid, layout, layoutChanged, modelToView, paint, paintChild, preferenceChanged, setAxis, setSize, viewToModel
 
Methods inherited from class javax.swing.text.CompositeView
getBottomInset, getInsideAllocation, getLeftInset, getNextEastWestVisualPositionFrom, getNextNorthSouthVisualPositionFrom, getNextVisualPositionFrom, getRightInset, getTopInset, getView, getViewCount, getViewIndex, getViewIndexAtPosition, loadChildren, modelToView, setInsets, setParagraphInsets, setParent
 
Methods inherited from class javax.swing.text.View
append, breakView, changedUpdate, createFragment, dump, forwardUpdateToView, getAttributes, 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.TableRow

public TableView.TableRow(Element el)
Creates a new instance of TableRow.

Parameters:
el - the element for which to create a row view
Method Detail

replace

public void replace(int offset,
                    int length,
                    View[] views)
Replaces some child views with a new set of child views. This is implemented to call the superclass behaviour and invalidates the row grid so that rows and columns will be recalculated.

Overrides:
replace in class BoxView
Parameters:
offset - the start offset at which to replace views
length - the number of views to remove
views - the new set of views

layoutMajorAxis

protected void layoutMajorAxis(int targetSpan,
                               int axis,
                               int[] offsets,
                               int[] spans)
Lays out the box's child views along the major axis. This is reimplemented so that the child views all have the width of their column.

Overrides:
layoutMajorAxis in class BoxView
Parameters:
targetSpan - the total span of the view
axis - the axis that is laid out
offsets - an array that holds the offsets of the child views after this method returned
spans - an array that holds the spans of the child views after this method returned

layoutMinorAxis

protected void layoutMinorAxis(int targetSpan,
                               int axis,
                               int[] offsets,
                               int[] spans)
Lays out the box's child views along the minor axis (the orthogonal axis to the major axis). This is reimplemented to call the super behaviour and then adjust the span of the child views that span multiple rows.

Overrides:
layoutMinorAxis in class BoxView
Parameters:
targetSpan - the total span of the view
axis - the axis that is laid out
offsets - an array that holds the offsets of the child views after this method returned
spans - an array that holds the spans of the child views after this method returned

getResizeWeight

public int getResizeWeight(int axis)
Determines the resizeability of this view along the specified axis.

Overrides:
getResizeWeight in class BoxView
Parameters:
axis - the axis of which to fetch the resizability
Returns:
the resize weight or <= 0 if this view is not resizable
Throws:
IllegalArgumentException - when an illegal axis is specified

getViewAtPosition

protected View getViewAtPosition(int pos,
                                 Rectangle a)
Returns the child view that represents the specified position in the model. This is reimplemented because in this view we do not necessarily have a one to one mapping of child elements to child views.

Overrides:
getViewAtPosition in class CompositeView
Parameters:
pos - the model position for which to query the view
a - the allocation of this view
Returns:
the view that corresponds to the specified model position or null if there is none