nl.cwi.sen1.util
Class MouseAdapter
java.lang.Object
java.awt.event.MouseAdapter
javax.swing.event.MouseInputAdapter
nl.cwi.sen1.util.MouseAdapter
- All Implemented Interfaces:
- java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener, javax.swing.event.MouseInputListener
public class MouseAdapter
- extends javax.swing.event.MouseInputAdapter
This is a generic MouseAdapter useful for any MetaStudio component that needs
to send mouse events to the ToolBus. It has some magic: if the component is a
subclass of JTextComponent it also stores the correct caret position, next to
the other details of a MouseEvent (x,y) pos. These can be used for later
inspection when the ToolBus scripts might ask for further details.
- Author:
- jurgenv
Field Summary |
private toolbus.AbstractTool |
bridge
|
private nl.cwi.sen1.configapi.types.Event |
event
|
private nl.cwi.sen1.configapi.Factory |
factory
|
private aterm.ATerm |
id
|
private static java.awt.event.MouseEvent |
popupEvent
|
Constructor Summary |
MouseAdapter(aterm.ATerm id,
toolbus.AbstractTool bridge,
nl.cwi.sen1.configapi.types.Event event)
|
Method Summary |
private nl.cwi.sen1.configapi.types.VirtualButton |
button(int modifiers)
|
private nl.cwi.sen1.configapi.types.Event |
convert(java.awt.event.MouseEvent e)
|
static java.awt.event.MouseEvent |
getPreviousPopupEvent()
|
private nl.cwi.sen1.configapi.types.KeyModifierList |
modifiers(int modifiers)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
setId(aterm.ATerm id)
|
Methods inherited from class java.awt.event.MouseAdapter |
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.awt.event.MouseListener |
mouseClicked, mouseEntered, mouseExited |
Methods inherited from interface java.awt.event.MouseMotionListener |
mouseDragged, mouseMoved |
factory
private nl.cwi.sen1.configapi.Factory factory
bridge
private toolbus.AbstractTool bridge
id
private aterm.ATerm id
event
private nl.cwi.sen1.configapi.types.Event event
popupEvent
private static java.awt.event.MouseEvent popupEvent
MouseAdapter
public MouseAdapter(aterm.ATerm id,
toolbus.AbstractTool bridge,
nl.cwi.sen1.configapi.types.Event event)
setId
public void setId(aterm.ATerm id)
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressed
in interface java.awt.event.MouseListener
- Overrides:
mousePressed
in class java.awt.event.MouseAdapter
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleased
in interface java.awt.event.MouseListener
- Overrides:
mouseReleased
in class java.awt.event.MouseAdapter
getPreviousPopupEvent
public static java.awt.event.MouseEvent getPreviousPopupEvent()
convert
private nl.cwi.sen1.configapi.types.Event convert(java.awt.event.MouseEvent e)
modifiers
private nl.cwi.sen1.configapi.types.KeyModifierList modifiers(int modifiers)
button
private nl.cwi.sen1.configapi.types.VirtualButton button(int modifiers)