Class JESConfig

java.lang.Object
  extended by JESConfig

public class JESConfig
extends java.lang.Object

The JES Config Class Created for the Jython Environment for Students The JESConfig Class reads the config file information for the JES config file, located at JES_CONFIG_FILE_NAME


Field Summary
static int CONFIG_AUTOOPENDOC
          Depreciated option, retained for backward compatibility.
static int CONFIG_AUTOSAVEONRUN
          Ease-of-use constant for the JES auto save on load option (0 is off, 1 is on).
static int CONFIG_BACKUPSAVE
          Ease-of-use constant for the JES save backup copy on save option (0 off, 1 on).
static int CONFIG_BLOCK
          Ease-of-use constant for the JES indention help (0 is on, 1 is off).
static int CONFIG_EMAIL_ADDR
          Ease-of-use constant for the JES user's e-mail address (for turn-in purposes).
static int CONFIG_FONT
          Ease-of-use constant for the JES user's font-size (1-72).
static int CONFIG_GT
          Ease-of-use constant for the JES user's ID # (for turn-in purposes).
static int CONFIG_GUTTER
          Ease-of-use constant for the JES line number gutter (0 is off, 1 is on).
static int CONFIG_LOGBUFFER
          Ease-of-use constant for the JES save logs option (0 off, 1 on).
static int CONFIG_MAIL
          Ease-of-use constant for the JES user's mail server (for turn-in purposes).
static int CONFIG_MEDIAPATH
          Ease-of-use constant for the JES mediapath option (default is user.home).
static int CONFIG_MODE
          Ease-of-use constant for the JES user's experience level ("Normal" or "Expert").
static int CONFIG_NAME
          Ease-of-use constant for the JES user's name (for turn-in purposes).
static int CONFIG_NLINES
          Number of options in the current version of JES.
static int CONFIG_SHOWTURNIN
          Ease-of-use constant for the JES turnin menu option (0 off, 1 on).
static int CONFIG_SKIN
          Ease-of-use constant for the JES skin option (UIManager.getLookAndFeel().getName()).
static int CONFIG_WEB_TURNIN
          Ease-of-use constant for the JES user's web-turnin server (coweb site).
static int CONFIG_WRAPPIXELVALUES
          Ease-of-use constant for the JES wrap pixel value option (0 out of bounds colors capped, 1 colors will be (value % 256)).
static java.lang.String JES_CONFIG_FILE_NAME
          Ease-of-use constant for JES Config file.
 
Method Summary
 boolean getBooleanProperty(int property)
          Method to get a JES boolean property
static JESConfig getInstance()
          Method to get the instance of the JESConfig singleton pattern
 int getIntegerProperty(int property)
          Method to get a JES Integer property
 boolean getSessionWrapAround()
          Method to get the current value of the pixel wrap around option.
 java.lang.String getStringProperty(int property)
          Method to get a JES String property
 boolean isConfigLoaded()
          Method to determine if the JES_CONFIG_FILE was read and previous settings restored
static void main(java.lang.String[] args)
           
 void setBooleanProperty(int property, boolean value)
          Method to set a JES Boolean property
 void setIntegerProperty(int property, int value)
          Method to set a JES Integer property
 void setSessionWrapAround(boolean value)
          Method to set the current value of the pixel wrap around option.
 void setStringProperty(int property, java.lang.String value)
          Method to set a JES String property
 void writeConfig()
          Method to write the current JES settings to the file user.home/JES_CONFIG_FILE_NAME
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JES_CONFIG_FILE_NAME

public static final java.lang.String JES_CONFIG_FILE_NAME
Ease-of-use constant for JES Config file. Specifies a filename to use as the JES settings file.

See Also:
Constant Field Values

CONFIG_NAME

public static final int CONFIG_NAME
Ease-of-use constant for the JES user's name (for turn-in purposes).

See Also:
Constant Field Values

CONFIG_GT

public static final int CONFIG_GT
Ease-of-use constant for the JES user's ID # (for turn-in purposes).

See Also:
Constant Field Values

CONFIG_MAIL

public static final int CONFIG_MAIL
Ease-of-use constant for the JES user's mail server (for turn-in purposes).

See Also:
Constant Field Values

CONFIG_MODE

public static final int CONFIG_MODE
Ease-of-use constant for the JES user's experience level ("Normal" or "Expert").

See Also:
Constant Field Values

CONFIG_FONT

public static final int CONFIG_FONT
Ease-of-use constant for the JES user's font-size (1-72).

See Also:
Constant Field Values

CONFIG_EMAIL_ADDR

public static final int CONFIG_EMAIL_ADDR
Ease-of-use constant for the JES user's e-mail address (for turn-in purposes).

See Also:
Constant Field Values

CONFIG_GUTTER

public static final int CONFIG_GUTTER
Ease-of-use constant for the JES line number gutter (0 is off, 1 is on).

See Also:
Constant Field Values

CONFIG_BLOCK

public static final int CONFIG_BLOCK
Ease-of-use constant for the JES indention help (0 is on, 1 is off).

See Also:
Constant Field Values

CONFIG_WEB_TURNIN

public static final int CONFIG_WEB_TURNIN
Ease-of-use constant for the JES user's web-turnin server (coweb site).

See Also:
Constant Field Values

CONFIG_AUTOSAVEONRUN

public static final int CONFIG_AUTOSAVEONRUN
Ease-of-use constant for the JES auto save on load option (0 is off, 1 is on).

See Also:
Constant Field Values

CONFIG_AUTOOPENDOC

public static final int CONFIG_AUTOOPENDOC
Depreciated option, retained for backward compatibility.

See Also:
Constant Field Values

CONFIG_WRAPPIXELVALUES

public static final int CONFIG_WRAPPIXELVALUES
Ease-of-use constant for the JES wrap pixel value option (0 out of bounds colors capped, 1 colors will be (value % 256)).

See Also:
Constant Field Values

CONFIG_SKIN

public static final int CONFIG_SKIN
Ease-of-use constant for the JES skin option (UIManager.getLookAndFeel().getName()).

See Also:
Constant Field Values

CONFIG_SHOWTURNIN

public static final int CONFIG_SHOWTURNIN
Ease-of-use constant for the JES turnin menu option (0 off, 1 on).

See Also:
Constant Field Values

CONFIG_BACKUPSAVE

public static final int CONFIG_BACKUPSAVE
Ease-of-use constant for the JES save backup copy on save option (0 off, 1 on).

See Also:
Constant Field Values

CONFIG_LOGBUFFER

public static final int CONFIG_LOGBUFFER
Ease-of-use constant for the JES save logs option (0 off, 1 on).

See Also:
Constant Field Values

CONFIG_MEDIAPATH

public static final int CONFIG_MEDIAPATH
Ease-of-use constant for the JES mediapath option (default is user.home).

See Also:
Constant Field Values

CONFIG_NLINES

public static final int CONFIG_NLINES
Number of options in the current version of JES.

See Also:
Constant Field Values
Method Detail

getInstance

public static JESConfig getInstance()
Method to get the instance of the JESConfig singleton pattern

Returns:
the instance of JESConfig

getSessionWrapAround

public boolean getSessionWrapAround()
Method to get the current value of the pixel wrap around option. getSessionWrapAround and setSessionWrapAround will ignore the value in user settings.

Returns:
the boolean value of the pixel wrap around

setSessionWrapAround

public void setSessionWrapAround(boolean value)
Method to set the current value of the pixel wrap around option. getSessionWrapAround and setSessionWrapAround will ignore the value in user settings.

Parameters:
value - the new value for the pixel wrap around

isConfigLoaded

public boolean isConfigLoaded()
Method to determine if the JES_CONFIG_FILE was read and previous settings restored

Returns:
true if the JES_CONFIG_FILE was succesfully loaded

getStringProperty

public java.lang.String getStringProperty(int property)
Method to get a JES String property

Parameters:
property - the JESConfig.CONFIG_* constant for the desired property
Returns:
the value of the specified property as a String

getBooleanProperty

public boolean getBooleanProperty(int property)
Method to get a JES boolean property

Parameters:
property - the JESConfig.CONFIG_* constant for the desired property
Returns:
the value of the specified property as a boolean

getIntegerProperty

public int getIntegerProperty(int property)
Method to get a JES Integer property

Parameters:
property - the JESConfig.CONFIG_* constant for the desired property
Returns:
the value of the specified property as an Integer

setStringProperty

public void setStringProperty(int property,
                              java.lang.String value)
Method to set a JES String property

Parameters:
property - the JESConfig.CONFIG_* constant for the desired property
value - the new String value for the specified property

setIntegerProperty

public void setIntegerProperty(int property,
                               int value)
Method to set a JES Integer property

Parameters:
property - the JESConfig.CONFIG_* constant for the desired property
value - the new Integer value for the specified property

setBooleanProperty

public void setBooleanProperty(int property,
                               boolean value)
Method to set a JES Boolean property

Parameters:
property - the JESConfig.CONFIG_* constant for the desired property
value - the new Boolean value for the specified property

writeConfig

public void writeConfig()
Method to write the current JES settings to the file user.home/JES_CONFIG_FILE_NAME


main

public static void main(java.lang.String[] args)