Package chemaxon.struc.graphics
Class MTextBox
- java.lang.Object
-
- chemaxon.struc.MObject
-
- chemaxon.struc.graphics.MPolyline
-
- chemaxon.struc.graphics.MRectangle
-
- chemaxon.struc.graphics.MTextBox
-
- All Implemented Interfaces:
Serializable
,Cloneable
@PublicAPI public class MTextBox extends MRectangle
Text box object.- Since:
- Marvin 3.3, 10/20/2003
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGN_BOTTOM
Align text to bottom of box.static int
ALIGN_CENTER
Align text to center of box.static int
ALIGN_LEFT
Align text to left edge of box.static int
ALIGN_RIGHT
Align text to right edge of box.static int
ALIGN_TOP
Align text to top of box.static int
FONT_DEFAULT_SCALE
-
Fields inherited from class chemaxon.struc.graphics.MRectangle
P_CENTER, P_E, P_N, P_NE, P_NW, P_S, P_SE, P_SW, P_W, T_NOROT
-
Fields inherited from class chemaxon.struc.graphics.MPolyline
ARROW_BACK_FLAG, ARROW_CROSSED_FLAG, ARROW_CURVED_FLAG, ARROW_DASHED_FLAG, ARROW_EQUILIBRIUM_FLAG, ARROW_GROUP1_MASK, ARROW_GROUP2_MASK, ARROW_HALF_LEFT, ARROW_HALF_MASK, ARROW_HALF_RIGHT, ARROW_RETROSYNTHETIC_FLAG, arrowFlags, CLOSED_FLAG, DEFAULT_ARROW_HEAD_LENGTH, DEFAULT_ARROW_HEAD_WIDTH, DEFAULT_EQUILIBRIUM_HEAD_WIDTH, DEFAULT_MAX_CROSS_SIZE, DEFAULT_RETROSYNTHETIC_HEAD_WIDTH, DEFAULT_THICKNESS, HEAD, points, TAIL, THICKNESS_SET_FLAG
-
Fields inherited from class chemaxon.struc.MObject
TRANSFORM_DISTORT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addAttributeKeys(List<String> l)
Adds the attribute names to the specified list.void
addCdataAttributeKeys(List<String> l)
Adds attribute names to the specified list.void
addChar(char c)
Adds a character to the text.void
addLine(MTextDocument.Portion s)
void
addString(String s)
Adds a string to the text.void
clearLines()
Clears all lines.MTextBox
clone()
Creates a clone.void
cursorDown(boolean select)
Move the cursor down.void
cursorLeft(boolean select)
void
cursorRight(boolean select)
void
cursorToRowEnd(boolean select)
void
cursorToRowStart(boolean select)
void
cursorUp(boolean select)
Moves the cursor up.void
deleteChar()
Removes the character under the cursor.void
deleteCharBackward()
Removes the character before the cursor (backspace).int
determinePosition(DPoint3 p, boolean allowExternalPoints)
Deprecated.usedeterminePosition(Graphics, DPoint3, boolean)
in case you have a special graphics context to be used for font calculations.int
determinePosition(Graphics g, DPoint3 p, boolean allowExternalPoints)
Determines the character index based on the passed view coordinate.ActionMap
getActionMap()
Returns the ActionMap used to determine what Action to fire for particular KeyStroke binding.String
getAttribute(String s)
Gets the value of an attribute.MFont
getBaseFont()
Gets the base font.String
getBaseFontFamily()
Gets the base font family.int
getBaseFontStyle()
Gets the base font style.String
getBreakingChars()
Gets the breaking characters after that the text in the text box can be broken if it doesn't fit into the text box.FontMetrics
getCurrentDefaultFontMetrics()
Gets the current default FontMetrics.Color
getCurrentForeground()
Gets the current color.double
getCurrentHeight()
Gets the current height of the text.int
getCurrentScriptCount(int subl)
Gets the number of subscripts or superscripts on the last normal character.int
getCurrentSubLevel()
Gets the current subscript/superscript level.MTextAttributes
getCurrentTextAttributes(int set0)
Gets the common attributes of the selected text or attributes for the next character to be typed.double
getCurrentWidth()
Gets the current width of the text.int
getCursorColumn()
Gets the cursor's column number.int
getCursorPos()
Gets the cursor position.int
getCursorRow()
Gets the cursor's row number.double
getFontScale()
Gets the font scaling factor.int
getHorizontalAlignment()
Gets the horizontal alignment.MTextDocument.Portion
getLine(int i)
Gets a line.int
getLineCount()
Gets the number of lines.double
getMinimumHeight()
Gets the minimum height of the text.String
getPreBreakingChars()
Gets the breaking characters before that the text in the text box can be broken if it doesn't fit into the text box.int
getPreviousNormalTextSectionIndex()
Gets the index of the last `normal' text section before the current subscript/superscript section.MTextDocument
getSelectedDocument()
String
getSelectedString()
Gets the selected substring.int
getSelectionEndColumn()
Gets the selection's end column number.int
getSelectionEndPos()
Gets the selection's end position.int
getSelectionEndRow()
Gets the selection's end row number.int
getSelectionStartColumn()
Gets the selection's start column number.int
getSelectionStartPos()
Gets the selection's start position.int
getSelectionStartRow()
Gets the selection's start row number.String
getText()
Gets the text stored.MTextAttributes
getTextAttributesAtCursor()
Gets the common attributes of the text on the cursor.MTextDocument
getTextDocument()
Gets the text document.int
getVerticalAlignment()
Gets the vertical alignment.boolean
hasBackground()
A text box has a background always.boolean
hasColor()
A text box has a text color.boolean
hasFace()
Is it 2 dimensional?boolean
hasRichText()
Tests whether the document is rich text.boolean
hasSelection()
Checks the existence of the selection.void
insertDocument(MTextDocument document)
Inserts document at the current cursor position.boolean
isAutoHeight()
Gets if it is autoHeight.boolean
isAutoSize()
boolean
isCurrentFontDefault()
Tests whether the default font is used.boolean
isCurrentFontRegular()
Tests whether the current font is regular.boolean
isEditable()
Determines if this text box's content can be edited by the user.boolean
isEmpty()
A text box is empty if the string contains only whitespace.boolean
isMinimumHeightSet()
Gets if it is minimumHeightSet.void
setActionMap(ActionMap map)
Sets the ActionMap to map.void
setAttribute(String s, String v)
Sets the value of an attribute.void
setAutoHeight(boolean v)
Turns on/off automatic height calculation.void
setAutoSize(boolean v)
Turns on/off automatic size calculation.void
setBaseFontFamily(String name)
Sets the base font family.void
setBaseFontStyle(int style)
Sets the base font style.void
setCurrentDefaultFontMetrics(FontMetrics fm)
Sets the current height of the text..void
setCurrentFont(MFont ft, int setflags)
Sets font for selected text or the next character to be typed.void
setCurrentForeground(Color c)
Sets color for selected text or the next character to be typed.void
setCurrentHeight(double h)
Sets the current height of the text..void
setCurrentTextAttributes(MTextAttributes attr)
Sets the attributes for the selected text or the next character to be typed.void
setCurrentWidth(double w)
Sets the current height of the text..void
setCursorPos(int i, boolean select)
Sets the cursor position.void
setCursorRow(int i)
Sets the cursor row number.void
setDocument(MTextDocument d)
void
setFontScale(double scale)
Sets the font scaling factor.void
setHorizontalAlignment(int align)
Sets the horizontal alignment.void
setMinimumHeight(double h)
Sets the minimum height of the text..void
setMinimumHeightSet(boolean v)
Turns on/off minimum height calculation.void
setPoints(MPoint[] p)
Sets the points.void
setRowAndColumn0(int i)
void
setSelected(boolean v)
Selects or unselects the text box.void
setText(String s)
Sets the text.void
setVerticalAlignment(int align)
Sets the vertical alignment.void
transform(CTransform3D t, int opts, CTransform3D trot)
Transforms all points and scales the font size.void
unselectContents()
Unselects text.void
wrapTextAndSetActualPoints(CTransform3D transform, double scale)
-
Methods inherited from class chemaxon.struc.graphics.MRectangle
calcCenter, convertTransform, distanceFrom, fixClonedPoints, fixRectanglePointClones, getClip, getPointRef, getPointRefCount, getTCenter, getTOption, removeChild, setCorners, setTCenter, setTOption, transformTo2D
-
Methods inherited from class chemaxon.struc.graphics.MPolyline
checkValidity, containsAtom, copyProperties, finishCloning, fixMidPointClones, getArcAngle, getArcCenter, getArcRadius, getArcRadius, getArrowFlags, getArrowLength, getArrowWidth, getFlags, getLineMiddlePoint, getMidPointLocation, getMirroredArrowFlags, getPoint, getPointCount, getPoints, getSkip, getThickness, hasLineColor, hasOutline, isArrow, isThicknessSet, removeNotify, replaceAtom, reverse, rotate, setArcAngle, setArrow, setArrowFlags, setArrowLength, setArrowWidth, setFlags, setSkip, setThickness, updateBoundingRect
-
Methods inherited from class chemaxon.struc.MObject
addNotify, connectToSgroupOfAtom, containsPoint, distanceFrom, getBackground, getColor, getContainerMObject, getLineColor, isChildOf, isInternalSelectable, isReactionArrow, isSelectableNow, isSelected, isTransformable, makeColor, removeAtom, setBackground, setColor, setLineColor, toString, updateBoundingRect
-
-
-
-
Field Detail
-
FONT_DEFAULT_SCALE
public static final int FONT_DEFAULT_SCALE
- See Also:
- Constant Field Values
-
ALIGN_LEFT
public static final int ALIGN_LEFT
Align text to left edge of box.- Since:
- Marvin 5.0, 02/13/2007
- See Also:
- Constant Field Values
-
ALIGN_CENTER
public static final int ALIGN_CENTER
Align text to center of box.- Since:
- Marvin 5.0, 02/13/2007
- See Also:
- Constant Field Values
-
ALIGN_RIGHT
public static final int ALIGN_RIGHT
Align text to right edge of box.- Since:
- Marvin 5.0, 02/13/2007
- See Also:
- Constant Field Values
-
ALIGN_TOP
public static final int ALIGN_TOP
Align text to top of box.- Since:
- Marvin 5.0, 02/13/2007
- See Also:
- Constant Field Values
-
ALIGN_BOTTOM
public static final int ALIGN_BOTTOM
Align text to bottom of box.- Since:
- Marvin 5.0, 02/13/2007
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MTextBox
public MTextBox()
Contructs an empty text box.
-
MTextBox
protected MTextBox(MTextBox t)
Copy constructor.- Parameters:
t
- the original text box
-
-
Method Detail
-
clone
public MTextBox clone()
Description copied from class:MObject
Creates a clone.- Overrides:
clone
in classMRectangle
- Returns:
- the clone
-
getActionMap
public ActionMap getActionMap()
Returns the ActionMap used to determine what Action to fire for particular KeyStroke binding. The returned ActionMap, unless otherwise set, will be null.- Returns:
- the ActionMap containing the key/action bindings
- Since:
- Marvin 5.0.2
-
setActionMap
public void setActionMap(ActionMap map)
Sets the ActionMap to map. This does not set the parent of the map, it is up to the caller to have done this.- Parameters:
map
- the new ActionMap- Since:
- Marvin 5.0.2
-
getTextDocument
public MTextDocument getTextDocument()
Gets the text document.- Returns:
- the text
- Since:
- Marvin 4.1, 09/30/2005
-
getText
public String getText()
Gets the text stored.- Returns:
- the text
-
setText
public void setText(String s)
Sets the text.- Parameters:
s
- the text- Since:
- Marvin 3.5, 07/14/2004
-
setDocument
public void setDocument(MTextDocument d)
-
isEditable
public boolean isEditable()
Determines if this text box's content can be edited by the user.- Returns:
- true if the content can be edited, false otherwise
- Since:
- Marvin 5.3
-
getBaseFont
public final MFont getBaseFont()
Gets the base font.- Returns:
- the base font
- Since:
- Marvin 4.1, 11/11/2005
-
getBaseFontFamily
public final String getBaseFontFamily()
Gets the base font family.- Returns:
- the font family name
- Since:
- Marvin 4.1, 11/11/2005
-
setBaseFontFamily
public final void setBaseFontFamily(String name)
Sets the base font family.- Parameters:
name
- the font family name- Since:
- Marvin 4.1, 11/11/2005
-
getBaseFontStyle
public final int getBaseFontStyle()
Gets the base font style.- Returns:
- the font style
- Since:
- Marvin 4.1, 11/11/2005
-
setBaseFontStyle
public final void setBaseFontStyle(int style)
Sets the base font style.- Parameters:
style
- the font style- Since:
- Marvin 4.1, 11/11/2005
-
getFontScale
public final double getFontScale()
Gets the font scaling factor.- Returns:
- the font scale
- Since:
- Marvin 4.1, 11/11/2005
-
setFontScale
public final void setFontScale(double scale)
Sets the font scaling factor.- Parameters:
scale
- the font scale- Since:
- Marvin 4.1, 11/11/2005
-
getHorizontalAlignment
public final int getHorizontalAlignment()
Gets the horizontal alignment. (The "halign" property.)- Returns:
- the horizontal alignment
- Since:
- Marvin 5.0, 02/13/2007
- See Also:
ALIGN_LEFT
,ALIGN_RIGHT
,ALIGN_CENTER
-
setHorizontalAlignment
public final void setHorizontalAlignment(int align)
Sets the horizontal alignment. (The "halign" property.)- Parameters:
align
- the horizontal alignment- Since:
- Marvin 5.0, 02/13/2007
- See Also:
ALIGN_LEFT
,ALIGN_RIGHT
,ALIGN_CENTER
-
getVerticalAlignment
public final int getVerticalAlignment()
Gets the vertical alignment. (The "valign" property.)- Returns:
- the vertical alignment
- Since:
- Marvin 5.0, 02/13/2007
- See Also:
ALIGN_TOP
,ALIGN_BOTTOM
,ALIGN_CENTER
-
setVerticalAlignment
public final void setVerticalAlignment(int align)
Sets the vertical alignment. (The "valign" property.)- Parameters:
align
- the vertical alignment- Since:
- Marvin 5.0, 02/13/2007
- See Also:
ALIGN_TOP
,ALIGN_BOTTOM
,ALIGN_CENTER
-
getLineCount
public int getLineCount()
Gets the number of lines. This method can only be called after the text is wrapped.- Returns:
- wrapped number of lines
-
getLine
public MTextDocument.Portion getLine(int i)
Gets a line. This method can only be called after the text is wrapped.- Parameters:
i
- line index- Returns:
- selected line
-
clearLines
public void clearLines()
Clears all lines.
-
setAutoSize
public void setAutoSize(boolean v)
Turns on/off automatic size calculation.- Parameters:
v
- turn on (true) or off (false)
-
isAutoSize
public boolean isAutoSize()
-
isEmpty
public boolean isEmpty()
A text box is empty if the string contains only whitespace.
-
hasRichText
public boolean hasRichText()
Tests whether the document is rich text.- Returns:
- true if the text is rich, false otherwise
- Since:
- Marvin 4.1, 11/11/2005
-
addAttributeKeys
public void addAttributeKeys(List<String> l)
Adds the attribute names to the specified list. CDATA attributes are not added.- Overrides:
addAttributeKeys
in classMRectangle
- Parameters:
l
- the list
-
addCdataAttributeKeys
public void addCdataAttributeKeys(List<String> l)
Adds attribute names to the specified list. Only CDATA attributes are added.- Overrides:
addCdataAttributeKeys
in classMObject
- Parameters:
l
- the list
-
getAttribute
public String getAttribute(String s)
Gets the value of an attribute.
Supported attributes:- cursorPosition: the position of the cursor in the text box
- text: the content of the text box
- Overrides:
getAttribute
in classMRectangle
- Parameters:
s
- the attribute name- Returns:
- the value or null
-
setAttribute
public void setAttribute(String s, String v)
Sets the value of an attribute.
Supported attributes:- cursorPosition: the position of the cursor in the text box
- text: the content of the text box
- Overrides:
setAttribute
in classMRectangle
- Parameters:
s
- the attribute namev
- the attribute value
-
hasSelection
public boolean hasSelection()
Checks the existence of the selection.- Returns:
- true if selection exists, false otherwise
-
getSelectedString
public String getSelectedString()
Gets the selected substring.- Returns:
- the selection if it exists, null otherwise
-
getSelectedDocument
public MTextDocument getSelectedDocument()
-
deleteCharBackward
public void deleteCharBackward()
Removes the character before the cursor (backspace).
-
deleteChar
public void deleteChar()
Removes the character under the cursor.
-
addChar
public void addChar(char c)
Adds a character to the text.- Parameters:
c
- the character
-
addString
public void addString(String s)
Adds a string to the text.- Parameters:
s
- the string
-
insertDocument
public void insertDocument(MTextDocument document)
Inserts document at the current cursor position. Style of the source is preserved.
-
getCursorPos
public int getCursorPos()
Gets the cursor position.- Returns:
- the position
-
setCursorPos
public void setCursorPos(int i, boolean select)
Sets the cursor position.- Parameters:
i
- the new positionselect
- select text while moving the cursor
-
getPreviousNormalTextSectionIndex
public final int getPreviousNormalTextSectionIndex()
Gets the index of the last `normal' text section before the current subscript/superscript section. `Normal' means that the absolute value of the subscript/superscript level must be smaller than in the current cursor position.- Returns:
- the section index or -1
- Since:
- Marvin 4.1, 10/08/2005
-
getCurrentSubLevel
public final int getCurrentSubLevel()
Gets the current subscript/superscript level.- Returns:
- the attributes
- Since:
- Marvin 4.1, 10/08/2005
-
getCurrentScriptCount
public final int getCurrentScriptCount(int subl)
Gets the number of subscripts or superscripts on the last normal character.- Parameters:
subl
- the script level to query, +1 (superscript) or -1 (subscript)- Returns:
- the number of subscripts or superscripts
- Since:
- Marvin 4.1, 02/25/2006
-
getCurrentTextAttributes
public final MTextAttributes getCurrentTextAttributes(int set0)
Gets the common attributes of the selected text or attributes for the next character to be typed.- Parameters:
set0
- the set of attributes that are supposed to be set even if their values are "default"- Returns:
- the attributes
- Since:
- Marvin 4.1, 10/06/2005
- See Also:
MTextAttributes.A_SUBLEVEL
,MTextAttributes.A_FOREGROUND
,MTextAttributes.A_FONT
,MTextAttributes.A_FONTFAMILY
,MTextAttributes.A_FONTSIZE
,MTextAttributes.A_BOLD
,MTextAttributes.A_ITALIC
,MTextAttributes.A_SCALE
,MTextAttributes.A_DX
,MTextAttributes.A_DY
-
getTextAttributesAtCursor
public final MTextAttributes getTextAttributesAtCursor()
Gets the common attributes of the text on the cursor.- Returns:
- the attributes
-
setCurrentTextAttributes
public void setCurrentTextAttributes(MTextAttributes attr)
Sets the attributes for the selected text or the next character to be typed.- Parameters:
attr
- the text attributes- Since:
- Marvin 4.1, 10/06/2005
- See Also:
MTextAttributes.A_SUBLEVEL
,MTextAttributes.A_FOREGROUND
,MTextAttributes.A_FONT
,MTextAttributes.A_FONTFAMILY
,MTextAttributes.A_FONTSIZE
,MTextAttributes.A_BOLD
,MTextAttributes.A_ITALIC
,MTextAttributes.A_SCALE
,MTextAttributes.A_DX
,MTextAttributes.A_DX
,MTextAttributes.A_DY
-
isCurrentFontDefault
public final boolean isCurrentFontDefault()
Tests whether the default font is used.- Returns:
- true if only the default font is used, false otherwise
- Since:
- Marvin 4.1, 01/11/2006
-
isCurrentFontRegular
public final boolean isCurrentFontRegular()
Tests whether the current font is regular.- Returns:
- true if the font is regular, false otherwise
- Since:
- Marvin 4.1, 01/11/2006
-
getCurrentForeground
public final Color getCurrentForeground()
Gets the current color.- Returns:
- the color
- Since:
- Marvin 4.1, 01/18/2006
-
setCurrentForeground
public final void setCurrentForeground(Color c)
Sets color for selected text or the next character to be typed.- Parameters:
c
- the color- Since:
- Marvin 4.1, 10/08/2005
-
setCurrentFont
public final void setCurrentFont(MFont ft, int setflags)
Sets font for selected text or the next character to be typed.- Parameters:
ft
- the font or nullsetflags
- font attributes to set- Since:
- Marvin 4.1, 10/08/2005
- See Also:
MTextAttributes.A_FONT
,MTextAttributes.A_FONTFAMILY
,MTextAttributes.A_FONTSIZE
,MTextAttributes.A_BOLD
,MTextAttributes.A_ITALIC
-
cursorUp
public void cursorUp(boolean select)
Moves the cursor up.- Parameters:
select
- select text while moving the cursor
-
cursorDown
public void cursorDown(boolean select)
Move the cursor down.- Parameters:
select
- select text while moving the cursor
-
cursorRight
public void cursorRight(boolean select)
-
cursorLeft
public void cursorLeft(boolean select)
-
cursorToRowStart
public void cursorToRowStart(boolean select)
-
cursorToRowEnd
public void cursorToRowEnd(boolean select)
-
getSelectionStartPos
public int getSelectionStartPos()
Gets the selection's start position.- Returns:
- the start index
-
getSelectionEndPos
public int getSelectionEndPos()
Gets the selection's end position.- Returns:
- the end index
-
getSelectionStartRow
public int getSelectionStartRow()
Gets the selection's start row number.- Returns:
- the start index
-
getSelectionEndRow
public int getSelectionEndRow()
Gets the selection's end row number.- Returns:
- the end index
-
getSelectionStartColumn
public int getSelectionStartColumn()
Gets the selection's start column number.- Returns:
- the start index
-
getSelectionEndColumn
public int getSelectionEndColumn()
Gets the selection's end column number.- Returns:
- the end index
-
setCursorRow
public void setCursorRow(int i)
Sets the cursor row number.- Parameters:
i
- the row number
-
getCursorRow
public int getCursorRow()
Gets the cursor's row number.- Returns:
- the row number
-
getCursorColumn
public int getCursorColumn()
Gets the cursor's column number.- Returns:
- the start index
-
setCurrentWidth
public void setCurrentWidth(double w)
Sets the current height of the text..- Parameters:
w
- the width
-
getCurrentWidth
public double getCurrentWidth()
Gets the current width of the text.- Returns:
- the width
-
setCurrentHeight
public void setCurrentHeight(double h)
Sets the current height of the text..- Parameters:
h
- the height
-
getCurrentHeight
public double getCurrentHeight()
Gets the current height of the text.- Returns:
- the height
-
setAutoHeight
public void setAutoHeight(boolean v)
Turns on/off automatic height calculation.- Parameters:
v
- turn on (true) or off (false)
-
isAutoHeight
public boolean isAutoHeight()
Gets if it is autoHeight.- Returns:
- true if aoutoHeight
-
setMinimumHeight
public void setMinimumHeight(double h)
Sets the minimum height of the text..- Parameters:
h
- the height
-
getMinimumHeight
public double getMinimumHeight()
Gets the minimum height of the text.- Returns:
- the height
-
setMinimumHeightSet
public void setMinimumHeightSet(boolean v)
Turns on/off minimum height calculation.- Parameters:
v
- turn on (true) or off (false)
-
isMinimumHeightSet
public boolean isMinimumHeightSet()
Gets if it is minimumHeightSet.- Returns:
- true if minimumHeightSet
-
setCurrentDefaultFontMetrics
public void setCurrentDefaultFontMetrics(FontMetrics fm)
Sets the current height of the text..- Parameters:
fm
- the fontMetrics
-
getCurrentDefaultFontMetrics
public FontMetrics getCurrentDefaultFontMetrics()
Gets the current default FontMetrics.- Returns:
- the fontMetrics
-
setPoints
public void setPoints(MPoint[] p)
Sets the points.
-
hasColor
public boolean hasColor()
A text box has a text color.
-
hasBackground
public boolean hasBackground()
A text box has a background always.- Overrides:
hasBackground
in classMPolyline
- Returns:
- true if closed
-
hasFace
public boolean hasFace()
Is it 2 dimensional?
-
transform
public void transform(CTransform3D t, int opts, CTransform3D trot)
Transforms all points and scales the font size.- Overrides:
transform
in classMRectangle
- Parameters:
t
- the transformation matrixopts
- transform options or 0trot
- the viewing transformation or null- Since:
- Marvin 4.1, 04/28/2006
- See Also:
MObject.TRANSFORM_DISTORT
-
wrapTextAndSetActualPoints
public void wrapTextAndSetActualPoints(CTransform3D transform, double scale)
-
setSelected
public void setSelected(boolean v)
Selects or unselects the text box.- Overrides:
setSelected
in classMObject
- Parameters:
v
- true to select, false to unselect
-
unselectContents
public void unselectContents()
Unselects text.- Overrides:
unselectContents
in classMPolyline
-
setRowAndColumn0
public void setRowAndColumn0(int i)
-
addLine
public void addLine(MTextDocument.Portion s)
-
determinePosition
@Deprecated public int determinePosition(DPoint3 p, boolean allowExternalPoints)
Deprecated.usedeterminePosition(Graphics, DPoint3, boolean)
in case you have a special graphics context to be used for font calculations.Determines the character index based on the passed view coordinate.- Parameters:
p
- view coordinateallowExternalPoints
- is set to true to allow external points (outside of this text box) to be checked.- Returns:
- character index
-
determinePosition
public int determinePosition(Graphics g, DPoint3 p, boolean allowExternalPoints)
Determines the character index based on the passed view coordinate. This method also takes the passed graphics context into account.- Parameters:
p
- view coordinateallowExternalPoints
- is set to true to allow external points (outside of this text box) to be checked.- Returns:
- character index
-
getPreBreakingChars
public String getPreBreakingChars()
Gets the breaking characters before that the text in the text box can be broken if it doesn't fit into the text box.- Returns:
- the string that contains the breaking characters.
-
getBreakingChars
public String getBreakingChars()
Gets the breaking characters after that the text in the text box can be broken if it doesn't fit into the text box.- Returns:
- the string that contains the breaking characters.
-
-