public interface Command
Modifier and Type | Method and Description |
---|---|
default Command |
copy()
Makes a deep copy of this command.
|
CommandResult |
executeCommand(Gadget gadget,
String parameter,
int x,
int y)
Actually executes this command with specified parameter and in
specified context.
|
boolean |
prepareCommand(Gadget gadget,
String parameter,
int x,
int y)
Tests whether this command can be executed with specified parameter
and in specified context.
|
boolean prepareCommand(Gadget gadget, String parameter, int x, int y)
If the command can be executed, this method returns
true
after having configured its internal state for
consumption by method executeCommand(com.xmlmind.xmledit.gadget.Gadget, java.lang.String, int, int)
which should be invoked
immediately after this one.
Returns false
if this command cannot be executed with
specified parameter and in specified context.
gadget
- the target of this commandparameter
- parameterizes the command (that is, modifies the
behavior of the command in a command specific way)x
- X position relative to gadget of the mouse event
having triggered this command; -1 if this command was triggered by a
keyboard inputy
- Y position relative to gadget of the mouse event
having triggered this command; -1 if this command was triggered by a
keyboard inputCommandResult executeCommand(Gadget gadget, String parameter, int x, int y)
This method assumes that prepareCommand(com.xmlmind.xmledit.gadget.Gadget, java.lang.String, int, int)
has been
successfully invoked immediately before its own invocation.
gadget
- the target of this commandparameter
- parameterizes the command (that is, modifies the
behavior of the command in a command specific way)x
- X position relative to gadget of the mouse event
having triggered this command; -1 if this command was triggered by a
keyboard inputy
- Y position relative to gadget of the mouse event
having triggered this command; -1 if this command was triggered by a
keyboard inputnull
default Command copy()
null
if how to copy this command
cannot be determined