public class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static double |
HALF_PI |
static double |
THREE_HALF_PI |
static double |
TWO_PI |
Modifier and Type | Method and Description |
---|---|
static String |
arrayOffloatAsCSStrings(float[] ar) |
static boolean |
containsGlyph(Glyph[] ga,
Glyph g)
Checks whether Glyph array ga contains glyph g or not.
|
static boolean |
containsGlyph(Glyph[] ga,
Glyph g,
int maxIndex)
Checks whether Glyph array ga contains glyph g or not within its first N items.
|
static void |
delLeadingSpaces(StringBuffer sb) |
static Glyph |
getClosestGlyph(Glyph[] glyphs,
Point2D.Double vp)
Get glyph closest to a given point in virtual space.
|
static Color |
getColorByKeyword(String keyword)
Get the Java AWT color which corresponds to a color keyword as defined in http://www.w3.org/TR/SVG/types.html#ColorKeywords.
|
static int |
getMenuShortcutKeyMod() |
static int |
getMenuShortcutKeyPlusShiftMod() |
static int |
indexOfGlyph(Glyph[] ga,
Glyph g)
Checks whether Glyph array ga contains glyph g or not and returns its index.
|
static int |
indexOfGlyph(Glyph[] ga,
Glyph g,
int maxIndex)
Checks whether Glyph array ga contains glyph g or not within its first N items, and returns its index.
|
static boolean |
javaVersionIs140OrLater()
tells wheter the current JVM is version 1.4.0 and later (or not)
|
static void |
main(String[] args) |
static Paint |
makeDiagGradient(float width,
float height,
Color centerColor)
Returns a diagonal gradient centered around a color (upper left
corner is lighter, lower right corner is darker)
|
static boolean |
osIsMacOS()
tells wheter the underlying OS is Mac OS X or not
|
static boolean |
osIsWindows()
tells whether the underlying OS is Windows(Win32) or not
|
static Image |
readImage(String filePath) |
static String |
replaceString(String input,
String key,
String replacement)
Replaces all occurences of key in input by replacement
|
static void |
tile(String src,
String targetPattern,
int tileSize) |
static double[] |
widthHeight(Glyph glyph) |
public static final double TWO_PI
public static final double HALF_PI
public static final double THREE_HALF_PI
public static Color getColorByKeyword(String keyword)
keyword
- a color keyword name such as black, blue, lime, darkorchid, etc...public static int getMenuShortcutKeyMod()
public static int getMenuShortcutKeyPlusShiftMod()
public static String arrayOffloatAsCSStrings(float[] ar)
public static boolean javaVersionIs140OrLater()
public static boolean osIsMacOS()
public static boolean osIsWindows()
public static String replaceString(String input, String key, String replacement)
public static void delLeadingSpaces(StringBuffer sb)
sb
- a StringBuffer from which leading whitespaces should be removedpublic static boolean containsGlyph(Glyph[] ga, Glyph g)
public static boolean containsGlyph(Glyph[] ga, Glyph g, int maxIndex)
maxIndex
- look for g in items in range [0,maxIndex[public static Glyph getClosestGlyph(Glyph[] glyphs, Point2D.Double vp)
public static int indexOfGlyph(Glyph[] ga, Glyph g)
public static int indexOfGlyph(Glyph[] ga, Glyph g, int maxIndex)
maxIndex
- look for g in items in range [0,maxIndex[public static double[] widthHeight(Glyph glyph)
public static Paint makeDiagGradient(float width, float height, Color centerColor)
width
- gradient widthheight
- gradient heightcenterColor
- center colorpublic static void main(String[] args)
Copyright © 2000-2002 Xerox Corporation. All Rights Reserved
Copyright © 2003 World Wide Web Consortium. All Rights Reserved
Copyright © 2004-2015 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.