main
Class NetworkFile

java.lang.Object
  extended byjavax.swing.text.AbstractDocument
      extended byjavax.swing.text.DefaultStyledDocument
          extended bymain.NetworkFile
All Implemented Interfaces:
javax.swing.text.Document, java.io.Serializable, javax.swing.text.StyledDocument

public class NetworkFile
extends javax.swing.text.DefaultStyledDocument

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.text.DefaultStyledDocument
javax.swing.text.DefaultStyledDocument.AttributeUndoableEdit, javax.swing.text.DefaultStyledDocument.ElementBuffer, javax.swing.text.DefaultStyledDocument.ElementSpec, javax.swing.text.DefaultStyledDocument.SectionElement
 
Nested classes inherited from class javax.swing.text.AbstractDocument
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement
 
Field Summary
 
Fields inherited from class javax.swing.text.DefaultStyledDocument
buffer, BUFFER_SIZE_DEFAULT
 
Fields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
NetworkFile()
           
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
           
 Model createModel()
          Make a new Model from the currently stored text.
 void hiliteLine(int line)
           
 void readText(java.io.InputStream stream)
          Reads in a model file from a stream, which will usually be a file stream.
 void removeActionListener(java.awt.event.ActionListener l)
           
 
Methods inherited from class javax.swing.text.DefaultStyledDocument
addDocumentListener, addStyle, create, createDefaultRoot, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, insert, insertUpdate, removeDocumentListener, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, setParagraphAttributes, styleChanged
 
Methods inherited from class javax.swing.text.AbstractDocument
addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, insertString, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.text.Document
addUndoableEditListener, createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeUndoableEditListener, render
 

Constructor Detail

NetworkFile

public NetworkFile()
Method Detail

readText

public void readText(java.io.InputStream stream)
              throws java.lang.Exception
Reads in a model file from a stream, which will usually be a file stream. Currently this is a very simple function that just puts the text into the document exactly as it comes in on the stream. In the future, this function might want to parse the text and set different styles for different tokens in the file. Or perhaps there should be a separate parsing function that gets called afterwards.

Throws:
java.lang.Exception

createModel

public Model createModel()
Make a new Model from the currently stored text. If the model is successfully created, returns the Model. Otherwise, returns null. TO DO: when there is an error, position cursor at the error and put up the error message.


hiliteLine

public void hiliteLine(int line)

addActionListener

public void addActionListener(java.awt.event.ActionListener l)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)