com.objectplanet.gui
Class TableEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byjava.awt.AWTEvent
          extended bycom.objectplanet.gui.TableEvent
All Implemented Interfaces:
java.io.Serializable

public class TableEvent
extends java.awt.AWTEvent

This class represents the different events generated by the table and sent to the table listeners.

The following events are generated by the table at runtime:

Author:
Bjorn J. Kvande.
See Also:
Serialized Form

Field Summary
static int DATA_LOADED
          The data finished loading event.
static int DESELECTED
          The de-selection event
static int DOUBLE_CLICK
          The double-click selection event.
static int FILTER
          The filtering event.
static int RIGHT_CLICK
          The right-click selection event.
static int SCROLL
          The row scrolling event.
static int SEARCH
          The search event.
static int SELECTED
          The selection event
static int SORT
          The sorting event.
static int TABLE_ID_MASK
          The table event ID
 
Fields inherited from class java.awt.AWTEvent
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK
 
Constructor Summary
TableEvent(java.lang.Object source, int type)
          Creates a new table event with the specified event type.
TableEvent(java.lang.Object source, int type, int column)
          Creates a new table event.
TableEvent(java.lang.Object source, int type, int rowPos, int rowIndex)
          Creates a new table event.
TableEvent(java.lang.Object source, int type, java.awt.Point position)
          Creates a new table event with the specified event type and mouse click position.
TableEvent(java.lang.Object source, java.lang.Object[] fields, int type, int column, int rowPos, int rowIndex, java.awt.Point pos)
          Creates a new table event.
 
Method Summary
 int getColumn()
          Gets the column index.
 java.lang.Object[] getFields()
          Gets the row fields.
 java.awt.Point getMousePosition()
          Gets the mouse position within the component where the event originated.
 int getRowIndex()
          Gets the row index.
 int getRowPos()
          Gets the row position.
 java.lang.Object getSelectedCell()
          Gets the cell that was selected.
 int getType()
          Gets the event type.
 java.lang.String toString()
          Returns a string representation of the event.
 
Methods inherited from class java.awt.AWTEvent
getID, paramString, setSource
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATA_LOADED

public static final int DATA_LOADED
The data finished loading event.

See Also:
Constant Field Values

DESELECTED

public static final int DESELECTED
The de-selection event

See Also:
Constant Field Values

DOUBLE_CLICK

public static final int DOUBLE_CLICK
The double-click selection event.

See Also:
Constant Field Values

FILTER

public static final int FILTER
The filtering event.

See Also:
Constant Field Values

RIGHT_CLICK

public static final int RIGHT_CLICK
The right-click selection event.

See Also:
Constant Field Values

SCROLL

public static final int SCROLL
The row scrolling event.

See Also:
Constant Field Values

SEARCH

public static final int SEARCH
The search event.

See Also:
Constant Field Values

SELECTED

public static final int SELECTED
The selection event

See Also:
Constant Field Values

SORT

public static final int SORT
The sorting event.

See Also:
Constant Field Values

TABLE_ID_MASK

public static final int TABLE_ID_MASK
The table event ID

See Also:
Constant Field Values
Constructor Detail

TableEvent

public TableEvent(java.lang.Object source,
                  int type)
Creates a new table event with the specified event type.

Parameters:
source - The table object that generated the event.
type - The event type. SELECTED, DESELECTED, DOUBLE_CLICK, RIGHT_CLICK, SORTED, FILTERED, or DATA_LOADED.

TableEvent

public TableEvent(java.lang.Object source,
                  int type,
                  int column)
Creates a new table event.

Parameters:
source - The table object that generated the event.
type - The event type. SELECTED, DESELECTED, DOUBLE_CLICK, RIGHT_CLICK, SORTED, FILTERED, DATA_LOADED, or SCROLLED.
column - The index of the column where the event originated.

TableEvent

public TableEvent(java.lang.Object source,
                  int type,
                  int rowPos,
                  int rowIndex)
Creates a new table event.

Parameters:
source - The table object that generated the event.
type - The event type. SELECTED, DESELECTED, DOUBLE_CLICK, RIGHT_CLICK, SORTED, FILTERED, DATA_LOADED, or SCROLLED.
rowPos - The row position.
rowIndex - The index of the row selected.

TableEvent

public TableEvent(java.lang.Object source,
                  int type,
                  java.awt.Point position)
Creates a new table event with the specified event type and mouse click position.

Parameters:
source - The table object that generated the event.
type - The event type. SELECTED, DESELECTED, DOUBLE_CLICK, RIGHT_CLICK, SORTED, FILTERED, or DATA_LOADED.
position - The mouse click position.

TableEvent

public TableEvent(java.lang.Object source,
                  java.lang.Object[] fields,
                  int type,
                  int column,
                  int rowPos,
                  int rowIndex,
                  java.awt.Point pos)
Creates a new table event.

Parameters:
source - The table object that generated the event.
fields - The fields of the row selected.
type - The event type. SELECTED, DESELECTED, DOUBLE_CLICK, RIGHT_CLICK, SORTED, FILTERED, DATA_LOADED, or SCROLLED.
column - The index of the column selected.
rowPos - The row position.
rowIndex - The index of the row selected.
pos - The mouse position.
Method Detail

getColumn

public int getColumn()
Gets the column index. On a row DESELECTION event, this will be unknown, -1.

Returns:
The column position, first column has value 0.

getFields

public java.lang.Object[] getFields()
Gets the row fields. This is a copy of the row in the table, so changing fields in this directly has no effect on the data in the table.

Returns:
The fields if set, or null if not set.

getMousePosition

public java.awt.Point getMousePosition()
Gets the mouse position within the component where the event originated.

Returns:
A position object, or null if the position was not recorded.

getRowIndex

public int getRowIndex()
Gets the row index. On a row DESELECTION event, this will be unknown -1.

Returns:
The row position, first row has value 0.

getRowPos

public int getRowPos()
Gets the row position. On a row DESELECTION event, this will be unknown -1.

Returns:
The row position, first row has value 0.

getSelectedCell

public java.lang.Object getSelectedCell()
Gets the cell that was selected.

Returns:
A String object, or null if no cell was selected.

getType

public int getType()
Gets the event type.

Returns:
SELECTED, DESELECTED, DOUBLE_CLICK, RIGHT_CLICK, SORTED, FILTERED, DATA_LOADED, or SCROLLED.

toString

public java.lang.String toString()
Returns a string representation of the event.