| net.refractions.udig.project.ui.commands.IDrawCommand
All known Subclasses: net.refractions.udig.tools.edit.commands.DrawEndPointsCommand, net.refractions.udig.project.ui.internal.commands.draw.AbstractDrawCommand, net.refractions.udig.project.ui.commands.AbstractDrawCommand,
IDrawCommand | public interface IDrawCommand extends MapCommand(Code) | | Draw commands do not change the model, rather they simply draw on the top-most layer. They are
primarily used to provide user feedback. For example the rubber-banding box drawn by the victim
selection tool is drawn using a DrawCommand. The rubber-banding box is a decoration for the user,
other commands employed byt the tool change the model. One class of commands that modifies the
models are the EditCommands. They edit the features themselves. Because draw commands are
executed every paint, instead of once like other types of commands, each DrawCommand has a valid
flag which is set false when the lifetime of the command is up. Once the valid flag is set to
false the command will be removed from the command stack the next update. The command must be
resent if the command is to be drawn again.
author: jeichar since: 0.3 See Also: MapCommand |
Method Summary | |
public void | dispose() Disposes of any resources that need to be disposed of. | public Rectangle | getValidArea() Returns the rectangle where this command is valid. | public boolean | isValid() Returns whether the current command should be drawn. | public void | setGraphics(ViewportGraphics graphics, IMapDisplay display) Sets the graphics2D that this command will draw on. | public void | setValid(boolean valid) Sets whether the current command should be drawn. |
dispose | public void dispose()(Code) | | Disposes of any resources that need to be disposed of.
Called by the framework when draw command is removed from the viewport pane.
|
getValidArea | public Rectangle getValidArea()(Code) | | Returns the rectangle where this command is valid. Ie The area that this command draws to.
Null may be returned if the valid area is unknown or is the entire screen.
Returns the rectangle where this command is valid. Ie The area that this command draws to.Null may be returned if the valid area is unknown or is the entire screen. |
isValid | public boolean isValid()(Code) | | Returns whether the current command should be drawn. If not then it will be removed from the
draw stack. Default value is true;
true if the command should be drawn. |
setGraphics | public void setGraphics(ViewportGraphics graphics, IMapDisplay display)(Code) | | Sets the graphics2D that this command will draw on. Will be called before execution of
command
Parameters: graphics - the graphics2D that this command will draw on Parameters: display - The display area that will be draw on. See Also: ViewportGraphics See Also: IMapDisplay |
setValid | public void setValid(boolean valid)(Code) | | Sets whether the current command should be drawn. If not then it will be removed from the
draw stack. Default value is true;
Parameters: valid - true if the command should be drawn. |
|
|