|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjhplot.HKey
public class HKey
Create an interactive key label in the USER or NDC coordinates. The label can be defined in the NDC (normalized coordinate system) or the user coordinate. Only one line of the text can be shown. The key is not related to any data set, so you can plot this key even if no data are shown.
Constructor Summary | |
---|---|
HKey(String s)
Make a key label with default attributes |
|
HKey(String s,
double x,
double y)
Make a key label with specific coordinated in the data system |
|
HKey(String s,
double x,
double y,
String howToSet)
Make a label with specific coordinates. |
|
HKey(String s,
Font f)
Make a key label (color- black) |
|
HKey(String s,
Font f,
Color c)
Create a key label. |
Method Summary | |
---|---|
Color |
getColor()
Get color of a label. |
Font |
getFont()
Get the font of the label text. |
jplot.GraphLabel |
getGraphLabel()
Get a label with default attributes |
Color |
getKeyColor()
Get key color |
float |
getKeySize()
Get key size |
double |
getKeySpace()
Get a space between the key and the text describing the key |
int |
getKeyType()
Get key type |
double |
getLineWidth()
Get a key line width |
int |
getPositionCoordinate()
Is the position set? |
double |
getRotation()
Returns the rotation angle. |
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(Color c)
Sets the color to a specific value |
void |
setFont(Font f)
Sets the font to a specific value |
void |
setKey(int key_type,
double key_size,
Color key_color)
Sets a key |
void |
setKeySpace(double key_space)
Sets a space between the key and the text describing the key |
void |
setLineWidth(int key_line_width)
Sets key line width |
void |
setLocation(double x,
double y)
Sets the location of the label in data coordinates. |
void |
setLocation(double x,
double y,
String howToSet)
Sets the location of the label in data coordinates. |
void |
setRotation(double r)
Sets the rotation angle. |
void |
setText(String s)
Sets a text of the label. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HKey(String s, Font f, Color c)
s
- Textf
- Fontc
- Colorpublic HKey(String s, Font f)
s
- Textf
- Fontpublic HKey(String s)
s
- textpublic HKey(String s, double x, double y)
s
- Textx
- Position in Xy
- Position in Ypublic HKey(String s, double x, double y, 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 coordinatesMethod Detail |
---|
public void setText(String s)
s
- new text for the labelpublic String getText()
public void setColor(Color c)
c
- color used to draw the labelpublic Color getColor()
public void setFont(Font f)
f
- font used to draw the labelpublic 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 setKey(int key_type, double key_size, Color key_color)
key_type
- type of the key. 0 means a boxkey_size
- size (i.e. length) a key in terms of character widthkey_color
- color of the keypublic void setLineWidth(int key_line_width)
key_line_width
- line width of the keypublic void setKeySpace(double key_space)
key_space
- key space in terms of character widthpublic double getKeySpace()
public double getLineWidth()
public int getKeyType()
public Color getKeyColor()
public float getKeySize()
public void setLocation(double x, double y, 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 jplot.GraphLabel getGraphLabel()
|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |