org.eclipse.birt.chart.util
Class ChartUtil

java.lang.Object
  extended byorg.eclipse.birt.chart.util.ChartUtil

public class ChartUtil
extends java.lang.Object

Utility class for Charts.


Constructor Summary
ChartUtil()
           
 
Method Summary
static double convertPixelsToPoints(IDisplayServer idsSWT, double dOriginalHeight)
          Convert pixel value to points.
static int getQuadrant(double dAngle)
          Returns the quadrant (1-4) for given angle in degree.
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. e.g.
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 java.lang.String stringValue(java.lang.Object value)
          Returns the string representation for given object. null for null object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartUtil

public ChartUtil()
Method Detail

isColorTransparent

public static final boolean isColorTransparent(ColorDefinition cdef)
Returns if the given color definition is totally transparent. e.g. transparency==0.

Parameters:
cdef -
Returns:

isShadowDefined

public static final boolean isShadowDefined(Label la)
Returns if the given label has defined a shadow.

Parameters:
la -
Returns:

mathEqual

public static final boolean mathEqual(double v1,
                                      double v2)
Returns if the given two double values are equal within a small precision.

Parameters:
v1 -
v2 -
Returns:

mathNE

public static final boolean mathNE(double v1,
                                   double v2)
Returns if the given two double values are not equal within a small precision.

Parameters:
v1 -
v2 -
Returns:

mathLT

public static final boolean mathLT(double lv,
                                   double rv)
Returns if the given left double value is less than the given right value within a small precision.

Returns:

mathLE

public static final 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.

Returns:

mathGT

public static final boolean mathGT(double lv,
                                   double rv)
Returns if the given left double value is greater than the given right value within a small precision.

Returns:

mathGE

public static final 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.

Parameters:
lv -
rv -
Returns:

convertPixelsToPoints

public static final double convertPixelsToPoints(IDisplayServer idsSWT,
                                                 double dOriginalHeight)
Convert pixel value to points.

Parameters:
idsSWT -
dOriginalHeight -
Returns:

getQuadrant

public static final int getQuadrant(double dAngle)
Returns the quadrant (1-4) for given angle in degree. Specially, -1 means Zero degree. -2 means 90 degree, -3 means 180 degree, -4 means 270 degree.

Parameters:
dAngle -
Returns:

intersects

public static boolean intersects(Polygon pg1,
                                 Polygon pg2)
Returns if two polygons intersect each other.

Parameters:
pg1 -
pg2 -
Returns:

mergeFont

public static void mergeFont(FontDefinition original,
                             FontDefinition source)
Merges two fonts to the original one from a source. The original one can not be null. ?Only consider inheritable properties.

Parameters:
original -
source -
Returns:

stringValue

public static java.lang.String stringValue(java.lang.Object value)
Returns the string representation for given object. null for null object.

Parameters:
value -
Returns:


Copyright © 2005 Actuate Corp. All rights reserved.