1 17 18 19 20 package org.apache.fop.layoutmgr; 21 22 public class Position { 23 24 private LayoutManager layoutManager; 25 private int index = -1; 26 27 public Position(LayoutManager lm) { 28 layoutManager = lm; 29 } 30 31 public LayoutManager getLM() { 32 return layoutManager; 33 } 34 35 39 public Position getPosition() { 40 return null; 41 } 42 43 public boolean generatesAreas() { 44 return false; 45 } 46 47 public void setIndex(int value) { 48 this.index = value; 49 } 50 51 public int getIndex() { 52 return this.index; 53 } 54 55 public String getShortLMName() { 56 if (getLM() != null) { 57 String lm = getLM().toString(); 58 int idx = lm.lastIndexOf('.'); 59 if (idx >= 0 && lm.indexOf('@') > 0) { 60 return(lm.substring(idx + 1)); 61 } else { 62 return lm; 63 } 64 } else { 65 return "null"; 66 } 67 } 68 69 70 public String toString() { 71 StringBuffer sb = new StringBuffer (); 72 sb.append("Position:").append(getIndex()).append("("); 73 sb.append(getShortLMName()); 74 sb.append(")"); 75 return sb.toString(); 76 } 77 } 78 79 | Popular Tags |