コード例 #1
0
  /** Renders the GVT tree. */
  protected void renderGVTTree() {
    Rectangle visRect = getRenderRect();
    if (gvtRoot == null || visRect.width <= 0 || visRect.height <= 0) {
      return;
    }

    // Renderer setup.
    if (renderer == null || renderer.getTree() != gvtRoot) {
      renderer = createImageRenderer();
      renderer.setTree(gvtRoot);
    }

    // Area of interest computation.
    AffineTransform inv;
    try {
      inv = renderingTransform.createInverse();
    } catch (NoninvertibleTransformException e) {
      throw new IllegalStateException("NoninvertibleTransformEx:" + e.getMessage());
    }
    Shape s = inv.createTransformedShape(visRect);

    // Rendering thread setup.
    gvtTreeRenderer =
        new GVTTreeRenderer(
            renderer,
            renderingTransform,
            doubleBufferedRendering,
            s,
            visRect.width,
            visRect.height);
    gvtTreeRenderer.setPriority(Thread.MIN_PRIORITY);

    Iterator it = gvtTreeRendererListeners.iterator();
    while (it.hasNext()) {
      gvtTreeRenderer.addGVTTreeRendererListener((GVTTreeRendererListener) it.next());
    }

    // Disable the dispatch during the rendering
    // to avoid concurrent access to the GVT tree.
    if (eventDispatcher != null) {
      eventDispatcher.setEventDispatchEnabled(false);
    }

    gvtTreeRenderer.start();
  }
コード例 #2
0
 /**
  * Flush a rectangle of cached image data (preliminary interface, may be removed or modified in
  * the future).
  */
 public void flush(Rectangle r) {
   renderer.flush(r);
 }
コード例 #3
0
 /**
  * Flush any cached image data (preliminary interface, may be removed or modified in the future).
  */
 public void flush() {
   renderer.flush();
 }