Class PSurfaceNone

  • All Implemented Interfaces:
    PSurface

    public class PSurfaceNone
    extends Object
    implements PSurface
    Surface that's not really visible. Used for PDF and friends, or as a base class for other drawing surfaces. It includes the standard rendering loop.
    • Field Detail

      • thread

        protected Thread thread
      • paused

        protected boolean paused
      • pauseObject

        protected Object pauseObject
      • frameRateTarget

        protected float frameRateTarget
      • frameRatePeriod

        protected long frameRatePeriod
    • Constructor Detail

      • PSurfaceNone

        public PSurfaceNone​(PGraphics graphics)
    • Method Detail

      • getNative

        public Object getNative()
        Description copied from interface: PSurface
        Get the native window object associated with this drawing surface. For Java2D, this will be an AWT Frame object. For OpenGL, the window. The data returned here is subject to the whims of the renderer, and using this method means you're willing to deal with underlying implementation changes and that you won't throw a fit like a toddler if your code breaks sometime in the future.
        Specified by:
        getNative in interface PSurface
      • setTitle

        public void setTitle​(String title)
        Set the window (and dock, or whatever necessary) title.
        Specified by:
        setTitle in interface PSurface
      • setVisible

        public void setVisible​(boolean visible)
        Show or hide the window.
        Specified by:
        setVisible in interface PSurface
      • setResizable

        public void setResizable​(boolean resizable)
        Set true if we want to resize things (default is not resizable)
        Specified by:
        setResizable in interface PSurface
      • placeWindow

        public void placeWindow​(int[] location,
                                int[] editorLocation)
        Specified by:
        placeWindow in interface PSurface
      • placePresent

        public void placePresent​(int stopColor)
        Specified by:
        placePresent in interface PSurface
      • setAlwaysOnTop

        public void setAlwaysOnTop​(boolean always)
        Description copied from interface: PSurface
        Dumb name, but inherited from Frame and no better ideas.
        Specified by:
        setAlwaysOnTop in interface PSurface
      • setLocation

        public void setLocation​(int x,
                                int y)
        Specified by:
        setLocation in interface PSurface
      • setSize

        public void setSize​(int wide,
                            int high)
        Specified by:
        setSize in interface PSurface
      • setCursor

        public void setCursor​(int kind)
        Specified by:
        setCursor in interface PSurface
      • setCursor

        public void setCursor​(PImage image,
                              int hotspotX,
                              int hotspotY)
        Specified by:
        setCursor in interface PSurface
      • createThread

        public Thread createThread()
      • startThread

        public void startThread()
        Description copied from interface: PSurface
        Start the animation thread
        Specified by:
        startThread in interface PSurface
      • stopThread

        public boolean stopThread()
        Description copied from interface: PSurface
        Stop the animation thread (set it null)
        Specified by:
        stopThread in interface PSurface
        Returns:
        false if already stopped
      • isStopped

        public boolean isStopped()
        Specified by:
        isStopped in interface PSurface
      • pauseThread

        public void pauseThread()
        Description copied from interface: PSurface
        On the next trip through the animation thread, things should go sleepy-bye. Does not pause the thread immediately because that needs to happen on the animation thread itself, so fires on the next trip through draw().
        Specified by:
        pauseThread in interface PSurface
      • checkPause

        protected void checkPause()
      • setFrameRate

        public void setFrameRate​(float fps)
        Specified by:
        setFrameRate in interface PSurface