at.tuwien.ifs.somtoolbox.apps.viewer.handlers
Class OrderedPSelectionEventHandler

java.lang.Object
  extended by edu.umd.cs.piccolo.event.PBasicInputEventHandler
      extended by edu.umd.cs.piccolo.event.PDragSequenceEventHandler
          extended by edu.umd.cs.piccolox.event.PSelectionEventHandler
              extended by at.tuwien.ifs.somtoolbox.apps.viewer.handlers.OrderedPSelectionEventHandler
All Implemented Interfaces:
edu.umd.cs.piccolo.event.PInputEventListener, EventListener
Direct Known Subclasses:
ClusterSelectionEventHandler, LineSelectionEventHandler, MyRectangleSelectionEventHandler

public class OrderedPSelectionEventHandler
extends edu.umd.cs.piccolox.event.PSelectionEventHandler

A Selection Event Handler that stores the selected items in the selection (insertion) order.

Version:
$Id: OrderedPSelectionEventHandler.java 3877 2010-11-02 15:43:17Z frank $
Author:
Rudolf Mayer

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.umd.cs.piccolox.event.PSelectionEventHandler
edu.umd.cs.piccolox.event.PSelectionEventHandler.BoundsFilter
 
Field Summary
protected  Set<GeneralUnitPNode> currentSelection
           
 
Fields inherited from class edu.umd.cs.piccolox.event.PSelectionEventHandler
SELECTION_CHANGED_NOTIFICATION
 
Constructor Summary
OrderedPSelectionEventHandler(edu.umd.cs.piccolo.PNode marqueeParent, List selectableParents)
           
OrderedPSelectionEventHandler(edu.umd.cs.piccolo.PNode marqueeParent, edu.umd.cs.piccolo.PNode selectableParent)
           
 
Method Summary
protected  boolean alreadySelected(Object o)
          check if an object has already been selected or not
 Collection<GeneralUnitPNode> getSelection()
          Returns a copy of the currently selected nodes.
protected  void init()
           
 void select(Collection items)
           
 void select(Map items)
           
 void select(edu.umd.cs.piccolo.PNode node)
           
protected  void startDrag(edu.umd.cs.piccolo.event.PInputEvent e)
           
 void unselect(Collection items)
           
 void unselect(edu.umd.cs.piccolo.PNode node)
           
 void unselectAll()
           
 
Methods inherited from class edu.umd.cs.piccolox.event.PSelectionEventHandler
addSelectableParent, computeMarqueeSelection, computeOptionMarqueeSelection, createNodeFilter, decorateSelectedNode, drag, dragActivityStep, dragStandardSelection, endDrag, endMarqueeSelection, endStandardSelection, getMarqueeBounds, getMarqueePaint, getMarqueePaintTransparency, getSelectableParents, getSelectionReference, getSupportDeleteKey, initializeMarquee, initializeSelection, isDeleteKeyActive, isMarqueeSelection, isOptionSelection, isSelectable, isSelected, keyPressed, removeSelectableParent, setDeleteKeyActive, setMarqueePaint, setMarqueePaintTransparency, setSelectableParent, setSelectableParents, startMarqueeSelection, startOptionMarqueeSelection, startStandardOptionSelection, startStandardSelection, undecorateSelectedNode, updateMarquee
 
Methods inherited from class edu.umd.cs.piccolo.event.PDragSequenceEventHandler
dragActivityFinalStep, dragActivityFirstStep, getDragActivity, getMinDragStartDistance, getMousePressedCanvasPoint, isDragging, mouseDragged, mousePressed, mouseReleased, paramString, setIsDragging, setMinDragStartDistance, shouldStartDragInteraction, startDragActivity, stopDragActivity
 
Methods inherited from class edu.umd.cs.piccolo.event.PBasicInputEventHandler
acceptsEvent, getEventFilter, keyboardFocusGained, keyboardFocusLost, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseWheelRotated, mouseWheelRotatedByBlock, processEvent, setEventFilter, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentSelection

protected Set<GeneralUnitPNode> currentSelection
Constructor Detail

OrderedPSelectionEventHandler

public OrderedPSelectionEventHandler(edu.umd.cs.piccolo.PNode marqueeParent,
                                     edu.umd.cs.piccolo.PNode selectableParent)

OrderedPSelectionEventHandler

public OrderedPSelectionEventHandler(edu.umd.cs.piccolo.PNode marqueeParent,
                                     List selectableParents)
Method Detail

init

protected void init()
Overrides:
init in class edu.umd.cs.piccolox.event.PSelectionEventHandler

getSelection

public Collection<GeneralUnitPNode> getSelection()
Returns a copy of the currently selected nodes. Overriding the super-class method to ensure an insertion-order of the elements (the super class returns the keyset of a hashmap).

Overrides:
getSelection in class edu.umd.cs.piccolox.event.PSelectionEventHandler

select

public void select(Collection items)
Overrides:
select in class edu.umd.cs.piccolox.event.PSelectionEventHandler

unselect

public void unselect(Collection items)
Overrides:
unselect in class edu.umd.cs.piccolox.event.PSelectionEventHandler

startDrag

protected void startDrag(edu.umd.cs.piccolo.event.PInputEvent e)
Overrides:
startDrag in class edu.umd.cs.piccolox.event.PSelectionEventHandler

alreadySelected

protected boolean alreadySelected(Object o)
check if an object has already been selected or not

Parameters:
o - - object to search for in the current selection
Returns:
true if the object is already selected, false otherwise.

select

public void select(edu.umd.cs.piccolo.PNode node)
Overrides:
select in class edu.umd.cs.piccolox.event.PSelectionEventHandler

unselect

public void unselect(edu.umd.cs.piccolo.PNode node)
Overrides:
unselect in class edu.umd.cs.piccolox.event.PSelectionEventHandler

unselectAll

public void unselectAll()
Overrides:
unselectAll in class edu.umd.cs.piccolox.event.PSelectionEventHandler

select

public void select(Map items)
Overrides:
select in class edu.umd.cs.piccolox.event.PSelectionEventHandler