Class 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.
      • Methods inherited from class java.awt.event.MouseAdapter

        mouseWheelMoved
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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 interface java.awt.event.MouseListener
        Overrides:
        mouseClicked in class java.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 interface java.awt.event.MouseMotionListener
        Overrides:
        mouseDragged in class java.awt.event.MouseAdapter
        Parameters:
        e - Event that triggered this function.
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent e)
        Unchanged.
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
        Overrides:
        mouseEntered in class java.awt.event.MouseAdapter
        Parameters:
        e - DOCUMENT ME!
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent e)
        Unchanged.
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
        Overrides:
        mouseExited in class java.awt.event.MouseAdapter
        Parameters:
        e - DOCUMENT ME!
      • mouseMoved

        public void mouseMoved​(java.awt.event.MouseEvent e)
        Unchanged.
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseMoved in class java.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 interface java.awt.event.MouseListener
        Overrides:
        mousePressed in class java.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 interface java.awt.event.MouseListener
        Overrides:
        mouseReleased in class java.awt.event.MouseAdapter
        Parameters:
        e - Event that triggered this function.