|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchemaxon.struc.graphics.MTextDocument.Section
public static class MTextDocument.Section
Plain text section with uniform attributes.
Constructor Summary | |
---|---|
MTextDocument.Section(int pos,
java.lang.String s)
Constructs a text section. |
|
MTextDocument.Section(int pos,
java.lang.String s,
MTextAttributes attr)
Constructs a text section. |
|
MTextDocument.Section(MTextDocument.Section sec)
Copy constructor. |
Method Summary | |
---|---|
double |
doubleStringWidth(java.lang.String s,
MFont dmf,
java.awt.FontMetrics fm,
java.awt.Graphics g)
Gets the width of a string as a floating point number. |
MTextAttributes |
getAttributes()
Gets the attributes. |
java.awt.FontMetrics |
getFontMetrics(java.awt.Graphics g,
MFont deffnt)
Gets and updates the font metrics of a document section. |
int |
getPosition()
Gets the position in the document. |
java.lang.String |
getString()
Gets the text string. |
int |
length()
Gets text length. |
java.lang.String |
substring(int start)
Gets a substring. |
java.lang.String |
substring(int start,
int end)
Gets a substring. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MTextDocument.Section(int pos, java.lang.String s)
pos
- the position in the documents
- the text stringpublic MTextDocument.Section(int pos, java.lang.String s, MTextAttributes attr)
pos
- the position in the documents
- the text stringattr
- text attributespublic MTextDocument.Section(MTextDocument.Section sec)
sec
- the section to copyMethod Detail |
---|
public int getPosition()
public java.lang.String getString()
public java.lang.String substring(int start)
start
- index of first character
public java.lang.String substring(int start, int end)
start
- index of first characterend
- index of last character + 1
public int length()
public MTextAttributes getAttributes()
public java.awt.FontMetrics getFontMetrics(java.awt.Graphics g, MFont deffnt)
g
- the graphics contextdeffnt
- the default font
public double doubleStringWidth(java.lang.String s, MFont dmf, java.awt.FontMetrics fm, java.awt.Graphics g)
s
- the stringfm
- the font metricsg
- the graphics context
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |