litestep
Class Litestep

java.lang.Object
  |
  +--litestep.Litestep

public class Litestep
extends java.lang.Object

The Litestep class provides access to some of the basic LSAPI functions. You can use it to read settings from step.rc, execute commands, and other useful functions.

The jar file containing this class (JavaMM.jar) must be in the classpath that you specify to Litestep using the "JavaClassPath" directive. For example, if the jar file is in C:\Java\ you would want to add "JavaClassPath C:\Java\JavaMM.jar" to your step.rc. Any modules you plan to load using "LoadJavaModule" must also be in your class path.

See Also:
Module

Field Summary
static java.lang.String SW_HIDE
          Constants for the calls to execute and executeEx.
static java.lang.String SW_MAXIMIZE
           
static java.lang.String SW_MINIMIZE
           
static java.lang.String SW_RESTORE
           
static java.lang.String SW_SHOW
           
static java.lang.String SW_SHOWDEFAULT
           
static java.lang.String SW_SHOWMAXIMIZED
           
static java.lang.String SW_SHOWMINIMIZED
           
static java.lang.String SW_SHOWMINNOACTIVE
           
static java.lang.String SW_SHOWNA
           
static java.lang.String SW_SHOWNOACTIVATE
           
static java.lang.String SW_SHOWNORMAL
           
 
Constructor Summary
Litestep()
           
 
Method Summary
 int execute(java.lang.String command, java.lang.String show)
          Execute a command.
 int executeEx(java.lang.String function, java.lang.String command, java.lang.String args, java.lang.String directory, java.lang.String show)
          Execute a command in the specified way (function) with the specified arguments (args) in the specified directory (directory).
 java.lang.String getImagePath()
          Get the path to the default image directory
 java.lang.String getLitestepPath()
          Get the path to the Litestep directory.
 boolean getRCBool(java.lang.String key, boolean ifFound)
          Get a boolean from the step.rc file using the specified key.
 java.awt.Color getRCColor(java.lang.String key, java.awt.Color defValue)
          Get a color from the step.rc file using the specified key.
 int getRCInt(java.lang.String key, int defValue)
          Get an integer from the step.rc file using the specified key.
 java.lang.String getRCLine(java.lang.String command, java.lang.String defValue)
          Get a full line from the step.rc file that starts with the string in 'command'.
 java.lang.String getRCString(java.lang.String key, java.lang.String defValue)
          Get a string from the step.rc file using the specified key.
 void setDesktopArea(int left, int top, int right, int bottom)
          Set the desktop area to the specified dimensions.
 java.lang.String varExpansion(java.lang.String value)
          Expand any variables in 'value' and return the expanded string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SW_HIDE

public static final java.lang.String SW_HIDE
Constants for the calls to execute and executeEx. These constants specify how the executed command's window should be displayed.

SW_MINIMIZE

public static final java.lang.String SW_MINIMIZE

SW_MAXIMIZE

public static final java.lang.String SW_MAXIMIZE

SW_RESTORE

public static final java.lang.String SW_RESTORE

SW_SHOW

public static final java.lang.String SW_SHOW

SW_SHOWDEFAULT

public static final java.lang.String SW_SHOWDEFAULT

SW_SHOWMAXIMIZED

public static final java.lang.String SW_SHOWMAXIMIZED

SW_SHOWMINIMIZED

public static final java.lang.String SW_SHOWMINIMIZED

SW_SHOWMINNOACTIVE

public static final java.lang.String SW_SHOWMINNOACTIVE

SW_SHOWNA

public static final java.lang.String SW_SHOWNA

SW_SHOWNOACTIVATE

public static final java.lang.String SW_SHOWNOACTIVATE

SW_SHOWNORMAL

public static final java.lang.String SW_SHOWNORMAL
Constructor Detail

Litestep

public Litestep()
Method Detail

getRCString

public java.lang.String getRCString(java.lang.String key,
                                    java.lang.String defValue)
Get a string from the step.rc file using the specified key.
Parameters:
key - The key to look up
defValue - The default value if the key is not found
Returns:
The value from step.rc, or the default

getRCInt

public int getRCInt(java.lang.String key,
                    int defValue)
Get an integer from the step.rc file using the specified key.
Parameters:
key - The key to look up
defValue - The default value if the key is not found
Returns:
The value from step.rc, or the default

getRCBool

public boolean getRCBool(java.lang.String key,
                         boolean ifFound)
Get a boolean from the step.rc file using the specified key.
Parameters:
key - The key to look up
defValue - The default value if the key is not found
Returns:
The value from step.rc, or the default

getRCLine

public java.lang.String getRCLine(java.lang.String command,
                                  java.lang.String defValue)
Get a full line from the step.rc file that starts with the string in 'command'.
Parameters:
command - The command to look up
defValue - The default value if the command cannot be found
Returns:
The value from step.rc, or the default

getRCColor

public java.awt.Color getRCColor(java.lang.String key,
                                 java.awt.Color defValue)
Get a color from the step.rc file using the specified key.
Parameters:
key - The key to look up
defValue - The default color if the key is not found
Returns:
The value from step.rc, or the default

varExpansion

public java.lang.String varExpansion(java.lang.String value)
Expand any variables in 'value' and return the expanded string.
Parameters:
value - The string to expand
Returns:
The fully-expanded string

setDesktopArea

public void setDesktopArea(int left,
                           int top,
                           int right,
                           int bottom)
Set the desktop area to the specified dimensions. Use negative numbers for distances from the bottom right corner.
Parameters:
left - The left side coordinate of the desktop
top - The top side coordinate of the desktop
right - The right side coordinate of the desktop
bottom - The bottom coordinate of the desktop

getLitestepPath

public java.lang.String getLitestepPath()
Get the path to the Litestep directory.
Returns:
The path to the Litestep directory

getImagePath

public java.lang.String getImagePath()
Get the path to the default image directory
Returns:
The path to the default image directory

execute

public int execute(java.lang.String command,
                   java.lang.String show)
Execute a command. If the command displays a window, show that window as specified in 'show'.
Parameters:
command - The command to execute
show - Specifies how to show the window the command produces
Returns:
A handle to the process associated with the executed command.

executeEx

public int executeEx(java.lang.String function,
                     java.lang.String command,
                     java.lang.String args,
                     java.lang.String directory,
                     java.lang.String show)
Execute a command in the specified way (function) with the specified arguments (args) in the specified directory (directory). If the command displays a window, show that window as specified in 'show'.
Parameters:
function - The function to perform on the command. Can be "open", "print", or "explore".
command - The command to execute.
args - The arguments to pass to the command.
directory - The directory to execute the command in.
show - Specified how to show the window the command produces.
Returns:
A handle to the process associated with the executed command.