--- /dev/null
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.layoutmgr.table;
+
+/**
+ * Represents a non-dividable part of a grid unit. Used by the table stepper.
+ */
+class GridUnitPart {
+
+ /** Primary grid unit */
+ protected PrimaryGridUnit pgu;
+ /** Index of the starting element of this part */
+ protected int start;
+ /** Index of the ending element of this part */
+ protected int end;
+
+ /**
+ * Creates a new GridUnitPart.
+ * @param pgu Primary grid unit
+ * @param start starting element
+ * @param end ending element
+ */
+ protected GridUnitPart(PrimaryGridUnit pgu, int start, int end) {
+ this.pgu = pgu;
+ this.start = start;
+ this.end = end;
+ }
+
+ /** @return true if this part is the first part of a cell */
+ public boolean isFirstPart() {
+ return (start == 0);
+ }
+
+ /** @return true if this part is the last part of a cell */
+ public boolean isLastPart() {
+ return (end >= 0 && end == pgu.getElements().size() - 1);
+ }
+
+ /** @see java.lang.Object#toString() */
+ public String toString() {
+ StringBuffer sb = new StringBuffer("Part: ");
+ sb.append(start).append("-").append(end);
+ sb.append(" [").append(isFirstPart() ? "F" : "-").append(isLastPart() ? "L" : "-");
+ sb.append("] ").append(pgu);
+ return sb.toString();
+ }
+
+}
import org.apache.fop.layoutmgr.KnuthPossPosIter;
import org.apache.fop.layoutmgr.LayoutContext;
import org.apache.fop.layoutmgr.SpaceResolver;
-import org.apache.fop.layoutmgr.table.TableContentLayoutManager.GridUnitPart;
-import org.apache.fop.layoutmgr.table.TableContentLayoutManager.TableContentPosition;
class RowPainter {
private static Log log = LogFactory.getLog(RowPainter.class);
import org.apache.fop.layoutmgr.KnuthPenalty;
import org.apache.fop.layoutmgr.KnuthPossPosIter;
import org.apache.fop.layoutmgr.LayoutContext;
-import org.apache.fop.layoutmgr.LayoutManager;
import org.apache.fop.layoutmgr.ListElement;
import org.apache.fop.layoutmgr.MinOptMaxUtil;
import org.apache.fop.layoutmgr.Position;
public int getUsedBPD() {
return this.usedBPD;
}
-
- /**
- * Represents a non-dividable part of a grid unit. Used by the table stepper.
- */
- protected static class GridUnitPart {
-
- /** Primary grid unit */
- protected PrimaryGridUnit pgu;
- /** Index of the starting element of this part */
- protected int start;
- /** Index of the ending element of this part */
- protected int end;
-
- /**
- * Creates a new GridUnitPart.
- * @param pgu Primary grid unit
- * @param start starting element
- * @param end ending element
- */
- protected GridUnitPart(PrimaryGridUnit pgu, int start, int end) {
- this.pgu = pgu;
- this.start = start;
- this.end = end;
- }
-
- /** @return true if this part is the first part of a cell */
- public boolean isFirstPart() {
- return (start == 0);
- }
-
- /** @return true if this part is the last part of a cell */
- public boolean isLastPart() {
- return (end >= 0 && end == pgu.getElements().size() - 1);
- }
-
- /** @see java.lang.Object#toString() */
- public String toString() {
- StringBuffer sb = new StringBuffer("Part: ");
- sb.append(start).append("-").append(end);
- sb.append(" [").append(isFirstPart() ? "F" : "-").append(isLastPart() ? "L" : "-");
- sb.append("] ").append(pgu);
- return sb.toString();
- }
-
- }
-
- /**
- * This class represents a Position specific to this layout manager. Used for normal content
- * cases.
- */
- public static class TableContentPosition extends Position {
- /** The position is the first of the row group. */
- public static final int FIRST_IN_ROWGROUP = 1;
- /** The position is the last of the row group. */
- public static final int LAST_IN_ROWGROUP = 2;
-
- /** the list of GridUnitParts making up this position */
- protected List gridUnitParts;
- /** effective row this position belongs to */
- protected EffRow row;
- /** flags for the position */
- protected int flags;
-
- /**
- * Creates a new TableContentPosition.
- * @param lm applicable layout manager
- * @param gridUnitParts the list of GridUnitPart instances
- * @param row effective row this position belongs to
- */
- protected TableContentPosition(LayoutManager lm, List gridUnitParts,
- EffRow row) {
- super(lm);
- this.gridUnitParts = gridUnitParts;
- this.row = row;
- }
-
- /**
- * Returns a flag for this GridUnit.
- * @param which the requested flag
- * @return the value of the flag
- */
- public boolean getFlag(int which) {
- return (flags & (1 << which)) != 0;
- }
-
- /**
- * Sets a flag on a GridUnit.
- * @param which the flag to set
- * @param value the new value for the flag
- */
- public void setFlag(int which, boolean value) {
- if (value) {
- flags |= (1 << which); //set flag
- } else {
- flags &= ~(1 << which); //clear flag
- }
- }
-
- /** @see org.apache.fop.layoutmgr.Position#generatesAreas() */
- public boolean generatesAreas() {
- return true;
- }
-
- /** @see java.lang.Object#toString() */
- public String toString() {
- StringBuffer sb = new StringBuffer("TableContentPosition:");
- sb.append(getIndex());
- sb.append("[");
- sb.append(row.getIndex()).append("/");
- sb.append(getFlag(FIRST_IN_ROWGROUP) ? "F" : "-");
- sb.append(getFlag(LAST_IN_ROWGROUP) ? "L" : "-").append("]");
- sb.append("(");
- sb.append(gridUnitParts);
- sb.append(")");
- return sb.toString();
- }
- }
-
- /**
- * This class represents a Position specific to this layout manager. Used for table
- * headers and footers at the beginning and end of a table.
- */
- public static class TableHeaderFooterPosition extends Position {
-
- /** True indicates a position for a header, false for a footer. */
- protected boolean header;
- /** Element list representing the header/footer */
- protected List nestedElements;
-
- /**
- * Creates a new TableHeaderFooterPosition.
- * @param lm applicable layout manager
- * @param header True indicates a position for a header, false for a footer.
- * @param nestedElements Element list representing the header/footer
- */
- protected TableHeaderFooterPosition(LayoutManager lm,
- boolean header, List nestedElements) {
- super(lm);
- this.header = header;
- this.nestedElements = nestedElements;
- }
-
- /** @see java.lang.Object#toString() */
- public String toString() {
- StringBuffer sb = new StringBuffer("Table");
- sb.append(header ? "Header" : "Footer");
- sb.append("Position:");
- sb.append(getIndex()).append("(");
- sb.append(nestedElements);
- sb.append(")");
- return sb.toString();
- }
- }
-
- /**
- * This class represents a Position specific to this layout manager. Used for table
- * headers and footers at breaks.
- */
- public static class TableHFPenaltyPosition extends Position {
-
- /** Element list for the header */
- protected List headerElements;
- /** Element list for the footer */
- protected List footerElements;
- /** Penalty length to be respected for nested content */
- protected int nestedPenaltyLength;
-
- /**
- * Creates a new TableHFPenaltyPosition
- * @param lm applicable layout manager
- */
- protected TableHFPenaltyPosition(LayoutManager lm) {
- super(lm);
- }
-
- /** @see java.lang.Object#toString() */
- public String toString() {
- StringBuffer sb = new StringBuffer("TableHFPenaltyPosition:");
- sb.append(getIndex()).append("(");
- sb.append("header:");
- sb.append(headerElements);
- sb.append(", footer:");
- sb.append(footerElements);
- sb.append(", inner penalty length:");
- sb.append(nestedPenaltyLength);
- sb.append(")");
- return sb.toString();
- }
- }
-
// --------- Property Resolution related functions --------- //
-
+
/**
* @see org.apache.fop.datatypes.PercentBaseContext#getBaseLength(int, FObj)
*/
--- /dev/null
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.layoutmgr.table;
+
+import java.util.List;
+
+import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.Position;
+
+/**
+ * This class represents a Position specific to TableContentLayoutManager. Used for normal
+ * content cases.
+ */
+class TableContentPosition extends Position {
+
+ /** The position is the first of the row group. */
+ public static final int FIRST_IN_ROWGROUP = 1;
+ /** The position is the last of the row group. */
+ public static final int LAST_IN_ROWGROUP = 2;
+
+ /** the list of GridUnitParts making up this position */
+ protected List gridUnitParts;
+ /** effective row this position belongs to */
+ protected EffRow row;
+ /** flags for the position */
+ protected int flags;
+
+ /**
+ * Creates a new TableContentPosition.
+ * @param lm applicable layout manager
+ * @param gridUnitParts the list of GridUnitPart instances
+ * @param row effective row this position belongs to
+ */
+ protected TableContentPosition(LayoutManager lm, List gridUnitParts,
+ EffRow row) {
+ super(lm);
+ this.gridUnitParts = gridUnitParts;
+ this.row = row;
+ }
+
+ /**
+ * Returns a flag for this GridUnit.
+ * @param which the requested flag
+ * @return the value of the flag
+ */
+ public boolean getFlag(int which) {
+ return (flags & (1 << which)) != 0;
+ }
+
+ /**
+ * Sets a flag on a GridUnit.
+ * @param which the flag to set
+ * @param value the new value for the flag
+ */
+ public void setFlag(int which, boolean value) {
+ if (value) {
+ flags |= (1 << which); //set flag
+ } else {
+ flags &= ~(1 << which); //clear flag
+ }
+ }
+
+ public boolean generatesAreas() {
+ return true;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer("TableContentPosition:");
+ sb.append(getIndex());
+ sb.append("[");
+ sb.append(row.getIndex()).append("/");
+ sb.append(getFlag(FIRST_IN_ROWGROUP) ? "F" : "-");
+ sb.append(getFlag(LAST_IN_ROWGROUP) ? "L" : "-").append("]");
+ sb.append("(");
+ sb.append(gridUnitParts);
+ sb.append(")");
+ return sb.toString();
+ }
+}
--- /dev/null
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.layoutmgr.table;
+
+import java.util.List;
+
+import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.Position;
+
+/**
+ * This class represents a Position specific to TableContentLayoutManager. Used for table
+ * headers and footers at breaks.
+ */
+class TableHFPenaltyPosition extends Position {
+
+ /** Element list for the header */
+ protected List headerElements;
+ /** Element list for the footer */
+ protected List footerElements;
+ /** Penalty length to be respected for nested content */
+ protected int nestedPenaltyLength;
+
+ /**
+ * Creates a new TableHFPenaltyPosition
+ * @param lm applicable layout manager
+ */
+ protected TableHFPenaltyPosition(LayoutManager lm) {
+ super(lm);
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer("TableHFPenaltyPosition:");
+ sb.append(getIndex()).append("(");
+ sb.append("header:");
+ sb.append(headerElements);
+ sb.append(", footer:");
+ sb.append(footerElements);
+ sb.append(", inner penalty length:");
+ sb.append(nestedPenaltyLength);
+ sb.append(")");
+ return sb.toString();
+ }
+}
--- /dev/null
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.layoutmgr.table;
+
+import java.util.List;
+
+import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.Position;
+
+/**
+ * This class represents a Position specific to TableContentLayoutManager. Used for table
+ * headers and footers at the beginning and end of a table.
+ */
+class TableHeaderFooterPosition extends Position {
+
+ /** True indicates a position for a header, false for a footer. */
+ protected boolean header;
+ /** Element list representing the header/footer */
+ protected List nestedElements;
+
+ /**
+ * Creates a new TableHeaderFooterPosition.
+ * @param lm applicable layout manager
+ * @param header True indicates a position for a header, false for a footer.
+ * @param nestedElements Element list representing the header/footer
+ */
+ protected TableHeaderFooterPosition(LayoutManager lm,
+ boolean header, List nestedElements) {
+ super(lm);
+ this.header = header;
+ this.nestedElements = nestedElements;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer("Table");
+ sb.append(header ? "Header" : "Footer");
+ sb.append("Position:");
+ sb.append(getIndex()).append("(");
+ sb.append(nestedElements);
+ sb.append(")");
+ return sb.toString();
+ }
+}
import org.apache.fop.layoutmgr.KnuthElement;
import org.apache.fop.layoutmgr.KnuthPenalty;
import org.apache.fop.layoutmgr.LayoutContext;
-import org.apache.fop.layoutmgr.table.TableContentLayoutManager.GridUnitPart;
-import org.apache.fop.layoutmgr.table.TableContentLayoutManager.TableContentPosition;
-import org.apache.fop.layoutmgr.table.TableContentLayoutManager.TableHFPenaltyPosition;
/**
* This class processes row groups to create combined element lists for tables.