1 51 package org.apache.fop.datatypes; 52 53 import org.apache.fop.fo.Property; 54 55 58 public class Keep implements CompoundDatatype { 59 private Property withinLine; 60 private Property withinColumn; 61 private Property withinPage; 62 63 public Keep() {} 64 65 public void setComponent(String sCmpnName, Property cmpnValue, 67 boolean bIsDefault) { 68 if (sCmpnName.equals("within-line")) 69 setWithinLine(cmpnValue, bIsDefault); 70 else if (sCmpnName.equals("within-column")) 71 setWithinColumn(cmpnValue, bIsDefault); 72 else if (sCmpnName.equals("within-page")) 73 setWithinPage(cmpnValue, bIsDefault); 74 } 75 76 public Property getComponent(String sCmpnName) { 78 if (sCmpnName.equals("within-line")) 79 return getWithinLine(); 80 else if (sCmpnName.equals("within-column")) 81 return getWithinColumn(); 82 else if (sCmpnName.equals("within-page")) 83 return getWithinPage(); 84 else 85 return null; 86 } 87 88 public void setWithinLine(Property withinLine, boolean bIsDefault) { 89 this.withinLine = withinLine; 90 } 91 92 protected void setWithinColumn(Property withinColumn, 93 boolean bIsDefault) { 94 this.withinColumn = withinColumn; 95 } 96 97 public void setWithinPage(Property withinPage, boolean bIsDefault) { 98 this.withinPage = withinPage; 99 } 100 101 public Property getWithinLine() { 102 return this.withinLine; 103 } 104 105 public Property getWithinColumn() { 106 return this.withinColumn; 107 } 108 109 public Property getWithinPage() { 110 return this.withinPage; 111 } 112 113 116 public String toString() { 117 return "Keep"; 118 } 119 120 } 121 | Popular Tags |