public class HKey extends Object implements Serializable
Constructor and Description |
---|
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 text,
double x,
double y,
Font font,
Color color,
String howToSet,
Object obj)
Make a key for a function, data points or histograms (F1D, H1D, P1D).
|
HKey(String text,
double x,
double y,
Font font,
String howToSet,
Object obj)
Make a key for a function, data points or histograms (F1D, H1D, P1D).
|
HKey(String text,
double x,
double y,
Object obj)
Make a key for a function, data points or histograms (F1D, H1D, P1D).
|
HKey(String s,
double x,
double y,
String howToSet)
Make a label with specific coordinates.
|
HKey(String text,
double x,
double y,
String howToSet,
Object obj)
Make a key for a function, data points or histograms (F1D, H1D, P1D).
|
HKey(String s,
Font f)
Make a key label (color- black)
|
HKey(String s,
Font f,
Color c)
Create a key label.
|
HKey(String text,
Object obj)
Make a key for a function, data points or histograms (F1D, H1D, P1D) at
the default position.
|
Modifier and Type | Method and Description |
---|---|
Color |
getColor()
Get color of a label.
|
Font |
getFont()
Get the font of the label text.
|
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.
|
float |
getSeparation()
Return vertical separation between different keys.
|
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.
|
boolean |
isDefaultPosition()
Is this key should be set at a default position?
|
void |
setColor(Color c)
Sets the color to a specific value
|
void |
setDefaultPosition(boolean isdefault)
Is this key should be set at a default position?
|
void |
setFont(Font f)
Sets the font to a specific value
|
void |
setKey(int key_type,
float key_size,
Color key_color)
Sets a key
|
void |
setKeySpace(float 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 |
setSeparation(float y)
Set Y-separation of the keys in the default location mode
|
void |
setText(String s)
Sets a text of the label.
|
public HKey(String s, Font f, Color c)
s
- Textf
- Fontc
- Colorpublic HKey(String text, double x, double y, Font font, Color color, String howToSet, Object obj)
text
- key textx
- position Xy
- position Yfont
- font of the key textcolor
- color of the key texthowToSet
- use either USER or NDC coordinatorsobj
- input objects, such as F1D, H1D, P1Dpublic HKey(String text, double x, double y, Font font, String howToSet, Object obj)
text
- key textx
- position Xy
- position Yfont
- font of the key texthowToSet
- use either USER or NDC coordinatorsobj
- input objects, such as F1D, H1D, P1Dpublic HKey(String text, double x, double y, String howToSet, Object obj)
text
- key textx
- position Xy
- position YhowToSet
- use either USER or NDC coordinatorsobj
- input objects, such as F1D, H1D, P1Dpublic HKey(String text, double x, double y, Object obj)
text
- key textx
- position Xy
- position Yobj
- input objects, such as F1D, H1D, P1Dpublic HKey(String text, Object obj)
text
- key textx
- position Xy
- position Yobj
- input objects, such as F1D, H1D, P1Dpublic 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 coordinatespublic 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, float 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(float 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 GraphLabel getGraphLabel()
public void setSeparation(float y)
y
- separation between 0 and 1. NDC system is used.public float getSeparation()
separation
- between keyspublic boolean isDefaultPosition()
public void setDefaultPosition(boolean isdefault)
isdefault
- true if the key are set at default locationJas4pp 1.5 © Java Analysis Studio for Particle Physics