Overview | Package | Class | Tree | Deprecated | Index | Help Java Platform
1.1.7
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class com.sun.java.swing.text.TableView.TableCell

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

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


Fields inherited from class com.sun.java.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 (e.g. the grid width).
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(java.awt.Graphics g, java.awt.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 com.sun.java.swing.text.BoxView
changedUpdate, childAllocation, getAlignment, getHeight, getPreferredSpan, getResizeWeight, getViewAtPoint, getWidth, insertUpdate, isAfter, isAllocationValid, isBefore, layout, modelToView, paint, paintChild, preferenceChanged, removeUpdate, replace, setSize, viewToModel
 
Methods inherited from class com.sun.java.swing.text.CompositeView
append, childAllocation, getBottomInset, getChildAllocation, getInsideAllocation, getLeftInset, getRightInset, getTopInset, getViewAtPoint, getViewAtPosition, getView, getViewCount, insert, isAfter, isBefore, loadChildren, modelToView, removeAll, replace, setInsets, setParagraphInsets, setParent, viewToModel
 
Methods inherited from class com.sun.java.swing.text.View
breakView, changedUpdate, createFragment, getAlignment, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getParent, getPreferredSpan, getResizeWeight, getStartOffset, getViewCount, getViewFactory, getView, insertUpdate, modelToView, paint, preferenceChanged, removeUpdate, setParent, setSize, viewToModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, 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 (e.g. 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 >= 0
col - the column >= 0

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(java.awt.Graphics g,
                  java.awt.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 View.X_AXIS or View.Y_AXIS
Overrides:
getPreferredSpan in class BoxView

Overview | Package | Class | Tree | Deprecated | Index | Help Java Platform
1.1.7
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

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