Overview | File | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class draw2d.CommandStack

    Object
       |
       +--draw2d.CommandStack

class draw2d.CommandStack

Defined in CommandStack.js
Version: 0.9.14
Author: Andreas Herz

Field Summary
`<static> Object` | `POST_EXECUTE` Constant indicating notification after a command has been executed (value is 8).
`<static> Object` | `POST_MASK`
`<static> Object` | `POST_REDO` Constant indicating notification after a command has been redone (value is 16).
`<static> Object` | `POST_UNDO` Constant indicating notification after a command has been undone (value is 32).
`<static> Object` | `PRE_EXECUTE` Constant indicating notification prior to executing a command (value is 1).
`<static> Object` | `PRE_MASK`
`<static> Object` | `PRE_REDO` Constant indicating notification prior to redoing a command (value is 2).
`<static> Object` | `PRE_UNDO` Constant indicating notification prior to undoing a command (value is 4).

Constructor Summary
`draw2d.CommandStack ()`

Method Summary
`void` | `addCommandStackEventListener( <draw2d.CommandStackListener> listener)` Adds a listener to the command stack, which will be notified whenever a command has been processed on the stack.
`boolean` | `canRedo()`
`boolean` | `canUndo()`
`void` | `execute( <draw2d.Command> command)` Executes the specified Command if possible.
`void` | `markSaveLocation()` Remove the undo / redo history.
`void` | `notifyListeners( <draw2d.Command> command, <int> state)` Notifies command stack event listeners that the command stack has changed to the specified state.
`void` | `redo()` Redo the command after the user has undo this command
`void` | `removeCommandStackEventListener( <draw2d.CommandStackListener> listener)` Removes a listener from the command stack.
`void` | `setUndoLimit( <int> count)` Set the maximal undo stack size.
`void` | `undo()` Undo the command

Field Detail

### POST_EXECUTE

    <static> Object POST_EXECUTE

Constant indicating notification after a command has been executed (value is 8).

### POST_MASK

    <static> Object POST_MASK

### POST_REDO

    <static> Object POST_REDO

Constant indicating notification after a command has been redone (value is 16).

### POST_UNDO

    <static> Object POST_UNDO

Constant indicating notification after a command has been undone (value is 32).

### PRE_EXECUTE

    <static> Object PRE_EXECUTE

Constant indicating notification prior to executing a command (value is 1).

### PRE_MASK

    <static> Object PRE_MASK

### PRE_REDO

    <static> Object PRE_REDO

Constant indicating notification prior to redoing a command (value is 2).

### PRE_UNDO

    <static> Object PRE_UNDO

Constant indicating notification prior to undoing a command (value is 4).

Constructor Detail

### draw2d.CommandStack

    draw2d.CommandStack()

Version: 0.9.14
Author: Andreas Herz

Method Detail

### addCommandStackEventListener

    void addCommandStackEventListener( <draw2d.CommandStackListener> listener)

Adds a listener to the command stack, which will be notified whenever a command has been processed on the stack.

Parameters:

`listener` - the listener to add.

### canRedo

    boolean canRedo()

Returns:

`true` if it is appropriate to call ().

### canUndo

    boolean canUndo()

Returns:

`true` if () can be called

### execute

    void execute( <draw2d.Command> command)

Executes the specified Command if possible. Prior to executing the command, a draw2d.CommandStackEvent for PRE_EXECUTE will be fired to event listeners. Similarly, after attempting to execute the command, an event for POST_EXECUTE will be fired.

Parameters:

`command` - The command to execute.

### markSaveLocation

    void markSaveLocation()

Remove the undo / redo history. This is usefull if the user has been save the document.

### notifyListeners

    void notifyListeners( <draw2d.Command> command, <int> state)

Notifies command stack event listeners that the command stack has changed to the specified state.

Parameters:

`command` - the command

`state` - the current stack state

### redo

    void redo()

Redo the command after the user has undo this command

### removeCommandStackEventListener

    void removeCommandStackEventListener( <draw2d.CommandStackListener> listener)

Removes a listener from the command stack.

Parameters:

`listener` - the listener to remove.

### setUndoLimit

    void setUndoLimit( <int> count)

Set the maximal undo stack size. Entries will be remove if the max. stack size has been reached.

Parameters:

`count` - The maximal undo stack size.

### undo

    void undo()

Undo the command

Overview | File | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Thu Feb 7 23:45:47 2008