|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.openbp.jaspira.gui.interaction.DragDropPane
public class DragDropPane
A drag and drop pane is a component that is to be used as glass pane for a window.
It is used to handle drag and drop events and propagate them to InteractionClient s via DragAwareRegion s.
It also provides support for break out box (bob) menus.
A bob is a circular overlay window that presents items that can be imported into the underlying
drop client. The user may select the item by simply clicking on it. A bob menu is always initiated
by a hot key.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static CursorPrototype |
acceptCursorPrototype
Accept cursor. |
static CursorPrototype |
rejectCursorPrototype
Reject cursor. |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Method Summary | |
|---|---|
void |
addDropClient(InteractionClient client)
Adds a drop client. |
void |
cancelDrag()
Cancels any currently ongoing drag action. |
void |
clearDropClients()
Removes all drop clients. |
void |
endBreakOutMode()
Ends the bob mode |
void |
endDrag()
Called when the drag ends. |
DragOrigin |
getDragOrigin()
Returns the originator of the current dnd action. |
java.awt.Point |
getLastLocation()
Returns the last mouse location. |
java.awt.event.MouseEvent |
getMouseEvent()
Gets the mouse event that triggered the drag action. |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent event)
Returns the tool tip appropriate for the given region. |
static DragDropPane |
installDragDropPane(DropPaneContainer container)
Creates a new drag drop pane and installs it as a glass pane for the givent container. |
void |
mouseDragged(java.awt.Point p)
Handler for 'mouse dragged' events. |
void |
mouseReleased(java.awt.Point p)
Handler for 'mouse released' events. |
void |
paint(java.awt.Graphics g)
Draws the Pane (i\.e\. the active DropRegions) |
void |
regionsInvalidated()
Rebuilds the DragAwareRegions of the pane. |
void |
removeDropClient(InteractionClient client)
Removes a drop client. |
void |
setComposite(java.awt.Composite composite)
Sets the composite used to draw the glasPaneElements. |
void |
setTransparency(float alpha)
Sets the alpha Component, i\.e\. the transparency of the drop pane. |
void |
startBreakOutMode(BreakoutProvider provider,
java.awt.Point position)
Starts the bob mode using the given provider. |
void |
startDrag(java.awt.datatransfer.Transferable transferable,
DragOrigin dragOrigin,
java.awt.event.MouseEvent mouseEvent)
Initiates a dragging action. |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static CursorPrototype acceptCursorPrototype
public static CursorPrototype rejectCursorPrototype
| Method Detail |
|---|
public static DragDropPane installDragDropPane(DropPaneContainer container)
container - Container to install the pane for
public void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentComponent.paint(Graphics)public void regionsInvalidated()
public void startDrag(java.awt.datatransfer.Transferable transferable,
DragOrigin dragOrigin,
java.awt.event.MouseEvent mouseEvent)
transferable - Transferable to be draggeddragOrigin - Originator of the dragging actionmouseEvent - Mouse event that triggered the drag actionpublic void cancelDrag()
public void endDrag()
public void startBreakOutMode(BreakoutProvider provider,
java.awt.Point position)
provider - Provider for bob entriesposition - Center of the bob in screen coordinatespublic void endBreakOutMode()
public void mouseDragged(java.awt.Point p)
p - Current mouse positionpublic void mouseReleased(java.awt.Point p)
p - Current mouse position in glass coordinatespublic java.lang.String getToolTipText(java.awt.event.MouseEvent event)
getToolTipText in class javax.swing.JComponentevent - Mouse event containing the coordinates that should be used to determine
the hovered bob entry if the bob is active.
public void addDropClient(InteractionClient client)
client - Client to addpublic void removeDropClient(InteractionClient client)
client - Client to removepublic void clearDropClients()
public void setComposite(java.awt.Composite composite)
setTransparency(float), which incidently just creates a new AlphaComposite object.
composite - The composite to setAlphaCompositepublic void setTransparency(float alpha)
alpha - New alpha value, between 0f (opaque) 1f (fully transparent)public DragOrigin getDragOrigin()
public java.awt.Point getLastLocation()
public java.awt.event.MouseEvent getMouseEvent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||