|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.birt.chart.computation.Methods
org.eclipse.birt.chart.computation.withaxes.AutoScale
public final class AutoScale
Encapsulates the auto scaling algorithms used by the rendering and chart computation framework.
Field Summary | |
---|---|
static java.lang.String |
KEY_SHARED_MINMAX
|
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_GROUP_NAME, 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, POSITION_MASK, POSITION_MOVE_ABOVE, POSITION_MOVE_BELOW, POSITION_MOVE_LEFT, POSITION_MOVE_RIGHT, 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,
RunTimeContext _rtc)
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 |
computeAxisLabelThickness(IDisplayServer xs,
Label la,
int iOrientation)
|
com.ibm.icu.text.DecimalFormat |
computeDecimalFormat(double dAxisValue,
double dAxisStep)
Computes the default DecimalFormat pattern for axis according to axis value and scale steps. |
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. |
java.lang.String |
getComputedLabelText(int index)
|
DataSetIterator |
getData()
|
int |
getDirection()
Returns the scale direction. |
double |
getEnd()
|
double[] |
getEndPoints()
|
double |
getFactor()
|
FormatSpecifier |
getFormatSpecifier()
|
java.lang.Object |
getMaximum()
|
java.lang.Object |
getMinimum()
|
double[] |
getMinorCoordinates(int iMinorUnitsPerMajor)
|
static int |
getMinUnit(CDateTime cdt)
|
double |
getNormalizedEnd()
Returns the normalized end point. |
double[] |
getNormalizedEndPoints()
Returns the normalized start and end point. |
double |
getNormalizedStart()
Returns the normalized start point. |
java.lang.String |
getNumericPattern()
Returns an auto computed decimal format pattern for representing axis labels on a numeric axis |
RunTimeContext |
getRunTimeContext()
|
double |
getStart()
|
java.lang.Object |
getStep()
|
java.lang.Integer |
getStepNumber()
|
AxisTickCoordinates |
getTickCordinates()
|
int |
getTickCount()
Computes tick count |
int |
getType()
|
java.lang.Object |
getUnit()
|
static int |
getUnitId(int iUnit)
|
double |
getUnitSize()
Returns the absolute value of the scale unit. |
java.util.Collection<java.lang.Integer> |
getVisibleLabelIds()
returns a list of all visible indexes, in the moment works only for categorey. |
boolean |
isAxisLabelStaggered()
|
boolean |
isCategoryScale()
Checks if axis is category style or Text type |
boolean |
isMaximumFixed()
|
boolean |
isMinimumFixed()
|
boolean |
isSetFactor()
|
boolean |
isStepFixed()
|
boolean |
isTickBetweenCategories()
|
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)
|
static void |
setNumberMinMaxToScale(AutoScale sc,
java.lang.Object oMinimum,
java.lang.Object oMaximum,
RunTimeContext rtc,
OneAxis ax)
Updates AutoScale by checking min or max |
void |
setRunTimeContext(RunTimeContext context)
|
void |
setStep(java.lang.Object o)
|
void |
setStepFixed(boolean v)
|
void |
setStepNumber(java.lang.Integer o)
|
static void |
setStepToScale(AutoScale sc,
java.lang.Object oStep,
java.lang.Integer oStepNumber,
RunTimeContext rtc)
Updates AutoScale by checking step size and step number |
void |
updateAxisMinMax(java.lang.Object oMinValue,
java.lang.Object oMaxValue)
Computes min, max value, step size and step number of the Axis |
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, computeBox, computeBox, computeBox, computeFontHeight, computeHeight, computeHeight, computeLabelSize, computePolygon, computePolygon, computePolygon, computeRotatedTopPoint, computeWidth, computeWidth, getLabelPosition, getLocation, getLocation, getNormalizedLocation, getNormalizedLocation |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String KEY_SHARED_MINMAX
Constructor Detail |
---|
public AutoScale(int _iType, java.lang.Object _oMinimum, java.lang.Object _oMaximum, RunTimeContext _rtc)
_iType
- _oMinimum
- _oMaximum
- _oStep
- Method Detail |
---|
public final void setDirection(int iValue)
val
- public int getDirection()
public final java.lang.Object clone()
clone
in class java.lang.Object
public final boolean zoomIn()
public final boolean zoomOut()
public final java.lang.String getNumericPattern()
public final int getType()
public final void setData(DataSetIterator _oaData)
_oaData
- public final FormatSpecifier getFormatSpecifier()
public final void setFormatSpecifier(FormatSpecifier fs)
fs
- public final java.lang.Object getUnit()
public final DataSetIterator getData()
public final boolean isTickLabelVisible(int index)
index
-
public final java.lang.String getComputedLabelText(int index)
public final java.util.Collection<java.lang.Integer> getVisibleLabelIds()
public final boolean isTickLabelStaggered(int index)
index
-
public final boolean isAxisLabelStaggered()
public final boolean isTickBetweenCategories()
public final AxisTickCoordinates getTickCordinates()
public final double getNormalizedStart()
public final double getNormalizedEnd()
public final double[] getNormalizedEndPoints()
public final double[] getEndPoints()
public final int getTickCount() throws ChartException
ChartException
public final double getUnitSize()
public final java.lang.Object getMinimum()
public final void setMinimum(java.lang.Object o)
o
- public final java.lang.Object getMaximum()
public final void setMaximum(java.lang.Object o)
o
- public final java.lang.Object getStep()
public final void setStep(java.lang.Object o)
o
- public final java.lang.Integer getStepNumber()
public final void setStepNumber(java.lang.Integer o)
public final double getFactor()
public final boolean isSetFactor()
public final void updateAxisMinMax(java.lang.Object oMinValue, java.lang.Object oMaxValue)
oMinValue
- min value in data points. Double or CDateTime type.oMaxValue
- max value in data points. Double or CDateTime type.public final boolean checkFit(IDisplayServer xs, Label la, int iLabelLocation) throws ChartException
la
- iLabelLocation
-
ChartException
public final double getStart()
public final double getEnd()
public static int getMinUnit(CDateTime cdt) throws ChartException
ChartException
public static int getUnitId(int iUnit) throws ChartException
ChartException
public final int computeTicks(IDisplayServer xs, Label la, int iLabelLocation, int iOrientation, double dStart, double dEnd, boolean bConsiderStartEndLabels, AllAxes aax) throws ChartException
la
- iLabelLocation
- iOrientation
- dStart
- dEnd
- bConsiderStartEndLabels
- aax
-
ChartException
public final int computeTicks(IDisplayServer xs, Label la, int iLabelLocation, int iOrientation, double dStart, double dEnd, boolean bConsiderStartLabel, boolean bConsiderEndLabel, AllAxes aax) throws ChartException
la
- iLabelLocation
- iOrientation
- dStart
- dEnd
- bConsiderStartEndLabels
- aax
-
ChartException
public final java.lang.String formatCategoryValue(int iType, java.lang.Object oValue, int iDateTimeUnit)
iType
- oValue
-
public final double computeAxisLabelThickness(IDisplayServer xs, Label la, int iOrientation) throws ChartException
ChartException
public final double computeStaggeredAxisLabelOffset(IDisplayServer xs, Label la, int iOrientation) throws ChartException
xs
- la
- iOrientation
-
ChartException
public final boolean isStepFixed()
public final void setStepFixed(boolean v)
v
- public final boolean isMinimumFixed()
public final void setMinimumFixed(boolean v)
v
- public final boolean isMaximumFixed()
public final void setMaximumFixed(boolean v)
v
- public final boolean isCategoryScale()
public final double[] getMinorCoordinates(int iMinorUnitsPerMajor)
iMinorUnitsPerMajor
-
public final RunTimeContext getRunTimeContext()
public final void setRunTimeContext(RunTimeContext context)
context
- public static void setNumberMinMaxToScale(AutoScale sc, java.lang.Object oMinimum, java.lang.Object oMaximum, RunTimeContext rtc, OneAxis ax) throws ChartException
sc
- oMinimum
- oMaximum
- rtc
- ax
-
ChartException
public static void setStepToScale(AutoScale sc, java.lang.Object oStep, java.lang.Integer oStepNumber, RunTimeContext rtc) throws ChartException
sc
- oStep
- oStepNumber
- rtc
-
ChartException
public final com.ibm.icu.text.DecimalFormat computeDecimalFormat(double dAxisValue, double dAxisStep)
dAxisValue
- axis valuedAxisStep
- scale step
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |