/** * Returns a <code>Map</code> that represents the attributes for the * specified cell. This attributes have precedence over each view's * attributes, regardless of isAttributeStore. * * @return attributes of <code>node</code> as a <code>Map</code> */ public AttributeMap getAttributes(Object node) { if (node instanceof GraphCell) return ((GraphCell) node).getAttributes(); else if (node == null) return attributes; return null; }
private static Point calculateCenter(GraphCell[] selected){ int x=0; int y=0; for (int k=0;k<selected.length;k++){ GraphCell current=selected[k]; Rectangle rect=GraphConstants.getBounds(current.getAttributes()).getBounds(); x=x+rect.x+rect.width/2; y=y+rect. y+rect.height/2; } return new Point((int)(x/selected.length),(int)(y/selected.length)); }
private Point calculateCenter(GraphCell[] selected){ int x=0; int y=0; for (int k=0;k<selected.length;k++){ GraphCell current=selected[k]; Rectangle rect=GraphConstants.getBounds(current.getAttributes()).getBounds(); x=x+rect.x+rect.width/2; y=y+rect. y+rect.height/2; } return new Point((int)(x/selected.length),(int)(y/selected.length)); }