Class ToolMouseAdapter
- java.lang.Object
-
- java.awt.event.MouseAdapter
-
- adams.gui.visualization.segmentation.tool.ToolMouseAdapter
-
- All Implemented Interfaces:
MouseListener,MouseMotionListener,MouseWheelListener,EventListener
public class ToolMouseAdapter extends MouseAdapter
MouseAdapterwith an owning tool.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_AutomaticallyRequestFocuswhether to automatically request focus when clicking on the canvas.protected Toolm_Ownerthe 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 booleangetAutomaticallyRequestFocus()Returns whether the focus gets automatically requested when clicking on the canvas.ToolgetOwner()Returns the owning tool.voidmouseClicked(MouseEvent e)Called when a mouse button has been clicked (pressed and released).voidmouseReleased(MouseEvent e)Called when a mouse button is released.protected voidrequestFocus()Requests the focus in the canvas panel.-
Methods inherited from class java.awt.event.MouseAdapter
mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, 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:
mouseClickedin interfaceMouseListener- Overrides:
mouseClickedin classMouseAdapter- Parameters:
e- the event- See Also:
getAutomaticallyRequestFocus()
-
mouseReleased
public void mouseReleased(MouseEvent e)
Called when a mouse button is released.- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classMouseAdapter- Parameters:
e- the event to be processed
-
requestFocus
protected void requestFocus()
Requests the focus in the canvas panel.
-
-