javax.swing.text

Class TableView.TableRow

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.
Constructor Summary
TableRow(Element el)
Creates a new instance of TableRow.
Method Summary
intgetResizeWeight(int axis)
Determines the resizeability of this view along the specified axis.
protected ViewgetViewAtPosition(int pos, Rectangle a)
Returns the child view that represents the specified position in the model.
protected voidlayoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
Lays out the box's child views along the major axis.
protected voidlayoutMinorAxis(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).
voidreplace(int offset, int length, View[] views)
Replaces some child views with a new set of child views.

Constructor Detail

TableRow

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

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

Method Detail

getResizeWeight

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

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.

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

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.

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.

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

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.

Parameters: offset the start offset at which to replace views length the number of views to remove views the new set of views