final public void exportDiagram(OutputStream os, CMapData cmap, int index, FileFormatOption fileFormatOption)
			throws IOException {
		List<BufferedImage> flashcodes = null;
		try {
			if ("split".equalsIgnoreCase(getSkinParam().getValue("flashcode"))
					&& fileFormatOption.getFileFormat() == FileFormat.PNG) {
				final String s = getSource().getPlainString();
				flashcodes = getFlashCodeUtils().exportSplitCompress(s);
			} else if ("compress".equalsIgnoreCase(getSkinParam().getValue("flashcode"))
					&& fileFormatOption.getFileFormat() == FileFormat.PNG) {
				final String s = getSource().getPlainString();
				flashcodes = getFlashCodeUtils().exportFlashcodeCompress(s);
			} else if (getSkinParam().getValue("flashcode") != null
					&& fileFormatOption.getFileFormat() == FileFormat.PNG) {
				final String s = getSource().getPlainString();
				flashcodes = getFlashCodeUtils().exportFlashcodeSimple(s);
			}
		} catch (IOException e) {
			Log.error("Cannot generate flashcode");
			e.printStackTrace();
			flashcodes = null;
		}
		if (fileFormatOption.getFileFormat() == FileFormat.PDF) {
			exportDiagramInternalPdf(os, cmap, index, flashcodes);
			return;
		}
		if (fileFormatOption.getFileFormat() == FileFormat.MJPEG) {
			// exportDiagramInternalMjpeg(os);
			// return;*
			throw new UnsupportedOperationException();
		}
		lastInfo = exportDiagramInternal(os, cmap, index, fileFormatOption, flashcodes);
	}