Rational Developer for Power Systems Software
V7.6

com.ibm.etools.systems.application.visual.editor.commands
Class SetConnectionLayerRouterCommand

java.lang.Object
  extended by Command
      extended by com.ibm.etools.systems.application.visual.editor.commands.SetConnectionLayerRouterCommand

public class SetConnectionLayerRouterCommand
extends Command

Command to set router in connection layer level.


Field Summary
protected  ConnectionLayer connectionLayer
           
static String copyright
           
protected  ConnectionRouter newRouter
           
protected  ConnectionRouter oldRouter
           
 
Constructor Summary
SetConnectionLayerRouterCommand(ConnectionLayer connectionLayer, ConnectionRouter newRouter, String label)
           
 
Method Summary
 boolean canExecute()
           
 boolean canUndo()
           
 void execute()
          executes the Command.
 ConnectionRouter getNewRouter()
          Get old ruter
 ConnectionRouter getOldRouter()
          Get old ruter
protected  boolean isDifferentRouter()
          Return true if the new router is different with the existing router.
 void redo()
          Re-executes the Command.
 void undo()
          Undoes the changes performed during execute().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

connectionLayer

protected ConnectionLayer connectionLayer

oldRouter

protected ConnectionRouter oldRouter

newRouter

protected ConnectionRouter newRouter
Constructor Detail

SetConnectionLayerRouterCommand

public SetConnectionLayerRouterCommand(ConnectionLayer connectionLayer,
                                       ConnectionRouter newRouter,
                                       String label)
Method Detail

execute

public void execute()
executes the Command. This method should not be called if the Command is not executable.


isDifferentRouter

protected boolean isDifferentRouter()
Return true if the new router is different with the existing router.


getOldRouter

public ConnectionRouter getOldRouter()
Get old ruter


getNewRouter

public ConnectionRouter getNewRouter()
Get old ruter


canExecute

public boolean canExecute()
Returns:
true if the command can be executed

canUndo

public boolean canUndo()
Returns:
true if the command can be undone. This method should only be called after execute() or redo() has been called.

undo

public void undo()
Undoes the changes performed during execute(). This method should only be called after execute has been called, and only when canUndo() returns true.

See Also:
canUndo()

redo

public void redo()
Re-executes the Command. This method should only be called after undo() has been called.


Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.