Package java.awt

Examples of java.awt.Rectangle.grow()


   * @param p1
   * @return
   */
  public static Point getRectangleLineCrossPoint(Rectangle rectangle, Point p1, int grow) {
    Rectangle rect = rectangle.getBounds();
    rect.grow(grow, grow);
    Point p0 = GeometryUtils.getRectangleCenter(rect);

    if (p1.x == p0.x) {
      if (p1.y < p0.y) {
        return new Point(p0.x, rect.y);
View Full Code Here


    NameCellComponent reference = getInstance();
    reference.setSize(cellSize);
    reference.setLevel(level);
    reference.doLayout();
    Rectangle bounds = reference.getIconLabel().getBounds();
    bounds.grow(4,4); // be more permissive in clicking on +/-
    return bounds.contains(pos);
  }
  public static boolean isOnText(Point pos, Dimension cellSize, int level) {
    NameCellComponent reference = getInstance();
    reference.setSize(cellSize);
View Full Code Here

        // intersects this rectangle can go to hell; it's either this or
        // we iterate over every object in the whole goddamned scene which
        // is so hairily inefficient i can't even bear to contemplate it
        ObjectSet objs = new ObjectSet();
        Rectangle orect = new Rectangle(rect);
        orect.grow(MAX_OBJECT_SIZE, MAX_OBJECT_SIZE);
        StageMisoSceneModel mmodel = StageMisoSceneModel.getSceneModel(model);
        mmodel.getObjects(orect, objs);

        // now prune from this set any and all objects that don't actually
        // overlap the specified rectangle
View Full Code Here

      // LATER: Fix repaint region to be smaller
      if (repaint)
      {
        old = old.union(finderBounds);
        old.grow(3, 3);
        repaint(old);
      }
    }
  }
View Full Code Here

  public void mark()
  {
    if (markedState != null)
    {
      Rectangle bounds = markedState.getRectangle();
      bounds.grow(3, 3);
      bounds.width += 1;
      bounds.height += 1;
      setBounds(bounds);

      if (getParent() == null)
View Full Code Here

      // we cannot just use the crop grid to world but we need to correct
      // it.
      final Rectangle sourceArea = CRS.transform(cropWorldToGrid, intersection).toRectangle2D().getBounds();
      //gutter
      if(selectedlevel.baseToLevelTransform.isIdentity()){
          sourceArea.grow(2, 2);
      }
      XRectangle2D.intersect(sourceArea, selectedlevel.rasterDimensions, sourceArea);//make sure roundings don't bother us
      // is it empty??
      if (sourceArea.isEmpty()) {
        if (LOGGER.isLoggable(java.util.logging.Level.FINE)){
View Full Code Here

        // If a ROI is present, then only the part contained inside the current tile bounds is taken.
        if (hasROI) {
            Rectangle rect = new Rectangle(destRect);
            // The tile dimension is extended for avoiding border errors
            rect.grow(TILE_EXTENDER, TILE_EXTENDER);
            roiTile = roi.intersect(new ROIShape(rect));
        }

        if (!hasROI || !roiTile.getBounds().isEmpty()) {
            // Loop on the image raster
View Full Code Here

        // If a ROI is present, then only the part contained inside the current tile bounds is taken.
        if (hasROI) {
            Rectangle rect = new Rectangle(destRect);
            // The tile dimension is extended for avoiding border errors
            rect.grow(TILE_EXTENDER, TILE_EXTENDER);
            roiTile = roi.intersect(new ROIShape(rect));
        }

        if (!hasROI || !roiTile.getBounds().isEmpty()) {
            // Loop on the image raster
View Full Code Here

  public boolean contains( Point point ){
    // COME BACK TO ME
    if (rect != null) {

      Rectangle smallRect = rect.getBounds();
      smallRect.grow(-4,-4);
      return smallRect.contains(point.getX(),point.getY());
    } else return false;
  }
  public boolean mousePressed(MouseEvent e){
    stencilApp.handleMouseEvent(e);
View Full Code Here

      area = area.union(new Rectangle(line.getBounds()) );
      if (triangle != null) area = area.union(triangle.getBounds());
    }
    if (moveRect != null) {
      Rectangle movingRect = moveRect.getShape().getBounds();
      movingRect.grow(10,10);
      area = area.union(movingRect);
    }
    return area;
  }
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.