public void paint(Graphics g) {
   super.paint(g);
   for (int i = 0; i < tableModel.getRowCount(); i++) {
     if (tableModel.isSeparator(i) && tableModel.isDefinition(i)) {
       int count = tableModel.getBlockSize(i + 1);
       if (count > 0) {
         paintEquivalentBlock(g, i + 1, count);
       }
     }
   }
 }
 public List getPrototypeTriples() {
   int[] sels = getSelectedRows();
   if (sels.length == 1 && tableModel.isSeparator(sels[0])) {
     RDFProperty predicate = null;
     if (tableModel.isDefinition(sels[0])) {
       predicate = getOWLModel().getOWLEquivalentClassProperty();
     } else {
       predicate = getOWLModel().getRDFSSubClassOfProperty();
     }
     return Collections.singletonList(
         new DefaultTriple(tableModel.getEditedCls(), predicate, null));
   }
   return super.getPrototypeTriples();
 }
 public TableCellRenderer getCellRenderer(int row, int column) {
   if (column == COL_EXPRESSION && tableModel.isSeparator(row)) {
     return separatorCellRendererGrayed;
   } else {
     return super.getCellRenderer(row, column);
   }
 }
  protected void addNavigationMenuItems(RDFResource resource, JPopupMenu menu) {
    super.addNavigationMenuItems(resource, menu);
    int row = getSelectedRow();
    if (tableModel.getType(row) == NCIConditionsTableModel.TYPE_INHERITED) {
      final RDFSClass definingClass = tableModel.getOriginClass(row);
      menu.add(
          new AbstractAction(
              "Navigate to defining class (" + definingClass.getBrowserText() + ")",
              ProtegeUI.getIcon(definingClass)) {
            private static final long serialVersionUID = 441936038070346937L;

            public void actionPerformed(ActionEvent e) {
              navigateTo(definingClass);
            }
          });
    }
  }
 public int addRow(Cls cls) {
   if (cls.equals(tableModel.getEditedCls())) {
     tableModel.displaySemanticError("Cannot assign " + cls.getBrowserText() + " to itself.");
     return -1;
   } else {
     RDFSClass rdfsClass = (RDFSClass) cls;
     if (tableModel.addRow(rdfsClass, getSelectedRow())) {
       setSelectedRow(rdfsClass);
       return tableModel.getClassRow(rdfsClass);
     } else {
       tableModel.displaySemanticError("Could not add " + cls.getBrowserText() + ".");
       if (rdfsClass instanceof OWLAnonymousClass) {
         rdfsClass.delete();
       }
       return -1;
     }
   }
 }
 public void selectNecessaryIfNothingSelected() {
   int selectedRow = getSelectedRow();
   if (selectedRow < 0) {
     selectedRow = 1;
     while (tableModel.getType(selectedRow) != NCIConditionsTableModel.TYPE_SUPERCLASS) {
       selectedRow++;
     }
     setSelectedRow(selectedRow);
   }
 }
 public void setSelectedTriples(Collection triples) {
   tableModel.refresh();
   Iterator it = triples.iterator();
   if (it.hasNext()) {
     Triple triple = (Triple) it.next();
     if (triple.getObject() instanceof RDFSClass) {
       RDFSClass cls = (RDFSClass) triple.getObject();
       setSelectedRow(cls);
     }
   }
 }
 public void setValueAt(Object aValue, int row, int column) {
   tableModel.previouslyEditedCls = null;
   if (aValue instanceof String) {
     try {
       String text = (String) aValue;
       getOWLModel().getOWLClassParser().checkClass(getOWLModel(), text);
       super.setValueAt(aValue, row, column);
       if (tableModel.previouslyEditedCls != null) {
         setSelectedRow((RDFSClass) tableModel.previouslyEditedCls);
       }
     } catch (Exception ex) {
       // Ignore: User has clicked somewhere else on the table while editing invalid expression
     }
   }
 }
 public void hideSymbolPanel() {
   super.hideSymbolPanel();
   tableModel.removeEmptyRow();
 }
 private void createAndEditRow(int selectedRow) {
   if (selectedRow >= 0 && tableModel.getType(selectedRow) != TYPE_INHERITED) {
     int row = tableModel.addEmptyRow(selectedRow);
     editExpression(row);
   }
 }