turingmachine
Class CTMApplication

java.lang.Object
  extended by turingmachine.CTMApplication

public class CTMApplication
extends java.lang.Object

The root application class for the turing machine simulator.


Field Summary
static java.awt.Cursor cursor_grab
          Instance of cursor for use by application components.
static java.awt.Cursor cursor_move
          Instance of cursor for use by application components.
static CTMFileFilter defaultFileFilter
          This applications default file filter.
static java.lang.String[] defaultFileTypes
          This applications default file types.
private  java.util.ArrayList<CTMDocument> mDocuments
          List of documents open in this application.
private  CTMFrame mFrame
          The application main frame.
static int mInstanceCount
          Count of application instances created.
 
Constructor Summary
CTMApplication()
          Constructor.
 
Method Summary
 void addDocument(CTMDocument aDocument)
          Add a document to applications open document list.
 boolean closeAllDocuments()
          Close all documents belonging to this application.
 boolean fileIsAlreadyOpen(java.lang.String filename)
          Checks whether a file is already open by the application.
 CTMFrame getApplicationFrame()
          Get the application main frame.
 int getInstanceCount()
          Get number of instances of application.
 CTMInternalFrameView getSelectedFrame()
           
static void main(java.lang.String[] args)
          Main method.
 boolean quitApplication()
          Quit an application instance.
 void removeDocument(CTMDocument aDocument)
          Remove a document from applications open document list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mFrame

private CTMFrame mFrame
The application main frame.


mInstanceCount

public static int mInstanceCount
Count of application instances created.


mDocuments

private java.util.ArrayList<CTMDocument> mDocuments
List of documents open in this application.


defaultFileTypes

public static java.lang.String[] defaultFileTypes
This applications default file types.


defaultFileFilter

public static CTMFileFilter defaultFileFilter
This applications default file filter.


cursor_grab

public static java.awt.Cursor cursor_grab
Instance of cursor for use by application components.


cursor_move

public static java.awt.Cursor cursor_move
Instance of cursor for use by application components.

Constructor Detail

CTMApplication

public CTMApplication()
Constructor.

Method Detail

quitApplication

public boolean quitApplication()
Quit an application instance. If it is the last application instance quit the program.

Returns:
true The application quit successfully else false.

closeAllDocuments

public boolean closeAllDocuments()
Close all documents belonging to this application.

Returns:
true if all documents closed else false.

getInstanceCount

public int getInstanceCount()
Get number of instances of application.

Returns:
Instances of application.

getApplicationFrame

public CTMFrame getApplicationFrame()
Get the application main frame.

Returns:
The applications main frame.

addDocument

public void addDocument(CTMDocument aDocument)
Add a document to applications open document list.

Parameters:
aDocument - The document to add.

removeDocument

public void removeDocument(CTMDocument aDocument)
Remove a document from applications open document list.

Parameters:
aDocument - The document to remove.

fileIsAlreadyOpen

public boolean fileIsAlreadyOpen(java.lang.String filename)
Checks whether a file is already open by the application.

Parameters:
filename - String Filename of file.
Returns:
boolean true if it is open.

getSelectedFrame

public CTMInternalFrameView getSelectedFrame()

main

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

Parameters:
args - Command line arguments for application(There are none).