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 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_APPLETVIEWER    AppletViewer
 BROWSER_EXPLORER        MS Internet Explorer
 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).

Variables

 o OS_OTHER
  public final static int OS_OTHER
 o OS_UNIX
  public final static int OS_UNIX
 o BROWSER_OTHER
  public final static int BROWSER_OTHER
 o BROWSER_INTERPRETER
  public final static int BROWSER_INTERPRETER
 o BROWSER_APPLETVIEWER
  public final static int BROWSER_APPLETVIEWER
 o BROWSER_NETSCAPE
  public final static int BROWSER_NETSCAPE
 o BROWSER_EXPLORER
  public final static int BROWSER_EXPLORER

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 getBrowser
  public static synchronized int getBrowser(Component comp)
Returns an int corresponding to the "java.vendor" System property:
 BROWSER_APPLETVIEWER    AppletViewer
 BROWSER_EXPLORER        MS Internet Explorer
 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
 


All Packages  Class Hierarchy  This Package  Previous  Next  Index