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

Variable Index

 o CANCEL_EDIT
A cancel edit event.
 o CELLS_CLICKED
 o CELLS_RELEASED
A cell released event.
 o CLICK_EVT
A cells clicked event.
 o COMMIT_EDIT
A commit edit event.
 o DOUBLE_CLICK_EVT
A double clicked event.
 o DOUBLE_CLICKED
 o RESIZE_COL
A resize column event.
 o RESIZE_ROW
A resize row event.
 o SEL_CHANGED
A selection changed event.
 o SORT_COL
A sort column event.
 o START_EDIT
A start edit event.

Constructor Index

 o GridEvent(Object, int, int, int, int)
Constructs a new GridEvent Object with the specified eventType and row and column values.

Method Index

 o getColumn()
Returns the column coordinate for the event.
 o getEventType()
Returns the type of GridEvent.
 o getRow()
Returns the row coordinate for the event.
 o paramString()
Returns the type of GridEvent.

Variables

 o CLICK_EVT
 public static final int CLICK_EVT
A cells clicked event.

 o CELLS_CLICKED
 public static final int CELLS_CLICKED
 o DOUBLE_CLICK_EVT
 public static final int DOUBLE_CLICK_EVT
A double clicked event.

 o DOUBLE_CLICKED
 public static final int DOUBLE_CLICKED
 o 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.

 o START_EDIT
 public static final int START_EDIT
A start edit event. This event is generated when editing is activated in a cell.

 o 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.

 o 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.

 o RESIZE_ROW
 public static final int RESIZE_ROW
A resize row event. This event is generated when the user resizes a row.

 o RESIZE_COL
 public static final int RESIZE_COL
A resize column event. This event is generated when the user resizes a column.

 o 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.

 o SEL_CHANGED
 public static final int SEL_CHANGED
A selection changed event. This event is generated whenever the GridPanel's selection changes.

Constructors

 o 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.

Methods

 o 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.

 o 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.

 o 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

 o 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