|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.jaret.util.ui.table.renderer.RendererBase de.jaret.util.ui.table.renderer.CellRendererBase de.jaret.util.ui.table.renderer.BooleanCellRenderer
public class BooleanCellRenderer
CellRenderer rendering a Boolean to a checkbox image (default) or any other two images.
Field Summary | |
---|---|
protected java.lang.String |
_checkedRscName
rsc name for the checked state. |
protected java.lang.String |
_uncheckedRscName
default rsc name for the unchecked state. |
protected static java.lang.String |
CHECKED
key for checked image in registry. |
protected static java.lang.String |
UNCHECKED
key for unchecked image in registry. |
Fields inherited from class de.jaret.util.ui.table.renderer.CellRendererBase |
---|
_inset, BLACKRGB, FOCUSINSETS, SELECTIONCOLOR, WHITERGB |
Fields inherited from class de.jaret.util.ui.table.renderer.RendererBase |
---|
_printer, _scaleX, _scaleY, SCREEN_DPI_X, SCREEN_DPI_Y |
Constructor Summary | |
---|---|
BooleanCellRenderer()
Construct a boolean cell renderer for the display using default resources. |
|
BooleanCellRenderer(org.eclipse.swt.printing.Printer printer)
Construct a boolean cell renderer for a printer device using default resources. |
|
BooleanCellRenderer(org.eclipse.swt.printing.Printer printer,
java.lang.String checkedRscName,
java.lang.String uncheckedRscName)
Construct a boolean cell renderer for a printer device providing resource names. |
|
BooleanCellRenderer(java.lang.String checkedRscName,
java.lang.String uncheckedRscName)
Construct a boolean cell renderer for the display providing resource names. |
Method Summary | |
---|---|
ICellRenderer |
createPrintRenderer(org.eclipse.swt.printing.Printer printer)
Create a renderer connfigured for printing. |
void |
dispose()
If there are resources to free - this is the place. |
void |
draw(org.eclipse.swt.graphics.GC gc,
JaretTable jaretTable,
ICellStyle cellStyle,
org.eclipse.swt.graphics.Rectangle drawingArea,
IRow row,
IColumn column,
boolean drawFocus,
boolean selected,
boolean printing)
Draw a single cell. |
int |
getPreferredHeight(org.eclipse.swt.graphics.GC gc,
ICellStyle cellStyle,
int width,
IRow row,
IColumn column)
Calculate the preferred height of a specific cell. |
int |
getPreferredWidth(java.util.List<IRow> rows,
IColumn column)
Calculate the preferred width for the column. |
Methods inherited from class de.jaret.util.ui.table.renderer.CellRendererBase |
---|
applyInsets, drawBackground, drawBorder, drawCommentMarker, drawFocus, drawSelection, getBackgroundColor, getBorderColor, getFont, getForegroundColor, getInnerWidth, getTooltip, getVerticalSpacesSum, isInCommentMarkerArea |
Methods inherited from class de.jaret.util.ui.table.renderer.RendererBase |
---|
getPrinter, getScaleX, getScaleY, restoreGCAttributes, saveGCAttributes, scaleX, scaleY |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.jaret.util.ui.table.renderer.ICellRenderer |
---|
getTooltip |
Field Detail |
---|
protected java.lang.String _checkedRscName
protected java.lang.String _uncheckedRscName
protected static final java.lang.String CHECKED
protected static final java.lang.String UNCHECKED
Constructor Detail |
---|
public BooleanCellRenderer(org.eclipse.swt.printing.Printer printer)
printer
- printer devicepublic BooleanCellRenderer()
public BooleanCellRenderer(org.eclipse.swt.printing.Printer printer, java.lang.String checkedRscName, java.lang.String uncheckedRscName)
printer
- printer devicecheckedRscName
- resource path for the checked imageuncheckedRscName
- resource path for the unchecked imagepublic BooleanCellRenderer(java.lang.String checkedRscName, java.lang.String uncheckedRscName)
checkedRscName
- resource path for the checked imageuncheckedRscName
- resource path for the unchecked imageMethod Detail |
---|
public void draw(org.eclipse.swt.graphics.GC gc, JaretTable jaretTable, ICellStyle cellStyle, org.eclipse.swt.graphics.Rectangle drawingArea, IRow row, IColumn column, boolean drawFocus, boolean selected, boolean printing)
draw
in interface ICellRenderer
gc
- GC to paint onjaretTable
- table the rendering is forcellStyle
- style of the celldrawingArea
- rectangle to draw withinrow
- row of the cell to paintcolumn
- column of the cell to paintdrawFocus
- true if a focus mark should be drawnselected
- true if the cell is currently selectedprinting
- true if the render operation is for a printerpublic int getPreferredWidth(java.util.List<IRow> rows, IColumn column)
getPreferredWidth
in interface ICellRenderer
getPreferredWidth
in class CellRendererBase
rows
- the rows currently displayed by the tablecolumn
- the column for which the preferred width is to be calculated
public int getPreferredHeight(org.eclipse.swt.graphics.GC gc, ICellStyle cellStyle, int width, IRow row, IColumn column)
getPreferredHeight
in interface ICellRenderer
getPreferredHeight
in class CellRendererBase
gc
- GC that will usedcellStyle
- cell style of the cellwidth
- width of the column (thus of the cell)row
- rowcolumn
- column
public void dispose()
dispose
in interface ICellRenderer
public ICellRenderer createPrintRenderer(org.eclipse.swt.printing.Printer printer)
createPrintRenderer
in interface ICellRenderer
printer
- printer to use
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |