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

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

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

Rectangle.setFrameFromDiagonal介绍

暂无

代码示例

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

/**
 * If the box is enabled, draws the box with the diagonal running from the start position to the
 * current mouse position.
 *
 * @param ev input mouse event
 */
@Override
public void mouseDragged(MouseEvent ev) {
  if (enabled) {
    ensureGraphics();
    if (dragged) {
      graphics.drawRect(rect.x, rect.y, rect.width, rect.height);
    }
    rect.setFrameFromDiagonal(startPos, ev.getPoint());
    graphics.drawRect(rect.x, rect.y, rect.width, rect.height);
    dragged = true;
  }
}

代码示例来源:origin: stackoverflow.com

Rectangle rect= new Rectangle();
rect.setFrameFromDiagonal(point1, point2);

g.fillRect(rect.x, rect.y, rect.width, rect.height);

代码示例来源:origin: igniterealtime/Spark

public void setClipFrame(Point start, Point end) {
  clip.setFrameFromDiagonal(start, end);
  repaint();
}

代码示例来源:origin: org.geotools/gt-swing

/**
 * If the box is enabled, draws the box with the diagonal running from the
 * start position to the current mouse position. 
 * 
 * @param ev input mouse event
 */
@Override
public void mouseDragged(MouseEvent ev) {
  if (enabled) {
    ensureGraphics();
    if (dragged) {
      graphics.drawRect(rect.x, rect.y, rect.width, rect.height);
    }
    rect.setFrameFromDiagonal(startPos, ev.getPoint());
    graphics.drawRect(rect.x, rect.y, rect.width, rect.height);
    dragged = true;
  }
}

代码示例来源:origin: nroduit/Weasis

double ratiox = img.getRescaleX();
double ratioy = img.getRescaleY();
area.setFrameFromDiagonal(getDisplayLength(tlhc[0], ratiox), getDisplayLength(tlhc[1], ratioy),
  getDisplayLength(brhc[0], ratiox), getDisplayLength(brhc[1], ratioy));

代码示例来源:origin: levigo/jbig2-imageio

final int y2 = Utils.floor(mappingY.srcToDst(srcBounds.y + srcBounds.height + yFilterParameterized.support)
  - EPSILON);
dstRegion.setFrameFromDiagonal(x1, y1, x2, y2);

代码示例来源:origin: org.apache.pdfbox/jbig2-imageio

mappingY.srcToDst(srcBounds.y + srcBounds.height + yFilterParameterized.support)
        - EPSILON);
dstRegion.setFrameFromDiagonal(x1, y1, x2, y2);

代码示例来源:origin: com.levigo.jbig2/levigo-jbig2-imageio

final int y2 = Utils.floor(mappingY.srcToDst(srcBounds.y + srcBounds.height + yFilterParameterized.support)
  - EPSILON);
dstRegion.setFrameFromDiagonal(x1, y1, x2, y2);

相关文章