本文整理了Java中java.awt.Rectangle.setRect
方法的一些代码示例,展示了Rectangle.setRect
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.setRect
方法的具体详情如下:
包路径:java.awt.Rectangle
类名称:Rectangle
方法名:setRect
暂无
代码示例来源:origin: stackoverflow.com
double theta = 2 * Math.PI * index++ / 64;
g.setColor(Color.blue);
rect.setRect(
(int) (Math.sin(theta) * w / 3 + w / 2 - RADIUS),
(int) (Math.cos(theta) * h / 3 + h / 2 - RADIUS),
代码示例来源:origin: geotools/geotools
sourceRegion.setRect(
Utilities.getCropRegion(
adjustedRequestedEnvelope,
sourceRegion.setRect(sourceRegion.intersection(baseGridRange.toRectangle()));
代码示例来源:origin: geotools/geotools
sourceArea.setRect(readParameters.getSourceRegion());
代码示例来源:origin: geotools/geotools
coverageRequestedRasterArea.setRect(getCropRegion());
if (coverageRequestedRasterArea.isEmpty()) {
if (LOGGER.isLoggable(Level.FINE))
代码示例来源:origin: geotools/geotools
requestedDim.setRect(tempRect);
} catch (TransformException te) {
代码示例来源:origin: geotools/geotools
sourceArea.setRect(readParameters.getSourceRegion());
代码示例来源:origin: Geomatys/geotoolkit
/**
* Returns an integer rectangle that completely encloses this shape.
* <p>
* The default implementation delegates to {@link #getBounds2D()} and cast the resulting
* rectangle.
*/
@Override
public Rectangle getBounds() {
final Rectangle bounds = new Rectangle();
bounds.setRect(bounds);
return bounds;
}
代码示例来源:origin: geotools/geotools
srcRectExpanded.setRect(
srcRectExpanded.getMinX() - interp.getLeftPadding(),
srcRectExpanded.getMinY() - interp.getTopPadding(),
代码示例来源:origin: geotools/geotools
sourceArea.setRect(readParameters.getSourceRegion());
代码示例来源:origin: xyz.cofe/gui.swing
private void initTargetTopBottomLine(int next) {
if (next < 0 || dragTabIndex == next || next - dragTabIndex == 1) {
lineRect.setRect(0, 0, 0, 0);
} else if (next == 0) {
Rectangle r = SwingUtilities.convertRectangle(this, getBoundsAt(0), glassPane);
lineRect.setRect(r.x, r.y - LINEWIDTH / 2, r.width, LINEWIDTH);
} else {
Rectangle r = SwingUtilities.convertRectangle(this, getBoundsAt(next - 1), glassPane);
lineRect.setRect(r.x, r.y + r.height - LINEWIDTH / 2, r.width, LINEWIDTH);
}
}
代码示例来源:origin: xyz.cofe/gui.swing
private void initTargetLeftRightLine(int next) {
if (next < 0 || dragTabIndex == next || next - dragTabIndex == 1) {
lineRect.setRect(0, 0, 0, 0);
} else if (next == 0) {
Rectangle r = SwingUtilities.convertRectangle(this, getBoundsAt(0), glassPane);
lineRect.setRect(r.x - LINEWIDTH / 2, r.y, LINEWIDTH, r.height);
} else {
Rectangle r = SwingUtilities.convertRectangle(this, getBoundsAt(next - 1), glassPane);
lineRect.setRect(r.x + r.width - LINEWIDTH / 2, r.y, LINEWIDTH, r.height);
}
}
代码示例来源:origin: sc.fiji/TrakEM2_
private final void paintImage(Point pt) {
if (null == rect2D || null == image) {
return;
}
tree.paintImmediately(rect2D.getBounds());
rect2D.setRect((int) pt.getX(),(int) pt.getY(),image.getWidth(),image.getHeight());
tree.getGraphics().drawImage(image,(int) pt.getX(),(int) pt.getY(),tree);
}
代码示例来源:origin: org.icepdf.os/icepdf-viewer
public void mouseDragged(MouseEvent e) {
updateSelectionSize(e.getX(), e.getY(), pageViewComponent);
rectangle.setRect(rectToDraw);
pageViewComponent.repaint();
}
代码示例来源:origin: org.icepdf.os/icepdf-viewer
public void mousePressed(MouseEvent e) {
int x = e.getX();
int y = e.getY();
if (rectangle == null) {
rectangle = new Rectangle();
}
currentRect = new Rectangle(x, y, 0, 0);
updateDrawableRect(pageViewComponent.getWidth(),
pageViewComponent.getHeight());
rectangle.setRect(currentRect);
pageViewComponent.repaint();
}
代码示例来源:origin: sc.fiji/TrakEM2_
/** Set the srcRect - used by the DisplayNavigator. */
protected void setSrcRect(final int x, final int y, int width, int height) {
if (width < 1) width = 1;
if (height < 1) height = 1;
this.srcRect.setRect(x, y, width, height);
display.updateInDatabase("srcRect");
display.getMode().srcRectUpdated(srcRect, magnification);
}
代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql
@Override
public void dragExit(DragSourceEvent e)
{
e.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
_dnDTabbedPaneData.getTargetLineRectBuffer().setRect(0, 0, 0, 0);
_glassPane.setPoint(new Point(-1000, -1000));
_glassPane.repaint();
}
代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql
@Override
public void dragDropEnd(DragSourceDropEvent e)
{
_dnDTabbedPaneData.getTargetLineRectBuffer().setRect(0, 0, 0, 0);
_dnDTabbedPaneData.setDragTabIndex(-1);
DndTabUtils.hideGlassPane(_glassPane, _dnDTabbedPaneData);
if(null != _outwardDndTabbedPaneChanel)
{
_outwardDndTabbedPaneChanel.dragDropEnd();
}
}
代码示例来源:origin: sc.fiji/TrakEM2_
public void zoomToFit() {
final double magw = (double) getWidth() / imageWidth;
final double magh = (double) getHeight() / imageHeight;
this.magnification = magw < magh ? magw : magh;
this.srcRect.setRect(0, 0, imageWidth, imageHeight);
setMagnification(magnification);
display.updateInDatabase("srcRect"); // includes magnification
}
代码示例来源:origin: xyz.cofe/gui.swing
@Override
public void dragDropEnd(DragSourceDropEvent e) {
lineRect.setRect(0, 0, 0, 0);
dragTabIndex = -1;
glassPane.setVisible(false);
if (hasGhost()) {
glassPane.setVisible(false);
glassPane.setImage(null);
}
}
代码示例来源:origin: bcdev/beam
@Override
public void productAdded(ProductManager.Event event) {
fireProductAdded(event.getProduct());
TreePath treePath = getModel().getTreePath(event.getProduct());
expandPath(treePath);
Rectangle bounds = getPathBounds(treePath);
if (bounds != null) {
bounds.setRect(0, bounds.y, bounds.width, bounds.height);
scrollRectToVisible(bounds);
}
}
内容来源于网络,如有侵权,请联系作者删除!