mars.venus
Class FileStatus

java.lang.Object
  |
  +--mars.venus.FileStatus

public class FileStatus
extends java.lang.Object

Used to store and return information on the status of the current ASM file that is being edited in the program.


Field Summary
static int EDITED
          open/saved edit window with unsaved edits
static int NEW_EDITED
          New edit window with unsaved edits
static int NEW_NOT_EDITED
          New edit window with no edits
static int NO_FILE
          initial state or after close
static int NOT_EDITED
          open/saved edit window with no edits
static int RUNNABLE
          successful assembly
static int RUNNING
          execution is under way
static int TERMINATED
          execution terminated
 
Constructor Summary
FileStatus()
           
 
Method Summary
static int get()
          Get file status
static java.io.File getFile()
          Returns the ASM file.
static java.lang.String getName()
          Returns the name of the file.
static boolean isAssembled()
          Tells whether the file has been assembled.
static boolean isEdited()
          Tells whether the file has been edited since it has been saved.
static boolean isSaved()
          Tells whether the file has been saved.
static void reset()
          Resets all the values in FileStatus
static void set(int newStatus)
          Set file status.
static void setAssembled(boolean b)
          Changes the value of assenbked to the parameter given.
static void setEdited(boolean b)
          Changes the value of edited to the parameter given.
static void setFile(java.io.File f)
          Sets the file to the ASM file passed.
static void setName(java.lang.String s)
          Changes the value of name to the parameter given.
static void setSaved(boolean b)
          Changes the value of saved to the parameter given.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_FILE

public static final int NO_FILE
initial state or after close

See Also:
Constant Field Values

NEW_NOT_EDITED

public static final int NEW_NOT_EDITED
New edit window with no edits

See Also:
Constant Field Values

NEW_EDITED

public static final int NEW_EDITED
New edit window with unsaved edits

See Also:
Constant Field Values

NOT_EDITED

public static final int NOT_EDITED
open/saved edit window with no edits

See Also:
Constant Field Values

EDITED

public static final int EDITED
open/saved edit window with unsaved edits

See Also:
Constant Field Values

RUNNABLE

public static final int RUNNABLE
successful assembly

See Also:
Constant Field Values

RUNNING

public static final int RUNNING
execution is under way

See Also:
Constant Field Values

TERMINATED

public static final int TERMINATED
execution terminated

See Also:
Constant Field Values
Constructor Detail

FileStatus

public FileStatus()
Method Detail

set

public static void set(int newStatus)
Set file status. Also updates menu state accordingly.

Parameters:
newStatus - New status: EDITED, RUNNABLE, etc, see list above.

get

public static int get()
Get file status

Returns:
file status EDITED, RUNNABLE, etc, see list above

setAssembled

public static void setAssembled(boolean b)
Changes the value of assenbked to the parameter given.

Parameters:
b - boolean variable that tells what to set assembled to.

setSaved

public static void setSaved(boolean b)
Changes the value of saved to the parameter given.

Parameters:
b - boolean variable that tells what to set saved to .

setEdited

public static void setEdited(boolean b)
Changes the value of edited to the parameter given.

Parameters:
b - boolean variable that tells what to set edited to.

setName

public static void setName(java.lang.String s)
Changes the value of name to the parameter given.

Parameters:
s - string variable tells what to set the name of the file to .

setFile

public static void setFile(java.io.File f)
Sets the file to the ASM file passed.

Parameters:
f - file object variable that stores the ASM file.

getFile

public static java.io.File getFile()
Returns the ASM file.

Returns:
The ASM file.

getName

public static java.lang.String getName()
Returns the name of the file.

Returns:
The name of the ASM file.

isAssembled

public static boolean isAssembled()
Tells whether the file has been assembled.

Returns:
Boolean value that is true if the ASM file has been assembled.

isSaved

public static boolean isSaved()
Tells whether the file has been saved.

Returns:
Boolean variable that is true if the ASM file has been saved

isEdited

public static boolean isEdited()
Tells whether the file has been edited since it has been saved.

Returns:
Boolean value that returns true if the ASM file has been edited.

reset

public static void reset()
Resets all the values in FileStatus