MCPcopy Create free account
hub / github.com/rambaut/figtree / exportGraphics

Method exportGraphics

src/figtree/application/FigTreeFrame.java:1241–1263  ·  view source on GitHub ↗
(GraphicFormat format, JComponent comp, OutputStream stream)

Source from the content-addressed store, hash-verified

1239 }
1240
1241 public final static void exportGraphics(GraphicFormat format, JComponent comp, OutputStream stream) throws IOException, DocumentException {
1242 switch (format) {
1243
1244 case PNG:
1245 case GIF:
1246 case BMP:
1247 case JPEG:
1248 exportGraphicsFile(format, comp, stream);
1249 break;
1250 case EPS:
1251 throw new UnsupportedOperationException("EPS not handled");
1252 case SVG:
1253 exportSVGFile(comp, stream);
1254 break;
1255 case PDF:
1256 exportPDFFile(comp, stream);
1257 break;
1258 default:
1259 throw new UnsupportedOperationException("Format not handled: " + format);
1260
1261 }
1262
1263 }
1264 private final static void exportGraphicsFile(GraphicFormat format, JComponent component, OutputStream stream) throws IOException {
1265 int imageType = BufferedImage.TYPE_INT_RGB;
1266

Callers 2

createGraphicMethod · 0.95
doExportGraphicMethod · 0.95

Calls 3

exportGraphicsFileMethod · 0.95
exportSVGFileMethod · 0.95
exportPDFFileMethod · 0.95

Tested by

no test coverage detected