JHotDraw 6.0b1

Class ToggleGridCommand

  extended by org.jhotdraw.standard.AbstractCommand
      extended by org.jhotdraw.standard.ToggleGridCommand
All Implemented Interfaces:
FigureSelectionListener, Command

public class ToggleGridCommand
extends AbstractCommand

A command to toggle the snap to grid behavior.

Nested Class Summary
Nested classes/interfaces inherited from class org.jhotdraw.standard.AbstractCommand
Constructor Summary
ToggleGridCommand(java.lang.String name, DrawingEditor newDrawingEditor, java.awt.Point grid)
          Constructs a toggle grid command.
Method Summary
 void execute()
          Executes the command.
Methods inherited from class org.jhotdraw.standard.AbstractCommand
addCommandListener, createEventDispatcher, createViewChangeListener, dispose, figureSelectionChanged, getDrawingEditor, getEventDispatcher, getUndoActivity, isExecutable, isExecutableWithView, isViewRequired, name, removeCommandListener, setName, setUndoActivity, view, viewCreated, viewDestroying, viewSelectionChanged
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ToggleGridCommand(java.lang.String name,
                         DrawingEditor newDrawingEditor,
                         java.awt.Point grid)
Constructs a toggle grid command.

name - the command name
newDrawingEditor - editor
grid - the grid size. A grid size of 1,1 turns grid snapping off.
Method Detail


public void execute()
Description copied from class: AbstractCommand
Executes the command.

Specified by:
execute in interface Command
execute in class AbstractCommand

JHotDraw 6.0b1