Package ptolemy.domains.gr.lib
Class ViewScreen2D.ViewScreen2DListener
- java.lang.Object
-
- 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.
-
-
Constructor Summary
Constructors Constructor Description ViewScreen2DListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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 interfacejava.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 interfacejava.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 interfacejava.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 interfaceLayerListener
- 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 interfaceLayerListener
- 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 interfaceLayerMotionListener
- 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 interfaceLayerMotionListener
- Parameters:
e
- The event
-
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 interfaceLayerMotionListener
- 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 interfaceLayerListener
- 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 interfaceLayerListener
- Parameters:
e
- The layer event generated by the informing layer.
-
-