Class SwingEventAdapter
java.lang.Object
javax.swing.InputVerifier
com.inductiveautomation.snap.swing.SwingEventAdapter
- All Implemented Interfaces:
- DragGestureListener,- DragSourceListener,- DropTargetListener,- ActionListener,- FocusListener,- KeyListener,- MouseListener,- MouseMotionListener,- EventListener
- Direct Known Subclasses:
- JComboBoxHpr.JComboBoxEventAdapter
public class SwingEventAdapter
extends InputVerifier
implements ActionListener, MouseListener, MouseMotionListener, KeyListener, FocusListener, DropTargetListener, DragGestureListener, DragSourceListener
A class to listen for Swing events and send them on.
- 
Constructor SummaryConstructorsConstructorDescriptionSwingEventAdapter(JComponent aComponent) Creates a new SwingEventAdapter for given component.
- 
Method SummaryModifier and TypeMethodDescriptionvoidActionListener method.voiddragDropEnd(DragSourceDropEvent anEvent) DragSourceListener method.voiddragEnter(DragSourceDragEvent anEvent) DragSourceListener method.voiddragEnter(DropTargetDragEvent anEvent) Drop target listener method.voiddragExit(DragSourceEvent anEvent) DragSourceListener method.voiddragExit(DropTargetEvent anEvent) Drop target listener method.voiddragGestureRecognized(DragGestureEvent anEvent) Called when drag should be initiated due to mouse drag.voiddragOver(DragSourceDragEvent anEvent) DragSourceListener method.voiddragOver(DropTargetDragEvent anEvent) Drop target listener method.voiddrop(DropTargetDropEvent anEvent) Drop target listener method.voiddropActionChanged(DragSourceDragEvent anEvent) DragSourceListener method.voiddropActionChanged(DropTargetDragEvent anEvent) Drop target listener method.voidImplements focusGained to cache value prior to editing, so we know whether to fire action on focusLost/verify.voidImplements focus lost to verify (almost certainly not needed, since verify is called prior to focus lost).Returns the component border if it is currently being substituted with a temporary one.Returns the component.Returns an array of enabled events.Returns the value of the component when focus gained.Returns the component helper.booleanisEnabled(UIEvent.Type aType) Returns whether given type is enabled.booleanisEnabled(UIEvent.Type... theTypes) Returns whether any of given types are enabled.protected booleanReturns whether FocusListener is set.booleanReturns whether input verifier is set.protected booleanReturns whether KeyListener is set.protected booleanReturns whether MouseListener is set.protected booleanReturns whether MouseMotionListener is set.voidKeyListener method.voidKeyListener method.voidKeyListener method.voidMouseListener method.voidMouseMotionListener method.voidMouseListener method.voidMouseListener method.voidMouseMotionListener method.voidMouseListener method.voidMouseListener method.voidsetEnabled(UIEvent.Type aType, boolean aValue) Sets whether a given type is enabled.voidsetEnabledEvents(UIEvent.Type... theEvents) Sets an array of enabled events.protected voidsetFocusListenerSet(boolean aValue) Sets whether FocusListener is set.voidsetInputVerifier(boolean aValue) Sets Input verifier.protected voidsetKeyListenerSet(boolean aValue) Sets whether KeyListener is set.protected voidsetMouseListenerSet(boolean aValue) Sets whether MouseListener is set.protected voidsetMouseMotionListenerSet(boolean aValue) Sets whether MouseMotionListener is set.booleanverify(JComponent aComponent) Verify.Methods inherited from class javax.swing.InputVerifiershouldYieldFocus, shouldYieldFocus, verifyTarget
- 
Constructor Details- 
SwingEventAdapterCreates a new SwingEventAdapter for given component.
 
- 
- 
Method Details- 
getComponentReturns the component.
- 
getHelperReturns the component helper.
- 
getBorderReturns the component border if it is currently being substituted with a temporary one.
- 
isEnabledReturns whether given type is enabled.
- 
isEnabledReturns whether any of given types are enabled.
- 
setEnabledSets whether a given type is enabled.
- 
getEnabledEventsReturns an array of enabled events.
- 
setEnabledEventsSets an array of enabled events.
- 
isKeyListenerSetprotected boolean isKeyListenerSet()Returns whether KeyListener is set.
- 
setKeyListenerSetprotected void setKeyListenerSet(boolean aValue) Sets whether KeyListener is set.
- 
isMouseListenerSetprotected boolean isMouseListenerSet()Returns whether MouseListener is set.
- 
setMouseListenerSetprotected void setMouseListenerSet(boolean aValue) Sets whether MouseListener is set.
- 
isMouseMotionListenerSetprotected boolean isMouseMotionListenerSet()Returns whether MouseMotionListener is set.
- 
setMouseMotionListenerSetprotected void setMouseMotionListenerSet(boolean aValue) Sets whether MouseMotionListener is set.
- 
isFocusListenerSetprotected boolean isFocusListenerSet()Returns whether FocusListener is set.
- 
setFocusListenerSetprotected void setFocusListenerSet(boolean aValue) Sets whether FocusListener is set.
- 
actionPerformedActionListener method.- Specified by:
- actionPerformedin interface- ActionListener
 
- 
keyPressedKeyListener method.- Specified by:
- keyPressedin interface- KeyListener
 
- 
keyTypedKeyListener method.- Specified by:
- keyTypedin interface- KeyListener
 
- 
keyReleasedKeyListener method.- Specified by:
- keyReleasedin interface- KeyListener
 
- 
mousePressedMouseListener method.- Specified by:
- mousePressedin interface- MouseListener
 
- 
mouseDraggedMouseMotionListener method.- Specified by:
- mouseDraggedin interface- MouseMotionListener
 
- 
mouseReleasedMouseListener method.- Specified by:
- mouseReleasedin interface- MouseListener
 
- 
mouseClickedMouseListener method.- Specified by:
- mouseClickedin interface- MouseListener
 
- 
mouseEnteredMouseListener method.- Specified by:
- mouseEnteredin interface- MouseListener
 
- 
mouseMovedMouseMotionListener method.- Specified by:
- mouseMovedin interface- MouseMotionListener
 
- 
mouseExitedMouseListener method.- Specified by:
- mouseExitedin interface- MouseListener
 
- 
focusGainedImplements focusGained to cache value prior to editing, so we know whether to fire action on focusLost/verify.- Specified by:
- focusGainedin interface- FocusListener
 
- 
focusLostImplements focus lost to verify (almost certainly not needed, since verify is called prior to focus lost).- Specified by:
- focusLostin interface- FocusListener
 
- 
getFocusGainedValueReturns the value of the component when focus gained.
- 
isInputVerifierSetpublic boolean isInputVerifierSet()Returns whether input verifier is set.
- 
setInputVerifierpublic void setInputVerifier(boolean aValue) Sets Input verifier.
- 
verifyVerify.- Specified by:
- verifyin class- InputVerifier
 
- 
dragEnterDrop target listener method.- Specified by:
- dragEnterin interface- DropTargetListener
 
- 
dragOverDrop target listener method.- Specified by:
- dragOverin interface- DropTargetListener
 
- 
dropActionChangedDrop target listener method.- Specified by:
- dropActionChangedin interface- DropTargetListener
 
- 
dragExitDrop target listener method.- Specified by:
- dragExitin interface- DropTargetListener
 
- 
dropDrop target listener method.- Specified by:
- dropin interface- DropTargetListener
 
- 
dragGestureRecognizedCalled when drag should be initiated due to mouse drag.- Specified by:
- dragGestureRecognizedin interface- DragGestureListener
 
- 
dragEnterDragSourceListener method.- Specified by:
- dragEnterin interface- DragSourceListener
 
- 
dragOverDragSourceListener method.- Specified by:
- dragOverin interface- DragSourceListener
 
- 
dropActionChangedDragSourceListener method.- Specified by:
- dropActionChangedin interface- DragSourceListener
 
- 
dragExitDragSourceListener method.- Specified by:
- dragExitin interface- DragSourceListener
 
- 
dragDropEndDragSourceListener method.- Specified by:
- dragDropEndin interface- DragSourceListener
 
 
-