0001: /**
0002: * ===========================================
0003: * JFreeReport : a free Java reporting library
0004: * ===========================================
0005: *
0006: * Project Info: http://reporting.pentaho.org/
0007: *
0008: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
0009: *
0010: * This library is free software; you can redistribute it and/or modify it under the terms
0011: * of the GNU Lesser General Public License as published by the Free Software Foundation;
0012: * either version 2.1 of the License, or (at your option) any later version.
0013: *
0014: * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
0015: * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0016: * See the GNU Lesser General Public License for more details.
0017: *
0018: * You should have received a copy of the GNU Lesser General Public License along with this
0019: * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
0020: * Boston, MA 02111-1307, USA.
0021: *
0022: * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
0023: * in the United States and other countries.]
0024: *
0025: * ------------
0026: * ElementFactory.java
0027: * ------------
0028: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
0029: */package org.jfree.report.elementfactory;
0030:
0031: import java.awt.Color;
0032: import java.awt.geom.Dimension2D;
0033: import java.awt.geom.Point2D;
0034:
0035: import org.jfree.report.Element;
0036: import org.jfree.report.ElementAlignment;
0037: import org.jfree.report.style.BorderStyle;
0038: import org.jfree.report.style.ElementStyleKeys;
0039: import org.jfree.report.style.ElementStyleSheet;
0040: import org.jfree.report.style.FontSmooth;
0041: import org.jfree.report.style.TextStyleKeys;
0042: import org.jfree.ui.FloatDimension;
0043:
0044: /**
0045: * The class element factory is the base class for all Element Factories. Element factories can be used to create
0046: * predefined element types. The properties allow null values, if a property is null, it will not be defined. Undefined
0047: * properties can inherit their values from the element's parent bands or the default-stylesheet. Whether a property is
0048: * inheritable from the parent is defined in the style-key itself.
0049: *
0050: * @author Thomas Morgner
0051: */
0052: public abstract class ElementFactory {
0053: /**
0054: * The name of the new element.
0055: */
0056: private String name;
0057:
0058: /**
0059: * The elements minimum width. A number between 0 and -100 specifies the width as relative size given in percent of
0060: * the parent's width or height (depending on the layout model of the band that contains this element).
0061: */
0062: private Float minimumWidth;
0063: /**
0064: * The elements minimum height. A number between 0 and -100 specifies the width as relative size given in percent of
0065: * the parent's width or height (depending on the layout model of the band that contains this element).
0066: */
0067: private Float minimumHeight;
0068:
0069: /**
0070: * The elements maximum width. The maximum width cannot have relative values.
0071: */
0072: private Float maximumWidth;
0073: /**
0074: * The elements maximum height. The maximum height cannot have relative values.
0075: */
0076: private Float maximumHeight;
0077:
0078: /**
0079: * The elements preferred width. A number between 0 and -100 specifies the width as relative size given in percent of
0080: * the parent's width or height (depending on the layout model of the band that contains this element).
0081: */
0082: private Float width;
0083: /**
0084: * The elements preferred height. A number between 0 and -100 specifies the width as relative size given in percent of
0085: * the parent's width or height (depending on the layout model of the band that contains this element).
0086: */
0087: private Float height;
0088:
0089: /**
0090: * The elements absolute horizontal position for the canvas-layout. The position is relative to the parents upper left
0091: * corner of the content-area. A number between 0 and -100 specifies the width as relative size given in percent of
0092: * the parent's width or height (depending on the layout model of the band that contains this element).
0093: */
0094: private Float x;
0095:
0096: /**
0097: * The elements absolute vertical position for the canvas-layout. The position is relative to the parents upper left
0098: * corner of the content-area. A number between 0 and -100 specifies the width as relative size given in percent of
0099: * the parent's width or height (depending on the layout model of the band that contains this element).
0100: */
0101: private Float y;
0102:
0103: /**
0104: * The elements dynamic content height flag.
0105: */
0106: private Boolean dynamicHeight;
0107:
0108: /**
0109: * The elements visible flag.
0110: */
0111: private Boolean visible;
0112:
0113: /**
0114: * Defines whether the layouter will try to avoid to generate pagebreaks inside this element. If the element does not
0115: * fit on the current page, it will be moved to the next page. Only if this next page does not have enough space to
0116: * hold this element, a pagebreak will be generated inside the element.
0117: */
0118: private Boolean avoidPagebreaks;
0119:
0120: /**
0121: * Defines, whether text contained in this element will overflow horizontally. This will generate overlapping text in
0122: * the pageable outputs without increasing the total size of the element. Activating this property may cause rendering
0123: * artifacts.
0124: */
0125: private Boolean overflowX;
0126:
0127: /**
0128: * Defines, whether text contained in this element will overflow vertically. This will generate overlapping text in
0129: * the pageable outputs without increasing the total size of the element. Activating this property may cause rendering
0130: * artifacts.
0131: */
0132: private Boolean overflowY;
0133:
0134: /**
0135: * Defines the number of widow-lines in this element. This avoids pagebreaks inside the first number of lines of a
0136: * paragraph. If a pagebreak would occur inside the widow-segment, the whole box will be shifted to the next page.
0137: */
0138: private Integer widows;
0139: /**
0140: * Defines the number of orphan-lines in this element. This avoids pagebreaks inside the last number of lines of a
0141: * paragraph. If a pagebreak would occur inside the orphan-segment, the whole number of orphan lines or the whole box
0142: * will be shifted to the next page.
0143: */
0144: private Integer orphans;
0145:
0146: /**
0147: * The background color of the box.
0148: */
0149: private Color backgroundColor;
0150:
0151: /**
0152: * Defines the global padding of this box. Padding defines the empty area between the border and the content of an
0153: * element. This property defines a short-hand property for all other padding properties. Paddings cannot have
0154: * relative sizes.
0155: */
0156: private Float padding;
0157:
0158: /**
0159: * Defines the top padding of this box. Padding defines the empty area between the border and the content of an
0160: * element. Paddings cannot have relative sizes.
0161: */
0162: private Float paddingTop;
0163: /**
0164: * Defines the left padding of this box. Padding defines the empty area between the border and the content of an
0165: * element. Paddings cannot have relative sizes.
0166: */
0167: private Float paddingLeft;
0168: /**
0169: * Defines the bottom padding of this box. Padding defines the empty area between the border and the content of an
0170: * element. Paddings cannot have relative sizes.
0171: */
0172: private Float paddingBottom;
0173: /**
0174: * Defines the right padding of this box. Padding defines the empty area between the border and the content of an
0175: * element. Paddings cannot have relative sizes.
0176: */
0177: private Float paddingRight;
0178:
0179: /**
0180: * Defines the global border width of this box. A border width of zero effectively disables the border. A number
0181: * between 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending
0182: * on the layout model of the band that contains this element). This property defines a short-hand property for all
0183: * other border-width properties.
0184: */
0185: private Float borderWidth;
0186: /**
0187: * Defines the top border width of this box. A border width of zero effectively disables the border. A number between
0188: * 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending on the
0189: * layout model of the band that contains this element).
0190: */
0191: private Float borderTopWidth;
0192: /**
0193: * Defines the left border width of this box. A border width of zero effectively disables the border. A number between
0194: * 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending on the
0195: * layout model of the band that contains this element).
0196: */
0197: private Float borderLeftWidth;
0198: /**
0199: * Defines the bottom border width of this box. A border width of zero effectively disables the border. A number
0200: * between 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending
0201: * on the layout model of the band that contains this element).
0202: */
0203: private Float borderBottomWidth;
0204: /**
0205: * Defines the right border width of this box. A border width of zero effectively disables the border. A number
0206: * between 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending
0207: * on the layout model of the band that contains this element).
0208: */
0209: private Float borderRightWidth;
0210: /**
0211: * Defines the break border width of this box. A border width of zero effectively disables the border. A number
0212: * between 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending
0213: * on the layout model of the band that contains this element).
0214: * <p/>
0215: * The break border is applied to all inner border-edges of elements that got split on a pagebreak.
0216: */
0217: private Float borderBreakWidth;
0218:
0219: /**
0220: * Defines the global border-style for the element. If the border-style is set to NONE or undefined, the border-size
0221: * property will be ignored and no border is rendered. This property defines a short-hand property for all other
0222: * border-style properties.
0223: */
0224: private BorderStyle borderStyle;
0225: /**
0226: * Defines the top border-style for the element. If the border-style is set to NONE or undefined, the border-size
0227: * property will be ignored and no border is rendered.
0228: */
0229: private BorderStyle borderTopStyle;
0230: /**
0231: * Defines the left border-style for the element. If the border-style is set to NONE or undefined, the border-size
0232: * property will be ignored and no border is rendered.
0233: */
0234: private BorderStyle borderLeftStyle;
0235: /**
0236: * Defines the bottom border-style for the element. If the border-style is set to NONE or undefined, the border-size
0237: * property will be ignored and no border is rendered.
0238: */
0239: private BorderStyle borderBottomStyle;
0240: /**
0241: * Defines the right border-style for the element. If the border-style is set to NONE or undefined, the border-size
0242: * property will be ignored and no border is rendered.
0243: */
0244: private BorderStyle borderRightStyle;
0245: /**
0246: * Defines the break border-style for the element. If the border-style is set to NONE or undefined, the border-size
0247: * property will be ignored and no border is rendered.
0248: * <p/>
0249: * The break border is applied to all inner border-edges of elements that got split on a pagebreak.
0250: */
0251: private BorderStyle borderBreakStyle;
0252:
0253: /**
0254: * Defines the global border-color. This property defines a short-hand property for all other border-color
0255: * properties.
0256: */
0257: private Color borderColor;
0258:
0259: /**
0260: * Defines the top border-color.
0261: */
0262: private Color borderTopColor;
0263: /**
0264: * Defines the left border-color.
0265: */
0266: private Color borderLeftColor;
0267: /**
0268: * Defines the bottom border-color.
0269: */
0270: private Color borderBottomColor;
0271: /**
0272: * Defines the right border-color.
0273: */
0274: private Color borderRightColor;
0275: /**
0276: * Defines the break border-color.
0277: */
0278: private Color borderBreakColor;
0279:
0280: /**
0281: * Defines the global width of the border-radius for this element. If the border radius has a non-zero width and
0282: * height, the element's border will have rounded corners. This property is a short-hand property for all other
0283: * border-radius properties.
0284: * <p/>
0285: * Split borders cannot have rounded-corners.
0286: */
0287: private Float borderRadiusWidth;
0288:
0289: /**
0290: * Defines the global height of the border-radius for this element. If the border radius has a non-zero width and
0291: * height, the element's border will have rounded corners. This property is a short-hand property for all other
0292: * border-radius properties.
0293: * <p/>
0294: * Split borders cannot have rounded-corners.
0295: */
0296: private Float borderRadiusHeight;
0297:
0298: /**
0299: * Defines the width of the bottom-left border-radius for this element. If the border radius has a non-zero width and
0300: * height, the element's border will have a rounded bottom-left corner.
0301: */
0302: private Float borderBottomLeftRadiusWidth;
0303: /**
0304: * Defines the width of the bottom-right border-radius for this element. If the border radius has a non-zero width and
0305: * height, the element's border will have a rounded bottom-right corner.
0306: */
0307: private Float borderBottomRightRadiusWidth;
0308: /**
0309: * Defines the width of the top-left border-radius for this element. If the border radius has a non-zero width and
0310: * height, the element's border will have a rounded top-left corner.
0311: */
0312: private Float borderTopLeftRadiusWidth;
0313: /**
0314: * Defines the width of the top-right border-radius for this element. If the border radius has a non-zero width and
0315: * height, the element's border will have a rounded top-right corner.
0316: */
0317: private Float borderTopRightRadiusWidth;
0318:
0319: /**
0320: * Defines the height of the bottom-left border-radius for this element. If the border radius has a non-zero width and
0321: * height, the element's border will have a rounded bottom-left corner.
0322: */
0323: private Float borderBottomLeftRadiusHeight;
0324: /**
0325: * Defines the height of the bottom-right border-radius for this element. If the border radius has a non-zero width
0326: * and height, the element's border will have a rounded bottom-right corner.
0327: */
0328: private Float borderBottomRightRadiusHeight;
0329: /**
0330: * Defines the height of the top-left border-radius for this element. If the border radius has a non-zero width and
0331: * height, the element's border will have a rounded top-left corner.
0332: */
0333: private Float borderTopLeftRadiusHeight;
0334: /**
0335: * Defines the height of the top-right border-radius for this element. If the border radius has a non-zero width and
0336: * height, the element's border will have a rounded top-right corner.
0337: */
0338: private Float borderTopRightRadiusHeight;
0339:
0340: /**
0341: * Defines the text color.
0342: */
0343: private Color color;
0344:
0345: /**
0346: * Defines the vertical alignment of the content.
0347: */
0348: private ElementAlignment verticalAlignment;
0349:
0350: /**
0351: * Defines the horizontal alignment of the content.
0352: */
0353: private ElementAlignment horizontalAlignment;
0354:
0355: /**
0356: * The URL for an hyperlink that contains this element as content.
0357: */
0358: private String hRefTarget;
0359:
0360: /**
0361: * The target-window for the hyperlink defined for this element.
0362: */
0363: private String hRefWindow;
0364:
0365: /**
0366: * The href-title for the hyperlink defined for this element.
0367: */
0368: private String hRefTitle;
0369:
0370: /**
0371: * Defines, whether font smoothing (also known as text-aliasing) is applied to the element. If the font-smooth
0372: * property is undefined or auto, the actual value will be comptued depending on the element's font size.
0373: */
0374: private FontSmooth fontSmooth;
0375:
0376: /**
0377: * Default Constructor.
0378: */
0379: protected ElementFactory() {
0380: }
0381:
0382: /**
0383: * Returns the defined global padding of this box. Padding defines the empty area between the border and the content
0384: * of an element. This property defines a short-hand property for all other padding properties. Paddings cannot have
0385: * relative sizes.
0386: *
0387: * @return the padding or null, if none is defined here.
0388: */
0389: public Float getPadding() {
0390: return padding;
0391: }
0392:
0393: /**
0394: * Defines the global padding of this box. Padding defines the empty area between the border and the content of an
0395: * element. This property defines a short-hand property for all other padding properties. Paddings cannot have
0396: * relative sizes.
0397: *
0398: * @param padding the padding or null, if the default should be used.
0399: */
0400: public void setPadding(final Float padding) {
0401: this .padding = padding;
0402: }
0403:
0404: /**
0405: * Returns the defined global border width of this box. A border width of zero effectively disables the border. A
0406: * number between 0 and -100 specifies the width as relative size given in percent of the parent's width or height
0407: * (depending on the layout model of the band that contains this element). This property defines a short-hand property
0408: * for all other border-width properties.
0409: *
0410: * @return the defined border-width or null, if none is defined here.
0411: */
0412: public Float getBorderWidth() {
0413: return borderWidth;
0414: }
0415:
0416: /**
0417: * Defines the global border width of this box. A border width of zero effectively disables the border. A number
0418: * between 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending
0419: * on the layout model of the band that contains this element). This property defines a short-hand property for all
0420: * other border-width properties.
0421: *
0422: * @param borderWidth the defined border width or null, if the default should be used.
0423: */
0424: public void setBorderWidth(final Float borderWidth) {
0425: this .borderWidth = borderWidth;
0426: }
0427:
0428: /**
0429: * Returns the defined global border-style for the element. If the border-style is set to NONE or undefined, the
0430: * border-size property will be ignored and no border is rendered. This property defines a short-hand property for all
0431: * other border-style properties.
0432: *
0433: * @return the defined border-style or null, if the default should be used.
0434: */
0435: public BorderStyle getBorderStyle() {
0436: return borderStyle;
0437: }
0438:
0439: /**
0440: * Defines the global border-style for the element. If the border-style is set to NONE or undefined, the border-size
0441: * property will be ignored and no border is rendered. This property defines a short-hand property for all other
0442: * border-style properties.
0443: *
0444: * @param borderStyle the defined border-style or null, if none is defined here.
0445: */
0446: public void setBorderStyle(final BorderStyle borderStyle) {
0447: this .borderStyle = borderStyle;
0448: }
0449:
0450: /**
0451: * Returns the defined global border-color. This property defines a short-hand property for all other border-color
0452: * properties.
0453: *
0454: * @return the border-color for all borders or null, if no global color is defined.
0455: */
0456: public Color getBorderColor() {
0457: return borderColor;
0458: }
0459:
0460: /**
0461: * Defines the global border-color. This property defines a short-hand property for all other border-color
0462: * properties.
0463: *
0464: * @param borderColor the defined color for all borders or null, if no global color is defined.
0465: */
0466: public void setBorderColor(final Color borderColor) {
0467: this .borderColor = borderColor;
0468: }
0469:
0470: /**
0471: * Returns the defined global border-radius for this element. If the border radius has a non-zero width and height,
0472: * the element's border will have rounded corners. This property is a short-hand property for all other border-radius
0473: * properties.
0474: *
0475: * @return the defined border-radius for all corners of this element or null, if no global default is defined here.
0476: */
0477: public Dimension2D getBorderRadius() {
0478: if (borderRadiusWidth == null || borderRadiusHeight == null) {
0479: return null;
0480: }
0481: return new FloatDimension(borderRadiusWidth.floatValue(),
0482: borderRadiusHeight.floatValue());
0483: }
0484:
0485: /**
0486: * Defines the global border-radius for this element. If the border radius has a non-zero width and height, the
0487: * element's border will have rounded corners. This property is a short-hand property for all other border-radius
0488: * properties.
0489: * <p/>
0490: *
0491: * @param borderRadius the defined border-radius for all corners of this element or null, if no global default should
0492: * be defined here.
0493: */
0494: public void setBorderRadius(final Dimension2D borderRadius) {
0495: if (borderRadius == null) {
0496: this .borderRadiusWidth = null;
0497: this .borderRadiusHeight = null;
0498: } else {
0499: this .borderRadiusWidth = new Float(borderRadius.getWidth());
0500: this .borderRadiusHeight = new Float(borderRadius
0501: .getHeight());
0502: }
0503: }
0504:
0505: /**
0506: * Returns the defined global width of the border-radius for this element. If the border radius has a non-zero width
0507: * and height, the element's border will have rounded corners. This property is a short-hand property for all other
0508: * border-radius properties.
0509: *
0510: * @return the defined width of the border-radius for all corners of this element or null, if no global default is
0511: * defined here.
0512: */
0513: public Float getBorderRadiusWidth() {
0514: return borderRadiusWidth;
0515: }
0516:
0517: /**
0518: * Defines the global width of the border-radius for this element. If the border radius has a non-zero width and
0519: * height, the element's border will have rounded corners. This property is a short-hand property for all other
0520: * border-radius properties.
0521: * <p/>
0522: *
0523: * @param borderRadiusWidth the defined width of the border-radius for all corners of this element or null, if no
0524: * global default should be defined here.
0525: */
0526: public void setBorderRadiusWidth(final Float borderRadiusWidth) {
0527: this .borderRadiusWidth = borderRadiusWidth;
0528: }
0529:
0530: /**
0531: * Returns the defined global height of the border-radius for this element. If the border radius has a non-zero width
0532: * and height, the element's border will have rounded corners. This property is a short-hand property for all other
0533: * border-radius properties.
0534: *
0535: * @return the defined height of the border-radius for all corners of this element or null, if no global default is
0536: * defined here.
0537: */
0538: public Float getBorderRadiusHeight() {
0539: return borderRadiusHeight;
0540: }
0541:
0542: /**
0543: * Defines the global height of the border-radius for this element. If the border radius has a non-zero width and
0544: * height, the element's border will have rounded corners. This property is a short-hand property for all other
0545: * border-radius properties.
0546: * <p/>
0547: *
0548: * @param borderRadiusHeight the defined height of the border-radius for all corners of this element or null, if no
0549: * global default should be defined here.
0550: */
0551: public void setBorderRadiusHeight(final Float borderRadiusHeight) {
0552: this .borderRadiusHeight = borderRadiusHeight;
0553: }
0554:
0555: /**
0556: * Returns the defined bottom-left border-radius for this element. If the border radius has a non-zero width and
0557: * height, the element's border will have a rounded bottom-left corner.
0558: *
0559: * @return the defined border-radius for the bottom-left corner of this element or null, if this property is
0560: * undefined.
0561: */
0562: public Dimension2D getBorderBottomLeftRadius() {
0563: if (borderBottomLeftRadiusWidth == null
0564: || borderBottomLeftRadiusHeight == null) {
0565: return null;
0566: }
0567: return new FloatDimension(borderBottomLeftRadiusWidth
0568: .floatValue(), borderBottomLeftRadiusHeight
0569: .floatValue());
0570: }
0571:
0572: /**
0573: * Defines the bottom-left border-radius for this element. If the border radius has a non-zero width and height, the
0574: * element's border will have a rounded bottom-left corner.
0575: *
0576: * @param borderRadius the defined border-radius for the bottom-left corner of this element or null, if this property
0577: * should be undefined.
0578: */
0579: public void setBorderBottomLeftRadius(final Dimension2D borderRadius) {
0580: if (borderRadius == null) {
0581: this .borderBottomLeftRadiusWidth = null;
0582: this .borderBottomLeftRadiusHeight = null;
0583: } else {
0584: this .borderBottomLeftRadiusWidth = new Float(borderRadius
0585: .getWidth());
0586: this .borderBottomLeftRadiusHeight = new Float(borderRadius
0587: .getHeight());
0588: }
0589: }
0590:
0591: /**
0592: * Returns width of the defined bottom-left border-radius for this element. If the border radius has a non-zero width
0593: * and height, the element's border will have a rounded bottom-left corner.
0594: *
0595: * @return the defined width of the border-radius for the bottom-left corner of this element or null, if this property
0596: * is undefined.
0597: */
0598: public Float getBorderBottomLeftRadiusWidth() {
0599: return borderBottomLeftRadiusWidth;
0600: }
0601:
0602: /**
0603: * Defines width of the bottom-left border-radius for this element. If the border radius has a non-zero width and
0604: * height, the element's border will have a rounded bottom-left corner.
0605: *
0606: * @param borderBottomLeftRadiusWidth the width of the defined border-radius for the bottom-left corner of this
0607: * element or null, if this property should be undefined.
0608: */
0609: public void setBorderBottomLeftRadiusWidth(
0610: final Float borderBottomLeftRadiusWidth) {
0611: this .borderBottomLeftRadiusWidth = borderBottomLeftRadiusWidth;
0612: }
0613:
0614: /**
0615: * Returns height of the defined bottom-left border-radius for this element. If the border radius has a non-zero width
0616: * and height, the element's border will have a rounded bottom-left corner.
0617: *
0618: * @return the defined height of the border-radius for the bottom-left corner of this element or null, if this
0619: * property is undefined.
0620: */
0621: public Float getBorderBottomLeftRadiusHeight() {
0622: return borderBottomLeftRadiusHeight;
0623: }
0624:
0625: /**
0626: * Defines height of the bottom-left border-radius for this element. If the border radius has a non-zero width and
0627: * height, the element's border will have a rounded bottom-left corner.
0628: *
0629: * @param borderBottomLeftRadiusHeight the height of the defined border-radius for the bottom-left corner of this
0630: * element or null, if this property should be undefined.
0631: */
0632: public void setBorderBottomLeftRadiusHeight(
0633: final Float borderBottomLeftRadiusHeight) {
0634: this .borderBottomLeftRadiusHeight = borderBottomLeftRadiusHeight;
0635: }
0636:
0637: /**
0638: * Returns the defined bottom-right border-radius for this element. If the border radius has a non-zero width and
0639: * height, the element's border will have a rounded bottom-right corner.
0640: *
0641: * @return the defined border-radius for the bottom-right corner of this element or null, if this property is
0642: * undefined.
0643: */
0644: public Dimension2D getBorderBottomRightRadius() {
0645: if (borderBottomRightRadiusWidth == null
0646: || borderBottomRightRadiusHeight == null) {
0647: return null;
0648: }
0649: return new FloatDimension(borderBottomRightRadiusWidth
0650: .floatValue(), borderBottomRightRadiusHeight
0651: .floatValue());
0652: }
0653:
0654: /**
0655: * Defines the bottom-right border-radius for this element. If the border radius has a non-zero width and height, the
0656: * element's border will have a rounded bottom-right corner.
0657: *
0658: * @param borderRadius the defined border-radius for the bottom-right corner of this element or null, if this property
0659: * should be undefined.
0660: */
0661: public void setBorderBottomRightRadius(
0662: final Dimension2D borderRadius) {
0663: if (borderRadius == null) {
0664: this .borderBottomRightRadiusWidth = null;
0665: this .borderBottomRightRadiusHeight = null;
0666: } else {
0667: this .borderBottomRightRadiusWidth = new Float(borderRadius
0668: .getWidth());
0669: this .borderBottomRightRadiusHeight = new Float(borderRadius
0670: .getHeight());
0671: }
0672: }
0673:
0674: /**
0675: * Returns the width of the defined bottom-right border-radius for this element. If the border radius has a non-zero
0676: * width and height, the element's border will have a rounded bottom-right corner.
0677: *
0678: * @return the width of the defined border-radius for the bottom-right corner of this element or null, if this
0679: * property is undefined.
0680: */
0681: public Float getBorderBottomRightRadiusWidth() {
0682: return borderBottomRightRadiusWidth;
0683: }
0684:
0685: /**
0686: * Defines the width of the bottom-right border-radius for this element. If the border radius has a non-zero width and
0687: * height, the element's border will have a rounded bottom-right corner.
0688: *
0689: * @param borderBottomRightRadiusWidth the width of the defined border-radius for the bottom-right corner of this
0690: * element or null, if this property should be undefined.
0691: */
0692: public void setBorderBottomRightRadiusWidth(
0693: final Float borderBottomRightRadiusWidth) {
0694: this .borderBottomRightRadiusWidth = borderBottomRightRadiusWidth;
0695: }
0696:
0697: /**
0698: * Returns the height of the defined bottom-right border-radius for this element. If the border radius has a non-zero
0699: * width and height, the element's border will have a rounded bottom-right corner.
0700: *
0701: * @return the height of the defined border-radius for the bottom-right corner of this element or null, if this
0702: * property is undefined.
0703: */
0704: public Float getBorderBottomRightRadiusHeight() {
0705: return borderBottomRightRadiusHeight;
0706: }
0707:
0708: /**
0709: * Defines the height of the bottom-right border-radius for this element. If the border radius has a non-zero width
0710: * and height, the element's border will have a rounded bottom-right corner.
0711: *
0712: * @param borderBottomRightRadiusHeight the height of the defined border-radius for the bottom-right corner of this
0713: * element or null, if this property should be undefined.
0714: */
0715: public void setBorderBottomRightRadiusHeight(
0716: final Float borderBottomRightRadiusHeight) {
0717: this .borderBottomRightRadiusHeight = borderBottomRightRadiusHeight;
0718: }
0719:
0720: /**
0721: * Returns the defined top-left border-radius for this element. If the border radius has a non-zero width and height,
0722: * the element's border will have a rounded top-left corner.
0723: *
0724: * @return the defined border-radius for the top-left corner of this element or null, if this property is undefined.
0725: */
0726: public Dimension2D getBorderTopLeftRadius() {
0727: if (borderTopLeftRadiusWidth == null
0728: || borderTopLeftRadiusHeight == null) {
0729: return null;
0730: }
0731: return new FloatDimension(
0732: borderTopLeftRadiusWidth.floatValue(),
0733: borderTopLeftRadiusHeight.floatValue());
0734: }
0735:
0736: /**
0737: * Defines the top-left border-radius for this element. If the border radius has a non-zero width and height, the
0738: * element's border will have a rounded top-left corner.
0739: *
0740: * @param borderRadius the defined border-radius for the top-left corner of this element or null, if this property
0741: * should be undefined.
0742: */
0743: public void setBorderTopLeftRadius(final Dimension2D borderRadius) {
0744: if (borderRadius == null) {
0745: this .borderTopLeftRadiusWidth = null;
0746: this .borderTopLeftRadiusHeight = null;
0747: } else {
0748: this .borderTopLeftRadiusWidth = new Float(borderRadius
0749: .getWidth());
0750: this .borderTopLeftRadiusHeight = new Float(borderRadius
0751: .getHeight());
0752: }
0753: }
0754:
0755: /**
0756: * Returns the width of the defined top-left border-radius for this element. If the border radius has a non-zero width
0757: * and height, the element's border will have a rounded top-left corner.
0758: *
0759: * @return the width of the defined border-radius for the top-left corner of this element or null, if this property is
0760: * undefined.
0761: */
0762: public Float getBorderTopLeftRadiusWidth() {
0763: return borderTopLeftRadiusWidth;
0764: }
0765:
0766: /**
0767: * Defines the width of the top-left border-radius for this element. If the border radius has a non-zero width and
0768: * height, the element's border will have a rounded top-left corner.
0769: *
0770: * @param borderTopLeftRadiusWidth the width of the defined border-radius for the top-left corner of this element or
0771: * null, if this property should be undefined.
0772: */
0773: public void setBorderTopLeftRadiusWidth(
0774: final Float borderTopLeftRadiusWidth) {
0775: this .borderTopLeftRadiusWidth = borderTopLeftRadiusWidth;
0776: }
0777:
0778: /**
0779: * Returns the height of the defined top-left border-radius for this element. If the border radius has a non-zero
0780: * width and height, the element's border will have a rounded top-left corner.
0781: *
0782: * @return the height of the defined border-radius for the top-left corner of this element or null, if this property
0783: * is undefined.
0784: */
0785: public Float getBorderTopLeftRadiusHeight() {
0786: return borderTopLeftRadiusHeight;
0787: }
0788:
0789: /**
0790: * Defines the height of the top-left border-radius for this element. If the border radius has a non-zero width and
0791: * height, the element's border will have a rounded top-left corner.
0792: *
0793: * @param borderTopLeftRadiusHeight the height of the defined border-radius for the top-left corner of this element or
0794: * null, if this property should be undefined.
0795: */
0796: public void setBorderTopLeftRadiusHeight(
0797: final Float borderTopLeftRadiusHeight) {
0798: this .borderTopLeftRadiusHeight = borderTopLeftRadiusHeight;
0799: }
0800:
0801: /**
0802: * Returns the defined top-right border-radius for this element. If the border radius has a non-zero width and height,
0803: * the element's border will have a rounded top-right corner.
0804: *
0805: * @return the defined border-radius for the top-right corner of this element or null, if this property is undefined.
0806: */
0807: public Dimension2D getBorderTopRightRadius() {
0808: if (borderTopRightRadiusWidth == null
0809: || borderTopRightRadiusHeight == null) {
0810: return null;
0811: }
0812: return new FloatDimension(borderTopRightRadiusWidth
0813: .floatValue(), borderTopRightRadiusHeight.floatValue());
0814: }
0815:
0816: /**
0817: * Defines the top-right border-radius for this element. If the border radius has a non-zero width and height, the
0818: * element's border will have a rounded top-right corner.
0819: *
0820: * @param borderRadius the defined border-radius for the top-right corner of this element or null, if this property
0821: * should be undefined.
0822: */
0823: public void setBorderTopRightRadius(final Dimension2D borderRadius) {
0824: if (borderRadius == null) {
0825: this .borderTopRightRadiusWidth = null;
0826: this .borderTopRightRadiusHeight = null;
0827: } else {
0828: this .borderTopRightRadiusWidth = new Float(borderRadius
0829: .getWidth());
0830: this .borderTopRightRadiusHeight = new Float(borderRadius
0831: .getHeight());
0832: }
0833: }
0834:
0835: /**
0836: * Returns the width of the defined top-right border-radius for this element. If the border radius has a non-zero
0837: * width and height, the element's border will have a rounded top-right corner.
0838: *
0839: * @return the width of the defined border-radius for the top-right corner of this element or null, if this property
0840: * is undefined.
0841: */
0842: public Float getBorderTopRightRadiusWidth() {
0843: return borderTopRightRadiusWidth;
0844: }
0845:
0846: /**
0847: * Defines the width of the top-right border-radius for this element. If the border radius has a non-zero width and
0848: * height, the element's border will have a rounded top-right corner.
0849: *
0850: * @param borderTopRightRadiusWidth the width of the defined border-radius for the top-right corner of this element or
0851: * null, if this property should be undefined.
0852: */
0853: public void setBorderTopRightRadiusWidth(
0854: final Float borderTopRightRadiusWidth) {
0855: this .borderTopRightRadiusWidth = borderTopRightRadiusWidth;
0856: }
0857:
0858: /**
0859: * Returns the height of the defined top-right border-radius for this element. If the border radius has a non-zero
0860: * width and height, the element's border will have a rounded top-right corner.
0861: *
0862: * @return the height of the defined border-radius for the top-right corner of this element or null, if this property
0863: * is undefined.
0864: */
0865: public Float getBorderTopRightRadiusHeight() {
0866: return borderTopRightRadiusHeight;
0867: }
0868:
0869: /**
0870: * Defines the height of the top-right border-radius for this element. If the border radius has a non-zero width and
0871: * height, the element's border will have a rounded top-right corner.
0872: *
0873: * @param borderTopRightRadiusHeight the height of the defined border-radius for the top-right corner of this element
0874: * or null, if this property should be undefined.
0875: */
0876: public void setBorderTopRightRadiusHeight(
0877: final Float borderTopRightRadiusHeight) {
0878: this .borderTopRightRadiusHeight = borderTopRightRadiusHeight;
0879: }
0880:
0881: /**
0882: * Returns the text color for the new element.
0883: *
0884: * @return the text color.
0885: */
0886: public Color getColor() {
0887: return color;
0888: }
0889:
0890: /**
0891: * Defines the text color for the new element.
0892: *
0893: * @param color the text color.
0894: */
0895: public void setColor(final Color color) {
0896: this .color = color;
0897: }
0898:
0899: /**
0900: * Returns the vertical alignment for the content of this element.
0901: *
0902: * @return the vertical alignment.
0903: */
0904: public ElementAlignment getVerticalAlignment() {
0905: return verticalAlignment;
0906: }
0907:
0908: /**
0909: * Defines the vertical alignment for the content of this element.
0910: *
0911: * @param verticalAlignment the vertical alignment.
0912: */
0913: public void setVerticalAlignment(
0914: final ElementAlignment verticalAlignment) {
0915: this .verticalAlignment = verticalAlignment;
0916: }
0917:
0918: /**
0919: * Returns the horizontal alignment for the content of this element.
0920: *
0921: * @return the horizontal alignment.
0922: */
0923: public ElementAlignment getHorizontalAlignment() {
0924: return horizontalAlignment;
0925: }
0926:
0927: /**
0928: * Defines the horizontal alignment for the content of this element.
0929: *
0930: * @param horizontalAlignment the vertical alignment.
0931: */
0932: public void setHorizontalAlignment(
0933: final ElementAlignment horizontalAlignment) {
0934: this .horizontalAlignment = horizontalAlignment;
0935: }
0936:
0937: /**
0938: * Returns the defined font smoothing (also known as text-aliasing) is applied to the element. If the font-smooth
0939: * property is undefined or auto, the actual value will be comptued depending on the element's font size.
0940: *
0941: * @return the font-smooth constant or null, if this property is undefined.
0942: */
0943: public FontSmooth getFontSmooth() {
0944: return fontSmooth;
0945: }
0946:
0947: /**
0948: * Defines, whether font smoothing (also known as text-aliasing) is applied to the element. If the font-smooth
0949: * property is undefined or auto, the actual value will be comptued depending on the element's font size.
0950: *
0951: * @param fontSmooth the font-smooth constant or null, if this property should be left undefined.
0952: */
0953: public void setFontSmooth(final FontSmooth fontSmooth) {
0954: this .fontSmooth = fontSmooth;
0955: }
0956:
0957: /**
0958: * Returns the defined top border width of this box. A border width of zero effectively disables the border. A number
0959: * between 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending
0960: * on the layout model of the band that contains this element).
0961: *
0962: * @return the border width for the top edge or null if the property should be left undefined.
0963: */
0964: public Float getBorderTopWidth() {
0965: return borderTopWidth;
0966: }
0967:
0968: /**
0969: * Defines the top border width of this box. A border width of zero effectively disables the border. A number between
0970: * 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending on the
0971: * layout model of the band that contains this element).
0972: *
0973: * @param borderTopWidth the border width for the top edge or null if the property should be left undefined.
0974: */
0975: public void setBorderTopWidth(final Float borderTopWidth) {
0976: this .borderTopWidth = borderTopWidth;
0977: }
0978:
0979: /**
0980: * Returns the defined left border width of this box. A border width of zero effectively disables the border. A number
0981: * between 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending
0982: * on the layout model of the band that contains this element).
0983: *
0984: * @return the border width for the left edge or null if the property should be left undefined.
0985: */
0986: public Float getBorderLeftWidth() {
0987: return borderLeftWidth;
0988: }
0989:
0990: /**
0991: * Defines the left border width of this box. A border width of zero effectively disables the border. A number between
0992: * 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending on the
0993: * layout model of the band that contains this element).
0994: *
0995: * @param borderLeftWidth the border width for the left edge or null if the property should be left undefined.
0996: */
0997: public void setBorderLeftWidth(final Float borderLeftWidth) {
0998: this .borderLeftWidth = borderLeftWidth;
0999: }
1000:
1001: /**
1002: * Returns the defined left border width of this box. A border width of zero effectively disables the border. A number
1003: * between 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending
1004: * on the layout model of the band that contains this element).
1005: *
1006: * @return the border width for the left edge or null if the property should be left undefined.
1007: */
1008: public Float getBorderBottomWidth() {
1009: return borderBottomWidth;
1010: }
1011:
1012: /**
1013: * Defines the bottom border width of this box. A border width of zero effectively disables the border. A number
1014: * between 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending
1015: * on the layout model of the band that contains this element).
1016: *
1017: * @param borderBottomWidth the border width for the bottom edge or null if the property should be left undefined.
1018: */
1019: public void setBorderBottomWidth(final Float borderBottomWidth) {
1020: this .borderBottomWidth = borderBottomWidth;
1021: }
1022:
1023: /**
1024: * Returns the defined right border width of this box. A border width of zero effectively disables the border. A
1025: * number between 0 and -100 specifies the width as relative size given in percent of the parent's width or height
1026: * (depending on the layout model of the band that contains this element).
1027: *
1028: * @return the border width for the right edge or null if the property should be left undefined.
1029: */
1030: public Float getBorderRightWidth() {
1031: return borderRightWidth;
1032: }
1033:
1034: /**
1035: * Defines the right border width of this box. A border width of zero effectively disables the border. A number
1036: * between 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending
1037: * on the layout model of the band that contains this element).
1038: *
1039: * @param borderRightWidth the border width for the right edge or null if the property should be left undefined.
1040: */
1041: public void setBorderRightWidth(final Float borderRightWidth) {
1042: this .borderRightWidth = borderRightWidth;
1043: }
1044:
1045: /**
1046: * Returns the defined break border width of this box. A border width of zero effectively disables the border. A
1047: * number between 0 and -100 specifies the width as relative size given in percent of the parent's width or height
1048: * (depending on the layout model of the band that contains this element).
1049: * <p/>
1050: * The break border is applied to all inner border-edges of elements that got split on a pagebreak.
1051: *
1052: * @return the width of the break edge of the border or null, if not defined.
1053: */
1054: public Float getBorderBreakWidth() {
1055: return borderBreakWidth;
1056: }
1057:
1058: /**
1059: * Defines the break border width of this box. A border width of zero effectively disables the border. A number
1060: * between 0 and -100 specifies the width as relative size given in percent of the parent's width or height (depending
1061: * on the layout model of the band that contains this element).
1062: * <p/>
1063: * The break border is applied to all inner border-edges of elements that got split on a pagebreak.
1064: *
1065: * @param borderBreakWidth the width of the break edge of the border or null, if not defined.
1066: */
1067: public void setBorderBreakWidth(final Float borderBreakWidth) {
1068: this .borderBreakWidth = borderBreakWidth;
1069: }
1070:
1071: /**
1072: * Returns the defined top border-style for the element. If the border-style is set to NONE or undefined, the
1073: * border-size property will be ignored and no border is rendered.
1074: *
1075: * @return the border style for the top edge or null, if the style should remain undefined.
1076: */
1077: public BorderStyle getBorderTopStyle() {
1078: return borderTopStyle;
1079: }
1080:
1081: /**
1082: * Defines the top border-style for the element. If the border-style is set to NONE or undefined, the border-size
1083: * property will be ignored and no border is rendered.
1084: *
1085: * @param borderTopStyle the border style for the top edge or null, if the style should remain undefined.
1086: */
1087: public void setBorderTopStyle(final BorderStyle borderTopStyle) {
1088: this .borderTopStyle = borderTopStyle;
1089: }
1090:
1091: /**
1092: * Returns the defined left border-style for the element. If the border-style is set to NONE or undefined, the
1093: * border-size property will be ignored and no border is rendered.
1094: *
1095: * @return the border style for the left edge or null, if the style should remain undefined.
1096: */
1097: public BorderStyle getBorderLeftStyle() {
1098: return borderLeftStyle;
1099: }
1100:
1101: /**
1102: * Defines the left border-style for the element. If the border-style is set to NONE or undefined, the border-size
1103: * property will be ignored and no border is rendered.
1104: *
1105: * @param borderLeftStyle the border style for the left edge or null, if the style should remain undefined.
1106: */
1107: public void setBorderLeftStyle(final BorderStyle borderLeftStyle) {
1108: this .borderLeftStyle = borderLeftStyle;
1109: }
1110:
1111: /**
1112: * Returns the defined bottom border-style for the element. If the border-style is set to NONE or undefined, the
1113: * border-size property will be ignored and no border is rendered.
1114: *
1115: * @return the border style for the bottom edge or null, if the style should remain undefined.
1116: */
1117: public BorderStyle getBorderBottomStyle() {
1118: return borderBottomStyle;
1119: }
1120:
1121: /**
1122: * Defines the bottom border-style for the element. If the border-style is set to NONE or undefined, the border-size
1123: * property will be ignored and no border is rendered.
1124: *
1125: * @param borderBottomStyle the border style for the bottom edge or null, if the style should remain undefined.
1126: */
1127: public void setBorderBottomStyle(final BorderStyle borderBottomStyle) {
1128: this .borderBottomStyle = borderBottomStyle;
1129: }
1130:
1131: /**
1132: * Returns the defined right border-style for the element. If the border-style is set to NONE or undefined, the
1133: * border-size property will be ignored and no border is rendered.
1134: *
1135: * @return the border style for the right edge or null, if the style should remain undefined.
1136: */
1137: public BorderStyle getBorderRightStyle() {
1138: return borderRightStyle;
1139: }
1140:
1141: /**
1142: * Defines the right border-style for the element. If the border-style is set to NONE or undefined, the border-size
1143: * property will be ignored and no border is rendered.
1144: *
1145: * @param borderRightStyle the border style for the right edge or null, if the style should remain undefined.
1146: */
1147: public void setBorderRightStyle(final BorderStyle borderRightStyle) {
1148: this .borderRightStyle = borderRightStyle;
1149: }
1150:
1151: /**
1152: * Returns the defined break border-style for the element. If the border-style is set to NONE or undefined, the
1153: * border-size property will be ignored and no border is rendered.
1154: *
1155: * @return the border style for the break edge or null, if the style should remain undefined.
1156: */
1157: public BorderStyle getBorderBreakStyle() {
1158: return borderBreakStyle;
1159: }
1160:
1161: /**
1162: * Defines the break border-style for the element. If the border-style is set to NONE or undefined, the border-size
1163: * property will be ignored and no border is rendered.
1164: *
1165: * @param borderBreakStyle the border style for the break edge or null, if the style should remain undefined.
1166: */
1167: public void setBorderBreakStyle(final BorderStyle borderBreakStyle) {
1168: this .borderBreakStyle = borderBreakStyle;
1169: }
1170:
1171: /**
1172: * Returns the defined top border-color.
1173: *
1174: * @return the color for the top edge or null, if the value should be left undefined here.
1175: */
1176: public Color getBorderTopColor() {
1177: return borderTopColor;
1178: }
1179:
1180: /**
1181: * Defines the top border-color.
1182: *
1183: * @param borderTopColor the color for the top edge or null, if the value should be left undefined here.
1184: */
1185: public void setBorderTopColor(final Color borderTopColor) {
1186: this .borderTopColor = borderTopColor;
1187: }
1188:
1189: /**
1190: * Returns the defined left border-color.
1191: *
1192: * @return the color for the left edge or null, if the value should be left undefined here.
1193: */
1194: public Color getBorderLeftColor() {
1195: return borderLeftColor;
1196: }
1197:
1198: /**
1199: * Defines the left border-color.
1200: *
1201: * @param borderLeftColor the color for the left edge or null, if the value should be left undefined here.
1202: */
1203: public void setBorderLeftColor(final Color borderLeftColor) {
1204: this .borderLeftColor = borderLeftColor;
1205: }
1206:
1207: /**
1208: * Returns the defined bottom border-color.
1209: *
1210: * @return the color for the bottom edge or null, if the value should be left undefined here.
1211: */
1212: public Color getBorderBottomColor() {
1213: return borderBottomColor;
1214: }
1215:
1216: /**
1217: * Defines the bottom border-color.
1218: *
1219: * @param borderBottomColor the color for the bottom edge or null, if the value should be left undefined here.
1220: */
1221: public void setBorderBottomColor(final Color borderBottomColor) {
1222: this .borderBottomColor = borderBottomColor;
1223: }
1224:
1225: /**
1226: * Returns the defined right border-color.
1227: *
1228: * @return the color for the right edge or null, if the value should be left undefined here.
1229: */
1230: public Color getBorderRightColor() {
1231: return borderRightColor;
1232: }
1233:
1234: /**
1235: * Defines the right border-color.
1236: *
1237: * @param borderRightColor the color for the right edge or null, if the value should be left undefined here.
1238: */
1239: public void setBorderRightColor(final Color borderRightColor) {
1240: this .borderRightColor = borderRightColor;
1241: }
1242:
1243: /**
1244: * Returns the defined break border-color.
1245: *
1246: * @return the color for the break edge or null, if the value should be left undefined here.
1247: */
1248: public Color getBorderBreakColor() {
1249: return borderBreakColor;
1250: }
1251:
1252: /**
1253: * Defines the break border-color.
1254: *
1255: * @param borderBreakColor the color for the break edge or null, if the value should be left undefined here.
1256: */
1257: public void setBorderBreakColor(final Color borderBreakColor) {
1258: this .borderBreakColor = borderBreakColor;
1259: }
1260:
1261: /**
1262: * Returns the defined top padding of this box. Padding defines the empty area between the border and the content of
1263: * an element. Paddings cannot have relative sizes.
1264: *
1265: * @return the padding or null, if the padding remains undefined here.
1266: */
1267: public Float getPaddingTop() {
1268: return paddingTop;
1269: }
1270:
1271: /**
1272: * Defines the top padding of this box. Padding defines the empty area between the border and the content of an
1273: * element. Paddings cannot have relative sizes.
1274: *
1275: * @param paddingTop the padding or null, if the padding remains undefined here.
1276: */
1277: public void setPaddingTop(final Float paddingTop) {
1278: this .paddingTop = paddingTop;
1279: }
1280:
1281: /**
1282: * Returns the defined left padding of this box. Padding defines the empty area between the border and the content of
1283: * an element. Paddings cannot have relative sizes.
1284: *
1285: * @return the padding or null, if the padding remains undefined here.
1286: */
1287: public Float getPaddingLeft() {
1288: return paddingLeft;
1289: }
1290:
1291: /**
1292: * Defines the left padding of this box. Padding defines the empty area between the border and the content of an
1293: * element. Paddings cannot have relative sizes.
1294: *
1295: * @param paddingLeft the padding or null, if the padding remains undefined here.
1296: */
1297: public void setPaddingLeft(final Float paddingLeft) {
1298: this .paddingLeft = paddingLeft;
1299: }
1300:
1301: /**
1302: * Returns the defined bottom padding of this box. Padding defines the empty area between the border and the content
1303: * of an element. Paddings cannot have relative sizes.
1304: *
1305: * @return the padding or null, if the padding remains undefined here.
1306: */
1307: public Float getPaddingBottom() {
1308: return paddingBottom;
1309: }
1310:
1311: /**
1312: * Defines the bottom padding of this box. Padding defines the empty area between the border and the content of an
1313: * element. Paddings cannot have relative sizes.
1314: *
1315: * @param paddingBottom the padding or null, if the padding remains undefined here.
1316: */
1317: public void setPaddingBottom(final Float paddingBottom) {
1318: this .paddingBottom = paddingBottom;
1319: }
1320:
1321: /**
1322: * Returns the defined right padding of this box. Padding defines the empty area between the border and the content of
1323: * an element. Paddings cannot have relative sizes.
1324: *
1325: * @return the padding or null, if the padding remains undefined here.
1326: */
1327: public Float getPaddingRight() {
1328: return paddingRight;
1329: }
1330:
1331: /**
1332: * Defines the right padding of this box. Padding defines the empty area between the border and the content of an
1333: * element. Paddings cannot have relative sizes.
1334: *
1335: * @param paddingRight the padding or null, if the padding remains undefined here.
1336: */
1337: public void setPaddingRight(final Float paddingRight) {
1338: this .paddingRight = paddingRight;
1339: }
1340:
1341: /**
1342: * Returns the defined number of widow-lines in this element. This avoids pagebreaks inside the first number of lines
1343: * of a paragraph. If a pagebreak would occur inside the widow-segment, the whole box will be shifted to the next
1344: * page.
1345: *
1346: * @return the number of widow-lines that control the pagebreak inside the paragraph.
1347: */
1348: public Integer getWidows() {
1349: return widows;
1350: }
1351:
1352: /**
1353: * Defines the number of widow-lines in this element. This avoids pagebreaks inside the first number of lines of a
1354: * paragraph. If a pagebreak would occur inside the widow-segment, the whole box will be shifted to the next page.
1355: *
1356: * @param widows the number of widow-lines that control the pagebreak inside the paragraph.
1357: */
1358: public void setWidows(final Integer widows) {
1359: this .widows = widows;
1360: }
1361:
1362: /**
1363: * Returns the defined number of orphan-lines in this element. This avoids pagebreaks inside the last number of lines
1364: * of a paragraph. If a pagebreak would occur inside the orphan-segment, the whole number of orphan lines or the whole
1365: * box will be shifted to the next page.
1366: *
1367: * @return the number of orphan-lines that control the pagebreak inside the paragraph.
1368: */
1369: public Integer getOrphans() {
1370: return orphans;
1371: }
1372:
1373: /**
1374: * Defines the number of orphan-lines in this element. This avoids pagebreaks inside the last number of lines of a
1375: * paragraph. If a pagebreak would occur inside the orphan-segment, the whole number of orphan lines or the whole box
1376: * will be shifted to the next page.
1377: *
1378: * @param orphans the number of orphan-lines that control the pagebreak inside the paragraph.
1379: */
1380: public void setOrphans(final Integer orphans) {
1381: this .orphans = orphans;
1382: }
1383:
1384: /**
1385: * Returns the defined background color of the box.
1386: *
1387: * @return the background color or null, if undefined.
1388: */
1389: public Color getBackgroundColor() {
1390: return backgroundColor;
1391: }
1392:
1393: /**
1394: * Defines the background color of the box.
1395: *
1396: * @param backgroundColor the background color or null, if undefined.
1397: */
1398: public void setBackgroundColor(final Color backgroundColor) {
1399: this .backgroundColor = backgroundColor;
1400: }
1401:
1402: /**
1403: * Returns, whether text contained in this element will overflow vertically. This will generate overlapping text in
1404: * the pageable outputs without increasing the total size of the element. Activating this property may cause rendering
1405: * artifacts.
1406: *
1407: * @return a boolean whether text can overflow the box boundaries or null, if this property is left undefined.
1408: */
1409: public Boolean getOverflowY() {
1410: return overflowY;
1411: }
1412:
1413: /**
1414: * Defines, whether text contained in this element will overflow vertically. This will generate overlapping text in
1415: * the pageable outputs without increasing the total size of the element. Activating this property may cause rendering
1416: * artifacts.
1417: *
1418: * @param overflowY defines, whether text can overflow the box boundaries or null, to leave this property undefined.
1419: */
1420: public void setOverflowY(final Boolean overflowY) {
1421: this .overflowY = overflowY;
1422: }
1423:
1424: /**
1425: * Returns, whether text contained in this element will overflow horizontally. This will generate overlapping text in
1426: * the pageable outputs without increasing the total size of the element. Activating this property may cause rendering
1427: * artifacts.
1428: *
1429: * @return a boolean whether text can overflow the box boundaries or null, if this property is left undefined.
1430: */
1431: public Boolean getOverflowX() {
1432: return overflowX;
1433: }
1434:
1435: /**
1436: * Defines, whether text contained in this element will overflow horizontally. This will generate overlapping text in
1437: * the pageable outputs without increasing the total size of the element. Activating this property may cause rendering
1438: * artifacts.
1439: *
1440: * @param overflowX defines, whether text can overflow the box boundaries or null, to leave this property undefined.
1441: */
1442: public void setOverflowX(final Boolean overflowX) {
1443: this .overflowX = overflowX;
1444: }
1445:
1446: /**
1447: * Returns whether the layouter will try to avoid to generate pagebreaks inside this element. If the element does not
1448: * fit on the current page, it will be moved to the next page. Only if this next page does not have enough space to
1449: * hold this element, a pagebreak will be generated inside the element.
1450: *
1451: * @return a boolean defining whether pagebreaks are allowed inside the box or null, if this property has been left
1452: * undefined.
1453: */
1454: public Boolean getAvoidPagebreaks() {
1455: return avoidPagebreaks;
1456: }
1457:
1458: /**
1459: * Defines whether the layouter will try to avoid to generate pagebreaks inside this element. If the element does not
1460: * fit on the current page, it will be moved to the next page. Only if this next page does not have enough space to
1461: * hold this element, a pagebreak will be generated inside the element.
1462: *
1463: * @param avoidPagebreaks a boolean defining whether pagebreaks are allowed inside the box or null, if this property
1464: * should be left undefined.
1465: */
1466: public void setAvoidPagebreaks(final Boolean avoidPagebreaks) {
1467: this .avoidPagebreaks = avoidPagebreaks;
1468: }
1469:
1470: /**
1471: * Returns the link target for this element. The link-target usually specifies the URL for a hyper-link.
1472: *
1473: * @return the link target.
1474: */
1475: public String getHRefTarget() {
1476: return hRefTarget;
1477: }
1478:
1479: /**
1480: * Defines the link target for the element. The link-target usually specifies the URL for a hyper-link.
1481: *
1482: * @param hRefTarget the link target.
1483: */
1484: public void setHRefTarget(final String hRefTarget) {
1485: this .hRefTarget = hRefTarget;
1486: }
1487:
1488: /**
1489: * Returns the name of the new element.
1490: *
1491: * @return the name of the element.
1492: */
1493: public String getName() {
1494: return name;
1495: }
1496:
1497: /**
1498: * Defines the name of the element. If the name is null, the default (anonymous) name will be used.
1499: *
1500: * @param name the element name.
1501: */
1502: public void setName(final String name) {
1503: this .name = name;
1504: }
1505:
1506: /**
1507: * Returns the element's minimum size.
1508: *
1509: * @return the element's minimum size.
1510: * @see ElementFactory#getMinimumWidth()
1511: * @see ElementFactory#getMinimumHeight()
1512: */
1513: public Dimension2D getMinimumSize() {
1514: if (minimumWidth == null && minimumHeight == null) {
1515: return null;
1516: }
1517: if (minimumWidth == null) {
1518: return new FloatDimension(0, minimumHeight.floatValue());
1519: }
1520: if (minimumHeight == null) {
1521: return new FloatDimension(minimumWidth.floatValue(), 0);
1522: }
1523: return new FloatDimension(minimumWidth.floatValue(),
1524: minimumHeight.floatValue());
1525: }
1526:
1527: /**
1528: * Defines the element's minimum size.
1529: *
1530: * @param minimumSize the element's minimum size.
1531: * @see ElementFactory#setMinimumWidth(Float)
1532: * @see ElementFactory#setMinimumHeight(Float)
1533: */
1534: public void setMinimumSize(final Dimension2D minimumSize) {
1535: if (minimumSize == null) {
1536: this .minimumWidth = null;
1537: this .minimumHeight = null;
1538: } else {
1539: this .minimumWidth = new Float(minimumSize.getWidth());
1540: this .minimumHeight = new Float(minimumSize.getHeight());
1541: }
1542: }
1543:
1544: /**
1545: * Returns the element's maximum size.
1546: *
1547: * @return the element's maximum size.
1548: * @see ElementFactory#getMinimumWidth()
1549: * @see ElementFactory#getMinimumHeight()
1550: */
1551: public Dimension2D getMaximumSize() {
1552: if (maximumWidth == null && maximumHeight == null) {
1553: return null;
1554: }
1555: if (maximumWidth == null) {
1556: return new FloatDimension(0, maximumHeight.floatValue());
1557: }
1558: if (maximumHeight == null) {
1559: return new FloatDimension(maximumWidth.floatValue(), 0);
1560: }
1561: return new FloatDimension(maximumWidth.floatValue(),
1562: maximumHeight.floatValue());
1563: }
1564:
1565: /**
1566: * Defines the element's maximum size.
1567: *
1568: * @param maximumSize the element's maximum size.
1569: * @see ElementFactory#setMaximumWidth(Float)
1570: * @see ElementFactory#setMaximumHeight(Float)
1571: */
1572: public void setMaximumSize(final Dimension2D maximumSize) {
1573: if (maximumSize == null) {
1574: this .maximumWidth = null;
1575: this .maximumHeight = null;
1576: } else {
1577: this .maximumWidth = new Float(maximumSize.getWidth());
1578: this .maximumHeight = new Float(maximumSize.getHeight());
1579: }
1580: }
1581:
1582: /**
1583: * Returns the element's preferred size.
1584: *
1585: * @return the element's preferred size.
1586: * @see ElementFactory#getWidth()
1587: * @see ElementFactory#getHeight()
1588: */
1589: public Dimension2D getPreferredSize() {
1590: if (width == null && height == null) {
1591: return null;
1592: }
1593: if (width == null) {
1594: return new FloatDimension(0, height.floatValue());
1595: }
1596: if (height == null) {
1597: return new FloatDimension(width.floatValue(), 0);
1598: }
1599: return new FloatDimension(width.floatValue(), height
1600: .floatValue());
1601: }
1602:
1603: /**
1604: * Returns the element's preferred size.
1605: *
1606: * @param preferredSize the element's preferred size.
1607: * @see ElementFactory#setWidth(Float)
1608: * @see ElementFactory#setHeight(Float)
1609: */
1610: public void setPreferredSize(final Dimension2D preferredSize) {
1611: if (preferredSize == null) {
1612: this .width = null;
1613: this .height = null;
1614: } else {
1615: this .width = new Float(preferredSize.getWidth());
1616: this .height = new Float(preferredSize.getHeight());
1617: }
1618: }
1619:
1620: /**
1621: * Returns the element's absolute position. This property is only used if the band containing this element uses a
1622: * canvas-layout strategy.
1623: *
1624: * @return the element's absolute position.
1625: * @see ElementFactory#getX()
1626: * @see ElementFactory#getY()
1627: */
1628: public Point2D getAbsolutePosition() {
1629: if (x == null && y == null) {
1630: return null;
1631: }
1632: if (x == null) {
1633: return new Point2D.Float(0, y.floatValue());
1634: }
1635: if (y == null) {
1636: return new Point2D.Float(x.floatValue(), 0);
1637: }
1638: return new Point2D.Float(x.floatValue(), y.floatValue());
1639: }
1640:
1641: /**
1642: * Returns the element's absolute position. This property is only used if the band containing this element uses a
1643: * canvas-layout strategy.
1644: *
1645: * @param absolutePosition the element's absolute position.
1646: * @see ElementFactory#setX(Float)
1647: * @see ElementFactory#setY(Float)
1648: */
1649: public void setAbsolutePosition(final Point2D absolutePosition) {
1650: if (absolutePosition == null) {
1651: this .x = null;
1652: this .y = null;
1653: } else {
1654: this .x = new Float(absolutePosition.getX());
1655: this .y = new Float(absolutePosition.getY());
1656: }
1657: }
1658:
1659: /**
1660: * Returns whether the element's height should be adjusted automaticly.
1661: *
1662: * @return the state of the dynamic feature or null, if the feature is undefined.
1663: */
1664: public Boolean getDynamicHeight() {
1665: return dynamicHeight;
1666: }
1667:
1668: /**
1669: * Defines whether the element's height should be adjusted automaticly.
1670: *
1671: * @param dynamicHeight the new value of the elements dynamic height feature.
1672: */
1673: public void setDynamicHeight(final Boolean dynamicHeight) {
1674: this .dynamicHeight = dynamicHeight;
1675: }
1676:
1677: /**
1678: * Returns, whether the layout for the element is cachable. If you intend to modify the element's properties from
1679: * within a function, you should mark the element as non-cachable, or the layout may look funny.
1680: * <p/>
1681: * This property is no longer used. This method will be removed in version 1.0.
1682: *
1683: * @return the layout-cachable flag.
1684: * @deprecated The layout cachable flag is no longer used.
1685: */
1686: public Boolean getLayoutCachable() {
1687: return null;
1688: }
1689:
1690: /**
1691: * Returns, whether the layout for the element is cachable. If you intend to modify the element's properties from
1692: * within a function, you should mark the element as non-cachable, or the layout may look funny. Set this value to
1693: * <code>null</code> if this value should be inherited from the parent.
1694: * <p/>
1695: * This property is no longer used. This method will be removed in version 1.0.
1696: *
1697: * @param layoutCachable the layout-cachable flag.
1698: * @deprecated The layout cachable flag is no longer used.
1699: */
1700: public void setLayoutCachable(final Boolean layoutCachable) {
1701: // does nothing.
1702: }
1703:
1704: /**
1705: * Returns, whether the element will be visible.
1706: *
1707: * @return the visibility of the element.
1708: */
1709: public Boolean getVisible() {
1710: return visible;
1711: }
1712:
1713: /**
1714: * Defines, whether the element will be visible.
1715: *
1716: * @param visible the visibility flag of the element.
1717: */
1718: public void setVisible(final Boolean visible) {
1719: this .visible = visible;
1720: }
1721:
1722: /**
1723: * Applies the defined name to the created element.
1724: *
1725: * @param e the element which was created.
1726: */
1727: protected void applyElementName(final Element e) {
1728: if (getName() != null) {
1729: e.setName(getName());
1730: }
1731: }
1732:
1733: /**
1734: * Returns the 'window' parameter for hyperlink references. This property will only make sense in HTML-exports, as all
1735: * other export targets that support Hyperlinks will open up in a new window anyway.
1736: *
1737: * @return the href-window string.
1738: */
1739: public String getHRefWindow() {
1740: return hRefWindow;
1741: }
1742:
1743: /**
1744: * Defines the 'window' parameter for hyperlink references. This property will only make sense in HTML-exports, as all
1745: * other export targets that support Hyperlinks will open up in a new window anyway.
1746: *
1747: * @param hRefWindow the href-window string.
1748: */
1749: public void setHRefWindow(final String hRefWindow) {
1750: this .hRefWindow = hRefWindow;
1751: }
1752:
1753: /**
1754: * Returns the elements minimum width. A number between 0 and -100 specifies the width as relative size given in
1755: * percent of the parent's width or height (depending on the layout model of the band that contains this element).
1756: *
1757: * @return the minimum width or null, if no minimum width is defined.
1758: */
1759: public Float getMinimumWidth() {
1760: return minimumWidth;
1761: }
1762:
1763: /**
1764: * Defines the elements minimum width. A number between 0 and -100 specifies the width as relative size given in
1765: * percent of the parent's width or height (depending on the layout model of the band that contains this element).
1766: *
1767: * @param minimumWidth the minimum width or null, to leave this property undefined.
1768: */
1769: public void setMinimumWidth(final Float minimumWidth) {
1770: this .minimumWidth = minimumWidth;
1771: }
1772:
1773: /**
1774: * Returns the elements minimum height. A number between 0 and -100 specifies the width as relative size given in
1775: * percent of the parent's width or height (depending on the layout model of the band that contains this element).
1776: *
1777: * @return the minimum height or null, if no minimum height is defined.
1778: */
1779: public Float getMinimumHeight() {
1780: return minimumHeight;
1781: }
1782:
1783: /**
1784: * Defines the elements minimum height. A number between 0 and -100 specifies the width as relative size given in
1785: * percent of the parent's width or height (depending on the layout model of the band that contains this element).
1786: *
1787: * @param minimumHeight the minimum height or null, to leave this property undefined.
1788: */
1789: public void setMinimumHeight(final Float minimumHeight) {
1790: this .minimumHeight = minimumHeight;
1791: }
1792:
1793: /**
1794: * Returns the elements maximum width. The maximum width cannot have relative values.
1795: *
1796: * @return the maximum width or null, if no maximum width is defined.
1797: */
1798: public Float getMaximumWidth() {
1799: return maximumWidth;
1800: }
1801:
1802: /**
1803: * Defines the elements maximum width. The maximum width cannot have relative values.
1804: *
1805: * @param maximumWidth the maximum width or null, if no maximum width should be defined.
1806: */
1807: public void setMaximumWidth(final Float maximumWidth) {
1808: this .maximumWidth = maximumWidth;
1809: }
1810:
1811: /**
1812: * Returns the elements maximum height. The maximum height cannot have relative values.
1813: *
1814: * @return the maximum height or null, if no maximum height is defined.
1815: */
1816: public Float getMaximumHeight() {
1817: return maximumHeight;
1818: }
1819:
1820: /**
1821: * Defines the elements maximum height. The maximum height cannot have relative values.
1822: *
1823: * @param maximumHeight the maximum width or null, if no maximum height should be defined.
1824: */
1825: public void setMaximumHeight(final Float maximumHeight) {
1826: this .maximumHeight = maximumHeight;
1827: }
1828:
1829: /**
1830: * Returns the elements defined preferred width. A number between 0 and -100 specifies the width as relative size
1831: * given in percent of the parent's width or height (depending on the layout model of the band that contains this
1832: * element).
1833: *
1834: * @return the preferred width or null, if left undefined.
1835: */
1836: public Float getWidth() {
1837: return width;
1838: }
1839:
1840: /**
1841: * Defines the elements preferred width. A number between 0 and -100 specifies the width as relative size given in
1842: * percent of the parent's width or height (depending on the layout model of the band that contains this element).
1843: *
1844: * @param width the preferred width or null, if left undefined.
1845: */
1846: public void setWidth(final Float width) {
1847: this .width = width;
1848: }
1849:
1850: /**
1851: * Returns the elements defined preferred height. A number between 0 and -100 specifies the width as relative size
1852: * given in percent of the parent's width or height (depending on the layout model of the band that contains this
1853: * element).
1854: *
1855: * @return the preferred height or null, if left undefined.
1856: */
1857: public Float getHeight() {
1858: return height;
1859: }
1860:
1861: /**
1862: * Defines the elements preferred height. A number between 0 and -100 specifies the width as relative size given in
1863: * percent of the parent's width or height (depending on the layout model of the band that contains this element).
1864: *
1865: * @param height the preferred height or null, if left undefined.
1866: */
1867: public void setHeight(final Float height) {
1868: this .height = height;
1869: }
1870:
1871: /**
1872: * Returns the elements defined absolute horizontal position for the canvas-layout. The position is relative to the
1873: * parents upper left corner of the content-area. A number between 0 and -100 specifies the width as relative size
1874: * given in percent of the parent's width or height (depending on the layout model of the band that contains this
1875: * element).
1876: *
1877: * @return the elements horizontal position or null, if not defined.
1878: */
1879: public Float getX() {
1880: return x;
1881: }
1882:
1883: /**
1884: * Defines the elements absolute horizontal position for the canvas-layout. The position is relative to the parents
1885: * upper left corner of the content-area. A number between 0 and -100 specifies the width as relative size given in
1886: * percent of the parent's width or height (depending on the layout model of the band that contains this element).
1887: *
1888: * @param x the elements horizontal position or null, if not defined.
1889: */
1890: public void setX(final Float x) {
1891: this .x = x;
1892: }
1893:
1894: /**
1895: * Returns the elements defined absolute vertical position for the canvas-layout. The position is relative to the
1896: * parents upper left corner of the content-area. A number between 0 and -100 specifies the width as relative size
1897: * given in percent of the parent's width or height (depending on the layout model of the band that contains this
1898: * element).
1899: *
1900: * @return the elements vertical position or null, if not defined.
1901: */
1902: public Float getY() {
1903: return y;
1904: }
1905:
1906: /**
1907: * Defines the elements absolute vertical position for the canvas-layout. The position is relative to the parents
1908: * upper left corner of the content-area. A number between 0 and -100 specifies the width as relative size given in
1909: * percent of the parent's width or height (depending on the layout model of the band that contains this element).
1910: *
1911: * @param y the elements vertical position or null, if not defined.
1912: */
1913: public void setY(final Float y) {
1914: this .y = y;
1915: }
1916:
1917: /**
1918: * Returns the defined HREF-Title. This title is only valid during the HTML export.
1919: *
1920: * @return the href-title as string.
1921: */
1922: public String getHRefTitle() {
1923: return hRefTitle;
1924: }
1925:
1926: /**
1927: * Defines the defined HREF-Title. This title is only valid during the HTML export.
1928: *
1929: * @param hRefTitle the href-title as string.
1930: */
1931: public void setHRefTitle(final String hRefTitle) {
1932: this .hRefTitle = hRefTitle;
1933: }
1934:
1935: /**
1936: * Applies the style definition to the elements stylesheet.
1937: *
1938: * @param style the element stylesheet which should receive the style definition.
1939: */
1940: protected void applyStyle(final ElementStyleSheet style) {
1941: style.setStyleProperty(ElementStyleKeys.POS_X, getX());
1942: style.setStyleProperty(ElementStyleKeys.POS_Y, getY());
1943: style.setStyleProperty(ElementStyleKeys.DYNAMIC_HEIGHT,
1944: getDynamicHeight());
1945: style.setStyleProperty(ElementStyleKeys.MAX_WIDTH,
1946: getMaximumWidth());
1947: style.setStyleProperty(ElementStyleKeys.MAX_HEIGHT,
1948: getMaximumHeight());
1949: style.setStyleProperty(ElementStyleKeys.MIN_WIDTH,
1950: getMinimumWidth());
1951: style.setStyleProperty(ElementStyleKeys.MIN_HEIGHT,
1952: getMinimumHeight());
1953: style.setStyleProperty(ElementStyleKeys.WIDTH, getWidth());
1954: style.setStyleProperty(ElementStyleKeys.HEIGHT, getHeight());
1955: style.setStyleProperty(ElementStyleKeys.VISIBLE, getVisible());
1956: style.setStyleProperty(ElementStyleKeys.HREF_TARGET,
1957: getHRefTarget());
1958: style.setStyleProperty(ElementStyleKeys.HREF_WINDOW,
1959: getHRefWindow());
1960: style.setStyleProperty(ElementStyleKeys.HREF_TITLE,
1961: getHRefTitle());
1962:
1963: style.setStyleProperty(ElementStyleKeys.BORDER_TOP_COLOR,
1964: getBorderColor());
1965: style.setStyleProperty(ElementStyleKeys.BORDER_LEFT_COLOR,
1966: getBorderColor());
1967: style.setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_COLOR,
1968: getBorderColor());
1969: style.setStyleProperty(ElementStyleKeys.BORDER_RIGHT_COLOR,
1970: getBorderColor());
1971: style.setStyleProperty(ElementStyleKeys.BORDER_BREAK_COLOR,
1972: getBorderColor());
1973:
1974: style.setStyleProperty(ElementStyleKeys.BORDER_TOP_WIDTH,
1975: getBorderWidth());
1976: style.setStyleProperty(ElementStyleKeys.BORDER_LEFT_WIDTH,
1977: getBorderWidth());
1978: style.setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_WIDTH,
1979: getBorderWidth());
1980: style.setStyleProperty(ElementStyleKeys.BORDER_RIGHT_WIDTH,
1981: getBorderWidth());
1982: style.setStyleProperty(ElementStyleKeys.BORDER_BREAK_WIDTH,
1983: getBorderWidth());
1984: style.setStyleProperty(ElementStyleKeys.BORDER_TOP_STYLE,
1985: getBorderStyle());
1986: style.setStyleProperty(ElementStyleKeys.BORDER_LEFT_STYLE,
1987: getBorderStyle());
1988: style.setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_STYLE,
1989: getBorderStyle());
1990: style.setStyleProperty(ElementStyleKeys.BORDER_RIGHT_STYLE,
1991: getBorderStyle());
1992: style.setStyleProperty(ElementStyleKeys.BORDER_BREAK_STYLE,
1993: getBorderStyle());
1994: style.setStyleProperty(ElementStyleKeys.PADDING_TOP,
1995: getPadding());
1996: style.setStyleProperty(ElementStyleKeys.PADDING_LEFT,
1997: getPadding());
1998: style.setStyleProperty(ElementStyleKeys.PADDING_BOTTOM,
1999: getPadding());
2000: style.setStyleProperty(ElementStyleKeys.PADDING_RIGHT,
2001: getPadding());
2002:
2003: if (borderTopColor != null) {
2004: style.setStyleProperty(ElementStyleKeys.BORDER_TOP_COLOR,
2005: getBorderTopColor());
2006: }
2007: if (borderLeftColor != null) {
2008: style.setStyleProperty(ElementStyleKeys.BORDER_LEFT_COLOR,
2009: getBorderLeftColor());
2010: }
2011: if (borderBottomColor != null) {
2012: style.setStyleProperty(
2013: ElementStyleKeys.BORDER_BOTTOM_COLOR,
2014: getBorderBottomColor());
2015: }
2016: if (borderRightColor != null) {
2017: style.setStyleProperty(ElementStyleKeys.BORDER_RIGHT_COLOR,
2018: getBorderRightColor());
2019: }
2020: if (borderBreakColor != null) {
2021: style.setStyleProperty(ElementStyleKeys.BORDER_BREAK_COLOR,
2022: getBorderBreakColor());
2023: }
2024: if (borderTopWidth != null) {
2025: style.setStyleProperty(ElementStyleKeys.BORDER_TOP_WIDTH,
2026: getBorderTopWidth());
2027: }
2028: if (borderLeftWidth != null) {
2029: style.setStyleProperty(ElementStyleKeys.BORDER_LEFT_WIDTH,
2030: getBorderLeftWidth());
2031: }
2032: if (borderBottomWidth != null) {
2033: style.setStyleProperty(
2034: ElementStyleKeys.BORDER_BOTTOM_WIDTH,
2035: getBorderBottomWidth());
2036: }
2037: if (borderRightWidth != null) {
2038: style.setStyleProperty(ElementStyleKeys.BORDER_RIGHT_WIDTH,
2039: getBorderRightWidth());
2040: }
2041: if (borderBreakWidth != null) {
2042: style.setStyleProperty(ElementStyleKeys.BORDER_BREAK_WIDTH,
2043: getBorderBreakWidth());
2044: }
2045: if (borderTopStyle != null) {
2046: style.setStyleProperty(ElementStyleKeys.BORDER_TOP_STYLE,
2047: getBorderTopStyle());
2048: }
2049: if (borderLeftStyle != null) {
2050: style.setStyleProperty(ElementStyleKeys.BORDER_LEFT_STYLE,
2051: getBorderLeftStyle());
2052: }
2053: if (borderBottomStyle != null) {
2054: style.setStyleProperty(
2055: ElementStyleKeys.BORDER_BOTTOM_STYLE,
2056: getBorderBottomStyle());
2057: }
2058: if (borderRightStyle != null) {
2059: style.setStyleProperty(ElementStyleKeys.BORDER_RIGHT_STYLE,
2060: getBorderRightStyle());
2061: }
2062: if (borderBreakStyle != null) {
2063: style.setStyleProperty(ElementStyleKeys.BORDER_BREAK_STYLE,
2064: getBorderBreakStyle());
2065: }
2066: if (paddingTop != null) {
2067: style.setStyleProperty(ElementStyleKeys.PADDING_TOP,
2068: getPaddingTop());
2069: }
2070: if (paddingLeft != null) {
2071: style.setStyleProperty(ElementStyleKeys.PADDING_LEFT,
2072: getPaddingLeft());
2073: }
2074: if (paddingBottom != null) {
2075: style.setStyleProperty(ElementStyleKeys.PADDING_BOTTOM,
2076: getPaddingBottom());
2077: }
2078: if (paddingRight != null) {
2079: style.setStyleProperty(ElementStyleKeys.PADDING_RIGHT,
2080: getPaddingRight());
2081: }
2082:
2083: style.setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR,
2084: getBackgroundColor());
2085: style.setStyleProperty(ElementStyleKeys.AVOID_PAGEBREAK_INSIDE,
2086: getAvoidPagebreaks());
2087: style.setStyleProperty(ElementStyleKeys.ORPHANS, getOrphans());
2088: style.setStyleProperty(ElementStyleKeys.WIDOWS, getWidows());
2089: style.setStyleProperty(ElementStyleKeys.OVERFLOW_X,
2090: getOverflowX());
2091: style.setStyleProperty(ElementStyleKeys.OVERFLOW_Y,
2092: getOverflowY());
2093: style.setStyleProperty(TextStyleKeys.FONT_SMOOTH,
2094: getFontSmooth());
2095: style.setStyleProperty(ElementStyleKeys.ALIGNMENT,
2096: getHorizontalAlignment());
2097: style.setStyleProperty(ElementStyleKeys.VALIGNMENT,
2098: getVerticalAlignment());
2099: style.setStyleProperty(ElementStyleKeys.PAINT, getColor());
2100:
2101: style.setStyleProperty(
2102: ElementStyleKeys.BORDER_TOP_LEFT_RADIUS_WIDTH,
2103: getBorderRadiusWidth());
2104: style.setStyleProperty(
2105: ElementStyleKeys.BORDER_TOP_LEFT_RADIUS_HEIGHT,
2106: getBorderRadiusHeight());
2107: style.setStyleProperty(
2108: ElementStyleKeys.BORDER_TOP_RIGHT_RADIUS_WIDTH,
2109: getBorderRadiusWidth());
2110: style.setStyleProperty(
2111: ElementStyleKeys.BORDER_TOP_RIGHT_RADIUS_HEIGHT,
2112: getBorderRadiusHeight());
2113: style.setStyleProperty(
2114: ElementStyleKeys.BORDER_BOTTOM_LEFT_RADIUS_WIDTH,
2115: getBorderRadiusWidth());
2116: style.setStyleProperty(
2117: ElementStyleKeys.BORDER_BOTTOM_LEFT_RADIUS_HEIGHT,
2118: getBorderRadiusHeight());
2119: style.setStyleProperty(
2120: ElementStyleKeys.BORDER_BOTTOM_RIGHT_RADIUS_WIDTH,
2121: getBorderRadiusWidth());
2122: style.setStyleProperty(
2123: ElementStyleKeys.BORDER_BOTTOM_RIGHT_RADIUS_HEIGHT,
2124: getBorderRadiusHeight());
2125:
2126: if (borderTopLeftRadiusWidth != null) {
2127: style.setStyleProperty(
2128: ElementStyleKeys.BORDER_TOP_LEFT_RADIUS_WIDTH,
2129: getBorderTopLeftRadiusWidth());
2130: }
2131: if (borderTopLeftRadiusHeight != null) {
2132: style.setStyleProperty(
2133: ElementStyleKeys.BORDER_TOP_LEFT_RADIUS_HEIGHT,
2134: getBorderTopLeftRadiusHeight());
2135: }
2136: if (borderTopRightRadiusWidth != null) {
2137: style.setStyleProperty(
2138: ElementStyleKeys.BORDER_TOP_RIGHT_RADIUS_WIDTH,
2139: getBorderTopRightRadiusWidth());
2140: }
2141: if (borderTopRightRadiusHeight != null) {
2142: style.setStyleProperty(
2143: ElementStyleKeys.BORDER_TOP_RIGHT_RADIUS_HEIGHT,
2144: getBorderTopRightRadiusHeight());
2145: }
2146: if (borderBottomLeftRadiusWidth != null) {
2147: style.setStyleProperty(
2148: ElementStyleKeys.BORDER_BOTTOM_LEFT_RADIUS_WIDTH,
2149: getBorderBottomLeftRadiusWidth());
2150: }
2151: if (borderBottomLeftRadiusHeight != null) {
2152: style.setStyleProperty(
2153: ElementStyleKeys.BORDER_BOTTOM_LEFT_RADIUS_HEIGHT,
2154: getBorderBottomLeftRadiusHeight());
2155: }
2156: if (borderBottomRightRadiusWidth != null) {
2157: style.setStyleProperty(
2158: ElementStyleKeys.BORDER_BOTTOM_RIGHT_RADIUS_WIDTH,
2159: getBorderBottomRightRadiusWidth());
2160: }
2161: if (borderBottomRightRadiusHeight != null) {
2162: style.setStyleProperty(
2163: ElementStyleKeys.BORDER_BOTTOM_RIGHT_RADIUS_HEIGHT,
2164: getBorderBottomRightRadiusHeight());
2165: }
2166: }
2167:
2168: /**
2169: * Creates a new instance of the element. Override this method to return a concrete subclass of the element.
2170: *
2171: * @return the newly generated instance of the element.
2172: */
2173: public abstract Element createElement();
2174:
2175: /**
2176: * Converts the given primitive boolean into a Boolean object.
2177: *
2178: * @param b the primitive value.
2179: * @return Boolean.TRUE or Boolean.FALSE.
2180: */
2181: protected static Boolean getBooleanValue(final boolean b) {
2182: if (b) {
2183: return Boolean.TRUE;
2184: }
2185: return Boolean.FALSE;
2186: }
2187: }
|