Package com.motivewave.platform.sdk.draw
Class Label
java.lang.Object
com.motivewave.platform.sdk.draw.Figure
com.motivewave.platform.sdk.draw.SinglePointFigure
com.motivewave.platform.sdk.draw.Label
Draws a label on the chart with a line connector.
-
Constructor Summary
ConstructorDescriptionLabel
(Coordinate location, Enums.StackPolicy stackPolicy, String text) Constructor.Label
(Coordinate location, String text) Constructor.Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(Graphics2D gc, DrawContext ctx) This method draws the figure on the graph (using the given Graphics2D).Gets the color of the line connector (and label outline).Gets the stroke used for the line and outline.int
Gets the offset of the label (in pixels) relative to its location.getText()
Gets the text displayed on the label.boolean
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
(Color color) Sets the color of the line connector (and label outline).void
setLineStroke
(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.Methods inherited from class com.motivewave.platform.sdk.draw.SinglePointFigure
contains, getGraphLocation, getLocation, getOffsetPixels, getPosition, getStackPolicy, getTime, getValue, isVisible, setGraphLocation, setLocation, setLocation, setOffsetPixels, setPosition, setStackPolicy
Methods inherited from class com.motivewave.platform.sdk.draw.Figure
getBounds, getPopupMessage, isUnderlay, setBounds, setPopupMessage, setUnderlay
-
Constructor Details
-
Label
Constructor. Creates a label using the default font and text color.- Parameters:
text
- text to display on the label
-
Label
Constructor. Creates a label using the default font and text color.- Parameters:
location
- absolute location of the labeltext
- text to display on the label
-
Label
Constructor. Creates a label using the default font and text color.- Parameters:
location
- absolute location of the labelstackPolicy
- stacking policy for figures that share the same coordinatetext
- text to display on the label
-
Label
Constructor.- Parameters:
text
- text to display in the labelfont
- font to usetextColor
- color of the textbgColor
- background color of the label
-
-
Method Details
-
getText
Gets the text displayed on the label.- Returns:
- text object that contains information for drawing the text for this label.
-
setOffset
public void setOffset(int offset) Sets the offset of the label (in pixels) relative to its location.- Parameters:
offset
- offset (in pixels) relative to its location.
-
getOffset
public int getOffset()Gets the offset of the label (in pixels) relative to its location.- Returns:
- the offset (in pixels) relative to its location.
-
setShowLine
public void setShowLine(boolean showLine) Sets the attribute to show the line from the label to the point that it is highlighting.- Parameters:
showLine
-
-
isShowLine
public boolean isShowLine()Determines if the line is to be shown on the label.- Returns:
- true if the label line is to be shown
-
getLineColor
Gets the color of the line connector (and label outline).- Returns:
- the color of the line connector.
-
setLineColor
Sets the color of the line connector (and label outline).- Parameters:
color
- line color
-
setLineStroke
Gets the stroke used for the line and outline.- Parameters:
stroke
- stroke to be used for the line and outline.
-
getLineStroke
Gets the stroke used for the line and outline.- Returns:
- stroke used to draw the line and outline.
-
layout
This method is called to translate any real values in the figure to the graph (represented by the DrawContext). -
draw
This method draws the figure on the graph (using the given Graphics2D). This method is called by the study framework to display the figure on the graph.
-