/** * Creates a buffered image for the given parameters. If there is not enough * memory to create the image then a OutOfMemoryError is thrown. */ public static BufferedImage createBufferedImage(int w, int h, Color background) { return mxUtils.createBufferedImage(w, h, background, (background != null) ? BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB); }
/** * Creates a buffered image for the given parameters. If there is not enough * memory to create the image then a OutOfMemoryError is thrown. */ public static BufferedImage createBufferedImage(int w, int h, Color background) { return mxUtils.createBufferedImage(w, h, background, (background != null) ? BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB); }
/** * Creates the tripleBufferGraphics and tripleBuffer for the given * dimension and draws the complete graph onto the triplebuffer. * * @param width * @param height */ protected void createTripleBuffer(int width, int height) { try { tripleBuffer = mxUtils.createBufferedImage(width, height, null); tripleBufferGraphics = tripleBuffer.createGraphics(); // Repaints the complete buffer repaintTripleBuffer(null); } catch (OutOfMemoryError error) { log.log(Level.SEVERE, "Failed to create a triple buffer", error); } }
/** * Creates the tripleBufferGraphics and tripleBuffer for the given * dimension and draws the complete graph onto the triplebuffer. * * @param width * @param height */ protected void createTripleBuffer(int width, int height) { try { tripleBuffer = mxUtils.createBufferedImage(width, height, null); tripleBufferGraphics = tripleBuffer.createGraphics(); // Repaints the complete buffer repaintTripleBuffer(null); } catch (OutOfMemoryError error) { // ignore } }
/** * Creates the tripleBufferGraphics and tripleBuffer for the given dimension * and draws the complete graph onto the triplebuffer. * * @param width * @param height */ protected void createTripleBuffer(int width, int height) { try { tripleBuffer = mxUtils.createBufferedImage(width, height, null); tripleBufferGraphics = tripleBuffer.createGraphics(); mxUtils.setAntiAlias(tripleBufferGraphics, antiAlias, textAntiAlias); // Repaints the complete buffer repaintTripleBuffer(null); } catch (OutOfMemoryError error) { log.log(Level.SEVERE, "Failed to create a triple buffer", error); } }
/** * Creates the tripleBufferGraphics and tripleBuffer for the given dimension * and draws the complete graph onto the triplebuffer. * * @param width * @param height */ protected void createTripleBuffer(int width, int height) { try { tripleBuffer = mxUtils.createBufferedImage(width, height, null); tripleBufferGraphics = tripleBuffer.createGraphics(); mxUtils.setAntiAlias(tripleBufferGraphics, antiAlias, textAntiAlias); // Repaints the complete buffer repaintTripleBuffer(null); } catch (OutOfMemoryError error) { // ignore } }
/** * */ public mxImageCanvas(mxGraphics2DCanvas canvas, int width, int height, Color background, boolean antiAlias, boolean textAntiAlias) { this.canvas = canvas; previousGraphics = canvas.getGraphics(); image = mxUtils.createBufferedImage(width, height, background); if (image != null) { Graphics2D g = image.createGraphics(); mxUtils.setAntiAlias(g, antiAlias, textAntiAlias); canvas.setGraphics(g); } }
/** * */ public mxImageCanvas(mxGraphics2DCanvas canvas, int width, int height, Color background, boolean antiAlias, boolean textAntiAlias) { this.canvas = canvas; previousGraphics = canvas.getGraphics(); image = mxUtils.createBufferedImage(width, height, background); if (image != null) { Graphics2D g = image.createGraphics(); mxUtils.setAntiAlias(g, antiAlias, textAntiAlias); canvas.setGraphics(g); } }