/** * Hook for subclassers to add more stuff for value changes. Currently this * adds the new value to the change. */ protected void augmentNestedMapForValueChange(Map nested, Object cell, Object newValue) { Map attrs = (Map) nested.get(cell); if (attrs != null) GraphConstants.setValue(attrs, newValue); }
public void edit(Map attributes, ConnectionSet cs, ParentMap pm, UndoableEdit[] e) { if (attributes != null && !attributes.isEmpty()) { Iterator it = attributes.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); Object cell = entry.getKey(); Map map = (Map) entry.getValue(); Object value = GraphConstants.getValue(map); if (value != null) { Object result = valueForCellChanged(cell, value); if(value.equals(result)) { map.remove(GraphConstants.VALUE); } else { GraphConstants.setValue(map, result); GraphConstants.setResize(map, true); } } } updateAttributes(attributes); fireGraphChangedEvent(new GraphModelEvent(this, new ScuflGraphAttributeChange( attributes))); } }
/** * Updates specified entity on the graph */ protected void updateEntityCell(Entity e) { DefaultGraphCell cell = entityCells.get(e.getName()); if (cell != null) { GraphConstants.setValue(cell.getAttributes(), getCellMetadata(e)); GraphConstants.setResize(cell.getAttributes(), true); Map nested = new HashMap(); nested.put(cell, cell.getAttributes()); edit(nested); } }
GraphConstants.setValue(map, newValue); Map insert = new Hashtable(); insert.put(oldCell, map);
GraphConstants.setValue(map, newValue); Map insert = new Hashtable(); insert.put(oldCell, map);
GraphConstants.setValue(map, newValue); Map insert = new Hashtable(); insert.put(oldCell, map);
GraphConstants.setValue(map, newValue); Map insert = new Hashtable(); insert.put(oldCell, map);
GraphConstants.setValue(attrs, newName); GraphConstants.setResize(attrs, true); GraphConstants.setBounds(attrs, GraphConstants.getBounds(model assert newName != null : source; assert !newName.equals(((ScuflModelRenameEvent) event).getOldName()) : source; GraphConstants.setValue(attrs, newName); GraphConstants.setResize(attrs, true); GraphConstants.setBounds(attrs, GraphConstants.getBounds(model