Class Box
java.lang.Object
com.motivewave.platform.sdk.draw.Figure
com.motivewave.platform.sdk.draw.Box
Draws a rectangular box with the given start and end coordinates.
A fill color may be used to fill the interior of the box.
-
Constructor Summary
ConstructorsConstructorDescriptionBox
(long startTime, double startValue, long endTime, double endValue) Constructor.Constructor.Box
(Coordinate start, Coordinate end) ConstructorBox
(Coordinate start, Coordinate end, PathInfo info) Constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(double x, double y, DrawContext ctx) Returns true if the box contains the given x and y coordinates within the given draw context.void
draw
(Graphics2D gc, DrawContext ctx) Draws the box (this is called by the study framework).long
Gets the time of the ending location of the box.double
Gets the value of the ending location of the box.Gets the color for drawing the box fill (null for no fill).Gets the color for drawing the box outline.long
Gets the time of the starting location of the box.double
Gets the value of the starting location of the box.Gets the stroke for displaying the box outline.boolean
isVisible
(DrawContext ctx) Returns true if the box is currently visible within the given draw context.void
layout
(DrawContext ctx) Lays out the box by converting the start and end coordinates to x,y coordinates on the graph.void
setEnd
(long time, double value) Sets the location of the end of the box.void
setFillColor
(Color color) Sets the color for drawing the box fill (null for no fill).void
setLineColor
(Color color) Sets the color of the line used to draw the box outline.void
setStart
(long time, double value) Sets the location of the start of the box.void
Sets the stroke for displaying the box outline.Methods inherited from class com.motivewave.platform.sdk.draw.Figure
getBounds, getPopupMessage, isUnderlay, setBounds, setPopupMessage, setUnderlay
-
Constructor Details
-
Box
Constructor- Parameters:
start
- starting location of the boxend
- ending location of the box
-
Box
Constructor- Parameters:
start
- starting location of the boxend
- ending location of the boxinfo
- describes how to display the outline of the box.
-
Box
public Box(long startTime, double startValue, long endTime, double endValue) Constructor.- Parameters:
startTime
-startValue
-endTime
-endValue
-
-
Box
Constructor.- Parameters:
startTime
-startValue
-endTime
-endValue
-info
-
-
-
Method Details
-
setStart
public void setStart(long time, double value) Sets the location of the start of the box.- Parameters:
time
- time (as milliseconds since 1970)value
- (y coordinate)
-
getStartTime
public long getStartTime()Gets the time of the starting location of the box.- Returns:
- start time for the box (milliseconds since 1970)
-
getStartValue
public double getStartValue()Gets the value of the starting location of the box.- Returns:
- start value for the box
-
setEnd
public void setEnd(long time, double value) Sets the location of the end of the box.- Parameters:
time
- time (as milliseconds since 1970)value
- (y coordinate)
-
getEndTime
public long getEndTime()Gets the time of the ending location of the box.- Returns:
- end time for the box (milliseconds since 1970)
-
getEndValue
public double getEndValue()Gets the value of the ending location of the box.- Returns:
- end value for the box
-
getLineColor
Gets the color for drawing the box outline.- Returns:
- the color of the line used to draw the box outline.
-
setLineColor
Sets the color of the line used to draw the box outline.- Parameters:
color
- box outline color
-
getFillColor
Gets the color for drawing the box fill (null for no fill).- Returns:
- the color used to draw the box fill (null for no fill).
-
setFillColor
Sets the color for drawing the box fill (null for no fill).- Parameters:
color
- box fill color
-
setStroke
Sets the stroke for displaying the box outline. If this value is null, the outline will not be drawn.- Parameters:
stroke
-
-
getStroke
Gets the stroke for displaying the box outline.- Returns:
- stroke for displaying the box outline
-
isVisible
Returns true if the box is currently visible within the given draw context. -
contains
Returns true if the box contains the given x and y coordinates within the given draw context. -
layout
Lays out the box by converting the start and end coordinates to x,y coordinates on the graph. This is called by the study framework. -
draw
Draws the box (this is called by the study framework).
-