@Override public void setBounds(final int x, final int y, final int width, final int height) { super.setBounds(x, y, width, height); try { if (tiledBufferedImage != null) { bufferedImageAllocator.freeBufferedImage(tiledBufferedImage); } final AllocationMatch myAllocationMatch = new AllocationMatch(); tiledBufferedImage = bufferedImageAllocator.allocateBufferedImage( "SourceSignalAmpMeter", myAllocationMatch, AllocationLifetime.SHORT, AllocationBufferType.TYPE_INT_RGB, width, height); outBufferedImage = tiledBufferedImage.getUnderlyingBufferedImage(); outBufferedImageGraphics = outBufferedImage.createGraphics(); outBufferedImageGraphics.setColor(Color.BLACK); outBufferedImageGraphics.fillRect(0, 0, componentWidth, componentHeight); } catch (final DatastoreException e) { if (log.isErrorEnabled()) { log.error("DatastoreException caught allocating buffered image: " + e.toString(), e); } } componentWidth = width; componentHeight = height; }
@Override public void setBounds(final Rectangle bounds) { super.setBounds(bounds); scrollingCanvas = new DoubleImageScrollingCanvas(uiInstance, bounds.width, bounds.height); }