1 17 18 19 20 package org.apache.fop.layoutmgr; 21 22 48 public class KnuthGlue extends KnuthElement { 49 50 private int stretchability; 51 private int shrinkability; 52 private int adjustmentClass = -1; 53 54 63 public KnuthGlue(int w, int y, int z, Position pos, boolean bAux) { 64 super(w, pos, bAux); 65 stretchability = y; 66 shrinkability = z; 67 } 68 69 public KnuthGlue(int w, int y, int z, 70 int iAdjClass, Position pos, boolean bAux) { 71 super(w, pos, bAux); 72 stretchability = y; 73 shrinkability = z; 74 adjustmentClass = iAdjClass; 75 } 76 77 78 public boolean isGlue() { 79 return true; 80 } 81 82 83 public int getY() { 84 return stretchability; 85 } 86 87 88 public int getZ() { 89 return shrinkability; 90 } 91 92 93 public int getAdjustmentClass() { 94 return adjustmentClass; 95 } 96 97 98 public String toString() { 99 StringBuffer sb = new StringBuffer (64); 100 if (isAuxiliary()) { 101 sb.append("aux. "); 102 } 103 sb.append("glue"); 104 sb.append(" w=").append(getW()); 105 sb.append(" stretch=").append(getY()); 106 sb.append(" shrink=").append(getZ()); 107 if (getAdjustmentClass() >= 0) { 108 sb.append(" adj-class=").append(getAdjustmentClass()); 109 } 110 return sb.toString(); 111 } 112 113 } 114 | Popular Tags |