|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.approximatrix.charting.render.AbstractRenderer
com.approximatrix.charting.coordsystem.AbstractCoordSystem
com.approximatrix.charting.coordsystem.BoxCoordSystem
public class BoxCoordSystem
Coordinate system that renders as a box around the entire graph area. Tick marks are drawn on all sides of the box. Axis labels are drawn centered on the X and Y axes.
| Field Summary | |
|---|---|
protected static int |
BOTTOM_BUFFER
Buffer between items on the bottom x axis |
protected ChartDataModelConstraints |
constraints
The ChartDataModel constraints of the first y-axis and the x-axis. |
protected ChartDataModelConstraints |
constraints2
The ChartDataModel constraints of the second y-axis and the x-axis. |
private static int |
DEFAULT_MAX_ACTUAL_TICKS
The default maximum number of ticks to allow the tick position calculator to generate on a single axis. |
private static float[] |
DOT1
Constant array of floats used to create the default grid line style. |
protected static boolean |
DRAW_OBJECT_X_AXIS_GRID
Flag to draw X-axis grid when the X axis contains an Object series |
private int |
estimated_x_ticks
Estimate of the number of x ticks to draw. |
private int |
estimated_y_ticks
Estimates of the number of y ticks to draw. |
protected java.awt.Color |
gridColor
The color of grid lines |
protected java.awt.Stroke |
gridStroke
The stroke to use for drawing grids |
protected static int |
LEFT_BUFFER
Buffer between items on the left y axis |
private int |
maximum_x_ticks
The maximum number of x ticks to allow in the x direction |
private int |
maximum_y_ticks
The maximum number of y ticks to allow in the x direction |
protected ChartDataModel |
model
The DataModel object. |
private int |
ticSize
The length of ticks in pixels |
| Fields inherited from class com.approximatrix.charting.coordsystem.AbstractCoordSystem |
|---|
bottommargin, bounds, centerObjectLabelsBetweenTicks, dfX, dfY, leftmargin, listener, rightmargin, shouldPaintAxes, shouldPaintGrid, shouldPaintLabels, shouldPaintOnlyTick, tickFont, topmargin, unitFont, xaxis, xaxis_unit, y1transform, y2transform, yaxis, yaxis_unit, yaxis2 |
| Fields inherited from interface com.approximatrix.charting.coordsystem.CoordSystem |
|---|
FIRST_YAXIS, SECOND_YAXIS |
| Constructor Summary | |
|---|---|
BoxCoordSystem(ChartDataModel cdm)
Creates a new Box Coordinate System using the passed model. |
|
| Method Summary | |
|---|---|
void |
chartDataChanged(ChartDataModelEvent evt)
Listener to force the recomputation of all transforms on data changes |
protected int |
computeBottomMargin()
Computes the bottom margin. |
protected int |
computeLeftMargin()
Computes the left margin. |
protected int |
computeRightMargin()
Computes the right margin. |
protected int |
computeTopMargin()
Computes the top margin. |
private void |
drawNumericalXAxisTicks(java.awt.Graphics2D g)
|
private void |
drawObjectXAxisTicks(java.awt.Graphics2D g)
|
private void |
drawSingleGridline(java.awt.Graphics2D g,
int x1,
int y1,
int x2,
int y2)
|
private void |
drawXAxisTicks(java.awt.Graphics2D g)
|
private void |
drawYAxisTicks(java.awt.Graphics2D g)
|
ChartDataModelConstraints |
getChartDataModelConstraints(int axis)
Returns the used ChartDataModelConstraints. |
int |
getMaximumXTicks()
Returns the maximum number of X ticks to draw on the X axis |
int |
getMaximumYTicks()
Returns the maximum number of Y ticks to draw on the Y axis |
void |
paintDefault(java.awt.Graphics2D g)
This method is called by the paint method to do the actual painting. |
void |
resetMaximumXTicks()
Resets the maximum number of ticks along the X axis to the default value |
void |
resetMaximumYTicks()
Resets the maximum number of ticks along the X axis to the default value |
void |
setMaximumXTicks(int value)
Sets the maximum number of ticks along the X axis that will be allowed. |
void |
setMaximumYTicks(int value)
Sets the maximum number of ticks along the Y axis that will be allowed. |
| Methods inherited from class com.approximatrix.charting.render.AbstractRenderer |
|---|
getDirectRender, isDifferentBounds, setDirectRender |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int DEFAULT_MAX_ACTUAL_TICKS
protected static final int BOTTOM_BUFFER
protected static final int LEFT_BUFFER
private static final float[] DOT1
protected static boolean DRAW_OBJECT_X_AXIS_GRID
private int estimated_x_ticks
private int estimated_y_ticks
private int maximum_x_ticks
private int maximum_y_ticks
private int ticSize
protected ChartDataModelConstraints constraints
protected ChartDataModelConstraints constraints2
protected ChartDataModel model
protected java.awt.Stroke gridStroke
protected java.awt.Color gridColor
| Constructor Detail |
|---|
public BoxCoordSystem(ChartDataModel cdm)
cdm - the chart data model to associate the coordinate system with| Method Detail |
|---|
protected int computeBottomMargin()
AbstractCoordSystem
computeBottomMargin in class AbstractCoordSystemprotected int computeLeftMargin()
AbstractCoordSystem
computeLeftMargin in class AbstractCoordSystemprotected int computeRightMargin()
AbstractCoordSystem
computeRightMargin in class AbstractCoordSystemprotected int computeTopMargin()
AbstractCoordSystem
computeTopMargin in class AbstractCoordSystempublic void paintDefault(java.awt.Graphics2D g)
AbstractRenderer
paintDefault in interface CoordSystempaintDefault in class AbstractCoordSystemg - the Graphics2D object to paint in.public void chartDataChanged(ChartDataModelEvent evt)
CoordSystem
chartDataChanged in interface CoordSystemchartDataChanged in interface ChartDataModelListenerevt - the event that caused the data changeChartDataModelListener.chartDataChanged(com.approximatrix.charting.event.ChartDataModelEvent)public ChartDataModelConstraints getChartDataModelConstraints(int axis)
CoordSystem
getChartDataModelConstraints in interface CoordSystempublic int getMaximumXTicks()
CoordSystem
getMaximumXTicks in interface CoordSystempublic int getMaximumYTicks()
CoordSystem
getMaximumYTicks in interface CoordSystempublic void resetMaximumXTicks()
CoordSystem
resetMaximumXTicks in interface CoordSystempublic void resetMaximumYTicks()
CoordSystem
resetMaximumYTicks in interface CoordSystempublic void setMaximumXTicks(int value)
CoordSystem
setMaximumXTicks in interface CoordSystemvalue - the maximum number of X ticks, or -1 to reset to defaultpublic void setMaximumYTicks(int value)
CoordSystem
setMaximumYTicks in interface CoordSystemvalue - the maximum number of Y ticks, or -1 to reset to defaultprivate void drawYAxisTicks(java.awt.Graphics2D g)
private void drawXAxisTicks(java.awt.Graphics2D g)
private void drawNumericalXAxisTicks(java.awt.Graphics2D g)
private void drawObjectXAxisTicks(java.awt.Graphics2D g)
private void drawSingleGridline(java.awt.Graphics2D g,
int x1,
int y1,
int x2,
int y2)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||