All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.util.JCEnvironment

java.lang.Object
   |
   +----jclass.util.JCEnvironment

public class JCEnvironment
extends Object
Static routines to provide environment information.


Variable Index

 o BROWSER_APPLETVIEWER
 o BROWSER_EXPLORER
 o BROWSER_INTERPRETER
 o BROWSER_NETSCAPE
 o BROWSER_OTHER
 o BROWSER_UNKNOWN
 o BROWSER_VISUALAGE
 o JAVA_OS
 o OS_OTHER
 o OS_UNIX

Constructor Index

 o JCEnvironment()

Method Index

 o getApplet(Component)
Follows the component's parents until a parent applet is found.
 o getAppletContext(Applet)
Gets the component's applet's context.
 o getBrowser(Component)
Returns an int corresponding to the "java.vendor" System property:
 BROWSER_UNKNOWN		   If the component's peer is null
 BROWSER_APPLETVIEWER    AppletViewer
 BROWSER_EXPLORER        MS Internet Explorer
 BROWSER_VISUALAGE       IBM VisualAge for Java
 BROWSER_INTERPRETER     Running as a mainline
 BROWSER_NETSCAPE        Netscape Navigator
 BROWSER_OTHER           Other
 
 o getJavaVersion()
Returns an int corresponding to the "java.version" System property:
 JDK 1.0.2   102
 JDK 1.1.0   110
 
 o getOS()
Returns an int corresponding to the "os.name" System property: OS_UNIX or OS_OTHER
 o inBrowser(Component)
Returns true if the component is in an applet in a browser (ie its AppletContext is not null).
 o isBrowserAppletViewer(Component)
Browser is AppletViewer
 o isBrowserExplorer(Component)
Browser is MS Internet Explorer
 o isBrowserVisualAge(Component)
Browser is IBM VisualAge for Java
 o isJavaOS()
Returns boolean, true if "os.name" equals "JavaOS", false otherwise.
 o isVisualAge()
Environment is IBM VisualAge for Java (applet viewer or interpreter)

Variables

 o OS_OTHER
 public static final int OS_OTHER
 o OS_UNIX
 public static final int OS_UNIX
 o BROWSER_UNKNOWN
 public static final int BROWSER_UNKNOWN
 o BROWSER_OTHER
 public static final int BROWSER_OTHER
 o BROWSER_INTERPRETER
 public static final int BROWSER_INTERPRETER
 o BROWSER_APPLETVIEWER
 public static final int BROWSER_APPLETVIEWER
 o BROWSER_NETSCAPE
 public static final int BROWSER_NETSCAPE
 o BROWSER_EXPLORER
 public static final int BROWSER_EXPLORER
 o BROWSER_VISUALAGE
 public static final int BROWSER_VISUALAGE
 o JAVA_OS
 public static final boolean JAVA_OS

Constructors

 o JCEnvironment
 public JCEnvironment()

Methods

 o getApplet
 public static Applet getApplet(Component comp)
Follows the component's parents until a parent applet is found. Returns null if no applet is found.

 o getAppletContext
 public static AppletContext getAppletContext(Applet applet)
Gets the component's applet's context. The applet context lets an applet control the applet's environment which is usually the browser or the applet viewer.

Returns:
null if the component is not in an applet or the applet is not in a browser.
See Also:
getAppletContext
 o inBrowser
 public static boolean inBrowser(Component comp)
Returns true if the component is in an applet in a browser (ie its AppletContext is not null).

 o getOS
 public static int getOS()
Returns an int corresponding to the "os.name" System property: OS_UNIX or OS_OTHER

 o isBrowserExplorer
 public static boolean isBrowserExplorer(Component comp)
Browser is MS Internet Explorer

 o isBrowserAppletViewer
 public static boolean isBrowserAppletViewer(Component comp)
Browser is AppletViewer

 o isBrowserVisualAge
 public static boolean isBrowserVisualAge(Component comp)
Browser is IBM VisualAge for Java

 o isVisualAge
 public static boolean isVisualAge()
Environment is IBM VisualAge for Java (applet viewer or interpreter)

 o getBrowser
 public static synchronized int getBrowser(Component comp)
Returns an int corresponding to the "java.vendor" System property:
 BROWSER_UNKNOWN		   If the component's peer is null
 BROWSER_APPLETVIEWER    AppletViewer
 BROWSER_EXPLORER        MS Internet Explorer
 BROWSER_VISUALAGE       IBM VisualAge for Java
 BROWSER_INTERPRETER     Running as a mainline
 BROWSER_NETSCAPE        Netscape Navigator
 BROWSER_OTHER           Other
 

Parameters:
comp - any component
 o getJavaVersion
 public static int getJavaVersion()
Returns an int corresponding to the "java.version" System property:
 JDK 1.0.2   102
 JDK 1.1.0   110
 

 o isJavaOS
 public static boolean isJavaOS()
Returns boolean, true if "os.name" equals "JavaOS", false otherwise.


All Packages  Class Hierarchy  This Package  Previous  Next  Index