public abstract class GAbstractControl extends Object implements PConstants, GConstants, GConstantsInternal
Modifier and Type | Class and Description |
---|---|
static class |
GAbstractControl.Z_Order
Comparator used for controlling the order components are drawn
|
Modifier and Type | Field and Description |
---|---|
String |
tag |
int |
tagNo |
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_STROKE_PURE, 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_STROKE_PURE, 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
ALPHA_BLOCK, ALPHA_PICK, BACKGROUND, BLUE_SCHEME, CLOSE_WINDOW, CTRL_ANGULAR, CTRL_HORIZONTAL, CTRL_VERTICAL, CYAN_SCHEME, DECIMAL, EXIT_APP, EXPONENT, FAMILY, FOREGROUND, GOLD_SCHEME, GREEN_SCHEME, INTEGER, KEEP_OPEN, ORANGE_SCHEME, ORIENT_LEFT, ORIENT_RIGHT, ORIENT_TRACK, POSTURE, POSTURE_OBLIQUE, POSTURE_REGULAR, PURPLE_SCHEME, RED_SCHEME, SCHEME_10, SCHEME_11, SCHEME_12, SCHEME_13, SCHEME_14, SCHEME_15, SCHEME_8, SCHEME_9, SCROLLBAR_HORIZONTAL, SCROLLBAR_VERTICAL, 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, 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, YELLOW_SCHEME
ALL_METHOD, CLIP_RUN, COMBI_MODES, DRAW_METHOD, EXCP_IN_HANDLER, grid, I_CL, I_COVERED, I_CR, I_INSIDE, I_MODES, I_NONE, I_TL, I_TR, KEY_METHOD, MERGE_RUNS, MISSING, MOUSE_METHOD, NONEXISTANT, OFF_CONTROL, OVER_CONTROL, pen_1_0, pen_2_0, pen_3_0, pen_4_0, POST_METHOD, PRE_METHOD, PRESS_CONTROL, RUNTIME_ERROR, TINT_FOR_ALPHA
Constructor and Description |
---|
GAbstractControl(PApplet theApplet,
float p0,
float p1,
float p2,
float p3) |
Modifier and Type | Method and Description |
---|---|
void |
addControl(GAbstractControl c)
Add a control at the position and rotation specified in the control.
|
void |
addControl(GAbstractControl c,
float x,
float y)
Add a control at the given position with zero rotation angle.
|
void |
addControl(GAbstractControl c,
float x,
float y,
float angle)
This will set the rotation of the control to angle overwriting
any previous rotation set.
|
void |
addControls(GAbstractControl... controls) |
void |
addEventHandler(Object obj,
String methodName)
Attempt to create the default event handler for the component class.
|
void |
draw() |
void |
forceBufferUpdate()
This is for emergency use only!!!!
In this version of the library a visual controls is drawn to off-screen buffer and then drawn to the screen by copying the buffer. |
int |
getCursorOver()
Get the shape type when the cursor is over a control
|
float |
getCX()
Get the centre x position of the control
|
float |
getCY()
Get the centre y position of the control
|
static String |
getFocusName() |
float |
getHeight() |
int |
getLocalColorScheme()
Get the local color scheme ID number.
|
PApplet |
getPApplet()
Get the PApplet that manages this component
|
GAbstractControl |
getParent()
Get the parent control.
|
PGraphics |
getSnapshot()
This method should be used sparingly since it is heavy on resources.
|
float |
getWidth() |
float |
getX()
Get the left position of the control
|
float |
getY()
Get the left position of the control
|
boolean |
hasFocus()
Does this component have focus
|
boolean |
isDragging() |
boolean |
isEnabled()
Is this component enabled
|
boolean |
isOpaque()
Find out if the component is opaque
|
boolean |
isVisible() |
void |
keyEvent(KeyEvent e) |
void |
markForDisposal()
If the control is permanently no longer required then call
this method to remove it and free up resources.
|
void |
mouseEvent(MouseEvent event) |
void |
post() |
void |
pre() |
void |
setAlpha(int alpha)
Set the transparency of the component and make it unavailable to
mouse and keyboard events if below the threshold.
|
void |
setAlpha(int alpha,
boolean includeChildren)
Set the transparency of the component and make it unavailable to
mouse and keyboard events if below the threshold.
|
void |
setAvailable(boolean avail)
If a control is made unavailable it will still be drawn but it not respond to user input.
|
void |
setAvailableChildren(boolean avail)
Set the availability for the children only.
|
void |
setCursorOver(int cursorOver)
Set the shape type to use when the cursor is over a control
|
void |
setEnabled(boolean enable)
Enable or disable the ability of the component to generate mouse events.
GTextField - it also controls key press events GPanel - controls whether the panel can be moved/collapsed/expanded |
void |
setFocus(boolean focus)
Determines whether this component is to have focus or not
|
void |
setLocalColorScheme(int cs)
Set the local colour scheme for this control.
|
void |
setLocalColorScheme(int cs,
boolean includeChildren)
Set the local colour scheme for this control.
|
void |
setOpaque(boolean opaque)
Determines whether to show the back colour or not.
|
void |
setRotation(float angle) |
void |
setRotation(float angle,
int mode)
Set the rotation to apply when displaying this control.
|
void |
setVisible(boolean visible) |
String |
toString() |
public String tag
public int tagNo
public GAbstractControl(PApplet theApplet, float p0, float p1, float p2, float p3)
public static String getFocusName()
public void draw()
public void mouseEvent(MouseEvent event)
public void keyEvent(KeyEvent e)
public void pre()
public void post()
public void forceBufferUpdate()
public void setLocalColorScheme(int cs)
cs
- the colour scheme to usepublic void setLocalColorScheme(int cs, boolean includeChildren)
cs
- the colour scheme to useincludeChildren
- if do do the same for all descendantspublic int getLocalColorScheme()
public void setAlpha(int alpha)
alpha
- value in the range 0 (transparent) to 255 (opaque)public void setAlpha(int alpha, boolean includeChildren)
alpha
- value in the range 0 (transparent) to 255 (opaque)includeChildren
- if do do the same for all descendantspublic GAbstractControl getParent()
public PApplet getPApplet()
public PGraphics getSnapshot()
public void addEventHandler(Object obj, String methodName)
obj
- the object to handle the eventmethodName
- the method to execute in the object handler classpublic void setRotation(float angle, int mode)
angle
- public void setRotation(float angle)
public float getX()
public float getY()
public float getCX()
public float getCY()
public float getWidth()
public float getHeight()
public void setVisible(boolean visible)
visible
- the visibility to setpublic boolean isVisible()
public void setAvailable(boolean avail)
avail
- public void setAvailableChildren(boolean avail)
avail
- public void setOpaque(boolean opaque)
opaque
- public boolean isOpaque()
public boolean isDragging()
public void setEnabled(boolean enable)
enable
- true to enable else falsepublic boolean isEnabled()
public void setFocus(boolean focus)
focus
- public boolean hasFocus()
public void addControl(GAbstractControl c, float x, float y, float angle)
c
- the control to add.x
- the leftmost or centre position depending on controlModey
- the topmost or centre position depending on controlModeangle
- the rotation angle (replaces any the angle specified in control)public void addControl(GAbstractControl c, float x, float y)
c
- the control to add.x
- the leftmost or centre position depending on controlModey
- the topmost or centre position depending on controlModepublic void addControl(GAbstractControl c)
c
- the control to addpublic void addControls(GAbstractControl... controls)
public int getCursorOver()
public void setCursorOver(int cursorOver)
cursorOver
- the shape type to usepublic void markForDisposal()
btnDoThisthen to remove the button use the statements
btnDoThis.dispose();
btnDoThis = null;
Processing library G4P by Peter Lager. (C) 2012