|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolo.event.PBasicInputEventHandler
edu.umd.cs.piccolo.event.PDragSequenceEventHandler
edu.umd.cs.piccolox.event.PSelectionEventHandler
public class PSelectionEventHandler
PSelectionEventHandler
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.
Nested Class Summary | |
---|---|
protected class |
PSelectionEventHandler.BoundsFilter
|
Field Summary | |
---|---|
static java.lang.String |
SELECTION_CHANGED_NOTIFICATION
|
Constructor Summary | |
---|---|
PSelectionEventHandler(PNode marqueeParent,
java.util.List selectableParents)
Creates a selection event handler. |
|
PSelectionEventHandler(PNode marqueeParent,
PNode selectableParent)
Creates a selection event handler. |
Method Summary | |
---|---|
void |
addSelectableParent(PNode node)
|
protected void |
computeMarqueeSelection(PInputEvent pie)
|
protected void |
computeOptionMarqueeSelection(PInputEvent pie)
|
protected PNodeFilter |
createNodeFilter(PBounds bounds)
|
void |
decorateSelectedNode(PNode node)
|
protected void |
drag(PInputEvent e)
Subclasses should override this method to get notified of the drag events in a drag sequence. |
protected void |
dragActivityStep(PInputEvent aEvent)
This gets called continuously during the drag, and is used to animate the marquee |
protected void |
dragStandardSelection(PInputEvent e)
|
protected void |
endDrag(PInputEvent e)
Subclasses should override this method to get notified of the end event in a drag sequence. |
protected void |
endMarqueeSelection(PInputEvent e)
|
protected void |
endStandardSelection(PInputEvent e)
|
protected PBounds |
getMarqueeBounds()
|
java.awt.Paint |
getMarqueePaint()
Indicates the color used to paint the marquee. |
float |
getMarqueePaintTransparency()
Indicates the transparency level for the interior of the marquee. |
java.util.Collection |
getSelectableParents()
|
java.util.Collection |
getSelection()
Returns a copy of the currently selected nodes. |
java.util.Collection |
getSelectionReference()
Gets a reference to the currently selected nodes. |
boolean |
getSupportDeleteKey()
|
protected void |
init()
|
protected void |
initializeMarquee(PInputEvent e)
|
protected void |
initializeSelection(PInputEvent pie)
|
boolean |
isDeleteKeyActive()
|
protected boolean |
isMarqueeSelection(PInputEvent pie)
|
boolean |
isOptionSelection(PInputEvent pie)
|
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. |
boolean |
isSelected(PNode node)
|
void |
keyPressed(PInputEvent e)
Delete selection when delete key is pressed (if enabled) |
void |
removeSelectableParent(PNode node)
|
void |
select(java.util.Collection items)
|
void |
select(java.util.Map items)
|
void |
select(PNode node)
|
void |
setDeleteKeyActive(boolean deleteKeyActive)
Specifies if the DELETE key should delete the selection |
void |
setMarqueePaint(java.awt.Paint paint)
Sets the color used to paint the marquee. |
void |
setMarqueePaintTransparency(float marqueePaintTransparency)
Sets the transparency level for the interior of the marquee. |
void |
setSelectableParent(PNode node)
|
void |
setSelectableParents(java.util.Collection c)
|
protected void |
startDrag(PInputEvent e)
Subclasses should override this method to get notified of the start of a new drag sequence. |
protected void |
startMarqueeSelection(PInputEvent e)
|
protected void |
startOptionMarqueeSelection(PInputEvent e)
|
protected void |
startStandardOptionSelection(PInputEvent pie)
|
protected void |
startStandardSelection(PInputEvent pie)
|
void |
undecorateSelectedNode(PNode node)
|
void |
unselect(java.util.Collection items)
|
void |
unselect(PNode node)
|
void |
unselectAll()
|
protected void |
updateMarquee(PInputEvent pie)
|
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 |
---|
public static final java.lang.String SELECTION_CHANGED_NOTIFICATION
Constructor Detail |
---|
public PSelectionEventHandler(PNode marqueeParent, PNode selectableParent)
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.public PSelectionEventHandler(PNode marqueeParent, java.util.List selectableParents)
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 |
---|
protected void init()
public void select(java.util.Collection items)
public void select(java.util.Map items)
public void select(PNode node)
public void decorateSelectedNode(PNode node)
public void unselect(java.util.Collection items)
public void unselect(PNode node)
public void undecorateSelectedNode(PNode node)
public void unselectAll()
public boolean isSelected(PNode node)
public java.util.Collection getSelection()
public java.util.Collection getSelectionReference()
protected boolean isSelectable(PNode node)
public void addSelectableParent(PNode node)
public void removeSelectableParent(PNode node)
public void setSelectableParent(PNode node)
public void setSelectableParents(java.util.Collection c)
public java.util.Collection getSelectableParents()
protected void startDrag(PInputEvent e)
PDragSequenceEventHandler
startDrag
in class PDragSequenceEventHandler
protected void drag(PInputEvent e)
PDragSequenceEventHandler
drag
in class PDragSequenceEventHandler
protected void endDrag(PInputEvent e)
PDragSequenceEventHandler
endDrag
in class PDragSequenceEventHandler
public boolean isOptionSelection(PInputEvent pie)
protected boolean isMarqueeSelection(PInputEvent pie)
protected void initializeSelection(PInputEvent pie)
protected void initializeMarquee(PInputEvent e)
protected void startOptionMarqueeSelection(PInputEvent e)
protected void startMarqueeSelection(PInputEvent e)
protected void startStandardSelection(PInputEvent pie)
protected void startStandardOptionSelection(PInputEvent pie)
protected void updateMarquee(PInputEvent pie)
protected void computeMarqueeSelection(PInputEvent pie)
protected void computeOptionMarqueeSelection(PInputEvent pie)
protected PNodeFilter createNodeFilter(PBounds bounds)
protected PBounds getMarqueeBounds()
protected void dragStandardSelection(PInputEvent e)
protected void endMarqueeSelection(PInputEvent e)
protected void endStandardSelection(PInputEvent e)
protected void dragActivityStep(PInputEvent aEvent)
dragActivityStep
in class PDragSequenceEventHandler
public void keyPressed(PInputEvent e)
keyPressed
in class PBasicInputEventHandler
public boolean getSupportDeleteKey()
public boolean isDeleteKeyActive()
public void setDeleteKeyActive(boolean deleteKeyActive)
public java.awt.Paint getMarqueePaint()
public void setMarqueePaint(java.awt.Paint paint)
paint
- the paint colorpublic float getMarqueePaintTransparency()
public void setMarqueePaintTransparency(float marqueePaintTransparency)
marqueePaintTransparency
- The marquee paint transparency to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |