Class Graphics2DTestPlusGlassPane.RightClickListener

java.lang.Object
  extended byjavax.swing.event.MouseInputAdapter
      extended byGraphics2DTestPlusGlassPane.RightClickListener
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.MouseInputListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener
Enclosing class:
Graphics2DTestPlusGlassPane

public static class Graphics2DTestPlusGlassPane.RightClickListener
extends javax.swing.event.MouseInputAdapter

Class RightClickListener implements all of the methods of a MouseInputAdapter. The work of converting the event into a form usable by the target component is done in the redispatchEvent method.


Field Summary
protected  Graphics2DTest.DrawingCanvas canvas
          The drawing canvas in the parent application.
protected  javax.swing.JFrame frame
          The frame in the parent application.
 
Constructor Summary
Graphics2DTestPlusGlassPane.RightClickListener(javax.swing.JFrame frame, Graphics2DTest.DrawingCanvas canvas)
          Construct with refs to the main JFrame and drawing canvas.
 
Method Summary
 void mouseClicked(java.awt.event.MouseEvent e)
          Forward the mouseClicked event.
 void mouseDragged(java.awt.event.MouseEvent e)
          Forward the mouseDragged event.
 void mouseEntered(java.awt.event.MouseEvent e)
          Forward the mouseEntered event.
 void mouseExited(java.awt.event.MouseEvent e)
          Forward the mouseExited event.
 void mouseMoved(java.awt.event.MouseEvent e)
          Forward the mouseMoved event.
 void mousePressed(java.awt.event.MouseEvent e)
          Forward the mousePressed event, after printing a message if the right mouse button has been pressed.
 void mouseReleased(java.awt.event.MouseEvent e)
          Forward the mouseReleased event.
protected  void redispatchEvent(java.awt.event.MouseEvent e)
          Redispatch the given MouseEvent to the appropriate target component in the frame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frame

protected javax.swing.JFrame frame
The frame in the parent application.


canvas

protected Graphics2DTest.DrawingCanvas canvas
The drawing canvas in the parent application.

Constructor Detail

Graphics2DTestPlusGlassPane.RightClickListener

public Graphics2DTestPlusGlassPane.RightClickListener(javax.swing.JFrame frame,
                                                      Graphics2DTest.DrawingCanvas canvas)
Construct with refs to the main JFrame and drawing canvas.

Method Detail

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Forward the mouseMoved event.


mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Forward the mouseDragged event.


mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Forward the mouseClicked event.


mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Forward the mouseEntered event.


mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Forward the mouseExited event.


mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Forward the mousePressed event, after printing a message if the right mouse button has been pressed. This is the only specialization here, but it's illustrative of such specialized processing in general. I.e., processing that is done at the glass pane level that is in addition to or in lieu of processing at the contained component level.


mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Forward the mouseReleased event.


redispatchEvent

protected void redispatchEvent(java.awt.event.MouseEvent e)
Redispatch the given MouseEvent to the appropriate target component in the frame. The two general component categories are the canvas, which wants mouse events, and the buttons, which want action events. See the code for further details.