![JAR search and dependency download from the Maven repository](/logo.png)
org.coode.owlviz.command.HideClassesPastRadiusCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of owlviz Show documentation
Show all versions of owlviz Show documentation
A plug-in for the Protege Desktop ontology editor that provides a graphical representation of the class
hierarchies in an OWL ontology.
The newest version!
package org.coode.owlviz.command;
import org.coode.owlviz.ui.ClassRadiusDialog;
import org.coode.owlviz.ui.OWLVizIcons;
import org.coode.owlviz.util.graph.controller.Controller;
import org.coode.owlviz.util.okcanceldialog.OKCancelDialog;
import org.protege.editor.owl.ui.view.OWLSelectionViewAction;
import org.semanticweb.owlapi.model.OWLClass;
import javax.swing.*;
import java.awt.event.ActionEvent;
/**
* User: matthewhorridge
* The Univeristy Of Manchester
* Medical Informatics Group
* Date: Mar 5, 2004
*
* [email protected]
* www.cs.man.ac.uk/~horridgm
*/
public class HideClassesPastRadiusCommand extends OWLSelectionViewAction {
private Controller assertedController;
private Controller inferredController;
private ClassRadiusDialog dlg;
public HideClassesPastRadiusCommand(Controller assertedController,
Controller inferredController) {
super("Hide classes past radius", OWLVizIcons.getIcon(OWLVizIcons.HIDE_CLASSES_PAST_RADIUS_ICON));
this.putValue(AbstractAction.SHORT_DESCRIPTION, "Hide classes past radius");
this.assertedController = assertedController;
this.inferredController = inferredController;
dlg = new ClassRadiusDialog(null, false);
}
public void updateState() {
setEnabled(true);
}
public void dispose() {
}
/**
* Invoked when an action occurs.
*/
public void actionPerformed(ActionEvent e) {
Object selObj = assertedController.getGraphSelectionModel().getSelectedObject();
if (selObj != null) {
if (dlg.showDialog() == OKCancelDialog.OPTION_APPROVE) {
int classRadius = dlg.getClassRadius();
assertedController.getVisualisedObjectManager().hideObjects(selObj, classRadius, OWLClass.class);
inferredController.getVisualisedObjectManager().hideObjects(selObj, classRadius, OWLClass.class);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy