Package java.awt

Examples of java.awt.Image


    report.setDataFactory(new TableDataFactory
        ("default", data));

    final URL imageURL = ObjectUtilities.getResourceRelative
        ("gorilla.jpg", OpenSourceXMLDemoHandler.class);
    final Image image = Toolkit.getDefaultToolkit().createImage(imageURL);
    final WaitingImageObserver obs = new WaitingImageObserver(image);
    obs.waitImageLoaded();
    report.getParameterValues().put("logo", image);
    return report;
  }
View Full Code Here


      // this demo adds the image at runtime just to show how this could be
      // done. Usually such images get referenced from the XML itself without
      // using manual coding.
      final URL imageURL = ObjectUtilities.getResource
          ("org/pentaho/reporting/engine/classic/demo/opensource/gorilla.jpg", StraightToPNG.class);
      final Image image = Toolkit.getDefaultToolkit().createImage(imageURL);
      final WaitingImageObserver obs = new WaitingImageObserver(image);
      obs.waitImageLoaded();
      report.getParameterValues().put("logo", image);
      return report;
    }
View Full Code Here

      throw new IllegalArgumentException();
    }

    if (icons != null)
    {
      final Image cachedIcon = icons[iconKind - 1];
      if (cachedIcon != null)
      {
        return cachedIcon;
      }
    }

    final String iconName;
    switch (iconKind)
    {
      case BeanInfo.ICON_COLOR_16x16:
        iconName = getBundle(locale).getString(getKeyPrefix() + getName() + ".icon-color-16");
        break;
      case BeanInfo.ICON_COLOR_32x32:
        iconName = getBundle(locale).getString(getKeyPrefix() + getName() + ".icon-color-32");
        break;
      case BeanInfo.ICON_MONO_16x16:
        iconName = getBundle(locale).getString(getKeyPrefix() + getName() + ".icon-mono-16");
        break;
      case BeanInfo.ICON_MONO_32x32:
        iconName = getBundle(locale).getString(getKeyPrefix() + getName() + ".icon-mono-32");
        break;
      default:
        throw new IllegalArgumentException();
    }

    URL url = ObjectUtilities.getResource(iconName, DefaultElementMetaData.class);
    if (url == null)
    {
      final String fallbackIcon = getBundle(locale).getString(getKeyPrefix() + getName() + ".icon");
      url = ObjectUtilities.getResource(fallbackIcon, DefaultElementMetaData.class);
      if (url == null)
      {
        return null;
      }
    }
    if (icons == null)
    {
      icons = new Image[4];
    }
    final Image retval = Toolkit.getDefaultToolkit().createImage(url);
    icons[iconKind - 1] = retval;
    return retval;
  }
View Full Code Here

    try
    {
      final MasterReport report = generator.parseReport(templateURL);
      final URL imageURL = ObjectUtilities.getResource
          ("org/pentaho/reporting/engine/classic/demo/opensource/gorilla.jpg", StraightToPDF.class);
      final Image image = Toolkit.getDefaultToolkit().createImage(imageURL);
      final WaitingImageObserver obs = new WaitingImageObserver(image);
      obs.waitImageLoaded();
      report.getParameterValues().put("logo", image);

      return report;
View Full Code Here

        final String fullName = ze.getName();
        if (fullName.endsWith(".gif"))
        {
          final String category = getCategory(fullName);
          final String name = getName(fullName);
          final Image image = getImage(iconJar);
          final Long bytes = new Long(ze.getSize());
          //logger.debug ("Add Icon: " + name);
          addIconEntry(name, category, image, bytes);
        }
        iconJar.closeEntry();
View Full Code Here

  {
    ClassicEngineBoot.getInstance().start();
    // add an image as a report property...
    final URL imageURL = ObjectUtilities.getResource
            ("org/pentaho/reporting/engine/classic/demo/opensource/gorilla.jpg", ImageElementTest.class);
    final Image image = Toolkit.getDefaultToolkit().createImage(imageURL);

    final Object[][] data = {{createImage(image), createImage(image), createImage(image)}};
    final Object[] names = {"Foto1", "Foto2", "Foto3"};
    final DefaultTableModel mod = new DefaultTableModel(data, names);
View Full Code Here

    public static DcImageIcon getImageFromClipboard() {
        Transferable clipData = clipboard.getContents(clipboard);
        if (clipData != null) {
            if (clipData.isDataFlavorSupported(DataFlavor.imageFlavor)) {
                try {
                    Image image = (Image) clipData.getTransferData(DataFlavor.imageFlavor);
                    return new DcImageIcon(Utilities.getBytes(new DcImageIcon(image)));
                } catch (Exception ignore) {}
            }
        }
        return null;
View Full Code Here

   
   
    public static BufferedImage toBufferedImage(ImageIcon icon, int width, int height) {
        // make sure the image is loaded
        icon.setImage(icon.getImage());
        Image image = icon.getImage();
       
        int imgW = image.getWidth(null);
        int imgH = image.getHeight(null);
       
        int w = width > 0 ? width : imgW;
        int h = height > 0 ? height : imgH;
       
        if (imgW <= width && imgH <= height) {
View Full Code Here

   
                    // draw the first page to an image
                    PDFPage page = pdffile.getPage(0);
                    if (page != null) {
                        Rectangle rect = new Rectangle(0,0, (int)page.getBBox().getWidth(), (int)page.getBBox().getHeight());
                        Image front = page.getImage(rect.width, rect.height, rect, null, true, true);
                        book.setValue(Book._K_PICTUREFRONT, new DcImageIcon(Utilities.getBytes(new DcImageIcon(front))));
                    }
                } finally {
                    if (raf != null)
                        raf.close();
View Full Code Here

        super(parent);

        buildDialog();

        setTitle("");
        Image img =IconLibrary._icoMain.getImage();
        img.flush();

        setCenteredLocation();
    }
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.