TableView.TableRow (Java 2 Platform SE 5.0) (original) (raw)
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
All Implemented Interfaces:
Enclosing class:
public class TableView.TableRow
extends BoxView
View of a row in a row-centric 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 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](../../../javax/swing/text/TableView.TableRow.html#getViewAtPosition%28int, java.awt.Rectangle%29)(int pos,Rectangle a) Fetches the child view that represents the given position in the model. |
protected void | [layoutMajorAxis](../../../javax/swing/text/TableView.TableRow.html#layoutMajorAxis%28int, int, int[], int[]%29)(int targetSpan, int axis, int[] offsets, int[] spans) Perform layout for the major axis of the box (i.e. |
protected void | [layoutMinorAxis](../../../javax/swing/text/TableView.TableRow.html#layoutMinorAxis%28int, int, int[], int[]%29)(int targetSpan, int axis, int[] offsets, int[] spans) Perform layout for the minor axis of the box (i.e. |
void | [replace](../../../javax/swing/text/TableView.TableRow.html#replace%28int, int, javax.swing.text.View[]%29)(int offset, int length,View[] views) Change the child views. |
Methods inherited from class javax.swing.text.BoxView |
---|
[baselineLayout](../../../javax/swing/text/BoxView.html#baselineLayout%28int, int, int[], int[]%29), [baselineRequirements](../../../javax/swing/text/BoxView.html#baselineRequirements%28int, javax.swing.SizeRequirements%29), [calculateMajorAxisRequirements](../../../javax/swing/text/BoxView.html#calculateMajorAxisRequirements%28int, javax.swing.SizeRequirements%29), [calculateMinorAxisRequirements](../../../javax/swing/text/BoxView.html#calculateMinorAxisRequirements%28int, javax.swing.SizeRequirements%29), [childAllocation](../../../javax/swing/text/BoxView.html#childAllocation%28int, java.awt.Rectangle%29), [flipEastAndWestAtEnds](../../../javax/swing/text/BoxView.html#flipEastAndWestAtEnds%28int, javax.swing.text.Position.Bias%29), [forwardUpdate](../../../javax/swing/text/BoxView.html#forwardUpdate%28javax.swing.event.DocumentEvent.ElementChange, javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory%29), getAlignment, getAxis, [getChildAllocation](../../../javax/swing/text/BoxView.html#getChildAllocation%28int, java.awt.Shape%29), getHeight, getMaximumSpan, getMinimumSpan, [getOffset](../../../javax/swing/text/BoxView.html#getOffset%28int, int%29), getPreferredSpan, [getSpan](../../../javax/swing/text/BoxView.html#getSpan%28int, int%29), [getViewAtPoint](../../../javax/swing/text/BoxView.html#getViewAtPoint%28int, int, java.awt.Rectangle%29), getWidth, [isAfter](../../../javax/swing/text/BoxView.html#isAfter%28int, int, java.awt.Rectangle%29), isAllocationValid, [isBefore](../../../javax/swing/text/BoxView.html#isBefore%28int, int, java.awt.Rectangle%29), isLayoutValid, [layout](../../../javax/swing/text/BoxView.html#layout%28int, int%29), layoutChanged, [modelToView](../../../javax/swing/text/BoxView.html#modelToView%28int, java.awt.Shape, javax.swing.text.Position.Bias%29), [paint](../../../javax/swing/text/BoxView.html#paint%28java.awt.Graphics, java.awt.Shape%29), [paintChild](../../../javax/swing/text/BoxView.html#paintChild%28java.awt.Graphics, java.awt.Rectangle, int%29), [preferenceChanged](../../../javax/swing/text/BoxView.html#preferenceChanged%28javax.swing.text.View, boolean, boolean%29), setAxis, [setSize](../../../javax/swing/text/BoxView.html#setSize%28float, float%29), [viewToModel](../../../javax/swing/text/BoxView.html#viewToModel%28float, float, java.awt.Shape, javax.swing.text.Position.Bias[]%29) |
Methods inherited from class javax.swing.text.CompositeView |
---|
getBottomInset, getInsideAllocation, getLeftInset, [getNextEastWestVisualPositionFrom](../../../javax/swing/text/CompositeView.html#getNextEastWestVisualPositionFrom%28int, javax.swing.text.Position.Bias, java.awt.Shape, int, javax.swing.text.Position.Bias[]%29), [getNextNorthSouthVisualPositionFrom](../../../javax/swing/text/CompositeView.html#getNextNorthSouthVisualPositionFrom%28int, javax.swing.text.Position.Bias, java.awt.Shape, int, javax.swing.text.Position.Bias[]%29), [getNextVisualPositionFrom](../../../javax/swing/text/CompositeView.html#getNextVisualPositionFrom%28int, javax.swing.text.Position.Bias, java.awt.Shape, int, javax.swing.text.Position.Bias[]%29), getRightInset, getTopInset, getView, getViewCount, [getViewIndex](../../../javax/swing/text/CompositeView.html#getViewIndex%28int, javax.swing.text.Position.Bias%29), getViewIndexAtPosition, loadChildren, [modelToView](../../../javax/swing/text/CompositeView.html#modelToView%28int, javax.swing.text.Position.Bias, int, javax.swing.text.Position.Bias, java.awt.Shape%29), [setInsets](../../../javax/swing/text/CompositeView.html#setInsets%28short, short, short, short%29), setParagraphInsets, setParent |
Methods inherited from class javax.swing.text.View |
---|
append, [breakView](../../../javax/swing/text/View.html#breakView%28int, int, float, float%29), [changedUpdate](../../../javax/swing/text/View.html#changedUpdate%28javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory%29), [createFragment](../../../javax/swing/text/View.html#createFragment%28int, int%29), [forwardUpdateToView](../../../javax/swing/text/View.html#forwardUpdateToView%28javax.swing.text.View, javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory%29), getAttributes, [getBreakWeight](../../../javax/swing/text/View.html#getBreakWeight%28int, float, float%29), getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getStartOffset, [getToolTipText](../../../javax/swing/text/View.html#getToolTipText%28float, float, java.awt.Shape%29), getViewFactory, [getViewIndex](../../../javax/swing/text/View.html#getViewIndex%28float, float, java.awt.Shape%29), [insert](../../../javax/swing/text/View.html#insert%28int, javax.swing.text.View%29), [insertUpdate](../../../javax/swing/text/View.html#insertUpdate%28javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory%29), isVisible, [modelToView](../../../javax/swing/text/View.html#modelToView%28int, java.awt.Shape%29), remove, removeAll, [removeUpdate](../../../javax/swing/text/View.html#removeUpdate%28javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory%29), [updateChildren](../../../javax/swing/text/View.html#updateChildren%28javax.swing.event.DocumentEvent.ElementChange, javax.swing.event.DocumentEvent, javax.swing.text.ViewFactory%29), [updateLayout](../../../javax/swing/text/View.html#updateLayout%28javax.swing.event.DocumentEvent.ElementChange, javax.swing.event.DocumentEvent, java.awt.Shape%29), [viewToModel](../../../javax/swing/text/View.html#viewToModel%28float, float, java.awt.Shape%29) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, [wait](../../../java/lang/Object.html#wait%28long, int%29) |
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 |
---|
replace
public void replace(int offset, int length, View[] views)
Change the child views. This is implemented to provide the superclass behavior and invalidate the grid so that rows and columns will be recalculated.
Overrides:
[replace](../../../javax/swing/text/BoxView.html#replace%28int, int, javax.swing.text.View[]%29)
in class [BoxView](../../../javax/swing/text/BoxView.html "class in javax.swing.text")
Parameters:
offset
- the starting index into the child views to insert the new views; this should be a value >= 0 and <= getViewCount
length
- the number of existing child views to remove; This should be a value >= 0 and <= (getViewCount() - offset)
views
- the child views to add; this value can be null
to indicate no children are being added (useful to remove)
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.
Overrides:
[layoutMajorAxis](../../../javax/swing/text/BoxView.html#layoutMajorAxis%28int, int, int[], int[]%29)
in class [BoxView](../../../javax/swing/text/BoxView.html "class in javax.swing.text")
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.
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.
Overrides:
[layoutMinorAxis](../../../javax/swing/text/BoxView.html#layoutMinorAxis%28int, int, int[], int[]%29)
in class [BoxView](../../../javax/swing/text/BoxView.html "class in javax.swing.text")
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.
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.
Overrides:
[getResizeWeight](../../../javax/swing/text/BoxView.html#getResizeWeight%28int%29)
in class [BoxView](../../../javax/swing/text/BoxView.html "class in javax.swing.text")
Parameters:
axis
- may be either View.X_AXIS or View.Y_AXIS
Returns:
the resize weight
Throws:
[IllegalArgumentException](../../../java/lang/IllegalArgumentException.html "class in java.lang")
- for an invalid axis
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.
Overrides:
[getViewAtPosition](../../../javax/swing/text/CompositeView.html#getViewAtPosition%28int, java.awt.Rectangle%29)
in class [CompositeView](../../../javax/swing/text/CompositeView.html "class in javax.swing.text")
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
Returns:
the view representing the given position, or null
if there isn't one
Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.