|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mt4j.components.MTComponent
org.mt4j.components.visibleComponents.AbstractVisibleComponent
org.mt4j.components.visibleComponents.shapes.AbstractShape
org.mt4j.components.visibleComponents.shapes.MTPolygon
org.mt4j.components.visibleComponents.shapes.MTRectangle
org.mt4j.components.visibleComponents.widgets.MTTextArea
public class MTTextArea
The Class MTTextArea. This widget allows to display text with a specified font. If the constructor with no fixed text are dimensions is used, the text area will expand itself to fit the text in.
If the constructor with fixed dimensions is used, the text will have word wrapping and be clipped to the specified dimensions.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.mt4j.components.visibleComponents.shapes.MTRectangle |
---|
MTRectangle.PositionAnchor |
Field Summary |
---|
Fields inherited from class org.mt4j.components.visibleComponents.shapes.AbstractShape |
---|
BOUNDS_CHECK_THEN_GEOMETRY_CHECK, BOUNDS_DONT_USE, BOUNDS_ONLY_CHECK |
Constructor Summary | |
---|---|
MTTextArea(float x, float y, float width, float height, IFont font, processing.core.PApplet pApplet) Instantiates a new mT text area. |
|
MTTextArea(processing.core.PApplet pApplet, IFont font) Instantiates a new text area. |
Method Summary | |
---|---|
void |
appendCharByName(java.lang.String characterName) Append char by name. |
void |
appendCharByUnicode(java.lang.String unicode) Append char by unicode. |
void |
appendText(java.lang.String string) Appends the string to the textarea. |
protected void |
characterAdded(IFontCharacter character) |
protected void |
characterRemoved(IFontCharacter character) |
void |
clear() resets the textarea, clears all characters. |
void |
drawComponent(processing.core.PGraphics g) Draws this component only (Not its children!). |
IFontCharacter[] |
getCharacters() Gets the characters. |
IFont |
getFont() Gets the font. |
float |
getInnerPadding() |
protected float |
getLastLineWidth() |
int |
getLineCount() Gets the line count. |
protected float |
getMaxLineWidth() Gets the max line width. |
protected float |
getScrollTextX() |
protected float |
getScrollTextY() |
java.lang.String |
getText() Gets the text. |
protected float |
getTotalLinesHeight() Gets the total lines height. |
boolean |
isEnableCaret() Checks if is enable caret. |
boolean |
isSelected() Checks if is selected. |
void |
postDraw(processing.core.PGraphics graphics) Post draw. |
void |
preDraw(processing.core.PGraphics graphics) This method is called just before the components drawComponent method is invoked. |
void |
removeLastCharacter() Removes the last character in the textarea. |
protected void |
scrollTextX(float amount) |
protected void |
scrollTextY(float amount) |
void |
setBitmapFontTextureFiltered(boolean scalable) Changes the texture filtering for the textarea's bitmap font. |
void |
setEnableCaret(boolean enableCaret) Sets the enable caret. |
void |
setHeightLocal(float height) Sets the height local. |
void |
setInnerPadding(float innerPadding) |
void |
setSelected(boolean selected) Sets the selected. |
void |
setText(java.lang.String string) Sets the provided string as the text of this textarea. |
void |
setWidthLocal(float width) Sets the width local. |
void |
snapToKeyboard(MTKeyboard mtKeyboard) Snap to keyboard. |
void |
updateComponent(long timeDelta) Tells the component to update its state if neccessary. |
Methods inherited from class org.mt4j.components.visibleComponents.shapes.MTRectangle |
---|
computeDefaultBounds, get2DPolygonArea, getAnchor, getCenterOfMass2DLocal, getCenterPointLocal, getPosition, setAnchor, setPositionGlobal, setPositionRelativeToParent, setSizeLocal |
Methods inherited from class org.mt4j.components.visibleComponents.shapes.MTPolygon |
---|
destroyComponent, drawPureGl, getGeometryIntersectionLocal, getHeightXY, getHeightXYVectLocal, getNormal, getWidthXY, getWidthXYVectLocal, isGeometryContainsPointLocal, setGeometryInfo, setHeightXYGlobal, setHeightXYRelativeToParent, setSizeXYGlobal, setSizeXYRelativeToParent, setVertices, setWidthXYGlobal, setWidthXYRelativeToParent |
Methods inherited from class org.mt4j.components.visibleComponents.AbstractVisibleComponent |
---|
applyStyle, getFillColor, getFillDrawMode, getFillPaint, getLineStipple, getMaterial, getStrokeColor, getStrokeWeight, getStyleInfo, isDrawSmooth, isNoFill, isNoStroke, postDrawChildren, setDrawSmooth, setFillDrawMode, setFillPaint, setLineStipple, setMaterial, setNoFill, setNoStroke, setStrokeWeight, setStyleInfo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mt4j.input.inputProcessors.componentProcessors.lassoProcessor.IdragClusterable |
---|
getCenterPointGlobal |
Methods inherited from interface org.mt4j.components.interfaces.IMTComponent3D |
---|
getCustomViewportSetting, getDefaultViewportSetting, getIntersectionGlobal, getViewingCamera, hasCustomViewPort, isPickable, rotateXGlobal, rotateYGlobal, setPickable |
Methods inherited from interface org.mt4j.components.interfaces.IMTComponent |
---|
containsPointGlobal, getID, getName, getRenderer, isEnabled, isGestureAllowed, isVisible, processInputEvent, rotateZGlobal, scaleGlobal, setEnabled, setName, setVisible, translateGlobal |
Constructor Detail |
---|
public MTTextArea(float x, float y, float width, float height, IFont font, processing.core.PApplet pApplet)
x
- the xy
- the ywidth
- the widthheight
- the heightfont
- the fontpApplet
- the appletpublic MTTextArea(processing.core.PApplet pApplet, IFont font)
pApplet
- the appletfont
- the fontMethod Detail |
---|
public void updateComponent(long timeDelta)
MTComponent
drawComponent()
method is invoked. The timeDelta
parameter indicates the time passed since the last frame was drawn and can be used for animation for example.IMTController
object if existing. If overriden, the superclass implementation should always be called!
updateComponent
in interface IMTComponent
updateComponent
in class MTComponent
timeDelta
- the time deltapublic void preDraw(processing.core.PGraphics graphics)
MTComponent
preDraw
in class AbstractVisibleComponent
graphics
- the graphics contextpublic void drawComponent(processing.core.PGraphics g)
MTComponent
drawComponent
in interface IMTComponent
drawComponent
in class MTPolygon
g
- the graphics contextpublic void postDraw(processing.core.PGraphics graphics)
MTComponent
postDraw
in class AbstractVisibleComponent
protected void scrollTextX(float amount)
protected void scrollTextY(float amount)
protected float getScrollTextX()
protected float getScrollTextY()
public void setBitmapFontTextureFiltered(boolean scalable)
scalable
- the new bitmap font scalablepublic void setWidthLocal(float width)
setWidthLocal
in class MTRectangle
width
- the new width localpublic void setHeightLocal(float height)
setHeightLocal
in class MTRectangle
height
- the new height localpublic void appendText(java.lang.String string)
appendText
in interface ITextInputListener
string
- the stringpublic void setText(java.lang.String string)
setText
in interface ITextInputListener
string
- the stringpublic java.lang.String getText()
ITextInputListener
getText
in interface ITextInputListener
public void appendCharByName(java.lang.String characterName)
characterName
- the character namepublic void appendCharByUnicode(java.lang.String unicode)
ITextInputListener
appendCharByUnicode
in interface ITextInputListener
unicode
- the unicodepublic IFontCharacter[] getCharacters()
protected void characterAdded(IFontCharacter character)
protected void characterRemoved(IFontCharacter character)
public void removeLastCharacter()
removeLastCharacter
in interface ITextInputListener
public void clear()
clear
in interface ITextInputListener
protected float getLastLineWidth()
protected float getMaxLineWidth()
protected float getTotalLinesHeight()
public float getInnerPadding()
public void setInnerPadding(float innerPadding)
public int getLineCount()
public IFont getFont()
public void snapToKeyboard(MTKeyboard mtKeyboard)
mtKeyboard
- the mt keyboardpublic boolean isSelected()
IdragClusterable
isSelected
in interface IdragClusterable
public void setSelected(boolean selected)
IdragClusterable
setSelected
in interface IdragClusterable
selected
- the new selectedpublic boolean isEnableCaret()
public void setEnableCaret(boolean enableCaret)
enableCaret
- the new enable caret
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |