Package java.awt.geom

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


        Rectangle2D bounds = null;
        for (int i=0; i < count; ++i) {
            Rectangle2D pb = painters[i].getPaintedBounds2D();
            if (pb == null) continue;
            if (bounds == null) bounds = (Rectangle2D)pb.clone();
            else                bounds.add(pb);
        }
        return bounds;
    }
View Full Code Here


            return null;

        Rectangle2D bounds = null;
        for (int i=0; i < count; ++i) {
            Rectangle2D pb = painters[i].getSensitiveBounds2D();
            if (bounds == null) bounds = (Rectangle2D)pb.clone();
            else                bounds.add(pb);
        }
        return bounds;
    }
View Full Code Here

        if (gn == null) return null;

        Rectangle2D bounds = gn.getBounds();
        if (bounds == null) return null;

        return (Rectangle2D) bounds.clone();
    }

    /**
     * Called when the scale size changes. The scale factor
     * (1.0 == original size). By default, this method does
View Full Code Here

            if (p != elem) continue;

            // runElem is a child of elem so include it's bounds.
            Rectangle2D glBounds = layout.getBounds2D();
            if (glBounds != null) {
                if (ret == null) ret = (Rectangle2D)glBounds.clone();
                else             ret.add(glBounds);
            }
        }
        return ret;
    }
View Full Code Here

            // rotation or flip because we don't know if the shape is symetric.
            if ((type & (TYPE_FLIP & TYPE_MASK_ROTATION)) == 0) {
                if (shape instanceof RectangularShape) {
                    RectangularShape rect = (RectangularShape) shape;
                    if (!overwrite) {
                        rect = (RectangularShape) rect.clone();
                    }
                    final Rectangle2D frame = rect.getFrame();
                    rect.setFrame(transform(transform, frame, frame));
                    return rect;
                }
View Full Code Here

        boolean o = (GraphConstants.getOffset(port.getAllAttributes()) != null);
        // ...Then use Parent's Bounds
        Rectangle2D r = (o) ? port.getBounds() : port.getParentView()
            .getBounds();
        // Scale from Model to Screen
        r = graph.toScreen((Rectangle2D) r.clone());
        // Add Space For the Highlight Border
        r.setFrame(r.getX() - 3, r.getY() - 3, r.getWidth() + 6, r
            .getHeight() + 6);
        // Paint Port in Preview (=Highlight) Mode
        graph.getUI().paintCell(g, port, r, true);
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

            }
          } 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

                              .getAttributes(cells[i]));

                    // Clone the rectangle to force a
                    // repaint
                    if (tmp != null)
                      tmp = (Rectangle2D) tmp.clone();

                    Hashtable attrs = new Hashtable();
                    Object parent = model
                        .getParent(cells[i]);
                    if (tmp == null) {
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

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.