de.muntjak.tinylookandfeel
Class TinyUtils

java.lang.Object
  extended by de.muntjak.tinylookandfeel.TinyUtils

public class TinyUtils
extends java.lang.Object

TinyUtils provides some static utility methods.

Since:
1.4.0

Field Summary
static java.lang.Object AA_TEXT_PROPERTY_KEY
          This key is a hidden "feature".
 
Constructor Summary
TinyUtils()
           
 
Method Summary
static void drawStringUnderlineCharAt(javax.swing.JComponent client, java.awt.Graphics g, java.lang.String text, int underlinedIndex, int x, int y)
          Draw a string with the graphics g at location (x, y) just like g.drawString would.
static java.lang.String getJavaVersion()
          Returns the JRE version.
static java.lang.String getSystemProperty(java.lang.String key)
          Returns the value of the system property corresponding to key argument.
static java.lang.String getSystemPropertyPrivileged(java.lang.String key)
          Retrieves a system property by executing a privileged block.
static boolean is1dot4()
          Returns true if we are running JRE 1.4 or lower, false otherwise.
static boolean is1dot5()
          Returns true if we are running JRE 1.5.x, false otherwise.
static boolean is1dot6()
          Returns true if we are running JRE 1.6.x, false otherwise.
static boolean isOSLinux()
          Returns true if we are running on Linux, false otherwise.
static boolean isOSMac()
          Returns true if we are running on Mac OS, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AA_TEXT_PROPERTY_KEY

public static final java.lang.Object AA_TEXT_PROPERTY_KEY
This key is a hidden "feature". Setting this client property (for any tabbed pane, menu or menu item) to Boolean.TRUE overrides all other text antialiasing settings.

Constructor Detail

TinyUtils

public TinyUtils()
Method Detail

getSystemPropertyPrivileged

public static java.lang.String getSystemPropertyPrivileged(java.lang.String key)
Retrieves a system property by executing a privileged block.

Parameters:
key - a non-null system property key
Returns:
the value of a system property, null if the key is unknown

isOSLinux

public static boolean isOSLinux()
Returns true if we are running on Linux, false otherwise.

Returns:
true if we are running on Linux, false otherwise.

isOSMac

public static boolean isOSMac()
Returns true if we are running on Mac OS, false otherwise.

Returns:
true if we are running on Mac OS, false otherwise.

is1dot4

public static boolean is1dot4()
Returns true if we are running JRE 1.4 or lower, false otherwise.

Returns:
true if we are running JRE 1.4 or lower, false otherwise.

is1dot5

public static boolean is1dot5()
Returns true if we are running JRE 1.5.x, false otherwise.

Returns:
true if we are running JRE 1.5.x, false otherwise.

is1dot6

public static boolean is1dot6()
Returns true if we are running JRE 1.6.x, false otherwise.

Returns:
true if we are running JRE 1.6.x, false otherwise.

getJavaVersion

public static java.lang.String getJavaVersion()
Returns the JRE version.

Returns:
the JRE version

drawStringUnderlineCharAt

public static void drawStringUnderlineCharAt(javax.swing.JComponent client,
                                             java.awt.Graphics g,
                                             java.lang.String text,
                                             int underlinedIndex,
                                             int x,
                                             int y)
Draw a string with the graphics g at location (x, y) just like g.drawString would. The character at index underlinedIndex in text will be underlined. If index is beyond the bounds of text (including < 0), nothing will be underlined.

Parameters:
client - the component for which we are drawing
g - Graphics to draw with
text - String to draw
underlinedIndex - Index of character in text to underline
x - x coordinate to draw at
y - y coordinate to draw at

getSystemProperty

public static java.lang.String getSystemProperty(java.lang.String key)
Returns the value of the system property corresponding to key argument.

Parameters:
key - a non-null system property key
Returns:
the value of a system property, null if either the key is unknown or a SecurityExcpetion was raised