Package java.awt

Examples of java.awt.Rectangle.translate()


   */
  private void showPopups(final Rectangle[] rects, final Rectangle bds, final Rectangle visible, final JComponent comp, final JScrollPane view) {
    boolean shown = false;
    for (int i = 0; i < rects.length; i++) {
      final Rectangle sect = rects[i];
      sect.translate(-bds.x, -bds.y);
      final ImgComp part = painter.getPartial(sect, bds.x + rects[i].x < visible.x);
      final Point pos = new Point(bds.x + rects[i].x, bds.y + rects[i].y);
      SwingUtilities.convertPointToScreen(pos, comp);
      if (comp instanceof JList) {
        //XXX off by one somewhere, only with JLists - where?
View Full Code Here


                Rectangle cellRect = table.getCellRect(row, draggedColumn, false);
                Rectangle gridRect = table.getCellRect(row, draggedColumn, true);

                paintBackgroundUnderDraggedCell(g, gridRect);
                cellRect.translate(table.getTableHeader().getDraggedDistance(), 0);
                gridRect.translate(table.getTableHeader().getDraggedDistance(), 0);
                if (clipBounds == null || clipBounds.intersects(gridRect)) {
                    paintCell(g, row, draggedColumn, cellRect, gridRect);
                    paintGrid(g, row, draggedColumn, gridRect);
                }
            }
View Full Code Here

        long rawBufferPtr = bufferPtr.lock();
        for (int i = 0; i < nCount; i++) {
            Win32.RECT nr = win32.createRECT(rawBufferPtr + i * sizeofRECT);
            Rectangle rect = factory.getRectBounds(nr);
            rect.translate(dx, dy);
            rgn[i] = rect;
        }
        bufferPtr.unlock();

        return new MultiRectArea(rgn);
View Full Code Here

        if (clip == null) {
            return null;
        }

        Rectangle res = (Rectangle) clip.getBounds().clone();
        res.translate(-Math.round((float)transform.getTranslateX()), -Math.round((float)transform.getTranslateY()));
        return res;
    }

    @Override
    public Color getColor() {
View Full Code Here

      // For each rectangle in the region to remove
      for (final Rectangle remove : removeRegion.rectangles)
      {
        // Offset the rectangle
        final Rectangle offsetRemove = new Rectangle(remove);
        offsetRemove.translate(offset.x, offset.y);

        // If we've gone past a possible match
        if (offsetRemove.y > y)
        {
          // quit
View Full Code Here

        long rawBufferPtr = bufferPtr.lock();
        for (int i = 0; i < nCount; i++) {
            Win32.RECT nr = win32.createRECT(rawBufferPtr + i * sizeofRECT);
            Rectangle rect = factory.getRectBounds(nr);
            rect.translate(dx, dy);
            rgn[i] = rect;
        }
        bufferPtr.unlock();

        return new MultiRectArea(rgn);
View Full Code Here

        Rectangle rect = getRectBounds(nativeRect);

        long hwndParent = win32.GetParent(hwnd);
        if (hwndParent != 0 && isChild(hwnd)) {
            win32.GetWindowRect(hwndParent, nativeRect);
            rect.translate(-nativeRect.get_left(), -nativeRect.get_top());
        }
        return rect;
    }

    Rectangle getRectBounds(Win32.RECT nativeRect) {
View Full Code Here

        if (txShape instanceof Rectangle2D) {
            if (txClip != null) {
                bounds = bounds.createIntersection(txClip.getBounds2D()).getBounds();
            }
            if ((bounds.width > 0) && (bounds.height > 0)) {
                bounds.translate((int) tx, (int) ty);
                fillRect(bounds.x, bounds.y, bounds.width, bounds.height, c, mode);
            }
        } else {
            // todo optimize for the ellipse
            for (int row = 0; row < bounds.height; row++) {
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness
  {
    Rectangle r1 = new Rectangle(1, 2, 3, 4);
    r1.translate(5, 6);
    harness.check(r1.x == 6);
    harness.check(r1.y == 8);
    harness.check(r1.width == 3);
    harness.check(r1.height == 4);
  }
View Full Code Here

        if (!headerBounds.contains(x, y)) return -1;
        Rectangle hitArea = new Rectangle(headerBounds.x, headerBounds.y, monthUpImage.getIconWidth(), monthUpImage.getIconHeight());
        if (hitArea.contains(x, y)) {
            return isLeftToRight ? MONTH_DOWN : MONTH_UP;
        }
        hitArea.translate(headerBounds.width - monthUpImage.getIconWidth(), 0);
        if (hitArea.contains(x, y)) {
            return isLeftToRight ? MONTH_UP : MONTH_DOWN;
        }
        return -1;
    }
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.