|
ReportCat 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectli.netcat.print.table.DefaultTableCellDrawer
Default implementation of a TableCellDrawer
that uses a LabelDrawer
for rendering.
Constructor Summary | |
DefaultTableCellDrawer()
Constructs and initializes a new DefaultTableCellDrawer . |
|
DefaultTableCellDrawer(int horizontalAlignment)
Constructs and initializes a new DefaultTableCellDrawer . |
Method Summary | |
void |
draw(java.awt.Graphics g,
java.lang.Object value,
java.lang.Object type,
int x,
int y,
int width,
int height,
int rowIndex,
int columnIndex)
Draws the given value to the graphics within the given bounds. |
LabelDrawer |
getDrawer()
Returns the drawer that is used for rendering. |
protected javax.swing.Icon |
getIcon(java.lang.Object value,
java.lang.Object type,
int rowIndex,
int columnIndex)
Override this callback for icon conversion. |
int |
getMinimumWidth(java.awt.Graphics g,
java.lang.Object value,
java.lang.Object type,
int rowIndex,
int columnIndex)
Returns the minimum width of this cell drawer. |
int |
getPreferredHeight(java.awt.Graphics g,
java.lang.Object value,
java.lang.Object type,
int rowIndex,
int columnIndex,
int availableWidth)
Returns the preferred height of this cell drawer. |
int |
getPreferredWidth(java.awt.Graphics g,
java.lang.Object value,
java.lang.Object type,
int rowIndex,
int columnIndex)
Returns the preferred width of this cell drawer. |
protected java.lang.String |
getText(java.lang.Object value,
java.lang.Object type,
int rowIndex,
int columnIndex)
Override this callback for text conversion. |
void |
setDrawer(LabelDrawer drawer)
Sets the drawer that is used for rendering. |
void |
setMinimumWidth(int minWidth)
Sets the minimum width of this table cell drawer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultTableCellDrawer()
DefaultTableCellDrawer
.
public DefaultTableCellDrawer(int horizontalAlignment)
DefaultTableCellDrawer
.
horizontalAlignment
- The horizontal alignment, one of LEFT
, CENTER
or RIGHT
.Method Detail |
public LabelDrawer getDrawer()
public void setDrawer(LabelDrawer drawer)
drawer
- The drawer that is used for rendering, not null
.public void setMinimumWidth(int minWidth)
minWidth
- The minimum cell with.public int getMinimumWidth(java.awt.Graphics g, java.lang.Object value, java.lang.Object type, int rowIndex, int columnIndex)
TableCellDrawer
getMinimumWidth
in interface TableCellDrawer
g
- The relevant Graphics
object.value
- The data value retrieved from the model.type
- The data type retrieved from the model.rowIndex
- The absolute index of the row. For a header cell, this value is defined as -1,
for a footer cell, it is Integer.MAX_VALUE
.columnIndex
- The index of the column.
public int getPreferredWidth(java.awt.Graphics g, java.lang.Object value, java.lang.Object type, int rowIndex, int columnIndex)
TableCellDrawer
getPreferredWidth
in interface TableCellDrawer
g
- The relevant Graphics
object.value
- The data value retrieved from the model.type
- The data type retrieved from the model.rowIndex
- The absolute index of the row. For a header cell, this value is defined as -1,
for a footer cell, it is Integer.MAX_VALUE
.columnIndex
- The index of the column.
public int getPreferredHeight(java.awt.Graphics g, java.lang.Object value, java.lang.Object type, int rowIndex, int columnIndex, int availableWidth)
TableCellDrawer
getPreferredHeight
in interface TableCellDrawer
g
- The relevant Graphics
object.value
- The data value retrieved from the model.type
- The data type retrieved from the model.rowIndex
- The absolute index of the row. For a header cell, this value is defined as -1,
for a footer cell, it is Integer.MAX_VALUE
.columnIndex
- The index of the column.availableWidth
- The final available width of the cell.
public void draw(java.awt.Graphics g, java.lang.Object value, java.lang.Object type, int x, int y, int width, int height, int rowIndex, int columnIndex)
TableCellDrawer
draw
in interface TableCellDrawer
g
- The relevant graphics object to paint on.value
- The data value retrieved from the model.type
- The data type retrieved from the model.x
- The x coordinate of the upper left corner of the cell.y
- The y coordinate of the upper left corner of the cell.width
- The width of the cell.height
- The height of the cell.rowIndex
- The absolute index of the row. For a header cell, this value is defined as -1, for a footer cell, it is Integer.MAX_VALUE
.columnIndex
- The index of the column.protected java.lang.String getText(java.lang.Object value, java.lang.Object type, int rowIndex, int columnIndex)
value
- The value retrieved from the model.type
- The type retrieved from the model.rowIndex
- The absolute row index.columnIndex
- The absolute column index.
protected javax.swing.Icon getIcon(java.lang.Object value, java.lang.Object type, int rowIndex, int columnIndex)
value
- The value retrieved from the model.type
- The type retrieved from the model.rowIndex
- The absolute row index.columnIndex
- The absolute column index.
|
ReportCat 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |