-
- All Known Implementing Classes:
PSurfaceNone
public interface PSurface
-
-
Field Summary
Fields Modifier and Type Field Description static intMIN_WINDOW_HEIGHTstatic intMIN_WINDOW_WIDTHMinimum dimensions for the window holding an applet.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectgetNative()Get the native window object associated with this drawing surface.voidhideCursor()voidinitFrame(PApplet sketch)voidinitOffscreen(PApplet sketch)booleanisStopped()voidpauseThread()On the next trip through the animation thread, things should go sleepy-bye.voidplacePresent(int stopColor)voidplaceWindow(int[] location, int[] editorLocation)voidresumeThread()voidsetAlwaysOnTop(boolean always)Dumb name, but inherited from Frame and no better ideas.voidsetCursor(int kind)voidsetCursor(PImage image, int hotspotX, int hotspotY)voidsetFrameRate(float fps)voidsetIcon(PImage icon)voidsetLocation(int x, int y)voidsetResizable(boolean resizable)Set true if we want to resize things (default is not resizable)voidsetSize(int width, int height)voidsetTitle(String title)Set the window (and dock, or whatever necessary) title.voidsetupExternalMessages()voidsetVisible(boolean visible)Show or hide the window.voidshowCursor()voidstartThread()Start the animation threadbooleanstopThread()Stop the animation thread (set it null)
-
-
-
Field Detail
-
MIN_WINDOW_WIDTH
static final int MIN_WINDOW_WIDTH
Minimum dimensions for the window holding an applet. This varies between platforms, Mac OS X 10.3 (confirmed with 10.7 and Java 6) can do any height but requires at least 128 pixels width. Windows XP has another set of limitations. And for all I know, Linux probably allows window sizes to be negative numbers.- See Also:
- Constant Field Values
-
MIN_WINDOW_HEIGHT
static final int MIN_WINDOW_HEIGHT
- See Also:
- Constant Field Values
-
-
Method Detail
-
initOffscreen
void initOffscreen(PApplet sketch)
-
initFrame
void initFrame(PApplet sketch)
-
getNative
Object getNative()
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.
-
setTitle
void setTitle(String title)
Set the window (and dock, or whatever necessary) title.
-
setVisible
void setVisible(boolean visible)
Show or hide the window.
-
setResizable
void setResizable(boolean resizable)
Set true if we want to resize things (default is not resizable)
-
setAlwaysOnTop
void setAlwaysOnTop(boolean always)
Dumb name, but inherited from Frame and no better ideas.
-
setIcon
void setIcon(PImage icon)
-
placeWindow
void placeWindow(int[] location, int[] editorLocation)
-
placePresent
void placePresent(int stopColor)
-
setupExternalMessages
void setupExternalMessages()
-
setLocation
void setLocation(int x, int y)
-
setSize
void setSize(int width, int height)
-
setFrameRate
void setFrameRate(float fps)
-
setCursor
void setCursor(int kind)
-
setCursor
void setCursor(PImage image, int hotspotX, int hotspotY)
-
showCursor
void showCursor()
-
hideCursor
void hideCursor()
-
startThread
void startThread()
Start the animation thread
-
pauseThread
void pauseThread()
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().
-
resumeThread
void resumeThread()
-
stopThread
boolean stopThread()
Stop the animation thread (set it null)- Returns:
- false if already stopped
-
isStopped
boolean isStopped()
-
-