|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.util.Utilities
public class Utilities
Contribution from NetBeans: Issue #319-swingx.
PENDING: need to reconcile with OS, JVM... added as-is because needed the shortcut handling to fix #
Field Summary | |
---|---|
static int |
OS_AIX
Operating system is IBM AIX. |
static int |
OS_FREEBSD
Operating system is FreeBSD |
static int |
OS_HP
Operating system is HP-UX. |
static int |
OS_IRIX
Operating system is SGI IRIX. |
static int |
OS_LINUX
Operating system is Linux. |
static int |
OS_MAC
Operating system is Mac. |
static int |
OS_OS2
Operating system is OS/2. |
static int |
OS_OTHER
Operating system is unknown. |
static int |
OS_SOLARIS
Operating system is Solaris. |
static int |
OS_SUNOS
Operating system is Sun OS. |
static int |
OS_TRU64
Operating system is Compaq TRU64 Unix |
static int |
OS_UNIX_MASK
A mask for Unix platforms. |
static int |
OS_VMS
Operating system is Compaq OpenVMS |
static int |
OS_WIN_OTHER
Operating system is one of the Windows variants but we don't know which one it is |
static int |
OS_WIN2000
Operating system is Windows 2000. |
static int |
OS_WIN95
Operating system is Windows 95. |
static int |
OS_WIN98
Operating system is Windows 98. |
static int |
OS_WINDOWS_MASK
A mask for Windows platforms. |
static int |
OS_WINNT
Operating system is Windows NT. |
static int |
TYPICAL_WINDOWS_TASKBAR_HEIGHT
A height of the windows's taskbar |
Method Summary | |
---|---|
static int |
getOperatingSystem()
Get the operating system on which NetBeans is running. |
static Rectangle |
getUsableScreenBounds()
Returns the usable area of the screen where applications can place its windows. |
static Rectangle |
getUsableScreenBounds(GraphicsConfiguration gconf)
Returns the usable area of the screen where applications can place its windows. |
static boolean |
isLargeFrameIcons()
Test whether the operating system supports icons on frames (windows). |
static boolean |
isUnix()
Test whether NetBeans is running on some variant of Unix. |
static boolean |
isWindows()
Test whether NetBeans is running on some variant of Windows. |
static String |
keyToString(KeyStroke stroke)
Converts a Swing key stroke descriptor to a familiar Emacs-like name. |
static KeyStroke |
stringToKey(String s)
Construct a new key description from a given universal string description. |
static KeyStroke[] |
stringToKeys(String s)
Convert a space-separated list of Emacs-like key binding names to a list of Swing key strokes. |
static Object[] |
toObjectArray(Object array)
Convert an array of primitive types to an array of objects. |
static Object |
toPrimitiveArray(Object[] array)
Convert an array of objects to an array of primitive types. |
static String[] |
wrapStringToArray(String original,
int width,
BreakIterator breakIterator,
boolean removeNewLines)
Wrap multi-line strings (and get the individual lines). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int OS_WINNT
public static final int OS_WIN95
public static final int OS_WIN98
public static final int OS_SOLARIS
public static final int OS_LINUX
public static final int OS_HP
public static final int OS_AIX
public static final int OS_IRIX
public static final int OS_SUNOS
public static final int OS_TRU64
public static final int OS_OS2
public static final int OS_MAC
public static final int OS_WIN2000
public static final int OS_VMS
public static final int OS_WIN_OTHER
public static final int OS_OTHER
public static final int OS_FREEBSD
public static final int OS_WINDOWS_MASK
public static final int OS_UNIX_MASK
public static final int TYPICAL_WINDOWS_TASKBAR_HEIGHT
Method Detail |
---|
public static int getOperatingSystem()
OS_*
constants (such as OS_WINNT
)public static boolean isWindows()
true
if Windows, false
if some other manner of operating systempublic static boolean isUnix()
true
some sort of Unix, false
if some other manner of operating systempublic static boolean isLargeFrameIcons()
true
if it does notpublic static Rectangle getUsableScreenBounds()
public static Rectangle getUsableScreenBounds(GraphicsConfiguration gconf)
gconf
- the GraphicsConfiguration of the monitor
public static String keyToString(KeyStroke stroke)
stroke
- key description
CS-F1
for control-shift-function key one)stringToKey(java.lang.String)
public static KeyStroke stringToKey(String s)
KeyStroke
object used in Swing.
This format has following form:
[C][A][S][M]-identifier
Where:
C
stands for the Control key
A
stands for the Alt key
S
stands for the Shift key
M
stands for the Meta key
D
stands for the default menu accelerator - the Control
key on most platforms, the Command (meta) key on MacintoshO
stands for the alternate accelerator - the Alt key on
most platforms, the Ctrl key on Macintosh (Macintosh uses Alt as a
secondary shift key for composing international characters - if you bind
Alt-8 to an action, a mac user with a French keyboard will not be able
to type the [
character, which is a significant handicapD-Q
will always map to Control-Q.
Every modifier before the hyphen must be pressed.
identifier can be any text constant from KeyEvent
but
without the leading VK_
characters. So KeyEvent.VK_ENTER
is described as
ENTER
.
s
- the string with the description of the key
null
if the string does not represent any valid keypublic static KeyStroke[] stringToKeys(String s)
s
- the string with keys
null
if the string description is not validstringToKey(java.lang.String)
public static Object toPrimitiveArray(Object[] array)
Integer[]
would be changed to an int[]
.
array
- the wrapper array
IllegalArgumentException
- if the array element type is not a primitive wrapperpublic static Object[] toObjectArray(Object array)
int[]
would be turned into an Integer[]
.
array
- the primitive array
IllegalArgumentException
- if the array element type is not primitivepublic static String[] wrapStringToArray(String original, int width, BreakIterator breakIterator, boolean removeNewLines)
original
- the original string to wrapwidth
- the maximum width of linesbreakIterator
- breaks original to chars, words, sentences, depending on what instance you provide.removeNewLines
- if true
, any newlines in the original string are ignored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |