java.lang.Object
PDragSequenceEventHandler
phoebe.event.PSelectionHandler
- public class PSelectionHandler
- extends PDragSequenceEventHandler
PSelectionHandler provides standard interaction for selection. Clicking
selects the object under the cursor. Shift-clicking allows multiple objects to be
selected. Dragging offers marquee selection. Pressing the delete key deletes
the selection by default.
- Version:
- 1.0
|
Constructor Summary |
PSelectionHandler(PNode marqueeParent,
PNode selectableParent)
Creates a selection event handler. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SELECTION_CHANGED_NOTIFICATION
public static final java.lang.String SELECTION_CHANGED_NOTIFICATION
- See Also:
- Constant Field Values
DASH_WIDTH
static final int DASH_WIDTH
- See Also:
- Constant Field Values
NUM_STROKES
static final int NUM_STROKES
- See Also:
- Constant Field Values
selection
private java.util.Hashtable selection
selectableParents
private java.util.ArrayList selectableParents
marquee
private PPath marquee
marqueeParent
private PNode marqueeParent
presspt
private java.awt.geom.Point2D presspt
canvasPressPt
private java.awt.geom.Point2D canvasPressPt
strokeNum
private float strokeNum
strokes
private java.awt.Stroke[] strokes
allItems
private java.util.Hashtable allItems
unselectList
private java.util.ArrayList unselectList
marqueeMap
private java.util.HashMap marqueeMap
pressNode
private PNode pressNode
deleteKeyActive
private boolean deleteKeyActive
mouseDown
private boolean mouseDown
selectionMade
private boolean selectionMade
PSelectionHandler
public PSelectionHandler(PNode marqueeParent,
PNode selectableParent)
- Creates a selection event handler.
init
protected void init()
select
public void select(java.util.Collection items)
select
public void select(java.util.Map items)
decorateSelectedNode
public void decorateSelectedNode(PNode node)
unselect
public void unselect(java.util.Collection items)
undecorateSelectedNode
public void undecorateSelectedNode(PNode node)
unselectAll
public void unselectAll()
isSelected
public boolean isSelected(PNode node)
getSelection
public java.util.Collection getSelection()
isSelectable
protected boolean isSelectable(PNode node)
- Determine if the specified node is selectable (i.e., if it is a child
of the one the list of selectable parents.
addSelectableParent
public void addSelectableParent(PNode node)
removeSelectableParent
public void removeSelectableParent(PNode node)
setSelectableParent
public void setSelectableParent(PNode node)
setSelectableParents
public void setSelectableParents(java.util.Collection c)
getSelectableParents
public java.util.Collection getSelectableParents()
startDrag
protected void startDrag(PInputEvent e)
drag
protected void drag(PInputEvent e)
endDrag
protected void endDrag(PInputEvent e)
isOptionSelection
public boolean isOptionSelection(PInputEvent pie)
isMarqueeSelection
protected boolean isMarqueeSelection(PInputEvent pie)
initializeSelection
protected void initializeSelection(PInputEvent pie)
initializeMarquee
protected void initializeMarquee(PInputEvent e)
startOptionMarqueeSelection
protected void startOptionMarqueeSelection(PInputEvent e)
startMarqueeSelection
protected void startMarqueeSelection(PInputEvent e)
startStandardSelection
protected void startStandardSelection(PInputEvent pie)
startStandardOptionSelection
protected void startStandardOptionSelection(PInputEvent pie)
updateMarquee
protected void updateMarquee(PInputEvent pie)
computeMarqueeSelection
protected void computeMarqueeSelection(PInputEvent pie)
computeOptionMarqueeSelection
protected void computeOptionMarqueeSelection(PInputEvent pie)
createNodeFilter
protected PNodeFilter createNodeFilter(PBounds bounds)
getMarqueeBounds
protected PBounds getMarqueeBounds()
dragStandardSelection
protected void dragStandardSelection(PInputEvent e)
endMarqueeSelection
protected void endMarqueeSelection(PInputEvent e)
endStandardSelection
protected void endStandardSelection(PInputEvent e)
keyPressed
public void keyPressed(PInputEvent e)
- Delete selection when delete key is pressed (if enabled)
getSupportDeleteKey
public boolean getSupportDeleteKey()
isDeleteKeyActive
public boolean isDeleteKeyActive()
setDeleteKeyActive
public void setDeleteKeyActive(boolean deleteKeyActive)
- Specifies if the DELETE key should delete the selection