Package java.awt

Examples of java.awt.Image


      {
        Class expressionClass = expression.getValueClass();
       
        if (Image.class.getName().equals(expressionClass.getName()))
        {
          Image img = (Image) source;
          newRenderer = JRImageRenderer.getInstance(img, getOnErrorTypeValue());
        }
        else if (InputStream.class.getName().equals(expressionClass.getName()))
        {
          InputStream is = (InputStream) source;
          newRenderer = JRImageRenderer.getInstance(is, getOnErrorTypeValue());
        }
        else if (URL.class.getName().equals(expressionClass.getName()))
        {
          URL url = (URL) source;
          newRenderer = JRImageRenderer.getInstance(url, getOnErrorTypeValue());
        }
        else if (File.class.getName().equals(expressionClass.getName()))
        {
          File file = (File) source;
          newRenderer = JRImageRenderer.getInstance(file, getOnErrorTypeValue());
        }
        else if (String.class.getName().equals(expressionClass.getName()))
        {
          String location = (String) source;
          newRenderer =
            JRImageRenderer.getInstance(
              location,
              getOnErrorTypeValue(),
              isLazy(),
              filler.reportClassLoader,
              filler.urlHandlerFactory,
              filler.fileResolver
              );
        }
        else if (JRRenderable.class.getName().equals(expressionClass.getName()))
        {
          newRenderer = (JRRenderable) source;
        }

        if (isUsingCache())
        {
          JRPrintImage img = new JRTemplatePrintImage(getJRTemplateImage());
          img.setRenderer(newRenderer);
          filler.fillContext.registerLoadedImage(source, img);
        }
      }
    }
View Full Code Here


  /**
   *
   */
  private Image printPageToImage(int pageIndex, float zoom) throws JRException
  {
    Image pageImage = new BufferedImage(
      (int)(jasperPrint.getPageWidth() * zoom) + 1,
      (int)(jasperPrint.getPageHeight() * zoom) + 1,
      BufferedImage.TYPE_INT_RGB
      );

    JRGraphics2DExporter exporter = new JRGraphics2DExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, this.jasperPrint);
    exporter.setParameter(JRGraphics2DExporterParameter.GRAPHICS_2D, pageImage.getGraphics());
    exporter.setParameter(JRExporterParameter.PAGE_INDEX, Integer.valueOf(pageIndex));
    exporter.setParameter(JRGraphics2DExporterParameter.ZOOM_RATIO, new Float(zoom));
    exporter.exportReport();

    return pageImage;
View Full Code Here

   */
  public Image readImage(byte[] bytes) throws JRException
  {
    InputStream bais = new ByteArrayInputStream(bytes);

    Image image = null;
    try
    {
      image = ImageIO.read(bais);
    }
    catch (Exception e)
View Full Code Here

  }

  protected void setChartBackground(JFreeChart jfreeChart)
  {
    Paint defaultBackgroundPaint = (Paint)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BACKGROUND_PAINT);
    Image defaultBackgroundImage = (Image)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BACKGROUND_IMAGE);
    Integer defaultBackgroundImageAlignment = (Integer)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BACKGROUND_IMAGE_ALIGNMENT);
    Float defaultBackgroundImageAlpha = (Float)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BACKGROUND_IMAGE_ALPHA);

    if (getChart().getOwnModeValue() != null)
    {
View Full Code Here

  {
    Paint defaultBackgroundPaint = (Paint)getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_BACKGROUND_PAINT);
    Float defaultBackgroundAlpha = (Float)getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_BACKGROUND_ALPHA);
    Float defaultForegroundAlpha = (Float)getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_FOREGROUND_ALPHA);
   
    Image defaultBackgroundImage = (Image)getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_BACKGROUND_IMAGE);
    Integer defaultBackgroundImageAlignment = (Integer)getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_BACKGROUND_IMAGE_ALIGNMENT);
    Float defaultBackgroundImageAlpha = (Float)getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_BACKGROUND_IMAGE_ALPHA);

    Paint backgroundPaint = jrPlot.getOwnBackcolor() != null ? jrPlot.getOwnBackcolor() : defaultBackgroundPaint;
    if(backgroundPaint != null)
View Full Code Here

  }
 
  protected void setChartBackgroundImage(JFreeChart jfreeChart)
  {
    ChartSettings chartSettings = getChartSettings();
    Image backgroundImage = chartSettings.getBackgroundImage() == null ? null : chartSettings.getBackgroundImage().getImage();
    if(backgroundImage != null)
    {
      jfreeChart.setBackgroundImage(backgroundImage);

      Integer backgroundImageAlignment = chartSettings.getBackgroundImageAlignment();
View Full Code Here

      foregroundAlpha = plotSettings.getForegroundAlpha();
    }
    if(foregroundAlpha != null)
      plot.setForegroundAlpha(foregroundAlpha.floatValue());
   
    Image backgroundImage = plotSettings.getBackgroundImage() == null ? null : plotSettings.getBackgroundImage().getImage();
    if(backgroundImage != null)
    {
      plot.setBackgroundImage(backgroundImage);
      Integer backgroundImageAlignment = plotSettings.getBackgroundImageAlignment();
      if(backgroundImageAlignment != null)
View Full Code Here

   */
  public void fill() throws JRException
  {
    long start = System.currentTimeMillis();
    //Preparing parameters
    Image image =
      Toolkit.getDefaultToolkit().createImage(
        JRLoader.loadBytesFromLocation("dukesign.jpg")
        );
    MediaTracker traker = new MediaTracker(new Panel());
    traker.addImage(image, 0);
View Full Code Here

   */
  public void fill() throws JRException
  {
    long start = System.currentTimeMillis();
    //Preparing parameters
    Image image =
      Toolkit.getDefaultToolkit().createImage(
        JRLoader.loadBytesFromLocation("dukesign.jpg")
        );
    MediaTracker traker = new MediaTracker(new Panel());
    traker.addImage(image, 0);
View Full Code Here

   */
  public void run() throws JRException
  {
    long start = System.currentTimeMillis();
    //Preparing parameters
    Image image = Toolkit.getDefaultToolkit().createImage("dukesign.jpg");
    MediaTracker traker = new MediaTracker(new Panel());
    traker.addImage(image, 0);
    try
    {
      traker.waitForID(0);
View Full Code Here

TOP

Related Classes of java.awt.Image

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.