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 voidkeyPressed(java.awt.event.KeyEvent e)Forward any keyPressed events to the figure which is selected in the viewscreen.voidkeyReleased(java.awt.event.KeyEvent e)Forward any keyReleased events to the figure which is selected in the viewscreen.voidkeyTyped(java.awt.event.KeyEvent e)Forward any keyTyped events to the figure which is selected in the viewscreen.voidmouseClicked(LayerEvent e)Included to comply with the LayerListener interface requirements.voidmouseDragged(LayerEvent e)Translate the origin of the viewScreen2D if the user drags the origin marker.voidmouseEntered(LayerEvent e)Update the state of this object to reflect that the mouse is in the viewscreen.voidmouseExited(LayerEvent e)Update the state of this object to reflect that the mouse is no longer in the viewscreen.voidmouseMoved(LayerEvent e)Included to comply with the LayerMotionListener interface requirement.voidmousePressed(LayerEvent e)Update the status of any figures which were deselected by the user clicking on a blank area of the viewscreen.voidmouseReleased(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:
keyPressedin 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:
keyReleasedin 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:
keyTypedin 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:
mouseClickedin 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:
mouseDraggedin 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:
mouseEnteredin 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:
mouseExitedin 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:
mouseMovedin 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:
mousePressedin 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:
mouseReleasedin interfaceLayerListener- Parameters:
e- The layer event generated by the informing layer.
-
-