Package hec.geometry
Class ProbabilityAxis
java.lang.Object
java.util.Observable
hec.geometry.Axis
hec.geometry.ProbabilityAxis
- All Implemented Interfaces:
AdjustmentListener
,Serializable
,EventListener
Title: CWMS Development
Description: This class defines the methods to compute the scaling for a probability axis.
Copyright: Copyright (c) 2002
Company: Resource Management Associates
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
static final double
static final String[]
static final double[]
Fields inherited from class hec.geometry.Axis
_axisProp, CATEGORY, COMPUTED_SCALE, DEBUG, DEFAULT_AXIS_MAX, DEFAULT_AXIS_MIN, LABEL_CHANGE, LINEAR, LOGARITHMIC, m_observerList, NEW_ZOOM, PROBABILITY, SEASONAL, TIME, XAXIS, YAXIS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Find a nice tic intervalvoid
void
computeScaling
(double min, double max) Computes the scaling based on the min and max values in World Coordinates.int
Computes an integer value based on the max/min and the current view max/min that represents a position on a scroll bardouble
double
double
Returns the maximum data value for the axis.double
Returns the minimum data value for the axis.int
getIndexFor
(double value) static double
getInverseNormalDistribution
(double x) double
getMax()
Returns the maximum value for this axis.double
getMin()
static double
getNormalDistribution
(double p) String[]
double[]
int
int
getType()
getValueStringAt
(int idx) double
void
growToGlyphBounds
(double min, double max) void
growWorldExtents
(double min, double max) void
double
l2w
(int l) returns the world value for the given local valuedouble
l2wE
(double l) returns the world value for the given local valuestatic void
Test Main functions that brings up a plot with simple data to show the probability Axis in Actionvoid
setAxisProp
(AxisProp prop) void
setProbabilityAxisArrays
(String[] labels, double[] values) void
setProbabilityAxisArrays
(String[] labels, double[] values, double minAxisValue, double maxAxisValue) void
setWorldExtents
(double min, double max) void
updateRatedFunctionScroll
(Axis baseAxis, AdjustmentEvent e) int
w2l
(double w) returns the local value for the given world valuedouble
w2lE
(double w) returns the local value for the given world valuevoid
zoomByFactor
(double factor) Change the zoom scaling by the given factor.void
zoomIn
(double wmin, double wmax) Zooms based on world coordinatesvoid
zoomIn
(int imin, int imax) Zooms in based on local coordinatesMethods inherited from class hec.geometry.Axis
addObserver, computeAutoViewValues, computeScaling, computeTicInterval, deleteObserver, deleteObservers, getAxisProp, getDataUnitSystem, getDisplayUnitsString, getDisplayUnitSystem, getLabel, getMajorTic, getMinorTic, getName, getNumTicLabelLevels, getObserverList, getOldDisplayUnitSystem, getOrigin, getParameterId, getRatedValue, getRatingFunction, getReversed, getScaledLabel, getScaleMax, getScaleMin, getThousPow, getThousScale, getTicColor, getTicColorString, getTicTextColor, getTicTextColorString, getUnRatedValue, getViewMax, getViewMin, getZoom, isComputingMajorTics, isComputingMinorTics, isReversed, isUsingAutomaticMaximum, isUsingAutomaticMinimum, isUsingAutomaticViewMaximum, isUsingAutomaticViewMinimum, isUsingDefaultLimits, popLabel, pushLabel, rateAxis, setActualMaximumValue, setActualMinimumValue, setAutomaticMaximumOff, setAutomaticMaximumOn, setAutomaticMinimumOff, setAutomaticMinimumOn, setAutomaticViewMaximumOff, setAutomaticViewMaximumOn, setAutomaticViewMinimumOff, setAutomaticViewMinimumOn, setComputeMajorTics, setComputeMajorTicsOff, setComputeMajorTicsOn, setComputeMinorTics, setComputeMinorTicsOff, setComputeMinorTicsOn, setDataUnitSystem, setDefaultExtents, setDisplayScaleFactor, setDisplayUnitSystem, setLabel, setMajorTicInterval, setMaximumFactionDigits, setMaximumLimit, setMinimumLimit, setMinMax, setMinorTicInterval, setName, setNumberOfTicLabelLayers, setNumTicLabelLevels, setOrigin, setParameterId, setRatingFunction, setRatingFunction, setReversed, setReversedOff, setReversedOn, setScaleLimits, setTicColor, setTicColor, setTicTextColor, setTicTextColor, setUnit, setUseDefaultLimitsOff, setUseDefaultLimitsOn, setViewLimits, setWorldMinExtent, unZoom, zoomInUnMod
Methods inherited from class java.util.Observable
clearChanged, countObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
PROBABILITY_AXIS_VALUES
public static final double[] PROBABILITY_AXIS_VALUES -
PROBABILITY_AXIS_LABELS
-
AXIS_MINIMUM
public static final double AXIS_MINIMUM- See Also:
-
AXIS_MAXIMUM
public static final double AXIS_MAXIMUM- See Also:
-
-
Constructor Details
-
ProbabilityAxis
-
-
Method Details
-
getType
public int getType() -
invalidateWorldExtents
public void invalidateWorldExtents()- Overrides:
invalidateWorldExtents
in classAxis
-
computeNiceMinMax
public void computeNiceMinMax()Description copied from class:Axis
Find a nice tic interval- Overrides:
computeNiceMinMax
in classAxis
-
getSigFig
public int getSigFig() -
setAxisProp
- Overrides:
setAxisProp
in classAxis
-
adjustmentValueChanged
- Specified by:
adjustmentValueChanged
in interfaceAdjustmentListener
- Overrides:
adjustmentValueChanged
in classAxis
-
updateRatedFunctionScroll
- Overrides:
updateRatedFunctionScroll
in classAxis
-
computeScrollPosition
public int computeScrollPosition()Computes an integer value based on the max/min and the current view max/min that represents a position on a scroll bar- Overrides:
computeScrollPosition
in classAxis
- Returns:
-
w2l
public int w2l(double w) returns the local value for the given world value -
w2lE
public double w2lE(double w) returns the local value for the given world value -
l2w
public double l2w(int l) Description copied from class:Axis
returns the world value for the given local value -
l2wE
public double l2wE(double l) returns the world value for the given local value -
growWorldExtents
public void growWorldExtents(double min, double max) - Overrides:
growWorldExtents
in classAxis
-
growToGlyphBounds
public void growToGlyphBounds(double min, double max) - Overrides:
growToGlyphBounds
in classAxis
-
setWorldExtents
public void setWorldExtents(double min, double max) - Overrides:
setWorldExtents
in classAxis
-
computeScaling
public void computeScaling(double min, double max) Computes the scaling based on the min and max values in World Coordinates. These are probability world coordinates such as -3.17- Overrides:
computeScaling
in classAxis
-
computeScaling
public void computeScaling()- Overrides:
computeScaling
in classAxis
-
zoomIn
public void zoomIn(double wmin, double wmax) Zooms based on world coordinates -
zoomByFactor
public void zoomByFactor(double factor) Change the zoom scaling by the given factor.- Overrides:
zoomByFactor
in classAxis
-
zoomIn
public void zoomIn(int imin, int imax) Zooms in based on local coordinates -
getInverseNormalDistribution
public static double getInverseNormalDistribution(double x) -
getNormalDistribution
public static double getNormalDistribution(double p) -
main
Test Main functions that brings up a plot with simple data to show the probability Axis in Action- Parameters:
args
- arguments to the program. Does not use any of the arguments.
-
getWorldExtents
- Overrides:
getWorldExtents
in classAxis
-
getWorldRange
public double getWorldRange()- Overrides:
getWorldRange
in classAxis
-
getMin
public double getMin() -
getMax
public double getMax()Returns the maximum value for this axis. This differes from the data max because the data max may be 9.75 and the Axis displays a max value of 10. -
getDataMax
public double getDataMax()Returns the maximum data value for the axis.- Overrides:
getDataMax
in classAxis
- Returns:
-
getDataMin
public double getDataMin()Returns the minimum data value for the axis.- Overrides:
getDataMin
in classAxis
- Returns:
-
getActMin
public double getActMin() -
getActMax
public double getActMax() -
getProbabilityAxisValues
public double[] getProbabilityAxisValues() -
getProbabilityAxisLabels
-
setProbabilityAxisArrays
-
setProbabilityAxisArrays
public void setProbabilityAxisArrays(String[] labels, double[] values, double minAxisValue, double maxAxisValue) -
getIndexFor
public int getIndexFor(double value) - Parameters:
value
-
-
getValueStringAt
- Parameters:
idx
-- Returns:
-