csheets.ui.ext
Class TableDecorator

java.lang.Object
  extended by csheets.ui.ext.TableDecorator

public abstract class TableDecorator
extends Object

A table decorator visualizes extension-specific data by drawing on top of a table's graphics context. Decorators should respect the enabled state set on them.

Author:
Einar Pehrson

Field Summary
protected  boolean enabled
          Whether the decorator should be used when rendering, default is false
 
Constructor Summary
TableDecorator()
          Creates a new table decorator.
 
Method Summary
abstract  void decorate(Graphics g, SpreadsheetTable table)
          Decorates the given graphics context, by drawing visualizations of extension-specific data on it.
 boolean isEnabled()
          Returns whether the decorator should be used when rendering.
 void setEnabled(boolean enabled)
          Sets whether the decorator should be used when rendering.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enabled

protected boolean enabled
Whether the decorator should be used when rendering, default is false

Constructor Detail

TableDecorator

public TableDecorator()
Creates a new table decorator.

Method Detail

decorate

public abstract void decorate(Graphics g,
                              SpreadsheetTable table)
Decorates the given graphics context, by drawing visualizations of extension-specific data on it.

Parameters:
g - the graphics context on which drawing should be done
table - the table displaying the spreadsheet to visualize

isEnabled

public final boolean isEnabled()
Returns whether the decorator should be used when rendering.

Returns:
true if the decorator should be used when rendering

setEnabled

public final void setEnabled(boolean enabled)
Sets whether the decorator should be used when rendering.

Parameters:
enabled - whether the decorator should be used when rendering