protected void createUI(JComponent parent) { setInstructions("Please select an existing (pre-loaded) ontology that you want to import."); ontologyList = new OWLObjectList(getOWLEditorKit()); ontologyList.setCellRenderer(new OWLOntologyCellRenderer(getOWLEditorKit())); ontologyList.addListSelectionListener(e -> { if (!e.getValueIsAdjusting()) { updateState(); } }); parent.setLayout(new BorderLayout()); parent.add(ComponentFactory.createScrollPane(ontologyList), BorderLayout.CENTER); parent.add(createCustomizedImportsComponent(), BorderLayout.SOUTH); }
public void displayingPanel() { fillList(); updateState(); ontologyList.requestFocus(); }
private void fillList() { ontologyList.setListData(getOntologies().toArray()); }
protected void createUI(JComponent parent) { setInstructions("Please select an existing (pre-loaded) ontology that you want to import."); ontologyList = new OWLObjectList(getOWLEditorKit()); ontologyList.setCellRenderer(new OWLOntologyCellRenderer(getOWLEditorKit())); ontologyList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { updateState(); } } }); parent.setLayout(new BorderLayout()); parent.add(ComponentFactory.createScrollPane(ontologyList), BorderLayout.CENTER); parent.add(createCustomizedImportsComponent(), BorderLayout.SOUTH); }
@Override public void aboutToHidePanel() { OntologyImportWizard wizard = getWizard(); wizard.setImportsAreFinal(false); wizard.clearImports(); for (Object o : ontologyList.getSelectedValues()){ OWLOntology ontology = (OWLOntology) o; OWLOntologyID id = ontology.getOntologyID(); IRI physicalLocation = getOWLModelManager().getOWLOntologyManager().getOntologyDocumentIRI(ontology); ImportInfo parameter = new ImportInfo(); parameter.setOntologyID(ontology.getOntologyID()); parameter.setPhysicalLocation(physicalLocation.toURI()); parameter.setImportLocation(!id.isAnonymous() ? id.getDefaultDocumentIRI().get() : physicalLocation); wizard.addImport(parameter); } ((SelectImportLocationPage) getWizardModel().getPanel(SelectImportLocationPage.ID)).setBackPanelDescriptor(ID); ((ImportConfirmationPage) getWizardModel().getPanel(ImportConfirmationPage.ID)).setBackPanelDescriptor(ID); super.aboutToHidePanel(); }
private List<OWLOntology> getOntologies() { final OWLModelManager mngr = getOWLModelManager(); List<OWLOntology> ontologies = new ArrayList<OWLOntology>(mngr.getOntologies()); ontologies.removeAll(mngr.getOWLOntologyManager().getImportsClosure(mngr.getActiveOntology())); // you cannot import an ontology from the same series ontologies.removeAll(getOntologiesInSeries(mngr.getActiveOntology(), ontologies)); Collections.sort(ontologies, mngr.getOWLObjectComparator()); return ontologies; }
private void updateState() { getWizard().setNextFinishButtonEnabled(ontologyList.getSelectedValue() != null); } }
public OntologyImportWizard(Frame owner, OWLEditorKit owlEditorKit) { super(owner); setTitle("Import ontology wizard"); registerWizardPanel(ImportTypePage.ID, new ImportTypePage(owlEditorKit)); registerWizardPanel(LocalFilePage.ID, new LocalFilePage(owlEditorKit)); registerWizardPanel(URLPage.ID, new URLPage(owlEditorKit)); registerWizardPanel(LoadedOntologyPage.ID, new LoadedOntologyPage(owlEditorKit)); registerWizardPanel(AnticipateOntologyIdPage.ID, new AnticipateOntologyIdPage(owlEditorKit)); registerWizardPanel(SelectImportLocationPage.ID, new SelectImportLocationPage(owlEditorKit)); registerWizardPanel(ImportConfirmationPage.ID, new ImportConfirmationPage(owlEditorKit)); setCurrentPanel(ImportTypePage.ID); }
@Override public void aboutToHidePanel() { OntologyImportWizard wizard = (OntologyImportWizard) getWizard(); wizard.setImportsAreFinal(false); wizard.clearImports(); for (Object o : ontologyList.getSelectedValues()){ OWLOntology ontology = (OWLOntology) o; OWLOntologyID id = ontology.getOntologyID(); IRI physicalLocation = getOWLModelManager().getOWLOntologyManager().getOntologyDocumentIRI(ontology); ImportInfo parameter = new ImportInfo(); parameter.setOntologyID(ontology.getOntologyID()); parameter.setPhysicalLocation(physicalLocation.toURI()); parameter.setImportLocation(!id.isAnonymous() ? id.getDefaultDocumentIRI() : physicalLocation); wizard.addImport(parameter); } ((SelectImportLocationPage) getWizardModel().getPanel(SelectImportLocationPage.ID)).setBackPanelDescriptor(ID); ((ImportConfirmationPage) getWizardModel().getPanel(ImportConfirmationPage.ID)).setBackPanelDescriptor(ID); super.aboutToHidePanel(); }
protected void createUI(JComponent parent) { setInstructions("Please select an existing (pre-loaded) ontology that you want to import."); ontologyList = new OWLObjectList(getOWLEditorKit()); ontologyList.setCellRenderer(new OWLOntologyCellRenderer(getOWLEditorKit())); ontologyList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { updateState(); } } }); parent.setLayout(new BorderLayout()); parent.add(ComponentFactory.createScrollPane(ontologyList), BorderLayout.CENTER); parent.add(createCustomizedImportsComponent(), BorderLayout.SOUTH); }
private List<OWLOntology> getOntologies() { final OWLModelManager mngr = getOWLModelManager(); List<OWLOntology> ontologies = new ArrayList<>(mngr.getOntologies()); ontologies.removeAll(mngr.getOWLOntologyManager().getImportsClosure(mngr.getActiveOntology())); // you cannot import an ontology from the same series ontologies.removeAll(getOntologiesInSeries(mngr.getActiveOntology(), ontologies)); Collections.sort(ontologies, mngr.getOWLObjectComparator()); return ontologies; }
public Object getNextPanelDescriptor() { return getWizard().isCustomizeImports() ? SelectImportLocationPage.ID : ImportConfirmationPage.ID; }
public OntologyImportWizard(Frame owner, OWLEditorKit owlEditorKit) { super(owner); setTitle("Import ontology wizard"); registerWizardPanel(ImportTypePage.ID, new ImportTypePage(owlEditorKit)); registerWizardPanel(LocalFilePage.ID, new LocalFilePage(owlEditorKit)); registerWizardPanel(URLPage.ID, new URLPage(owlEditorKit)); registerWizardPanel(LoadedOntologyPage.ID, new LoadedOntologyPage(owlEditorKit)); registerWizardPanel(LibraryPage.ID, new LibraryPage(owlEditorKit)); registerWizardPanel(AnticipateOntologyIdPage.ID, new AnticipateOntologyIdPage(owlEditorKit)); registerWizardPanel(SelectImportLocationPage.ID, new SelectImportLocationPage(owlEditorKit)); registerWizardPanel(ImportConfirmationPage.ID, new ImportConfirmationPage(owlEditorKit)); setCurrentPanel(ImportTypePage.ID); }
@Override public void aboutToHidePanel() { OntologyImportWizard wizard = getWizard(); wizard.setImportsAreFinal(false); wizard.clearImports(); for (Object o : ontologyList.getSelectedValues()){ OWLOntology ontology = (OWLOntology) o; OWLOntologyID id = ontology.getOntologyID(); IRI physicalLocation = getOWLModelManager().getOWLOntologyManager().getOntologyDocumentIRI(ontology); ImportInfo parameter = new ImportInfo(); parameter.setOntologyID(ontology.getOntologyID()); parameter.setPhysicalLocation(physicalLocation.toURI()); parameter.setImportLocation(!id.isAnonymous() ? id.getDefaultDocumentIRI().get() : physicalLocation); wizard.addImport(parameter); } ((SelectImportLocationPage) getWizardModel().getPanel(SelectImportLocationPage.ID)).setBackPanelDescriptor(ID); ((ImportConfirmationPage) getWizardModel().getPanel(ImportConfirmationPage.ID)).setBackPanelDescriptor(ID); super.aboutToHidePanel(); }
protected void createUI(JComponent parent) { setInstructions("Please select an existing (pre-loaded) ontology that you want to import."); ontologyList = new OWLObjectList(getOWLEditorKit()); ontologyList.setCellRenderer(new OWLOntologyCellRenderer(getOWLEditorKit())); ontologyList.addListSelectionListener(e -> { if (!e.getValueIsAdjusting()) { updateState(); } }); parent.setLayout(new BorderLayout()); parent.add(ComponentFactory.createScrollPane(ontologyList), BorderLayout.CENTER); parent.add(createCustomizedImportsComponent(), BorderLayout.SOUTH); }
private List<OWLOntology> getOntologies() { final OWLModelManager mngr = getOWLModelManager(); List<OWLOntology> ontologies = new ArrayList<>(mngr.getOntologies()); ontologies.removeAll(mngr.getOWLOntologyManager().getImportsClosure(mngr.getActiveOntology())); // you cannot import an ontology from the same series ontologies.removeAll(getOntologiesInSeries(mngr.getActiveOntology(), ontologies)); Collections.sort(ontologies, mngr.getOWLObjectComparator()); return ontologies; }
public void displayingPanel() { fillList(); updateState(); ontologyList.requestFocus(); }
public Object getNextPanelDescriptor() { return getWizard().isCustomizeImports() ? SelectImportLocationPage.ID : ImportConfirmationPage.ID; }
public OntologyImportWizard(Frame owner, OWLEditorKit owlEditorKit) { super(owner); setTitle("Import ontology wizard"); registerWizardPanel(ImportTypePage.ID, new ImportTypePage(owlEditorKit)); registerWizardPanel(LocalFilePage.ID, new LocalFilePage(owlEditorKit)); registerWizardPanel(URLPage.ID, new URLPage(owlEditorKit)); registerWizardPanel(LoadedOntologyPage.ID, new LoadedOntologyPage(owlEditorKit)); registerWizardPanel(LibraryPage.ID, new LibraryPage(owlEditorKit)); registerWizardPanel(AnticipateOntologyIdPage.ID, new AnticipateOntologyIdPage(owlEditorKit)); registerWizardPanel(SelectImportLocationPage.ID, new SelectImportLocationPage(owlEditorKit)); registerWizardPanel(ImportConfirmationPage.ID, new ImportConfirmationPage(owlEditorKit)); setCurrentPanel(ImportTypePage.ID); }
private void fillList() { ontologyList.setListData(getOntologies().toArray()); }