Class ColorRange
java.lang.Object
com.motivewave.platform.sdk.draw.Figure
com.motivewave.platform.sdk.draw.ColorRange
This class may be used to draw a set of colors at a given bar location.
Each color is defined by a region. The region consists of a color plus top and bottom values.
The width of the color range will be the bar width of the graph.
A background color may be specified to fill areas where no color has been defined.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a color region to this range.voidRemoves all of the regions defined for this color range.voiddraw(Graphics2D gc, DrawContext ctx) This method draws the figure on the graph (using the given Graphics2D).Gets the background color for the color range.longgetTime()Gets the time (in milliseconds since 1970) where this bar is displayed.voidlayout(DrawContext ctx) Converts the color regions to displayable areas on the graph.voidSets the background color for the color range.Methods inherited from class com.motivewave.platform.sdk.draw.Figure
contains, getBounds, getPopupMessage, isUnderlay, isVisible, setBounds, setPopupMessage, setUnderlay
-
Constructor Details
-
ColorRange
public ColorRange(long time) Creates a color range at the given bar time.- Parameters:
time- milliseconds since 1970
-
-
Method Details
-
layout
Converts the color regions to displayable areas on the graph. -
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. -
addRegion
Adds a color region to this range. The top and bottom values are 'real' values and will be converted to graph values in the 'layout' method.- Parameters:
color- Color for the regionbottom- 'real' bottom valuetop- 'real' top value
-
clearRegions
public void clearRegions()Removes all of the regions defined for this color range. -
setBackgroundColor
Sets the background color for the color range. this is the color that is shown for undefined regions.- Parameters:
bg- background color
-
getBackgroundColor
Gets the background color for the color range. this is the color that is shown for undefined regions.- Returns:
- background color for the color range.
-
getTime
public long getTime()Gets the time (in milliseconds since 1970) where this bar is displayed.- Returns:
- time where this bar is displayed
-