Package org.pentaho.reporting.engine.classic.core.util

Examples of org.pentaho.reporting.engine.classic.core.util.ComponentDrawable


      return null;
    }

    final float scale = getScale() * getDeviceScale();

    final ComponentDrawable drawable = new ComponentDrawable();
    drawable.setComponent((Component) o);
    drawable.setAllowOwnPeer(true);
    drawable.setPaintSynchronized(true);
    final Dimension dim = drawable.getSize();

    final int width = Math.max(1, (int) (scale * dim.width));
    final int height = Math.max(1, (int) (scale * dim.height));

    final BufferedImage bi = ImageUtils.createTransparentImage(width, height);
    final Graphics2D graph = bi.createGraphics();
    graph.setBackground(new Color(0, 0, 0, 0));
    graph.setTransform(AffineTransform.getScaleInstance(scale, scale));
    drawable.draw(graph, new Rectangle2D.Float(0, 0, dim.width, dim.height));
    graph.dispose();

    return bi;
  }
View Full Code Here


      return null;
    }


    final Configuration config = runtime.getConfiguration();
    final ComponentDrawable cd;
    final String drawMode = config.getConfigProperty("org.pentaho.reporting.engine.classic.core.ComponentDrawableMode",
        "shared");
    if ("private".equals(drawMode))
    {
      cd = new ComponentDrawable();
    }
    else if ("synchronized".equals(drawMode))
    {
      cd = new ComponentDrawable();
      cd.setPaintSynchronized(true);
    }
    else
    {
      if (frame == null)
      {
        frame = new JFrame();
      }
      cd = new ComponentDrawable(frame);
      cd.setPaintSynchronized(true);
    }

    final String allowOwnPeer = config.getConfigProperty(
        "org.pentaho.reporting.engine.classic.core.AllowOwnPeerForComponentDrawable");
    cd.setAllowOwnPeer("true".equals(allowOwnPeer));
    cd.setComponent((Component) o);
    return cd;
  }
View Full Code Here

  }

  protected final ComponentDrawable createComponentDrawable(final ExpressionRuntime runtime, final Component c)
  {
    final Configuration config = runtime.getConfiguration();
    final ComponentDrawable cd;
    final String drawMode = config.getConfigProperty("org.pentaho.reporting.engine.classic.core.ComponentDrawableMode",
        "shared");
    if ("private".equals(drawMode))
    {
      cd = new ComponentDrawable();
    }
    else if ("synchronized".equals(drawMode))
    {
      cd = new ComponentDrawable();
      cd.setPaintSynchronized(true);
    }
    else
    {
      if (frame == null)
      {
        frame = new JFrame();
      }
      cd = new ComponentDrawable(frame);
      cd.setPaintSynchronized(true);
    }

    final String allowOwnPeer = config.getConfigProperty(
        "org.pentaho.reporting.engine.classic.core.AllowOwnPeerForComponentDrawable");
    cd.setAllowOwnPeer("true".equals(allowOwnPeer));
    cd.setComponent(c);
    return cd;
  }
View Full Code Here

      return null;
    }

    final float scale = getScale() * getDeviceScale();

    final ComponentDrawable drawable = new ComponentDrawable();
    drawable.setComponent((Component) o);
    drawable.setAllowOwnPeer(true);
    drawable.setPaintSynchronized(true);
    final Dimension dim = drawable.getSize();

    final int width = Math.max(1, (int) (scale * dim.width));
    final int height = Math.max(1, (int) (scale * dim.height));

    final BufferedImage bi = ImageUtils.createTransparentImage(width, height);
    final Graphics2D graph = bi.createGraphics();
    graph.setBackground(new Color(0, 0, 0, 0));
    graph.setTransform(AffineTransform.getScaleInstance(scale, scale));
    drawable.draw(graph, new Rectangle2D.Float(0, 0, dim.width, dim.height));
    graph.dispose();

    return bi;
  }
View Full Code Here

  protected final ComponentDrawable createComponentDrawable(final ExpressionRuntime runtime,
                                                            final Component c,
                                                            final ReportElement element)
  {
    final Configuration config = runtime.getConfiguration();
    final ComponentDrawable cd;
    final String drawMode = config.getConfigProperty("org.pentaho.reporting.engine.classic.core.ComponentDrawableMode",
        "shared");
    if ("private".equals(drawMode))
    {
      cd = new ComponentDrawable();
    }
    else if ("synchronized".equals(drawMode))
    {
      cd = new ComponentDrawable();
      cd.setPaintSynchronized(true);
    }
    else
    {
      final ContentTypeContext context = element.getElementContext(ContentTypeContext.class);
      if (context.frame == null)
      {
        context.frame = new JFrame();
      }
      cd = new ComponentDrawable(context.frame);
      cd.setPaintSynchronized(true);
    }

    final String allowOwnPeer = config.getConfigProperty(
        "org.pentaho.reporting.engine.classic.core.AllowOwnPeerForComponentDrawable");
    cd.setAllowOwnPeer("true".equals(allowOwnPeer));
    cd.setComponent(c);
    return cd;
  }
View Full Code Here

      return null;
    }


    final Configuration config = runtime.getConfiguration();
    final ComponentDrawable cd;
    final String drawMode = config.getConfigProperty("org.pentaho.reporting.engine.classic.core.ComponentDrawableMode",
        "shared");
    if ("private".equals(drawMode))
    {
      cd = new ComponentDrawable();
    }
    else if ("synchronized".equals(drawMode))
    {
      cd = new ComponentDrawable();
      cd.setPaintSynchronized(true);
    }
    else
    {
      if (frame == null)
      {
        frame = new JFrame();
      }
      cd = new ComponentDrawable(frame);
      cd.setPaintSynchronized(true);
    }

    final String allowOwnPeer = config.getConfigProperty(
        "org.pentaho.reporting.engine.classic.core.AllowOwnPeerForComponentDrawable");
    cd.setAllowOwnPeer("true".equals(allowOwnPeer));
    cd.setComponent((Component) o);
    return cd;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.util.ComponentDrawable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.