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: * StaticBoxLayoutProperties.java
027: * ------------
028: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
029: */package org.jfree.report.layout.model.context;
030:
031: import java.io.Serializable;
032:
033: import org.jfree.report.layout.text.ExtendedBaselineInfo;
034:
035: /**
036: * A static properties collection. That one is static; once computed it does
037: * not change anymore. It does not (under no thinkable circumstances) depend
038: * on the given content. It may depend on static content of the parent.
039: *
040: * A box typically has two sets of margins. The first set is the declared
041: * margin set - it simply expresses the user's definitions. The second set
042: * is the effective margin set, it is based on the context of the element in
043: * the document tree and denotes the distance between the nodes edge and any
044: * oposite edge.
045: *
046: * @author Thomas Morgner
047: */
048: public class StaticBoxLayoutProperties implements Serializable {
049: private long marginLeft;
050: private long marginRight;
051: private long marginTop;
052: private long marginBottom;
053: private long borderLeft;
054: private long borderRight;
055: private long borderTop;
056: private long borderBottom;
057: // private long positionX;
058:
059: private int dominantBaseline;
060: private ExtendedBaselineInfo nominalBaselineInfo;
061: private int widows;
062: private int orphans;
063: private boolean avoidPagebreakInside;
064: private boolean preserveSpace;
065: private boolean breakAfter;
066: private String fontFamily;
067: private long blockContextWidth;
068: private long spaceWidth;
069:
070: public StaticBoxLayoutProperties() {
071: }
072:
073: public long getSpaceWidth() {
074: return spaceWidth;
075: }
076:
077: public void setSpaceWidth(final long spaceWidth) {
078: this .spaceWidth = spaceWidth;
079: }
080:
081: public long getMarginLeft() {
082: return marginLeft;
083: }
084:
085: public void setMarginLeft(final long marginLeft) {
086: this .marginLeft = marginLeft;
087: }
088:
089: public long getMarginRight() {
090: return marginRight;
091: }
092:
093: public void setMarginRight(final long marginRight) {
094: this .marginRight = marginRight;
095: }
096:
097: public long getMarginTop() {
098: return marginTop;
099: }
100:
101: public void setMarginTop(final long marginTop) {
102: this .marginTop = marginTop;
103: }
104:
105: public long getMarginBottom() {
106: return marginBottom;
107: }
108:
109: public void setMarginBottom(final long marginBottom) {
110: this .marginBottom = marginBottom;
111: }
112:
113: public long getBorderLeft() {
114: return borderLeft;
115: }
116:
117: public void setBorderLeft(final long borderLeft) {
118: this .borderLeft = borderLeft;
119: }
120:
121: public long getBorderRight() {
122: return borderRight;
123: }
124:
125: public void setBorderRight(final long borderRight) {
126: this .borderRight = borderRight;
127: }
128:
129: public long getBorderTop() {
130: return borderTop;
131: }
132:
133: public void setBorderTop(final long borderTop) {
134: this .borderTop = borderTop;
135: }
136:
137: public long getBorderBottom() {
138: return borderBottom;
139: }
140:
141: public void setBorderBottom(final long borderBottom) {
142: this .borderBottom = borderBottom;
143: }
144:
145: public int getDominantBaseline() {
146: return dominantBaseline;
147: }
148:
149: public void setDominantBaseline(final int dominantBaseline) {
150: this .dominantBaseline = dominantBaseline;
151: }
152:
153: public ExtendedBaselineInfo getNominalBaselineInfo() {
154: return nominalBaselineInfo;
155: }
156:
157: public void setNominalBaselineInfo(
158: final ExtendedBaselineInfo nominalBaselineInfo) {
159: if (nominalBaselineInfo == null) {
160: throw new NullPointerException();
161: }
162: this .nominalBaselineInfo = nominalBaselineInfo;
163: }
164:
165: public String getFontFamily() {
166: return fontFamily;
167: }
168:
169: public void setFontFamily(final String fontFamily) {
170: this .fontFamily = fontFamily;
171: }
172:
173: public int getWidows() {
174: return widows;
175: }
176:
177: public void setWidows(final int widows) {
178: this .widows = widows;
179: }
180:
181: public int getOrphans() {
182: return orphans;
183: }
184:
185: public void setOrphans(final int orphans) {
186: this .orphans = orphans;
187: }
188:
189: public boolean isAvoidPagebreakInside() {
190: return avoidPagebreakInside;
191: }
192:
193: public void setAvoidPagebreakInside(
194: final boolean avoidPagebreakInside) {
195: this .avoidPagebreakInside = avoidPagebreakInside;
196: }
197:
198: public boolean isPreserveSpace() {
199: return preserveSpace;
200: }
201:
202: public void setPreserveSpace(final boolean preserveSpace) {
203: this .preserveSpace = preserveSpace;
204: }
205:
206: public boolean isBreakAfter() {
207: return breakAfter;
208: }
209:
210: public void setBreakAfter(final boolean breakAfter) {
211: this .breakAfter = breakAfter;
212: }
213:
214: /**
215: * The block-context width is the computed width of the containing block of this element.
216: *
217: * @return
218: */
219: public long getBlockContextWidth() {
220: return blockContextWidth;
221: }
222:
223: public void setBlockContextWidth(final long boxContextWidth) {
224: this .blockContextWidth = boxContextWidth;
225: }
226:
227: public String toString() {
228: return "StaticBoxLayoutProperties{" + "marginLeft="
229: + marginLeft + ", marginRight=" + marginRight
230: + ", marginTop=" + marginTop + ", marginBottom="
231: + marginBottom + ", borderLeft=" + borderLeft
232: + ", borderRight=" + borderRight + ", borderTop="
233: + borderTop + ", borderBottom=" + borderBottom
234: + ", dominantBaseline=" + dominantBaseline
235: + ", nominalBaselineInfo=" + nominalBaselineInfo
236: + ", widows=" + widows + ", orphans=" + orphans
237: + ", avoidPagebreakInside=" + avoidPagebreakInside
238: + ", preserveSpace=" + preserveSpace + '}';
239: }
240: }
|