Package java.awt.geom

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


          if (!graph.isPortsScaled())
            center = graph.toScreen(center);
          bounds.setFrame(center.getX() - bounds.getWidth() / 2,
              center.getY() - bounds.getHeight() / 2, bounds
                  .getWidth(), bounds.getHeight());
          if (r == null || bounds.intersects(r))
            paintCell(g, ports[i], bounds, false);
        }
      }
    }
  }
View Full Code Here


        Graphics2D g2 = (Graphics2D) graph.getGraphics();
        if (g2.hit(rect, view.getShape(), true))
          return true;
      }
      Rectangle2D r = getLabelBounds(graph, view);
      if (r != null && r.intersects(rect))
        return true;
      Object[] labels = GraphConstants.getExtraLabels(view
          .getAllAttributes());
      if (labels != null) {
        for (int i = 0; i < labels.length; i++) {
View Full Code Here

      Object[] labels = GraphConstants.getExtraLabels(view
          .getAllAttributes());
      if (labels != null) {
        for (int i = 0; i < labels.length; i++) {
          r = getExtraLabelBounds(graph, view, i);
          if (r != null && r.intersects(rect))
            return true;
        }
      }
    }
    return false;
View Full Code Here

    for (Iterator ii = _outsideHashtable.keySet().iterator(); ii.hasNext(); ) {
      Object anObject = ii.next();
      Rectangle2D itsAbsoluteBoundingRectangle2D = (Rectangle2D)
      _outsideHashtable.get(anObject);

      if (itsAbsoluteBoundingRectangle2D.intersects(r)) {
        v.addElement(anObject);
      }
    }

    if (_absoluteBoundingRectangle2D.intersects(r)) {
View Full Code Here

      for(Iterator i = _theHashtable.keySet().iterator(); i.hasNext(); ) {
        Object anObject = i.next();
        Rectangle2D itsAbsoluteBoundingRectangle2D = (Rectangle2D)
        _theHashtable.get(anObject);

        if (itsAbsoluteBoundingRectangle2D.intersects(r)) {
          v.addElement(anObject);
        }
      }

      if (_nMaxTreeDepth > 1) {
View Full Code Here

            AffineTransform transform = targetContext
                    .getTransform(manipulatorContext);
            Rectangle2D bounds = _target.getBounds();
            bounds = ShapeUtilities.transformBounds(bounds, transform);

            if (bounds.intersects(x - h, y - h, 2 * h, 2 * h)) {
                // We're still over, so snap to the nearest site -- FIXME
                //                debug("STILL OVER SAME TARGET: " + _target);
                Site current = _handle.getSite();

                // FIXME: shouldn't this be x,y?
View Full Code Here

    CellView[] views = getRoots();
    Rectangle2D bounds;
    for (CellView view : views) {
      bounds = view.getBounds();
      if (bounds != null) {
        if (bounds.intersects(clip)) {
          result.add(view);
        }
      }
    }
    views = new CellView[result.size()];
View Full Code Here

          // System.out.println("Intersect è TRUE");

          // Puts last to last corner of overlapping cells
          if (overlapping[j] instanceof JmtCell && overlapping[j] != cell && inGroup) {
            Rectangle2D b2 = GraphConstants.getBounds(((JmtCell) overlapping[j]).getAttributes());
            if (b2.intersects(bounds)) {
              if (b2.getMaxX() > last.getX()) {
                last.setLocation(b2.getMaxX(), last.getY());
              }
              if (b2.getMaxY() > last.getY()) {
                last.setLocation(last.getX(), b2.getMaxY());
View Full Code Here

          if (!inGroup && overlapping[j] instanceof JmtCell && overlapping[j] != cell) {

            Rectangle2D b = GraphConstants.getBounds(((JmtCell) overlapping[j]).getAttributes());
            // Consider only rectangles that intersects with given
            // bound
            if (b.intersects(bounds2)) {
              last.setLocation(new Point(oldPointX, oldPointY));

            }
          }
          // inizio a controllare se l intersezione e' un lato
View Full Code Here

      while (overlapping.length > 0) {
        Point2D last = (Point2D) zero.clone();
        for (Object element : overlapping) {
          if (element instanceof JmtCell && element != cell && inGroup) {
            Rectangle2D b2 = GraphConstants.getBounds(((JmtCell) element).getAttributes());
            if (b2.intersects(bounds)) {
              if (b2.getMaxX() > last.getX()) {
                last.setLocation(b2.getMaxX(), last.getY());
              }
              if (b2.getMaxY() > last.getY()) {
                last.setLocation(last.getX(), b2.getMaxY());
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.