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),
sourceArea.setRect(readParameters.getSourceRegion());
coverageRequestedRasterArea.setRect(getCropRegion()); if (coverageRequestedRasterArea.isEmpty()) { if (LOGGER.isLoggable(Level.FINE))
requestedDim.setRect(tempRect); } catch (TransformException te) {
sourceArea.setRect(readParameters.getSourceRegion());
/** * 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; }
srcRectExpanded.setRect( srcRectExpanded.getMinX() - interp.getLeftPadding(), srcRectExpanded.getMinY() - interp.getTopPadding(),
sourceArea.setRect(readParameters.getSourceRegion());
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); } }
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); } }
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); }
public void mouseDragged(MouseEvent e) { updateSelectionSize(e.getX(), e.getY(), pageViewComponent); rectangle.setRect(rectToDraw); pageViewComponent.repaint(); }
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(); }
/** 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); }
@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(); }
@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(); } }
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 }
@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); } }
@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); } }