Package chemaxon.struc.graphics
Class MNameTextBox
java.lang.Object
chemaxon.struc.MObject
chemaxon.struc.graphics.MPolyline
chemaxon.struc.graphics.MRectangle
chemaxon.struc.graphics.MTextBox
chemaxon.struc.graphics.MNameTextBox
- All Implemented Interfaces:
Serializable
,Cloneable
Name Text box object to display IUPAC name.
- Since:
- Marvin 5.0, 03/22/2007
- See Also:
-
Field Summary
Fields inherited from class chemaxon.struc.graphics.MTextBox
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_TOP, 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
-
Constructor Summary
ModifierConstructorDescriptionConstructs an empty name text box.protected
Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the attribute names to the specified list.double
Calculates the width of the string in the name text box.clone()
Creates a clone.Gets the value of an attribute.Gets the breaking characters after that the text in the text box can be broken if it doesn't fit into the text box.long
getGrinv()
Gets an invariant the text box depends on.Gets the breaking characters before that the text in the text box can be broken if it doesn't fit into the text box.double
Gets the preferred width of the text-box.boolean
Returns if the text-box is in automatic alignment mode.boolean
Returns if the text-box is in automatic resize mode.boolean
Determines if this text box's content can be edited by the user.void
setAttribute
(String s, String v) Sets the value of an attribute.void
setAutoAlign
(boolean autoAlign) Sets the alignment behavior of the text-box.void
setAutoHeight
(boolean v) Turns on/off automatic height calculation.void
setAutoResize
(boolean autoResize) Sets the resizing behavior of the text-box.void
setCurrentWidth
(double w) Sets the current height of the text..void
setGrinv
(long grinv) Sets the invariant the text box depends on.void
Sets the points.void
setPreferredWidth
(double preferredWidth) Sets the preferred width of the text-box.void
Sets the text.void
transform
(CTransform3D t, int opts, CTransform3D trot) Transforms all points, scales the arrow head widths and lengths.Methods inherited from class chemaxon.struc.graphics.MTextBox
addCdataAttributeKeys, addChar, addLine, addString, clearLines, cursorDown, cursorLeft, cursorRight, cursorToRowEnd, cursorToRowStart, cursorUp, deleteChar, deleteCharBackward, determinePosition, determinePosition, getActionMap, getBaseFont, getBaseFontFamily, getBaseFontStyle, getCurrentDefaultFontMetrics, getCurrentForeground, getCurrentHeight, getCurrentScriptCount, getCurrentSubLevel, getCurrentTextAttributes, getCurrentWidth, getCursorColumn, getCursorPos, getCursorRow, getFontScale, getHorizontalAlignment, getLine, getLineCount, getMinimumHeight, getPreviousNormalTextSectionIndex, getSelectedDocument, getSelectedString, getSelectionEndColumn, getSelectionEndPos, getSelectionEndRow, getSelectionStartColumn, getSelectionStartPos, getSelectionStartRow, getText, getTextAttributesAtCursor, getTextDocument, getVerticalAlignment, hasBackground, hasColor, hasFace, hasRichText, hasSelection, insertDocument, isAutoHeight, isAutoSize, isCurrentFontDefault, isCurrentFontRegular, isEmpty, isMinimumHeightSet, setActionMap, setAutoSize, setBaseFontFamily, setBaseFontStyle, setCurrentDefaultFontMetrics, setCurrentFont, setCurrentForeground, setCurrentHeight, setCurrentTextAttributes, setCursorPos, setCursorRow, setDocument, setFontScale, setHorizontalAlignment, setMinimumHeight, setMinimumHeightSet, setRowAndColumn0, setSelected, setVerticalAlignment, unselectContents, wrapTextAndSetActualPoints
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
-
Constructor Details
-
MNameTextBox
Copy constructor.- Parameters:
t
- the original text box
-
MNameTextBox
public MNameTextBox()Constructs an empty name text box.
-
-
Method Details
-
clone
Description copied from class:MObject
Creates a clone. -
isEditable
public boolean isEditable()Description copied from class:MTextBox
Determines if this text box's content can be edited by the user.- Overrides:
isEditable
in classMTextBox
- Returns:
- true if the content can be edited, false otherwise
-
calcWidth
Calculates the width of the string in the name text box.- Parameters:
g
- the graphics context- Returns:
- the width of the string in the name box.
-
setCurrentWidth
public void setCurrentWidth(double w) Sets the current height of the text..- Overrides:
setCurrentWidth
in classMTextBox
- Parameters:
w
- the width
-
setAutoHeight
public void setAutoHeight(boolean v) Turns on/off automatic height calculation.- Overrides:
setAutoHeight
in classMTextBox
- Parameters:
v
- turn on (true) or off (false)- Since:
- Marvin 5.0, 03/22/2007
-
setText
Sets the text. -
getGrinv
public long getGrinv()Gets an invariant the text box depends on.- Returns:
- the invariant value
- Since:
- Marvin 5.0, 03/22/2007
-
setGrinv
public void setGrinv(long grinv) Sets the invariant the text box depends on.- Parameters:
grinv
- the invariant value- Since:
- Marvin 5.0, 03/22/2007
-
isAutoResize
public boolean isAutoResize()Returns if the text-box is in automatic resize mode.- Returns:
- true if in automatic resize mode
-
setAutoResize
public void setAutoResize(boolean autoResize) Sets the resizing behavior of the text-box.- Parameters:
autoResize
- if set true then the behavior is automatic resize.
-
isAutoAlign
public boolean isAutoAlign()Returns if the text-box is in automatic alignment mode.- Returns:
- true if in automatic alignment mode
-
setAutoAlign
public void setAutoAlign(boolean autoAlign) Sets the alignment behavior of the text-box.- Parameters:
autoAlign
- if set true then the behavior is automatic alignment.
-
getPreferredWidth
public double getPreferredWidth()Gets the preferred width of the text-box.- Returns:
- the preferred width
-
setPreferredWidth
public void setPreferredWidth(double preferredWidth) Sets the preferred width of the text-box.- Parameters:
preferredWidth
- the preferred width
-
transform
Transforms all points, scales the arrow head widths and lengths. -
setPoints
Sets the points. -
addAttributeKeys
Adds the attribute names to the specified list. CDATA attributes are not added.- Overrides:
addAttributeKeys
in classMTextBox
- Parameters:
l
- the list
-
getAttribute
Gets the value of an attribute.
Supported attributes:- autoResize: resizing mode of the text box
- autoAlign: aligning mode of the text box
- preferredWidth: preferred width of the text box
- Overrides:
getAttribute
in classMTextBox
- Parameters:
s
- the attribute name- Returns:
- the value or null
-
setAttribute
Sets the value of an attribute.
Supported attributes:- autoResize: resizing mode of the text box
- autoAlign: aligning mode of the text box
- preferredWidth: preferred width of the text box
- Overrides:
setAttribute
in classMTextBox
- Parameters:
s
- the attribute namev
- the attribute value
-
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.- Overrides:
getPreBreakingChars
in classMTextBox
- Returns:
- the string that contains the breaking characters.
-
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.- Overrides:
getBreakingChars
in classMTextBox
- Returns:
- the string that contains the breaking characters.
-