001: /**
002: * ===========================================
003: * JFreeReport : a free Java reporting library
004: * ===========================================
005: *
006: * Project Info: http://reporting.pentaho.org/
007: *
008: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
009: *
010: * This library is free software; you can redistribute it and/or modify it under the terms
011: * of the GNU Lesser General Public License as published by the Free Software Foundation;
012: * either version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
015: * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016: * See the GNU Lesser General Public License for more details.
017: *
018: * You should have received a copy of the GNU Lesser General Public License along with this
019: * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
020: * Boston, MA 02111-1307, USA.
021: *
022: * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
023: * in the United States and other countries.]
024: *
025: * ------------
026: * PhysicalPageBox.java
027: * ------------
028: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
029: */package org.jfree.report.layout.model;
030:
031: import java.awt.print.PageFormat;
032:
033: import org.jfree.report.util.geom.StrictGeomUtility;
034:
035: /**
036: * Defines the properties of a single physical page. In a later version, this
037: * box may receive physical page header and footer or may even support the full
038: * CSS-pagebox modell.
039: */
040: public class PhysicalPageBox implements Cloneable {
041: private long width;
042: private long height;
043: private long imageableX;
044: private long imageableY;
045: private long imageableWidth;
046: private long imageableHeight;
047: private long globalX;
048: private long globalY;
049: private int orientation;
050:
051: public PhysicalPageBox(final PageFormat pageFormat,
052: final long globalX, final long globalY) {
053: this .width = StrictGeomUtility.toInternalValue(pageFormat
054: .getWidth());
055: this .height = StrictGeomUtility.toInternalValue(pageFormat
056: .getHeight());
057: this .imageableX = StrictGeomUtility.toInternalValue(pageFormat
058: .getImageableX());
059: this .imageableY = StrictGeomUtility.toInternalValue(pageFormat
060: .getImageableY());
061: this .imageableWidth = StrictGeomUtility
062: .toInternalValue(pageFormat.getImageableWidth());
063: this .imageableHeight = StrictGeomUtility
064: .toInternalValue(pageFormat.getImageableHeight());
065: this .globalX = globalX;
066: this .globalY = globalY;
067: this .orientation = pageFormat.getOrientation();
068: }
069:
070: //
071: // public PhysicalPageBox(final long width,
072: // final long height,
073: // final long imageableX,
074: // final long imageableY,
075: // final long imageableWidth,
076: // final long imageableHeight,
077: // final long globalX,
078: // final long globalY)
079: // {
080: // this.width = width;
081: // this.height = height;
082: // this.imageableX = imageableX;
083: // this.imageableY = imageableY;
084: // this.imageableWidth = imageableWidth;
085: // this.imageableHeight = imageableHeight;
086: // this.globalX = globalX;
087: // this.globalY = globalY;
088: // }
089:
090: public int getOrientation() {
091: return orientation;
092: }
093:
094: public long getImageableX() {
095: return imageableX;
096: }
097:
098: public long getImageableY() {
099: return imageableY;
100: }
101:
102: public long getImageableWidth() {
103: return imageableWidth;
104: }
105:
106: public long getImageableHeight() {
107: return imageableHeight;
108: }
109:
110: public long getGlobalX() {
111: return globalX;
112: }
113:
114: public void setGlobalX(final long globalX) {
115: this .globalX = globalX;
116: }
117:
118: public long getGlobalY() {
119: return globalY;
120: }
121:
122: public void setGlobalY(final long globalY) {
123: this .globalY = globalY;
124: }
125:
126: public long getWidth() {
127: return width;
128: }
129:
130: public long getHeight() {
131: return height;
132: }
133:
134: public Object clone() throws CloneNotSupportedException {
135: return super.clone();
136: }
137: }
|