Search in sources :

Example 1 with SerialAnalyserController

use of gate.creole.SerialAnalyserController in project gate-core by GateNLP.

the class NameBearerHandle method buildStaticPopupItems.

protected void buildStaticPopupItems() {
    // build the static part of the popup
    staticPopupItems = new ArrayList<JComponent>();
    if (target instanceof ProcessingResource && !(target instanceof Controller)) {
        // actions for PRs (but not Controllers)
        staticPopupItems.add(null);
        staticPopupItems.add(new XJMenuItem(new ReloadAction(), sListenerProxy));
        staticPopupItems.add(new XJMenuItem(new ApplicationWithPRAction(), sListenerProxy));
    } else if (target instanceof LanguageResource) {
        // Language Resources
        staticPopupItems.add(null);
        if (target instanceof Document) {
            staticPopupItems.add(new XJMenuItem(new CreateCorpusForDocAction(), sListenerProxy));
        }
        if (target instanceof gate.TextualDocument) {
            staticPopupItems.add(null);
            staticPopupItems.add(new DocumentExportMenu(this));
        } else if (target instanceof Corpus) {
            corpusFiller = new CorpusFillerComponent();
            scfInputDialog = new SingleConcatenatedFileInputDialog();
            staticPopupItems.add(new XJMenuItem(new PopulateCorpusAction(), sListenerProxy));
            staticPopupItems.add(new XJMenuItem(new PopulateCorpusFromSingleConcatenatedFileAction(), sListenerProxy));
            staticPopupItems.add(null);
            staticPopupItems.add(new DocumentExportMenu(this));
        }
        if (((LanguageResource) target).getDataStore() != null) {
            // this item can be used only if the resource belongs to a
            // datastore
            staticPopupItems.add(new XJMenuItem(new SaveAction(), sListenerProxy));
        }
        if (!(target instanceof AnnotationSchema)) {
            staticPopupItems.add(new XJMenuItem(new SaveToAction(), sListenerProxy));
        }
    }
    if (target instanceof Controller) {
        // Applications
        staticPopupItems.add(null);
        if (target instanceof SerialAnalyserController) {
            staticPopupItems.add(new XJMenuItem(new MakeConditionalAction(), sListenerProxy));
        }
        staticPopupItems.add(new XJMenuItem(new DumpToFileAction(), sListenerProxy));
        staticPopupItems.add(new XJMenuItem(new ExportApplicationAction(), sListenerProxy));
    }
}
Also used : LanguageResource(gate.LanguageResource) ProcessingResource(gate.ProcessingResource) Document(gate.Document) IndexedCorpus(gate.creole.ir.IndexedCorpus) Corpus(gate.Corpus) AnnotationSchema(gate.creole.AnnotationSchema) SerialAnalyserController(gate.creole.SerialAnalyserController) ConditionalSerialAnalyserController(gate.creole.ConditionalSerialAnalyserController) JComponent(javax.swing.JComponent) SerialAnalyserController(gate.creole.SerialAnalyserController) Controller(gate.Controller) ConditionalSerialAnalyserController(gate.creole.ConditionalSerialAnalyserController) CorpusController(gate.CorpusController) ConditionalController(gate.creole.ConditionalController) XJMenuItem(gate.swing.XJMenuItem)

Example 2 with SerialAnalyserController

use of gate.creole.SerialAnalyserController in project gate-core by GateNLP.

the class SerialAnalyserControllerPersistence method createObject.

/**
 * Creates a new object from the data contained. This new object is supposed
 * to be a copy for the original object used as source for data extraction.
 */
@Override
public Object createObject() throws PersistenceException, ResourceInstantiationException {
    SerialAnalyserController sac = (SerialAnalyserController) super.createObject();
    sac.setCorpus((Corpus) PersistenceManager.getTransientRepresentation(corpus, resourceName, initParamOverrides));
    return sac;
}
Also used : SerialAnalyserController(gate.creole.SerialAnalyserController)

Example 3 with SerialAnalyserController

use of gate.creole.SerialAnalyserController in project gate-core by GateNLP.

the class SerialAnalyserControllerPersistence method extractDataFromSource.

/**
 * Populates this Persistence with the data that needs to be stored from the
 * original source object.
 */
@Override
public void extractDataFromSource(Object source) throws PersistenceException {
    if (!(source instanceof SerialAnalyserController)) {
        throw new UnsupportedOperationException(getClass().getName() + " can only be used for " + SerialAnalyserController.class.getName() + " objects!\n" + source.getClass().getName() + " is not a " + SerialAnalyserController.class.getName());
    }
    super.extractDataFromSource(source);
    SerialAnalyserController sac = (SerialAnalyserController) source;
    corpus = PersistenceManager.getPersistentRepresentation(sac.getCorpus());
}
Also used : SerialAnalyserController(gate.creole.SerialAnalyserController)

Aggregations

SerialAnalyserController (gate.creole.SerialAnalyserController)3 Controller (gate.Controller)1 Corpus (gate.Corpus)1 CorpusController (gate.CorpusController)1 Document (gate.Document)1 LanguageResource (gate.LanguageResource)1 ProcessingResource (gate.ProcessingResource)1 AnnotationSchema (gate.creole.AnnotationSchema)1 ConditionalController (gate.creole.ConditionalController)1 ConditionalSerialAnalyserController (gate.creole.ConditionalSerialAnalyserController)1 IndexedCorpus (gate.creole.ir.IndexedCorpus)1 XJMenuItem (gate.swing.XJMenuItem)1 JComponent (javax.swing.JComponent)1