|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.monitorenter.gui.chart.axis.AAxis.AChart2DDataAccessor
info.monitorenter.gui.chart.axis.AAxis.XDataAccessor
public class AAxis.XDataAccessor
An accessor for the x axis of a chart.
Chart2D.getAxisX()
,
Serialized FormField Summary |
---|
Fields inherited from class info.monitorenter.gui.chart.axis.AAxis.AChart2DDataAccessor |
---|
m_chart, m_rangePolicy |
Constructor Summary | |
---|---|
AAxis.XDataAccessor(Chart2D chart)
Creates an instance that accesses the given chart's x axis. |
Method Summary | |
---|---|
int |
getDimension()
Returns the constant for the dimension that is accessed on the chart. |
int |
getHeight(Graphics2D g2d)
Returns the height in pixel the corresponding axis needs to paint itself. |
protected double |
getMax()
Returns the maximum value from the Chart2D's axis (X or Y) this instance is standing for with respect to the installed range policy. |
double |
getMaxFromAxis()
|
protected double |
getMaximumPixelForLabel(Graphics g2d)
Returns the maximum pixels that will be needed to paint a label. |
protected double |
getMin()
|
double |
getMinFromAxis()
|
protected double |
getMinimumValueDistanceForLabels(Graphics g2d)
Returns the minimum amount of increase in the value that will be needed to display all labels without overwriting each others. |
protected int |
getPixelRange()
Returns the amount of pixel avalable for displaying the values on the chart in the dimension this accessor stands for. |
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(Graphics2D g2d)
Returns the width in pixel the corresponding axis needs to paint itself. |
protected void |
scale()
Scales all instances in the dimension represented by this
axis. |
protected void |
scaleTrace(ITrace2D trace,
Range range)
Scales the given trace in the dimension represented by this axis. |
String |
toString()
Returns "X". |
double |
translateMousePosition(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, getRangePolicy, setRangePolicy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AAxis.XDataAccessor(Chart2D chart)
chart
- the chart to access.Method Detail |
---|
public 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 int getHeight(Graphics2D 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.Graphics2D)
protected final double getMax()
AAxis.AChart2DDataAccessor
getMax
in class AAxis.AChart2DDataAccessor
AAxis.AChart2DDataAccessor.getMax()
public final double getMaxFromAxis()
getMaxFromAxis
in class AAxis.AChart2DDataAccessor
AAxis.AChart2DDataAccessor.getMaxFromAxis()
protected final double getMaximumPixelForLabel(Graphics g2d)
AAxis.AChart2DDataAccessor
getMaximumPixelForLabel
in class AAxis.AChart2DDataAccessor
g2d
- provides information about the graphics context to paint on (e.g. font size).
AAxis.AChart2DDataAccessor.getMaximumPixelForLabel(Graphics)
protected final double getMin()
getMin
in class AAxis.AChart2DDataAccessor
AAxis.AChart2DDataAccessor.getMin()
public final double getMinFromAxis()
getMinFromAxis
in class AAxis.AChart2DDataAccessor
AAxis.AChart2DDataAccessor.getMinFromAxis()
protected final double getMinimumValueDistanceForLabels(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(java.awt.Graphics)
protected int getPixelRange()
AAxis.AChart2DDataAccessor
This method must not be called within the first lines of a paint cycle (neccessary underlying values then are computed new).
getPixelRange
in class AAxis.AChart2DDataAccessor
AAxis.AChart2DDataAccessor.getPixelRange()
protected final double getValueDistanceForPixel(int pixel)
AAxis.AChart2DDataAccessor
Returns the value distance on the current chart that exists for the given amount of pixel
distance in the given direction of this 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 addes
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 scalepoints of the x- axis in pixel.
AAxis.AChart2DDataAccessor.getValueDistanceForPixel(int)
public int getWidth(Graphics2D 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.Graphics2D)
protected final void scale()
AAxis.AChart2DDataAccessor
ITrace2D
instances in the dimension represented by this
axis.
This method is not deadlock - safe and should be called by the
only!
Chart2D
scale
in class AAxis.AChart2DDataAccessor
AAxis.AChart2DDataAccessor.scale()
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 String toString()
toString
in class Object
public final double translateMousePosition(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 All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |