be.ugent.caagt.swirl.tables

Class TableColumnIcon

Implemented Interfaces:
Cloneable, TableColumnDecoration

public class TableColumnIcon
extends java.lang.Object
implements TableColumnDecoration

Simple table column decoration that displays a fixed icon and does not interpret mouse events.

Constructor Summary

TableColumnIcon(Icon icon)
Create a decoration for the given icon.

Method Summary

TableColumnIcon
copy()
Makes a copy of this object.
int
getDecorationHeight()
Return the height of this decoration.
int
getDecorationWidth()
Return the width of this decoration.
void
mouseEntered()
Signals that the mouse pointer entered the bounds of this decoration.
void
mouseExited()
Signals that the mouse pointer exited the bounds of this decoration.
void
mousePressed()
Signals that the mouse button was pressed inside the bounds of this decoration.
void
mouseReleased()
Signals that the mouse button was released after being pressed inside the bounds of this decoration.
void
paintDecoration(Component c, Graphics g, int x, int y)
Paint this decoration.
void
setColumnIndex(int columnIndex)
Called to indicate that this decoration has been associated with the given table column.

Constructor Details

TableColumnIcon

public TableColumnIcon(Icon icon)
Create a decoration for the given icon.

Method Details

copy

public TableColumnIcon copy()
Makes a copy of this object. This is typically implemented as (MyDecoration)super.clone() where MyDecoration is a class that implements this interface, surrounded by a try-catch clause which caches the CloneNotSupportedException.
Specified by:
copy in interface TableColumnDecoration

getDecorationHeight

public int getDecorationHeight()
Return the height of this decoration.
Specified by:
getDecorationHeight in interface TableColumnDecoration

getDecorationWidth

public int getDecorationWidth()
Return the width of this decoration.
Specified by:
getDecorationWidth in interface TableColumnDecoration

mouseEntered

public void mouseEntered()
Signals that the mouse pointer entered the bounds of this decoration.
Specified by:
mouseEntered in interface TableColumnDecoration

mouseExited

public void mouseExited()
Signals that the mouse pointer exited the bounds of this decoration.
Specified by:
mouseExited in interface TableColumnDecoration

mousePressed

public void mousePressed()
Signals that the mouse button was pressed inside the bounds of this decoration.
Specified by:
mousePressed in interface TableColumnDecoration

mouseReleased

public void mouseReleased()
Signals that the mouse button was released after being pressed inside the bounds of this decoration.
Specified by:
mouseReleased in interface TableColumnDecoration

paintDecoration

public void paintDecoration(Component c,
                            Graphics g,
                            int x,
                            int y)
Paint this decoration.
Specified by:
paintDecoration in interface TableColumnDecoration

setColumnIndex

public void setColumnIndex(int columnIndex)
Called to indicate that this decoration has been associated with the given table column.
Specified by:
setColumnIndex in interface TableColumnDecoration
Parameters:
columnIndex - Column index in the data model.