|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nite.gui.util.AbstractCallableTool
public abstract class AbstractCallableTool
DOCUMENTATION UNDER CONSTRUCTION. NEED HELP? ASK dennisr at hmi dot utwente dot nl
A general abstract class that implements a lot of the default support for annotation tools.
It is targeted at observation-related callable tools such as a dialogue act coder or
named entity coder.
Main functionalities:
<callable-program description="Dialogue Act Annotation" name="net.sourceforge.nite.tools.dacoder.DACoder"> <required-argument name="corpus" type="corpus"/> <required-argument name="observation" type="observation"/> </callable-program>toolname (class), corpus and observation are generally a required argument (most annotation tools operate on one recording at a time)
<required-argument name="annotator" type="annotator"/>If set, annotator is asked for name, and the codings that are annotator specific (e.g. in DACoder this would be the dialogue act file and the adjacency pair file) are loaded especially for that coder and saved in a separate directory. This means that the current coder will not see the data from these layers generated by annotators with other name, and other annotators will not see results of this annotator. This prevents mixup of multiple versions of the same annotation created by different people.
initNomAnnotatorSpecificLoads(net.sourceforge.nite.nom.nomwrite.impl.NOMWriteCorpus)
. E.g. in the DACoder that method is implemented to set exactly
those codings to be annotator specific that contain the dialogue acts and the adjacency pairs.
<required-argument default="true" name="usecvs"/>If set, the tool will try, upon startup, to get the latest version of the relevant codings
<required-argument default="myConfigFileName.xml" name="config"/>If set, the tool will try to load the specified configuration file rather than the default nxtConfig.xml. further to this, the specific corpus and gui-settings within the configuration file can be named with two more required-argument in the CallableTool:
<required-argument name="corpus-settings" default="my-corpus-settings-id"/> <required-argument name="gui-settings" default="my-gui-settings-id"/>the first naming the ID of the corpus-settings node in the config file that should be used, the second naming the ID of the gui-settings node.
The main method for a subclassing tool is probably always the same: simply call the constructor and pass any arguments. public static void main(String[] args) { DACoder mainProg = new DACoder(args); }needed: proper constructor calling a list of functions (show list, explain if each is necessary, optional, how and why) a config object!!!!
This method starts with parsing the arguments passed to this tool, after which it calls all those useful methods from the superclass that make development of a new tool such an easy process. public DACoder(String[] args) { //* mostly necessary: * parseArguments(args); //AbstractCallableTool.parseArguments parses the usual arguments: corpus, observation, annotator, usecvs. initConfig(); //cfreate the tool specific configuration class initializeCorpus(getCorpusName(),getObservationName(), getAnnotatorName()); //initialize the corpus, given the settings passed as arguments setupMainFrame(getConfig().getApplicationName()); //setup a main frame initLnF(); // Look and feel. Can be ignored/left out if you happen to like the default metal look-and-feel setupDesktop(); //setup a desktop on which all the windows (media viewer, transcription view, etc) are added //* pretty much optional: * setupLog(Logger.global, 530, 535, 465, 90); //a logging window, useful for giving feedback to the user setupMediaPlayer(695,15,300,400); //a mediaplayer: necessary if you want video or audio players synchronized to the transcription view setupTranscriptionView(15,15,500,600); //one of the most important elements for many tools: a view of the transcription. Highly customizable in the methods initTranscriptionView and refreshTranscriptionView. setupSearch(); //search functinoality can be included by default in all subclassing tools. Search results can be highlighted in the transcription view. setupActions(); setupMenus(); //* setup any tool specific extras... * } The config method creates a configuration object specific for this subclass. More information on this configuration stuff can be found below. protected void initConfig() { config = new DACoderConfig(); }The documentation of the methods called in the above example constructor should help a lot in deciding whether (and how) to use them. In many cases the utility methods make some asssumptions about what has been called before (e.g. the setupVideo should be called AFTER the corpus has been initialized /loaded etc). Keep track of this by reading javadoc! needed: config class / config file settings. See other section for this.
Field Summary | |
---|---|
static java.lang.String |
EXIT_ACTION
Exit action: Exit application. |
static java.lang.String |
HELP_ACTION
Show help. |
static java.lang.String |
PRINT_NTV_ACTION
Print action: print the NTranscriptionView. |
static java.lang.String |
REFRESH_NTV_ACTION
Refresh action: refresh the NTranscriptionView. |
static java.lang.String |
SAVE_ACTION
Save action: Save corpus. |
static java.lang.String |
SEARCH_ACTION
Show searchwindow. |
Constructor Summary | |
---|---|
AbstractCallableTool()
|
Method Summary | |
---|---|
javax.swing.ActionMap |
getActionMap()
See ntv attribute. |
java.lang.String |
getAnnotatorName()
|
Clock |
getClock()
|
ClockFace |
getClockFace()
Returns the clockface of this class. |
AbstractCallableToolConfig |
getConfig()
|
java.lang.String |
getConfigFileName()
|
NOMWriteCorpus |
getCorpus()
|
java.lang.String |
getCorpusName()
|
java.lang.String |
getCorpusSettingsName()
|
java.lang.String |
getGUISettingsName()
|
NiteMetaData |
getMetaData()
|
NTranscriptionView |
getNTV()
Returns the transcription view, if it has already been created by a call to setupTranscriptionView(). |
java.lang.String |
getObservationName()
|
QueryHandler |
getQueryHandler()
|
void |
initTranscriptionViewSettings()
Initializes the settings of the transcriptionView. |
void |
refreshTranscriptionView()
Refresh the transcriptionView. |
java.util.List |
search(java.lang.String query)
|
boolean |
useCVS()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String REFRESH_NTV_ACTION
ntv
attribute.
Doesn't exist if no NTV initialized when actmap was created!
public static final java.lang.String PRINT_NTV_ACTION
ntv
attribute.
Doesn't exist if no NTV initialized when actmap was created!
public static final java.lang.String EXIT_ACTION
public static final java.lang.String SAVE_ACTION
public static final java.lang.String HELP_ACTION
public static final java.lang.String SEARCH_ACTION
Constructor Detail |
---|
public AbstractCallableTool()
Method Detail |
---|
public AbstractCallableToolConfig getConfig()
public java.lang.String getCorpusName()
public java.lang.String getObservationName()
public java.lang.String getAnnotatorName()
public boolean useCVS()
public java.lang.String getConfigFileName()
public java.lang.String getCorpusSettingsName()
public java.lang.String getGUISettingsName()
public NOMWriteCorpus getCorpus()
public NiteMetaData getMetaData()
public Clock getClock()
public ClockFace getClockFace()
public NTranscriptionView getNTV()
public void initTranscriptionViewSettings()
refreshTranscriptionView
.
This methods will be overriden by the implementations.
WHAT SHOULD BE INITIALIZED? See also new config classes
public void refreshTranscriptionView()
initTranscriptionViewSettings
.
May be overriden, but default behaviour is OK for most. Default: display all segments of type config.getSegmentationElementName()
and display all annotation element of all types in config.getDisplayedAnnotationNames().
public java.util.List search(java.lang.String query)
public QueryHandler getQueryHandler()
public javax.swing.ActionMap getActionMap()
ntv
attribute.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |