Package java.awt

Examples of java.awt.Image


            } else if (d.width >= 22 && d.height >= 22) {
                iconFile = "/org/h2/res/h2-22-t.png";
            } else {
                iconFile = "/org/h2/res/h2.png";
            }
            Image icon = loadImage(iconFile);

            // trayIcon = new TrayIcon(image, "H2 Database Engine", menuConsole);
            trayIcon = Utils.newInstance("java.awt.TrayIcon", icon, "H2 Database Engine", menuConsole);

            // trayIcon.addMouseListener(this);
View Full Code Here


        if (frame != null) {
            return;
        }
        frame = new Frame("H2 Console");
        frame.addWindowListener(this);
        Image image = loadImage("/org/h2/res/h2.png");
        if (image != null) {
            frame.setIconImage(image);
        }
        frame.setResizable(false);
        frame.setBackground(SystemColor.control);
View Full Code Here

     */
    public void generateTotalScenario(Projection p) {
        renderList.clear();
        OMGraphicList icons = new OMGraphicList();

        Image image = null;
        if (location instanceof OMRaster) {
            image = ((OMRaster) location).getImage();
        }

        float lastLat = 0f;
View Full Code Here

    String key)
    throws GUIException {

    Label label = new Label(null, null);
    ImageIcon icon = (ImageIcon) value;
    Image inImage = icon.getImage();

    /* Resize the image */
    double scale = (double) maxImageSize / (double) inImage.getHeight(null);

    if (inImage.getWidth(null) > inImage.getHeight(null)) {
      scale = (double) maxImageSize / (double) inImage.getWidth(null);
    }
    int scaledW = (int) (scale * inImage.getWidth(null));
    int scaledH = (int) (scale * inImage.getHeight(null));
    BufferedImage outImage = new BufferedImage(scaledW, scaledH, BufferedImage.TYPE_INT_RGB);
    AffineTransform tx = new AffineTransform();

    if (scale < 1.0d) {
      tx.scale(scale, scale);
View Full Code Here

    public static void write(float lt, float ln, ImageIcon ii,
                             LinkProperties properties, DataOutputStream dos)
            throws IOException, InterruptedException {

        int image_width, image_height;
        Image image;

        image_width = ii.getIconWidth();
        image_height = ii.getIconHeight();
        image = ii.getImage();
        LinkRaster.write(lt,
View Full Code Here

    public static void write(int x1, int y1, ImageIcon ii,
                             LinkProperties properties, DataOutputStream dos)
            throws IOException, InterruptedException {

        int image_width, image_height;
        Image image;

        image_width = ii.getIconWidth();
        image_height = ii.getIconHeight();
        image = ii.getImage();
        LinkRaster.write(x1,
View Full Code Here

                             ImageIcon ii, LinkProperties properties,
                             DataOutputStream dos) throws IOException,
            InterruptedException {

        int image_width, image_height;
        Image image;

        image_width = ii.getIconWidth();
        image_height = ii.getIconHeight();
        image = ii.getImage();
        LinkRaster.write(lt,
View Full Code Here

             */
            try {
                Toolkit tk = Toolkit.getDefaultToolkit();
                ImageIcon pointer = new ImageIcon(getClass().getResource("pan.gif"));
                Dimension bestSize = tk.getBestCursorSize(pointer.getIconWidth(), pointer.getIconHeight());
                Image pointerImage = ImageScaler.getOptimalScalingImage(pointer.getImage(),(int) bestSize.getWidth(),
                                                                          (int) bestSize.getHeight());
                Cursor cursor = tk.createCustomCursor(pointerImage, new Point(0, 0), "PP");
                setModeCursor(cursor);
                return;
            } catch (Exception e) {
View Full Code Here

     * size is reached.
     */
    public static Image getOptimalScalingImage(Image inputImage,
            int startSize, int endSize) {
        int currentSize = startSize;
        Image currentImage = inputImage;
        int delta = currentSize - endSize;
        int nextPow2 = currentSize >> 1;
        while (currentSize > 1) {
            if (delta <= nextPow2) {
                if (currentSize != endSize) {
                    BufferedImage tmpImage = new BufferedImage(endSize,
                            endSize, BufferedImage.TYPE_INT_RGB);
                    Graphics g = tmpImage.getGraphics();
                    ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                            RenderingHints.VALUE_INTERPOLATION_BILINEAR);
                    g.drawImage(currentImage, 0, 0, tmpImage.getWidth(),
                            tmpImage.getHeight(), null);
                    currentImage = tmpImage;
                }
                return currentImage;
            } else {
                BufferedImage tmpImage = new BufferedImage(currentSize >> 1,
                        currentSize >> 1, BufferedImage.TYPE_INT_RGB);
                Graphics g = tmpImage.getGraphics();
                ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                        RenderingHints.VALUE_INTERPOLATION_BILINEAR);
                g.drawImage(currentImage, 0, 0, tmpImage.getWidth(),
                        tmpImage.getHeight(), null);
                currentImage = tmpImage;
                currentSize = currentImage.getWidth(null);
                delta = currentSize - endSize;
                nextPow2 = currentSize >> 1;
            }
        }
        return currentImage;
View Full Code Here

    public Paint getFillPaintForScale(float scale) {
        if (fillPattern != null) {
            if (baseScale != NONE) {
                BufferedImage bi = fillPattern.getImage();
                float scaleFactor = scale / baseScale;
                Image image = bi.getScaledInstance((int) (bi.getWidth() * scaleFactor),
                        (int) (bi.getHeight() * scaleFactor),
                        Image.SCALE_SMOOTH);
                try {
                    bi = BufferedImageHelper.getBufferedImage(image,
                            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.