public class ColorRange extends Figure
Constructor and Description |
---|
ColorRange(long time)
Creates a color range at the given bar time.
|
Modifier and Type | Method and Description |
---|---|
void |
addRegion(java.awt.Color color,
double bottom,
double top)
Adds a color region to this range.
|
void |
clearRegions()
Removes all of the regions defined for this color range.
|
void |
draw(java.awt.Graphics2D gc,
DrawContext ctx)
This method draws the figure on the graph (using the given Graphics2D).
|
java.awt.Color |
getBackgroundColor()
Gets the background color for the color range.
|
long |
getTime()
Gets the time (in milliseconds since 1970) where this bar is displayed.
|
void |
layout(DrawContext ctx)
Converts the color regions to displayable areas on the graph.
|
void |
setBackgroundColor(java.awt.Color bg)
Sets the background color for the color range.
|
public ColorRange(long time)
time
- milliseconds since 1970public void layout(DrawContext ctx)
public void draw(java.awt.Graphics2D gc, DrawContext ctx)
public void addRegion(java.awt.Color color, double bottom, double top)
color
- Color for the regionbottom
- 'real' bottom valuetop
- 'real' top valuepublic void clearRegions()
public void setBackgroundColor(java.awt.Color bg)
bg
- background colorpublic java.awt.Color getBackgroundColor()
public long getTime()