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: * DefaultExtendedBaselineInfo.java
027: * ------------
028: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
029: */package org.jfree.report.layout.text;
030:
031: /**
032: * Creation-Date: 24.07.2006, 17:35:25
033: *
034: * @author Thomas Morgner
035: */
036: public final class DefaultExtendedBaselineInfo implements
037: ExtendedBaselineInfo {
038: private long[] baselines;
039: private int dominantBaseline;
040: private long underlinePosition;
041: private long strikethroughPosition;
042:
043: public DefaultExtendedBaselineInfo(final int dominantBaseline,
044: final long[] baselines, final long underlinePosition,
045: final long strikethroughPosition) {
046: this .strikethroughPosition = strikethroughPosition;
047: this .underlinePosition = underlinePosition;
048: this .baselines = baselines;
049: this .dominantBaseline = dominantBaseline;
050: }
051:
052: public long getUnderlinePosition() {
053: return underlinePosition;
054: }
055:
056: public long getStrikethroughPosition() {
057: return strikethroughPosition;
058: }
059:
060: public int getDominantBaseline() {
061: return dominantBaseline;
062: }
063:
064: public long[] getBaselines() {
065: return baselines;
066: }
067:
068: // public void setBaselines(final long[] baselines)
069: // {
070: // if (baselines.length != ExtendedBaselineInfo.BASELINE_COUNT)
071: // {
072: // throw new IllegalArgumentException();
073: // }
074: // System.arraycopy(baselines, 0, this.baselines, 0, ExtendedBaselineInfo.BASELINE_COUNT);
075: // }
076:
077: public long getBaseline(final int baseline) {
078: return baselines[baseline];
079: }
080:
081: public String toString() {
082: final StringBuffer b = new StringBuffer();
083: b.append("DefaultExtendedBaselineInfo{");
084: final int length = baselines.length;
085: for (int i = 0; i < length; i++) {
086: if (i > 0) {
087: b.append(", ");
088: }
089: b.append("baselines[");
090: b.append(String.valueOf(i));
091: b.append("]=");
092: b.append(baselines[i]);
093:
094: }
095: b.append(", dominantBaseline=");
096: b.append(dominantBaseline);
097: b.append('}');
098: return b.toString();
099: }
100: }
|