edu.umd.cs.piccolox.swt
Class PSWTSelectionEventHandler

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 edu.umd.cs.piccolox.swt.PSWTSelectionEventHandler
All Implemented Interfaces:
PInputEventListener, EventListener

public class PSWTSelectionEventHandler
extends PSelectionEventHandler

Selection event handler modified to use SWT paths instead of normal paths.

Version:
1.0
Author:
Lance Good

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.umd.cs.piccolox.event.PSelectionEventHandler
PSelectionEventHandler.BoundsFilter
 
Field Summary
(package private)  Point2D canvasPressPt
           
(package private)  PSWTPath marquee
           
(package private)  PNode marqueeParent
           
(package private)  Point2D pressPt
           
 
Fields inherited from class edu.umd.cs.piccolox.event.PSelectionEventHandler
SELECTION_CHANGED_NOTIFICATION
 
Constructor Summary
PSWTSelectionEventHandler(PNode marqueeParent, List selectableParents)
          Creates a selection event handler.
PSWTSelectionEventHandler(PNode marqueeParent, PNode selectableParent)
          Creates a selection event handler.
 
Method Summary
 void decorateSelectedNode(PNode node)
          Modifies the provided node so that it is displayed as selected.
protected  void dragActivityStep(PInputEvent aEvent)
          This gets called continuously during the drag, and is used to animate the marquee.
protected  void endMarqueeSelection(PInputEvent e)
          Removes marquee and clears selection.
protected  PBounds getMarqueeBounds()
          Returns the bounds of the current selection marquee.
protected  void initializeMarquee(PInputEvent e)
          Creates an empty marquee child for use in displaying the marquee around the selection.
protected  void initializeSelection(PInputEvent pie)
          Starts a selection based on the provided event.
 void undecorateSelectedNode(PNode node)
          Undoes any modifications to the provided node so that it is not displayed as selected.
protected  void updateMarquee(PInputEvent pie)
          Updates the marquee rectangle as the result of a drag.
 
Methods inherited from class edu.umd.cs.piccolox.event.PSelectionEventHandler
addSelectableParent, computeMarqueeSelection, computeOptionMarqueeSelection, createNodeFilter, drag, dragStandardSelection, endDrag, endStandardSelection, getMarqueePaint, getMarqueePaintTransparency, getSelectableParents, getSelection, getSelectionReference, getSupportDeleteKey, init, isDeleteKeyActive, isMarqueeSelection, isOptionSelection, isSelectable, isSelected, keyPressed, removeSelectableParent, select, select, select, setDeleteKeyActive, setMarqueePaint, setMarqueePaintTransparency, setSelectableParent, setSelectableParents, startDrag, startMarqueeSelection, startOptionMarqueeSelection, startStandardOptionSelection, startStandardSelection, unselect, unselect, unselectAll
 
Methods inherited from class edu.umd.cs.piccolo.event.PDragSequenceEventHandler
dragActivityFinalStep, dragActivityFirstStep, getDragActivity, getMinDragStartDistance, getMousePressedCanvasPoint, isDragging, mouseDragged, mousePressed, mouseReleased, 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, paramString, processEvent, setEventFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

marquee

PSWTPath marquee

marqueeParent

PNode marqueeParent

pressPt

Point2D pressPt

canvasPressPt

Point2D canvasPressPt
Constructor Detail

PSWTSelectionEventHandler

public PSWTSelectionEventHandler(PNode marqueeParent,
                                 PNode selectableParent)
Creates a selection event handler.

Parameters:
marqueeParent - The node to which the event handler dynamically adds a marquee (temporarily) to represent the area being selected.
selectableParent - The node whose children will be selected by this event handler.

PSWTSelectionEventHandler

public PSWTSelectionEventHandler(PNode marqueeParent,
                                 List selectableParents)
Creates a selection event handler.

Parameters:
marqueeParent - The node to which the event handler dynamically adds a marquee (temporarily) to represent the area being selected.
selectableParents - A list of nodes whose children will be selected by this event handler.
Method Detail

decorateSelectedNode

public void decorateSelectedNode(PNode node)
Modifies the provided node so that it is displayed as selected.

Overrides:
decorateSelectedNode in class PSelectionEventHandler
Parameters:
node - node to be decorated

undecorateSelectedNode

public void undecorateSelectedNode(PNode node)
Undoes any modifications to the provided node so that it is not displayed as selected.

Overrides:
undecorateSelectedNode in class PSelectionEventHandler
Parameters:
node - node to be undecorated

initializeSelection

protected void initializeSelection(PInputEvent pie)
Starts a selection based on the provided event.

Overrides:
initializeSelection in class PSelectionEventHandler
Parameters:
pie - event used to populate the selection

initializeMarquee

protected void initializeMarquee(PInputEvent e)
Creates an empty marquee child for use in displaying the marquee around the selection.

Overrides:
initializeMarquee in class PSelectionEventHandler
Parameters:
e - event responsible for the initialization

updateMarquee

protected void updateMarquee(PInputEvent pie)
Updates the marquee rectangle as the result of a drag.

Overrides:
updateMarquee in class PSelectionEventHandler
Parameters:
pie - event responsible for the change in the marquee

getMarqueeBounds

protected PBounds getMarqueeBounds()
Returns the bounds of the current selection marquee.

Overrides:
getMarqueeBounds in class PSelectionEventHandler
Returns:
bounds of current selection marquee

endMarqueeSelection

protected void endMarqueeSelection(PInputEvent e)
Removes marquee and clears selection.

Overrides:
endMarqueeSelection in class PSelectionEventHandler
Parameters:
e - event responsible for the end of the selection

dragActivityStep

protected void dragActivityStep(PInputEvent aEvent)
This gets called continuously during the drag, and is used to animate the marquee.

Overrides:
dragActivityStep in class PSelectionEventHandler
Parameters:
aEvent - event responsible for this step in the drag sequence


Copyright © 1995-2011 Piccolo2D. All Rights Reserved.