Package jmri.util.swing
Interface JmriMouseListener
- All Superinterfaces:
EventListener
- All Known Implementing Classes:
BeanTableDataModel.PopupListener,BeanTableDataModel.TableHeaderListener,ButtonEditor,ButtonTrigger,CatalogPanel.IconDisplayPanel,CatalogPanel.IconListener,ControlPanelEditor,DispatcherFrame.TableHeaderListener,Editor,GlobalVariableComboIcon,GlobalVariableInputIcon,GlobalVariableSpinnerIcon,IconItemPanel.IconDisplayPanel,IconItemPanel.IconListener,JmriMouseAdapter,LayoutEditor,LogixNGTableIcon,MemoryComboIcon,MemoryInputIcon,MemoryOrGVComboIcon,MemorySpinnerIcon,PanelEditor,PositionableJPanel,SwitchboardEditor,TrackerTableAction.TableFrame,WarrantTableFrame
Replacement for
MouseListener.
This class is used to replace MouseEvent with
JmriMouseEvent.
Java 11 through 21 (at least)
omits calling mouseClicked if the cursor has moved even a single pixel while the mouse
is down. This results in mouse clicks feeling intermittent.
This class replaces that behavior with a small dead zone, firing a mouseClicked
event if the mouse has not moved very far between mousePressed and mouseReleased.-
Method Summary
Modifier and TypeMethodDescriptionstatic MouseListeneradapt(JmriMouseListener listener) Adapt a JmriMouseListener to a MouseListener.voidInvoked when the mouse button has been clicked (pressed and released) on a component.voidInvoked when the mouse enters a component.voidInvoked when the mouse exits a component.voidInvoked when a mouse button has been pressed on a component.voidInvoked when a mouse button has been released on a component.
-
Method Details
-
adapt
Adapt a JmriMouseListener to a MouseListener.- Parameters:
listener- the JmriMouseListener- Returns:
- the MouseListener
-
mouseClicked
Invoked when the mouse button has been clicked (pressed and released) on a component.- Parameters:
e- the event to be processed
-
mousePressed
Invoked when a mouse button has been pressed on a component.- Parameters:
e- the event to be processed
-
mouseReleased
Invoked when a mouse button has been released on a component.- Parameters:
e- the event to be processed
-
mouseEntered
Invoked when the mouse enters a component.- Parameters:
e- the event to be processed
-
mouseExited
Invoked when the mouse exits a component.- Parameters:
e- the event to be processed
-