Class JPanelCamera.StandardMouse

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    JPanelCamera

    class JPanelCamera.StandardMouse
    extends java.lang.Thread
    Class used to send Standard mouse events to the canvas. Must subclass Thread because a single mousePressed event on one of the mouse buttons needs to generate mouseDragged events on the canvas until the mouse is released.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int centerX
      Canvas center coordinate.
      (package private) int centerY
      Canvas center coordinate.
      (package private) java.awt.event.MouseEvent evt
      Mouse event
      (package private) int id
      MouseEvent id.
      (package private) int mod
      Mouseevent mask
      (package private) java.lang.Object source
      Event source
      (package private) long when
      Event time stamp.
      (package private) int x
      Canvas center x and y.
      (package private) int y
      Canvas center x and y.
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      StandardMouse​(java.awt.event.MouseEvent event)
      Creates new thread and sets up mouse event variables appropriately.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()
      Runs the thread.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • centerX

        int centerX
        Canvas center coordinate.
      • centerY

        int centerY
        Canvas center coordinate.
      • evt

        java.awt.event.MouseEvent evt
        Mouse event
      • source

        java.lang.Object source
        Event source
      • when

        long when
        Event time stamp.
      • mod

        int mod
        Mouseevent mask
      • x

        int x
        Canvas center x and y.
      • y

        int y
        Canvas center x and y.
      • id

        int id
        MouseEvent id.
    • Constructor Detail

      • StandardMouse

        public StandardMouse​(java.awt.event.MouseEvent event)
        Creates new thread and sets up mouse event variables appropriately.
        Parameters:
        event - Original mouse event, from button.
    • Method Detail

      • run

        public void run()
        Runs the thread. While the button is pressed, dispatches mouse dragged events at a rate consistent with the velocity slider. Once the mouse is released, pressed will be set to false and the loop will stop.
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread