Class LookUtils
java.lang.Object
org.pushingpixels.lafwidget.utils.LookUtils
Provides convenience behavior used by the JGoodies Looks.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanTrue if this is Java 1.4.static final booleanTrue if this is Java 1.4.0_*.static final booleanTrue if this is Java 1.4.2 or later.static final booleanTrue if this is Java 1.4 or Java 5.static final booleanTrue if this is Java 5.x.static final booleanTrue if this is Java 5.x or later.static final booleanTrue if this is Java 6.static final booleanTrue if this is Java 6.x or later.static final booleanTrue if the Windows XP Look&Feel is enabled.static final booleanTrue if if the screen resolution is smaller than 120 dpi.static final booleanTrue if this is FreeBSD.static final booleanTrue if this is Linux.static final booleanTrue if this is the Mac OS X.static final booleanTrue if this is OS/2.static final booleanTrue if this is Solaris.static final booleanTrue if this is Windows.static final booleanTrue if this is Windows 2000.static final booleanTrue if this is Windows 95.static final booleanTrue if this is Windows 98.static final booleanTrue if this is Windows ME.static final booleanTrue if this is Windows 98/ME/2000/XP/VISTA.static final booleanTrue if this is Windows NT.static final booleanTrue if this is Windows Vista.static final booleanTrue if this is Windows XP. -
Method Summary
Modifier and TypeMethodDescriptionstatic BooleangetBooleanSystemProperty(String key, String logMessage) Checks if a boolean system property has been set for the given key, and returns the associated Boolean, ornullif no value has been set.static ColorgetSlightlyBrighter(Color color) Computes and returns a Color that is slightly brighter than the specified Color.static ColorgetSlightlyBrighter(Color color, float factor) Computes and returns a Color that is slightly brighter than the specified Color.static StringgetSystemProperty(String key) Tries to look up the System property for the given key.static StringgetSystemProperty(String key, String defaultValue) Tries to look up the System property for the given key.static booleanChecks and answers whether this toolkit provides native drop shadows for popups such as the Mac OS X.static booleanChecks and answers whether we have a true color system.static voidlog()Prints a new line to the console if logging is enabled.static voidPrints the given message to the console if logging is enabled.static voidsetLoggingEnabled(boolean enabled) Enables or disables the Looks logging.
-
Field Details
-
IS_JAVA_1_4
public static final boolean IS_JAVA_1_4True if this is Java 1.4. -
IS_JAVA_1_4_0
public static final boolean IS_JAVA_1_4_0True if this is Java 1.4.0_*. -
IS_JAVA_1_4_2_OR_LATER
public static final boolean IS_JAVA_1_4_2_OR_LATERTrue if this is Java 1.4.2 or later. Since we assume Java 1.4 we just check for 1.4.0 and 1.4.1. -
IS_JAVA_5
public static final boolean IS_JAVA_5True if this is Java 5.x. We check for a prefix of 1.5. -
IS_JAVA_5_OR_LATER
public static final boolean IS_JAVA_5_OR_LATERTrue if this is Java 5.x or later. Since we don't support Java 1.3, we can check that it's not 1.4. -
IS_JAVA_6
public static final boolean IS_JAVA_6True if this is Java 6. We check for a prefix of 1.6. -
IS_JAVA_6_OR_LATER
public static final boolean IS_JAVA_6_OR_LATERTrue if this is Java 6.x or later. Since we don't support Java 1.3, we can check that it's neither 1.4 nor 1.5. -
IS_JAVA_1_4_OR_5
public static final boolean IS_JAVA_1_4_OR_5True if this is Java 1.4 or Java 5. -
IS_OS_FREEBSD
public static final boolean IS_OS_FREEBSDTrue if this is FreeBSD. -
IS_OS_LINUX
public static final boolean IS_OS_LINUXTrue if this is Linux. -
IS_OS_OS2
public static final boolean IS_OS_OS2True if this is OS/2. -
IS_OS_MAC
public static final boolean IS_OS_MACTrue if this is the Mac OS X. -
IS_OS_WINDOWS
public static final boolean IS_OS_WINDOWSTrue if this is Windows. -
IS_OS_WINDOWS_MODERN
public static final boolean IS_OS_WINDOWS_MODERNTrue if this is Windows 98/ME/2000/XP/VISTA. -
IS_OS_WINDOWS_95
public static final boolean IS_OS_WINDOWS_95True if this is Windows 95.- Since:
- 2.0
-
IS_OS_WINDOWS_98
public static final boolean IS_OS_WINDOWS_98True if this is Windows 98.- Since:
- 2.0
-
IS_OS_WINDOWS_NT
public static final boolean IS_OS_WINDOWS_NTTrue if this is Windows NT.- Since:
- 2.0
-
IS_OS_WINDOWS_ME
public static final boolean IS_OS_WINDOWS_METrue if this is Windows ME.- Since:
- 2.0
-
IS_OS_WINDOWS_2000
public static final boolean IS_OS_WINDOWS_2000True if this is Windows 2000.- Since:
- 2.0
-
IS_OS_WINDOWS_XP
public static final boolean IS_OS_WINDOWS_XPTrue if this is Windows XP. -
IS_OS_WINDOWS_VISTA
public static final boolean IS_OS_WINDOWS_VISTATrue if this is Windows Vista.- Since:
- 2.0
-
IS_OS_SOLARIS
public static final boolean IS_OS_SOLARISTrue if this is Solaris. -
IS_LAF_WINDOWS_XP_ENABLED
public static final boolean IS_LAF_WINDOWS_XP_ENABLEDTrue if the Windows XP Look&Feel is enabled. -
IS_LOW_RESOLUTION
public static final boolean IS_LOW_RESOLUTIONTrue if if the screen resolution is smaller than 120 dpi.- See Also:
-
-
Method Details
-
getSystemProperty
Tries to look up the System property for the given key. In untrusted environments this may throw a SecurityException. In this case we catch the exception and answernull.- Parameters:
key- the name of the system property- Returns:
- the system property's String value, or
nullif there's no such value, or a SecurityException has been caught
-
getSystemProperty
Tries to look up the System property for the given key. In untrusted environments this may throw a SecurityException. In this case, we catch the exception and answer the default value.- Parameters:
key- the name of the system propertydefaultValue- the default value if no property exists.- Returns:
- the system property's String value, or the defaultValue if there's no such value, or a SecurityException has been caught
-
getBooleanSystemProperty
Checks if a boolean system property has been set for the given key, and returns the associated Boolean, ornullif no value has been set. The test for the property ignores case. If a Boolean value has been set, a message is logged with the given prefix.- Parameters:
key- the key used to lookup the system property valuelogMessage- a prefix used when a message is logged- Returns:
Boolean.TRUEif the system property has been set to "true" (case ignored),Boolean.FALSEif it has been set to "false",nullotherwise
-
isTrueColor
Checks and answers whether we have a true color system.- Parameters:
c- the component used to determine the toolkit- Returns:
- true if the component's toolkit has a pixel size >= 24
-
getToolkitUsesNativeDropShadows
public static boolean getToolkitUsesNativeDropShadows()Checks and answers whether this toolkit provides native drop shadows for popups such as the Mac OS X. Currently this is used to determine if the Looks' popup drop shadow feature is active or not - even if it's enabled.- Returns:
- true if the toolkit provides native drop shadows
-
getSlightlyBrighter
Computes and returns a Color that is slightly brighter than the specified Color.- Parameters:
color- the color used as basis for the brightened color- Returns:
- a slightly brighter color
-
getSlightlyBrighter
Computes and returns a Color that is slightly brighter than the specified Color.- Parameters:
color- the color used as basis for the brightened colorfactor- the factor used to compute the brightness- Returns:
- a slightly brighter color
-
setLoggingEnabled
public static void setLoggingEnabled(boolean enabled) Enables or disables the Looks logging.- Parameters:
enabled- true to enable logging, false to disable it
-
log
public static void log()Prints a new line to the console if logging is enabled. -
log
Prints the given message to the console if logging is enabled.- Parameters:
message- the message to print
-