com.swfm.mica.commands
Class MiDeletePartsCommand

java.lang.Object
  extended bycom.swfm.mica.commands.MiCommandHandler
      extended bycom.swfm.mica.commands.MiDeletePartsCommand
All Implemented Interfaces:
MiiActionTypes, MiiCommandHandler, MiiCommandNames, MiiDisplayNames, MiiMessages, MiiTargetableCommandHandler, MiiTransaction, MiiTypes

public class MiDeletePartsCommand
extends MiCommandHandler
implements MiiTransaction, MiiCommandNames, MiiDisplayNames, MiiActionTypes, MiiTypes

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
static java.lang.String Mi_DUPLICATE_GROW_BOTTOMRIGHT_COMMAND_NAME
           
static java.lang.String Mi_DUPLICATE_TO_BOTTOM_COMMAND_NAME
           
static java.lang.String Mi_DUPLICATE_TO_BOTTOMRIGHT_COMMAND_NAME
           
static java.lang.String Mi_DUPLICATE_TO_RIGHT_COMMAND_NAME
           
           
Constructor Summary
MiDeletePartsCommand()
           
MiDeletePartsCommand(MiEditor editor, MiPart part, boolean toDelete)
           
MiDeletePartsCommand(MiEditor editor, MiParts parts, boolean toDelete)
           
MiDeletePartsCommand(MiEditor editor, MiParts parts, boolean toDelete, boolean connsOnly)
           
 
Method Summary
 MiDeletePartsCommand create(MiEditor editor, MiParts parts, boolean toDelete)
           
 void doit(MiEditor editor, boolean toDelete)
           
 java.lang.String getCommand()
          Gets the command perfromed by this transaction.
 MiEditor getEditor()
           
 java.lang.String getName()
          Gets the name of this transaction.
 int getNumberOfTimesToRepeatDuplication()
           
 MiConnection getPrototype()
           
 boolean getSelectingAddedParts()
           
 MiParts getSources()
          Gets the parts used by this transaction.
 MiParts getTargets()
          Gets the targets of this transaction.
 void getToBeDeletedConnectionsOfToBeDeletedParts(MiParts parts, MiParts conns, MiParts connSources, MiParts connDests)
           
 boolean isRepeatable()
          Gets whether this transaction is repeatable.
 boolean isUndoable()
          Gets whether this transaction is undoable.
 void processCommand(MiEditor editor, MiParts parts, java.lang.String name, boolean toDelete, boolean connsOnly, boolean alreadyDidIt)
           
 void processCommand(MiEditor editor, MiParts parts, java.lang.String name, boolean toDelete, boolean connsOnly, boolean alreadyDidIt, int numberOfTimesToRepeatDuplication, boolean selectAddedParts)
           
 void processCommand(java.lang.String arg)
          Processes the given command.
 void processCommand(java.lang.String arg, MiParts targetParts)
           
 void redo()
          Redoes this transaction.
 void repeat()
          Repeats this transaction.
 void setName(java.lang.String name)
           
 void setNumberOfTimesToRepeatDuplication(int num)
           
 void setPrototype(MiConnection conn)
           
 void setSelectingAddedParts(boolean flag)
           
 java.lang.String toString()
           
 void undo()
          Undoes this transaction.
 
Methods inherited from class com.swfm.mica.commands.MiCommandHandler
getTargetOfCommand, setTargetOfCommand
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Mi_DUPLICATE_TO_RIGHT_COMMAND_NAME

public static final java.lang.String Mi_DUPLICATE_TO_RIGHT_COMMAND_NAME
See Also:
Constant Field Values

Mi_DUPLICATE_TO_BOTTOM_COMMAND_NAME

public static final java.lang.String Mi_DUPLICATE_TO_BOTTOM_COMMAND_NAME
See Also:
Constant Field Values

Mi_DUPLICATE_TO_BOTTOMRIGHT_COMMAND_NAME

public static final java.lang.String Mi_DUPLICATE_TO_BOTTOMRIGHT_COMMAND_NAME
See Also:
Constant Field Values

Mi_DUPLICATE_GROW_BOTTOMRIGHT_COMMAND_NAME

public static final java.lang.String Mi_DUPLICATE_GROW_BOTTOMRIGHT_COMMAND_NAME
See Also:
Constant Field Values
Constructor Detail

MiDeletePartsCommand

public MiDeletePartsCommand()

MiDeletePartsCommand

public MiDeletePartsCommand(MiEditor editor,
                            MiPart part,
                            boolean toDelete)

MiDeletePartsCommand

public MiDeletePartsCommand(MiEditor editor,
                            MiParts parts,
                            boolean toDelete)

MiDeletePartsCommand

public MiDeletePartsCommand(MiEditor editor,
                            MiParts parts,
                            boolean toDelete,
                            boolean connsOnly)
Method Detail

create

public MiDeletePartsCommand create(MiEditor editor,
                                   MiParts parts,
                                   boolean toDelete)

getEditor

public MiEditor getEditor()

setName

public void setName(java.lang.String name)

setSelectingAddedParts

public void setSelectingAddedParts(boolean flag)

getSelectingAddedParts

public boolean getSelectingAddedParts()

setNumberOfTimesToRepeatDuplication

public void setNumberOfTimesToRepeatDuplication(int num)

getNumberOfTimesToRepeatDuplication

public int getNumberOfTimesToRepeatDuplication()

setPrototype

public void setPrototype(MiConnection conn)

getPrototype

public MiConnection getPrototype()

processCommand

public void processCommand(java.lang.String arg)
Description copied from interface: MiiCommandHandler
Processes the given command.

Specified by:
processCommand in interface MiiCommandHandler

processCommand

public void processCommand(java.lang.String arg,
                           MiParts targetParts)

processCommand

public void processCommand(MiEditor editor,
                           MiParts parts,
                           java.lang.String name,
                           boolean toDelete,
                           boolean connsOnly,
                           boolean alreadyDidIt)

processCommand

public void processCommand(MiEditor editor,
                           MiParts parts,
                           java.lang.String name,
                           boolean toDelete,
                           boolean connsOnly,
                           boolean alreadyDidIt,
                           int numberOfTimesToRepeatDuplication,
                           boolean selectAddedParts)

doit

public void doit(MiEditor editor,
                 boolean toDelete)

getName

public java.lang.String getName()
Gets the name of this transaction. This name is often displayed, for example, in the menubar's edit pulldown menu.

Specified by:
getName in interface MiiTransaction
Returns:
the name of this transaction.

getCommand

public java.lang.String getCommand()
Gets the command perfromed by this transaction. This name is often found in the MiiCommandNames file.

Specified by:
getCommand in interface MiiTransaction
Returns:
the command of this transaction.

redo

public void redo()
Redoes this transaction. This is only valid after an undo. This redoes the changes encapsulated by this transaction that were undone by the undo() method.

Specified by:
redo in interface MiiTransaction

undo

public void undo()
Undoes this transaction. This undoes any changes that were made by the changes encapsulated by this transaction.

Specified by:
undo in interface MiiTransaction

repeat

public void repeat()
Repeats this transaction. This re-applies the changes encapsulated by this transaction. For example, a translation of a shape can be repeated in order to move it further.

Specified by:
repeat in interface MiiTransaction

isUndoable

public boolean isUndoable()
Gets whether this transaction is undoable.

Specified by:
isUndoable in interface MiiTransaction

isRepeatable

public boolean isRepeatable()
Gets whether this transaction is repeatable. If repeatable then calling this transaction's repeat() method is permitted. Duplicate and Create are repeatable, but if another unrepeatable command is part of this one, such as MiDeleteModelEntitiesCommand, then no operation is not repeatable.

Specified by:
isRepeatable in interface MiiTransaction

getTargets

public MiParts getTargets()
Gets the targets of this transaction.

Specified by:
getTargets in interface MiiTransaction

getSources

public MiParts getSources()
Gets the parts used by this transaction.

Specified by:
getSources in interface MiiTransaction

getToBeDeletedConnectionsOfToBeDeletedParts

public void getToBeDeletedConnectionsOfToBeDeletedParts(MiParts parts,
                                                        MiParts conns,
                                                        MiParts connSources,
                                                        MiParts connDests)

toString

public java.lang.String toString()