()
| 210 | } |
| 211 | |
| 212 | public int getVWidth() { |
| 213 | //g.setColor(0); |
| 214 | if (width>0) return width; // cached |
| 215 | |
| 216 | int w=0; |
| 217 | int imgWidth=imgWidth(); |
| 218 | |
| 219 | for (int index=0; index<elementCount;index++) { |
| 220 | Object ob=elementData[index]; |
| 221 | if (ob!=null) { |
| 222 | |
| 223 | if (ob instanceof String ){ |
| 224 | // string element |
| 225 | w+=font.stringWidth((String)ob); |
| 226 | } else if ((ob instanceof Integer)&& imageList!=null) { |
| 227 | // image element or color |
| 228 | int i=(((Integer)ob).intValue()); |
| 229 | switch (i&0xff000000) { |
| 230 | case IMAGE: |
| 231 | //#ifdef ANI_SMILES |
| 232 | if (imageList instanceof AniImageList) { |
| 233 | imgWidth = ((AniImageList)imageList).iconAt(i).getWidth(); |
| 234 | } |
| 235 | //#endif |
| 236 | w+=imgWidth; |
| 237 | break; |
| 238 | } |
| 239 | } // Integer |
| 240 | } // if ob!=null |
| 241 | } // for |
| 242 | return width=w; |
| 243 | } |
| 244 | |
| 245 | public void setElementAt(Object obj, int index) { |
| 246 | height=width=0; // discarding cached values |
nothing calls this directly
no test coverage detected