Java Platform 1.2

javax.swing.text
Class TableView.TableRow

java.lang.Object
  |
  +--javax.swing.text.View
        |
        +--javax.swing.text.CompositeView
              |
              +--javax.swing.text.BoxView
                    |
                    +--javax.swing.text.TableView.TableRow

public class TableView.TableRow
extends BoxView

View of a row in a table.


Fields inherited from class javax.swing.text.View
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
 
Constructor Summary
TableView.TableRow(Element elem)
          Constructs a TableView for the given element.
 
Method Summary
 int getResizeWeight(int axis)
          Determines the resizability of the view along the given axis.
protected  View getViewAtPosition(int pos, Rectangle a)
          Fetches the child view that represents the given position in the model.
protected  void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
          Perform layout for the major axis of the box (i.e.
protected  void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
          Perform layout for the minor axis of the box (i.e.
protected  void loadChildren(ViewFactory f)
          Loads all of the children to initialize the view.
 
Methods inherited from class javax.swing.text.BoxView
baselineLayout, baselineRequirements, calculateMajorAxisRequirements, calculateMinorAxisRequirements, changedUpdate, childAllocation, flipEastAndWestAtEnds, getAlignment, getHeight, getMaximumSpan, getMinimumSpan, getOffset, getPreferredSpan, getSpan, getViewAtPoint, getWidth, insertUpdate, isAfter, isAllocationValid, isBefore, layout, modelToView, paint, paintChild, preferenceChanged, removeUpdate, replace, setSize, viewToModel
 
Methods inherited from class javax.swing.text.CompositeView
append, getBottomInset, getChildAllocation, getInsideAllocation, getLeftInset, getNextEastWestVisualPositionFrom, getNextNorthSouthVisualPositionFrom, getNextVisualPositionFrom, getRightInset, getTopInset, getView, getViewCount, getViewIndexAtPosition, insert, modelToView, removeAll, setInsets, setParagraphInsets, setParent
 
Methods inherited from class javax.swing.text.View
breakView, createFragment, getAttributes, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getParent, getStartOffset, getViewFactory, isVisible, modelToView, 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 elem)
Constructs a TableView 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 re-implemented to give each child the span of the column width for the table, and to give cells that span multiple columns the multi-column span.

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.
Overrides:
layoutMajorAxis in class BoxView

layoutMinorAxis

protected void layoutMinorAxis(int targetSpan,
                               int axis,
                               int[] offsets,
                               int[] spans)
Perform layout for the minor axis of the box (i.e. the axis orthoginal to 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 minor axis. This is called by the superclass whenever the layout needs to be updated along the minor axis.

This is implemented to delegate to the superclass, then adjust the span for any cell that spans multiple rows.

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.
Overrides:
layoutMinorAxis in class BoxView

loadChildren

protected void loadChildren(ViewFactory f)
Loads all of the children to initialize the view. This is called by the setParent method. This is reimplemented to build cells using the createTableCell method.
Parameters:
f - the view factory
Overrides:
loadChildren in class CompositeView

getResizeWeight

public int getResizeWeight(int axis)
Determines the resizability of the view along the given axis. A value of 0 or less is not resizable.
Parameters:
axis - may be either View.X_AXIS or View.Y_AXIS
Returns:
the resize weight
Throws:
IllegalArgumentException - for an invalid axis
Overrides:
getResizeWeight in class BoxView

getViewAtPosition

protected View getViewAtPosition(int pos,
                                 Rectangle a)
Fetches the child view that represents the given position in the model. This is implemented to walk through the children looking for a range that contains the given position. In this view the children do not necessarily have a one to one mapping with the child elements.
Parameters:
pos - the search position >= 0
a - the allocation to the table on entry, and the allocation of the view containing the position on exit
Overrides:
getViewAtPosition in class CompositeView

Java Platform 1.2

Submit a bug or feature Version 1.2 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.