/** * Returns the graph model's attribute. Shortcut to <code> * getAttributes(null)</code>. * * @return attributes of <code>node</code> as a <code>Map</code> */ public Map getAttributes() { return getAttributes(null); }
private void initializeOccupiedPositions() { occupiedpositions.clear(); for (Object obj : dgm.getRoots()) { if (obj instanceof DefaultGraphCell) { // if (getChildren(obj).isEmpty()){ if (dgm.getAttributes(obj) != null && GraphConstants.getBounds(dgm.getAttributes(obj)) != null) occupiedpositions.put((DefaultGraphCell) obj, GraphConstants.getBounds(dgm.getAttributes(obj))); // } } } }
private void moveChildrenToNewLocation(Hashtable<DefaultGraphCell, Map> map) { Vector<DefaultGraphCell> collectionkey = new Vector<DefaultGraphCell>( map.keySet()); for (Object key : collectionkey) { Vector<DefaultGraphCell> children = getChildren(key); // System.err.println("moving "+children); Map attsparent = (Map) (dgm.getAttributes(key)); Map newAtts = (Map) map.get(key); if (GraphConstants.getBounds(newAtts) != null) moveChildrenToParent(map, children, key, attsparent, newAtts); } }
private void moveChildrenToParent(Hashtable map, Vector<DefaultGraphCell> children, Object changed, Map attsparent, Map newatts) { Rectangle2D coordParent = GraphConstants.getBounds(attsparent); Rectangle2D newCoordParent = GraphConstants.getBounds(newatts); Rectangle2D coordAtts = GraphConstants.getBounds(newatts); for (Object child : children) { Map attsChildren = dgm.getAttributes(child); // System.err.println("moving "+child); Rectangle2D coordChildren = GraphConstants.getBounds(attsChildren); int xchild = (int) coordChildren.getX(); int ychild = (int) coordChildren.getY(); int widthchild = (int) coordChildren.getWidth(); int heightchild = (int) coordChildren.getHeight(); xchild = (xchild + ((int) coordParent.getX() - (int) newCoordParent .getX())); ychild = ychild + ((int) coordParent.getY() - (int) newCoordParent.getY()); Hashtable newMap = new Hashtable(); GraphConstants.setBounds(newMap, new Rectangle(xchild, ychild, widthchild, heightchild)); map.put(child, newMap); } }
AttributeMap attr = getAttributes(cell); if (attr != null) { deltaOld = attr.applyMap(deltaNew);
.getAttributes(changed)); Map attsparent = (Map) (dgm .getAttributes(parentship.get(changed)));
insertNAryEdges(children); Map attsparent = (Map) (dgm.getAttributes(changed)); Map newAtts = (Map) arg0.getChange().getAttributes() .get(changed);