|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.monitorenter.gui.chart.axis.AAxis.AChart2DDataAccessor info.monitorenter.gui.chart.axis.AAxis.YDataAccessor
protected class AAxis.YDataAccessor
Accesses the y axis of the Chart2D
.
AAxis.setAccessor(info.monitorenter.gui.chart.axis.AAxis.AChart2DDataAccessor)
,
Chart2D.getAxisY()
,
Serialized FormField Summary |
---|
Fields inherited from class info.monitorenter.gui.chart.axis.AAxis.AChart2DDataAccessor |
---|
m_chart |
Constructor Summary | |
---|---|
AAxis.YDataAccessor(Chart2D chart)
Creates an instance that accesses the y axis of the given chart. |
Method Summary | |
---|---|
int |
getDimension()
Returns the constant for the dimension that is accessed on the chart. |
int |
getHeight(java.awt.Graphics g2d)
Returns the height in pixel the corresponding axis needs to paint itself. |
protected double |
getMaximumPixelForLabel(java.awt.Graphics g2d)
Returns the maximum pixels that will be needed to paint a label. |
protected double |
getMaxValue(ITrace2D trace)
Returns the max value of the given trace according to the dimension the outer axis belongs to. |
double |
getMinimumValueDistanceForLabels(java.awt.Graphics g2d)
Returns the minimum amount of increase in the value that will be needed to display all labels without overwriting each others. |
protected double |
getMinValue(ITrace2D trace)
Returns the min value of the given trace according to the dimension the outer axis belongs to. |
protected int |
getPixelRange()
Returns the amount of pixel available for displaying the values on the chart in the dimension this accessor stands for. |
protected double |
getValue(ITracePoint2D point)
Returns the value of the given point according to the dimension the outer axis belongs to. |
protected double |
getValueDistanceForPixel(int pixel)
Returns the value distance on the current chart that exists for the given amount of pixel distance in the given direction of this AAxis . |
int |
getWidth(java.awt.Graphics g2d)
Returns the width in pixel the corresponding axis needs to paint itself. |
protected void |
scaleTrace(ITrace2D trace,
Range range)
Scales the given trace in the dimension represented by this axis. |
java.lang.String |
toString()
Returns "Y". |
double |
translateMousePosition(java.awt.event.MouseEvent mouseEvent)
Returns the translation of the mouse event coordinates of the given mouse event to the value within the chart for the dimension (x,y) covered by this axis. |
double |
translatePxToValue(int pixel)
Transforms the given pixel value (which has to be a awt value like MouseEvent.getX() into the chart value. |
int |
translateValueToPx(double value)
Transforms the given chart data value into the corresponding awt pixel value for the chart. |
Methods inherited from class info.monitorenter.gui.chart.axis.AAxis.AChart2DDataAccessor |
---|
getChart |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AAxis.YDataAccessor(Chart2D chart)
chart
- the chart to access.Method Detail |
---|
public final int getDimension()
AAxis.AChart2DDataAccessor
getDimension
in class AAxis.AChart2DDataAccessor
Chart2D.X
, Chart2D.Y
or -1 if this axis is not
assigned to a chart.AAxis.AChart2DDataAccessor.getDimension()
public final int getHeight(java.awt.Graphics g2d)
AAxis.AChart2DDataAccessor
This includes the axis line, it's ticks and labels and it's title.
getHeight
in class AAxis.AChart2DDataAccessor
g2d
- needed for font metric information.
AAxis.AChart2DDataAccessor.getHeight(java.awt.Graphics)
protected final double getMaximumPixelForLabel(java.awt.Graphics g2d)
AAxis.AChart2DDataAccessor
getMaximumPixelForLabel
in class AAxis.AChart2DDataAccessor
g2d
- the current graphic context to use in case further information
is required.
AAxis.AChart2DDataAccessor.getMaximumPixelForLabel(Graphics)
protected double getMaxValue(ITrace2D trace)
AAxis.AChart2DDataAccessor
This is either an x or an y value depending on the dimension the outer axis is working in.
getMaxValue
in class AAxis.AChart2DDataAccessor
trace
- the trace to read the maximum of.
AAxis.AChart2DDataAccessor.getMaxValue(info.monitorenter.gui.chart.ITrace2D)
public final double getMinimumValueDistanceForLabels(java.awt.Graphics g2d)
AAxis.AChart2DDataAccessor
This procedure needs the amount of pixels needed by the largest possible
label and relies on the implementation of
AAxis.AChart2DDataAccessor.getMaximumPixelForLabel(Graphics)
, whose result is multiplied
with the "value per pixel" quantifier.
getMinimumValueDistanceForLabels
in class AAxis.AChart2DDataAccessor
g2d
- the current graphic context to use in case further information
is required.
AAxis.AChart2DDataAccessor.getMinimumValueDistanceForLabels(Graphics)
protected double getMinValue(ITrace2D trace)
AAxis.AChart2DDataAccessor
This is either an x or an y value depending on the dimension the outer axis is working in.
getMinValue
in class AAxis.AChart2DDataAccessor
trace
- the trace to read the maximum of.
AAxis.AChart2DDataAccessor.getMinValue(info.monitorenter.gui.chart.ITrace2D)
protected final int getPixelRange()
AAxis.AChart2DDataAccessor
This method must not be called within the first lines of a paint cycle (necessary underlying values then are computed new).
getPixelRange
in class AAxis.AChart2DDataAccessor
AAxis.AChart2DDataAccessor.getPixelRange()
protected double getValue(ITracePoint2D point)
AAxis.AChart2DDataAccessor
This is either
or
ITracePoint2D.getX()
.
ITracePoint2D.getY()
getValue
in class AAxis.AChart2DDataAccessor
point
- the point to read ITracePoint2D.getX()
or
ITracePoint2D.getY()
from.
AAxis.AChart2DDataAccessor.getValue(info.monitorenter.gui.chart.ITracePoint2D)
protected final double getValueDistanceForPixel(int pixel)
AAxis.AChart2DDataAccessor
AAxis
.
Depending on the width of the actual Chart2D and the contained values,
the relation between displayed distances (pixel) and value distances (the
values of the added
instances
changes.
ITrace2D
This method calculates depending on the actual painting area of the
Chart2D, the shift in value between two points that have a screen
distance of the given pixel.
This method is not used by the chart itself but a helper for outside use.
getValueDistanceForPixel
in class AAxis.AChart2DDataAccessor
pixel
- The desired distance between to scale points of the x- axis in
pixel.
AAxis.AChart2DDataAccessor.getValueDistanceForPixel(int)
public final int getWidth(java.awt.Graphics g2d)
AAxis.AChart2DDataAccessor
This includes the axis line, it's ticks and labels and it's title.
getWidth
in class AAxis.AChart2DDataAccessor
g2d
- needed for font metric information.
AAxis.AChart2DDataAccessor.getWidth(java.awt.Graphics)
protected void scaleTrace(ITrace2D trace, Range range)
AAxis.AChart2DDataAccessor
This method is not deadlock - safe and should be called by the
only!
Chart2D
scaleTrace
in class AAxis.AChart2DDataAccessor
trace
- the trace to scale.range
- the range to use as scaler.AAxis.AChart2DDataAccessor.scaleTrace(info.monitorenter.gui.chart.ITrace2D,
info.monitorenter.util.Range)
public java.lang.String toString()
toString
in class java.lang.Object
public double translateMousePosition(java.awt.event.MouseEvent mouseEvent)
AAxis.AChart2DDataAccessor
Note that the mouse event has to be an event fired on this component!
translateMousePosition
in class AAxis.AChart2DDataAccessor
mouseEvent
- a mouse event that has been fired on this component.
AAxis.AChart2DDataAccessor.translateMousePosition(java.awt.event.MouseEvent)
public double translatePxToValue(int pixel)
AAxis.AChart2DDataAccessor
MouseEvent.getX()
into the chart value.
Internal use only, the interface does not guarantee that the pixel corresponds to any valid awt pixel value within the chart component.
Warning: A value transformed to a pixel by
AAxis.AChart2DDataAccessor.translateValueToPx(double)
and then retransformed by
AAxis.AChart2DDataAccessor.translatePxToValue(int)
will most often have changed, as the
transformation from value to px a) has to hit an exact int b) most often
will map from a bigger domain (value range) to a smaller one (range of
chart on the screen).
translatePxToValue
in class AAxis.AChart2DDataAccessor
pixel
- a pixel value of the chart component as used by awt.
AAxis.AChart2DDataAccessor.translatePxToValue(int)
public int translateValueToPx(double value)
AAxis.AChart2DDataAccessor
The inverse transformation to AAxis.AChart2DDataAccessor.translatePxToValue(int)
.
translateValueToPx
in class AAxis.AChart2DDataAccessor
value
- a chart data value.
AAxis.AChart2DDataAccessor.translateValueToPx(double)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |