at.tuwien.ifs.somtoolbox.apps.viewer.handlers
Class LineSelectionEventHandler
java.lang.Object
edu.umd.cs.piccolo.event.PBasicInputEventHandler
edu.umd.cs.piccolo.event.PDragSequenceEventHandler
edu.umd.cs.piccolox.event.PSelectionEventHandler
at.tuwien.ifs.somtoolbox.apps.viewer.handlers.OrderedPSelectionEventHandler
at.tuwien.ifs.somtoolbox.apps.viewer.handlers.LineSelectionEventHandler
- All Implemented Interfaces:
- edu.umd.cs.piccolo.event.PInputEventListener, EventListener
public class LineSelectionEventHandler
- extends OrderedPSelectionEventHandler
Implements the line selection model, everything below a drawn line is selected.
- Version:
- $Id: LineSelectionEventHandler.java 3888 2010-11-02 17:42:53Z frank $
- Author:
- Robert Neumayer
Nested classes/interfaces inherited from class edu.umd.cs.piccolox.event.PSelectionEventHandler |
edu.umd.cs.piccolox.event.PSelectionEventHandler.BoundsFilter |
Constructor Summary |
LineSelectionEventHandler(edu.umd.cs.piccolo.PNode marqueeParent,
edu.umd.cs.piccolo.PNode selectableParent)
Creates a selection event handler. |
Methods inherited from class edu.umd.cs.piccolox.event.PSelectionEventHandler |
addSelectableParent, computeMarqueeSelection, computeOptionMarqueeSelection, createNodeFilter, dragActivityStep, dragStandardSelection, endDrag, getMarqueeBounds, getMarqueePaint, getMarqueePaintTransparency, getSelectableParents, getSelectionReference, getSupportDeleteKey, initializeSelection, isDeleteKeyActive, isOptionSelection, isSelectable, isSelected, keyPressed, removeSelectableParent, setDeleteKeyActive, setMarqueePaint, setMarqueePaintTransparency, setSelectableParent, setSelectableParents, startOptionMarqueeSelection, startStandardOptionSelection, startStandardSelection, 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 |
SELECTION_CHANGED_NOTIFICATION
public static final String SELECTION_CHANGED_NOTIFICATION
- See Also:
- Constant Field Values
BLUR_FACTOR
public static final float BLUR_FACTOR
- See Also:
- Constant Field Values
selectionStatusString
private String selectionStatusString
lineParts
private Vector<edu.umd.cs.piccolo.PNode> lineParts
selectableParents
private List<edu.umd.cs.piccolo.PNode> selectableParents
marqueeParent
private edu.umd.cs.piccolo.PNode marqueeParent
allItems
private HashMap<Object,Boolean> allItems
pressNode
private edu.umd.cs.piccolo.PNode pressNode
startPoint
static Point2D startPoint
lastPoint
static Point2D lastPoint
nextPoint
static Point2D nextPoint
endPoint
static Point2D endPoint
currentLine
edu.umd.cs.piccolox.nodes.PLine currentLine
LineSelectionEventHandler
public LineSelectionEventHandler(edu.umd.cs.piccolo.PNode marqueeParent,
edu.umd.cs.piccolo.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.
decorateSelectedNode
public void decorateSelectedNode(edu.umd.cs.piccolo.PNode node)
- Overrides:
decorateSelectedNode
in class edu.umd.cs.piccolox.event.PSelectionEventHandler
undecorateSelectedNode
public void undecorateSelectedNode(edu.umd.cs.piccolo.PNode node)
- Overrides:
undecorateSelectedNode
in class edu.umd.cs.piccolox.event.PSelectionEventHandler
init
public void init()
- Overrides:
init
in class OrderedPSelectionEventHandler
deleteOldLine
public void deleteOldLine()
- delete the old selection / line
startDrag
protected void startDrag(edu.umd.cs.piccolo.event.PInputEvent e)
- Overrides:
startDrag
in class OrderedPSelectionEventHandler
drag
protected void drag(edu.umd.cs.piccolo.event.PInputEvent e)
- Overrides:
drag
in class edu.umd.cs.piccolox.event.PSelectionEventHandler
isMarqueeSelection
protected boolean isMarqueeSelection(edu.umd.cs.piccolo.event.PInputEvent pie)
- Overrides:
isMarqueeSelection
in class edu.umd.cs.piccolox.event.PSelectionEventHandler
initializeMarquee
protected void initializeMarquee(edu.umd.cs.piccolo.event.PInputEvent e)
- Overrides:
initializeMarquee
in class edu.umd.cs.piccolox.event.PSelectionEventHandler
startMarqueeSelection
protected void startMarqueeSelection(edu.umd.cs.piccolo.event.PInputEvent e)
- Overrides:
startMarqueeSelection
in class edu.umd.cs.piccolox.event.PSelectionEventHandler
updateWhatever
protected void updateWhatever(edu.umd.cs.piccolo.event.PInputEvent e)
- adds the node specified by the event e to the current selection (if it is not selected already)
onSelection
protected boolean onSelection(GeneralUnitPNode upn,
Point2D selectedPoint)
- check if the given Point lies on the given UnitPNode
- Returns:
- - true if coordinates match, false if not
endMarqueeSelection
protected void endMarqueeSelection(edu.umd.cs.piccolo.event.PInputEvent e)
- Overrides:
endMarqueeSelection
in class edu.umd.cs.piccolox.event.PSelectionEventHandler
endStandardSelection
protected void endStandardSelection(edu.umd.cs.piccolo.event.PInputEvent e)
- Overrides:
endStandardSelection
in class edu.umd.cs.piccolox.event.PSelectionEventHandler