|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.standard.AbstractCommand
Nested Class Summary | |
static class |
AbstractCommand.EventDispatcher
|
Constructor Summary | |
AbstractCommand(java.lang.String newName,
DrawingEditor newDrawingEditor)
Constructs a command with the given name that applies to the given view. |
|
AbstractCommand(java.lang.String newName,
DrawingEditor newDrawingEditor,
boolean newIsViewRequired)
|
Method Summary | |
void |
addCommandListener(CommandListener newCommandListener)
|
protected AbstractCommand.EventDispatcher |
createEventDispatcher()
|
protected ViewChangeListener |
createViewChangeListener()
|
void |
dispose()
Releases resources associated with this command |
void |
execute()
Executes the command. |
void |
figureSelectionChanged(DrawingView view)
Sent when the figure selection has changed. |
DrawingEditor |
getDrawingEditor()
|
protected AbstractCommand.EventDispatcher |
getEventDispatcher()
|
Undoable |
getUndoActivity()
|
boolean |
isExecutable()
Tests if the command can be executed. |
protected boolean |
isExecutableWithView()
|
protected boolean |
isViewRequired()
|
java.lang.String |
name()
Gets the command name. |
void |
removeCommandListener(CommandListener oldCommandListener)
|
void |
setName(java.lang.String newName)
|
void |
setUndoActivity(Undoable newUndoableActivity)
|
DrawingView |
view()
Convenience method |
protected void |
viewCreated(DrawingView view)
Sent when a new view is created |
protected void |
viewDestroying(DrawingView view)
Send when an existing view is about to be destroyed. |
protected void |
viewSelectionChanged(DrawingView oldView,
DrawingView newView)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractCommand(java.lang.String newName, DrawingEditor newDrawingEditor)
newName
- java.lang.StringnewDrawingEditor
- the DrawingEditor which manages the viewspublic AbstractCommand(java.lang.String newName, DrawingEditor newDrawingEditor, boolean newIsViewRequired)
Method Detail |
protected void viewSelectionChanged(DrawingView oldView, DrawingView newView)
protected void viewCreated(DrawingView view)
protected void viewDestroying(DrawingView view)
public void figureSelectionChanged(DrawingView view)
FigureSelectionListener
figureSelectionChanged
in interface FigureSelectionListener
view
- a DrawingViewpublic DrawingEditor getDrawingEditor()
getDrawingEditor
in interface Command
public DrawingView view()
public java.lang.String name()
name
in interface Command
public void setName(java.lang.String newName)
public void dispose()
public void execute()
execute
in interface Command
public boolean isExecutable()
isExecutable
in interface Command
protected boolean isViewRequired()
protected boolean isExecutableWithView()
public Undoable getUndoActivity()
getUndoActivity
in interface Command
public void setUndoActivity(Undoable newUndoableActivity)
setUndoActivity
in interface Command
public void addCommandListener(CommandListener newCommandListener)
addCommandListener
in interface Command
public void removeCommandListener(CommandListener oldCommandListener)
removeCommandListener
in interface Command
protected AbstractCommand.EventDispatcher getEventDispatcher()
protected AbstractCommand.EventDispatcher createEventDispatcher()
protected ViewChangeListener createViewChangeListener()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |