public abstract class Graph2DRenderer<T extends Graph2DRendererUpdate> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Color |
backgroundColor |
protected int |
bottomAreaMargin |
protected int |
bottomMargin |
protected Graphics2D |
g |
protected Color |
labelColor |
protected Font |
labelFont |
protected FontMetrics |
labelFontMetrics |
protected int |
leftAreaMargin |
protected int |
leftMargin |
protected Color |
referenceLineColor |
protected int |
rightAreaMargin |
protected int |
rightMargin |
protected int |
topAreaMargin |
protected int |
topMargin |
protected int |
xAreaEnd |
protected int |
xAreaStart |
protected int |
xLabelMargin |
protected double |
xPlotCoordEnd |
protected double |
xPlotCoordStart |
protected double |
xPlotCoordWidth |
protected double |
xPlotValueEnd |
protected double |
xPlotValueStart |
protected org.epics.util.array.ListDouble |
xReferenceCoords |
protected List<String> |
xReferenceLabels |
protected org.epics.util.array.ListDouble |
xReferenceValues |
protected int |
yAreaEnd |
protected int |
yAreaStart |
protected int |
yLabelMargin |
protected double |
yPlotCoordEnd |
protected double |
yPlotCoordHeight |
protected double |
yPlotCoordStart |
protected double |
yPlotValueEnd |
protected double |
yPlotValueStart |
protected org.epics.util.array.ListDouble |
yReferenceCoords |
protected List<String> |
yReferenceLabels |
protected org.epics.util.array.ListDouble |
yReferenceValues |
| Constructor and Description |
|---|
Graph2DRenderer(int graphWidth,
int graphHeight)
Creates a graph renderer.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateGraphArea()
Calculates the graph area based on:
The image size
The plot ranges
The value scales
The font for the labels
The margins
|
protected void |
calculateRanges(Range xDataRange,
Range yDataRange)
Given the new data ranges, calculates the new aggregated and plot
ranges.
|
protected void |
drawBackground()
Draws the background with the background color.
|
protected void |
drawGraphArea()
Draw the calculated graph area.
|
protected void |
drawHorizontalReferenceLines()
Draws the horizontal reference lines based on the calculated
graph area.
|
protected void |
drawValueExplicitLine(org.epics.util.array.ListNumber xValues,
org.epics.util.array.ListNumber yValues,
InterpolationScheme interpolation,
ReductionScheme reduction)
Draws an explicit line give the interpolation and reduction schemes,
the x values and the y values.
|
protected void |
drawValueLine(org.epics.util.array.ListNumber xValues,
org.epics.util.array.ListNumber yValues,
InterpolationScheme interpolation)
Draws an implicit line given the interpolation scheme and the x,y values.
|
protected void |
drawVerticalReferenceLines() |
protected void |
drawXLabels()
Draw the horizontal labels based on the calculated graph area.
|
protected void |
drawYLabels()
Draw the vertical labels based on the calculated graph area.
|
int |
getImageHeight()
The current height of the graph.
|
int |
getImageWidth()
The current width of the graph.
|
Range |
getXAggregatedRange()
The aggregated range of all the data that has been rendered.
|
AxisRange |
getXAxisRange()
The current strategy to calculate the x range for the graph.
|
Range |
getXPlotRange()
The range of the x axis in the last graph rendering.
|
Range |
getYAggregatedRange()
The aggregated range of all the data that has been rendered.
|
AxisRange |
getYAxisRange()
The current strategy to calculate the y range for the graph.
|
Range |
getYPlotRange()
The range of the y axis in the last graph rendering.
|
abstract T |
newUpdate()
Creates a new update for the given graph.
|
protected void |
processScaledValue(int index,
double valueX,
double valueY,
double scaledX,
double scaledY) |
protected double |
scaledX(double value)
Scale the x value to the graph area.
|
protected double |
scaledY(double value)
Scale the y value to the graph area.
|
protected void |
setClip(Graphics2D g)
Sets the clip area to the actual graph area
|
void |
update(T update)
Applies the update to the renderer.
|
protected double xPlotValueStart
protected double yPlotValueStart
protected double xPlotValueEnd
protected double yPlotValueEnd
protected double yPlotCoordHeight
protected double xPlotCoordWidth
protected double xPlotCoordStart
protected double yPlotCoordStart
protected double yPlotCoordEnd
protected double xPlotCoordEnd
protected int xAreaStart
protected int yAreaStart
protected int yAreaEnd
protected int xAreaEnd
protected Graphics2D g
protected Color backgroundColor
protected Color labelColor
protected Color referenceLineColor
protected Font labelFont
protected int bottomMargin
protected int topMargin
protected int leftMargin
protected int rightMargin
protected int bottomAreaMargin
protected int topAreaMargin
protected int leftAreaMargin
protected int rightAreaMargin
protected int xLabelMargin
protected int yLabelMargin
protected FontMetrics labelFontMetrics
protected org.epics.util.array.ListDouble xReferenceCoords
protected org.epics.util.array.ListDouble xReferenceValues
protected org.epics.util.array.ListDouble yReferenceCoords
protected org.epics.util.array.ListDouble yReferenceValues
public Graph2DRenderer(int graphWidth,
int graphHeight)
graphWidth - the graph widthgraphHeight - the graph heightpublic int getImageHeight()
public int getImageWidth()
public AxisRange getXAxisRange()
public AxisRange getYAxisRange()
public Range getXAggregatedRange()
public Range getYAggregatedRange()
public Range getXPlotRange()
public Range getYPlotRange()
public void update(T update)
When sub-classing, one should re-implement this method by first calling it and then applying all the updates specific to the sub-class.
update - the update to applypublic abstract T newUpdate()
protected void calculateRanges(Range xDataRange, Range yDataRange)
xDataRange - the new data range for xyDataRange - the new data range for yprotected void drawHorizontalReferenceLines()
protected void drawVerticalReferenceLines()
protected void calculateGraphArea()
protected void drawBackground()
protected void drawGraphArea()
protected void processScaledValue(int index,
double valueX,
double valueY,
double scaledX,
double scaledY)
protected void drawValueLine(org.epics.util.array.ListNumber xValues,
org.epics.util.array.ListNumber yValues,
InterpolationScheme interpolation)
xValues - the x valuesyValues - the y valuesinterpolation - the interpolation schemeprotected void drawValueExplicitLine(org.epics.util.array.ListNumber xValues,
org.epics.util.array.ListNumber yValues,
InterpolationScheme interpolation,
ReductionScheme reduction)
xValues - the x valuesyValues - the y valuesinterpolation - the interpolationreduction - the reductionprotected final double scaledX(double value)
value - the x valueprotected final double scaledY(double value)
value - the y valueprotected void setClip(Graphics2D g)
g - the graphics contextprotected void drawYLabels()
protected void drawXLabels()
Copyright © 2012-2013 Brookhaven National Laboratory, University of Michigan. All Rights Reserved.