|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectchemaxon.struc.MObject
chemaxon.struc.graphics.MPolyline
chemaxon.struc.graphics.MRectangle
chemaxon.struc.graphics.MTextBox
Text box object.
| Field Summary |
| 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_HALF_LEFT, ARROW_HALF_MASK, ARROW_HALF_RIGHT, CLOSED_FLAG, DEFAULT_THICKNESS, HEAD, TAIL, THICKNESS_SET_FLAG |
| Fields inherited from class chemaxon.struc.MObject |
PAINT_ANTIALIAS, PAINT_FOCUSED, TRANSFORM_DISTORT |
| Constructor Summary | |
|
MTextBox()
Contructs an empty text box. |
protected |
MTextBox(MTextBox t)
Copy constructor. |
| Method Summary | |
void |
addAttributeKeys(java.util.Vector v)
Adds the attribute names to the specified vector. |
void |
addCdataAttributeKeys(java.util.Vector v)
Adds attribute names to the specified vector. |
void |
addChar(char c)
Adds a character to the text. |
void |
addString(java.lang.String s)
Adds a string to the text. |
java.lang.Object |
clone()
Creates a clone. |
void |
cursorDown(boolean select)
Move the cursor down. |
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)
|
java.lang.String |
getAttribute(java.lang.String s)
Gets the value of an attribute. |
MFont |
getBaseFont()
Gets the base font. |
java.lang.String |
getBaseFontFamily()
Gets the base font family. |
int |
getBaseFontStyle()
Gets the base font style. |
java.awt.Color |
getCurrentForeground()
Gets the current color. |
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. |
int |
getCursorPos()
Gets the cursor position. |
double |
getFontScale()
Gets the font scaling factor. |
int |
getPreviousNormalTextSectionIndex()
Gets the index of the last `normal' text section before the current subscript/superscript section. |
java.lang.String |
getSelectedString()
Gets the selected substring. |
int |
getSelectionEndPos()
Gets the selection's end position. |
int |
getSelectionStartPos()
Gets the selection's start position. |
java.lang.String |
getText()
Gets the text stored. |
MTextDocument |
getTextDocument()
Gets the text document. |
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. |
boolean |
isCurrentFontDefault()
Tests whether the default font is used. |
boolean |
isCurrentFontRegular()
Tests whether the current font is regular. |
boolean |
isEmpty()
A text box is empty if the string contains only whitespace. |
void |
paint(java.awt.Graphics g,
CTransform3D t0,
int f,
java.awt.Color c,
java.awt.Color selc,
java.awt.Color focusc)
Paints the object. |
void |
setAttribute(java.lang.String s,
java.lang.String v)
Sets the value of an attribute. |
void |
setAutoSize(boolean v)
Turns on/off automatic size calculation. |
void |
setBaseFontFamily(java.lang.String name)
Sets the base font family. |
void |
setBaseFontStyle(int style)
Sets the base font style. |
void |
setCurrentFont(MFont ft,
int setflags)
Sets font for selected text or the next character to be typed. |
void |
setCurrentForeground(java.awt.Color c)
Sets color for selected text or the next character to be typed. |
void |
setCurrentTextAttributes(MTextAttributes attr)
Sets the attributes for the selected text or the next character to be typed. |
void |
setCursorPos(int i,
boolean select)
Sets the cursor position. |
void |
setFontScale(double scale)
Sets the font scaling factor. |
void |
setPoints(MPoint[] p)
Sets the points. |
void |
setSelected(boolean v)
Selects or unselects the text box. |
void |
setText(java.lang.String s)
Sets the text. |
void |
transform(CTransform3D t,
int opts,
CTransform3D trot)
Transforms all points and scales the font size. |
void |
unselectContents()
Unselects text. |
| Methods inherited from class chemaxon.struc.graphics.MRectangle |
calcCenter, convertTransform, distanceFrom, fixRectanglePointClones, getClipObject, 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, getArrowFlags, getArrowLength, getArrowWidth, getFlags, getMidPointLocation, getPoint, getPointCount, getPoints, getSkip, getThickness, hasLineColor, hasOutline, isArrow, isThicknessSet, replaceAtom, setArcAngle, setArrow, setArrowFlags, setArrowLength, setArrowWidth, setFlags, setSkip, setThickness |
| Methods inherited from class chemaxon.struc.MObject |
addNotify, distanceFrom, getBackground, getColor, getLineColor, isChildOf, isInternalSelectable, isSelectableNow, isSelected, isTransformable, makeColor, removeNotify, setBackground, setColor, setLineColor, toString |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MTextBox()
protected MTextBox(MTextBox t)
t - the original text box| Method Detail |
public java.lang.Object clone()
MObject
clone in class MRectanglepublic MTextDocument getTextDocument()
public java.lang.String getText()
public void setText(java.lang.String s)
s - the textpublic final MFont getBaseFont()
public final java.lang.String getBaseFontFamily()
public final void setBaseFontFamily(java.lang.String name)
name - the font family namepublic final int getBaseFontStyle()
public final void setBaseFontStyle(int style)
style - the font stylepublic final double getFontScale()
public final void setFontScale(double scale)
scale - the font scalepublic void setAutoSize(boolean v)
v - turn on (true) or off (false)public boolean isEmpty()
isEmpty in class MPolylinepublic boolean hasRichText()
public void addAttributeKeys(java.util.Vector v)
addAttributeKeys in class MRectanglev - the vectorpublic void addCdataAttributeKeys(java.util.Vector v)
addCdataAttributeKeys in class MObjectv - the vectorpublic java.lang.String getAttribute(java.lang.String s)
getAttribute in class MRectangles - the attribute name
public void setAttribute(java.lang.String s,
java.lang.String v)
setAttribute in class MRectangles - the attribute namev - the attribute valuepublic boolean hasSelection()
public java.lang.String getSelectedString()
public void deleteCharBackward()
public void deleteChar()
public void addChar(char c)
c - the characterpublic void addString(java.lang.String s)
s - the stringpublic int getCursorPos()
public void setCursorPos(int i,
boolean select)
i - the new positionselect - select text while moving the cursorpublic final int getPreviousNormalTextSectionIndex()
public final int getCurrentSubLevel()
public final int getCurrentScriptCount(int subl)
subl - the script level to query,
+1 (superscript) or -1 (subscript)
public final MTextAttributes getCurrentTextAttributes(int set0)
set0 - the set of attributes that are supposed to be set
even if their values are "default"
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_DYpublic void setCurrentTextAttributes(MTextAttributes attr)
attr - the text attributesMTextAttributes.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_DYpublic final boolean isCurrentFontDefault()
public final boolean isCurrentFontRegular()
public final java.awt.Color getCurrentForeground()
public final void setCurrentForeground(java.awt.Color c)
c - the color
public final void setCurrentFont(MFont ft,
int setflags)
ft - the font or nullsetflags - font attributes to setMTextAttributes.A_FONT,
MTextAttributes.A_FONTFAMILY,
MTextAttributes.A_FONTSIZE,
MTextAttributes.A_BOLD,
MTextAttributes.A_ITALICpublic void cursorUp(boolean select)
select - select text while moving the cursorpublic void cursorDown(boolean select)
select - select text while moving the cursorpublic int getSelectionStartPos()
public int getSelectionEndPos()
public void setPoints(MPoint[] p)
setPoints in class MPolylinep - the pointspublic boolean hasColor()
hasColor in class MPolylinepublic boolean hasBackground()
hasBackground in class MPolylinepublic boolean hasFace()
hasFace in class MPolyline
public void transform(CTransform3D t,
int opts,
CTransform3D trot)
transform in class MRectanglet - the transformation matrixopts - transform options or 0trot - the viewing transformation or null
public void paint(java.awt.Graphics g,
CTransform3D t0,
int f,
java.awt.Color c,
java.awt.Color selc,
java.awt.Color focusc)
paint in class MRectangleg - the graphics contextt0 - the transformation matrixf - flagsc - the color to use or nullselc - the selection colorfocusc - the focus colorpublic void setSelected(boolean v)
setSelected in class MObjectv - true to select, false to unselectpublic void unselectContents()
unselectContents in class MPolyline
public int determinePosition(DPoint3 p,
boolean allowExternalPoints)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||