Class Methods

    • Constructor Detail

      • Methods

        public Methods()
    • Method Detail

      • asDateTime

        public static final CDateTime asDateTime​(java.lang.Object o)
        Converts given object to a DateTime object.
        Parameters:
        o -
        Returns:
        CDateTime
      • asDouble

        public static final java.lang.Double asDouble​(java.lang.Object o)
        Converts the given object to a Double object.
        Parameters:
        o -
        Returns:
        Double
      • asInteger

        public static final int asInteger​(java.lang.Object o)
        Converts the given object to an Integer object.
        Parameters:
        o -
        Returns:
        int
      • getLocation

        public static final double getLocation​(AutoScale sc,
                                               java.lang.Object oValue)
                                        throws ChartException,
                                               java.lang.IllegalArgumentException
        Parameters:
        sc -
        oValue -
        Returns:
        location coordinate
        Throws:
        ChartException
        java.lang.IllegalArgumentException
      • getNormalizedLocation

        public static final double getNormalizedLocation​(AutoScale sc,
                                                         double dValue)
        Parameters:
        sc -
        dValue -
        Returns:
        location coordinate
      • getNormalizedLocation

        public static final double getNormalizedLocation​(AutoScale sc,
                                                         java.lang.Object oValue)
                                                  throws ChartException,
                                                         java.lang.IllegalArgumentException
        Parameters:
        sc -
        oValue -
        Returns:
        location coordinate
        Throws:
        ChartException
        java.lang.IllegalArgumentException
      • getLocation

        public static final double getLocation​(AutoScale sc,
                                               java.lang.Number bdValue)
        Computes and returns the location based on specified value and scale info.
        Parameters:
        sc - scale info instance.
        bdValue - specified value.
        Returns:
      • getLocation

        public static final double getLocation​(AutoScale sc,
                                               double dValue)
                                        throws java.lang.IllegalArgumentException
        Parameters:
        sc -
        dValue -
        Returns:
        location coordinate
        Throws:
        java.lang.IllegalArgumentException
      • computeWidth

        public static final double computeWidth​(IDisplayServer xs,
                                                Label la)
        Parameters:
        g2d -
        fm -
        sText -
        dAngleInDegrees -
        Returns:
        width
      • computeWidth

        public static final double computeWidth​(ITextMetrics itm,
                                                Label la)
      • computeHeight

        public static final double computeHeight​(IDisplayServer xs,
                                                 Label la)
        Parameters:
        g2d -
        fm -
        sText -
        iAngleInDegrees -
        Returns:
        height
      • computeHeight

        public static final double computeHeight​(ITextMetrics itm,
                                                 Label la)
      • computePolygon

        public static final RotatedRectangle computePolygon​(IDisplayServer xs,
                                                            int iLabelLocation,
                                                            Label la,
                                                            double dX,
                                                            double dY)
                                                     throws java.lang.IllegalArgumentException
        Parameters:
        iLabelLocation -
        g2d -
        fm -
        sText -
        dAngleInDegrees -
        dX -
        dY -
        Returns:
        Note: If you find yourself calling this method very frequently while the font of the label is not changed, consider using the version with fontHeight instead. (following)
        Throws:
        java.lang.IllegalArgumentException
      • computePolygon

        public static final RotatedRectangle computePolygon​(IDisplayServer xs,
                                                            int iLabelLocation,
                                                            Label la,
                                                            double dX,
                                                            double dY,
                                                            java.lang.Double fontHeight)
                                                     throws java.lang.IllegalArgumentException
        Parameters:
        xs -
        iLabelLocation -
        la -
        dX -
        dY -
        fontHeight - , see also: computeFontHeight
        Returns:
        RotatedRectangle
        Throws:
        java.lang.IllegalArgumentException
      • computePolygon

        public static final RotatedRectangle computePolygon​(ITextMetrics itm,
                                                            int iLabelLocation,
                                                            Label la,
                                                            double dX,
                                                            double dY,
                                                            java.lang.Double fontHeight)
                                                     throws java.lang.IllegalArgumentException
        Parameters:
        xs -
        iLabelLocation -
        la -
        dX -
        dY -
        fontHeight - , see also: computeFontHeight
        Returns:
        RotatedRectangle
        Throws:
        java.lang.IllegalArgumentException
      • computeRotatedTopPoint

        public static final Location computeRotatedTopPoint​(IDisplayServer xs,
                                                            BoundingBox bbox,
                                                            Label la,
                                                            double fullHeight)
                                                     throws java.lang.IllegalArgumentException
        Parameters:
        xs -
        bbox -
        la -
        fullHeight -
        Returns:
        Location
        Throws:
        java.lang.IllegalArgumentException
      • computeBox

        public static final BoundingBox computeBox​(IDisplayServer xs,
                                                   int iLabelLocation,
                                                   Label la,
                                                   double dX,
                                                   double dY)
                                            throws java.lang.IllegalArgumentException
        Parameters:
        xs -
        iLabelLocation -
        la -
        dX -
        dY -
        Returns:
        BoundingBox
        Throws:
        java.lang.IllegalArgumentException
      • computeLabelSize

        public static final BoundingBox computeLabelSize​(IDisplayServer xs,
                                                         Label la,
                                                         double dWrapping,
                                                         java.lang.Double fontHeight)
                                                  throws ChartException
        Compute the size of a label.
        Parameters:
        xs -
        la -
        dWrapping -
        fontHeight - , pre-computed font height
        Returns:
        BoundingBox
        Throws:
        ChartException
      • computeBox

        public static final BoundingBox computeBox​(IDisplayServer xs,
                                                   int iLabelLocation,
                                                   Label la,
                                                   double dX,
                                                   double dY,
                                                   double dWrapping)
                                            throws java.lang.IllegalArgumentException
        Parameters:
        xs -
        iLabelLocation -
        la -
        dX -
        dY -
        dWrapping - the max size for wrapping by pixels
        Returns:
        BoundingBox
        Throws:
        java.lang.IllegalArgumentException
      • computeBox

        public static final BoundingBox computeBox​(IDisplayServer xs,
                                                   ITextMetrics itm,
                                                   int iLabelLocation,
                                                   Label la,
                                                   double dX,
                                                   double dY,
                                                   java.lang.Double fontHeight)
                                            throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • computeBox

        public static final BoundingBox computeBox​(IDisplayServer xs,
                                                   int iLabelLocation,
                                                   Label la,
                                                   double dX,
                                                   double dY,
                                                   double dWrapping,
                                                   java.lang.Double fontHeight)
                                            throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • getLabelPosition

        public static final int getLabelPosition​(Position lp)
        Converts to internal (non public-model) data structures
        Parameters:
        lp -
        Returns:
        position state
      • computeFontHeight

        public static double computeFontHeight​(IDisplayServer xs,
                                               Label la)
        Convenient method to compute the font's height of a label. This computation is costly, but in most case we do not change the font of a label, we just change the string value, so the font height will not changed. The purpose of the method is to get the font height overhead for reusing.
        Parameters:
        xs -
        la -
        Returns:
        font height