public interface GlobalOperation extends Operation
operation
which is not activated and deactivated but invoked instantly. Meant for
global operations that do not require the user to interact with the map while the operation is active.
Operations implementing this interface will receive a regular, momentary button on the Tools panel, rather than a toggle button.
The Operation.isActive()
, Operation.setActive(boolean)
, Operation.getOptionsPanel()
and Operation.interrupt()
methods
will never be invoked for operations which implement this interface. Instead, the invoke()
method is invoked
once when the button is pushed.
Modifier and Type | Method and Description |
---|---|
void |
invoke()
Invoked when the user presses the tool button for this operation.
|
getDescription, getIcon, getName, getOptionsPanel, interrupt, isActive, setActive, setView
void invoke()
To obtain a window to use as parent for such a dialog, the implementation may use the view that was set
earlier by invoking Operation.setView(WorldPainterView)
:
Window window = SwingUtilities.getWindowAncestor(view)
To obtain the dimension that is currently being edited, the implementation may also use the view:
Dimension dimension = view.getDimension()Note: it is strongly recommended that if the operation opens windows, that it be application modal windows so that the user cannot perform any other actions while it is open. Otherwise, the potential for confusion and problems by mulitple windows being open, or windows remaining open containing state belonging to dimensions or worlds which have already been closed, is great.