Package xal.extension.widgets.plot
Class SmartFormatGridLimits
java.lang.Object
xal.extension.widgets.plot.GridLimits
xal.extension.widgets.plot.SmartFormatGridLimits
- Direct Known Subclasses:
SmartGridLimits
This is subclass of grid limits class (GridLimits) with non-empty
setSmartLimitsX() and setSmartLimitsY() methods. These methods will redefine
format to beautify the axes markers
- Version:
- 1.0
- Author:
- shishlo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static NumberFormat[]
The scientific formatsprotected static NumberFormat[]
The simple formatsprotected boolean
The scale on x, xMin and xMax are definedprotected boolean
The scale on y, yMin and yMax are definedprotected static NumberFormat
The universal formatprotected double[]
The array with scale on x, xMin and xMaxprotected double[]
The array with scale on y, yMin and yMax -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Calculates smart limits for the X axisprotected void
Calculates smart limits for the Y axisprotected static NumberFormat
getSmartFormat
(double[] arr, int nExtraDigits) Returns the new format that will be suitable for given limitsvoid
Sets the limits by using smart procedure for x-axisvoid
Sets the limits by using smart procedure for x-axisMethods inherited from class xal.extension.widgets.plot.GridLimits
getColor, getGridLimitsSwitch, getMajorTicksOnX, getMajorTicksOnY, getMaxX, getMaxY, getMinX, getMinY, getNumberFormatX, getNumberFormatY, getNumMajorTicksX, getNumMajorTicksY, getNumMinorTicksX, getNumMinorTicksY, initialize, initializeX, initializeY, isSetXmax, isSetXmin, isSetYmax, isSetYmin, setColor, setGridLimitsSwitch, setLimitsAndTicksX, setLimitsAndTicksX, setLimitsAndTicksX, setLimitsAndTicksX, setLimitsAndTicksY, setLimitsAndTicksY, setLimitsAndTicksY, setLimitsAndTicksY, setMajorTicksOnX, setMajorTicksOnY, setNumberFormatX, setNumberFormatY, setNumMajorTicksX, setNumMajorTicksY, setNumMinorTicksX, setNumMinorTicksY, setSmartLimits, setXmax, setXmaxOn, setXmin, setXminOn, setYmax, setYmaxOn, setYmin, setYminOn
-
Field Details
-
xSR
protected double[] xSRThe array with scale on x, xMin and xMax -
sucessX
protected boolean sucessXThe scale on x, xMin and xMax are defined -
ySR
protected double[] ySRThe array with scale on y, yMin and yMax -
sucessY
protected boolean sucessYThe scale on y, yMin and yMax are defined -
simpleFormats
The simple formats -
scientificFormats
The scientific formats -
univFormat
The universal format
-
-
Constructor Details
-
SmartFormatGridLimits
public SmartFormatGridLimits()Constructor for the SmartFormatGridLimits object
-
-
Method Details
-
setSmartLimitsX
public void setSmartLimitsX()Sets the limits by using smart procedure for x-axis- Overrides:
setSmartLimitsX
in classGridLimits
-
setSmartLimitsY
public void setSmartLimitsY()Sets the limits by using smart procedure for x-axis- Overrides:
setSmartLimitsY
in classGridLimits
-
calculateScalesAndLimitsX
protected void calculateScalesAndLimitsX()Calculates smart limits for the X axis -
calculateScalesAndLimitsY
protected void calculateScalesAndLimitsY()Calculates smart limits for the Y axis -
getSmartFormat
Returns the new format that will be suitable for given limits- Parameters:
arr
- The array with scale, vMin, vMaxnExtraDigits
- The additional number of digits in mantissa- Returns:
- The format
-