Package com.lowagie.text

Examples of com.lowagie.text.Rectangle


      switch (getConstraint().getFlowDirection()) {
        case LayoutConstraint.FLOW_NONE:
          layoutChild(child, getBounds());
          break;
        case LayoutConstraint.FLOW_X:
          layoutChild(child, new Rectangle(x, y, x + cw + 2 * marginX, y + h));
          x += cw + 2 * marginX;
          break;
        case LayoutConstraint.FLOW_Y:
          layoutChild(child, new Rectangle(x, y - ch - 2 * marginY, x + w, y));
          y -= ch + 2 * marginY;
          break;
      }
    }
    for (PrintComponent<?> child : children) {
View Full Code Here


      width = getConstraint().getWidth();
    }
    if (getConstraint().getHeight() != 0) {
      height = getConstraint().getHeight();
    }
    setBounds(new Rectangle(0, 0, width, height));
  }
View Full Code Here

   * Return a rectangle with the size of this component and origin (0,0)
   *
   * @return
   */
  protected Rectangle getSize() {
    return new Rectangle(getBounds().getWidth(), getBounds().getHeight());
  }
View Full Code Here

      case LayoutConstraint.ABSOLUTE:
        y = marginY;
        h = absh;
        break;
    }
    child.setBounds(new Rectangle(x, y, x + w, y + h));
  }
View Full Code Here

    setId(info.getId());
    setTag(info.getTag());
  }

  private Rectangle createRectangle(Bbox bounds) {
    return new Rectangle((float) bounds.getX(), (float) bounds.getY(), (float) bounds.getX()
        + (float) bounds.getWidth(), (float) bounds.getY() + (float) bounds.getHeight());
  }
View Full Code Here

    if (log.isDebugEnabled()) {
      log.debug("adding image, width=" + width + ",height=" + height + ",x=" + x + ",y=" + y);
    }
    // opacity
    log.debug("before drawImage");
    context.drawImage(Image.getInstance(imageResult.getImage()), new Rectangle(x, y, x + width, y + height),
        getSize(), getOpacity());
    log.debug("after drawImage");
  }
View Full Code Here

    float y = (float) (-imageBounds.getY() - imageBounds.getHeight() - rasterScale * bbox.getMinY()) * scaleFactor;
    if (log.isDebugEnabled()) {
      log.debug("adding failed message=" + width + ",height=" + height + ",x=" + x + ",y=" + y);
    }
    float textHeight = context.getTextSize("failed", ERROR_FONT).getHeight() * 3f;
    Rectangle rec = new Rectangle(x, y, x + width, y + height);
    context.strokeRectangle(rec, Color.RED, 0.5f);
    context.drawText(getNlsString("RasterLayerComponent.loaderror.line1"), ERROR_FONT, new Rectangle(x, y
        + textHeight, x + width, y + height), Color.RED);
    context.drawText(getNlsString("RasterLayerComponent.loaderror.line2"), ERROR_FONT, rec, Color.RED);
    context.drawText(getNlsString("RasterLayerComponent.loaderror.line3"), ERROR_FONT, new Rectangle(x, y
        - textHeight, x + width, y + height), Color.RED);
  }
View Full Code Here

    jso.getString("javaClass");
    float x = (float) jso.getDouble("x");
    float y = (float) jso.getDouble("y");
    float width = (float) jso.getDouble("width");
    float height = (float) jso.getDouble("height");
    return new Rectangle(x, y, x + width, y + height);
  }
View Full Code Here

    float height = (float) jso.getDouble("height");
    return new Rectangle(x, y, x + width, y + height);
  }

  public Object marshall(SerializerState state, Object o) throws MarshallException {
    Rectangle rect = (Rectangle) o;

    JSONObject obj = new JSONObject();
    if (ser.getMarshallClassHints()) {
      obj.put("javaClass", o.getClass().getName());
    }
    obj.put("x", rect.getLeft());
    obj.put("y", rect.getBottom());
    obj.put("width", rect.getWidth());
    obj.put("height", rect.getHeight());
    return obj;
  }
View Full Code Here

  /**
   * Writes to <code>outputStream</code> the print of a home in PDF format.
   */
  public void write(OutputStream outputStream) throws IOException {
    PageFormat pageFormat = HomePrintableComponent.getPageFormat(this.home.getPrint());
    Document pdfDocument = new Document(new Rectangle((float)pageFormat.getWidth(), (float)pageFormat.getHeight()));
    try {
      // Get a PDF writer that will write to the given PDF output stream
      PdfWriter pdfWriter = PdfWriter.getInstance(pdfDocument, outputStream);
      pdfDocument.open();
     
View Full Code Here

TOP

Related Classes of com.lowagie.text.Rectangle

Copyright © 2018 www.massapicom. 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.