com.nwoods.jgo
Class JGoGlobal

java.lang.Object
  extended bycom.nwoods.jgo.JGoGlobal

public class JGoGlobal
extends java.lang.Object

This class is used to hold information and routines that may be needed throughout the JGo system and/or that need to be constant across views.

In particular, this class maintains the current primary and secondary selection colors, routines to access what version of Java is running, and others.


Method Summary
static java.awt.Component getComponent()
          Return a default Component that can be used to measure text, if no view is available at the time.
static java.awt.Graphics2D getGraphics2D()
          The Graphics2D used to measure text without using any JGoView.
static double getJavaVersion()
          Return the version of Java under which this program is running.
static double getJGoVersion()
          Return the version of JGo in this package.
static java.awt.Toolkit getToolkit()
          Return a Toolkit.
static boolean isAtLeastJavaVersion(double version)
          Return true if this program is running under Java version "version" or greater.
static boolean isAtLeastJGoVersion(double version)
          Return true if this program is using JGo version "version" or greater.
static boolean isJavaVersion(double version)
          Test whether or not this program is running under exactly this version of Java.
static boolean isJGoVersion(double version)
          Test whether or not this program is using a particular version of JGo.
static void setComponent(java.awt.Component c)
          Save a Component that can be used to measure text in documents independent of any view.
static void setup()
          Make sure a Component exists that can be used to measure text.
static void TRACE(java.lang.String msg)
          This method just prints a line to System.err.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

TRACE

public static void TRACE(java.lang.String msg)
This method just prints a line to System.err.


getJGoVersion

public static double getJGoVersion()
Return the version of JGo in this package.

Returns:
the current version of JGo

isJGoVersion

public static boolean isJGoVersion(double version)
Test whether or not this program is using a particular version of JGo.

Parameters:
version - the version
Returns:
true if we're running exactly the given version

isAtLeastJGoVersion

public static boolean isAtLeastJGoVersion(double version)
Return true if this program is using JGo version "version" or greater. Otherwise, it returns false.

Parameters:
version - the minimum version underwhich to run.
Returns:
true if the JGo version is at least the given version.

getJavaVersion

public static double getJavaVersion()
Return the version of Java under which this program is running.

Returns:
the current version of Java.

isJavaVersion

public static boolean isJavaVersion(double version)
Test whether or not this program is running under exactly this version of Java.

Parameters:
version - the minimum version
Returns:
true if we're running under at least the given version

isAtLeastJavaVersion

public static boolean isAtLeastJavaVersion(double version)
Return true if this program is running under Java version "version" or greater. Otherwise, it returns false.

Parameters:
version - the minimum version underwhich to run.
Returns:
true if the Java version is at least version.

getComponent

public static java.awt.Component getComponent()
Return a default Component that can be used to measure text, if no view is available at the time. Will return null if no JGoView has been created yet.


setComponent

public static void setComponent(java.awt.Component c)
Save a Component that can be used to measure text in documents independent of any view.


getGraphics2D

public static java.awt.Graphics2D getGraphics2D()
The Graphics2D used to measure text without using any JGoView.

This Graphics2D should not be disposed. Initially the rendering hints are set to favor quality.


setup

public static void setup()
Make sure a Component exists that can be used to measure text. This should only be called when the programmer is not intending to create a Frame or Applet holding a JGoView. The code must have permission to create a native window.


getToolkit

public static java.awt.Toolkit getToolkit()
Return a Toolkit.