All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.protege.editor.owl.ui.action.VisibilityManagerOntologySelectionStrategyAction Maven / Gradle / Ivy

Go to download

OWL ontology editing infrastructure used by the Protege desktop application.

The newest version!
package org.protege.editor.owl.ui.action;

import org.protege.editor.owl.model.OntologyVisibilityManager;
import org.protege.editor.owl.model.OntologyVisibilityManagerImpl;
import org.protege.editor.owl.model.selection.ontologies.OntologySelectionStrategy;
import org.protege.editor.owl.model.selection.ontologies.VisibilityManagerSelectionStrategy;
import org.protege.editor.owl.ui.UIHelper;
import org.protege.editor.owl.ui.selector.OWLOntologySelectorPanel;

import javax.swing.*;
import java.awt.event.ActionEvent;

/**
 * Author: drummond
* http://www.cs.man.ac.uk/~drummond/

* The University Of Manchester
* Bio Health Informatics Group
* Date: Jun 6, 2008

*/ public class VisibilityManagerOntologySelectionStrategyAction extends AbstractOntologySelectionStrategyAction { private OntologySelectionStrategy strategy; private OntologyVisibilityManager vm; private OWLOntologySelectorPanel ontPanel; public void actionPerformed(ActionEvent event) { if (ontPanel == null){ ontPanel = new OWLOntologySelectorPanel(getOWLEditorKit()); } int ret = new UIHelper(getOWLEditorKit()).showDialog("Select ontologies", ontPanel); if (ret == JOptionPane.OK_OPTION) { getVisibilityManager().setVisible(ontPanel.getSelectedOntologies()); super.actionPerformed(event); } } protected OntologySelectionStrategy getStrategy() { if (strategy == null){ strategy = new VisibilityManagerSelectionStrategy(getVisibilityManager()); } return strategy; } public OntologyVisibilityManager getVisibilityManager() { if (vm == null){ vm = new OntologyVisibilityManagerImpl(); } return vm; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy