Class ToolMouseAdapter
- java.lang.Object
-
- java.awt.event.MouseAdapter
-
- adams.gui.visualization.object.tools.ToolMouseAdapter
-
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,MouseWheelListener
,EventListener
public class ToolMouseAdapter extends MouseAdapter
MouseAdapter
with an owning tool.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_AutomaticallyRequestFocus
whether to automatically request focus when clicking on the canvas.protected Tool
m_Owner
the owning tool.
-
Constructor Summary
Constructors Constructor Description ToolMouseAdapter(Tool owner)
Initializes the adapter.ToolMouseAdapter(Tool owner, boolean automaticallyRequestFocus)
Initializes the adapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getAutomaticallyRequestFocus()
Returns whether the focus gets automatically requested when clicking on the canvas.Tool
getOwner()
Returns the owning tool.void
mouseClicked(MouseEvent e)
Called when a mouse button has been clicked (pressed and released).protected void
requestFocus()
Requests the focus in the canvas panel.-
Methods inherited from class java.awt.event.MouseAdapter
mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved
-
-
-
-
Field Detail
-
m_Owner
protected Tool m_Owner
the owning tool.
-
m_AutomaticallyRequestFocus
protected boolean m_AutomaticallyRequestFocus
whether to automatically request focus when clicking on the canvas.
-
-
Constructor Detail
-
ToolMouseAdapter
public ToolMouseAdapter(Tool owner)
Initializes the adapter. Automatically requests focus when clicking.- Parameters:
owner
- the owning tool
-
ToolMouseAdapter
public ToolMouseAdapter(Tool owner, boolean automaticallyRequestFocus)
Initializes the adapter.- Parameters:
owner
- the owning toolautomaticallyRequestFocus
- automatically requests the focus when clicking on the canvas.
-
-
Method Detail
-
getOwner
public Tool getOwner()
Returns the owning tool.- Returns:
- the owning tool
-
getAutomaticallyRequestFocus
public boolean getAutomaticallyRequestFocus()
Returns whether the focus gets automatically requested when clicking on the canvas.- Returns:
- true if automatically requesting
-
mouseClicked
public void mouseClicked(MouseEvent e)
Called when a mouse button has been clicked (pressed and released).- Specified by:
mouseClicked
in interfaceMouseListener
- Overrides:
mouseClicked
in classMouseAdapter
- Parameters:
e
- the event- See Also:
getAutomaticallyRequestFocus()
-
requestFocus
protected void requestFocus()
Requests the focus in the canvas panel.
-
-