public class G4P extends Object implements PConstants, GConstants
Modifier and Type | Field and Description |
---|---|
static boolean |
cursorChangeEnabled |
static String[] |
fontFamilies
An array of names representing all the available fonts.
|
static PStyle |
g4pStyle |
static PApplet |
mainWinApp |
static boolean |
messages |
static int |
mouseOff |
static int |
mouseOver |
static boolean |
overControl |
ADD, ALPHA, ALPHA_MASK, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_2D, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_STROKE_PERSPECTIVE, DISABLE_TEXTURE_CACHE, DISABLE_TEXTURE_MIPMAPS, DISABLE_TRANSFORM_CACHE, DODGE, DOWN, DXF, ELLIPSE, ENABLE_ACCURATE_2D, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_STROKE_PERSPECTIVE, ENABLE_TEXTURE_CACHE, ENABLE_TEXTURE_MIPMAPS, ENABLE_TRANSFORM_CACHE, ENTER, EPSILON, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, GIF, GRAY, GREEN_MASK, 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, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPHERE, SPOT, SQUARE, SUBTRACT, TAB, TARGA, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z
ADD_DUPLICATE, BACKGROUND, CHANGED, CLICKED, CLOSE_WINDOW, COLLAPSED, CTRL_ANGULAR, CTRL_HORIZONTAL, CTRL_VERTICAL, DESELECTED, DISABLE_AUTO_DRAW, DRAGGED, ENTERED, EXCP_IN_HANDLER, EXIT_APP, EXPANDED, FAMILY, FOREGROUND, HUD_UNSUPPORTED, INVALID_STATUS, JUSTIFICATION, JUSTIFICATION_FULL, JUSTIFICATION_NONE, KEEP_OPEN, MISSING, NONEXISTANT, NOT_PEASYCAM, POSTURE, POSTURE_OBLIQUE, POSTURE_REGULAR, PRESSED, RELEASED, RUNTIME_ERROR, SCROLL_DOWN, SCROLL_LEFT, SCROLL_RIGHT, SCROLL_UP, SCROLLBAR_HORIZONTAL, SCROLLBAR_VERTICAL, SCROLLBARS_AUTOHIDE, SCROLLBARS_BOTH, SCROLLBARS_HORIZONTAL_ONLY, SCROLLBARS_NONE, SCROLLBARS_VERTICAL_ONLY, SELECTED, SET, SIZE, STRIKETHROUGH, STRIKETHROUGH_OFF, STRIKETHROUGH_ON, SUPERSCRIPT, SUPERSCRIPT_SUB, SUPERSCRIPT_SUPER, USER_COL_SCHEME, 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
Constructor and Description |
---|
G4P() |
Modifier and Type | Method and Description |
---|---|
static void |
addComponent(PApplet app,
GComponent c)
INTERNAL USE ONLY
This should be called by all ctors in GComponent and since all GUI components inherit from GComponent and are required to call a GComponent ctor then all GUI components will automatically be registered in the set. |
static void |
addWindow(GWindow window)
Add the window's PApplet object to G4P if not already there.
|
static guicomponents.G4P.AppletInfo |
addWindow(PApplet app)
Add a PApplet object to G4P if not already there.
|
static void |
cursor(int cursorOver)
Inform G4P which cursor to use for mouse over.
|
static void |
cursor(int cursorOff,
int cursorOver)
Inform G4P which cursor shapes will be used.
|
static void |
draw(PApplet app)
When you first use G4P(app) it switches off auto draw for the
PApplet app.
|
static void |
dumpComponent(GComponent c)
INTERNAL USE ONLY
Remove a component so that it is permanently unavailable. |
static String |
getFamily(String family)
See if this font family is available on this user's computer system
and return the family name if found.
|
static boolean |
isAutoDrawOn(PApplet app)
Is autodraw on for the PApplet app?
|
static boolean |
isWindowActive(GWindow window)
Determines whether a window is still open or has been closed
|
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 |
moveToFrontForDraw(GComponent comp)
INTERNAL USE ONLY
Used to bring a panel to the front of the display. |
static void |
moveToFrontForMouse(GComponent comp)
INTERNAL USE ONLY
Used to ensure the panel is the last component to be tested for mouse events. |
static void |
refresh() |
static void |
removeWindow(GWindow window)
INTERNAL USE ONLY
Remove control window - called when a ControlWindow is closed for good. |
static void |
setColorScheme(PApplet theApplet,
int schemeNo)
Set the color scheme to be used by G4P
Only reqd if different from the default blue scheme to be global specify before creating GUI components Available schemes: BLUE_SCHEME, GREEN_SCHEME, RED_SCHEME, PURPLE_SCHEME YELLOW_SCHEME, CYAN_SCHEME, GREY_SCHEME |
static void |
setDrawOrder(GWindow window)
This will sort the GUI controls in a secondary window.
|
static void |
setDrawOrder(PApplet app)
If you are using GPanel or GCombo it would be useful to call this method in setup
or customGUI (if using GUI builder tool).
|
static void |
setFont(Font font)
Set the global font to be used by all controls.
|
static void |
setFont(PApplet theApplet,
String fontName,
int fontSize)
Deprecated.
|
static void |
setFont(String fontName,
int fontSize)
Set the global font to be used by all controls.
|
static void |
setFont(String fontName,
int fontSize,
int style)
Set the global font to be used by all controls.
|
static void |
setMouseOverEnabled(boolean enable)
Enables or disables cursor over component change.
|
public static PApplet mainWinApp
public static PStyle g4pStyle
public static boolean messages
public static final String[] fontFamilies
public static boolean overControl
public static boolean cursorChangeEnabled
public static int mouseOff
public static int mouseOver
public static String getFamily(String family)
family
- public static void setMouseOverEnabled(boolean enable)
enable
- public static void refresh()
public static void cursor(int cursorOff, int cursorOver)
cursorOff
- cursorOver
- public static void cursor(int cursorOver)
cursorOver
- public static void addComponent(PApplet app, GComponent c)
theApplet
- c
- the component that has been created.public static void dumpComponent(GComponent c)
c
- the component to removepublic static void addWindow(GWindow window)
window
- public static guicomponents.G4P.AppletInfo addWindow(PApplet app)
void setup(){
size(480, 320);
G4P.addWindow(this);
app
- the PApplet object to addpublic static void removeWindow(GWindow window)
window
- public static boolean isWindowActive(GWindow window)
window
- public static void setColorScheme(PApplet theApplet, int schemeNo)
theApplet
- schemeNo
- GCScheme.GREEN_SCHEMEpublic static void setFont(PApplet theApplet, String fontName, int fontSize)
theApplet
- fontName
- name of fontfontSize
- font sizepublic static void setFont(String fontName, int fontSize)
fontName
- font family namefontSize
- font sizepublic static void setFont(String fontName, int fontSize, int style)
fontName
- font family namefontSize
- font sizestyle
- style e.g. Font.PLAINpublic static void setFont(Font font)
font
- the java.awt.Font to usepublic static void draw(PApplet app)
public static boolean isAutoDrawOn(PApplet app)
public static void messagesEnabled(boolean enable)
enable
- public static void setDrawOrder(GWindow window)
window
- the GWindow objectpublic static void setDrawOrder(PApplet app)
windowApp
- the PApplet objectpublic static void moveToFrontForDraw(GComponent comp)
public static void moveToFrontForMouse(GComponent comp)
Processing library guicomponents by Peter Lager. (C) 2012