JIDE 3.4.0

com.jidesoft.chart
Class AbstractAutoRanger

java.lang.Object
  extended by com.jidesoft.chart.AbstractAutoRanger
All Implemented Interfaces:
AutoRanger
Direct Known Subclasses:
DefaultAutoRanger, ZeroAlignedAutoRanger

public abstract class AbstractAutoRanger
extends Object
implements AutoRanger


Constructor Summary
protected AbstractAutoRanger()
           
protected AbstractAutoRanger(Double fixMinX, Double fixMinY, Double fixMaxX, Double fixMaxY)
           
 
Method Summary
protected  Pair<Range<?>,Range<?>> applyRangeConstraints(Axis xAxis, Axis yAxis, double minX, double minY, double maxX, double maxY)
          Post-processes the ranges of the supplied x and y axes to apply the minimum and maximum values
protected  Range<?> applyXRangeConstraints(Axis xAxis, double minX, double maxX)
           
protected  Range<?> applyYRangeConstraints(Axis yAxis, double minY, double maxY)
           
 double getLeadingXMarginProportion()
           
 double getLeadingYMarginProportion()
           
 Pair<Range<?>,Range<?>> getRanges(ChartModel model)
          Returns the x and y ranges for the supplied chart model
 Pair<Range<?>,Range<?>> getStackedRanges(Chart chart)
          Returns the x and y range when plotting a stacked bar chart.
 double getTrailingXMarginProportion()
           
 double getTrailingYMarginProportion()
           
 boolean isAllowXMarginToCrossZero()
           
 boolean isAllowYMarginToCrossZero()
           
 void setAllowXMarginToCrossZero(boolean allowXMarginToCrossZero)
           
 void setAllowYMarginToCrossZero(boolean allowYMarginToCrossZero)
          Specify whether the increase to the range by applying the margin is allowed to extend the range by crossing from the positive region into the negative region, or vice versa.
 void setLeadingXMarginProportion(double leadingXMarginProportion)
           
 void setLeadingYMarginProportion(double leadingYMarginProportion)
           
 void setMarginProportions(double top, double left, double bottom, double right)
          Sets the margin proportions to apply to ranges when calculating minima and maxima.
 void setTrailingXMarginProportion(double trailingXMarginProportion)
           
 void setTrailingYMarginProportion(double trailingYMarginProportion)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jidesoft.chart.AutoRanger
getRanges
 

Constructor Detail

AbstractAutoRanger

protected AbstractAutoRanger()

AbstractAutoRanger

protected AbstractAutoRanger(Double fixMinX,
                             Double fixMinY,
                             Double fixMaxX,
                             Double fixMaxY)
Method Detail

setMarginProportions

public void setMarginProportions(double top,
                                 double left,
                                 double bottom,
                                 double right)
Sets the margin proportions to apply to ranges when calculating minima and maxima. If you are setting all the margin proportions this is easier to use than calling the individual setters for each of the margins.

Parameters:
top - the trailing y margin proportion
left - the leading x margin proportion
bottom - the leading y margin proportion
right - the trailing x margin proportion

getLeadingXMarginProportion

public double getLeadingXMarginProportion()

setLeadingXMarginProportion

public void setLeadingXMarginProportion(double leadingXMarginProportion)

getLeadingYMarginProportion

public double getLeadingYMarginProportion()

setLeadingYMarginProportion

public void setLeadingYMarginProportion(double leadingYMarginProportion)

getTrailingXMarginProportion

public double getTrailingXMarginProportion()

setTrailingXMarginProportion

public void setTrailingXMarginProportion(double trailingXMarginProportion)

getTrailingYMarginProportion

public double getTrailingYMarginProportion()

isAllowXMarginToCrossZero

public boolean isAllowXMarginToCrossZero()

setAllowXMarginToCrossZero

public void setAllowXMarginToCrossZero(boolean allowXMarginToCrossZero)

setTrailingYMarginProportion

public void setTrailingYMarginProportion(double trailingYMarginProportion)

isAllowYMarginToCrossZero

public boolean isAllowYMarginToCrossZero()

setAllowYMarginToCrossZero

public void setAllowYMarginToCrossZero(boolean allowYMarginToCrossZero)
Specify whether the increase to the range by applying the margin is allowed to extend the range by crossing from the positive region into the negative region, or vice versa. By default this is true, meaning there is no additional restriction and the margin will be applied.

Parameters:
allowYMarginToCrossZero - specify whether allowed to cross from positive to negative (or vice versa) when extending the range.

getRanges

public Pair<Range<?>,Range<?>> getRanges(ChartModel model)
Returns the x and y ranges for the supplied chart model

Parameters:
model - the chart model whose x and y ranges we need to discover
Returns:
a pair of NumericRanges

applyRangeConstraints

protected Pair<Range<?>,Range<?>> applyRangeConstraints(Axis xAxis,
                                                        Axis yAxis,
                                                        double minX,
                                                        double minY,
                                                        double maxX,
                                                        double maxY)
Post-processes the ranges of the supplied x and y axes to apply the minimum and maximum values


applyXRangeConstraints

protected Range<?> applyXRangeConstraints(Axis xAxis,
                                          double minX,
                                          double maxX)

applyYRangeConstraints

protected Range<?> applyYRangeConstraints(Axis yAxis,
                                          double minY,
                                          double maxY)

getStackedRanges

public Pair<Range<?>,Range<?>> getStackedRanges(Chart chart)
Returns the x and y range when plotting a stacked bar chart. This is a special case for finding out the x and y range so is treated separately here

Parameters:
chart - the chart for which we are computing the stacked ranges
Returns:
the X and Y Range as a pair for a stacked bar chart

JIDE 3.4.0