Package gov.nih.mipav.view.dialogs
Class JDialogCaptureScreen.GlassPaneListener
- java.lang.Object
-
- java.awt.event.MouseAdapter
-
- javax.swing.event.MouseInputAdapter
-
- gov.nih.mipav.view.dialogs.JDialogCaptureScreen.GlassPaneListener
-
- All Implemented Interfaces:
java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.event.MouseWheelListener
,java.util.EventListener
,javax.swing.event.MouseInputListener
- Enclosing class:
- JDialogCaptureScreen
class JDialogCaptureScreen.GlassPaneListener extends javax.swing.event.MouseInputAdapter
Listener for the glass panes.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) JDialogCaptureScreen.MyGlassPane
glassPane
Pane of glass this listener is tied to.(package private) int
x
X and Y coordinates where drawing started.(package private) int
y
X and Y coordinates where drawing started.
-
Constructor Summary
Constructors Constructor Description GlassPaneListener(JDialogCaptureScreen.MyGlassPane glassPane)
Creates new listener that captures mouse and mouse motion events and sends them to the glass pane to draw a partial or completed rectangle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mouseClicked(java.awt.event.MouseEvent e)
Unchanged.void
mouseDragged(java.awt.event.MouseEvent e)
Sets the width and height variables in the glass pane based upon how far the mouse has been dragged and repaints the glass pane.void
mouseEntered(java.awt.event.MouseEvent e)
Unchanged.void
mouseExited(java.awt.event.MouseEvent e)
Unchanged.void
mouseMoved(java.awt.event.MouseEvent e)
Unchanged.void
mousePressed(java.awt.event.MouseEvent e)
Sets the x and y variables in the glass pane to indicate that we've begun drawing a rectangle.void
mouseReleased(java.awt.event.MouseEvent e)
Sets the width and height variables appropriately, and lets the glass pane know that we are done drawing the rectangle.
-
-
-
Field Detail
-
glassPane
JDialogCaptureScreen.MyGlassPane glassPane
Pane of glass this listener is tied to.
-
x
int x
X and Y coordinates where drawing started.
-
y
int y
X and Y coordinates where drawing started.
-
-
Constructor Detail
-
GlassPaneListener
public GlassPaneListener(JDialogCaptureScreen.MyGlassPane glassPane)
Creates new listener that captures mouse and mouse motion events and sends them to the glass pane to draw a partial or completed rectangle.- Parameters:
glassPane
- Glass pane tied to this listener.
-
-
Method Detail
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
Unchanged.- Specified by:
mouseClicked
in interfacejava.awt.event.MouseListener
- Overrides:
mouseClicked
in classjava.awt.event.MouseAdapter
- Parameters:
e
- DOCUMENT ME!
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
Sets the width and height variables in the glass pane based upon how far the mouse has been dragged and repaints the glass pane.- Specified by:
mouseDragged
in interfacejava.awt.event.MouseMotionListener
- Overrides:
mouseDragged
in classjava.awt.event.MouseAdapter
- Parameters:
e
- Event that triggered this function.
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
Unchanged.- Specified by:
mouseEntered
in interfacejava.awt.event.MouseListener
- Overrides:
mouseEntered
in classjava.awt.event.MouseAdapter
- Parameters:
e
- DOCUMENT ME!
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
Unchanged.- Specified by:
mouseExited
in interfacejava.awt.event.MouseListener
- Overrides:
mouseExited
in classjava.awt.event.MouseAdapter
- Parameters:
e
- DOCUMENT ME!
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
Unchanged.- Specified by:
mouseMoved
in interfacejava.awt.event.MouseMotionListener
- Overrides:
mouseMoved
in classjava.awt.event.MouseAdapter
- Parameters:
e
- DOCUMENT ME!
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
Sets the x and y variables in the glass pane to indicate that we've begun drawing a rectangle. Resets all the glass panes first so only one has any drawing in it at one time.- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Overrides:
mousePressed
in classjava.awt.event.MouseAdapter
- Parameters:
e
- Event that triggered this function.
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
Sets the width and height variables appropriately, and lets the glass pane know that we are done drawing the rectangle.- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
- Overrides:
mouseReleased
in classjava.awt.event.MouseAdapter
- Parameters:
e
- Event that triggered this function.
-
-