net.sf.jaxodraw.util
Class JaxoInfo

java.lang.Object
  extended by net.sf.jaxodraw.util.JaxoInfo

public final class JaxoInfo
extends Object

Collects system data and practical infos about JaxoDraw.

Since:
2.0

Field Summary
static String DOT_EXTENSION
          Extension of JaxoDraw data files, with a preceding dot.
static String EXTENSION
          Extension of JaxoDraw data files.
static String JAVA_CLASSPATH
          The current Java class path.
static String JAVA_HOME
          The directory where Java is installed on the current machine.
static String JAVA_RUNTIME_VERSION
          The current Java runtime version.
static String JAVA_VERSION
          The current Java version.
static String LOG_DIR
          The absolute path of the directory where log records are stored.
static String OS_ARCH
          The architecture of the current operating system.
static String OS_NAME
          The name of the current operating system.
static String OS_VERSION
          The version of the current operating system.
static String PLUGIN_DIR
          The absolute path of the directory where plugins are stored.
static Dimension SCREEN_SIZE
          The screen size.
static String SETTINGS_DIR
          The absolute path of the directory where user settings are stored.
static String USER_HOME
          The current user's home directory.
static String USER_NAME
          The current user.
static String VERSION
          The current version of JaxoDraw.
static String VERSION_NUMBER
          The version number of this release of JaxoDraw.
static String WEB_SITE
          The JaxoDraw web site.
 
Method Summary
static String about(String plugins)
          Returns a string with some 'About' infos.
static int compareVersion(String version)
          Compares the given version String to the current version of JaxoDraw.
static int compareVersions(String v1, String v2)
          Compares two version Strings.
static String help()
          Returns a help message.
static String info()
          Returns an info message.
static String sysInfo()
          Returns a string with some system infos.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_NAME

public static final String USER_NAME
The current user.


USER_HOME

public static final String USER_HOME
The current user's home directory.


OS_NAME

public static final String OS_NAME
The name of the current operating system.


OS_ARCH

public static final String OS_ARCH
The architecture of the current operating system.


OS_VERSION

public static final String OS_VERSION
The version of the current operating system.


JAVA_VERSION

public static final String JAVA_VERSION
The current Java version.


JAVA_RUNTIME_VERSION

public static final String JAVA_RUNTIME_VERSION
The current Java runtime version.


JAVA_HOME

public static final String JAVA_HOME
The directory where Java is installed on the current machine.


JAVA_CLASSPATH

public static final String JAVA_CLASSPATH
The current Java class path.


SCREEN_SIZE

public static final Dimension SCREEN_SIZE
The screen size.


VERSION_NUMBER

public static final String VERSION_NUMBER
The version number of this release of JaxoDraw.


VERSION

public static final String VERSION
The current version of JaxoDraw.


WEB_SITE

public static final String WEB_SITE
The JaxoDraw web site.

See Also:
Constant Field Values

EXTENSION

public static final String EXTENSION
Extension of JaxoDraw data files.

See Also:
Constant Field Values

DOT_EXTENSION

public static final String DOT_EXTENSION
Extension of JaxoDraw data files, with a preceding dot.

See Also:
Constant Field Values

SETTINGS_DIR

public static final String SETTINGS_DIR
The absolute path of the directory where user settings are stored.


PLUGIN_DIR

public static final String PLUGIN_DIR
The absolute path of the directory where plugins are stored.


LOG_DIR

public static final String LOG_DIR
The absolute path of the directory where log records are stored.

Method Detail

help

public static String help()
Returns a help message.

Returns:
a translated string.

info

public static String info()
Returns an info message.

Returns:
a translated string.

sysInfo

public static String sysInfo()
Returns a string with some system infos.

Returns:
a translated string.

about

public static String about(String plugins)
Returns a string with some 'About' infos.

Parameters:
plugins - available plugins.
Returns:
a translated string.

compareVersion

public static int compareVersion(String version)
Compares the given version String to the current version of JaxoDraw. See compareVersions for a specification of a valid version String.

Parameters:
version - the version to compare to. If this is null, +1 is returned, ie the current version is assumed greater.
Returns:
0 if the two versions are equal, a value less than 0 if the current version is smaller than the given one, a value greater than 0 if the current version is greater than the given one,

compareVersions

public static int compareVersions(String v1,
                                  String v2)
Compares two version Strings.

A valid version String must be of the form

major.minor[.bugfix][-qualifier]

where the quantities in square brackets are optional. The major, minor and bugfix parts have to be non-negative integers.

For the comparison, the major, minor and bugfix arguments are compared as integers in this order. The first ocurring inequality is returned. A missing bugfix counts as 0.

If all integers are equal, the qualifiers are compared lexigraphically as Strings. If one version has a qualifier while the other has none, the version with the qualifier is considered smaller.

Examples:

3.0.1 > 2.10.221
3.0-SNAPSHOT < 3.0
2.1.0 == 2.1
1.2.3-abc < 1.2.3-xyz

Parameters:
v1 - the first version to compare. Cannot be null.
v2 - the second version to compare. Cannot be null.
Returns:
0 if the two versions are equal, a value less than 0 if v1 is smaller than v2, a value greater than 0 if v1 is greater than v2.


Copyright © 2003-2011 The JaxoDraw team. All Rights Reserved.