org.stellarium.command
Class ScriptMgr

java.lang.Object
  extended by org.stellarium.command.ScriptMgr

public class ScriptMgr
extends java.lang.Object

Version:
0.8.2
Author:
Jerome Beau, Fred Simon

Field Summary
private  boolean allowUI
          Allow user interface to function during scripts (except for time related keys which control script playback)
private  StelCommandInterface commander
          for executing script commands
private  long elapsedTime
          ms since last script command executed
private  boolean guiDebug
           
private  boolean playing
          is a script playing?
private  boolean playPaused
          is script playback paused?
private  java.io.Writer recFile
           
private  long recordElapsedTime
          ms since last command recorded
private  java.lang.String recordFileName
           
private  boolean recording
          is a script being recorded?
private  boolean removeableDirectoryMounted
           
private  java.lang.String removeableScriptDirectory
           
private  Script script
          currently loaded script
private static java.lang.String STELLARIUM_FILE_PREFIX
           
private static java.lang.String STS_EXTENSION
           
private  long waitTime
          ms until next script command should be executed
 
Constructor Summary
ScriptMgr(StelCommandInterface commandInterface)
           
 
Method Summary
(package private)  void cancelRecordScript()
           
(package private)  void cancelScript()
          delete script object...
 java.lang.String getRecordFileName()
           
 java.lang.String getScriptList(java.lang.String directory)
           
(package private)  java.lang.String getScriptPath()
           
 boolean isAllowUI()
           
 boolean isGuiDebug()
           
 boolean isPaused()
           
 boolean isPlaying()
           
 boolean isRecording()
           
private  void mountIfNeeded(java.lang.String scriptFile)
           
(package private)  void pauseScript()
           
(package private)  void playScript(java.lang.String scriptFile, java.lang.String scriptPath)
          path is used for loading script assets
 boolean playStartupScript()
           
 void recordCommand(java.lang.String commandline)
           
(package private)  void recordScript(java.lang.String scriptFilename)
           
(package private)  void resumeScript()
           
 void setAllowUI(boolean aui)
           
 void setGuiDebug(boolean guiDebug)
          Should script errors be shown onscreen?
private  void unmountIfNeeded()
           
 void update(int deltaTime)
          runs maximum of one command per update note that waits can drift by up to 1/fps seconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STELLARIUM_FILE_PREFIX

private static final java.lang.String STELLARIUM_FILE_PREFIX
See Also:
Constant Field Values

STS_EXTENSION

private static final java.lang.String STS_EXTENSION
See Also:
Constant Field Values

commander

private StelCommandInterface commander
for executing script commands


script

private Script script
currently loaded script


elapsedTime

private long elapsedTime
ms since last script command executed


waitTime

private long waitTime
ms until next script command should be executed


recordElapsedTime

private long recordElapsedTime
ms since last command recorded


recording

private boolean recording
is a script being recorded?


playing

private boolean playing
is a script playing? (could be paused)


playPaused

private boolean playPaused
is script playback paused?


recFile

private java.io.Writer recFile

recordFileName

private java.lang.String recordFileName

removeableScriptDirectory

private java.lang.String removeableScriptDirectory

removeableDirectoryMounted

private boolean removeableDirectoryMounted

allowUI

private boolean allowUI
Allow user interface to function during scripts (except for time related keys which control script playback)


guiDebug

private boolean guiDebug
Constructor Detail

ScriptMgr

public ScriptMgr(StelCommandInterface commandInterface)
Method Detail

playScript

void playScript(java.lang.String scriptFile,
                java.lang.String scriptPath)
          throws StellariumException
path is used for loading script assets

Parameters:
scriptFile -
scriptPath -
Throws:
StellariumException

mountIfNeeded

private void mountIfNeeded(java.lang.String scriptFile)
                    throws StellariumException
Throws:
StellariumException

cancelScript

void cancelScript()
delete script object...


unmountIfNeeded

private void unmountIfNeeded()

pauseScript

void pauseScript()
           throws StellariumException
Throws:
StellariumException

resumeScript

void resumeScript()
            throws StellariumException
Throws:
StellariumException

recordScript

void recordScript(java.lang.String scriptFilename)

recordCommand

public void recordCommand(java.lang.String commandline)

cancelRecordScript

void cancelRecordScript()
                  throws StellariumException
Throws:
StellariumException

update

public void update(int deltaTime)
            throws StellariumException
runs maximum of one command per update note that waits can drift by up to 1/fps seconds

Throws:
StellariumException

getScriptList

public java.lang.String getScriptList(java.lang.String directory)
                               throws StellariumException
Parameters:
directory - A given directory
Returns:
A list of script files from directory
Throws:
StellariumException - If the directory is not an existing directory

getScriptPath

java.lang.String getScriptPath()

playStartupScript

public boolean playStartupScript()

isPlaying

public boolean isPlaying()
Returns:
is a script playing?

isPaused

public boolean isPaused()
Returns:
is a script paused?

isRecording

public boolean isRecording()
Returns:
is a script being recorded?

getRecordFileName

public java.lang.String getRecordFileName()
Returns:
file record is writing to

setAllowUI

public void setAllowUI(boolean aui)

isAllowUI

public boolean isAllowUI()

isGuiDebug

public boolean isGuiDebug()

setGuiDebug

public void setGuiDebug(boolean guiDebug)
Should script errors be shown onscreen?

Parameters:
guiDebug -