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.
static boolean isColorTransparent(ColorDefinition cdef)
          Returns if the given color definition is totally transparent.
static boolean isShadowDefined(Label la)
          Returns if the given label defines a shadow.
static boolean mathEqual(double v1, double v2)
          Returns if the given two double values are equal within a small precision, e.g.
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, e.g.
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, e.g.
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.
 
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 defines 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, e.g. EPS=1E-10.

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, e.g. EPS=1E-10.

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, e.g. EPS=1E-10.

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.

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.