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.MouseInputAdapterListener for the glass panes.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) JDialogCaptureScreen.MyGlassPaneglassPanePane of glass this listener is tied to.(package private) intxX and Y coordinates where drawing started.(package private) intyX 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 voidmouseClicked(java.awt.event.MouseEvent e)Unchanged.voidmouseDragged(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.voidmouseEntered(java.awt.event.MouseEvent e)Unchanged.voidmouseExited(java.awt.event.MouseEvent e)Unchanged.voidmouseMoved(java.awt.event.MouseEvent e)Unchanged.voidmousePressed(java.awt.event.MouseEvent e)Sets the x and y variables in the glass pane to indicate that we've begun drawing a rectangle.voidmouseReleased(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:
mouseClickedin interfacejava.awt.event.MouseListener- Overrides:
mouseClickedin 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:
mouseDraggedin interfacejava.awt.event.MouseMotionListener- Overrides:
mouseDraggedin classjava.awt.event.MouseAdapter- Parameters:
e- Event that triggered this function.
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
Unchanged.- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener- Overrides:
mouseEnteredin classjava.awt.event.MouseAdapter- Parameters:
e- DOCUMENT ME!
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
Unchanged.- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener- Overrides:
mouseExitedin classjava.awt.event.MouseAdapter- Parameters:
e- DOCUMENT ME!
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
Unchanged.- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener- Overrides:
mouseMovedin 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:
mousePressedin interfacejava.awt.event.MouseListener- Overrides:
mousePressedin 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:
mouseReleasedin interfacejava.awt.event.MouseListener- Overrides:
mouseReleasedin classjava.awt.event.MouseAdapter- Parameters:
e- Event that triggered this function.
-
-