This Package Previous Next Index
Class CoffeeTable.Grid.GridEvent
java.lang.Object
|
+----java.awt.Event
|
+----CoffeeTable.Grid.GridEvent
- public class GridEvent
- extends Event
GridEvent is an event generated by the GridPanel based on certain user actions
on the GridPanel. This event can be checked by any container of the GridPanel. The
event ID for this event is ACTION_EVENT and there are additional member variables
to provide event specific information.
Here is some sample code that shows how you can handle GridEvents generated by the
GridPanel component.
void gridPanel1_Action(Event event) {
if (event instanceof GridEvent) {
switch ( ((GridEvent)event).getEventType() ) {
case GridEvent.CLICK_EVT:
System.out.println(event.toString());
break;
case GridEvent.DOUBLE_CLICK_EVT:
System.out.println(event.toString());
break;
}
}
}
public boolean handleEvent(Event event) {
if (event.target == gridPanel1 && event.id == Event.ACTION_EVENT) {
gridPanel1_Action(event);
return true;
}
return super.handleEvent(event);
}
- Version:
- 1.2.10 of September 15, 1999 Copyright © 1996-1999 3magic
- Author:
- Anil Bajaj
-
CANCEL_EDIT
- A cancel edit event.
-
CELLS_CLICKED
-
-
CELLS_RELEASED
- A cell released event.
-
CLICK_EVT
- A cells clicked event.
-
COMMIT_EDIT
- A commit edit event.
-
DOUBLE_CLICK_EVT
- A double clicked event.
-
DOUBLE_CLICKED
-
-
RESIZE_COL
- A resize column event.
-
RESIZE_ROW
- A resize row event.
-
SEL_CHANGED
- A selection changed event.
-
SORT_COL
- A sort column event.
-
START_EDIT
- A start edit event.
-
GridEvent(Object, int, int, int, int)
- Constructs a new GridEvent Object with the specified eventType and row and column values.
-
getColumn()
- Returns the column coordinate for the event.
-
getEventType()
- Returns the type of GridEvent.
-
getRow()
- Returns the row coordinate for the event.
-
paramString()
- Returns the type of GridEvent.
CLICK_EVT
public static final int CLICK_EVT
- A cells clicked event.
CELLS_CLICKED
public static final int CELLS_CLICKED
DOUBLE_CLICK_EVT
public static final int DOUBLE_CLICK_EVT
- A double clicked event.
DOUBLE_CLICKED
public static final int DOUBLE_CLICKED
CELLS_RELEASED
public static final int CELLS_RELEASED
- A cell released event. This event is generated when the mouse is released after a CELLS_CLICKED event.
START_EDIT
public static final int START_EDIT
- A start edit event. This event is generated when editing is activated in a cell.
COMMIT_EDIT
public static final int COMMIT_EDIT
- A commit edit event. This event is generated when editing ends in a cell and the changes are commited.
CANCEL_EDIT
public static final int CANCEL_EDIT
- A cancel edit event. This event is generated when editing ends in a cell and the changes are canceled.
RESIZE_ROW
public static final int RESIZE_ROW
- A resize row event. This event is generated when the user resizes a row.
RESIZE_COL
public static final int RESIZE_COL
- A resize column event. This event is generated when the user resizes a column.
SORT_COL
public static final int SORT_COL
- A sort column event. This event is generated when the user clicks on a column header and sorts the column.
SEL_CHANGED
public static final int SEL_CHANGED
- A selection changed event. This event is generated whenever the GridPanel's selection changes.
GridEvent
public GridEvent(Object target,
int eventType,
int modifiers,
int col,
int row)
- Constructs a new GridEvent Object with the specified eventType and row and column values.
getRow
public int getRow()
- Returns the row coordinate for the event. If the row is 0, and the column is non-zero
then the event occured in the column header.
getColumn
public int getColumn()
- Returns the column coordinate for the event. If the column is 0, and the row is non-zero
then the event occured in the row header.
getEventType
public int getEventType()
- Returns the type of GridEvent. This specifies the type of GridEvent that occured. Possible
values are: CLICK_EVT, DOUBLE_CLICK_EVT
paramString
public String paramString()
- Returns the type of GridEvent. This specifies the type of GridEvent that occured. Possible
values are: CLICK_EVT, DOUBLE_CLICK_EVT
- Overrides:
- paramString in class Event
This Package Previous Next Index