|
miSim | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--misim.util.FileDetails | +--misim.editor.TextFile
Field Summary | |
static int |
FILE_ITERATOR
The type of this line iterator |
Fields inherited from class misim.util.FileDetails |
output |
Constructor Summary | |
TextFile(java.lang.String filename,
boolean webFile)
Constructor - create a new file |
|
TextFile(java.lang.String filename,
java.lang.String directory,
boolean webFile)
|
Method Summary | |
void |
addLine(int index,
Line aLine)
Add a line to the file |
LineFactory |
getFactory()
|
Line |
getLine(int index)
Get the line at a particular index in the file. |
int |
getLineIndex()
Return the current line index being read in this file |
int |
getMaxWidth()
Return the maximum pixel width of any line in this file |
Line |
getNextLine()
Return the next line, and advance the index to the next line in the file. |
Parser |
getParser()
|
java.lang.String |
getText()
Return the contents of the text file as a string. |
int |
getType()
Return the type of this iterator, as an integer. |
void |
insertLine(Line aLine)
Insert a new line at the current line index. |
int |
lines()
Return the number of lines in this file |
int |
readFile(EditorPrefs prefs)
|
void |
redo(Undoable undo,
CursorPos cursor)
Redo a change made to the file |
void |
removeAllLines()
Remove all lines from the file |
void |
removeLine(int index)
Remove a line from the file |
void |
resetLineIndex()
Reset the current line index to the beginning of the file |
void |
saveFile()
|
int |
search(java.lang.String text,
CursorPos cursor,
boolean ignoreCase,
boolean forward)
Search for the given text from the cursor position. |
void |
setFactory(LineFactory factory)
|
void |
setMaxWidth(int newMax)
Test the new maximum display width of the file, and if it is larger than the existing maximum, set the maximum width to the new value |
void |
setParser(Parser parser)
|
void |
undo(Undoable undo,
CursorPos cursor)
Undo a change made to the file |
boolean |
updatedOnDisk()
Check to see if the file has been updated on disk since the last time it was read. |
Methods inherited from class misim.util.FileDetails |
getDirectory, getFilename, getInputStream, getLastModified, getOutputStream, isNewFile, isWebFile, setDirectory, setFilename |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FILE_ITERATOR
Constructor Detail |
public TextFile(java.lang.String filename, boolean webFile)
filename
- The name for this file.webFile
- If true, this file is being managed by an appletpublic TextFile(java.lang.String filename, java.lang.String directory, boolean webFile)
Method Detail |
public void setParser(Parser parser)
public Parser getParser()
public void setFactory(LineFactory factory)
public LineFactory getFactory()
public int readFile(EditorPrefs prefs) throws java.io.IOException
public int getMaxWidth()
public void setMaxWidth(int newMax)
newMax
- The new display width for the filepublic boolean updatedOnDisk()
public void saveFile() throws java.io.IOException
public java.lang.String getText()
public int lines()
public void resetLineIndex()
resetLineIndex
in interface LineIterator
public Line getNextLine()
getNextLine
in interface LineIterator
public int getLineIndex()
getLineIndex
in interface LineIterator
public void insertLine(Line aLine)
insertLine
in interface LineIterator
aLine
- The line to insertpublic int getType()
getType
in interface LineIterator
public int search(java.lang.String text, CursorPos cursor, boolean ignoreCase, boolean forward)
text
- The string to search forcursor
- The cursor position to search fromignoreCase
- If true, search ingnoring caseforward
- If true seek forward through the file.public Line getLine(int index)
index
- The line number to returnpublic void removeLine(int index)
index
- The line number to removepublic void removeAllLines()
public void addLine(int index, Line aLine)
index
- The line number to addline
- The line to addpublic void undo(Undoable undo, CursorPos cursor)
undo
in interface UndoIF
public void redo(Undoable undo, CursorPos cursor)
redo
in interface UndoIF
|
miSim | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |