/** * Sets the attributes. * @param attributes The attributes to set */ public void setAttributes(AttributeMap attributes) { if (attributes == null) attributes = new AttributeMap(); this.attributes = attributes; }
/** * Hook for subclassers to avoid creating an empty AttributeMap during * construction of the instance. Override this and return null if you want * to avoid creation of an attribute map at construction time. */ protected AttributeMap createAttributeMap() { return new AttributeMap(); }
/** * Constructs a model that is not an attribute store. */ public DefaultGraphModel(List roots, AttributeMap attributes) { if (roots != null) this.roots = roots; else this.roots = new ArrayList(); if (attributes != null) this.attributes = attributes; else this.attributes = new AttributeMap(); }
public RoleEntity(String id) { super(id); attributes=new org.jgraph.graph.AttributeMap(); GraphConstants.setDisconnectable(attributes,false); }
@SuppressWarnings("unchecked") // FIXME hb 28-nov-05: See FIXME below private void positionVertexAt(Object vertex, int x, int y) { DefaultGraphCell cell = jgAdapter.getVertexCell(vertex); AttributeMap attr = cell.getAttributes(); Rectangle2D bounds = GraphConstants.getBounds(attr); Rectangle2D newBounds = new Rectangle2D.Double( x, y, bounds.getWidth(), bounds.getHeight()); GraphConstants.setBounds(attr, newBounds); // TODO: Clean up generics once JGraph goes generic AttributeMap cellAttr = new AttributeMap(); cellAttr.put(cell, attr); jgAdapter.edit(cellAttr, null, null, null); }
AttributeMap undo = new AttributeMap(); if (change != null) {
org.jgraph.graph.AttributeMap cellAttr = new AttributeMap(); cellAttr.put(cell, attr); jgAdapter.edit(cellAttr, null, null, null);
AttributeMap implementStyle = new AttributeMap(); GraphConstants.setLineBegin(implementStyle, GraphConstants.ARROW_TECHNICAL); AttributeMap extendStyle = new AttributeMap(); GraphConstants .setLineBegin(extendStyle, GraphConstants.ARROW_TECHNICAL); AttributeMap aggregateStyle = new AttributeMap(); GraphConstants.setLineBegin(aggregateStyle, GraphConstants.ARROW_DIAMOND); createBounds(new AttributeMap(), 20, 100, Color.blue)); gm.addPort(null, "GraphModel/Center"); DefaultGraphCell dgm = new DefaultGraphCell("DefaultGraphModel"); attributes.put(dgm, createBounds(new AttributeMap(), 20, 180, Color.blue)); dgm.addPort(null, "DefaultGraphModel/Center"); attributes.put(jc, createBounds(new AttributeMap(), 180, 20, Color.green)); jc.addPort(null, "JComponent/Center"); DefaultGraphCell jg = new DefaultGraphCell("JGraph"); attributes.put(jg, createBounds(new AttributeMap(), 180, 100, Color.green)); jg.addPort(null, "JGraph/Center"); .put(cu, createBounds(new AttributeMap(), 340, 20, Color.red)); cu.addPort(null, "ComponentUI/Center");
Map attr = new AttributeMap();//auxiliaryEdges[i].getAttributes(); auxiliaryEdges[i].setAttributes(new AttributeMap());
if(map == null) map = new AttributeMap(); attributes.put(node, map);