edu.umd.cfar.lamp.apploader.misc
Class TableEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byjava.awt.AWTEvent
          extended byedu.umd.cfar.lamp.apploader.misc.TableEvent
All Implemented Interfaces:
java.io.Serializable

public class TableEvent
extends java.awt.AWTEvent

An event that indicates a user interaction on a JTable. It is a little higher-level than a MouseEvent. Note that the events are all called 'clicks', but there is nothing preventing them from being generated in other ways.

See Also:
Serialized Form

Field Summary
static int ACTION_CLICK
          Indicates a click asking for an action to occur.
static int ALT_CLICK
          Indicates a click asking for an alternate click.
static int CENTER
          Places the click in the center of the cell.
static int CONTEXT_CLICK
          Indicates a click asking for a context information.
static int EAST
          Places the click in the east of the cell.
static int MAIN_CLICK
          Indicates is the standard click type.
static int SOUTH
          Places the click in the south of the cell.
static int SOUTHEAST
          Places the click in the southeast of the cell.
static int SOUTHWEST
          Places the click in the southwest of the cell.
static int TABLE_EVENT_ID
          An arbitrary number selected to indicate the event type.
static int WEST
          Places the click in the west of the cell.
 
Fields inherited from class java.awt.AWTEvent
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, 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
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
TableEvent(java.lang.Object source, int type, int row, int column, int direction)
          Creates a new event for the given source table of the given type at the specified cell
 
Method Summary
 int getColumn()
          Get the column of the cell-recipient of the event.
 int getDirection()
          Gets the direction in the cell where the event occurred, e.g.
 int getRow()
          Get the row of the cell-recipient of the event
 int getType()
          Get the type of interaction event.
 boolean onEdge()
          Detects if the click was slightly to the east or south of the clicked cell.
 
Methods inherited from class java.awt.AWTEvent
consume, getID, isConsumed, paramString, setSource, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTEXT_CLICK

public static final int CONTEXT_CLICK
Indicates a click asking for a context information. This is currently bound to 'BUTTON_2'.

See Also:
Constant Field Values

MAIN_CLICK

public static final int MAIN_CLICK
Indicates is the standard click type. This is currently bound to 'BUTTON_1'.

See Also:
Constant Field Values

ALT_CLICK

public static final int ALT_CLICK
Indicates a click asking for an alternate click. This is currently bound to 'BUTTON_3'.

See Also:
Constant Field Values

ACTION_CLICK

public static final int ACTION_CLICK
Indicates a click asking for an action to occur. This is currently bound to a double click of 'BUTTON_1'.

See Also:
Constant Field Values

CENTER

public static final int CENTER
Places the click in the center of the cell.

See Also:
Constant Field Values

EAST

public static final int EAST
Places the click in the east of the cell.

See Also:
Constant Field Values

SOUTH

public static final int SOUTH
Places the click in the south of the cell.

See Also:
Constant Field Values

SOUTHEAST

public static final int SOUTHEAST
Places the click in the southeast of the cell.

See Also:
Constant Field Values

WEST

public static final int WEST
Places the click in the west of the cell.

See Also:
Constant Field Values

SOUTHWEST

public static final int SOUTHWEST
Places the click in the southwest of the cell.

See Also:
Constant Field Values

TABLE_EVENT_ID

public static final int TABLE_EVENT_ID
An arbitrary number selected to indicate the event type.

See Also:
Constant Field Values
Constructor Detail

TableEvent

public TableEvent(java.lang.Object source,
                  int type,
                  int row,
                  int column,
                  int direction)
Creates a new event for the given source table of the given type at the specified cell

Parameters:
source - The table that contains the event
type - The type of event
row - of the cell with the event
column - column of the cell with the event
direction -
Method Detail

getColumn

public int getColumn()
Get the column of the cell-recipient of the event.

Returns:
The column that contained the click.

getRow

public int getRow()
Get the row of the cell-recipient of the event. -1 is the header.

Returns:
The row that contained the click.

getType

public int getType()
Get the type of interaction event.

Returns:
The type of interaction event.

onEdge

public boolean onEdge()
Detects if the click was slightly to the east or south of the clicked cell. Useful for double-click on edge of a column.

Returns:
true iff the user clicked on the edge of the cell.

getDirection

public int getDirection()
Gets the direction in the cell where the event occurred, e.g. SOUTHWEST of CENTER.

Returns:
the direction