Package java.awt.geom

Examples of java.awt.geom.Rectangle2D.clone()


            }
          } else {
            Rectangle2D r = graph.getCellBounds(cells[i]);
            if (r != null) {
              if (ret == null)
                ret = (Rectangle2D) r.clone();
              Rectangle2D.union(ret, r, ret);
            }
          }
        }
        if (ret != null)
View Full Code Here


      throw new InternalError("BasicGraphUI cannot paint " + c.toString()
          + "; " + graph + " was expected.");

    Rectangle2D clipBounds = g.getClipBounds();
    if (clipBounds != null) {
      clipBounds = (Rectangle2D) clipBounds.clone();
    }
    if (graph.isDoubleBuffered()) {
      Graphics offGraphics = graph.getOffgraphics();
      Image offscreen = graph.getOffscreen();
      if (offGraphics == null || offscreen == null) {
View Full Code Here

    protected Rectangle getHighlightBounds(JGraph graph, CellView cellView)
    {
      boolean offset = (GraphConstants.getOffset(cellView.getAllAttributes()) != null);
      Rectangle2D r = (offset) ? cellView.getBounds() : cellView
          .getParentView().getBounds();
      r = graph.toScreen((Rectangle2D) r.clone());
      int s = 3;

      return new Rectangle((int) (r.getX() - s), (int) (r.getY() - s),
          (int) (r.getWidth() + 2 * s), (int) (r.getHeight() + 2 * s));
    }
 
View Full Code Here

    protected void paintPort(Graphics g, CellView p) {
      boolean offset = (GraphConstants.getOffset(p.getAllAttributes()) != null);
      Rectangle2D r = (offset) ? p.getBounds() : p.getParentView()
          .getBounds();
      r = graph.toScreen((Rectangle2D) r.clone());
      int s = 3;
      r.setFrame(r.getX() - s, r.getY() - s, r.getWidth() + 2 * s, r
          .getHeight()
          + 2 * s);
      graph.getUI().paintCell(g, p, r, true);
View Full Code Here

   */
  public AttributeMap cloneEntries(AttributeMap newMap) {
    // Clone Bounds
    Rectangle2D bounds = GraphConstants.getBounds(newMap);
    if (bounds != null)
      GraphConstants.setBounds(newMap, (Rectangle2D) (bounds.clone()));
    // Clone List Of Points
    List points = GraphConstants.getPoints(newMap);
    if (points != null)
      GraphConstants.setPoints(newMap, clonePoints(points));
    // Clone extra label positions
View Full Code Here

    protected void invalidate() {
      // Retrieve current bounds and set local vars
      Rectangle2D tmp = graph.getCellBounds(vertex.getCell());
      if (tmp != null) {
        tmp = (Rectangle2D) tmp.clone();
        graph.toScreen(tmp);
        int handlesize = graph.getHandleSize();
        int s2 = 2 * handlesize;
        double left = tmp.getX() - handlesize;
        double top = tmp.getY() - handlesize;
View Full Code Here

    Iterator it = vertices.iterator();
    while (it.hasNext()) {
      Rectangle2D r = (Rectangle2D) getBounds(it.next());
      if (r != null) {
        if (ret == null)
          ret = (Rectangle2D) r.clone();
        else
          Rectangle2D.union(ret, r, ret);
      }
    }
    return ret;
View Full Code Here

            r = GraphConstants.getBounds(attributes);
          }
        }
        if (r != null) {
          if (ret == null) {
            ret = (r != null) ? (Rectangle2D) r.clone() : null;
          } else {
            Rectangle2D.union(ret, r, ret);
          }
        }
      }
View Full Code Here

    while (it.hasNext()) {
      Object cell = it.next();
      Rectangle2D r = getBounds(cell);
      if (r != null) {
        if (ret == null) {
          ret = (Rectangle2D) r.clone();
        } else {
          Rectangle2D.union(ret, r, ret);
        }
      }
    }
View Full Code Here

      while (it.hasNext()) {
        Map.Entry entry = (Map.Entry) it.next();
        Rectangle2D bounds = GraphConstants.getBounds((Map) entry
            .getValue());
        if (bounds != null) {
          setBounds(entry.getKey(), (Rectangle2D) bounds.clone());
        }
      }
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.