|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.jrefinery.chart.Axis
com.jrefinery.chart.ValueAxis
com.jrefinery.chart.DateAxis
com.jrefinery.chart.HorizontalDateAxis
public class HorizontalDateAxis
A horizontal axis that displays date values. Used in XY plots where the x-values in the dataset are interpreted as milliseconds, encoded in the same way as java.util.Date.
XYPlot| Field Summary | |
|---|---|
protected boolean |
verticalTickLabels
A flag indicating whether or not tick labels are drawn vertically. |
| Fields inherited from class com.jrefinery.chart.DateAxis |
|---|
anchorDate, crosshairDate, DEFAULT_CROSSHAIR_DATE, standardTickFormats, standardTickUnitMagnitudes, standardTickUnits, tickLabelFormatter, tickUnit |
| Fields inherited from class com.jrefinery.chart.Axis |
|---|
fixedDimension, label, labelFont, labelInsets, labelPaint, listeners, plot, tickLabelFont, tickLabelInsets, tickLabelPaint, tickLabelsVisible, tickMarkStroke, tickMarksVisible, ticks, visible |
| Fields inherited from interface com.jrefinery.chart.AxisConstants |
|---|
DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_STROKE |
| Constructor Summary | |
|---|---|
HorizontalDateAxis()
Constructs a HorizontalDateAxis, using default values where necessary. |
|
HorizontalDateAxis(java.lang.String label)
Constructs a horizontal date axis, using default values where necessary. |
|
HorizontalDateAxis(java.lang.String label,
java.awt.Font labelFont,
java.awt.Paint labelPaint,
java.awt.Insets labelInsets,
boolean showTickLabels,
java.awt.Font tickLabelFont,
java.awt.Paint tickLabelPaint,
java.awt.Insets tickLabelInsets,
boolean verticalTickLabels,
boolean showTickMarks,
java.awt.Stroke tickMarkStroke,
boolean autoRange,
Range range,
boolean autoUnits,
DateUnit tickUnits,
java.text.SimpleDateFormat tickLabelFormatter,
boolean gridVisible,
java.awt.Stroke gridStroke,
java.awt.Paint gridPaint,
boolean crosshairVisible,
java.util.Date crosshairDate,
java.awt.Stroke crosshairStroke,
java.awt.Paint crosshairPaint)
Constructs a HorizontalDateAxis. |
|
HorizontalDateAxis(java.lang.String label,
java.awt.Font labelFont,
Range range)
Constructs a HorizontalDateAxis, using default values where necessary. |
|
| Method Summary | |
|---|---|
protected void |
autoAdjustRange()
Rescales the axis to ensure that all data is visible. |
void |
configure()
Configures the axis to work with the specified plot. |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
Draws the plot on a Java 2D graphics device (such as the screen or a printer). |
boolean |
getVerticalTickLabels()
Returns true if the tick labels should be rotated to vertical, and false for standard horizontal labels. |
protected boolean |
isCompatiblePlot(Plot plot)
Returns true if the specified plot is compatible with the axis, and false otherwise. |
void |
refreshTicks(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
Recalculates the ticks for the date axis. |
java.awt.geom.Rectangle2D |
reserveAxisArea(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea,
double reservedWidth)
Returns area in which the axis will be displayed. |
double |
reserveHeight(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea)
Returns the height required to draw the axis in the specified draw area. |
void |
setVerticalTickLabels(boolean flag)
Sets the flag that determines the orientation of the tick labels. |
double |
translateDateToJava2D(java.util.Date date,
java.awt.geom.Rectangle2D dataArea)
Translates a date to Java2D coordinates, based on the range displayed by this axis for the specified data area. |
double |
translateJava2DtoValue(float java2DValue,
java.awt.geom.Rectangle2D dataArea)
Translates the Java2D (horizontal) coordinate back to the corresponding data value. |
double |
translateValueToJava2D(double value,
java.awt.geom.Rectangle2D dataArea)
Translates the data value to the display coordinates (Java 2D User Space) of the chart. |
| Methods inherited from class com.jrefinery.chart.DateAxis |
|---|
calculateHighestVisibleTickValue, calculateLowestVisibleTickValue, findAxisMagnitudeIndex, getAnchorDate, getCrosshairDate, getMaximumDate, getMinimumDate, getTickLabelFormatter, getTickUnit, nextStandardDate, previousStandardDate, setAnchorDate, setAnchorValue, setAxisRange, setCrosshairDate, setMaximumDate, setMinimumDate, setRange, setTickUnit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean verticalTickLabels
| Constructor Detail |
|---|
public HorizontalDateAxis()
public HorizontalDateAxis(java.lang.String label)
label - The axis label.
public HorizontalDateAxis(java.lang.String label,
java.awt.Font labelFont,
Range range)
label - The axis label.labelFont - The font for displaying the axis label.range - The axis range.
public HorizontalDateAxis(java.lang.String label,
java.awt.Font labelFont,
java.awt.Paint labelPaint,
java.awt.Insets labelInsets,
boolean showTickLabels,
java.awt.Font tickLabelFont,
java.awt.Paint tickLabelPaint,
java.awt.Insets tickLabelInsets,
boolean verticalTickLabels,
boolean showTickMarks,
java.awt.Stroke tickMarkStroke,
boolean autoRange,
Range range,
boolean autoUnits,
DateUnit tickUnits,
java.text.SimpleDateFormat tickLabelFormatter,
boolean gridVisible,
java.awt.Stroke gridStroke,
java.awt.Paint gridPaint,
boolean crosshairVisible,
java.util.Date crosshairDate,
java.awt.Stroke crosshairStroke,
java.awt.Paint crosshairPaint)
label - The axis label.labelFont - The font for displaying the axis label.labelPaint - The paint used to draw the axis label.labelInsets - The blank space around the axis label.showTickLabels - Flag indicating whether or not tick labels are visible.tickLabelFont - Font for displaying tick labels.tickLabelPaint - The paint used to display the tick labels.tickLabelInsets - The blank space around the tick labels.verticalTickLabels - A flag indicating whether or not tick labels are drawn vertically.showTickMarks - Flag indicating whether or not tick marks are visible.tickMarkStroke - The stroke used to draw tick marks (if visible).autoRange - Flag indicating whether or not the axis is automatically scaled to fit the
data.range - The axis range.autoUnits - A flag indicating whether or not the tick units are automatically
selected.tickUnits - The tick units.tickLabelFormatter - The format object used to display tick labels.gridVisible - Flag indicating whether or not grid lines are visible for this axis.gridStroke - The Stroke used to display grid lines (if visible).gridPaint - The Paint used to display grid lines (if visible).crosshairDate - The date at which to draw the crosshair line (null permitted).crosshairStroke - The pen/brush used to draw the data line.crosshairPaint - The color used to draw the data line.| Method Detail |
|---|
public boolean getVerticalTickLabels()
public void setVerticalTickLabels(boolean flag)
flag - The flag.public void configure()
configure in class Axis
public double translateDateToJava2D(java.util.Date date,
java.awt.geom.Rectangle2D dataArea)
date - The date.dataArea - The rectangle (in Java2D space) where the data is to be plotted.
public double translateValueToJava2D(double value,
java.awt.geom.Rectangle2D dataArea)
translateValueToJava2D in class ValueAxisdate - The date to be plotted.dataArea - The rectangle (in Java2D space) where the data is to be plotted.
public double translateJava2DtoValue(float java2DValue,
java.awt.geom.Rectangle2D dataArea)
translateJava2DtoValue in class ValueAxisjava2DValue - The coordinate in Java2D space.dataArea - The rectangle (in Java2D space) where the data is to be plotted.
protected void autoAdjustRange()
autoAdjustRange in class ValueAxis
public void refreshTicks(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
refreshTicks in class Axisg2 - The graphics device.drawArea - The area in which the axes and data are to be drawn.plotArea - The area in which the data is to be drawn.
public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
draw in class Axisg2 - The graphics device.drawArea - The area within which the chart should be drawn.plotArea - The area within which the plot should be drawn (a subset of the drawArea).
public double reserveHeight(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea)
reserveHeight in interface HorizontalAxisg2 - The graphics device.plot - The plot that the axis belongs to.drawArea - The area within which the plot should be drawn.
public java.awt.geom.Rectangle2D reserveAxisArea(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea,
double reservedWidth)
reserveAxisArea in interface HorizontalAxisg2 - The graphics device.plot - The plot.drawArea - The drawing area.reservedWidth - The width already reserved for the vertical axis.
protected boolean isCompatiblePlot(Plot plot)
The HorizontalDateAxis class expects the plot to implement the HorizontalValuePlot interface.
isCompatiblePlot in class Axisplot - The plot.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||