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 doublestatic final doublestatic 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 TypeMethodDescriptionvoidvoidFind a nice tic intervalvoidvoidcomputeScaling(double min, double max) Computes the scaling based on the min and max values in World Coordinates.intComputes an integer value based on the max/min and the current view max/min that represents a position on a scroll bardoubledoubledoubleReturns the maximum data value for the axis.doubleReturns the minimum data value for the axis.intgetIndexFor(double value) static doublegetInverseNormalDistribution(double x) doublegetMax()Returns the maximum value for this axis.doublegetMin()static doublegetNormalDistribution(double p) String[]double[]intintgetType()getValueStringAt(int idx) doublevoidgrowToGlyphBounds(double min, double max) voidgrowWorldExtents(double min, double max) voiddoublel2w(int l) returns the world value for the given local valuedoublel2wE(double l) returns the world value for the given local valuestatic voidTest Main functions that brings up a plot with simple data to show the probability Axis in ActionvoidsetAxisProp(AxisProp prop) voidsetProbabilityAxisArrays(String[] labels, double[] values) voidsetProbabilityAxisArrays(String[] labels, double[] values, double minAxisValue, double maxAxisValue) voidsetWorldExtents(double min, double max) voidupdateRatedFunctionScroll(Axis baseAxis, AdjustmentEvent e) intw2l(double w) returns the local value for the given world valuedoublew2lE(double w) returns the local value for the given world valuevoidzoomByFactor(double factor) Change the zoom scaling by the given factor.voidzoomIn(double wmin, double wmax) Zooms based on world coordinatesvoidzoomIn(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, zoomInUnModMethods 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:
invalidateWorldExtentsin classAxis
-
computeNiceMinMax
public void computeNiceMinMax()Description copied from class:AxisFind a nice tic interval- Overrides:
computeNiceMinMaxin classAxis
-
getSigFig
public int getSigFig() -
setAxisProp
- Overrides:
setAxisPropin classAxis
-
adjustmentValueChanged
- Specified by:
adjustmentValueChangedin interfaceAdjustmentListener- Overrides:
adjustmentValueChangedin classAxis
-
updateRatedFunctionScroll
- Overrides:
updateRatedFunctionScrollin 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:
computeScrollPositionin 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:Axisreturns 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:
growWorldExtentsin classAxis
-
growToGlyphBounds
public void growToGlyphBounds(double min, double max) - Overrides:
growToGlyphBoundsin classAxis
-
setWorldExtents
public void setWorldExtents(double min, double max) - Overrides:
setWorldExtentsin 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:
computeScalingin classAxis
-
computeScaling
public void computeScaling()- Overrides:
computeScalingin 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:
zoomByFactorin 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:
getWorldExtentsin classAxis
-
getWorldRange
public double getWorldRange()- Overrides:
getWorldRangein 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:
getDataMaxin classAxis- Returns:
-
getDataMin
public double getDataMin()Returns the minimum data value for the axis.- Overrides:
getDataMinin 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:
-