/** Called when a rendering was completed. */ public void gvtRenderingCompleted(GVTTreeRendererEvent e) { haltProgressivePaintThread(); if (doubleBufferedRendering) { paintingTransform = null; suspendInteractions = false; } gvtTreeRenderer = null; if (needRender) { renderGVTTree(); needRender = false; } else { image = e.getImage(); immediateRepaint(); } if (eventDispatcher != null) { eventDispatcher.setEventDispatchEnabled(true); } }
/** Called when a rendering started. */ public void gvtRenderingStarted(GVTTreeRendererEvent e) { if (progressivePaint && !doubleBufferedRendering) { image = e.getImage(); progressivePaintThread = new HaltingThread() { public void run() { final Thread thisThread = this; try { while (!hasBeenHalted()) { EventQueue.invokeLater( new Runnable() { public void run() { if (progressivePaintThread == thisThread) { Rectangle vRect = getRenderRect(); repaint( vRect.x, vRect.y, vRect.width, vRect.height); } } }); sleep(200); } } catch (InterruptedException ie) { } catch (ThreadDeath td) { throw td; } catch (Throwable t) { t.printStackTrace(); } } }; progressivePaintThread.setPriority(Thread.MIN_PRIORITY + 1); progressivePaintThread.start(); } if (!doubleBufferedRendering) { paintingTransform = null; suspendInteractions = false; } }