Examples of Rectangle2D


Examples of ae.java.awt.geom.Rectangle2D

            result.x += adv.x + dx;
            result.y += adv.y + dy;
        }

        Rectangle2D getGlyphOutlineBounds(int glyphID, float x, float y) {
            Rectangle2D result = null;
            if (sgv.invdtx == null) {
                result = new Rectangle2D.Float();
                result.setRect(strike.getGlyphOutlineBounds(glyphID)); // don't mutate cached rect
            } else {
                GeneralPath gp = strike.getGlyphOutline(glyphID, 0, 0);
                gp.transform(sgv.invdtx);
                result = gp.getBounds2D();
            }
            result.setRect(result.getMinX() + x + dx, result.getMinY() + y + dy,
                           result.getWidth(), result.getHeight());
            return result;
        }
View Full Code Here

Examples of com.google.code.appengine.awt.geom.Rectangle2D

        i = i + 2;
      }
    }
   
    private double getAreaBoundsSquare() {
        Rectangle2D bounds = getBounds2D();
        return bounds.getHeight() * bounds.getWidth();
    }
View Full Code Here

Examples of com.jgraph.gaeawt.java.awt.geom.Rectangle2D

  }

  public BufferedImage createCompatibleDestImage(BufferedImage src,
      ColorModel destCM)
  {
    Rectangle2D newBounds = getBounds2D(src);

    // Destination image should include (0,0) + positive part
    // of the area bounded by newBounds (in source coordinate system).
    double dstWidth = newBounds.getX() + newBounds.getWidth();
    double dstHeight = newBounds.getY() + newBounds.getHeight();

    if (dstWidth <= 0 || dstHeight <= 0)
    {
      // awt.251=Transformed width ({0}) and height ({1}) should be greater than 0
      throw new RasterFormatException(Messages.getString(
View Full Code Here

Examples of eas.math.geometry.Rectangle2D

    }

    @Override
    public Vector2D getRealPosFromScreenPos(Vector2D screenPos) {
        Vector2D pos = new Vector2D(screenPos.x, screenPos.y);
        Rectangle2D box = env.getCurrentViewBox();
       
        Polygon2D pinkBorder = env.getPinkBorder();
       
        pos.sub(new Vector2D(
                pinkBorder.getBoundingBox().upperLeftCorner().x,
                pinkBorder.getBoundingBox().upperLeftCorner().y));
       
        pos.x = pos.x / env.globalScale();
        pos.y = pos.y / env.globalScale();
       
        pos.translate(box.upperLeftCorner());
       
        if (env.getVisualizationAngleCenterPoint() != null) {
            pos.rotate(env.getVisualizationAngleCenterPoint(), -env.getVisualizationAngleRAD());
        }
       
View Full Code Here

Examples of java.awt.geom.Rectangle2D

                    int numberOfConflicts = stepFunction.getMaxAssignments(interval);
                    int position = stepFunction.getOffset(interval);
                    int thickness = dayWidth / numberOfConflicts;
                    int offset = position * thickness;

                    Rectangle2D paintingRect = new Rectangle2D.Double(
                            day * dayWidth + offset, start_hourWidth,
                            thickness, duration_hourWidth);

                    String text = interval.getDescription();
                    if (text == null || text.length() == 0)
                        text = interval.getName();
                    RoundBox box = new RoundBox(text, numberOfConflicts);
                    box.setRect(paintingRect);

                    if (paintingRect.intersects(mousePositionX, mousePositionY, 1, 1)) {
                        selectedBox = box;
                        continue;
                    }

                    box.paintComponent(g2d);
View Full Code Here

Examples of java.awt.geom.Rectangle2D

    int[] xs = new int[s.length()];
    int[] ys = new int[s.length()];
    for (int i = 0; i < xs.length; i++) {
      xs[i] = fm.stringWidth(s.substring(0, i + 1));
      TextLayout lay = new TextLayout(s.substring(i, i + 1), font, frc);
      Rectangle2D rect = lay.getBounds();
      int asc = (int) Math.ceil(-rect.getMinY());
      int desc = (int) Math.ceil(rect.getMaxY());
      if (asc < 0) asc = 0;
      if (asc > 0xFFFF) asc = 0xFFFF;
      if (desc < 0) desc = 0;
      if (desc > 0xFFFF) desc = 0xFFFF;
      ys[i] = (asc << 16) | desc;
View Full Code Here

Examples of java.awt.geom.Rectangle2D

            && ((mCurrentPoint.x != location.x) || (mCurrentPoint.y != location.y))) {

          if (!DragSource.isDragImageSupported()) {
            Graphics2D g2 = (Graphics2D) getGraphics();

            Rectangle2D old = (Rectangle2D) mGhostRect.clone();

            // Remember where you are about to draw the new ghost image
            mGhostRect.setRect(location.x + 20, location.y, mGhostImage
                .getWidth(), mGhostImage.getHeight());

            Rectangle2D target = (Rectangle2D) old.clone();
            target.add(mGhostRect);

            BufferedImage bf = new BufferedImage((int) target.getWidth(),
                (int) target.getHeight(), BufferedImage.TYPE_INT_ARGB_PRE);
            Graphics2D g2b = bf.createGraphics();

            int width = ((int) (mTreeImage.getWidth() - (target.getX() + target
                .getWidth()))) > 0 ? (int) target.getWidth()
                : (int) (mTreeImage.getWidth() - (target.getX()));
            int height = ((int) (mTreeImage.getHeight() - (target.getY() + target
                .getHeight()))) > 0 ? (int) target.getHeight()
                : (int) (mTreeImage.getHeight() - (target.getY()));

            if (width > 0 && height > 0) {
              g2b.drawImage(mTreeImage.getSubimage((int) target.getX(),
                  (int) target.getY(), width, height), 0, 0, null);
            }

            if (mCueLine.contains(location) && !reject) {
              Rectangle2D temp1 = mCueLine.createIntersection(target);
              double y = 0;

              if (changed) {
                y = mCueLine.getY() - target.getY();
                changed = false;
              }
              temp1.setRect(0, y, temp1.getWidth(), temp1.getHeight());

              Color c = new Color(255, 0, 0, 40);
              g2b.setColor(c);
              if (mCueLine.contains(mCueLine.createIntersection(target))) {
                g2b.fill(temp1);
View Full Code Here

Examples of java.awt.geom.Rectangle2D

   *
   * @return The object.
   */
  public Object createObject()
  {
    final Rectangle2D rect = new Rectangle2D.Float();

    final float w = getFloatParameter("width");
    final float h = getFloatParameter("height");
    final float x = getFloatParameter("x");
    final float y = getFloatParameter("y");
    rect.setRect(x, y, w, h);
    return rect;
  }
View Full Code Here

Examples of java.awt.geom.Rectangle2D

    if (!(o instanceof Rectangle2D))
    {
      throw new ObjectFactoryException("The given object is no java.awt.geom.Rectangle2D.");
    }

    final Rectangle2D rect = (Rectangle2D) o;
    final float x = (float) rect.getX();
    final float y = (float) rect.getY();
    final float w = (float) rect.getWidth();
    final float h = (float) rect.getHeight();

    setParameter("x", new Float(x));
    setParameter("y", new Float(y));
    setParameter("width", new Float(w));
    setParameter("height", new Float(h));
View Full Code Here

Examples of java.awt.geom.Rectangle2D

  }

  private static double computeWidth (final Font font,
                               FontRenderContext frc, char[] string)
  {
    Rectangle2D rect = font.getStringBounds(string, 0, string.length, frc);
    return rect.getWidth();
  }
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.