Class Index

Classes


Namespace motigon.figure.Text

Defines a text holder.

Text

Method Summary
void
Assign default style to the text element.
void
Assign properties from an another text object.
void
Clear the text selection.
int
Gets the caret horizontal position.
int
Gets the caret vertical position.
Point
Gets the end selection position.
Figure
Gets the figure this text belong to.
String
Gets the font color.
String
Gets the font family.
int
Gets the font size.
boolean
getFontStyle(fontStyle)
Gets whether a font style has been enabled.
String
Gets the horizontal text alignment.
double
Gets the text positioning offset. A value of 0 places the text at the start of the line, while a value of 1 places the text at the end of the line.
double
Gets the offset horizontal position.
double
Gets the offset vertical position.
double
Gets the padding between the text and the figure border.
String
Gets the selected text.
Point
Gets the start selection position.
String[]
Gets the text lines.
String
Gets the text joined into one string. Please note that the text is saved using text lines internally, and that this method call will result in a text merge operation.
String
Gets the vertical text alignment.
double
getX()
Gets the horizontal position.
double
getY()
Gets the vertical position.
boolean
Checks if a font color has been set.
boolean
Checks id this text element has a selection.
void
Initialize the text object.
void
insertText(insert)
Insert text at current caret position.
boolean
Checks if this text element should show its background.
boolean
Checks if the caret is visible.
boolean
Checks if the element has been modified.
boolean
Checks if the element needs to be redrawn.
boolean
Checks if the user is editing text offset position.
boolean
Checks if the user is currently editing text.
boolean
Gets whether or not this model has a text defined.
boolean
isHit(x, y)
Checks if the given position is within the bounds of this text element.
boolean
Checks if the text will be rotated with the figure.
void
Position the caret within the text element.
void
Removes the selected text.
void
removeText(start, count)
Removes the text at the given position.
void
Reset the dirty state of this element. The next call to {@link #isDirty()} will be false, unless a change has been made to the element.
void
setBackground(background)
Sets whether the text background should be shown.
void
Sets the caret position in both dimensions.
void
Sets the caret horizontal position. Please note that you should set the vertical position first if you need to update both positions.
void
Sets the caret vertical position.
void
setEditingOffset(editingOffset)
Sets whether the user is currently editing the text offset position.
void
setEditingText(editing)
Sets the editing text state.
void
setFontColor(color)
Sets the font color.
void
setFontFamily(family)
Sets the font family.
void
setFontSize(size)
Sets the font size.
void
setFontStyle(fontStyle, value)
Sets the state of a font style.
void
Sets the horizontal text alignment.
void
Sets the initial selection position. Uses the current caret position.
void
Sets the initial selection position.
void
Sets the new selection position. Uses the current caret position.
void
Sets the new selection position.
void
setOffsetPosition(offsetPosition)
Sets the text positioning offset. A value of 0 places the text at the start of the line, while a value of 1 places the text at the end of the line.
void
setOffsetX(offsetX)
Sets the offset horizontal position.
void
setOffsetY(offsetY)
Sets the offset vertical position.
void
setPadding(padding)
Sets the padding between the text and the figure border.
void
setText(text)
Sets the text content from a single string. The text will be split by line shift characters, and saved as separetes lines inernally.
void
setTextRotate(textRotate)
Sets whether the text should rotate with the figure.
void
Sets the vertical text alignment.
void
setX(x)
Sets the horizontal position.
void
setY(y)
Sets the vertical position.
void
update(delta)
Updates an element.
Method Detail
assignDefaultStyle()
Assign default style to the text element.
Returns:
{void}

assignProperties(text)
Assign properties from an another text object.
Parameters:
{Text} text
the other text object
Returns:
{void}

clearSelection()
Clear the text selection.
Returns:
{void}

getCaretPositionX()
Gets the caret horizontal position.
Returns:
{int}

getCaretPositionY()
Gets the caret vertical position.
Returns:
{int}

getEndSelectPosition()
Gets the end selection position.
Returns:
{Point}

getFigure()
Gets the figure this text belong to.
Returns:
{Figure}

getFontColor()
Gets the font color.
Returns:
{String}

getFontFamily()
Gets the font family.
Returns:
{String}

getFontSize()
Gets the font size.
Returns:
{int}

getFontStyle(fontStyle)
Gets whether a font style has been enabled.
Parameters:
{String} fontStyle
the font style
Returns:
{boolean}

getHorizontalAlignment()
Gets the horizontal text alignment.
Returns:
{String}

getOffsetPosition()
Gets the text positioning offset. A value of 0 places the text at the start of the line, while a value of 1 places the text at the end of the line.
Returns:
{double}

getOffsetX()
Gets the offset horizontal position.
Returns:
{double}

getOffsetY()
Gets the offset vertical position.
Returns:
{double}

getPadding()
Gets the padding between the text and the figure border.
Returns:
{double}

getSelectedText()
Gets the selected text.
Returns:
{String}

getStartSelectPosition()
Gets the start selection position.
Returns:
{Point}

getText()
Gets the text lines.
Returns:
{String[]}

getTextJoined()
Gets the text joined into one string. Please note that the text is saved using text lines internally, and that this method call will result in a text merge operation.
Returns:
{String}

getVerticalAlignment()
Gets the vertical text alignment.
Returns:
{String}

getX()
Gets the horizontal position.
Returns:
{double}

getY()
Gets the vertical position.
Returns:
{double}

hasFontColor()
Checks if a font color has been set.
Returns:
{boolean}

hasSelection()
Checks id this text element has a selection.
Returns:
{boolean}

initialize()
Initialize the text object.
Returns:
{void}

insertText(insert)
Insert text at current caret position.
Parameters:
{String} insert
Returns:
{void}

isBackground()
Checks if this text element should show its background.
Returns:
{boolean}

isCaretVisible()
Checks if the caret is visible.
Returns:
{boolean}

isDirty()
Checks if the element has been modified.
Returns:
{boolean}

isDrawDirty()
Checks if the element needs to be redrawn.
Returns:
{boolean}

isEditingOffset()
Checks if the user is editing text offset position.
Returns:
{boolean}

isEditingText()
Checks if the user is currently editing text.
Returns:
{boolean}

isEmpty()
Gets whether or not this model has a text defined.
Returns:
{boolean}

isHit(x, y)
Checks if the given position is within the bounds of this text element.
Parameters:
{double} x
the horizontal position
{double} y
the vertical position
Returns:
{boolean}

isTextRotate()
Checks if the text will be rotated with the figure.
Returns:
{boolean}

positionCursor(x, y)
Position the caret within the text element.
Parameters:
{double} x
the horizontal position
{double} y
the vertical position
Returns:
{void}

removeSelectedText()
Removes the selected text.
Returns:
{void}

removeText(start, count)
Removes the text at the given position.
Parameters:
{int} start
the start position
{int} count
the number of characters to remove
Returns:
{void}

resetDirty()
Reset the dirty state of this element. The next call to {@link #isDirty()} will be false, unless a change has been made to the element.
Returns:
{void}

setBackground(background)
Sets whether the text background should be shown.
Parameters:
{boolean} background
the new show background state
Returns:
{void}

setCaretPosition(x, y)
Sets the caret position in both dimensions.
Parameters:
{int} x
the horizontal position
{int} y
the vertical position
Returns:
{void}
See:
motigon.figure.Text #setCaretPositionX
motigon.figure.Text #setCaretPositionY

setCaretPositionX(x)
Sets the caret horizontal position. Please note that you should set the vertical position first if you need to update both positions.
Parameters:
{int} x
the horizontal position
Returns:
{void}
See:
motigon.figure.Text #setCaretPositionY
motigon.figure.Text #setCaretPosition

setCaretPositionY(y)
Sets the caret vertical position.
Parameters:
{int} y
the vertical position
Returns:
{void}

setEditingOffset(editingOffset)
Sets whether the user is currently editing the text offset position.
Parameters:
{boolean} editingOffset
the new editing offset state
Returns:
{void}

setEditingText(editing)
Sets the editing text state.
Parameters:
{boolean} editing
the new editing text state
Returns:
{void}

setFontColor(color)
Sets the font color.
Parameters:
{String} color
the new font color
Returns:
{void}

setFontFamily(family)
Sets the font family.
Parameters:
{String} family
the new font family
Returns:
{void}

setFontSize(size)
Sets the font size.
Parameters:
{int} size
the new font size
Returns:
{void}

setFontStyle(fontStyle, value)
Sets the state of a font style.
Parameters:
{String} fontStyle
the font style
{boolean} value
the style state
Returns:
{void}

setHorizontalAlignment(alignment)
Sets the horizontal text alignment.
Parameters:
{String} alignment
the new horizontal text alignment
Returns:
{void}

setInitialSelectPosition()
Sets the initial selection position. Uses the current caret position.
Returns:
{void}

setInitialSelectPosition(x, y)
Sets the initial selection position.
Parameters:
{int} x
the horizontal position
{int} y
the vertical position
Returns:
{void}

setNewSelectPosition()
Sets the new selection position. Uses the current caret position.
Returns:
{void}

setNewSelectPosition(x, y)
Sets the new selection position.
Parameters:
{int} x
the horizontal position
{int} y
the vertical position
Returns:
{void}

setOffsetPosition(offsetPosition)
Sets the text positioning offset. A value of 0 places the text at the start of the line, while a value of 1 places the text at the end of the line.
Parameters:
{double} offsetPosition
the offset position
Returns:
{void}

setOffsetX(offsetX)
Sets the offset horizontal position.
Parameters:
{double} offsetX
the new offset horizontal position
Returns:
{void}

setOffsetY(offsetY)
Sets the offset vertical position.
Parameters:
{double} offsetY
the new offset vertical position
Returns:
{void}

setPadding(padding)
Sets the padding between the text and the figure border.
Parameters:
{double} padding
the new padding
Returns:
{void}

setText(text)
Sets the text content from a single string. The text will be split by line shift characters, and saved as separetes lines inernally.
Parameters:
{String} text
the new text
Returns:
{void}

setTextRotate(textRotate)
Sets whether the text should rotate with the figure.
Parameters:
{boolean} textRotate
the new text rotate state
Returns:
{void}

setVerticalAlignment(alignment)
Sets the vertical text alignment.
Parameters:
{String} alignment
the new vertical text alignment
Returns:
{void}

setX(x)
Sets the horizontal position.
Parameters:
{double} x
the new horizontal position
Returns:
{void}

setY(y)
Sets the vertical position.
Parameters:
{double} y
the new vertical position
Returns:
{void}

update(delta)
Updates an element.
Parameters:
{double} delta
the delta in seconds since last update
Returns:
{void}