Class ViewScreen2D.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.
      • Methods inherited from class java.lang.Object

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

      • ViewScreen2DListener

        public 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
        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 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.