public class GTextArea extends GEditableTextControl
GAbstractControl.Z_Order
Modifier and Type | Field and Description |
---|---|
static int |
ALL_METHOD |
static int |
CLIP_RUN |
static int |
COMBI_MODES |
static java.lang.String |
DEFAULT_SLIDER_STYLE |
static int |
DRAG_CONTROL |
static int |
DRAW_METHOD |
static char |
EOL |
static int |
EXCP_IN_HANDLER |
static int[][] |
grid |
static int |
GROUP_CONTROL_METHOD |
static int |
I_CL |
static int |
I_COVERED |
static int |
I_CR |
static int |
I_INSIDE |
static int |
I_MODES |
static int |
I_NONE |
static int |
I_TL |
static int |
I_TR |
static int |
INVALID_PAPPLET |
static int |
INVALID_TYPE |
static int |
KEY_METHOD |
static int |
MERGE_RUNS |
static int |
MISSING |
static int |
MOUSE_METHOD |
static int |
NONEXISTANT |
static int |
OFF_CONTROL |
static int |
OVER_CONTROL |
static java.awt.BasicStroke |
pen_1_0 |
static java.awt.BasicStroke |
pen_2_0 |
static java.awt.BasicStroke |
pen_3_0 |
static java.awt.BasicStroke |
pen_4_0 |
static int |
POST_METHOD |
static int |
PRE_METHOD |
static int |
PRESS_CONTROL |
static int |
SCROLLBAR_HORIZONTAL |
static int |
SCROLLBAR_VERTICAL |
static java.lang.String |
SLIDER_STYLES |
static int |
TINT_FOR_ALPHA |
static int |
TPAD2 |
static int |
TPAD4 |
static int |
TPAD6 |
static int |
TPAD8 |
static float |
WHEEL_DELTA |
static float |
WHEEL_STICK_FACTOR |
static int |
Z_PANEL |
static int |
Z_SLIPPY |
static int |
Z_SLIPPY_EXPANDS |
static int |
Z_STICKY |
tag, tagNo
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
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
Constructor and Description |
---|
GTextArea(processing.core.PApplet theApplet,
float p0,
float p1,
float p2,
float p3)
Create a text area without scrollbars and a text wrap width to fit the control.
|
GTextArea(processing.core.PApplet theApplet,
float p0,
float p1,
float p2,
float p3,
int sbPolicy)
Create a text field with the given scrollbar policy and a text wrap width to fit the control.
|
GTextArea(processing.core.PApplet theApplet,
float p0,
float p1,
float p2,
float p3,
int sbPolicy,
int wrapWidth)
Create a text field with the given scrollbar policy with a user specified text wrap length
|
Modifier and Type | Method and Description |
---|---|
void |
addStyle(java.awt.font.TextAttribute attr,
java.lang.Object value,
int lineNo)
Adds the text attribute to an entire display line.
|
void |
addStyle(java.awt.font.TextAttribute attr,
java.lang.Object value,
int lineNo,
int charStart,
int charEnd)
Adds the text attribute to a range of characters on a particular display line.
|
boolean |
appendText(java.lang.String text)
Add text to the end of the current text.
|
void |
clearStyles(int lineNo)
Clears all text attribute from an entire display line.
|
void |
clearStyles(int lineNo,
int charStart,
int charEnd)
Clears all text attribute from a range of characters on a particular display line.
|
void |
draw() |
int[] |
getCaretPos()
Get the current caret position.
|
int[] |
getCaretPos(int[] cpos)
Get the current caret position.
|
processing.core.PGraphics |
getSnapshot()
This method should be used sparingly since it is heavy on resources.
|
java.lang.String |
getText(int lineNo)
Get the text on a particular line in the text area.
|
java.lang.String[] |
getTextAsArray()
Get the text as a String array.
|
int |
getTextLength(int lineNo,
boolean ignoreEOL)
Get the length of text on a particular line in the text area.
|
boolean |
insertText(java.lang.String text)
Insert text at the current caret position.
|
boolean |
insertText(java.lang.String text,
boolean startWithEOL,
boolean endWithEOL)
Insert text at the current caret position.
|
boolean |
insertText(java.lang.String text,
int lineNo,
int charNo)
Insert text at the display position specified.
|
boolean |
insertText(java.lang.String text,
int lineNo,
int charNo,
boolean startWithEOL,
boolean endWithEOL)
Insert text at the display position specified.
|
void |
mouseEvent(processing.event.MouseEvent event)
Will respond to mouse events.
|
void |
moveCaretTo(int lineNo,
int charNo)
Move the insertion point (caret) to the specified line and character.
|
void |
pre() |
void |
setStyledText(StyledString st)
Set the styled text to be displayed.
|
void |
setText(java.lang.String text)
Set the text to be used.
|
void |
setText(java.lang.String[] lines)
Set the text to display and adjust any scrollbars
|
void |
setText(java.lang.String[] lines,
int wrapWidth)
Set the text to display and adjust any scrollbars
|
void |
setText(java.lang.String text,
int wrapWidth)
Set the text to display and adjust any scrollbars
|
addStyle, addStyle, clearSelectionStyle, clearStyles, clearStyles, dispose, flashCaret, getPromptText, getSelectedText, getStyledText, getText, getWrapWidth, hasSelection, hsbEventHandler, isTextEditEnabled, keyEvent, loadText, markForDisposal, saveText, setFocus, setFont, setJustify, setLocalColorScheme, setPromptText, setSelectedTextStyle, setTabManager, setTextEditEnabled, setWrapWidth, vsbEventHandler
forceBufferUpdate, setTextBold, setTextBold, setTextItalic, setTextItalic, setTextPlain
addControl, addControl, addControl, addControls, addEventHandler, getCursorOver, getCX, getCY, getHeight, getLocalColorScheme, getPApplet, getParent, getWidth, getX, getY, hasFocus, isDragging, isEnabled, isOpaque, isOver, isVisible, moveTo, moveTo, post, saveSnapshot, saveSnapshot, setAlpha, setAlpha, setCursorOver, setEnabled, setLocalColor, setLocalColorScheme, setOpaque, setRotation, setRotation, setVisible, toString
public static final java.lang.String SLIDER_STYLES
public static final java.lang.String DEFAULT_SLIDER_STYLE
public static final int DRAW_METHOD
public static final int MOUSE_METHOD
public static final int PRE_METHOD
public static final int KEY_METHOD
public static final int POST_METHOD
public static final int ALL_METHOD
public static final int GROUP_CONTROL_METHOD
public static final int MISSING
public static final int NONEXISTANT
public static final int INVALID_TYPE
public static final int INVALID_PAPPLET
public static final int EXCP_IN_HANDLER
public static final int OFF_CONTROL
public static final int OVER_CONTROL
public static final int PRESS_CONTROL
public static final int DRAG_CONTROL
public static final int TINT_FOR_ALPHA
public static final int I_NONE
public static final int I_TL
public static final int I_TR
public static final int I_CL
public static final int I_CR
public static final int I_INSIDE
public static final int I_COVERED
public static final int I_MODES
public static final int MERGE_RUNS
public static final int CLIP_RUN
public static final int COMBI_MODES
public static final int[][] grid
public static final java.awt.BasicStroke pen_1_0
public static final java.awt.BasicStroke pen_2_0
public static final java.awt.BasicStroke pen_3_0
public static final java.awt.BasicStroke pen_4_0
public static final int TPAD2
public static final int TPAD4
public static final int TPAD6
public static final int TPAD8
public static final int SCROLLBAR_VERTICAL
public static final int SCROLLBAR_HORIZONTAL
public static final float WHEEL_DELTA
public static final float WHEEL_STICK_FACTOR
public static final char EOL
public static final int Z_STICKY
public static final int Z_SLIPPY
public static final int Z_SLIPPY_EXPANDS
public static final int Z_PANEL
public GTextArea(processing.core.PApplet theApplet, float p0, float p1, float p2, float p3)
theApplet
- p0
- p1
- p2
- p3
- public GTextArea(processing.core.PApplet theApplet, float p0, float p1, float p2, float p3, int sbPolicy)
theApplet
- p0
- p1
- p2
- p3
- sbPolicy
- public GTextArea(processing.core.PApplet theApplet, float p0, float p1, float p2, float p3, int sbPolicy, int wrapWidth)
theApplet
- p0
- p1
- p2
- p3
- sbPolicy
- wrapWidth
- public void setText(java.lang.String text, int wrapWidth)
text
- text to displaywrapWidth
- the wrap widthpublic void setText(java.lang.String text)
public void setText(java.lang.String[] lines)
lines
- an array of Strings representing the text to displaypublic void setText(java.lang.String[] lines, int wrapWidth)
lines
- an array of Strings representing the text to displaywrapWidth
- the wrap widthpublic java.lang.String[] getTextAsArray()
public void addStyle(java.awt.font.TextAttribute attr, java.lang.Object value, int lineNo, int charStart, int charEnd)
attr
- the text attribute to addvalue
- value of the text attributelineNo
- the display line number (starts at 0)charStart
- the position of the first character to apply the attributecharEnd
- the position after the last character to apply the attributepublic void addStyle(java.awt.font.TextAttribute attr, java.lang.Object value, int lineNo)
attr
- the text attribute to addvalue
- value of the text attributelineNo
- the display line number (starts at 0)public void clearStyles(int lineNo, int charStart, int charEnd)
lineNo
- the display line number (starts at 0)charStart
- the position of the first character to apply the attributecharEnd
- the position after the last character to apply the attributepublic void clearStyles(int lineNo)
lineNo
- the display line number (starts at 0)public void setStyledText(StyledString st)
setStyledText
in class GTextBase
public boolean appendText(java.lang.String text)
text
- the text to appendpublic boolean insertText(java.lang.String text, int lineNo, int charNo)
text
- the text to insertlineNo
- the area line numbercharNo
- the character position to insert text in display linepublic boolean insertText(java.lang.String text, int lineNo, int charNo, boolean startWithEOL, boolean endWithEOL)
text
- the text to insertlineNo
- the area line numbercharNo
- the character position to insert text in display linestartWithEOL
- if true,inserted text will start on newlineendWithEOL
- if true, text after inserted text will start on new linepublic boolean insertText(java.lang.String text, boolean startWithEOL, boolean endWithEOL)
text
- the text to insertstartWithEOL
- if true,inserted text will start on newlineendWithEOL
- if true, text after inserted text will start on new linepublic boolean insertText(java.lang.String text)
text
- the text to insertpublic java.lang.String getText(int lineNo)
lineNo
- the text area line number we wantpublic int getTextLength(int lineNo, boolean ignoreEOL)
lineNo
- the text area line number we wantignoreEOL
- if true do not include trailing end=of-line characterspublic void pre()
pre
in class GAbstractControl
public void draw()
draw
in class GAbstractControl
public processing.core.PGraphics getSnapshot()
GAbstractControl
getSnapshot
in class GAbstractControl
public void moveCaretTo(int lineNo, int charNo)
lineNo
- the line number (starts at 0)charNo
- the character position on the line (starts at 0)public int[] getCaretPos()
public int[] getCaretPos(int[] cpos)
cpos
- array to be populated with caret positionpublic void mouseEvent(processing.event.MouseEvent event)
mouseEvent
in class GAbstractControl
Processing library G4P by Peter Lager. (c) 2017