public interface Operation
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDescription()
Get the short description of the operation.
|
java.awt.image.BufferedImage |
getIcon()
Get the icon of the operation.
|
java.lang.String |
getName()
Get the short name of the operation.
|
javax.swing.JPanel |
getOptionsPanel()
Get the options panel of the operation, if any.
|
void |
interrupt()
Interrupt the operation if it is a continuous operations that is
currently in progress (for instance because a button is being held down).
|
boolean |
isActive()
Determine whether the operation is currently active.
|
void |
setActive(boolean active)
Activate or deactivate the operation.
|
void |
setView(WorldPainterView view)
Set the
WorldPainterView with which the operation should
associate. |
void setView(WorldPainterView view)
WorldPainterView
with which the operation should
associate. Will be invoked once by WorldPainter when the operation is
initialised.view
- The WorldPainterView
with which the operation
should associate.java.lang.String getName()
java.lang.String getDescription()
boolean isActive()
true
if the operation is currently active.void setActive(boolean active) throws java.beans.PropertyVetoException
Please note: it is the operation's own responsibility to install listeners, etc. on the view if necessary to detect user activity while the operation is active, and uninstall them when deactivated.
active
- Whether the operation should activatate itself (when
true
) or deactivate itself (when
false
).java.beans.PropertyVetoException
- If the operation failed to activate for
some reason, for instance because some dependency is not met, or some
state is inappropriate.java.awt.image.BufferedImage getIcon()
javax.swing.JPanel getOptionsPanel()
null
if the operation has no options.void interrupt()