1 17 18 19 20 package org.apache.fop.area.inline; 21 22 import org.apache.fop.fo.Constants; 23 24 28 public class Leader extends InlineArea { 29 30 35 private int ruleStyle = Constants.EN_SOLID; 36 private int ruleThickness = 1000; 37 38 41 public Leader() { 42 } 43 44 49 public void setRuleStyle(int style) { 50 ruleStyle = style; 51 } 52 53 57 public void setRuleStyle(String style) { 58 if ("dotted".equalsIgnoreCase(style)) { 59 setRuleStyle(Constants.EN_DOTTED); 60 } else if ("dashed".equalsIgnoreCase(style)) { 61 setRuleStyle(Constants.EN_DASHED); 62 } else if ("solid".equalsIgnoreCase(style)) { 63 setRuleStyle(Constants.EN_SOLID); 64 } else if ("double".equalsIgnoreCase(style)) { 65 setRuleStyle(Constants.EN_DOUBLE); 66 } else if ("groove".equalsIgnoreCase(style)) { 67 setRuleStyle(Constants.EN_GROOVE); 68 } else if ("ridge".equalsIgnoreCase(style)) { 69 setRuleStyle(Constants.EN_RIDGE); 70 } else if ("none".equalsIgnoreCase(style)) { 71 setRuleStyle(Constants.EN_NONE); 72 } 73 } 74 75 80 public void setRuleThickness(int rt) { 81 ruleThickness = rt; 82 } 83 84 89 public int getRuleStyle() { 90 return ruleStyle; 91 } 92 93 94 public String getRuleStyleAsString() { 95 switch (getRuleStyle()) { 96 case Constants.EN_DOTTED: return "dotted"; 97 case Constants.EN_DASHED: return "dashed"; 98 case Constants.EN_SOLID: return "solid"; 99 case Constants.EN_DOUBLE: return "double"; 100 case Constants.EN_GROOVE: return "groove"; 101 case Constants.EN_RIDGE: return "ridge"; 102 case Constants.EN_NONE: return "none"; 103 default: 104 throw new IllegalStateException ("Unsupported rule style: " + getRuleStyle()); 105 } 106 } 107 108 113 public int getRuleThickness() { 114 return ruleThickness; 115 } 116 117 } 118 119 | Popular Tags |