fr.esrf.tangoatk.widget.util.chart
Class JLAxis

java.lang.Object
  extended by fr.esrf.tangoatk.widget.util.chart.JLAxis
All Implemented Interfaces:
java.io.Serializable

public class JLAxis
extends java.lang.Object
implements java.io.Serializable

Class which handles chart axis.

See Also:
Serialized Form

Field Summary
static int AUTO_FORMAT
          Use default compiler format to display double
static int BININT_FORMAT
          Display integer using binary format
static int DATE_FORMAT
          Display value as date
static int DECINT_FORMAT
          Display integer using decimal format
static java.lang.String FR_DATE_FORMAT
          French date format to format labels as dates
static int HEXINT_FORMAT
          Display integer using haxadecimal format
static int HORIZONTAL_DOWN
          Horizontal axis at bottom of the chart
static int HORIZONTAL_ORG1
          Horizontal axis at 0 position (on Y1)
static int HORIZONTAL_ORG2
          Horizontal axis at 0 position (on Y2)
static int HORIZONTAL_UP
          Horizontal axis at top of the chart
static int LINEAR_SCALE
          Use linear scale for this axis
static int LOG_SCALE
          Use logarithmic scale for this axis
static int SCIENTIFIC_FORMAT
          Display value using exponential representation (x.xxEyy)
static int SCIENTIFICINT_FORMAT
          Display value using exponential representation (xEyy)
static int TIME_ANNO
          Draw time annotation for x axis.
static int TIME_FORMAT
          Display number of second as HH:MM:SS
static java.lang.String US_DATE_FORMAT
          US date format to format labels as dates
static int VALUE_ANNO
          Draw formated annotation
static int VERTICAL_LEFT
          Vertical left axis
static int VERTICAL_ORG
          Vertical axis at X=0
static int VERTICAL_RIGHT
          Vertical right axis
 
Constructor Summary
JLAxis(javax.swing.JComponent parent, int orientation)
          Axis constructor (Expert usage).
 
Method Summary
 void addDataView(JLDataView v)
          Displays a DataView on this axis.
 void addDataViewAt(int index, JLDataView v)
          Add the given dataView at the specifed index.
 void applyConfiguration(java.lang.String prefix, CfFileReader f)
          Apply axis configuration.
 boolean checkRemoveDataView(JLDataView v)
          Removes dataview from this axis and returns true if the dataview has been found for this Axis
 void clearDataView()
          Clear all dataview from this axis
 java.awt.Color computeMediumColor(java.awt.Color c1, java.awt.Color c2)
          Compute the medium color of c1,c2
 void computeXScale(java.util.Vector views)
          Expert usage.
 void drawFast(java.awt.Graphics g, java.awt.Point lp, java.awt.Point p, JLDataView v)
          Expert Usage.
static void drawSampleLine(java.awt.Graphics g, int x, int y, JLDataView v)
          Expert usage.
static java.lang.String formatTimeValue(double vt)
          Returns a representation of the double in time format "EEE, d MMM yyyy HH:mm:ss".
 java.lang.String formatValue(double vt, double prec)
          Returns a representation of the double acording to the format
 int getAnnotation()
          Returns the annotation method
 java.lang.String getAxeName()
          Gets the axis label.
 java.awt.Color getAxisColor()
          Returns the axis color.
 java.awt.Rectangle getBoundRect()
          Returns the bouding rectangle of this axis.
 java.lang.String getConfiguration(java.lang.String prefix)
          Builds a configuration string that can be write into a file and is compatible with CfFileReader.
 JLDataView getDataView(int index)
          Get the dataView of this axis at the specified index.
 java.lang.String getDateFormat()
           
 java.awt.Font getFont()
          Gets the label font
 int getFontHeight(java.awt.Graphics g)
          Deprecated. Use getLabelFontDimension() instead
 int getFontOverWidth()
           
 int getGridStyle()
          Returns the current grid style.
static java.lang.String getHelpString()
           
 int getLabelFontDimension(java.awt.font.FontRenderContext frc)
          Expert usage.
 int getLabelFormat()
          Returns the axis label format.
 int getLength()
          Expert usage.
 double getMax()
          Expert usage.
 double getMaximum()
          Gets maximum axis value
 double getMin()
          Expert usage.
 double getMinimum()
          Gets minimum axis value
 java.lang.String getName()
          Gets the axis label.
 int getOrientation()
          Returns the orientation of this axis.
 double getPercentScrollback()
          Gets the percent scrollback
 int getScale()
          Gets the scale mdoe for this axis.
 int getThickness()
          Expert usage.
 int getTick()
          Deprecated. Use getTickSpacing
 int getTickLength()
          Returns the tick length (in pixel).
 double getTickSpacing()
          Returns the current minimum tick spacing (in pixel).
 int getViewNumber()
          Returns the number if dataview in this axis.
 java.util.Vector<JLDataView> getViews()
          Gets all dataViews displayed on this axis.
 boolean isAutoScale()
          Determines whether the axis is autoscaled.
 boolean isDrawOpposite()
          Determines whether the axis at the opposite side is visible
 boolean isFitXAxisToDisplayDuration()
          Return true if the x axis fit to display duration.
 boolean isGridVisible()
          Determines whether the axis is showing the grid
 boolean isInverted()
          Returns true if this axis is inverted.
 boolean isSubGridVisible()
          Determines whether the axis is showing the sub grid
 boolean isVisible()
          Returns true if the axis is visble, false otherwise
 boolean isXY()
          Determines whether the axis is in XY mode.
 boolean isZeroAlwaysVisible()
          Allaws user to know if the 0 value will always be visible in case of auto scale
 boolean isZoomed()
          Determines whether the axis is zoomed.
 void measureAxis(java.awt.font.FontRenderContext frc, int desiredWidth, int desiredHeight)
          Expert usage.
 void paintAxisDirect(java.awt.Graphics g, java.awt.font.FontRenderContext frc, int x0, int y0, java.awt.Color back, int tr, int la)
          Paint this axis.
 void paintAxisOpposite(java.awt.Graphics g, java.awt.font.FontRenderContext frc, int x0, int y0, java.awt.Color back, int tr, int la)
           
 void paintAxisOppositeDouble(java.awt.Graphics g, java.awt.font.FontRenderContext frc, int x0, int y0, java.awt.Color back, int tr, int la)
           
static void paintMarker(java.awt.Graphics g, int mType, int mSize, int x, int y)
          Expert usage.
 void removeDataView(JLDataView v)
          Removes dataview from this axis
 SearchInfo searchNearest(int x, int y, JLAxis xAxis)
          Search the nearest point in the dataViews.
 SearchInfo searchNearestNormal(int x, int y, JLAxis xAxis)
          Expert usage.
 SearchInfo searchNearestXY(int x, int y, JLAxis xAxis)
          Expert usage.
 void setAnnotation(int a)
          Set the annotation method
 void setAutoScale(boolean b)
          Sets the autoscale mode for this axis.
 void setAxeName(java.lang.String s)
          Sets the axis name.
 void setAxisColor(java.awt.Color c)
          Sets the axis color.
 void setAxisDuration(double d)
          Expert usage.
 void setDateFormat(java.lang.String dateFormat)
          Sets date format chen chosen label format is DATE_FORMAT
 void setDrawOpposite(boolean b)
          Draw a second axis at the opposite side.
 void setFitXAxisToDisplayDuration(boolean b)
          Fit the x axis to display duration (Horizontal axis only).
 void setFont(java.awt.Font f)
          Sets the label font
 void setGridStyle(int s)
          Sets the grid style.
 void setGridVisible(boolean b)
          Shows the grid.
 void setInverted(boolean i)
          Invert this axis.
 void setLabelFormat(int l)
          Sets the axis label format.
 void setLabels(java.lang.String[] labels, double[] labelPos)
          Customize axis labels.
 void setMaximum(double d)
          Sets maximum axis value.
 void setMinimum(double d)
          Sets minimum axis value.
 void setName(java.lang.String s)
          Sets the axis label.
 void setOrientation(int orientation)
          Sets the axis orientation and reset position.
 void setPercentScrollback(double d)
          Sets the percent scrollback.
 void setPosition(int o)
          Sets the axis position
 void setScale(int s)
          Sets scale mode
 void setSubGridVisible(boolean b)
          Shows the sub grid.
 void setTick(int s)
          Deprecated. Use setTickSpacing
 void setTickLength(int lgth)
          Sets the tick length (in pixel).
 void setTickSpacing(double spacing)
          Sets the minimum tick spacing (in pixel).
 void setVisible(boolean b)
          Display or hide the axis.
 void setZeroAlwaysVisible(boolean zeroAlwaysVisible)
          Sets if 0 must always be visible in case of auto scale or not
 java.lang.String toScientific(double d)
          Return a scientific (exponential) representation of the double.
 java.lang.String toScientificInt(double d)
           
 java.awt.Point transform(double x, double y, JLAxis xAxis)
          Expert usage.
 void unzoom()
          Unzoom the axis and restores last state.
 void zoom(int x1, int x2)
          Zoom axis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL_DOWN

public static final int HORIZONTAL_DOWN
Horizontal axis at bottom of the chart

See Also:
Constant Field Values

HORIZONTAL_UP

public static final int HORIZONTAL_UP
Horizontal axis at top of the chart

See Also:
Constant Field Values

HORIZONTAL_ORG1

public static final int HORIZONTAL_ORG1
Horizontal axis at 0 position (on Y1)

See Also:
Constant Field Values

HORIZONTAL_ORG2

public static final int HORIZONTAL_ORG2
Horizontal axis at 0 position (on Y2)

See Also:
Constant Field Values

VERTICAL_RIGHT

public static final int VERTICAL_RIGHT
Vertical right axis

See Also:
Constant Field Values

VERTICAL_LEFT

public static final int VERTICAL_LEFT
Vertical left axis

See Also:
Constant Field Values

VERTICAL_ORG

public static final int VERTICAL_ORG
Vertical axis at X=0

See Also:
Constant Field Values

TIME_ANNO

public static final int TIME_ANNO
Draw time annotation for x axis.

See Also:
Constant Field Values

VALUE_ANNO

public static final int VALUE_ANNO
Draw formated annotation

See Also:
Constant Field Values

LINEAR_SCALE

public static final int LINEAR_SCALE
Use linear scale for this axis

See Also:
Constant Field Values

LOG_SCALE

public static final int LOG_SCALE
Use logarithmic scale for this axis

See Also:
Constant Field Values

AUTO_FORMAT

public static final int AUTO_FORMAT
Use default compiler format to display double

See Also:
Constant Field Values

SCIENTIFIC_FORMAT

public static final int SCIENTIFIC_FORMAT
Display value using exponential representation (x.xxEyy)

See Also:
Constant Field Values

TIME_FORMAT

public static final int TIME_FORMAT
Display number of second as HH:MM:SS

See Also:
Constant Field Values

DECINT_FORMAT

public static final int DECINT_FORMAT
Display integer using decimal format

See Also:
Constant Field Values

HEXINT_FORMAT

public static final int HEXINT_FORMAT
Display integer using haxadecimal format

See Also:
Constant Field Values

BININT_FORMAT

public static final int BININT_FORMAT
Display integer using binary format

See Also:
Constant Field Values

SCIENTIFICINT_FORMAT

public static final int SCIENTIFICINT_FORMAT
Display value using exponential representation (xEyy)

See Also:
Constant Field Values

DATE_FORMAT

public static final int DATE_FORMAT
Display value as date

See Also:
Constant Field Values

US_DATE_FORMAT

public static final java.lang.String US_DATE_FORMAT
US date format to format labels as dates

See Also:
Constant Field Values

FR_DATE_FORMAT

public static final java.lang.String FR_DATE_FORMAT
French date format to format labels as dates

See Also:
Constant Field Values
Constructor Detail

JLAxis

public JLAxis(javax.swing.JComponent parent,
              int orientation)
Axis constructor (Expert usage).

Parameters:
orientation - Default Axis placement (cannot be ..._ORG).
parent - (deprecated, not used).
See Also:
HORIZONTAL_DOWN, HORIZONTAL_UP, VERTICAL_LEFT, VERTICAL_RIGHT, setPosition(int)
Method Detail

getHelpString

public static java.lang.String getHelpString()

setPercentScrollback

public void setPercentScrollback(double d)
Sets the percent scrollback. When using JLChart.addData and TIME_ANNO mode for the horizontal axis this property allows to avoid a full graph repaint for every new data entered.

Parameters:
d - Scrollback percent [0..100]

getPercentScrollback

public double getPercentScrollback()
Gets the percent scrollback

Returns:
scrollback percent

setAxisColor

public void setAxisColor(java.awt.Color c)
Sets the axis color.

Parameters:
c - Axis color
See Also:
getAxisColor()

getAxisColor

public java.awt.Color getAxisColor()
Returns the axis color.

Returns:
Axis color
See Also:
setAxisColor(java.awt.Color)

setLabelFormat

public void setLabelFormat(int l)
Sets the axis label format.

Parameters:
l - Format of values displayed on axis and in tooltips.
See Also:
AUTO_FORMAT, SCIENTIFIC_FORMAT, TIME_FORMAT, DECINT_FORMAT, HEXINT_FORMAT, BININT_FORMAT, SCIENTIFICINT_FORMAT, DATE_FORMAT, getLabelFormat()

getLabelFormat

public int getLabelFormat()
Returns the axis label format.

Returns:
Axis value format
See Also:
setLabelFormat(int)

setGridVisible

public void setGridVisible(boolean b)
Shows the grid.

Parameters:
b - true to make the grid visible; false to hide it
See Also:
isGridVisible()

setFitXAxisToDisplayDuration

public void setFitXAxisToDisplayDuration(boolean b)
Fit the x axis to display duration (Horizontal axis only).

Parameters:
b - true to fit x axis false otherwise

isFitXAxisToDisplayDuration

public boolean isFitXAxisToDisplayDuration()
Return true if the x axis fit to display duration.


isGridVisible

public boolean isGridVisible()
Determines whether the axis is showing the grid

Returns:
true if the grid is visible, false otherwise
See Also:
setGridVisible(boolean)

setDrawOpposite

public void setDrawOpposite(boolean b)
Draw a second axis at the opposite side.

Parameters:
b - true to enable the opposite axis.

isDrawOpposite

public boolean isDrawOpposite()
Determines whether the axis at the opposite side is visible

Returns:
true if opposite axis is visible.
See Also:
setDrawOpposite(boolean)

setSubGridVisible

public void setSubGridVisible(boolean b)
Shows the sub grid. More accurate grid displayed with a soft color.

Parameters:
b - true to make the subgrid visible; false to hide it
See Also:
isSubGridVisible()

isSubGridVisible

public boolean isSubGridVisible()
Determines whether the axis is showing the sub grid

Returns:
true if the subgrid is visible, false otherwise
See Also:
setSubGridVisible(boolean)

setGridStyle

public void setGridStyle(int s)
Sets the grid style.

Parameters:
s - Style of the grid. Can be one of the following:
See Also:
JLDataView.STYLE_SOLID, JLDataView.STYLE_DOT, JLDataView.STYLE_DASH, JLDataView.STYLE_LONG_DASH, JLDataView.STYLE_DASH_DOT, getGridStyle()

getGridStyle

public int getGridStyle()
Returns the current grid style.

Returns:
the current grid style
See Also:
setGridStyle(int)

setFont

public void setFont(java.awt.Font f)
Sets the label font

Parameters:
f - Sets the font for this components
See Also:
getFont()

getFont

public java.awt.Font getFont()
Gets the label font

Returns:
The current label font
See Also:
setFont(java.awt.Font)

setAnnotation

public void setAnnotation(int a)
Set the annotation method

Parameters:
a - Annotation for this axis
See Also:
TIME_ANNO, VALUE_ANNO

getAnnotation

public int getAnnotation()
Returns the annotation method

See Also:
setAnnotation(int)

setVisible

public void setVisible(boolean b)
Display or hide the axis.

Parameters:
b - True to make the axis visible.

isVisible

public boolean isVisible()
Returns true if the axis is visble, false otherwise


isZoomed

public boolean isZoomed()
Determines whether the axis is zoomed.

Returns:
true if the axis is zoomed, false otherwise
See Also:
zoom(int, int)

isXY

public boolean isXY()
Determines whether the axis is in XY mode. Use only with HORIZONTAL axis.

Returns:
true if the axis is in XY mode, false otherwise
See Also:
addDataView(fr.esrf.tangoatk.widget.util.chart.JLDataView)

setMinimum

public void setMinimum(double d)
Sets minimum axis value. This value is ignored when using autoscale.

Parameters:
d - Minimum value for this axis. Must be strictly positive for LOG_SCALE.
See Also:
getMinimum()

getMinimum

public double getMinimum()
Gets minimum axis value

Returns:
The minimum value for this axis.
See Also:
setMinimum(double)

setMaximum

public void setMaximum(double d)
Sets maximum axis value. This value is ignored when using autoscale.

Parameters:
d - Maximum value for this axis. Must be strictly positive for LOG_SCALE.
See Also:
getMaximum()

getMaximum

public double getMaximum()
Gets maximum axis value

Returns:
The maximum value for this axis.
See Also:
setMaximum(double)

getMin

public double getMin()
Expert usage. Get minimum axis value (according to auto scale transformation).

Returns:
The minimum value for this axis.

getMax

public double getMax()
Expert usage. Get maximum axis value (according to auto scale transformation).

Returns:
The maximum value for this axis.

isAutoScale

public boolean isAutoScale()
Determines whether the axis is autoscaled.

Returns:
true if the axis is autoscaled, false otherwise
See Also:
setAutoScale(boolean)

setAutoScale

public void setAutoScale(boolean b)
Sets the autoscale mode for this axis.

Parameters:
b - true if the axis is autoscaled, false otherwise
See Also:
isAutoScale()

getScale

public int getScale()
Gets the scale mdoe for this axis.

Returns:
scale mdoe
See Also:
setScale(int)

setScale

public void setScale(int s)
Sets scale mode

Parameters:
s - Scale mode for this axis
See Also:
LINEAR_SCALE, LOG_SCALE, getScale()

setOrientation

public void setOrientation(int orientation)
Sets the axis orientation and reset position.

Parameters:
orientation - Orientation value
See Also:
HORIZONTAL_DOWN, HORIZONTAL_UP, VERTICAL_LEFT, VERTICAL_RIGHT, setPosition(int)

getOrientation

public int getOrientation()
Returns the orientation of this axis.

See Also:
setOrientation(int)

zoom

public void zoom(int x1,
                 int x2)
Zoom axis.

Parameters:
x1 - New minimum value for this axis
x2 - New maximum value for this axis
See Also:
isZoomed, unzoom()

unzoom

public void unzoom()
Unzoom the axis and restores last state.

See Also:
isZoomed, unzoom()

getTick

public int getTick()
Deprecated. Use getTickSpacing

See Also:
getTickSpacing()

getTickSpacing

public double getTickSpacing()
Returns the current minimum tick spacing (in pixel).


setTickSpacing

public void setTickSpacing(double spacing)
Sets the minimum tick spacing (in pixel). Allows to control the number of generated labels.

Parameters:
spacing - Minimum tick spacing

setTick

public void setTick(int s)
Deprecated. Use setTickSpacing

See Also:
setTickSpacing(double)

setTickLength

public void setTickLength(int lgth)
Sets the tick length (in pixel).

Parameters:
lgth - Length

getTickLength

public int getTickLength()
Returns the tick length (in pixel).


getName

public java.lang.String getName()
Gets the axis label.

Returns:
Axis name.
See Also:
setName(java.lang.String)

setName

public void setName(java.lang.String s)
Sets the axis label. Label is displayed along or above the axis.

Parameters:
s - Name of this axis.
See Also:
getName()

setPosition

public void setPosition(int o)
Sets the axis position

Parameters:
o - Axis position
See Also:
VERTICAL_LEFT, VERTICAL_RIGHT, VERTICAL_ORG, HORIZONTAL_DOWN, HORIZONTAL_UP, HORIZONTAL_ORG1, HORIZONTAL_ORG2

getAxeName

public java.lang.String getAxeName()
Gets the axis label.

Returns:
Axis name.
See Also:
setAxeName(java.lang.String)

setAxeName

public void setAxeName(java.lang.String s)
Sets the axis name. Name is displayed in tooltips when clicking on the graph.

Parameters:
s - Name of this axis.
See Also:
getName()

addDataView

public void addDataView(JLDataView v)
Displays a DataView on this axis. The graph switches in XY monitoring mode when adding a dataView to X axis. Only one view is allowed on HORIZONTAL Axis. In case of a view plotted along this horizontal axis doesn't have the same number of point as this x view, points are correlated according to their x values.

Parameters:
v - The dataview to map along this axis.
See Also:
removeDataView(fr.esrf.tangoatk.widget.util.chart.JLDataView), clearDataView(), getViews()

addDataViewAt

public void addDataViewAt(int index,
                          JLDataView v)
Add the given dataView at the specifed index.

Parameters:
index - Insertion position
v - DataView to add
See Also:
addDataView(fr.esrf.tangoatk.widget.util.chart.JLDataView)

getDataView

public JLDataView getDataView(int index)
Get the dataView of this axis at the specified index.

Parameters:
index - DataView index
Returns:
Null if index out of bounds.

removeDataView

public void removeDataView(JLDataView v)
Removes dataview from this axis

Parameters:
v - dataView to remove from this axis.
See Also:
addDataView(fr.esrf.tangoatk.widget.util.chart.JLDataView), clearDataView(), getViews()

checkRemoveDataView

public boolean checkRemoveDataView(JLDataView v)
Removes dataview from this axis and returns true if the dataview has been found for this Axis

Parameters:
v - dataView to remove from this axis.
Returns:
true if Axis contained the dataview and false if this dataview did not belong to the axis
See Also:
addDataView(fr.esrf.tangoatk.widget.util.chart.JLDataView), clearDataView(), getViews()

clearDataView

public void clearDataView()
Clear all dataview from this axis

See Also:
removeDataView(fr.esrf.tangoatk.widget.util.chart.JLDataView), addDataView(fr.esrf.tangoatk.widget.util.chart.JLDataView), getViews()

getViews

public java.util.Vector<JLDataView> getViews()
Gets all dataViews displayed on this axis. Do not modify the returned vector (Use as read only).

Returns:
Vector of JLDataView.
See Also:
addDataView(fr.esrf.tangoatk.widget.util.chart.JLDataView), removeDataView(fr.esrf.tangoatk.widget.util.chart.JLDataView), clearDataView()

getViewNumber

public int getViewNumber()
Returns the number if dataview in this axis.

Returns:
DataView number.

setInverted

public void setInverted(boolean i)
Invert this axis.

Parameters:
i - true to invert the axis

isInverted

public boolean isInverted()
Returns true if this axis is inverted.


getBoundRect

public java.awt.Rectangle getBoundRect()
Returns the bouding rectangle of this axis.

Returns:
The bounding rectangle

toScientific

public java.lang.String toScientific(double d)
Return a scientific (exponential) representation of the double.

Parameters:
d - double to convert
Returns:
A string continaing a scientific representation of the given double.

toScientificInt

public java.lang.String toScientificInt(double d)

formatTimeValue

public static java.lang.String formatTimeValue(double vt)
Returns a representation of the double in time format "EEE, d MMM yyyy HH:mm:ss".

Parameters:
vt - number of millisec since epoch
Returns:
A string continaing a time representation of the given double.

setLabels

public void setLabels(java.lang.String[] labels,
                      double[] labelPos)
Customize axis labels.

Parameters:
labels - Label values
labelPos - Label positions (in axis coordinates)

formatValue

public java.lang.String formatValue(double vt,
                                    double prec)
Returns a representation of the double acording to the format

Parameters:
vt - double to convert
prec - Desired precision (Pass 0 to not perform prec rounding).
Returns:
A string continaing a formated representation of the given double.

setAxisDuration

public void setAxisDuration(double d)
Expert usage. Sets the preferred scale for time axis (HORIZONTAL axis only)

Parameters:
d - Duration (millisec)

computeXScale

public void computeXScale(java.util.Vector views)
Expert usage. Compute X auto scale (HORIZONTAL axis only)

Parameters:
views - All views displayed along all Y axis.

getFontHeight

public int getFontHeight(java.awt.Graphics g)
Deprecated. Use getLabelFontDimension() instead


getLabelFontDimension

public int getLabelFontDimension(java.awt.font.FontRenderContext frc)
Expert usage.

Returns:
Axis font dimension.

getFontOverWidth

public int getFontOverWidth()

getThickness

public int getThickness()
Expert usage. Returns axis tichkness in pixel ( shorter side )

Returns:
Axis tichkness
See Also:
getLength()

getLength

public int getLength()
Expert usage. Returns axis lenght in pixel ( larger side ).

Returns:
Axis lenght.
See Also:
getThickness()

measureAxis

public void measureAxis(java.awt.font.FontRenderContext frc,
                        int desiredWidth,
                        int desiredHeight)
Expert usage. Computes labels and measures axis dimension.

Parameters:
frc - Font render context
desiredWidth - Desired width
desiredHeight - Desired height

transform

public java.awt.Point transform(double x,
                                double y,
                                JLAxis xAxis)
Expert usage. Transfrom given coordinates (real space) into pixel coordinates

Parameters:
x - The x coordinates (Real space)
y - The y coordinates (Real space)
xAxis - The axis corresponding to x coordinates.
Returns:
Point(-100,-100) when cannot transform

searchNearestNormal

public SearchInfo searchNearestNormal(int x,
                                      int y,
                                      JLAxis xAxis)
Expert usage. Search the nearest point in the dataViews in normal monitoring mode

Parameters:
x - The x coordinates (Real space)
y - The y coorsinates (Real space)
xAxis - The axis corresponding to x coordinates.
Returns:
A structure containing search result.
See Also:
searchNearestXY(int, int, fr.esrf.tangoatk.widget.util.chart.JLAxis)

searchNearestXY

public SearchInfo searchNearestXY(int x,
                                  int y,
                                  JLAxis xAxis)
Expert usage. Search the nearest point in the dataViews in XY monitoring mode

Parameters:
x - The x coordinates (Real space)
y - The y coorsinates (Real space)
xAxis - The axis corresponding to x coordinates.
Returns:
A structure containing search result.
See Also:
searchNearestNormal(int, int, fr.esrf.tangoatk.widget.util.chart.JLAxis)

searchNearest

public SearchInfo searchNearest(int x,
                                int y,
                                JLAxis xAxis)
Search the nearest point in the dataViews.

Parameters:
x - The x coordinates (Real space)
y - The y coordinates (Real space)
xAxis - The axis corresponding to x coordinates.
Returns:
A structure containing search result.

drawFast

public void drawFast(java.awt.Graphics g,
                     java.awt.Point lp,
                     java.awt.Point p,
                     JLDataView v)
Expert Usage. Paint last point of a dataView.

Parameters:
g - Graphics object
lp - last point
p - new point
v - view containing the lp and p.

paintMarker

public static void paintMarker(java.awt.Graphics g,
                               int mType,
                               int mSize,
                               int x,
                               int y)
Expert usage. Paint a marker a the specified position

Parameters:
g - Graphics object
mType - Marker type
mSize - Marker size
x - x coordinates (pixel space)
y - y coordinates (pixel space)

drawSampleLine

public static void drawSampleLine(java.awt.Graphics g,
                                  int x,
                                  int y,
                                  JLDataView v)
Expert usage. Draw a sample line of a dataview

Parameters:
g - Graphics object
x - x coordinates (pixel space)
y - y coordinates (pixel space)
v - dataview

computeMediumColor

public java.awt.Color computeMediumColor(java.awt.Color c1,
                                         java.awt.Color c2)
Compute the medium color of c1,c2

Parameters:
c1 - Color 1
c2 - Color 2
Returns:
Averaged color.

paintAxisDirect

public void paintAxisDirect(java.awt.Graphics g,
                            java.awt.font.FontRenderContext frc,
                            int x0,
                            int y0,
                            java.awt.Color back,
                            int tr,
                            int la)
Paint this axis.

Parameters:
g - Graphics context
frc - Font render context
x0 - Axis position
y0 - Axis position
back - background Color (used to compute subTick color)
tr - Translation from x0 to axis.
la - Translation to opposite axis (used by grid).

paintAxisOpposite

public void paintAxisOpposite(java.awt.Graphics g,
                              java.awt.font.FontRenderContext frc,
                              int x0,
                              int y0,
                              java.awt.Color back,
                              int tr,
                              int la)

paintAxisOppositeDouble

public void paintAxisOppositeDouble(java.awt.Graphics g,
                                    java.awt.font.FontRenderContext frc,
                                    int x0,
                                    int y0,
                                    java.awt.Color back,
                                    int tr,
                                    int la)

applyConfiguration

public void applyConfiguration(java.lang.String prefix,
                               CfFileReader f)
Apply axis configuration.

Parameters:
prefix - Axis settings prefix
f - CfFileReader object wich contains axis parametters
See Also:
JLChart.applyConfiguration(fr.esrf.tangoatk.widget.util.chart.CfFileReader), JLDataView.applyConfiguration(java.lang.String, fr.esrf.tangoatk.widget.util.chart.CfFileReader)

getConfiguration

public java.lang.String getConfiguration(java.lang.String prefix)
Builds a configuration string that can be write into a file and is compatible with CfFileReader.

Parameters:
prefix - Axis settings prefix
Returns:
A string containing param
See Also:
applyConfiguration(java.lang.String, fr.esrf.tangoatk.widget.util.chart.CfFileReader), JLChart.getConfiguration(), JLDataView.getConfiguration(java.lang.String)

isZeroAlwaysVisible

public boolean isZeroAlwaysVisible()
Allaws user to know if the 0 value will always be visible in case of auto scale

Returns:
a boolean value

setZeroAlwaysVisible

public void setZeroAlwaysVisible(boolean zeroAlwaysVisible)
Sets if 0 must always be visible in case of auto scale or not

Parameters:
zeroAlwaysVisible - a boolean value. True for always visible, false otherwise.

getDateFormat

public java.lang.String getDateFormat()

setDateFormat

public void setDateFormat(java.lang.String dateFormat)
Sets date format chen chosen label format is DATE_FORMAT

Parameters:
dateFormat -
See Also:
US_DATE_FORMAT, FR_DATE_FORMAT