|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectturingmachine.CTMDocument
A turing machine document.
Field Summary | |
---|---|
private CTMApplication |
mApplication
The application this document belongs to. |
private java.util.ArrayList<CTMData> |
mComponents
List of states in document. |
private java.lang.String |
mDirections
Turing machine directions. |
private java.lang.String |
mFileName
Filename this document was loaded from. |
private boolean |
mIsDeterministic
Whether or not this machine is deterministic. |
private boolean |
mModified
Document modification state. |
private java.awt.Dimension |
mSize
Size of document. |
private int |
mStateCount
Number of states created. |
private java.lang.String |
mStatePrefix
Default prefix for new states. |
private java.lang.String |
mSymbols
Turing machine symbols. |
private java.lang.String |
mTitle
Document title. |
private java.util.ArrayList<CTMInternalFrameView> |
mViews
List of views for this document. |
private CTMPreferences |
preferences
Prefereneces for document. |
(package private) static long |
serialVersionUID
Serial id, so future version will load old files. |
Constructor Summary | |
---|---|
CTMDocument(CTMApplication application)
Constructor. |
Method Summary | |
---|---|
boolean |
close()
Close this document and all its views. |
void |
commentAdd(java.awt.Rectangle bounds)
Add a comment to the document and update views. |
java.util.Iterator<CTMData> |
componentIterator()
Method for getting the components iterator as mComponents is private. |
void |
componentToBack(CTMData component)
Send a component to the back. |
void |
componentToFront(CTMData component)
Bring a component to the front. |
CTMApplication |
getApplication()
Get the application for this document. |
java.lang.String |
getDirections()
Gets turing machine tape direction symbols. |
java.lang.String |
getFilename()
Getter for documents filename. |
CTMPreferences |
getPreferences()
Gets document preferences. |
java.awt.Dimension |
getSize()
Get the size of the document. |
java.lang.String |
getSymbols()
Gets the symbols for the turing machine. |
java.lang.String |
getTitle()
Gets the document title. |
private void |
initTransients()
Initialises transient variables not initialised on load. |
boolean |
isIsDeterministic()
Get whether or not this machine is determininistic. |
boolean |
isModified()
Get whether or not this document has been modified. |
static CTMDocument |
load(CTMApplication application)
Load a document. |
boolean |
save()
provide a save dialog and save the document. |
boolean |
saveAs()
Save this document under a different name. |
boolean |
saveQuestion()
Ask whether the use wants to save the document. |
void |
setDirections(java.lang.String aDirections)
Sets turing machine tape direction symbols. |
void |
setIsDeterministic(boolean isDeterministic)
Set whether or not this machine is determininistic. |
void |
setModified(boolean aModified)
Set the status of the documents modified flag. |
void |
setSize(java.awt.Dimension aSize)
Sets the size of the document view. |
void |
setSymbols(java.lang.String aSymbols)
Sets the symbols for the turing machine. |
void |
setTitle(java.lang.String aTitle)
Sets the document title. |
void |
stateAdd(java.awt.Point aPoint)
Add a state to the document and update views. |
boolean |
validate()
Check document is a valid program. |
boolean |
viewClose(CTMInternalFrameView aView)
Close a view of this document. |
CTMInternalFrameView |
viewCreate()
Create a new view of this document. |
void |
viewUpdateAll()
Sync all views to the document. |
void |
viewUpdateTitles()
Updates all view titles to reflect current document status. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final long serialVersionUID
private transient CTMApplication mApplication
private transient java.util.ArrayList<CTMInternalFrameView> mViews
private transient boolean mModified
private boolean mIsDeterministic
private transient java.lang.String mFileName
private int mStateCount
private java.lang.String mTitle
private java.lang.String mSymbols
private java.lang.String mDirections
private java.lang.String mStatePrefix
private java.util.ArrayList<CTMData> mComponents
private java.awt.Dimension mSize
private CTMPreferences preferences
Constructor Detail |
---|
public CTMDocument(CTMApplication application)
application
- The application that created this document.Method Detail |
---|
private void initTransients()
public java.lang.String getTitle()
public java.lang.String getFilename()
public void setTitle(java.lang.String aTitle)
aTitle
- The new document title.public void viewUpdateTitles()
public java.lang.String getSymbols()
public void setSymbols(java.lang.String aSymbols)
aSymbols
- The allowed symbols.public java.lang.String getDirections()
public void setDirections(java.lang.String aDirections)
aDirections
- The valid directions for this machine.public CTMInternalFrameView viewCreate()
public boolean close()
public boolean viewClose(CTMInternalFrameView aView)
aView
- The view to close.
public boolean saveQuestion()
public static CTMDocument load(CTMApplication application)
application
- Which application does the open dialog belong to.
public boolean saveAs()
public boolean save()
public java.util.Iterator<CTMData> componentIterator()
public void stateAdd(java.awt.Point aPoint)
aPoint
- Where to put the state.public void commentAdd(java.awt.Rectangle bounds)
bounds
- Where to put the comment.public void viewUpdateAll()
public void componentToFront(CTMData component)
component
- The component to reorder.public void componentToBack(CTMData component)
component
- The component to reorder.public java.awt.Dimension getSize()
public void setSize(java.awt.Dimension aSize)
aSize
- The size to set it to.public boolean validate()
public void setModified(boolean aModified)
aModified
- Modification state to set.public boolean isModified()
public CTMApplication getApplication()
public void setIsDeterministic(boolean isDeterministic)
isDeterministic
- boolean true if it is deterministic, else false.public boolean isIsDeterministic()
public CTMPreferences getPreferences()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |