|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcpsim.util.util
public final class util
Various utility routines
| Nested Class Summary | |
|---|---|
static class |
util.H
|
static class |
util.V
|
| Method Summary | |
|---|---|
static void |
centerFrame(javax.swing.JFrame frame,
double ratio)
|
static java.lang.String |
chars(char c,
int n)
|
int |
clipToByte(int x)
|
static int |
dpPosition(double x)
Position of the decimal point. |
static java.lang.String |
fnum(double x,
int integer,
int fraction)
|
static java.lang.String |
format(double value,
double min,
double max,
double step)
|
static double |
fraction(double x)
|
static int |
fractionNeeded(double x)
TODO: This is not very elegant. |
static java.awt.Color |
gamma(java.awt.Color c,
double gamma)
Gamma filter for colors. |
static java.lang.String |
getClassName(java.lang.Object o)
|
static java.lang.String |
getExtension(java.io.File f)
Returns the (lowercase) extension of the name of the file. |
static java.net.URL[] |
getJarURLs(java.lang.String directory)
|
static org.w3c.dom.Document |
getNewDocument()
|
static org.w3c.dom.Document |
getXmlDocument(java.io.File file)
|
static org.w3c.dom.Document |
getXmlDocument(java.io.InputStream is)
|
static java.lang.String |
I18N(java.util.ResourceBundle rb,
java.lang.String s)
Fetches a string from a ResourceBundle. |
static java.lang.String[] |
I18Ns(java.util.ResourceBundle rb,
java.lang.String s)
Fetches a string array from a ResourceBundle. |
static int |
integerNeeded(double x)
Calculates the number digits before the decimal point (including the minus sign). |
static double |
log10(double x)
|
static java.lang.String |
lpos(int n,
java.lang.String s)
|
static void |
paintButtonBg(java.awt.Graphics2D g2,
double w,
double h,
java.awt.Color c)
|
static void |
paintButtonBg(java.awt.Graphics2D g2,
double w,
double h,
double m,
java.awt.Color c)
|
static void |
paintButtonBg(java.awt.Graphics2D g2,
double wd,
double hd,
double md,
java.awt.Color c,
java.awt.Color c1,
java.awt.Color c2)
|
static void |
paintText(java.awt.Graphics2D g2,
java.lang.String s,
util.H h,
util.V v,
double x,
double y)
|
static void |
paintTextCA(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
|
static void |
paintTextCB(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
|
static void |
paintTextCC(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
|
static void |
paintTextCD(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
|
static void |
paintTextLA(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
|
static void |
paintTextLB(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
|
static void |
paintTextLC(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
|
static void |
paintTextLD(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
|
static void |
paintTextRA(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
|
static void |
paintTextRB(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
|
static void |
paintTextRC(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
|
static void |
paintTextRD(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
|
static void |
printResourceBundle(java.util.ResourceBundle rb)
Outputs all elements of a ResourceBundle. |
static double |
quadEquationBigger(double a,
double b,
double c)
Returns the bigger result of a quadratic equation (ax2 + bx + c = 0). |
static double |
quadEquationSmaller(double a,
double b,
double c)
Returns the smaller result of a quadratic equation (ax2 + bx + c = 0). |
static java.lang.String |
rpos(int n,
java.lang.String s)
|
static int |
sign(double x)
|
int |
toRGB(double r,
double g,
double b)
|
static java.awt.Color |
withAlpha(java.awt.Color c,
int alpha)
|
static void |
writeXmlFile(org.w3c.dom.Document document,
java.io.File file,
boolean indent)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.awt.Color gamma(java.awt.Color c,
double gamma)
c - the color to be changedgamma - the gamma factor
public static java.awt.Color withAlpha(java.awt.Color c,
int alpha)
public static java.lang.String I18N(java.util.ResourceBundle rb,
java.lang.String s)
ResourceBundle.
public static java.lang.String[] I18Ns(java.util.ResourceBundle rb,
java.lang.String s)
ResourceBundle.
public static void printResourceBundle(java.util.ResourceBundle rb)
ResourceBundle.
TODO: Sort for key;
TODO: Justify output.
public static double quadEquationBigger(double a,
double b,
double c)
public static double quadEquationSmaller(double a,
double b,
double c)
public static int sign(double x)
public static void paintButtonBg(java.awt.Graphics2D g2,
double w,
double h,
java.awt.Color c)
public static void paintButtonBg(java.awt.Graphics2D g2,
double w,
double h,
double m,
java.awt.Color c)
public static void paintButtonBg(java.awt.Graphics2D g2,
double wd,
double hd,
double md,
java.awt.Color c,
java.awt.Color c1,
java.awt.Color c2)
public static void paintText(java.awt.Graphics2D g2,
java.lang.String s,
util.H h,
util.V v,
double x,
double y)
public static void paintTextLB(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
public static void paintTextCB(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
public static void paintTextRB(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
public static void paintTextLA(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
public static void paintTextCA(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
public static void paintTextRA(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
public static void paintTextLC(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
public static void paintTextCC(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
public static void paintTextRC(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
public static void paintTextLD(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
public static void paintTextCD(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
public static void paintTextRD(java.awt.Graphics2D g2,
java.lang.String s,
double x,
double y)
public static java.lang.String chars(char c,
int n)
public static java.lang.String lpos(int n,
java.lang.String s)
public static java.lang.String rpos(int n,
java.lang.String s)
public static java.lang.String getClassName(java.lang.Object o)
public static double log10(double x)
public static double fraction(double x)
public static int dpPosition(double x)
x - The value to check.
public static int integerNeeded(double x)
public static int fractionNeeded(double x)
public static java.lang.String fnum(double x,
int integer,
int fraction)
x - integer - fraction -
public static java.lang.String format(double value,
double min,
double max,
double step)
public int clipToByte(int x)
public int toRGB(double r,
double g,
double b)
public static org.w3c.dom.Document getXmlDocument(java.io.File file)
public static org.w3c.dom.Document getXmlDocument(java.io.InputStream is)
public static org.w3c.dom.Document getNewDocument()
public static void writeXmlFile(org.w3c.dom.Document document,
java.io.File file,
boolean indent)
public static java.lang.String getExtension(java.io.File f)
public static java.net.URL[] getJarURLs(java.lang.String directory)
public static void centerFrame(javax.swing.JFrame frame,
double ratio)
frame - the frame that schall be resized and centered on the screenratio - 0.5: half width and half height of screen
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||