public class Label extends SinglePointFigure
| Constructor and Description |
|---|
Label(Coordinate location,
Enums.StackPolicy stackPolicy,
java.lang.String text)
Constructor.
|
Label(Coordinate location,
java.lang.String text)
Constructor.
|
Label(java.lang.String text)
Constructor.
|
Label(java.lang.String text,
java.awt.Font font,
java.awt.Color textColor,
java.awt.Color bgColor)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
draw(java.awt.Graphics2D gc,
DrawContext ctx)
This method draws the figure on the graph (using the given Graphics2D).
|
java.awt.Color |
getLineColor()
Gets the color of the line connector (and label outline).
|
java.awt.Stroke |
getLineStroke()
Gets the stroke used for the line and outline.
|
int |
getOffset()
Gets the offset of the label (in pixels) relative to its location.
|
Text |
getText()
Gets the text displayed on the label.
|
boolean |
isShowLine()
Determines if the line is to be shown on the label.
|
void |
layout(DrawContext ctx)
This method is called to translate any real values in the figure to the graph (represented by the DrawContext).
|
void |
setLineColor(java.awt.Color color)
Sets the color of the line connector (and label outline).
|
void |
setLineStroke(java.awt.Stroke stroke)
Gets the stroke used for the line and outline.
|
void |
setOffset(int offset)
Sets the offset of the label (in pixels) relative to its location.
|
void |
setShowLine(boolean showLine)
Sets the attribute to show the line from the label to the point that it is highlighting.
|
contains, getGraphLocation, getLocation, getOffsetPixels, getPosition, getStackPolicy, getTime, getValue, isVisible, setGraphLocation, setLocation, setLocation, setOffsetPixels, setPosition, setStackPolicypublic Label(java.lang.String text)
text - text to display on the labelpublic Label(Coordinate location, java.lang.String text)
location - absolute location of the labeltext - text to display on the labelpublic Label(Coordinate location, Enums.StackPolicy stackPolicy, java.lang.String text)
location - absolute location of the labelstackPolicy - stacking policy for figures that share the same coordinatetext - text to display on the labelpublic Label(java.lang.String text,
java.awt.Font font,
java.awt.Color textColor,
java.awt.Color bgColor)
text - text to display in the labelfont - font to usetextColor - color of the textbgColor - background color of the labelpublic Text getText()
public void setOffset(int offset)
offset - offset (in pixels) relative to its location.public int getOffset()
public void setShowLine(boolean showLine)
showLine - public boolean isShowLine()
public java.awt.Color getLineColor()
public void setLineColor(java.awt.Color color)
color - line colorpublic void setLineStroke(java.awt.Stroke stroke)
stroke - stroke to be used for the line and outline.public java.awt.Stroke getLineStroke()
public void layout(DrawContext ctx)
public void draw(java.awt.Graphics2D gc,
DrawContext ctx)