public class G4P extends java.lang.Object implements GConstants, processing.core.PConstants
G4P.method_name(parameters); G4P.name_of_constant;
G4P.usePre35Fonts();before you create any GUI controls.
ALPHA_BLOCK, ALPHA_PICK, BACKGROUND, BLUE_SCHEME, CANCEL, CLOSE_WINDOW, CLOSED, CTRL_ANGULAR, CTRL_HORIZONTAL, CTRL_VERTICAL, CYAN_SCHEME, DECIMAL, END, ERROR, EXIT_APP, EXPONENT, FAMILY, FOREGROUND, FORWARD, GOLD_SCHEME, GREEN_SCHEME, HOME, INFO, INTEGER, KEEP_OPEN, NO, OK, OK_CANCEL, ORANGE_SCHEME, ORIENT_LEFT, ORIENT_RIGHT, ORIENT_TRACK, PLAIN, POSTURE, POSTURE_OBLIQUE, POSTURE_REGULAR, PURPLE_SCHEME, QUERY, RED_SCHEME, REVERSE, SCHEME_10, SCHEME_11, SCHEME_12, SCHEME_13, SCHEME_14, SCHEME_15, SCHEME_8, SCHEME_9, SCROLLBARS_AUTOHIDE, SCROLLBARS_BOTH, SCROLLBARS_HORIZONTAL_ONLY, SCROLLBARS_NONE, SCROLLBARS_VERTICAL_ONLY, SIZE, STRIKETHROUGH, STRIKETHROUGH_OFF, STRIKETHROUGH_ON, SUPERSCRIPT, SUPERSCRIPT_OFF, SUPERSCRIPT_SUB, SUPERSCRIPT_SUPER, USER_COL_SCHEME, WARNING, WEIGHT, WEIGHT_BOLD, WEIGHT_DEMIBOLD, WEIGHT_DEMILIGHT, WEIGHT_EXTRA_LIGHT, WEIGHT_EXTRABOLD, WEIGHT_HEAVY, WEIGHT_LIGHT, WEIGHT_MEDIUM, WEIGHT_REGULAR, WEIGHT_SEMIBOLD, WEIGHT_ULTRABOLD, WIDTH, WIDTH_CONDENSED, WIDTH_EXTENDED, WIDTH_REGULAR, WIDTH_SEMI_CONDENSED, WIDTH_SEMI_EXTENDED, X4, X8, YELLOW_SCHEME, YES, YES_NO, YES_NO_CANCEL
ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ASYNC_SAVEFRAME, DISABLE_BUFFER_READING, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_KEY_REPEAT, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_ASYNC_SAVEFRAME, ENABLE_BUFFER_READING, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_KEY_REPEAT, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ESC, EXCLUSION, FX2D, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NORMAL, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADRATIC_VERTEX, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPAN, SPHERE, SPOT, SQUARE, SUBTRACT, SVG, TAB, TARGA, TAU, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z
Constructor and Description |
---|
G4P() |
Modifier and Type | Method and Description |
---|---|
static GControlMode |
getCtrlMode()
Get the control creation mode @see ctrlMode(int mode)
|
static int |
getCursor()
Get the cursor shape used when the mouse is not over a G4P
control
set for the
|
static int |
getCursorOff()
Deprecated.
use getCursor()
|
static GWindow[] |
getOpenWindowsAsArray()
Get an array of GWindow objects even if minimised or invisible.
|
static java.util.ArrayList<GWindow> |
getOpenWindowsAsList(java.util.ArrayList<GWindow> list)
Get a list of all open GWindow objects even if minimised or invisible.
|
static java.lang.String |
getPrettyVersion()
return the pretty version of the library.
|
static java.lang.String |
getVersion()
return the version of the library used by Processing
|
static boolean |
isWindowOpen(GWindow window)
Use this to check whether a GWindow window is still open (as far as G4P is concerned).
|
static void |
messagesEnabled(boolean enable)
G4P has a range of support messages eg
if you create a GUI component without an event handler or, a slider where the visible size of the slider is less than the difference between min and max values. |
static void |
mouseWheelDirection(int dir)
Determines how the direction of the mouse wheel rotation is interpreted
for sliders and knobs.
|
static void |
mouseWheelScrollbarDirection(int dir)
Determines how the direction of the mouse wheel rotation is interpreted
for sliders.
|
static void |
registerSketch(processing.core.PApplet app)
Used to register the main sketch window with G4P.
|
static int |
selectColor()
This will open a version of the Java Swing color chooser dialog.
|
static int |
selectColor(java.awt.Color color)
This will open a version of the Java Swing color chooser dialog.
|
static int |
selectColor(int red,
int green,
int blue)
This will open a version of the Java Swing color chooser dialog.
|
static java.lang.String |
selectFolder(java.lang.String prompt)
Select a folder from the local file system.
|
static java.lang.String |
selectInput(java.lang.String prompt)
Select a file for input from the local file system.
|
static java.lang.String |
selectInput(java.lang.String prompt,
java.lang.String startFolder)
Select a file for input from the local file system.
|
static java.lang.String |
selectInput(java.lang.String prompt,
java.lang.String types,
java.lang.String typeDesc)
Select a file for input from the local file system.
|
static java.lang.String |
selectInput(java.lang.String prompt,
java.lang.String types,
java.lang.String typeDesc,
java.lang.String startFolder)
Select a file for input from the local file system.
|
static int |
selectOption(processing.core.PApplet owner,
java.lang.String message,
java.lang.String title,
int messageType,
int optionType)
Display a simple message dialog window.
|
static java.lang.String |
selectOutput(java.lang.String prompt)
Select a file for output from the local file system.
|
static java.lang.String |
selectOutput(java.lang.String prompt,
java.lang.String startFolder)
Select a file for output from the local file system.
|
static java.lang.String |
selectOutput(java.lang.String prompt,
java.lang.String types,
java.lang.String typeDesc)
Select a file for output from the local file system.
|
static java.lang.String |
selectOutput(java.lang.String prompt,
java.lang.String types,
java.lang.String typeDesc,
java.lang.String startFolder)
Select a file for output from the local file system.
|
static void |
setCtrlMode(GControlMode mode)
Change the way position and size parameters are interpreted when a control is created.
|
static void |
setCursor(int cursorOff)
Set the cursor shape to be used when the mouse is not over a
G4P control for the entire application including secondary
windows.
|
static void |
setCursorOff(int cursorOff)
Deprecated.
use setCursor(int)
|
static void |
setGlobalAlpha(int alpha)
Set the transparency of all controls.
|
static void |
setGlobalColorScheme(int cs)
Set the global colour scheme.
|
static void |
setMouseOverEnabled(boolean enable)
Enables or disables cursor over component change.
|
static void |
setWindowAlpha(processing.core.PApplet app,
int alpha)
Set the transparency level for all controls drawn by the given
PApplet.
|
static void |
setWindowColorScheme(processing.core.PApplet app,
int cs)
Set the colour scheme for all the controls drawn by the given
PApplet.
|
static void |
showMessage(processing.core.PApplet owner,
java.lang.String message,
java.lang.String title,
int messageType)
Display a simple message dialog window.
|
static void |
usePre35Fonts()
Versions of G4P prior to 3.5 used logical fonts for the controls.
|
public static java.lang.String getPrettyVersion()
public static java.lang.String getVersion()
public static void registerSketch(processing.core.PApplet app)
app
- public static void setGlobalColorScheme(int cs)
cs
- colour scheme to use (0-15)public static void usePre35Fonts()
public static void setWindowColorScheme(processing.core.PApplet app, int cs)
app
- cs
- public static void setGlobalAlpha(int alpha)
alpha
- value in the range 0 (transparent) to 255 (opaque)public static void setWindowAlpha(processing.core.PApplet app, int alpha)
app
- alpha
- value in the range 0 (transparent) to 255 (opaque)public static void setCtrlMode(GControlMode mode)
PApplet.CORNER (x, y, w, h)
PApplet.CORNERS (x0, y0, x1, y1)
PApplet.CENTER (cx, cy, w, h)
mode
- illegal values are ignored leaving the mode unchangedpublic static GControlMode getCtrlMode()
public static void messagesEnabled(boolean enable)
enable
- public static void setMouseOverEnabled(boolean enable)
enable
- true to enable cursor change over components.public static void mouseWheelDirection(int dir)
dir
- FORWARD or REVERSE, illegal values are ignoredpublic static void mouseWheelScrollbarDirection(int dir)
dir
- FORWARD or REVERSE, illegal values are ignored@Deprecated public static void setCursorOff(int cursorOff)
public static void setCursor(int cursorOff)
cursorOff
- the cursor shape.public static int getCursor()
@Deprecated public static int getCursorOff()
public static java.util.ArrayList<GWindow> getOpenWindowsAsList(java.util.ArrayList<GWindow> list)
list
- an optional ArrayList to use. In null will create a new ArrayList.public static GWindow[] getOpenWindowsAsArray()
public static boolean isWindowOpen(GWindow window)
window
- the window we are interested inpublic static int selectColor()
public static int selectColor(java.awt.Color color)
color
- the color to start the dialogpublic static int selectColor(int red, int green, int blue)
red
- red channel value (0-255)green
- green channel value (0-255)blue
- red channel value (0-255)public static java.lang.String selectFolder(java.lang.String prompt)
prompt
- the frame text for the chooserpublic static java.lang.String selectInput(java.lang.String prompt)
prompt
- the frame text for the chooserpublic static java.lang.String selectInput(java.lang.String prompt, java.lang.String startFolder)
prompt
- the frame text for the chooserstartFolder
- the location to start the dialog boxpublic static java.lang.String selectInput(java.lang.String prompt, java.lang.String types, java.lang.String typeDesc)
prompt
- the frame text for the choosertypes
- a comma separated list of file extensions e.g. "png,gif,jpg,jpeg"typeDesc
- simple textual description of the file types e.g. "Image files"public static java.lang.String selectInput(java.lang.String prompt, java.lang.String types, java.lang.String typeDesc, java.lang.String startFolder)
prompt
- the frame text for the choosertypes
- a comma separated list of file extensions e.g. "png,gif,jpg,jpeg"typeDesc
- simple textual description of the file types e.g. "Image files"startFolder
- the folder where the dialog starts (uses default if null or not a folder)public static java.lang.String selectOutput(java.lang.String prompt)
prompt
- the frame text for the chooserpublic static java.lang.String selectOutput(java.lang.String prompt, java.lang.String startFolder)
prompt
- the frame text for the chooserstartFolder
- the folder where the dialog starts (uses default if null or not a folder)public static java.lang.String selectOutput(java.lang.String prompt, java.lang.String types, java.lang.String typeDesc)
prompt
- the frame text for the choosertypes
- a comma separated list of file extensions e.g. "png,jpf,tiff"typeDesc
- simple textual description of the file types e.g. "Image files"public static java.lang.String selectOutput(java.lang.String prompt, java.lang.String types, java.lang.String typeDesc, java.lang.String startFolder)
prompt
- the frame text for the choosertypes
- a comma separated list of file extensions e.g. "png,jpf,tiff"typeDesc
- simple textual description of the file types e.g. "Image files"startFolder
- the folder where the dialog starts (uses default if null or not a folder)public static void showMessage(processing.core.PApplet owner, java.lang.String message, java.lang.String title, int messageType)
owner
- the control responsible for this dialog.message
- the text to be displayed in the main area of the dialogtitle
- the text to appear in the dialog's title bar.messageType
- the message typepublic static int selectOption(processing.core.PApplet owner, java.lang.String message, java.lang.String title, int messageType, int optionType)
owner
- the control responsible for this dialog.message
- the text to be displayed in the main area of the dialogtitle
- the text to appear in the dialog's title bar.messageType
- the message typeoptionType
- Processing library G4P by Peter Lager. (c) 2017