java.awt.Rectangle.clone()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(163)

本文整理了Java中java.awt.Rectangle.clone方法的一些代码示例,展示了Rectangle.clone的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.clone方法的具体详情如下:
包路径:java.awt.Rectangle
类名称:Rectangle
方法名:clone

Rectangle.clone介绍

[英]Creates a new object of the same class and with the same contents as this object.
[中]创建与此对象具有相同类和相同内容的新对象。

代码示例

代码示例来源:origin: geotools/geotools

/**
   * Returns a clone of this grid envelope.
   *
   * @return A clone of this grid envelope.
   */
  @Override
  public GridEnvelope2D clone() {
    return (GridEnvelope2D) super.clone();
  }
}

代码示例来源:origin: geotools/geotools

/** @see org.geotools.coverage.io.CoverageReadRequest#getRasterArea() */
public Rectangle getRasterArea() {
  return rasterArea != null ? (Rectangle) rasterArea.clone() : rasterArea;
}

代码示例来源:origin: geotools/geotools

public Rectangle getRequestedRasterArea() {
  return (Rectangle)
      (requestedRasterArea != null ? requestedRasterArea.clone() : requestedRasterArea);
}

代码示例来源:origin: geotools/geotools

public Rectangle getRequestedRasterArea() {
  return (Rectangle)
      (requestedRasterArea != null ? requestedRasterArea.clone() : requestedRasterArea);
}

代码示例来源:origin: geotools/geotools

public Rectangle getComputedRasterArea() {
  return (Rectangle)
      (computedRasterArea != null ? computedRasterArea.clone() : computedRasterArea);
}

代码示例来源:origin: geotools/geotools

public Rectangle getBounds() {
  return (Rectangle) rasterDimensions.clone();
}

代码示例来源:origin: geotools/geotools

public Rectangle getBounds() {
  return (Rectangle) rasterDimensions.clone();
}

代码示例来源:origin: geotools/geotools

public Rectangle2D getBounds2D(Raster src) {
  return (Rectangle) src.getBounds().clone();
}

代码示例来源:origin: RaiMan/SikuliX2

public void setActualBounds(Rectangle actualBounds) {
 this.actualBounds = (Rectangle) actualBounds.clone();
 Rectangle paintBounds = (Rectangle) actualBounds.clone();
 if (hasShadow()) {
  paintBounds.x -= (shadowSize - shadowOffset);
  paintBounds.y -= (shadowSize - shadowOffset);
  paintBounds.width += (2 * shadowSize);
  paintBounds.height += (2 * shadowSize);
 }
 super.setBounds(paintBounds);
 updateAllFollowers();
}

代码示例来源:origin: geotools/geotools

/**
 * @see org.geotools.coverage.io.CoverageReadRequest#setDomainSubset(java.awt.Rectangle,
 *     org.opengis.referencing.operation.MathTransform2D,
 *     org.opengis.referencing.crs.CoordinateReferenceSystem)
 */
public void setDomainSubset(
    final Rectangle rasterArea,
    final MathTransform2D gridToWorldTrasform,
    final CoordinateReferenceSystem crs)
    throws MismatchedDimensionException, TransformException {
  // get input elements
  this.rasterArea = (Rectangle) rasterArea.clone();
  this.gridToWorldTransform = gridToWorldTrasform;
  // create a bbox
  GeneralEnvelope env =
      CRS.transform(
          gridToWorldTrasform, new ReferencedEnvelope(rasterArea.getBounds2D(), crs));
  this.geographicArea = new ReferencedEnvelope(new ReferencedEnvelope(env), crs);
}

代码示例来源:origin: geotools/geotools

requestedRasterArea = (Rectangle) coverageProperties.rasterArea.clone();
destinationRasterArea = (Rectangle) coverageProperties.rasterArea.clone();
requestedResolution = coverageProperties.fullResolution.clone();

代码示例来源:origin: geotools/geotools

cropBBox = rasterManager.spatialDomainManager.coverageBBox;
requestedRasterArea =
    (Rectangle) rasterManager.spatialDomainManager.coverageRasterArea.clone();
destinationRasterArea =
    (Rectangle) rasterManager.spatialDomainManager.coverageRasterArea.clone();
requestedResolution = rasterManager.spatialDomainManager.coverageFullResolution.clone();

代码示例来源:origin: geotools/geotools

/**
 * @see org.geotools.coverage.io.CoverageReadRequest#setDomainSubset(java.awt.Rectangle,
 *     org.opengis.geometry.BoundingBox, org.opengis.referencing.datum.PixelInCell)
 */
public void setDomainSubset(final Rectangle rasterArea, final ReferencedEnvelope worldArea) {
  // get input elements
  if (rasterArea != null) {
    this.rasterArea = (Rectangle) rasterArea.clone();
  }
  this.geographicArea = worldArea;
  // create a math transform
  final GridToEnvelopeMapper mapper =
      new GridToEnvelopeMapper(
          new GridEnvelope2D(rasterArea), new ReferencedEnvelope(worldArea));
  mapper.setPixelAnchor(PixelInCell.CELL_CENTER);
  this.gridToWorldTransform = (MathTransform2D) mapper.createTransform();
}

代码示例来源:origin: geotools/geotools

requestedRasterArea = (Rectangle) coverageProperties.rasterArea.clone();
computedResolution = coverageProperties.fullResolution.clone();
computedBBox =
    new ReferencedEnvelope(coverageProperties.bbox, coverageProperties.crs2D);
computedRasterArea = (Rectangle) coverageProperties.rasterArea.clone();

代码示例来源:origin: geotools/geotools

requestedRasterArea = (Rectangle) coverageRasterArea.clone();
coverageRequestedRasterArea = (Rectangle) coverageRasterArea.clone();
requestedResolution = coverageFullResolution.clone();

代码示例来源:origin: omero/rendering

/**
 * Implemented as specified in the {@link ome.util.mem.Copiable Copiable}
 * I/F.
 * 
 * @see ome.util.mem.Copiable#copy()
 */
public Object copy() {
  return super.clone();
}

代码示例来源:origin: Waikato/meka

/**
 * Updates the current bounds.
 *
 * @param bounds    the current bounds of the owner
 */
public void updateBounds(Rectangle bounds) {
 if (!getIgnoreStateChangeEvent())
  m_CurrentBounds = (Rectangle) bounds.clone();
}

代码示例来源:origin: geotools/geotools

} else {
  Rectangle bufferedTargetArea = (Rectangle) screenSize.clone();

代码示例来源:origin: sc.fiji/TrakEM2_

/** Recalculate box and reset handles. */
public void resetBox() {
  synchronized (queue_lock) {
    box = null;
    Rectangle b = new Rectangle();
    for (final Displayable d : queue) {
      b = d.getBoundingBox(b);
      if (null == box) box = (Rectangle)b.clone();
      box.add(b);
    }
  }
}

代码示例来源:origin: net.imagej/ij

public void mousePressed(MouseEvent e) {
  ImageCanvas xyCanvas = imp.getCanvas();
  startingSrcRect = (Rectangle)xyCanvas.getSrcRect().clone();
  mouseDragged(e);
}

相关文章