|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.birt.chart.util.ChartUtil
public class ChartUtil
Utility class for Charts.
Field Summary | |
---|---|
static java.lang.String |
CHART_MAX_ROW
The constant defined as the key in RuntimeContext or JVM arguments, to represent the value of chart max row number. |
Constructor Summary | |
---|---|
ChartUtil()
|
Method Summary | |
---|---|
static double |
alignWithInt(double dValue,
boolean bForced)
Aligns a double value with a int value, if the differance between the two value is less than EPS, and if dValue is lager than 1E15, the maximum count of significant digit is set to 15 |
static boolean |
checkDoublePrecise(double dValue)
Checks a double value is double precise. |
static int |
compareVersion(java.lang.String va,
java.lang.String vb)
Compare version number, the format of version number should be X.X.X style. |
static double |
computeHeightOfOrthogonalAxisTitle(ChartWithAxes cm,
IDisplayServer xs)
Computes the height of orthogonal axis title. |
static Fill |
convertFill(Fill fill,
double dValue,
Fill fNegative)
Converts Fill if possible. |
static double |
convertPixelsToPoints(IDisplayServer idsSWT,
double dOriginalHeight)
Convert pixel value to points. |
static int |
convertUnitTypeToCalendarConstant(ScaleUnitType unitType)
Convers Scale unit type to ICU Calendar constant. |
static java.lang.String |
createRegularRowExpression(java.lang.String expression,
boolean hasOperation)
Create a regular row expression for the matching operation. |
static java.lang.String |
createValueSeriesRowFullExpression(java.lang.String expr,
SeriesDefinition orthSD,
SeriesDefinition categorySD)
Create row full expression of value series. |
static java.lang.String |
formatDouble(double value)
Formats the double value with fixed precision. |
static java.lang.Object[] |
getAggFunParameters(SeriesDefinition orthSD,
SeriesDefinition baseSD)
Returns value of aggregate function parameters. |
static java.lang.String |
getAggregateFuncExpr(SeriesDefinition orthSD,
SeriesDefinition baseSD)
Returns aggregation function expression. |
static java.lang.String |
getAggregateFunctionExpr(SeriesDefinition orthoSD,
java.lang.String strBaseAggExp)
Gets the aggregation function expression |
static java.util.List<SeriesDefinition> |
getAllOrthogonalSeriesDefinitions(Chart chart)
Return specified axis definitions or all series definitions. |
static org.eclipse.emf.common.util.EList<SeriesDefinition> |
getBaseSeriesDefinitions(Chart chart)
Returns all instances of SeriesDefinition on category of
chart. |
static java.lang.String[] |
getCategoryExpressions(Chart cm)
Returns all category expressions of chart. |
static java.lang.String |
getFullAggregateExpression(SeriesDefinition orthoSD,
SeriesDefinition categorySD)
Return full aggregate expression which includes aggregate func and aggregate parameters. |
static java.lang.String |
getGroupingUnitName(SeriesGrouping grouping)
Returns grouping unit name of series grouping. |
static java.lang.String |
getNewSampleData(AxisType axisType,
int index)
Creates new sample data according to specified axis type. |
static int |
getQuadrant(double dAngle)
Returns the quadrant (1-4) for given angle in degree. |
static java.lang.String[] |
getStringTokens(java.lang.String str)
|
static int |
getSupportedMaxRowCount(RunTimeContext rtc)
Returns max row count that will be supported in charts. |
static java.lang.String[] |
getSupportedOutputFormats()
Gets all supported output formats. |
static java.lang.String[] |
getValueSeriesExpressions(Chart cm)
Returns all value expressions of chart. |
static java.lang.String |
getValueSeriesFullExpression(java.lang.String valueExpr,
SeriesDefinition orthoSD,
SeriesDefinition categorySD)
Returns full expression of value series. |
static java.lang.String |
getValueSeriesRowFullExpression(java.lang.String valueExpr,
SeriesDefinition orthoSD,
SeriesDefinition categorySD)
Returns row full expression of value series. |
static java.lang.String[] |
getYOptoinalExpressions(Chart cm)
Returns all Y optional expressions of chart. |
static boolean |
intersects(Polygon pg1,
Polygon pg2)
Returns if two polygons intersect each other. |
static boolean |
isColorTransparent(ColorDefinition cdef)
Returns if the given color definition is totally transparent. |
static boolean |
isMagicAggregate(java.lang.String aggFunc)
The method checks if specified aggregate function is a magic aggregate, it means these aggregates operations will change data type. |
static boolean |
isOutputFormatSupport(java.lang.String output)
Checks current output format can be supported |
static boolean |
isRightToLeftLocale(com.ibm.icu.util.ULocale lcl)
Returns if specified locale uses right-to-left direction. |
static boolean |
isShadowDefined(Label la)
Returns if the given label has defined a shadow. |
static boolean |
mathEqual(double v1,
double v2)
Returns if the given two double values are equal within a small precision. |
static boolean |
mathGE(double lv,
double rv)
Returns if the given left double value is greater than or equals to the given right value within a small precision. |
static boolean |
mathGT(double lv,
double rv)
Returns if the given left double value is greater than the given right value within a small precision. |
static boolean |
mathLE(double lv,
double rv)
Returns if the given left double value is less than or equals to the given right value within a small precision. |
static boolean |
mathLT(double lv,
double rv)
Returns if the given left double value is less than the given right value within a small precision. |
static boolean |
mathNE(double v1,
double v2)
Returns if the given two double values are not equal within a small precision. |
static void |
mergeFont(FontDefinition original,
FontDefinition source)
Merges two fonts to the original one from a source. |
static void |
pruneInvisibleSeries(Chart cm)
Remove all invisible SeriesDefinitions from the runtime chart model. |
static java.lang.String |
stringValue(java.lang.Object value)
Returns the string representation for given object. |
static TextAlignment |
transposeAlignment(TextAlignment ta)
|
static Anchor |
transposeAnchor(Anchor an)
Transposes the anchor |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CHART_MAX_ROW
Constructor Detail |
---|
public ChartUtil()
Method Detail |
---|
public static final boolean isColorTransparent(ColorDefinition cdef)
cdef
-
public static final boolean isShadowDefined(Label la)
la
-
public static final boolean mathEqual(double v1, double v2)
v1
- v2
- public static final boolean mathNE(double v1, double v2)
v1
- v2
- public static final boolean mathLT(double lv, double rv)
v1
- v2
- public static final boolean mathLE(double lv, double rv)
v1
- v2
- public static final boolean mathGT(double lv, double rv)
v1
- v2
- public static final boolean mathGE(double lv, double rv)
lv
- rv
- public static java.lang.String formatDouble(double value)
public static final double convertPixelsToPoints(IDisplayServer idsSWT, double dOriginalHeight)
idsSWT
- dOriginalHeight
-
public static final int getQuadrant(double dAngle)
dAngle
-
public static boolean intersects(Polygon pg1, Polygon pg2)
pg1
- pg2
-
public static void mergeFont(FontDefinition original, FontDefinition source)
original
- source
- public static java.lang.String stringValue(java.lang.Object value)
value
-
public static Fill convertFill(Fill fill, double dValue, Fill fNegative)
fill
- Fill to convertdValue
- numeric valuefNegative
- Fill for negative value. Useless for positive value or
MultipleFillpublic static Anchor transposeAnchor(Anchor an) throws java.lang.IllegalArgumentException
an
- anchor
java.lang.IllegalArgumentException
public static TextAlignment transposeAlignment(TextAlignment ta)
public static int convertUnitTypeToCalendarConstant(ScaleUnitType unitType)
unitType
- Scale unit type
public static int getSupportedMaxRowCount(RunTimeContext rtc)
public static java.lang.String[] getSupportedOutputFormats() throws ChartException
ChartException
public static boolean isOutputFormatSupport(java.lang.String output) throws ChartException
output
- current output format
ChartException
public static boolean isRightToLeftLocale(com.ibm.icu.util.ULocale lcl)
lcl
- locale to check direction
public static boolean checkDoublePrecise(double dValue)
dValue
-
public static double computeHeightOfOrthogonalAxisTitle(ChartWithAxes cm, IDisplayServer xs)
cm
- chart modelxs
- display server to compute pixel
public static java.lang.String getGroupingUnitName(SeriesGrouping grouping)
grouping
-
public static java.lang.String createValueSeriesRowFullExpression(java.lang.String expr, SeriesDefinition orthSD, SeriesDefinition categorySD) throws ChartException
expr
- orthSD
- categorySD
-
ChartException
public static java.lang.String getValueSeriesFullExpression(java.lang.String valueExpr, SeriesDefinition orthoSD, SeriesDefinition categorySD) throws ChartException
valueExpr
- orthoSD
- categorySD
-
ChartException
public static java.lang.String getValueSeriesRowFullExpression(java.lang.String valueExpr, SeriesDefinition orthoSD, SeriesDefinition categorySD) throws ChartException
valueExpr
- orthoSD
- categorySD
-
ChartException
public static java.lang.String getFullAggregateExpression(SeriesDefinition orthoSD, SeriesDefinition categorySD) throws ChartException
orthoSD
- categorySD
-
ChartException
public static java.lang.Object[] getAggFunParameters(SeriesDefinition orthSD, SeriesDefinition baseSD)
orthSD
- baseSD
-
public static java.lang.String getAggregateFunctionExpr(SeriesDefinition orthoSD, java.lang.String strBaseAggExp) throws ChartException
orthoSD
- strBaseAggExp
-
ChartException
public static java.lang.String getAggregateFuncExpr(SeriesDefinition orthSD, SeriesDefinition baseSD) throws ChartException
orthSD
- baseSD
-
ChartException
public static boolean isMagicAggregate(java.lang.String aggFunc)
Now the magic aggregates in chart include Count, DistinctCount, Top, TopPercent, Bottom, BottomPercent, Rank and PercentRank.
aggFunc
-
public static void pruneInvisibleSeries(Chart cm)
cm
- (will be changed)public static double alignWithInt(double dValue, boolean bForced)
dValue
- bForce
-
public static org.eclipse.emf.common.util.EList<SeriesDefinition> getBaseSeriesDefinitions(Chart chart)
SeriesDefinition
on category of
chart.
chart
- chart model object.
SeriesDefinition
.public static java.util.List<SeriesDefinition> getAllOrthogonalSeriesDefinitions(Chart chart)
chart
- chart
public static java.lang.String createRegularRowExpression(java.lang.String expression, boolean hasOperation)
expression
- specified expression.hasOperation
- indicate if the expression will include operations.
public static java.lang.String[] getValueSeriesExpressions(Chart cm)
cm
-
public static java.lang.String[] getYOptoinalExpressions(Chart cm)
cm
-
public static java.lang.String[] getCategoryExpressions(Chart cm)
cm
-
public static int compareVersion(java.lang.String va, java.lang.String vb)
va
- version number 1.vb
- version number 2.public static java.lang.String[] getStringTokens(java.lang.String str)
public static java.lang.String getNewSampleData(AxisType axisType, int index)
axisType
- axis typeindex
- sample data index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |