kaapo.projectmanager.command
Class SelectionEdit

java.lang.Object
  extended by kaapo.projectmanager.command.AbstractEdit
      extended by kaapo.projectmanager.command.SelectionEdit
All Implemented Interfaces:
Edit

public class SelectionEdit
extends AbstractEdit

An Edit that selects DiagramComponentWrappers on the given {x,y}-point or in a rectangular area created from two {x,y}-points.

When only one point is given the first DiagramComponent that contains the given coordinate is selected.

When an area is given in form of the two points all the DiagramComponents that are in that area are selected.

After the selection is made an instance of the Selection class is created and it is given to ProjectManager for keeping.

Author:
hprajani

Constructor Summary
SelectionEdit()
          resets the selection to empty
SelectionEdit(DiagramComponentWrapper dc)
          constructs an edit with a given diagramocomponent
SelectionEdit(List<DiagramComponentWrapper> dcs)
          constructs an edit with the given diagram components
SelectionEdit(Point2D point)
          constructs an edit with a single assigned point
SelectionEdit(Point2D startPoint, Point2D endPoint)
          constructs an edit with an area
 
Method Summary
 void execute(ProjectManager pm)
          Execution of this Edit is done in this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectionEdit

public SelectionEdit()
resets the selection to empty


SelectionEdit

public SelectionEdit(Point2D point)
constructs an edit with a single assigned point

Parameters:
point - the checked point

SelectionEdit

public SelectionEdit(Point2D startPoint,
                     Point2D endPoint)
constructs an edit with an area

Parameters:
startPoint - the staring point of the selection area
endPoint - the ending point of the selection area

SelectionEdit

public SelectionEdit(DiagramComponentWrapper dc)
constructs an edit with a given diagramocomponent

Parameters:
dc - the DiagramComponent selected from a tree or such.

SelectionEdit

public SelectionEdit(List<DiagramComponentWrapper> dcs)
constructs an edit with the given diagram components

Parameters:
dcs - the DiagramComponents selected from a tree or such.
Method Detail

execute

public void execute(ProjectManager pm)
             throws EditFailedException
Execution of this Edit is done in this method.

Parameters:
pm - the ProjectManager the Edit is executed in
Throws:
EditFailedException
See Also:
Edit.execute(ProjectManager)