Ejemplo n.º 1
0
  /**
   * Returns the x coordinate of the upper left point of the imageable area of the <code>Paper
   * </code> object associated with this <code>PageFormat</code>. This method takes into account the
   * orientation of the page.
   *
   * @return the x coordinate of the upper left point of the imageable area of the <code>Paper
   *     </code> object associated with this <code>PageFormat</code>.
   */
  public double getImageableX() {
    double x;

    switch (getOrientation()) {
      case LANDSCAPE:
        x = mPaper.getHeight() - (mPaper.getImageableY() + mPaper.getImageableHeight());
        break;

      case PORTRAIT:
        x = mPaper.getImageableX();
        break;

      case REVERSE_LANDSCAPE:
        x = mPaper.getImageableY();
        break;

      default:
        /* This should never happen since it signifies that the
         * PageFormat is in an invalid orientation.
         */
        throw new InternalError("unrecognized orientation");
    }

    return x;
  }
Ejemplo n.º 2
0
  /**
   * Return the height, in 1/72nds of an inch, of the imageable area of the page. This method takes
   * into account the orientation of the page.
   *
   * @return the height of the page.
   */
  public double getImageableHeight() {
    double height;

    if (getOrientation() == PORTRAIT) {
      height = mPaper.getImageableHeight();
    } else {
      height = mPaper.getImageableWidth();
    }

    return height;
  }
Ejemplo n.º 3
0
  /**
   * Returns the width, in 1/72nds of an inch, of the imageable area of the page. This method takes
   * into account the orientation of the page.
   *
   * @return the width of the page.
   */
  public double getImageableWidth() {
    double width;

    if (getOrientation() == PORTRAIT) {
      width = mPaper.getImageableWidth();
    } else {
      width = mPaper.getImageableHeight();
    }

    return width;
  }