|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectacm.util.Platform
public class Platform
This class contains methods to support platform-specific code.
| Field Summary | |
|---|---|
int |
MAC
|
int |
UNIX
|
int |
UNKNOWN
|
int |
WINDOWS
|
| Method Summary | |
|---|---|
boolean |
areCollectionsAvailable()
|
boolean |
areStandardFontFamiliesAvailable()
Serif,
SansSerif, and Monospaced) are available. |
int |
compareVersion(String version)
|
int |
compareVersion(String v1,
String v2)
v1 and v2
and returns -1, 0, or +1 depending on whether v1 is earlier
than, equal to, or later than v2. |
void |
copyFileTypeAndCreator(File oldFile,
File newFile)
|
String |
getJTFVersion()
compareVersion method. |
int |
getPlatform()
|
boolean |
isJMFAvailable()
|
boolean |
isMac()
|
boolean |
isSunAudioAvailable()
sun.audio package is available. |
boolean |
isSwingAvailable()
|
boolean |
isUnix()
|
boolean |
isWindows()
|
void |
setFileTypeAndCreator(File file,
String type,
String creator)
|
void |
setFileTypeAndCreator(String filename,
String type,
String creator)
|
| Field Detail |
|---|
public static final int MAC
public static final int UNIX
public static final int UNKNOWN
public static final int WINDOWS
| Method Detail |
|---|
public static boolean areCollectionsAvailable()ArrayList class.
Usage: | if (Platform.areCollectionsAvailable()) . . . |
Returns: | true if collections are available, false otherwise
|
public static boolean areStandardFontFamiliesAvailable()Serif,
SansSerif, and Monospaced) are available.
Usage: | if (Platform.areStandardFontFamiliesAvailable()) . . . |
Returns: | true if the standard fonts are available, false otherwise
|
public static int compareVersion(String version)
if (Platform.compareVersion("1.2.1") >= 0) . . .
Usage: | int cmp = Platform.compareVersion(version); | ||
Parameter: |
| ||
Returns: | -1, 0, or +1 depending on whether the system version is earlier than, equal to, or later than the specified one |
public static int compareVersion(String v1,
String v2)v1 and v2
and returns -1, 0, or +1 depending on whether v1 is earlier
than, equal to, or later than v2.
Usage: | int cmp = Platform.compareVersion(v1, v2); | ||||
Parameters: |
| ||||
Returns: | -1, 0, or +1 depending on whether v1 is earlier than,
equal to, or later than v2
|
public static void copyFileTypeAndCreator(File oldFile,
File newFile)Usage: | Platform.copyFileTypeAndCreator(oldFile, newFile); | ||||
Parameters: |
|
public static String getJTFVersion()compareVersion method. Note
that this returns the value of the version of the library that is
actually loaded. Making this a constant would mean that the value
would be the one with which the code was compiled, which is less
likely to be useful.
Usage: | String version = getJTFVersion(); |
Returns: | The loaded version of the JTF libraries |
public static int getPlatform()Usage: | int platform = Platform.getPlatform(); |
Returns: | A constant specifying the platform type |
public static boolean isJMFAvailable()Usage: | if (Platform.isJMFAvailable()) . . . |
Returns: | true if the JMF package is available, false otherwise
|
public static boolean isMac()Usage: | if (Platform.isMac()) . . . |
Returns: | true if the platform is a Macintosh, false otherwise
|
public static boolean isSunAudioAvailable()sun.audio package is available.
Usage: | if (Platform.isSunAudioAvailable()) . . . |
Returns: | true if the sun.audio package is available,
false otherwise
|
public static boolean isSwingAvailable()JComponent class. Checking the version first
means that no SecurityExceptionsSecurityExceptionsUsage: | if (Platform.isSwingAvailable()) . . . |
Returns: | true if Swing is available, false otherwise
|
public static boolean isUnix()Usage: | if (Platform.isUnix()) . . . |
Returns: | true if the platform is Unix, false otherwise
|
public static boolean isWindows()Usage: | if (Platform.isWindows()) . . . |
Returns: | true if the platform is a Windows machine, false otherwise
|
public static void setFileTypeAndCreator(File file,
String type,
String creator)Usage: | Platform.setFileTypeAndCreator(file, type, creator); | ||||||
Parameters: |
|
public static void setFileTypeAndCreator(String filename,
String type,
String creator)Usage: | Platform.setFileTypeAndCreator(filename, type, creator); | ||||||
Parameters: |
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||