/** * Writes out all the format records and the XF records * * @exception IOException * @param outputFile the file to write to */ public void write(File outputFile) throws IOException { // Write out all the formats Iterator i = formatsList.iterator(); FormatRecord fr = null; while (i.hasNext()) { fr = (FormatRecord) i.next(); outputFile.write(fr); } // Write out the styles i = xfRecords.iterator(); XFRecord xfr = null; while (i.hasNext()) { xfr = (XFRecord) i.next(); outputFile.write(xfr); } // Write out the style records BuiltInStyle style = new BuiltInStyle(0x10, 3); outputFile.write(style); style = new BuiltInStyle(0x11, 6); outputFile.write(style); style = new BuiltInStyle(0x12, 4); outputFile.write(style); style = new BuiltInStyle(0x13, 7); outputFile.write(style); style = new BuiltInStyle(0x0, 0); outputFile.write(style); style = new BuiltInStyle(0x14, 5); outputFile.write(style); }
/* 209: */ /* 210: */ public void write(File outputFile) /* 211: */ throws IOException /* 212: */ { /* 213:406 */ if (this.origin == Origin.WRITE) /* 214: */ { /* 215:408 */ DggContainer dggContainer = new DggContainer(); /* 216: */ /* 217:410 */ Dgg dgg = new Dgg(this.numBlips + this.numCharts + 1, this.numBlips); /* 218: */ /* 219:412 */ dgg.addCluster(1, 0); /* 220:413 */ dgg.addCluster(this.numBlips + 1, 0); /* 221: */ /* 222:415 */ dggContainer.add(dgg); /* 223: */ /* 224:417 */ int drawingsAdded = 0; /* 225:418 */ BStoreContainer bstoreCont = new BStoreContainer(); /* 226:421 */ for (Iterator i = this.drawings.iterator(); i.hasNext(); ) /* 227: */ { /* 228:423 */ Object o = i.next(); /* 229:424 */ if ((o instanceof Drawing)) /* 230: */ { /* 231:426 */ Drawing d = (Drawing) o; /* 232:427 */ BlipStoreEntry bse = new BlipStoreEntry(d); /* 233: */ /* 234:429 */ bstoreCont.add(bse); /* 235:430 */ drawingsAdded++; /* 236: */ } /* 237: */ } /* 238:433 */ if (drawingsAdded > 0) /* 239: */ { /* 240:435 */ bstoreCont.setNumBlips(drawingsAdded); /* 241:436 */ dggContainer.add(bstoreCont); /* 242: */ } /* 243:439 */ Opt opt = new Opt(); /* 244: */ /* 245:441 */ dggContainer.add(opt); /* 246: */ /* 247:443 */ SplitMenuColors splitMenuColors = new SplitMenuColors(); /* 248:444 */ dggContainer.add(splitMenuColors); /* 249: */ /* 250:446 */ this.drawingData = dggContainer.getData(); /* 251: */ } /* 252:448 */ else if (this.origin == Origin.READ_WRITE) /* 253: */ { /* 254:450 */ DggContainer dggContainer = new DggContainer(); /* 255: */ /* 256:452 */ Dgg dgg = new Dgg(this.numBlips + this.numCharts + 1, this.numBlips); /* 257: */ /* 258:454 */ dgg.addCluster(1, 0); /* 259:455 */ dgg.addCluster(this.drawingGroupId + this.numBlips + 1, 0); /* 260: */ /* 261:457 */ dggContainer.add(dgg); /* 262: */ /* 263:459 */ BStoreContainer bstoreCont = new BStoreContainer(); /* 264:460 */ bstoreCont.setNumBlips(this.numBlips); /* 265: */ /* 266: */ /* 267:463 */ BStoreContainer readBStoreContainer = getBStoreContainer(); /* 268:465 */ if (readBStoreContainer != null) /* 269: */ { /* 270:467 */ EscherRecord[] children = readBStoreContainer.getChildren(); /* 271:468 */ for (int i = 0; i < children.length; i++) /* 272: */ { /* 273:470 */ BlipStoreEntry bse = (BlipStoreEntry) children[i]; /* 274:471 */ bstoreCont.add(bse); /* 275: */ } /* 276: */ } /* 277:476 */ for (Iterator i = this.drawings.iterator(); i.hasNext(); ) /* 278: */ { /* 279:478 */ DrawingGroupObject dgo = (DrawingGroupObject) i.next(); /* 280:479 */ if ((dgo instanceof Drawing)) /* 281: */ { /* 282:481 */ Drawing d = (Drawing) dgo; /* 283:482 */ if (d.getOrigin() == Origin.WRITE) /* 284: */ { /* 285:484 */ BlipStoreEntry bse = new BlipStoreEntry(d); /* 286:485 */ bstoreCont.add(bse); /* 287: */ } /* 288: */ } /* 289: */ } /* 290:490 */ dggContainer.add(bstoreCont); /* 291: */ /* 292:492 */ Opt opt = new Opt(); /* 293: */ /* 294:494 */ opt.addProperty(191, false, false, 524296); /* 295:495 */ opt.addProperty(385, false, false, 134217737); /* 296:496 */ opt.addProperty(448, false, false, 134217792); /* 297: */ /* 298:498 */ dggContainer.add(opt); /* 299: */ /* 300:500 */ SplitMenuColors splitMenuColors = new SplitMenuColors(); /* 301:501 */ dggContainer.add(splitMenuColors); /* 302: */ /* 303:503 */ this.drawingData = dggContainer.getData(); /* 304: */ } /* 305:506 */ MsoDrawingGroupRecord msodg = new MsoDrawingGroupRecord(this.drawingData); /* 306:507 */ outputFile.write(msodg); /* 307: */ }