You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TableRow.java 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * $Id$
  3. * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
  4. * For details on use and redistribution please refer to the
  5. * LICENSE file included with these sources.
  6. */
  7. package org.apache.fop.fo.flow;
  8. // FOP
  9. import org.apache.fop.fo.*;
  10. import org.apache.fop.fo.properties.*;
  11. import org.apache.fop.datatypes.*;
  12. import org.apache.fop.layout.*;
  13. import org.apache.fop.apps.FOPException;
  14. import org.apache.fop.layoutmgr.table.Row;
  15. // Java
  16. import java.util.ArrayList;
  17. import java.util.List;
  18. import java.util.Iterator;
  19. public class TableRow extends FObj {
  20. boolean setup = false;
  21. int breakAfter;
  22. ColorType backgroundColor;
  23. KeepValue keepWithNext;
  24. KeepValue keepWithPrevious;
  25. KeepValue keepTogether;
  26. int minHeight = 0; // force row height
  27. public TableRow(FONode parent) {
  28. super(parent);
  29. }
  30. /**
  31. */
  32. public void addLayoutManager(List list) {
  33. Row rlm = new Row(this);
  34. list.add(rlm);
  35. }
  36. public KeepValue getKeepWithPrevious() {
  37. return keepWithPrevious;
  38. }
  39. public void doSetup() {
  40. // Common Accessibility Properties
  41. AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
  42. // this.properties.get("block-progression-dimension");
  43. // Common Aural Properties
  44. AuralProps mAurProps = propMgr.getAuralProps();
  45. // Common Border, Padding, and Background Properties
  46. // only background apply, border apply if border-collapse
  47. // is collapse.
  48. BorderAndPadding bap = propMgr.getBorderAndPadding();
  49. BackgroundProps bProps = propMgr.getBackgroundProps();
  50. // Common Relative Position Properties
  51. RelativePositionProps mRelProps = propMgr.getRelativePositionProps();
  52. // this.properties.get("break-before");
  53. // this.properties.get("break-after");
  54. setupID();
  55. // this.properties.get("height");
  56. // this.properties.get("keep-together");
  57. // this.properties.get("keep-with-next");
  58. // this.properties.get("keep-with-previous");
  59. this.breakAfter = this.properties.get("break-after").getEnum();
  60. this.backgroundColor =
  61. this.properties.get("background-color").getColorType();
  62. this.keepTogether = getKeepValue("keep-together.within-column");
  63. this.keepWithNext = getKeepValue("keep-with-next.within-column");
  64. this.keepWithPrevious =
  65. getKeepValue("keep-with-previous.within-column");
  66. this.minHeight = this.properties.get("height").getLength().mvalue();
  67. setup = true;
  68. }
  69. private KeepValue getKeepValue(String sPropName) {
  70. Property p = this.properties.get(sPropName);
  71. Number n = p.getNumber();
  72. if (n != null) {
  73. return new KeepValue(KeepValue.KEEP_WITH_VALUE, n.intValue());
  74. }
  75. switch (p.getEnum()) {
  76. case Constants.ALWAYS:
  77. return new KeepValue(KeepValue.KEEP_WITH_ALWAYS, 0);
  78. // break;
  79. case Constants.AUTO:
  80. default:
  81. return new KeepValue(KeepValue.KEEP_WITH_AUTO, 0);
  82. // break;
  83. }
  84. }
  85. }