Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.awt.swing.text.TableView.TableCell

java.lang.Object
    |
    +----java.awt.swing.text.View
            |
            +----java.awt.swing.text.CompositeView
                    |
                    +----java.awt.swing.text.BoxView
                            |
                            +----java.awt.swing.text.TableView.TableCell

public class TableView.TableCell
extends BoxView
View of a cell in a table


Fields inherited from class java.awt.swing.text.View
 BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
 

Constructor Summary
 TableView.TableCell(TableView this$0, Element elem)
Constructs a TableCell for the given element.
 

Method Summary
int  getColumnCount()
Gets the number of columns this cell spans (eg.
int  getPreferredColumnSpan()
Gets the preferred span for the column occupied.
float  getPreferredSpan(int axis)
Determines the preferred span for this view along an axis.
int  getRowCount()
Gets the number of rows this cell spans (that is, the grid height).
void  paint(Graphics g, Shape allocation)
Renders using the given rendering surface and area on that surface.
void  setGridLocation(int row, int col)
Sets the grid location.
 
Methods inherited from class java.awt.swing.text.BoxView
 changedUpdate, childAllocation, getAlignment, getPreferredSpan, getResizeWeight, getViewAtPoint, insertUpdate, isAfter, isAllocationValid, isBefore, layout, modelToView, paint, paintChild, preferenceChanged, removeUpdate, replace, setSize, viewToModel
 
Methods inherited from class java.awt.swing.text.CompositeView
 append, childAllocation, getBottomInset, getChildAllocation, getInsideAllocation, getLeftInset, getRightInset, getTopInset, getView, getViewAtPoint, getViewAtPosition, getViewCount, insert, isAfter, isBefore, loadChildren, modelToView, removeAll, replace, setInsets, setParagraphInsets, setParent, viewToModel
 
Methods inherited from class java.awt.swing.text.View
 breakView, changedUpdate, createFragment, getAlignment, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getParent, getPreferredSpan, getResizeWeight, getStartOffset, getView, getViewCount, getViewFactory, insertUpdate, modelToView, paint, preferenceChanged, removeUpdate, setParent, setSize, viewToModel
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableView.TableCell

public TableView.TableCell(TableView this$0,
                           Element elem)
Constructs a TableCell for the given element.
Parameters:
elem - the element that this view is responsible for
Method Detail

getColumnCount

public int getColumnCount()
Gets the number of columns this cell spans (eg. the grid width).
Returns:
the number of columns

getRowCount

public int getRowCount()
Gets the number of rows this cell spans (that is, the grid height).
Returns:
the number of rows

setGridLocation

public void setGridLocation(int row,
                            int col)
Sets the grid location. ???
Parameters:
row - the row
col - the column

getPreferredColumnSpan

public int getPreferredColumnSpan()
Gets the preferred span for the column occupied. This is basically the host's desired column span. The host divides its desired across the number of grid points.
Returns:
the span

paint

public void paint(Graphics g,
                  Shape allocation)
Renders using the given rendering surface and area on that surface. This is implemented to delegate to the superclass after adjusting the allocation if needed because the cell spans multiple grid points (eg. muliple columns and/or rows).
Parameters:
g - the rendering surface to use
allocation - the allocated region to render into
Overrides:
paint in class BoxView
See Also:
paint

getPreferredSpan

public float getPreferredSpan(int axis)
Determines the preferred span for this view along an axis. For the x axis, this is implemented to return the column width for the grid location that this cell lives at. This is the method that is effectively controlling the layout of the table. Cells can be independantly altered by re-implementing this method.
Parameters:
axis - may be either X_AXIS or Y_AXIS
Overrides:
getPreferredSpan in class BoxView

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
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.