Package java.awt

Examples of java.awt.Rectangle.translate()


                                       r.getMinY()+deltaY);
    }

    public Raster getData(Rectangle rect) {
        Rectangle r = (Rectangle)rect.clone();
        r.translate(-deltaX, -deltaY);
        Raster ret = getSource().getData(r);
        return ret.createTranslatedChild(ret.getMinX()+deltaX,
                                         ret.getMinY()+deltaY);
    }
View Full Code Here


        Rectangle r = (Rectangle)rect.clone();

        if (r.intersects(getBounds()) == false)
            return null;
        r = r.intersection(getBounds());
        r.translate(-getMinX(), - getMinY());

        Raster ret = bi.getData(r);
        return ret.createTranslatedChild(ret.getMinX()+getMinX(),
                                         ret.getMinY()+getMinY());
    }
View Full Code Here

        int scaleX = param.getSourceXSubsampling();
        int scaleY = param.getSourceYSubsampling();
        int xOffset = param.getSubsamplingXOffset();
        int yOffset = param.getSubsamplingYOffset();

        sourceRegion.translate(xOffset, yOffset);
        sourceRegion.width -= xOffset;
        sourceRegion.height -= yOffset;

        int minX = sourceRegion.x / scaleX;
        int minY = sourceRegion.y / scaleY;
View Full Code Here

        int scaleX = param.getSourceXSubsampling();
        int scaleY = param.getSourceYSubsampling();
        int xOffset = param.getSubsamplingXOffset();
        int yOffset = param.getSubsamplingYOffset();

        sourceRegion.translate(xOffset, yOffset);
        sourceRegion.width -= xOffset;
        sourceRegion.height -= yOffset;

        int minX = sourceRegion.x / scaleX;
        int minY = sourceRegion.y / scaleY;
View Full Code Here

            pt.setX(abs.getX());
          }
        }

        Rectangle rect = getPreviewBounds();
        rect.translate((int) Math.round(pt.getX() - first.x),
            (int) Math.round(pt.getY() - first.y));
        preview.setBounds(rect);
      }
      else
      {
View Full Code Here

            idx = 0;
          }
        }

        Rectangle rect = state.getLabelBounds().getRectangle();
        rect.translate(idx, idy);
        preview.setBounds(rect);
      }
      else
      {
        mxGraph graph = graphComponent.getGraph();
View Full Code Here

    int descent = mets.getDescent();
    int height = ascent + descent;
   
    Rectangle ret = new Rectangle(x, y, width, height);
    switch (halign) {
      case H_CENTER: ret.translate(-(width / 2), 0); break;
      case H_RIGHT:  ret.translate(-width, 0); break;
      default: ;
    }
    switch (valign) {
      case V_TOP:      break;
View Full Code Here

    int height = ascent + descent;
   
    Rectangle ret = new Rectangle(x, y, width, height);
    switch (halign) {
      case H_CENTER: ret.translate(-(width / 2), 0); break;
      case H_RIGHT:  ret.translate(-width, 0); break;
      default: ;
    }
    switch (valign) {
      case V_TOP:      break;
      case V_CENTER:   ret.translate(0, -(ascent / 2)); break;
View Full Code Here

      case H_RIGHT:  ret.translate(-width, 0); break;
      default: ;
    }
    switch (valign) {
      case V_TOP:      break;
      case V_CENTER:   ret.translate(0, -(ascent / 2)); break;
      case V_CENTER_OVERALL: ret.translate(0, -(height / 2)); break;
      case V_BASELINE: ret.translate(0, -ascent); break;
      case V_BOTTOM:   ret.translate(0, -height); break;
      default: ;
    }
View Full Code Here

      default: ;
    }
    switch (valign) {
      case V_TOP:      break;
      case V_CENTER:   ret.translate(0, -(ascent / 2)); break;
      case V_CENTER_OVERALL: ret.translate(0, -(height / 2)); break;
      case V_BASELINE: ret.translate(0, -ascent); break;
      case V_BOTTOM:   ret.translate(0, -height); break;
      default: ;
    }
    return ret;
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.