(GraphicFormat format, JComponent comp, OutputStream stream)
| 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 |
no test coverage detected