Search in sources :

Example 1 with OWLCellRenderer

use of org.protege.editor.owl.ui.renderer.OWLCellRenderer in project protege-client by protegeproject.

the class ShowUncommittedChangesAction method displayUncommittedChanges.

private void displayUncommittedChanges(OWLOntology ontology, List<OWLOntologyChange> uncommitted) {
    String shortOntologyName = "";
    OWLOntologyID ontologyId = ontology.getOntologyID();
    if (!ontologyId.isAnonymous()) {
        shortOntologyName = ontology.getOntologyID().getOntologyIRI().get().getRemainder().get();
    }
    if (shortOntologyName.isEmpty()) {
        shortOntologyName = ontologyId.toString();
    }
    ChangeListTableModel tableModel = new ChangeListTableModel(uncommitted);
    JTable table = new JTable(tableModel);
    table.setDefaultRenderer(OWLObject.class, new OWLCellRenderer(getOWLEditorKit()));
    JScrollPane pane = new JScrollPane(table);
    JDialog dialog = new JDialog((Frame) SwingUtilities.getAncestorOfClass(Frame.class, getOWLWorkspace()));
    dialog.setTitle("Uncommitted changes for " + shortOntologyName);
    dialog.getContentPane().add(pane);
    dialog.setResizable(true);
    dialog.setModal(true);
    dialog.pack();
    dialog.setVisible(true);
}
Also used : OWLCellRenderer(org.protege.editor.owl.ui.renderer.OWLCellRenderer) OWLOntologyID(org.semanticweb.owlapi.model.OWLOntologyID) ChangeListTableModel(org.protege.editor.owl.client.panel.ChangeListTableModel)

Example 2 with OWLCellRenderer

use of org.protege.editor.owl.ui.renderer.OWLCellRenderer in project protege-client by protegeproject.

the class ChangeHistoryPanel method getChangeListComponent.

private JComponent getChangeListComponent() {
    changeListTableModel = new ChangeListTableModel(new ArrayList<OWLOntologyChange>());
    changeListTable = new JTable(changeListTableModel);
    changeListTable.setDefaultRenderer(OWLObject.class, new OWLCellRenderer(editorKit));
    JScrollPane scrollPane = new JScrollPane(changeListTable);
    scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
    return scrollPane;
}
Also used : JScrollPane(javax.swing.JScrollPane) OWLCellRenderer(org.protege.editor.owl.ui.renderer.OWLCellRenderer) JTable(javax.swing.JTable) ArrayList(java.util.ArrayList)

Aggregations

OWLCellRenderer (org.protege.editor.owl.ui.renderer.OWLCellRenderer)2 ArrayList (java.util.ArrayList)1 JScrollPane (javax.swing.JScrollPane)1 JTable (javax.swing.JTable)1 ChangeListTableModel (org.protege.editor.owl.client.panel.ChangeListTableModel)1 OWLOntologyID (org.semanticweb.owlapi.model.OWLOntologyID)1