|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ContextualActionProvider
Implementing objects can provide actions possibly dependant on context information (position and target object)
Field Summary | |
---|---|
static int |
EDITOR_CONTEXT
|
static int |
MOUSE_OUT_CONTEXT
|
static int |
MOUSE_OVER_CONTEXT
|
static int |
MOUSE_PRESSED_CONTEXT
|
static int |
SHAPELIST_CONTEXT
|
static int |
SOURCELIST_CONTEXT
|
Method Summary | |
---|---|
boolean |
canDoAction(double x,
double y,
java.lang.Object o,
java.lang.String action,
int context)
Returns true if, and only if, it is possible to do the action right now |
boolean |
doAction(double x,
double y,
java.lang.Object o,
java.lang.String action,
javax.swing.undo.CompoundEdit undoableEdit)
Do one of the actions previously declared by getAction. |
java.lang.String[] |
getActions(double x,
double y,
java.lang.Object o,
int context)
Return list of possible actions the contect information may be used, or not. |
Field Detail |
---|
static final int EDITOR_CONTEXT
static final int SOURCELIST_CONTEXT
static final int MOUSE_OVER_CONTEXT
static final int MOUSE_OUT_CONTEXT
static final int MOUSE_PRESSED_CONTEXT
static final int SHAPELIST_CONTEXT
Method Detail |
---|
java.lang.String[] getActions(double x, double y, java.lang.Object o, int context)
x
- Coordinate, mouse position in the same unit as contains(x,y)y
- Coordinate, mouse position in the same unit as contains(x,y)o
- Object the actions should work on. Possibly null => default or all actionscontext
- one of the context defined in the ContextualActionProvider class
boolean doAction(double x, double y, java.lang.Object o, java.lang.String action, javax.swing.undo.CompoundEdit undoableEdit)
x
- Coordinate, for example mouse positiony
- Coordinate, for example mouse positiono
- Object the action should work on.action
- An action returned by a previous getActions call with the same x, y, o parameters
It may be null, in which case the default action is requested for this x,y,o.undoableEdit
- current edit for undo/redo operation
If not null, this action is undoable.
boolean canDoAction(double x, double y, java.lang.Object o, java.lang.String action, int context)
x
- Coordinate, for example mouse positiony
- Coordinate, for example mouse positiono
- Object the action should work on.action
- An action returned by a previous getActions call with the same x, y, o parameters
It may be null, in which case the default action is requested for this x,y,o.context
- one of the context defined in the ContextualActionProvider class
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |