public class HLabel
extends java.lang.Object
implements java.io.Serializable
class
For more labels look at the shape package,
Serialized Form| Constructor and Description |
|---|
HLabel(java.lang.String s)
Make a label with default attributes
|
HLabel(java.lang.String s,
double x,
double y)
Make a label with specific coordinated in the data system
|
HLabel(java.lang.String s,
double x,
double y,
java.lang.String howToSet)
Make a label with specific coordinates.
|
HLabel(java.lang.String s,
java.awt.Font f)
Make a label (color- black)
|
HLabel(java.lang.String s,
java.awt.Font f,
java.awt.Color c)
Make a text label at (0,0) in the data coordinates (USER).
|
| Modifier and Type | Method and Description |
|---|---|
void |
doc()
Show online documentation.
|
java.awt.Color |
getColor()
Get color of a label.
|
java.awt.Font |
getFont()
Get the font of the label text.
|
GraphLabel |
getGraphLabel()
Get a label with default attributes
|
int |
getPositionCoordinate()
Is the position set?
|
double |
getRotation()
Returns the rotation angle.
|
java.lang.String |
getText()
Get the text of the label.
|
double |
getX()
Returns the X position of the text.
|
double |
getY()
Returns the Y position of the text.
|
void |
setColor(java.awt.Color c)
Sets the color to a specific value
|
void |
setFont(java.awt.Font f)
Sets the font to a specific value
|
void |
setLocation(double x,
double y)
Sets the location of the label in the NDC coordinates.
|
void |
setLocation(double x,
double y,
java.lang.String howToSet)
Sets the location of the label in data coordinates.
|
void |
setRotation(double r)
Sets the rotation angle.
|
void |
setText(java.lang.String s)
Sets a text of the label.
|
public HLabel(java.lang.String s,
java.awt.Font f,
java.awt.Color c)
s - Textf - Fontc - Colorpublic HLabel(java.lang.String s,
java.awt.Font f)
s - Textf - Fontpublic HLabel(java.lang.String s)
s - textpublic HLabel(java.lang.String s,
double x,
double y)
s - Textx - Position in Xy - Position in Ypublic HLabel(java.lang.String s,
double x,
double y,
java.lang.String howToSet)
s - Textx - position in Xy - position in YhowToSet - set it to "NDC" for normalized coordinates (in the range 0-1).
This is a data independent position set it to "USER" for the
user coordinatespublic void setText(java.lang.String s)
s - new text for the labelpublic java.lang.String getText()
public void setColor(java.awt.Color c)
c - color used to draw the labelpublic java.awt.Color getColor()
public void setFont(java.awt.Font f)
f - font used to draw the labelpublic java.awt.Font getFont()
public void setRotation(double r)
r - angle for this labelpublic double getRotation()
public void setLocation(double x,
double y)
x - x-position of the lower-left corner of the texty - y-position of the lower-left corner of the textpublic void setLocation(double x,
double y,
java.lang.String howToSet)
x - x-position of the lower-left corner of the texty - y-position of the lower-left corner of the texthowToSet - set it to "NDC" for normalized coordinates (in the range 0-1).
This is a data independent position set it to "USER" for the
user coordinatespublic int getPositionCoordinate()
public double getX()
public double getY()
public GraphLabel getGraphLabel()
public void doc()
JHepSim. A part of HSTOOLS. version-1.2