public class Utils
extends java.lang.Object
Title: misc.Utils class
Description: Chart utility procedures
Copyright (c) 2005-2019 by Steema Software SL. All Rights Reserved.
Company: Steema Software SL
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BuildNumber |
static int[] |
functionGalleryPage |
static int |
FUNCTIONTYPESCOUNT
Number of chart Function types.
|
static java.lang.Class[] |
functionTypesOf
List of chart Function types.
|
static double |
PISTEP |
static int[] |
seriesGalleryCount |
static int[] |
seriesGalleryPage |
static int |
SERIESTYPESCOUNT |
static java.lang.Class[] |
seriesTypesOf |
static int |
TOOLTYPESCOUNT
Number of chart Tool types.
|
static java.lang.Class[] |
toolTypesOf
List of chart Tool classes.
|
static java.lang.String |
VersionMode |
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
arrayToString(java.lang.String[] a) |
static java.lang.String |
arrayToString(java.lang.String[] a,
char separator) |
static double |
atan2(double y,
double x)
Note: This method has been implemented here in Utils class because J2ME
Math class does not include it.
|
static double |
calcDistance(Point p,
int x0,
int y0,
int x1,
int y1) |
static boolean |
colorIsEmpty(Color color) |
static java.lang.String |
colorToHex(Color color,
boolean ARGB) |
static int |
compareDoubles(double d1,
double d2)
Note: This code has been copied from Java JDK Double.compare method,
because J2ME Double class does not include it.
|
static Color |
darkenColor(Color AColor,
int Percentage) |
static java.lang.String |
dateTimeToDateTimeStr(DateTime datetime) |
static java.lang.String |
dateTimeToStr(DateTime datetime) |
static java.lang.String |
dateTimeToStr(double datetime) |
static java.io.InputStream |
downloadURLStream(java.lang.String url) |
static java.lang.String |
downloadURLString(java.lang.String url) |
static void |
drawCheckBox(int x,
int y,
IGraphics3D g,
boolean drawChecked,
boolean CheckBox,
Color backColor) |
static Rectangle |
emptyRectangle() |
static double |
exp(double a)
Note: This method has been implemented here in Utils class because J2ME
Math class does not include it.
|
static java.lang.String |
formatFloat(double value) |
static double |
getDateTimeStep(int value)
Evaluates and returns a steema.teechart.DateTimeStep value
as an Axis double scale that may be used to set the steema.teechart.Axis.Increment.
|
static Color |
getEmptyColor() |
static double |
hypot(double a,
double b) |
static boolean |
intersectWithRect(Rectangle r1,
Rectangle r2) |
static boolean |
isEmptyRectangle(Rectangle rect) |
static boolean |
isNullOrEmpty(java.lang.String str) |
static double |
log(double value)
Note: This function has been added to Utils because J2ME Math class does
not include it.
|
static double |
log(double x,
double numBase) |
static int |
MulDiv(int a,
int b,
int c) |
static PointDouble |
offsetPoint(PointDouble value,
double x,
double y) |
static Point |
pointAtDistance(Point aFrom,
Point aTo,
int aDist) |
static boolean |
pointInLineTolerance(Point p,
int x0,
int y0,
int x1,
int y1,
int tolerance) |
static double |
pow(double a,
double b)
Note: This method has been implemented here in Utils class because J2ME
Math class does not include it.
|
static double |
rad2Deg(double radian) |
static double[] |
rationaliseValues(double x,
double y,
double z) |
static Point[] |
rectToPolygon(Rectangle r) |
static PointDouble[] |
rectToPolygonDouble(Rectangle r) |
static int |
round(double value)
Returns the integer nearest to "value" parameter
|
static java.lang.Class |
seriesClass(java.lang.String style) |
static int |
seriesTypesIndex(java.lang.Class seriesType) |
static int |
seriesTypesIndex(ISeries s) |
static void |
sort(int[] x,
int startIndex,
int endIndex,
Comparator c) |
static void |
sort(int startIndex,
int endIndex,
Comparator c,
Swapper s) |
static double |
sqr(double x) |
static double |
stringToDouble(java.lang.String text,
double value) |
static java.lang.String |
timeToStr(DateTime datetime) |
static java.lang.String |
timeToStr(double datetime) |
static int |
toolTypeIndex(Tool tool)
Returns the index in ToolTypesOf list of a given tool instance.
|
static double |
trunc(double d)
Note: This method has been implemented here in Utils class because J2ME
Math class does not include it.
|
public static final double PISTEP
public static final java.lang.String BuildNumber
public static final java.lang.String VersionMode
public static final int TOOLTYPESCOUNT
public static final java.lang.Class[] toolTypesOf
public static final int FUNCTIONTYPESCOUNT
public static final java.lang.Class[] functionTypesOf
public static final int[] functionGalleryPage
public static final int SERIESTYPESCOUNT
public static final int[] seriesGalleryCount
public static final int[] seriesGalleryPage
public static final java.lang.Class[] seriesTypesOf
public static java.lang.String formatFloat(double value)
public static double getDateTimeStep(int value)
value
- DateTimeSteppublic static double stringToDouble(java.lang.String text, double value)
public static void sort(int startIndex, int endIndex, Comparator c, Swapper s)
public static void sort(int[] x, int startIndex, int endIndex, Comparator c)
public static int toolTypeIndex(Tool tool)
tool
- Tool to search its type in listpublic static int seriesTypesIndex(ISeries s)
public static int seriesTypesIndex(java.lang.Class seriesType)
public static java.io.InputStream downloadURLStream(java.lang.String url) throws java.net.MalformedURLException, java.io.IOException
java.net.MalformedURLException
java.io.IOException
public static java.lang.String downloadURLString(java.lang.String url) throws java.io.IOException
java.io.IOException
public static int MulDiv(int a, int b, int c)
public static java.lang.String dateTimeToStr(double datetime)
public static java.lang.String dateTimeToStr(DateTime datetime)
public static java.lang.String dateTimeToDateTimeStr(DateTime datetime)
public static java.lang.String timeToStr(double datetime)
public static java.lang.String timeToStr(DateTime datetime)
public static java.lang.String arrayToString(java.lang.String[] a)
public static java.lang.String arrayToString(java.lang.String[] a, char separator)
public static void drawCheckBox(int x, int y, IGraphics3D g, boolean drawChecked, boolean CheckBox, Color backColor)
public static Color getEmptyColor()
public static boolean colorIsEmpty(Color color)
public static java.lang.String colorToHex(Color color, boolean ARGB)
public static int round(double value)
value
- doublepublic static double calcDistance(Point p, int x0, int y0, int x1, int y1)
public static final double sqr(double x)
public static double log(double value)
value
- doublepublic static double log(double x, double numBase)
public static boolean isNullOrEmpty(java.lang.String str)
public static Rectangle emptyRectangle()
public static boolean isEmptyRectangle(Rectangle rect)
public static boolean pointInLineTolerance(Point p, int x0, int y0, int x1, int y1, int tolerance)
public static int compareDoubles(double d1, double d2)
d1
- doubled2
- doublepublic static double atan2(double y, double x)
y
- doublex
- doublepublic static double pow(double a, double b)
a
- doubleb
- doublepublic static PointDouble offsetPoint(PointDouble value, double x, double y)
public static double rad2Deg(double radian)
public static double exp(double a)
a
- doublepublic static double trunc(double d)
d
- doublepublic static PointDouble[] rectToPolygonDouble(Rectangle r)
public static java.lang.Class seriesClass(java.lang.String style)
public static double[] rationaliseValues(double x, double y, double z)
public static double hypot(double a, double b)