1 51 package org.apache.fop.layout.inline; 52 53 import org.apache.fop.render.Renderer; 55 import org.apache.fop.layout.*; 56 57 public class ForeignObjectArea extends InlineArea { 58 59 protected int xOffset = 0; 60 61 protected int align; 62 63 protected int valign; 64 65 protected int scaling; 66 protected Area foreignObject; 67 68 protected int cheight; 69 70 protected int cwidth; 71 72 protected int awidth; 73 74 protected int aheight; 75 76 protected int width; 77 boolean wauto; 78 boolean hauto; 79 boolean cwauto; 80 boolean chauto; 81 int overflow; 82 83 public ForeignObjectArea(FontState fontState, int width) { 84 super(fontState, width, 0, 0, 0); 85 } 86 87 public void render(Renderer renderer) { 88 if (foreignObject != null) 89 renderer.renderForeignObjectArea(this); 90 } 91 92 96 public int getContentWidth() { 97 return getEffectiveWidth(); 98 } 99 100 104 public int getHeight() { 105 return getEffectiveHeight(); 106 } 107 108 public int getContentHeight() { 109 return getEffectiveHeight(); 110 } 111 112 public int getXOffset() { 113 return this.xOffset; 114 } 115 116 public void setStartIndent(int startIndent) { 117 xOffset = startIndent; 118 } 119 120 public void setObject(Area fobject) { 121 foreignObject = fobject; 122 } 123 124 public Area getObject() { 125 return foreignObject; 126 } 127 128 public void setSizeAuto(boolean wa, boolean ha) { 129 wauto = wa; 130 hauto = ha; 131 } 132 133 public void setContentSizeAuto(boolean wa, boolean ha) { 134 cwauto = wa; 135 chauto = ha; 136 } 137 138 public boolean isContentWidthAuto() { 139 return cwauto; 140 } 141 142 public boolean isContentHeightAuto() { 143 return chauto; 144 } 145 146 public void setAlign(int align) { 147 this.align = align; 148 } 149 150 public int getAlign() { 151 return this.align; 152 } 153 154 public void setVerticalAlign(int align) { 155 this.valign = align; 156 } 157 158 public int getVerticalAlign() { 159 return this.valign; 160 } 161 162 public void setOverflow(int o) { 163 this.overflow = o; 164 } 165 166 public int getOverflow() { 167 return this.overflow; 168 } 169 170 public void setHeight(int height) { 171 this.height = height; 172 } 173 174 public void setWidth(int width) { 175 this.width = width; 176 } 177 178 public void setContentHeight(int cheight) { 179 this.cheight = cheight; 180 } 181 182 public void setContentWidth(int cwidth) { 183 this.cwidth = cwidth; 184 } 185 186 public void setScaling(int scaling) { 187 this.scaling = scaling; 188 } 189 190 public int scalingMethod() { 191 return this.scaling; 192 } 193 194 public void setIntrinsicWidth(int w) { 195 awidth = w; 196 } 197 198 public void setIntrinsicHeight(int h) { 199 aheight = h; 200 } 201 202 public int getIntrinsicHeight() { 203 return aheight; 204 } 205 206 public int getIntrinsicWidth() { 207 return awidth; 208 } 209 210 public int getEffectiveHeight() { 211 if (this.hauto) { 212 if (this.chauto) { 213 return aheight; 214 } else { 215 return this.cheight; 226 } 227 } else { 228 return this.height; 229 } 230 } 231 232 public int getEffectiveWidth() { 233 if (this.wauto) { 234 if (this.cwauto) { 235 return awidth; 236 } else { 237 return this.cwidth; 248 } 249 } else { 250 return this.width; 251 } 252 } 253 254 } 255 | Popular Tags |