Modifier and Type | Field and Description |
---|---|
static int |
ALGEBRAIC
Format to use when parsing a double
|
static int |
CENTER
Center the Text over the point
|
static int |
LEFT
Position the Text to the Left of the point
|
static int |
RIGHT
Position the Text to the Right of the point
|
static int |
SCIENTIFIC
Format to use when parsing a double
|
Constructor and Description |
---|
TextLine()
Instantiate the class
|
TextLine(Font f,
Color c,
int j)
Instantiate the class
|
TextLine(String s)
Instantiate the class.
|
TextLine(String s,
Color c)
Instantiate the class
|
TextLine(String s,
Font f)
Instantiate the class
|
TextLine(String s,
Font f,
Color c,
int j)
Instantiate the class
|
Modifier and Type | Method and Description |
---|---|
int |
charWidth(Graphics g,
char ch) |
TextLine |
copyState()
Create a New Textline object copying the state of the existing
object into the new one.
|
void |
copyState(TextLine t)
Copy the state of the parsed Textline into the existing
object.
|
void |
draw(Graphics g,
int x,
int y)
Parse the text then draw it without any rotation.
|
void |
draw(Graphics g,
int x,
int y,
int j)
Parse the text then draw it.
|
int |
getAscent(Graphics g) |
Color |
getBackground() |
Color |
getColor() |
int |
getDescent(Graphics g) |
FontMetrics |
getFM(Graphics g) |
Font |
getFont() |
String |
getFontName() |
int |
getFontSize() |
int |
getFontStyle() |
int |
getHeight(Graphics g) |
int |
getJustification() |
int |
getLeading(Graphics g) |
int |
getMaxAscent(Graphics g) |
int |
getMaxDescent(Graphics g) |
Font |
getScriptFont(Font f) |
String |
getText() |
int |
getWidth(Graphics g) |
boolean |
isNull() |
boolean |
parseDouble(double d)
Parse a double value.
|
boolean |
parseDouble(double d,
int p)
Parse a double value.
|
boolean |
parseDouble(double d,
int n,
int p,
int f)
Parse a double value
|
void |
parseText(Graphics g)
parse the text.
|
void |
setBackground(Color c)
Set the Background Color to use with the class
|
void |
setColor(Color c)
Set the Color to use with the class
|
void |
setFont(Font f)
Set the Font to use with the class
|
void |
setFontName(String s)
Set the Logical font name of the current font
|
void |
setFontSize(int i)
Set the Font size of the current font
|
void |
setFontStyle(int i)
Set the Font style of the current font
|
void |
setJustification(int i)
Set the Justification to use with the class
|
void |
setText(String s)
Set the String to use with the class
|
public static final int CENTER
public static final int LEFT
public static final int RIGHT
public static final int SCIENTIFIC
public static final int ALGEBRAIC
public TextLine()
public TextLine(String s)
s
- String to parse.public TextLine(String s, Font f)
s
- String to parse.f
- Font to use.public TextLine(String s, Font f, Color c, int j)
s
- String to parse.f
- Font to use.c
- Color to usej
- Justificationpublic TextLine(String s, Color c)
s
- String to parse.c
- Color to usepublic TextLine copyState()
public void copyState(TextLine t)
t
- The TextLine to get the state information from.public void setFont(Font f)
public void setText(String s)
s
- Stringpublic void setColor(Color c)
c
- Colorpublic void setBackground(Color c)
c
- Colorpublic void setJustification(int i)
t
- Justificationpublic Font getFont()
public String getText()
public Color getColor()
public Color getBackground()
public int getJustification()
public FontMetrics getFM(Graphics g)
g
- Graphics context.public int charWidth(Graphics g, char ch)
g
- Graphics context.ch
- The character.public int getWidth(Graphics g)
g
- Graphics context.public int getHeight(Graphics g)
g
- Graphics context.public int getAscent(Graphics g)
g
- Graphics context.public int getMaxAscent(Graphics g)
g
- Graphics context.public int getDescent(Graphics g)
g
- Graphics context.public int getMaxDescent(Graphics g)
g
- Graphics context.public int getLeading(Graphics g)
g
- Graphics context.public void parseText(Graphics g)
g
- Graphics context.public boolean isNull()
public void draw(Graphics g, int x, int y, int j)
g
- Graphics contextx
- pixel position of the texty
- pixel position of the textj
- justification of the textpublic void draw(Graphics g, int x, int y)
g
- Graphics contextx
- pixel position of the texty
- pixel position of the textpublic String getFontName()
public int getFontStyle()
public int getFontSize()
public void setFontName(String s)
s
- Logical font name.public void setFontStyle(int i)
i
- Font style.public void setFontSize(int i)
i
- Font size.public Font getScriptFont(Font f)
f
- Fontpublic boolean parseDouble(double d)
d
- double to parse
return true if the parse was successfulpublic boolean parseDouble(double d, int p)
d
- double to parsep
- precision of the number
return true if the parse was successfulpublic boolean parseDouble(double d, int n, int p, int f)
d
- double to parsen
- number of significant figuresp
- precision of the numberf
- format of the number scientific, algebraic etc.
return true if the parse was successfulJas4pp 1.5 © Java Analysis Studio for Particle Physics