|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.annotation.wordfreak.AnnotatedFileManager
Class that handles and disbatches file
related events to AnnotatedFileListener
s. These events come from
this object when it is their FileRequestListener
and from the
EventManager
.
AnnotatedFileListener
,
FileRequestListener
,
EventManager
Constructor Summary | |
AnnotatedFileManager()
|
Method Summary | |
void |
addAnnotatedFileListener(AnnotatedFileListener adl)
Registers an AnnotatedFileListener to be notified
of file related changes. |
void |
addGold(java.lang.String filename)
Adds the annotated file name/path specified by fileName to the set of gold files. |
boolean |
allAnnotatedFilesSaved()
Returns true is all annotated files have been saved, false otherwise. |
boolean |
closeAnnotatedFile(java.lang.String annFileName)
Returns true if the the annotated file specified by annFileName could be closed. |
boolean |
eventTranspired(java.lang.String eventType,
java.lang.Object source)
|
java.io.File |
getAnnotatedFile(java.lang.String sourceFileName)
Returns a likly annotated file for this source file name. |
int |
getFileCount()
Returns the number of files which have been opened. |
FileFormat |
getFileFormat(javax.swing.filechooser.FileFilter ff)
Returns the file format associated with the specified file filter. |
FileFormat |
getFileFormat(java.lang.String name)
Returns the file format associated with the specified file format name. |
FileFormat |
getFileFormatForFile(java.lang.String fileName)
Returns the file format associated with the specified file name. |
java.util.Iterator |
getFileFormatNames()
Returns an iterator over the names of currently loaded file formats. |
AnnotationFile |
getFileFromPath(java.lang.String p)
Returns the annotated file associated with the name/path of the file sent as a parameter. |
void |
incrementProgress()
|
void |
incrementProgress(int v)
|
java.util.Iterator |
iterator()
Returns an iterator over the opened files. |
boolean |
openAnnotatedFile(java.lang.String annFileName)
Returns true if the source file specified by fileName and its coresponding annotated file could be opened. |
boolean |
openAnnotatedFile(java.lang.String fileName,
java.lang.String annFileName)
Returns true if the source file specified by fileName and the annotated file specified by annFileName could be opened.' |
boolean |
openAnnotatedFile(java.lang.String fileName,
java.lang.String annFileName,
AnnotatedFileFormat format)
|
boolean |
openAnnotationGraphFile(java.lang.String signal,
java.lang.String fileName)
|
void |
removeAnnotatedFileListener(AnnotatedFileListener adl)
Un-registers an AnnotatedFileListener . |
void |
removeGold(java.lang.String filename)
Removes the annotated file name/path specified by fileName from the set of gold files. |
static boolean |
saveAnnotatedFile(AnnotationFile f,
java.lang.String name)
|
boolean |
saveAnnotatedFile(AnnotationFile af,
java.lang.String name,
java.awt.Component source)
|
boolean |
saveAnnotatedFile(java.lang.String annFileName)
Returns true if the the annotated file specified by annFileName could be saved. |
static boolean |
saveTextFile(AnnotationFile f)
|
static boolean |
saveTextFile(AnnotationFile f,
java.lang.String name)
|
boolean |
scanAnnotatedFile(java.lang.String fileName,
java.lang.String annFileName)
Returns true if the source file specified by fileName and the annotated file specified by annFileName could be scaned. |
void |
setAnnotatorNameListener(FilterCriteriaManager l)
|
java.lang.String[] |
setFileFormat(java.lang.String file,
AnnotatedFileFormat format)
Assigns the annotated file specified by file to the
format specified by format and returns the name of
the annotated file and the source file. |
void |
setFileFormats(java.lang.String[] classes)
|
void |
setFilter(AnnotationFilter f)
Set the saving filter for all files. |
void |
setProgress(int v)
|
void |
windowActivated(java.awt.event.WindowEvent e)
|
void |
windowClosed(java.awt.event.WindowEvent e)
|
void |
windowClosing(java.awt.event.WindowEvent e)
|
void |
windowDeactivated(java.awt.event.WindowEvent e)
|
void |
windowDeiconified(java.awt.event.WindowEvent e)
|
void |
windowIconified(java.awt.event.WindowEvent e)
|
void |
windowOpened(java.awt.event.WindowEvent e)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AnnotatedFileManager()
Method Detail |
public void setFileFormats(java.lang.String[] classes)
public boolean eventTranspired(java.lang.String eventType, java.lang.Object source)
eventTranspired
in interface EventListener
public void setFilter(AnnotationFilter f)
FileRequestListener
setFilter
in interface FileRequestListener
f
- the filter.public FileFormat getFileFormatForFile(java.lang.String fileName)
FileRequestListener
getFileFormatForFile
in interface FileRequestListener
fileName
- the nae of the file.
FileFormat
object associated with the
fileName
parameter, or null of no file format handles this type of file.public java.io.File getAnnotatedFile(java.lang.String sourceFileName)
FileRequestListener
getAnnotatedFile
in interface FileRequestListener
public java.util.Iterator getFileFormatNames()
FileRequestListener
getFileFormatNames
in interface FileRequestListener
public FileFormat getFileFormat(java.lang.String name)
FileRequestListener
getFileFormat
in interface FileRequestListener
name
- the name of the file format.
public FileFormat getFileFormat(javax.swing.filechooser.FileFilter ff)
FileRequestListener
getFileFormat
in interface FileRequestListener
ff
- the file filter.
FileFormat
object associated with the
ff
parameter.public java.lang.String[] setFileFormat(java.lang.String file, AnnotatedFileFormat format)
FileRequestListener
file
to the
format specified by format
and returns the name of
the annotated file and the source file.
setFileFormat
in interface FileRequestListener
file
- the name of the source file.format
- the format of the file.
public boolean scanAnnotatedFile(java.lang.String fileName, java.lang.String annFileName)
FileRequestListener
scanAnnotatedFile
in interface FileRequestListener
fileName
- the name/path of the source file to be opene.annFileName
- the name/path of the annotated file to be opened.
public boolean openAnnotatedFile(java.lang.String annFileName)
FileRequestListener
openAnnotatedFile
in interface FileRequestListener
annFileName
- the name/path of the source file to be opened.
public boolean openAnnotatedFile(java.lang.String fileName, java.lang.String annFileName, AnnotatedFileFormat format)
public boolean openAnnotatedFile(java.lang.String fileName, java.lang.String annFileName)
FileRequestListener
openAnnotatedFile
in interface FileRequestListener
fileName
- the name/path of the source file to be opene.annFileName
- the name/path of the annotated file to be opened.
public boolean openAnnotationGraphFile(java.lang.String signal, java.lang.String fileName)
public int getFileCount()
FileRequestListener
getFileCount
in interface FileRequestListener
public java.util.Iterator iterator()
FileRequestListener
iterator
in interface FileRequestListener
public void addAnnotatedFileListener(AnnotatedFileListener adl)
FileRequestListener
AnnotatedFileListener
to be notified
of file related changes.
addAnnotatedFileListener
in interface FileRequestListener
adl
- the annotated file listener.public void removeAnnotatedFileListener(AnnotatedFileListener adl)
FileRequestListener
AnnotatedFileListener
.
removeAnnotatedFileListener
in interface FileRequestListener
adl
- the annotated file listener.public static boolean saveTextFile(AnnotationFile f)
public static boolean saveTextFile(AnnotationFile f, java.lang.String name)
public boolean saveAnnotatedFile(AnnotationFile af, java.lang.String name, java.awt.Component source)
public static boolean saveAnnotatedFile(AnnotationFile f, java.lang.String name)
public boolean saveAnnotatedFile(java.lang.String annFileName)
FileRequestListener
saveAnnotatedFile
in interface FileRequestListener
annFileName
- the name/path of the annotated file to be saved.
public boolean closeAnnotatedFile(java.lang.String annFileName)
FileRequestListener
closeAnnotatedFile
in interface FileRequestListener
annFileName
- the name/path of the annotated file to be closed.
public boolean allAnnotatedFilesSaved()
FileRequestListener
allAnnotatedFilesSaved
in interface FileRequestListener
public AnnotationFile getFileFromPath(java.lang.String p)
FileRequestListener
getFileFromPath
in interface FileRequestListener
p
- the file name/path.
p
.public void setProgress(int v)
setProgress
in interface ProgressListener
public void incrementProgress()
incrementProgress
in interface ProgressListener
public void incrementProgress(int v)
incrementProgress
in interface ProgressListener
public void windowOpened(java.awt.event.WindowEvent e)
windowOpened
in interface java.awt.event.WindowListener
public void windowClosing(java.awt.event.WindowEvent e)
windowClosing
in interface java.awt.event.WindowListener
public void windowClosed(java.awt.event.WindowEvent e)
windowClosed
in interface java.awt.event.WindowListener
public void windowIconified(java.awt.event.WindowEvent e)
windowIconified
in interface java.awt.event.WindowListener
public void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified
in interface java.awt.event.WindowListener
public void windowActivated(java.awt.event.WindowEvent e)
windowActivated
in interface java.awt.event.WindowListener
public void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated
in interface java.awt.event.WindowListener
public void setAnnotatorNameListener(FilterCriteriaManager l)
public void addGold(java.lang.String filename)
FileRequestListener
fileName
to the set of gold files.
addGold
in interface FileRequestListener
filename
- the name/path of the annotated file.public void removeGold(java.lang.String filename)
FileRequestListener
fileName
from the set of gold files.
removeGold
in interface FileRequestListener
filename
- the name/path of the annotated file.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |