jimm.datavision.gui.cmd
Class GroupEditCommand

java.lang.Object
  extended by jimm.datavision.gui.cmd.CommandAdapter
      extended by jimm.datavision.gui.cmd.GroupEditCommand
All Implemented Interfaces:
Command, Nameable

public class GroupEditCommand
extends CommandAdapter

A command for changing a report's Groups.

Author:
Jim Menard, jimm@io.com

Field Summary
protected  Designer designer
           
protected static int DRASTIC_CHANGE
           
protected  java.util.Collection newGroupItems
           
protected static int NO_CHANGE
           
protected  java.util.Collection oldGroupItems
           
protected static int ONLY_SORTING_CHANGE
           
protected  Report report
           
 
Fields inherited from class jimm.datavision.gui.cmd.CommandAdapter
name
 
Constructor Summary
GroupEditCommand(Report r, Designer designer, java.util.Collection groupItems)
           
 
Method Summary
 void perform()
          Performs the command.
protected  void setGroups(java.util.Collection fromList, java.util.Collection toList)
           
 void undo()
          Undoes the command.
protected  int whatChanged(java.util.Collection fromList, java.util.Collection toList)
          Determines the severity of the difference between the report and what we have now: NO_CHANGE, ONLY_SORTING_CHANGE, or DRASTIC_CHANGE.
 
Methods inherited from class jimm.datavision.gui.cmd.CommandAdapter
getName, redo, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_CHANGE

protected static final int NO_CHANGE
See Also:
Constant Field Values

ONLY_SORTING_CHANGE

protected static final int ONLY_SORTING_CHANGE
See Also:
Constant Field Values

DRASTIC_CHANGE

protected static final int DRASTIC_CHANGE
See Also:
Constant Field Values

report

protected Report report

designer

protected Designer designer

newGroupItems

protected java.util.Collection newGroupItems

oldGroupItems

protected java.util.Collection oldGroupItems
Constructor Detail

GroupEditCommand

public GroupEditCommand(Report r,
                        Designer designer,
                        java.util.Collection groupItems)
Method Detail

perform

public void perform()
Description copied from class: CommandAdapter
Performs the command. The default implementation does nothing.

Specified by:
perform in interface Command
Overrides:
perform in class CommandAdapter

undo

public void undo()
Description copied from class: CommandAdapter
Undoes the command. The default implementation does nothing.

Specified by:
undo in interface Command
Overrides:
undo in class CommandAdapter

setGroups

protected void setGroups(java.util.Collection fromList,
                         java.util.Collection toList)

whatChanged

protected int whatChanged(java.util.Collection fromList,
                          java.util.Collection toList)
Determines the severity of the difference between the report and what we have now: NO_CHANGE, ONLY_SORTING_CHANGE, or DRASTIC_CHANGE.

Parameters:
fromList - the list of groups before the pending change
toList - the list of groups after the pending change
Returns:
one of NO_CHANGE, ONLY_SORTING_CHANGE, or DRASTIC_CHANGE