de.jaret.util.ui.table.renderer
Class SmileyCellRenderer

java.lang.Object
  extended by de.jaret.util.ui.table.renderer.RendererBase
      extended by de.jaret.util.ui.table.renderer.CellRendererBase
          extended by de.jaret.util.ui.table.renderer.SmileyCellRenderer
All Implemented Interfaces:
ICellRenderer

public class SmileyCellRenderer
extends CellRendererBase
implements ICellRenderer

Fun renderer rendering an integer as a smiley.

Version:
$Id: SmileyCellRenderer.java 179 2007-01-07 17:37:50Z olk $
Author:
Peter Kliem

Field Summary
 
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
SmileyCellRenderer()
           
SmileyCellRenderer(org.eclipse.swt.printing.Printer printer)
           
 
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.
 
Methods inherited from class de.jaret.util.ui.table.renderer.CellRendererBase
applyInsets, drawBackground, drawBorder, drawCommentMarker, drawFocus, drawSelection, getBackgroundColor, getBorderColor, getFont, getForegroundColor, getInnerWidth, getPreferredHeight, getPreferredWidth, 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
getPreferredHeight, getPreferredWidth, getTooltip
 

Constructor Detail

SmileyCellRenderer

public SmileyCellRenderer(org.eclipse.swt.printing.Printer printer)

SmileyCellRenderer

public SmileyCellRenderer()
Method Detail

draw

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 a single cell. The draw method should be null safe (handling null as the cell value).

Specified by:
draw in interface ICellRenderer
Parameters:
gc - GC to paint on
jaretTable - table the rendering is for
cellStyle - style of the cell
drawingArea - rectangle to draw within
row - row of the cell to paint
column - column of the cell to paint
drawFocus - true if a focus mark should be drawn
selected - true if the cell is currently selected
printing - true if the render operation is for a printer

dispose

public void dispose()
If there are resources to free - this is the place.

Specified by:
dispose in interface ICellRenderer

createPrintRenderer

public ICellRenderer createPrintRenderer(org.eclipse.swt.printing.Printer printer)
Create a renderer connfigured for printing.

Specified by:
createPrintRenderer in interface ICellRenderer
Parameters:
printer - printer to use
Returns:
a configured renderer for printing


Copyright © 2012. All Rights Reserved.