Package org.jCharts.test
Class TestDataGenerator
java.lang.Object
org.jCharts.test.TestDataGenerator
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static Color
Random Color generator.static Font
getRandomFont
(double minSize, double maxSize) Random font generator based on the available Fonts on this machine.static double
getRandomNumber
(double maxValue) Random number generator.protected static double
getRandomNumber
(double minValue, double maxValue) Random number generator in specified range.static double[]
getRandomNumbers
(int numToGenerate, double minValue, double maxValue) Random numbers generator in specified range.static double[][]
getRandomNumbers
(int numberOfDataSets, int numToGenerate, double minValue, double maxValue) Random numbers generator in specified range.protected static Paint
Random Paint generator.static Paint[]
getRandomPaints
(int numToCreate) Random Color generator.static Point2D.Double[]
getRandomPoints
(int numToGenerate, double xMinValue, double xMaxValue, double yMinValue, double yMaxValue) Random numbers generator in specified range.protected static String
getRandomString
(int maxStringLength, boolean canBeNull) Random String generator.protected static String[]
getRandomStrings
(int numToCreate, int maxStringLength, boolean canBeNull) Random String generator.protected static void
randomizeAxisProperties
(AxisProperties axisProperties) Takes the passed AxisProperties and randomizes it.protected static void
randomizeLegend
(LegendProperties legendProperties) Takes the passed Legend and randomizes it.
-
Field Details
-
ALL_FONTS
-
-
Constructor Details
-
TestDataGenerator
public TestDataGenerator()
-
-
Method Details
-
getRandomFont
Random font generator based on the available Fonts on this machine.- Parameters:
minSize
-maxSize
-- Returns:
- Font
-
getRandomNumber
public static double getRandomNumber(double maxValue) Random number generator.- Parameters:
maxValue
-- Returns:
- double
-
getRandomNumber
protected static double getRandomNumber(double minValue, double maxValue) Random number generator in specified range.- Parameters:
minValue
-maxValue
-- Returns:
- double
-
getRandomNumbers
public static double[] getRandomNumbers(int numToGenerate, double minValue, double maxValue) Random numbers generator in specified range.- Parameters:
numToGenerate
- the number of doubles to generateminValue
-maxValue
-- Returns:
- double[]
-
getRandomNumbers
public static double[][] getRandomNumbers(int numberOfDataSets, int numToGenerate, double minValue, double maxValue) Random numbers generator in specified range.- Parameters:
numberOfDataSets
- to generatenumToGenerate
- the number of doubles to generateminValue
-maxValue
-- Returns:
- double[]
-
getRandomPoints
public static Point2D.Double[] getRandomPoints(int numToGenerate, double xMinValue, double xMaxValue, double yMinValue, double yMaxValue) Random numbers generator in specified range.- Parameters:
numToGenerate
- the number of doubles to generatexMinValue
-xMaxValue
-yMinValue
-yMaxValue
-- Returns:
- Point.Double[]
-
getRandomPaint
Random Paint generator.- Returns:
- Paint
-
getRandomPaints
Random Color generator.- Returns:
- Paint[]
-
getRandomColor
Random Color generator.- Returns:
- Color
-
getRandomString
Random String generator.- Parameters:
maxStringLength
-canBeNull
-- Returns:
- String
-
getRandomStrings
Random String generator.- Returns:
- String[]
-
randomizeAxisProperties
Takes the passed AxisProperties and randomizes it.- Parameters:
axisProperties
-
-
randomizeLegend
Takes the passed Legend and randomizes it.- Parameters:
legendProperties
-
-