|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jaret.util.ui.table.renderer.RendererBase
de.jaret.util.ui.table.renderer.CellRendererBase
de.jaret.util.ui.table.renderer.ClassImageRenderer
public class ClassImageRenderer
CellRenderer rendering images corresponding to the class of the value.
| Field Summary | |
|---|---|
protected java.util.Map<java.lang.Class,java.lang.String> |
_keyMap
|
| 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 | |
|---|---|
ClassImageRenderer()
|
|
ClassImageRenderer(org.eclipse.swt.printing.Printer printer)
|
|
| Method Summary | |
|---|---|
void |
addClassImageDescriptorMapping(java.lang.Class<?> clazz,
java.lang.String key,
org.eclipse.jface.resource.ImageDescriptor imageDescriptor)
Add a mapping between a class and an image descriptor. |
void |
addClassRessourceNameMapping(java.lang.Class<?> clazz,
java.lang.String key,
java.lang.String ressourceName)
Add a mapping between a class and an image ressource. |
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. |
protected java.lang.String |
getKeyForClass(java.lang.Class<?> clazz)
Retrieve the key for a class, checking all super classes and interfaces. |
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.util.Map<java.lang.Class,java.lang.String> _keyMap
| Constructor Detail |
|---|
public ClassImageRenderer(org.eclipse.swt.printing.Printer printer)
public ClassImageRenderer()
| Method Detail |
|---|
public void addClassImageDescriptorMapping(java.lang.Class<?> clazz,
java.lang.String key,
org.eclipse.jface.resource.ImageDescriptor imageDescriptor)
clazz - the classkey - string key (has to be non null an unique for this renderer) to identfy the objectimageDescriptor - image descriptor for the image
public void addClassRessourceNameMapping(java.lang.Class<?> clazz,
java.lang.String key,
java.lang.String ressourceName)
clazz - classkey - string key (has to be non null an unique for this renderer) to identfy the objectressourceName - ressource pathprotected java.lang.String getKeyForClass(java.lang.Class<?> clazz)
clazz - class to check
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 ICellRenderergc - 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 printer
public int getPreferredWidth(java.util.List<IRow> rows,
IColumn column)
getPreferredWidth in interface ICellRenderergetPreferredWidth in class CellRendererBaserows - 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 ICellRenderergetPreferredHeight in class CellRendererBasegc - 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 ICellRendererpublic ICellRenderer createPrintRenderer(org.eclipse.swt.printing.Printer printer)
createPrintRenderer in interface ICellRendererprinter - printer to use
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||