public boolean stopCellEditing() { ConflictCell pc = (ConflictCell) graph.getEditingCell(); Conflict conflict = (Conflict) pc.getUserObject(); conflict.setTopic(topic.getText()); conflict.setViewpoints(new String[] {vp1.getDescription(), vp2.getDescription()}); return super.stopCellEditing(); }
public Component getGraphCellEditorComponent(JGraph graph, Object value, boolean isSelected) { ConflictCell cc = (ConflictCell) editingCell; Conflict c = (Conflict) cc.getUserObject(); topic.setText(c.getTopic()); vp1.setDescription(c.getViewpoints()[0]); vp2.setDescription(c.getViewpoints()[1]); return editorComponent; }
public Component getRendererComponent( JGraph graph, CellView view, boolean sel, boolean focus, boolean preview) { ConflictCell cc = (ConflictCell) view.getCell(); Conflict conflict = (Conflict) cc.getUserObject(); if (conflict.getTopic().length() > 0) { conflictLabel.setText("<html><center>" + conflict.getTopic() + "</center></html>"); } else { conflictLabel.setText("<html><center>Konflikt</center></html>"); } return component; }