SORTIE Java Interface
1
|
This class fills in map cell rectangles on a plot. More...
Public Member Functions | |
XYSimpleCellRenderer () | |
Constructor. More... | |
void | drawItem (java.awt.Graphics2D g2, XYItemRendererState state, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass) |
Draws a single grid cell. More... | |
void | setColor (int iRed, int iGreen, int iBlue, int iSeries) throws ModelException |
Sets the fill color for a series. More... | |
void | setColor (Color jColor, int iSeries) |
Sets the fill color for a series. More... | |
void | setXCellLength (float fLength) |
Sets the X cell length. More... | |
void | setYCellLength (float fLength) |
Sets the Y cell length. More... | |
Color | getColor (int iSeries) |
Gets the color for a series. More... | |
Paint | GetSeriesPaint (int iSeries) |
Returns the color for a series. More... | |
Private Attributes | |
float | m_fXCellSize = 8 |
Length of each cell in the X direction, in meters. More... | |
float | m_fYCellSize = 8 |
Length of each cell in the Y direction, in meters. More... | |
org.jfree.util.PaintList | m_jPaintList = new org.jfree.util.PaintList() |
The paint list. More... | |
This class fills in map cell rectangles on a plot.
The rectangle size can be set; the size defaults to the same as the underlying grid size.
The X and Y are expected to be integers which equal cell numbers in the X and Y directions. The Z is expected to be a number which controls the presence or absence of fill in a cell. true means fill; false means don't fill. Each filled cell is filled in the same color. A non-filled cell is not filled in white; it is not filled at all, which will allow anything underneath to show through.
The color can be controlled by setting the RGB value.
Originally this task was performed by XYCellRenderer. But then JFreeChart upgraded and took away my only way to find out if a cell was not to be filled, so I made this class for subplots, and simplified it for the job while I was at it.
Copyright: Copyright (c) Charles D. Canham 2003
Company: Cary Institute of Ecosystem Studies
Edit history:
---------------—
December 21, 2006: Created (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)
sortie.datavisualizer.XYSimpleCellRenderer.XYSimpleCellRenderer | ( | ) |
Constructor.
Sets defaults.
void sortie.datavisualizer.XYSimpleCellRenderer.drawItem | ( | java.awt.Graphics2D | g2, |
XYItemRendererState | state, | ||
java.awt.geom.Rectangle2D | dataArea, | ||
PlotRenderingInfo | info, | ||
XYPlot | plot, | ||
ValueAxis | domainAxis, | ||
ValueAxis | rangeAxis, | ||
XYDataset | dataset, | ||
int | series, | ||
int | item, | ||
CrosshairState | crosshairState, | ||
int | pass | ||
) |
Draws a single grid cell.
If the Z value is not true, nothing is drawn.
g2 | - the graphics device. |
state | - the renderer state. |
dataArea | - the area within which the data is being rendered. |
info | - collects drawing info. |
plot | - the plot. |
domainAxis | - the domain axis. |
rangeAxis | - the range axis. |
dataset | - the dataset. |
series | - the series index (zero-based). |
item | - the item index (zero-based). |
crosshairState | - crosshair information for the plot (null permitted). |
pass | - the pass index. |
Color sortie.datavisualizer.XYSimpleCellRenderer.getColor | ( | int | iSeries | ) |
Gets the color for a series.
iSeries | The series to get the color for. |
Paint sortie.datavisualizer.XYSimpleCellRenderer.GetSeriesPaint | ( | int | iSeries | ) |
Returns the color for a series.
If the series has not been explicitly set, it returns the default.
iSeries | the series index (zero-based). |
void sortie.datavisualizer.XYSimpleCellRenderer.setColor | ( | int | iRed, |
int | iGreen, | ||
int | iBlue, | ||
int | iSeries | ||
) | throws ModelException |
Sets the fill color for a series.
iRed | The RGB red value, between 0 and 255. |
iGreen | The RGB green value, between 0 and 255. |
iBlue | The RGB blue value, between 0 and 255. |
iSeries | The series to set the color for. |
sortie.data.simpletypes.ModelException | if the rgb values are invalid. |
void sortie.datavisualizer.XYSimpleCellRenderer.setColor | ( | Color | jColor, |
int | iSeries | ||
) |
Sets the fill color for a series.
jColor | Color to set. |
iSeries | Series for which to set the color. |
void sortie.datavisualizer.XYSimpleCellRenderer.setXCellLength | ( | float | fLength | ) |
Sets the X cell length.
fLength | X cell length, in m. |
void sortie.datavisualizer.XYSimpleCellRenderer.setYCellLength | ( | float | fLength | ) |
Sets the Y cell length.
fLength | Y cell length, in m. |
|
private |
Length of each cell in the X direction, in meters.
|
private |
Length of each cell in the Y direction, in meters.
|
private |
The paint list.