org.eclipse.birt.chart.computation.withaxes
Class AutoScale

java.lang.Object
  extended byorg.eclipse.birt.chart.computation.Methods
      extended byorg.eclipse.birt.chart.computation.withaxes.AutoScale
All Implemented Interfaces:
java.lang.Cloneable, IConstants

public final class AutoScale
extends Methods
implements java.lang.Cloneable

Encapsulates the auto scaling algorithms used by the rendering and chart computation framework.


Field Summary
 
Fields inherited from interface org.eclipse.birt.chart.computation.IConstants
ABOVE, ANCILLARY_AXIS, ANCILLARY_BASE, AUTO, AVERAGE, AXIS, BACKWARD, BASE, BASE_AXIS, BELOW, BOTTOM, CENTER, COLLECTION, DATE_TIME, DESIGN_TIME, EMPTY_STRING, EQUAL, FORWARD, HORIZONTAL, INSIDE, LABELS, LEFT, LEGEND_ENTRY, LEGEND_MINSLICE_ENTRY, LEGEND_SEPERATOR, LESS, LINE_EXPAND_DOUBLE_SIZE, LINE_EXPAND_SIZE, LINEAR, LOG_10, LOGARITHMIC, MAJOR, MAX, MIN, MINOR, MORE, NON_PRIMITIVE_ARRAY, NULL_STRING, NUMERICAL, ONE_SPACE, ORTHOGONAL, ORTHOGONAL_AXIS, OTHER, OUTSIDE, PERCENT, PRIMITIVE_ARRAY, RIGHT, RUN_TIME, SOME_NULL, TEXT, THREE_D, TICK_ABOVE, TICK_ACROSS, TICK_BELOW, TICK_LEFT, TICK_NONE, TICK_RIGHT, TICK_SIDE1, TICK_SIDE2, TICK_SIZE, TOP, TWO_5_D, TWO_D, UNDEFINED, UNDEFINED_STRING, USER_INTERFACE, VALUE, VERTICAL
 
Constructor Summary
AutoScale(int _iType, java.lang.Object _oMinimum, java.lang.Object _oMaximum, java.lang.Object _oStep)
          The constructor.
 
Method Summary
 boolean checkFit(IDisplayServer xs, Label la, int iLabelLocation)
          Checks all labels for any overlap for a given axis' scale
 java.lang.Object clone()
           
 double computeStaggeredAxisLabelOffset(IDisplayServer xs, Label la, int iOrientation)
           
 int computeTicks(IDisplayServer xs, Label la, int iLabelLocation, int iOrientation, double dStart, double dEnd, boolean bConsiderStartEndLabels, AllAxes aax)
           
 int computeTicks(IDisplayServer xs, Label la, int iLabelLocation, int iOrientation, double dStart, double dEnd, boolean bConsiderStartLabel, boolean bConsiderEndLabel, AllAxes aax)
           
 java.lang.String formatCategoryValue(int iType, java.lang.Object oValue, int iDateTimeUnit)
          Returns the formatted value for given Axis type and value.
 DataSetIterator getData()
           
 int getDirection()
          Returns the scale direction.
 double getEnd()
           
 double[] getEndPoints()
           
 FormatSpecifier getFormatSpecifier()
           
 java.lang.Object getMaximum()
           
 java.lang.Object getMinimum()
           
 double[] getMinorCoordinates(int iMinorUnitsPerMajor)
           
 double getNormalizedEnd()
          Returns the normalized end point.
 double[] getNormalizedEndPoints()
          Returns the normalized start and end point.
 double getNormalizedStart()
          Returns the normalized start point.
 double[] getNormalizedTickCoordinates()
          Returns the normalized tick coordinates.
 java.lang.String getNumericPattern()
          Returns an auto computed decimal format pattern for representing axis labels on a numeric axis
 java.lang.String getNumericPattern(double dValue)
          Returns an auto computed decimal format pattern for representing axis labels on a numeric axis This is used for representing logarithmic values
 RunTimeContext getRunTimeContext()
           
 double getStart()
           
 java.lang.Object getStep()
           
 double[] getTickCordinates()
           
 int getTickCount()
           
 int getType()
           
 java.lang.Object getUnit()
           
 double getUnitSize()
          Returns the absolute value of the scale unit.
 boolean isAxisLabelStaggered()
           
 boolean isCategoryScale()
           
 boolean isMaximumFixed()
           
 boolean isMinimumFixed()
           
 boolean isStepFixed()
           
 boolean isTickLabelStaggered(int index)
           
 boolean isTickLabelVisible(int index)
           
 void setData(DataSetIterator _oaData)
           
 void setDirection(int iValue)
          Sets the scale direction.
 void setFormatSpecifier(FormatSpecifier fs)
           
 void setMaximum(java.lang.Object o)
           
 void setMaximumFixed(boolean v)
           
 void setMinimum(java.lang.Object o)
           
 void setMinimumFixed(boolean v)
           
 void setRunTimeContext(RunTimeContext context)
           
 void setStep(java.lang.Object o)
           
 void setStepFixed(boolean v)
           
 void updateAxisMinMax(java.lang.Object oMinValue, java.lang.Object oMaxValue)
           
 boolean zoomIn()
          Zooms IN 'once' into a scale of type numerical or datetime Typically, this is called in a loop until label overlaps occur
 boolean zoomOut()
          Zooms OUT 'once' into a scale of type numerical or datetime Typically, this is called in a loop until label overlaps occur
 
Methods inherited from class org.eclipse.birt.chart.computation.Methods
asDateTime, asDouble, asInteger, computeBox, computePolygon, computeRotatedTopPoint, getLabelPosition, getLocation, getLocation, getLocation, getNormalizedLocation, getNormalizedLocation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoScale

public AutoScale(int _iType,
                 java.lang.Object _oMinimum,
                 java.lang.Object _oMaximum,
                 java.lang.Object _oStep)
The constructor.

Parameters:
_iType -
_oMinimum -
_oMaximum -
_oStep -
Method Detail

setDirection

public final void setDirection(int iValue)
Sets the scale direction.


getDirection

public int getDirection()
Returns the scale direction.

Returns:

clone

public final java.lang.Object clone()

zoomIn

public final boolean zoomIn()
Zooms IN 'once' into a scale of type numerical or datetime Typically, this is called in a loop until label overlaps occur


zoomOut

public final boolean zoomOut()
Zooms OUT 'once' into a scale of type numerical or datetime Typically, this is called in a loop until label overlaps occur


getNumericPattern

public final java.lang.String getNumericPattern(double dValue)
Returns an auto computed decimal format pattern for representing axis labels on a numeric axis This is used for representing logarithmic values

Returns:

getNumericPattern

public final java.lang.String getNumericPattern()
Returns an auto computed decimal format pattern for representing axis labels on a numeric axis

Returns:

getType

public final int getType()
Returns:

setData

public final void setData(DataSetIterator _oaData)
Parameters:
_oaData -

getFormatSpecifier

public final FormatSpecifier getFormatSpecifier()
Returns:

setFormatSpecifier

public final void setFormatSpecifier(FormatSpecifier fs)
Parameters:
fs -

getUnit

public final java.lang.Object getUnit()
Returns:

getData

public final DataSetIterator getData()
Returns:

isTickLabelVisible

public final boolean isTickLabelVisible(int index)
Parameters:
index -
Returns:

isTickLabelStaggered

public final boolean isTickLabelStaggered(int index)
Parameters:
index -
Returns:

isAxisLabelStaggered

public final boolean isAxisLabelStaggered()
Returns:

getTickCordinates

public final double[] getTickCordinates()
Returns:

getNormalizedTickCoordinates

public final double[] getNormalizedTickCoordinates()
Returns the normalized tick coordinates. that means the start point is always zero, and the array lines forward.

Returns:

getNormalizedStart

public final double getNormalizedStart()
Returns the normalized start point. always be Zero.

Returns:

getNormalizedEnd

public final double getNormalizedEnd()
Returns the normalized end point. this will be the (orginal end - orginal start).

Returns:

getNormalizedEndPoints

public final double[] getNormalizedEndPoints()
Returns the normalized start and end point.

Returns:

getEndPoints

public final double[] getEndPoints()
Returns:

getTickCount

public final int getTickCount()
Returns:

getUnitSize

public final double getUnitSize()
Returns the absolute value of the scale unit.

Returns:

getMinimum

public final java.lang.Object getMinimum()
Returns:

setMinimum

public final void setMinimum(java.lang.Object o)
Parameters:
o -

getMaximum

public final java.lang.Object getMaximum()
Returns:

setMaximum

public final void setMaximum(java.lang.Object o)
Parameters:
o -

getStep

public final java.lang.Object getStep()
Returns:

setStep

public final void setStep(java.lang.Object o)
Parameters:
o -

updateAxisMinMax

public final void updateAxisMinMax(java.lang.Object oMinValue,
                                   java.lang.Object oMaxValue)
Parameters:
oMinValue -
oMaxValue -

checkFit

public final boolean checkFit(IDisplayServer xs,
                              Label la,
                              int iLabelLocation)
                       throws ChartException
Checks all labels for any overlap for a given axis' scale

Parameters:
la -
iLabelLocation -
Returns:
Throws:
ChartException

getStart

public final double getStart()
Returns:

getEnd

public final double getEnd()
Returns:

computeTicks

public final int computeTicks(IDisplayServer xs,
                              Label la,
                              int iLabelLocation,
                              int iOrientation,
                              double dStart,
                              double dEnd,
                              boolean bConsiderStartEndLabels,
                              AllAxes aax)
                       throws ChartException
Parameters:
la -
iLabelLocation -
iOrientation -
dStart -
dEnd -
bConsiderStartEndLabels -
aax -
Throws:
ChartException

computeTicks

public final int computeTicks(IDisplayServer xs,
                              Label la,
                              int iLabelLocation,
                              int iOrientation,
                              double dStart,
                              double dEnd,
                              boolean bConsiderStartLabel,
                              boolean bConsiderEndLabel,
                              AllAxes aax)
                       throws ChartException
Parameters:
la -
iLabelLocation -
iOrientation -
dStart -
dEnd -
aax -
Throws:
ChartException

formatCategoryValue

public final java.lang.String formatCategoryValue(int iType,
                                                  java.lang.Object oValue,
                                                  int iDateTimeUnit)
Returns the formatted value for given Axis type and value.

Parameters:
iType -
oValue -
Returns:

computeStaggeredAxisLabelOffset

public final double computeStaggeredAxisLabelOffset(IDisplayServer xs,
                                                    Label la,
                                                    int iOrientation)
                                             throws ChartException
Parameters:
xs -
la -
iOrientation -
Returns:
Throws:
ChartException

isStepFixed

public final boolean isStepFixed()
Returns:

setStepFixed

public final void setStepFixed(boolean v)
Parameters:
v -

isMinimumFixed

public final boolean isMinimumFixed()
Returns:

setMinimumFixed

public final void setMinimumFixed(boolean v)
Parameters:
v -

isMaximumFixed

public final boolean isMaximumFixed()
Returns:

setMaximumFixed

public final void setMaximumFixed(boolean v)
Parameters:
v -

isCategoryScale

public final boolean isCategoryScale()
Returns:

getMinorCoordinates

public final double[] getMinorCoordinates(int iMinorUnitsPerMajor)
Parameters:
iMinorUnitsPerMajor -
Returns:

getRunTimeContext

public final RunTimeContext getRunTimeContext()
Returns:

setRunTimeContext

public final void setRunTimeContext(RunTimeContext context)
Parameters:
context -


Copyright © 2005 Actuate Corp. All rights reserved.