/** * * Copyright (c) 2003 University of Mancester. * @author Kevin Garwood (garwood@cs.man.ac.uk) * @version 1.0 * */ package pedro.ontology; import javax.swing.text.JTextComponent; /* Code RoadMap: Section Constants Section Properties Section Construction Section Accessors Section Mutators Section Validation Section Errors Section Interfaces Section Overload */ public class OWLOntologyViewer extends DefaultOntologyViewer { // ========================================== // Section Constants // ========================================== // ========================================== // Section Properties // ========================================== private OWLOntologySource owlOntologySource; // ========================================== // Section Construction // ========================================== public OWLOntologyViewer() { setShowReset(true); buildUI(); } // ========================================== // Section Accessors // ========================================== // ========================================== // Section Mutators // ========================================== // ========================================== // Section Validation // ========================================== // ========================================== // Section Errors // ========================================== // ========================================== // Section Interfaces // ========================================== public void setTargetDataField(String fieldName, JTextComponent textComponent) { super.setTargetDataField(fieldName, textComponent); owlOntologySource.setTargetFieldName(fieldName); updateOntologyViews(); } private void updateOntologyViews() { int numberOfViews = ontologyViews.size(); for ( int i = 0; i < numberOfViews; i++) { OntologyView currentView = (OntologyView) ontologyViews.get(i); currentView.setSource(owlOntologySource); } // end for () } // ========================================== // Section Overload // ========================================== public void reset() { owlOntologySource.reset(); updateOntologyViews(); repaint(); } public void setSource(OntologySource _owlOntologySource) { super.setSource(_owlOntologySource); owlOntologySource = (OWLOntologySource) _owlOntologySource; } public void useTerms() { owlOntologySource.addContext(targetFieldName, selectedOntologyTerms); super.useTerms(); } public void show() { updateOntologyViews(); super.show(); } }