public class GValueControl extends GAbstractControl
GAbstractControl.Z_Order
tag, 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 |
---|
GValueControl(PApplet theApplet,
float p0,
float p1,
float p2,
float p3) |
Modifier and Type | Method and Description |
---|---|
float |
getEasing()
Get the current value used for easing.
|
float |
getEndLimit() |
int |
getNbrTicks()
Get the number of tick marks.
|
int |
getPrecision()
Precision used with floating point numbers
|
float |
getStartLimit() |
String |
getUnit() |
float |
getValueF()
Get the current value as a float
|
int |
getValueI()
Get the current value as an integer.
|
String |
getValueS()
If we are using labels then this will get the label text
associated with the current value.
|
int |
getValueType() |
boolean |
isShowLimits()
Are the limit values visible?
|
boolean |
isShowTicks()
Are the tick marks visible?
|
boolean |
isShowValue()
Is the current value to be displayed?
|
boolean |
isStickToTicks()
Is the value constrained to the tick marks?
|
void |
pre() |
void |
setEasing(float easeBy)
Set the amount of easing to be used when a value is changing.
|
void |
setLimits(float start,
float end)
Sets the range of values to be returned.
|
void |
setLimits(float initValue,
float start,
float end)
Sets the initial value and the range of values to be returned.
|
void |
setLimits(int start,
int end)
Sets the range of values to be returned.
|
void |
setLimits(int initValue,
int start,
int end)
Sets the initial value and the range of values to be returned.
|
void |
setNbrTicks(int noOfTicks)
The number of ticks must be >= 2 since 2 are required for the slider limits.
|
void |
setNumberFormat(int numberFormat) |
void |
setNumberFormat(int numberFormat,
int precision)
Set the numberFormat and precision in one go.
|
void |
setNumberFormat(int numberFormat,
int precision,
String unit)
Set the numberFormat, precision and units in one go.
|
void |
setPrecision(int nd)
For DECIMAL values this sets the number of decimal places to
be displayed.
|
void |
setShowDecor(boolean opaque,
boolean ticks,
boolean value,
boolean limits)
Convenience method to set what is to be drawn to the screen.
|
void |
setShowLimits(boolean showLimits)
Set whether the limits are to be displayed or not.
|
void |
setShowTicks(boolean showTicks)
Set whether the tick marks are to be displayed or not.
|
void |
setShowValue(boolean showValue)
Set whether the current value is to be displayed or not.
|
void |
setStickToTicks(boolean stickToTicks)
Specify whether the values are to be constrained to the tick marks or not.
|
void |
setUnits(String units)
The units to be displayed with the current and limit values e.g.
|
void |
setValue(float v)
Set the value for the slider.
|
addControl, addControl, addControl, addControls, addEventHandler, draw, forceBufferUpdate, getCursorOver, getCX, getCY, getFocusName, getHeight, getLocalColorScheme, getPApplet, getParent, getSnapshot, getWidth, getX, getY, hasFocus, isDragging, isEnabled, isOpaque, isVisible, keyEvent, markForDisposal, mouseEvent, post, setAlpha, setAlpha, setAvailable, setAvailableChildren, setCursorOver, setEnabled, setFocus, setLocalColorScheme, setLocalColorScheme, setOpaque, setRotation, setRotation, setVisible, toString
public GValueControl(PApplet theApplet, float p0, float p1, float p2, float p3)
public void pre()
pre
in class GAbstractControl
public void setLimits(int start, int end)
start
- the start value of the rangeend
- the end value of the rangepublic void setLimits(int initValue, int start, int end)
initValue
- the initial valuestart
- the start value of the rangeend
- the end value of the rangepublic void setLimits(float start, float end)
start
- end
- public void setLimits(float initValue, float start, float end)
initValue
- the initial valuestart
- the start value of the rangeend
- the end value of the rangepublic void setValue(float v)
v
- public void setPrecision(int nd)
nd
- must be >= 1 otherwise will use 1public void setUnits(String units)
units
- for example kg, m, ($), fpspublic void setNumberFormat(int numberFormat, int precision, String unit)
numberFormat
- INTEGER, DECIMAL or EXPONENTprecision
- must be >= 1units
- for example kg, m, ($), fpspublic void setNumberFormat(int numberFormat, int precision)
numberFormat
- INTEGER, DECIMAL or EXPONENTprecision
- must be >= 1public void setNumberFormat(int numberFormat)
public float getValueF()
public int getValueI()
public String getValueS()
public float getEasing()
public void setEasing(float easeBy)
easeBy
- the easing to setpublic int getNbrTicks()
public void setNbrTicks(int noOfTicks)
noOfTicks
- the nbrTicks to setpublic boolean isStickToTicks()
public void setStickToTicks(boolean stickToTicks)
stickToTicks
- true if you want to constrain the values else falsepublic boolean isShowTicks()
public void setShowTicks(boolean showTicks)
showTicks
- the showTicks to setpublic boolean isShowLimits()
public void setShowLimits(boolean showLimits)
showLimits
- the showLimits to setpublic boolean isShowValue()
public void setShowValue(boolean showValue)
showValue
- the showValue to setpublic void setShowDecor(boolean opaque, boolean ticks, boolean value, boolean limits)
opaque
- show backgroundticks
- show tick marksvalue
- show current valuelimits
- show min and max values (limits)public float getStartLimit()
public float getEndLimit()
public int getValueType()
public int getPrecision()
public String getUnit()
Processing library G4P by Peter Lager. (C) 2012