本文整理汇总了Java中net.sourceforge.plantuml.FileFormatOption.getFileFormat方法的典型用法代码示例。如果您正苦于以下问题:Java FileFormatOption.getFileFormat方法的具体用法?Java FileFormatOption.getFileFormat怎么用?Java FileFormatOption.getFileFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sourceforge.plantuml.FileFormatOption
的用法示例。
在下文中一共展示了FileFormatOption.getFileFormat方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUGraphic
import net.sourceforge.plantuml.FileFormatOption; //导入方法依赖的package包/类
private UGraphic2 createUGraphic(FileFormatOption fileFormatOption, final Dimension2D dim, Animation animationArg,
double dx, double dy) {
final FileFormat fileFormat = fileFormatOption.getFileFormat();
switch (fileFormat) {
case PNG:
return createUGraphicPNG(colorMapper, dpiFactor, dim, mybackcolor, animationArg, dx, dy);
case SVG:
return createUGraphicSVG(colorMapper, dpiFactor, dim, mybackcolor, fileFormatOption.getSvgLinkTarget());
case EPS:
return new UGraphicEps(colorMapper, EpsStrategy.getDefault2());
case EPS_TEXT:
return new UGraphicEps(colorMapper, EpsStrategy.WITH_MACRO_AND_TEXT);
case HTML5:
return new UGraphicHtml5(colorMapper);
case VDX:
return new UGraphicVdx(colorMapper);
case LATEX:
return new UGraphicTikz(colorMapper, true);
case LATEX_NO_PREAMBLE:
return new UGraphicTikz(colorMapper, false);
case BRAILLE_PNG:
return new UGraphicBraille(colorMapper, fileFormat);
default:
throw new UnsupportedOperationException(fileFormat.toString());
}
}
示例2: createImage
import net.sourceforge.plantuml.FileFormatOption; //导入方法依赖的package包/类
private UGraphic createImage(FileFormatOption fileFormatOption) {
final Color backColor = getSkinParam().getColorMapper()
.getMappedColor(this.getSkinParam().getBackgroundColor());
final FileFormat fileFormat = fileFormatOption.getFileFormat();
if (fileFormat == FileFormat.PNG) {
final double height = getDefaultArea().heightWhenWidthIs(width, fileFormat.getDefaultStringBounder());
final EmptyImageBuilder builder = new EmptyImageBuilder(width, height, backColor);
final Graphics2D graphics2D = builder.getGraphics2D();
final double dpiFactor = this.getDpiFactor(fileFormatOption);
final UGraphicG2d result = new UGraphicG2d(new ColorMapperIdentity(), graphics2D, dpiFactor);
result.setBufferedImage(builder.getBufferedImage());
return result;
}
throw new UnsupportedOperationException();
}
示例3: writeImage
import net.sourceforge.plantuml.FileFormatOption; //导入方法依赖的package包/类
public static void writeImage(OutputStream os, String metadata, FileFormatOption fileFormatOption,
ColorMapper colorMapper, HtmlColor background, TextBlock image) throws IOException {
final FileFormat fileFormat = fileFormatOption.getFileFormat();
if (fileFormat == FileFormat.PNG) {
final BufferedImage im = createImage(colorMapper, background, image);
PngIO.write(im, os, fileFormatOption.isWithMetadata() ? metadata : null, 96);
} else if (fileFormat == FileFormat.SVG) {
final UGraphicSvg svg = new UGraphicSvg(colorMapper, StringUtils.getAsHtml(colorMapper
.getMappedColor(background)), false, 1.0);
image.drawU(svg);
svg.createXml(os);
} else if (fileFormat == FileFormat.EPS) {
final UGraphicEps ug = new UGraphicEps(colorMapper, EpsStrategy.getDefault2());
image.drawU(ug);
os.write(ug.getEPSCode().getBytes());
} else {
throw new UnsupportedOperationException();
}
}
示例4: createImage
import net.sourceforge.plantuml.FileFormatOption; //导入方法依赖的package包/类
private UGraphic createImage(FileFormatOption fileFormatOption) {
final Color backColor = getSkinParam().getColorMapper()
.getMappedColor(this.getSkinParam().getBackgroundColor());
final FileFormat fileFormat = fileFormatOption.getFileFormat();
if (fileFormat == FileFormat.PNG) {
final double height = getDefaultArea().heightWhenWidthIs(width, TextBlockUtils.getDummyStringBounder());
final EmptyImageBuilder builder = new EmptyImageBuilder(width, height, backColor);
final Graphics2D graphics2D = builder.getGraphics2D();
final double dpiFactor = this.getDpiFactor(fileFormatOption);
final UGraphicG2d result = new UGraphicG2d(new ColorMapperIdentity(), graphics2D, dpiFactor);
result.setBufferedImage(builder.getBufferedImage());
return result;
}
throw new UnsupportedOperationException();
}
示例5: writeImageTOBEMOVED
import net.sourceforge.plantuml.FileFormatOption; //导入方法依赖的package包/类
public ImageData writeImageTOBEMOVED(FileFormatOption fileFormatOption, OutputStream os) throws IOException {
final FileFormat fileFormat = fileFormatOption.getFileFormat();
if (fileFormat == FileFormat.MJPEG) {
return writeImageMjpeg(os, fileFormat.getDefaultStringBounder());
} else if (fileFormat == FileFormat.ANIMATED_GIF) {
return writeImageAnimatedGif(os, fileFormat.getDefaultStringBounder());
}
return writeImageInternal(fileFormatOption, os, animation);
}
示例6: getSequenceDiagramPngMaker
import net.sourceforge.plantuml.FileFormatOption; //导入方法依赖的package包/类
private FileMaker getSequenceDiagramPngMaker(FileFormatOption fileFormatOption) {
final FileFormat fileFormat = fileFormatOption.getFileFormat();
if (fileFormat == FileFormat.ATXT || fileFormat == FileFormat.UTXT) {
return new SequenceDiagramTxtMaker(this, fileFormat);
}
if (modeTeoz()) {
return new SequenceDiagramFileMakerTeoz(this, getSkin2(), fileFormatOption);
}
return new SequenceDiagramFileMakerPuma2(this, getSkin2(), fileFormatOption);
}
示例7: exportDiagramInternal
import net.sourceforge.plantuml.FileFormatOption; //导入方法依赖的package包/类
@Override
protected ImageData exportDiagramInternal(OutputStream os, int index, FileFormatOption fileFormatOption)
throws IOException {
final FileFormat fileFormat = fileFormatOption.getFileFormat();
if (fileFormat == FileFormat.ATXT || fileFormat == FileFormat.UTXT) {
try {
createFilesTxt(os, index, fileFormat);
} catch (Throwable t) {
t.printStackTrace(new PrintStream(os));
}
return new ImageDataSimple();
}
if (fileFormat.name().startsWith("XMI")) {
createFilesXmi(os, fileFormat);
return new ImageDataSimple();
}
if (fileFormat == FileFormat.SCXML) {
createFilesScxml(os);
return new ImageDataSimple();
}
if (getUmlDiagramType() == UmlDiagramType.COMPOSITE) {
throw new UnsupportedOperationException();
}
// final CucaDiagramFileMaker maker = OptionFlags.USE_HECTOR ? new CucaDiagramFileMakerHectorC1(this)
// : new CucaDiagramFileMakerSvek(this);
final CucaDiagramFileMaker maker = this.isUseJDot() ? new CucaDiagramFileMakerJDot(this,
fileFormat.getDefaultStringBounder()) : new CucaDiagramFileMakerSvek(this);
final ImageData result = maker.createFile(os, getDotStrings(), fileFormatOption);
if (result == null) {
return new ImageDataSimple();
}
this.warningOrError = result.getWarningOrError();
return result;
}
示例8: createFileInternal
import net.sourceforge.plantuml.FileFormatOption; //导入方法依赖的package包/类
private ImageData createFileInternal(OutputStream os, List<String> dotStrings, FileFormatOption fileFormatOption)
throws IOException, InterruptedException {
if (diagram.getUmlDiagramType() == UmlDiagramType.ACTIVITY) {
new CucaDiagramSimplifierActivity(diagram, dotStrings);
} else if (diagram.getUmlDiagramType() == UmlDiagramType.STATE) {
new CucaDiagramSimplifierState(diagram, dotStrings);
}
CucaDiagramFileMakerSvek2 svek2 = buildCucaDiagramFileMakerSvek2(DotMode.NORMAL);
TextBlockBackcolored result = svek2.createFile(diagram.getDotStringSkek());
if (result instanceof GraphvizCrash) {
svek2 = buildCucaDiagramFileMakerSvek2(DotMode.NO_LEFT_RIGHT);
result = svek2.createFile(diagram.getDotStringSkek());
}
result = addLegend(result);
result = addTitle(result);
result = addHeaderAndFooter(result);
final FileFormat fileFormat = fileFormatOption.getFileFormat();
final String widthwarning = diagram.getSkinParam().getValue("widthwarning");
if (widthwarning != null && widthwarning.matches("\\d+")) {
this.warningOrError = svek2.getBibliotekon().getWarningOrError(Integer.parseInt(widthwarning));
} else {
this.warningOrError = null;
}
final Dimension2D dim = result.calculateDimension(stringBounder);
final double scale = getScale(fileFormatOption, dim);
final ImageBuilder imageBuilder = new ImageBuilder(diagram.getSkinParam().getColorMapper(), scale,
result.getBackcolor(), fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null,
warningOrError, 0, 10, diagram.getAnimation());
imageBuilder.addUDrawable(result);
return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
示例9: getSequenceDiagramPngMaker
import net.sourceforge.plantuml.FileFormatOption; //导入方法依赖的package包/类
private FileMaker getSequenceDiagramPngMaker(FileFormatOption fileFormatOption) {
final FileFormat fileFormat = fileFormatOption.getFileFormat();
if (fileFormat == FileFormat.ATXT || fileFormat == FileFormat.UTXT) {
return new SequenceDiagramTxtMaker(this, fileFormat);
}
if (OptionFlags.TEOZ) {
return new SequenceDiagramFileMakerTeoz(this, skin, fileFormatOption);
}
return new SequenceDiagramFileMakerPuma2(this, skin, fileFormatOption);
}
示例10: exportDiagramInternal
import net.sourceforge.plantuml.FileFormatOption; //导入方法依赖的package包/类
@Override
final protected ImageData exportDiagramInternal(OutputStream os, int index, FileFormatOption fileFormatOption)
throws IOException {
final FileFormat fileFormat = fileFormatOption.getFileFormat();
if (fileFormat == FileFormat.ATXT || fileFormat == FileFormat.UTXT) {
try {
createFilesTxt(os, index, fileFormat);
} catch (Throwable t) {
t.printStackTrace(new PrintStream(os));
}
return new ImageDataSimple();
}
if (fileFormat.name().startsWith("XMI")) {
createFilesXmi(os, fileFormat);
return new ImageDataSimple();
}
if (getUmlDiagramType() == UmlDiagramType.COMPOSITE) {
throw new UnsupportedOperationException();
}
final CucaDiagramFileMaker maker = OptionFlags.USE_HECTOR ? new CucaDiagramFileMakerHectorC1(this)
: new CucaDiagramFileMakerSvek(this);
final ImageData result = maker.createFile(os, getDotStrings(), fileFormatOption);
if (result == null) {
return new ImageDataSimple();
}
this.warningOrError = result.getWarningOrError();
return result;
}
示例11: createFileInternalOld
import net.sourceforge.plantuml.FileFormatOption; //导入方法依赖的package包/类
private ImageData createFileInternalOld(OutputStream os, List<String> dotStrings, FileFormatOption fileFormatOption)
throws IOException, InterruptedException {
if (diagram.getUmlDiagramType() == UmlDiagramType.ACTIVITY) {
new CucaDiagramSimplifierActivity(diagram, dotStrings);
} else if (diagram.getUmlDiagramType() == UmlDiagramType.STATE) {
new CucaDiagramSimplifierState(diagram, dotStrings);
}
CucaDiagramFileMakerSvek2 svek2 = buildCucaDiagramFileMakerSvek2(DotMode.NORMAL);
TextBlockBackcolored result = svek2.createFile(diagram.getDotStringSkek());
if (result instanceof GraphvizCrash) {
svek2 = buildCucaDiagramFileMakerSvek2(DotMode.NO_LEFT_RIGHT);
result = svek2.createFile(diagram.getDotStringSkek());
}
result = addLegend(result);
result = addTitle(result);
result = addHeaderAndFooter(result);
final Dimension2D dim = result.calculateDimension(stringBounder);
final FileFormat fileFormat = fileFormatOption.getFileFormat();
Set<Url> allUrlEncountered = null;
double scale = 0;
if (fileFormat == FileFormat.PNG) {
allUrlEncountered = new HashSet<Url>();
scale = createPng(os, fileFormatOption, result, dim, allUrlEncountered, fileFormatOption.isWithMetadata());
} else if (fileFormat == FileFormat.SVG) {
createSvg(os, fileFormatOption, result, dim);
} else if (fileFormat == FileFormat.VDX) {
createVdx(os, fileFormatOption, result, dim);
} else if (fileFormat == FileFormat.LATEX) {
createTikz(os, fileFormatOption, result, dim);
} else if (fileFormat == FileFormat.EPS) {
createEps(os, fileFormatOption, result, dim);
} else {
throw new UnsupportedOperationException(fileFormat.toString());
}
double deltaX = 0;
double deltaY = 0;
if (result instanceof DecorateEntityImage) {
deltaX += ((DecorateEntityImage) result).getDeltaX();
deltaY += ((DecorateEntityImage) result).getDeltaY();
}
final Dimension2D finalDimension = Dimension2DDouble.delta(dim, deltaX, deltaY);
CMapData cmap = null;
if (diagram.hasUrl() && fileFormatOption.getFileFormat() == FileFormat.PNG) {
cmap = CMapData.cmapString(allUrlEncountered, scale);
}
final String widthwarning = diagram.getSkinParam().getValue("widthwarning");
if (widthwarning != null && widthwarning.matches("\\d+")) {
this.warningOrError = svek2.getBibliotekon().getWarningOrError(Integer.parseInt(widthwarning));
} else {
this.warningOrError = null;
}
return new ImageDataComplex(finalDimension, cmap, getWarningOrError());
}