ptolemy.domains.gr.lib
Class ViewScreen2D.ViewScreen2DListener

java.lang.Object
  extended by ptolemy.domains.gr.lib.ViewScreen2D.ViewScreen2DListener
All Implemented Interfaces:
LayerListener, LayerMotionListener, java.awt.event.KeyListener, java.util.EventListener
Enclosing class:
ViewScreen2D

public class ViewScreen2D.ViewScreen2DListener
extends java.lang.Object
implements LayerListener, LayerMotionListener, java.awt.event.KeyListener

Listen for Layer, LayerMotion and Key events.


Field Summary
private  boolean _mouseDragging
           
private  boolean _mouseInWindow
           
 
Constructor Summary
ViewScreen2D.ViewScreen2DListener()
           
 
Method Summary
 void keyPressed(java.awt.event.KeyEvent e)
          Forward any keyPressed events to the figure which is selected in the viewscreen.
 void keyReleased(java.awt.event.KeyEvent e)
          Forward any keyReleased events to the figure which is selected in the viewscreen.
 void keyTyped(java.awt.event.KeyEvent e)
          Forward any keyTyped events to the figure which is selected in the viewscreen.
 void mouseClicked(LayerEvent e)
          Included to comply with the LayerListener interface requirements.
 void mouseDragged(LayerEvent e)
          Translate the origin of the viewScreen2D if the user drags the origin marker.
 void mouseEntered(LayerEvent e)
          Update the state of this object to reflect that the mouse is in the viewscreen.
 void mouseExited(LayerEvent e)
          Update the state of this object to reflect that the mouse is no longer in the viewscreen.
 void mouseMoved(LayerEvent e)
          Included to comply with the LayerMotionListener interface requirement.
 void mousePressed(LayerEvent e)
          Update the status of any figures which were deselected by the user clicking on a blank area of the viewscreen.
 void mouseReleased(LayerEvent e)
          Update the state of this object to reflect that the mouse is no longer being dragged.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_mouseDragging

private boolean _mouseDragging

_mouseInWindow

private boolean _mouseInWindow
Constructor Detail

ViewScreen2D.ViewScreen2DListener

public ViewScreen2D.ViewScreen2DListener()
Method Detail

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Forward any keyPressed events to the figure which is selected in the viewscreen. Allow the origin of the viewscreen to be translated if the user holds the 'o' key.

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
e - The KeyEvent generated by the frame containing the viewscreen.

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Forward any keyReleased events to the figure which is selected in the viewscreen. Disable relocation of the origin of the viewscreen if the user releases the 'o' key.

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
e - The KeyEvent generated by the frame containing the viewscreen.

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Forward any keyTyped events to the figure which is selected in the viewscreen. If no figure is selected, this method does nothing.

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
e - The KeyEvent generated by the frame containing the viewscreen.

mouseClicked

public void mouseClicked(LayerEvent e)
Included to comply with the LayerListener interface requirements. This method does nothing in its current implementation.

Specified by:
mouseClicked in interface LayerListener
Parameters:
e - The layer event generated by the informing layer.

mouseDragged

public void mouseDragged(LayerEvent e)
Translate the origin of the viewScreen2D if the user drags the origin marker. To enable this function, the user must hold the 'o' key while dragging the origin marker.

Specified by:
mouseDragged in interface LayerListener
Parameters:
e - The layer event generated by the informing layer.

mouseEntered

public void mouseEntered(LayerEvent e)
Update the state of this object to reflect that the mouse is in the viewscreen.

Specified by:
mouseEntered in interface LayerMotionListener
Parameters:
e - The layer event generated by the informing layer.

mouseExited

public void mouseExited(LayerEvent e)
Update the state of this object to reflect that the mouse is no longer in the viewscreen.

Specified by:
mouseExited in interface LayerMotionListener

mouseMoved

public void mouseMoved(LayerEvent e)
Included to comply with the LayerMotionListener interface requirement. This method does nothing in its current implementation.

Specified by:
mouseMoved in interface LayerMotionListener
Parameters:
e - The layer event generated by the informing layer.

mousePressed

public void mousePressed(LayerEvent e)
Update the status of any figures which were deselected by the user clicking on a blank area of the viewscreen.

Specified by:
mousePressed in interface LayerListener
Parameters:
e - The layer event generated by the informing layer.

mouseReleased

public void mouseReleased(LayerEvent e)
Update the state of this object to reflect that the mouse is no longer being dragged.

Specified by:
mouseReleased in interface LayerListener
Parameters:
e - The layer event generated by the informing layer.