arlut.csd.JTable
Class tableCell

java.lang.Object
  |
  +--arlut.csd.JTable.tableCell

class tableCell
extends java.lang.Object

tableCell represents the contents of a single cell in the table. This class is responsible for the mechanics of word wrapping.


Field Summary
(package private)  arlut.csd.JTable.tableAttr attr
          An individual cell may have a special font and colors set..
(package private)  arlut.csd.JTable.tableCol col
          What column is this cell in? We use this not only to handle column-specific attributes, but also to get a reference to our baseTable when we need it for internal calculations.
(package private)  int currentWidth
           
(package private)  java.lang.Object data
          We may have a binary representation of the text displayed in this cell recorded for convenience.
(package private) static boolean debug
           
(package private)  int lastOfficialWidth
           
(package private)  int nominalWidth
           
(package private)  java.lang.String origText
          The non-word-wrapped text for this cell
private  int rowSpan
          How many rows has this cell been wrapped across?
(package private)  boolean selected
          Remember whether we are selected or not.
(package private)  java.lang.String text
          The word-wrapped text for this cell
 
Constructor Summary
tableCell(arlut.csd.JTable.tableCol col)
           
tableCell(arlut.csd.JTable.tableCol col, java.lang.String text)
           
tableCell(arlut.csd.JTable.tableCol col, java.lang.String text, arlut.csd.JTable.tableAttr attr)
           
 
Method Summary
private  void calcRowSpan()
           
 void clear()
          This method reinitializes the cell to its virgin state.
 int getCurrentWidth()
          This method returns the width of this cell at its widest point, after word wrapping has been performed.
 java.lang.Object getData()
          This method retrieves a piece of random attendant data held with this cell.
 java.awt.Font getFont()
          Return this cell's font
 int getJust()
          Return this cell's justification
 java.awt.FontMetrics getMetrics()
          Return the fontmetrics that apply to this cell.
 int getNominalWidth()
          This method returns the width that the cell's current text would have if not wrapped.
 int getRowSpan()
          This method returns the number of lines this cell desires to occupy.
 java.lang.String getText(int n)
          This method returns the nth row of this cell's text, where the first row is 0.
private  boolean isspace(char c)
           
 void refresh()
          This method refreshes the cell's measurements, and should be called after the fontmetrics for this cell have changed.
 void setData(java.lang.Object data)
          This method is used to record a piece of random attendant data with this cell.
 void setText(java.lang.String newText)
          This method sets the text for this cell.
 void wrap(int wrap_length)
          This method wraps the contained text to a certain number of pixels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

static final boolean debug
See Also:
Constant Field Values

origText

java.lang.String origText
The non-word-wrapped text for this cell


text

java.lang.String text
The word-wrapped text for this cell


data

java.lang.Object data
We may have a binary representation of the text displayed in this cell recorded for convenience.


attr

arlut.csd.JTable.tableAttr attr
An individual cell may have a special font and colors set.. if so, we'll track it with this variable.


selected

boolean selected
Remember whether we are selected or not.


col

arlut.csd.JTable.tableCol col
What column is this cell in? We use this not only to handle column-specific attributes, but also to get a reference to our baseTable when we need it for internal calculations.


nominalWidth

int nominalWidth

currentWidth

int currentWidth

lastOfficialWidth

int lastOfficialWidth

rowSpan

private int rowSpan
How many rows has this cell been wrapped across?

Constructor Detail

tableCell

public tableCell(arlut.csd.JTable.tableCol col,
                 java.lang.String text,
                 arlut.csd.JTable.tableAttr attr)

tableCell

public tableCell(arlut.csd.JTable.tableCol col,
                 java.lang.String text)

tableCell

public tableCell(arlut.csd.JTable.tableCol col)
Method Detail

clear

public void clear()
This method reinitializes the cell to its virgin state.


setText

public void setText(java.lang.String newText)
This method sets the text for this cell.


setData

public final void setData(java.lang.Object data)
This method is used to record a piece of random attendant data with this cell. It is used by rowTable to facilitate type-specific sorting.


getData

public final java.lang.Object getData()
This method retrieves a piece of random attendant data held with this cell. It is used by rowTable to facilitate type-specific sorting.


refresh

public void refresh()
This method refreshes the cell's measurements, and should be called after the fontmetrics for this cell have changed.


getMetrics

public java.awt.FontMetrics getMetrics()
Return the fontmetrics that apply to this cell.


getFont

public java.awt.Font getFont()
Return this cell's font


getJust

public int getJust()
Return this cell's justification


getCurrentWidth

public int getCurrentWidth()
This method returns the width of this cell at its widest point, after word wrapping has been performed.


getNominalWidth

public int getNominalWidth()
This method returns the width that the cell's current text would have if not wrapped.


getText

public java.lang.String getText(int n)
This method returns the nth row of this cell's text, where the first row is 0.


wrap

public void wrap(int wrap_length)
This method wraps the contained text to a certain number of pixels.

Parameters:
wrap_length - The width of the cell to wrap to, in pixels

isspace

private boolean isspace(char c)

calcRowSpan

private void calcRowSpan()

getRowSpan

public int getRowSpan()
This method returns the number of lines this cell desires to occupy.