|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.amis.pogamut.usar2004.samples.AirScanner.ToolBox
public class ToolBox
ToolBox class covers methods that help solve comon/easy tasks.
Constructor Summary | |
---|---|
ToolBox()
|
Method Summary | |
---|---|
static double |
getAngle(double sx,
double cx)
Determines an angle in degrees based on sin and cos of the angle. |
static int |
getMax(int[] array)
Returns maximum value from the input array. |
static int |
getMin(int i,
int j,
int k,
int l)
Uses Math.min method to determine the minimum of the four input values. |
static String |
getTime(long elapsed)
Uses DateFormat to format the input value to hours, minutes, seconds and mili seconds. |
static String |
getTwoDecimalPlaces(double value)
Uses DecimalFormat to format the value. |
static double[][] |
initArray(int width,
int height)
Initial value will be Double.MIN_VALUE. |
static double[][] |
resizeArray(double[][] original,
int x,
int y,
int offsetX,
int offsetY)
Creates new array enlongated by x and y and fills it with old walues at offsetX, offsetY. |
static BufferedImage |
resizeImage(Image original,
int x,
int y,
int offsetX,
int offsetY)
Creates new a image enlarged by x and y and draws old image at offsetX, offsetY. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ToolBox()
Method Detail |
---|
public static int getMax(int[] array)
array
- Input array.
public static String getTime(long elapsed)
elapsed
- Elapsed time in miliseconds.
public static int getMin(int i, int j, int k, int l)
i
- first numberj
- second numberk
- third nubmerl
- fourth number
public static double getAngle(double sx, double cx)
sx
- Sinus xcx
- Cosinus x
public static String getTwoDecimalPlaces(double value)
value
- Double value to convert to string.
public static BufferedImage resizeImage(Image original, int x, int y, int offsetX, int offsetY)
original
- Original image to be stretched.x
- Widht enlargement.y
- Height enlargement.offsetX
- Offset for original picture to be drawn at x-axis.offsetY
- Offset for original picture to be drawn at y-axis.
public static double[][] resizeArray(double[][] original, int x, int y, int offsetX, int offsetY)
original
- Original array to be lengthened.x
- Width enlargement.y
- Height enlargement.offsetX
- Offset for original data at x-axis.offsetY
- Offset for original data at y-axis.
public static double[][] initArray(int width, int height)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |