/** * 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); } }
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))); } }
protected DefaultGraphCell createEntityCell(Entity entity) { DefaultGraphCell cell = new DefaultGraphCell(getCellMetadata(entity)); GraphConstants.setResize(cell.getAttributes(), true); GraphConstants.setBorder(cell.getAttributes(), new LineBorder(Color.BLACK)); GraphConstants.setEditable(cell.getAttributes(), false); entityCells.put(entity.getName(), cell); cell.addPort(); return cell; }
GraphConstants.setResize(attrs, true); GraphConstants.setBounds(attrs, GraphConstants.getBounds(model .getAttributes(source))); assert !newName.equals(((ScuflModelRenameEvent) event).getOldName()) : source; GraphConstants.setValue(attrs, newName); GraphConstants.setResize(attrs, true); GraphConstants.setBounds(attrs, GraphConstants.getBounds(model .getAttributes(source)));
.getX(), p.getY(), gs2 / 2, gs2); GraphConstants.setResize(attrs, true);
.getPreferredColour(processor), Color.WHITE)); GraphConstants.setOpaque(map, true); GraphConstants.setResize(map, true); GraphConstants.setBorder(map, new LineBorder(Color.BLACK)); GraphConstants.setInset(map, 3); GraphConstants.setResize(map, true); GraphConstants.setInset(map, 3); GraphConstants.setBorder(map, new LineBorder(Color.BLACK));