Package javax.swing

Examples of javax.swing.ImageIcon.paintIcon()


        ? new ImageIcon(HomeComponent3D.class.getResource(navigationPanelIconPath))
        : null;
    navigationPanel.setBorder(new Border() {
        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
          if (nagivationPanelIcon != null) {
            nagivationPanelIcon.paintIcon(c, g, x, y);
          } else {
            // Draw a surrounding oval if no navigation panel icon is defined
            Graphics2D g2D = (Graphics2D)g;
            g2D.setColor(Color.BLACK);
            g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
View Full Code Here


        ImageIcon baseIcon = new ImageIcon(baseImage);
        Image result = new BufferedImage(baseIcon.getIconWidth(), baseIcon
                .getIconHeight(), BufferedImage.TYPE_INT_ARGB);
        Component c = new Component() {};
        Graphics2D g = (Graphics2D) result.getGraphics();
        baseIcon.paintIcon(c, g, 0, 0);
       
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);
        g.setColor(Color.black);
        int x = baseIcon.getIconWidth()/4;
View Full Code Here

        ImageIcon baseIcon = new ImageIcon(baseImage);
        Image result = new BufferedImage(baseIcon.getIconWidth(), baseIcon
                .getIconHeight(), BufferedImage.TYPE_INT_ARGB);
        Component c = new Component() {};
        Graphics2D g = (Graphics2D) result.getGraphics();
        baseIcon.paintIcon(c, g, 0, 0);
       
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);
        g.setColor(Color.black);
        int x = baseIcon.getIconWidth()/4;
View Full Code Here

        for (Iterator iterator = iconSet.iterator(); iterator.hasNext();) {
            ImageIcon icon = (ImageIcon) iterator.next();
            Dimension id = new Dimension(icon.getIconWidth(), icon.getIconHeight());
            int dx = (d.width - id.width)/2;
            int dy = (d.height - id.height)/2;
            icon.paintIcon(c, g, x+dx, y+dy);
        }
        ImageIcon bg = getBackground();
        if (bg != null) {
            int dx = (d.width - bg.getIconWidth())/2;
            int dy = (d.height - bg.getIconHeight())/2;
View Full Code Here

          //PM:25/4/08 move code to common method
              UIutils.transparentImage(buf, label.getBackground());

        }
        ImageIcon img = new ImageIcon(buf);
        img.paintIcon(c, g, 0, 0);
      }

    }
  }
View Full Code Here

          //PM:25/4/08 move code to common method
              UIutils.transparentImage(buf, label.getBackground());

        }
        ImageIcon img = new ImageIcon(buf);
        img.paintIcon(c, g, 0, 0);
      }

    }
  }
View Full Code Here

          //PM:25/4/08 move code to common method
              UIutils.transparentImage(buf, label.getBackground());

        }
        ImageIcon img = new ImageIcon(buf);
        img.paintIcon(c, g, 0, 0);
      }

    }
  }
View Full Code Here

            ImageIcon qualityIcon = qualityIcons[quality];
            int qx = startx
                    + (columnWidth-img.getWidth()-qualityIcon.getIconWidth())/(int)2;
            int qy = starty
                    + (rowHeight-img.getHeight()-qualityIcon.getIconHeight())/(int)2;
            qualityIcon.paintIcon( this, g2, qx, qy );
        }
       
        if ( photo.getRawSettings() != null ) {
            // Draw the "RAW" icon
            int rx = startx
View Full Code Here

                }
            }

            ImageIcon icon = currentCover.getImage();
            BufferedImage image = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_RGB);
            icon.paintIcon(null, image.createGraphics(), 0, 0);
            try {
                ImageIO.write(image, "JPG", cover);
            } catch (IOException e) {
                logger.error(I18N.translate("error.save_image"), e);
            }
View Full Code Here

    /* scale down icon to 16*16 pixels */
    ImageIcon smallIcon = new ImageIcon(rotatedIcon.getImage()
        .getScaledInstance(16, 16, Image.SCALE_SMOOTH));
    int w = smallIcon.getIconWidth(), h = smallIcon.getIconHeight();
    smallIcon.paintIcon(Main.map.mapView, g, (int) (pVia.x + vx + vx2) - w
        / 2, (int) (pVia.y + vy + vy2) - h / 2);

    if (r.selected) {
      g.setColor(selectedColor);
      g.drawRect((int) (pVia.x + vx + vx2) - w / 2 - 2, (int) (pVia.y
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.