Examples of paintIcon()


Examples of javax.swing.Icon.paintIcon()

        }
        else {
          iconHeight = Math.max(iconHeight, icon.getIconHeight());
        }
        if ((y + iconHeight) < mHeight) {
          icon.paintIcon(this, grp, currentX, y);
        }
        if (nextColumn) {
          currentX += icon.getIconWidth() + ICON_DISTANCE_X;
        }
        if (!nextColumn || (colCount == 1)) {
View Full Code Here

Examples of javax.swing.Icon.paintIcon()

          if (icon != null) {
            // Create a half transparent drag image from icon
            BufferedImage image = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
            Graphics2D g2D = (Graphics2D)image.getGraphics();
            g2D.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.66f));
            icon.paintIcon(component, g2D, 0, 0);
            g2D.dispose();
           
            ev.startDrag(null, image, new Point(12, 24),  transferable, this);
          } else {
            // Force the use of an empty image otherwise Mac OS X uses a grey rectangle
View Full Code Here

Examples of javax.swing.Icon.paintIcon()

  private BufferedImage getErrorImage() {
    Icon errorIcon = IconManager.getInstance().getErrorIcon(16);
    BufferedImage errorImage = new BufferedImage(
        errorIcon.getIconWidth(), errorIcon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
    Graphics2D g2D = (Graphics2D)errorImage.getGraphics();
    errorIcon.paintIcon(this, g2D, 0, 0);
    g2D.dispose();
    return errorImage;
  }
 
  /**
 
View Full Code Here

Examples of javax.swing.Icon.paintIcon()

            if (icon.getIconWidth() != icon.getIconHeight()) {
              Graphics2D g2D = (Graphics2D)g;
              AffineTransform previousTransform = g2D.getTransform();
              g2D.translate(x + 3, y + 3);
              g2D.scale((float)icon.getIconHeight() / icon.getIconWidth(), 1);
              icon.paintIcon(c, g2D, 0, 0);
              g2D.setTransform(previousTransform);
            } else {
              icon.paintIcon(c, g, x + 3, y + 3);
            }
          }
View Full Code Here

Examples of javax.swing.Icon.paintIcon()

              g2D.translate(x + 3, y + 3);
              g2D.scale((float)icon.getIconHeight() / icon.getIconWidth(), 1);
              icon.paintIcon(c, g2D, 0, 0);
              g2D.setTransform(previousTransform);
            } else {
              icon.paintIcon(c, g, x + 3, y + 3);
            }
          }
        }
      });
   
View Full Code Here

Examples of javax.swing.Icon.paintIcon()

              if (icon.getIconWidth() != icon.getIconHeight()) {
                Graphics2D g2D = (Graphics2D)g;
                AffineTransform previousTransform = g2D.getTransform();
                g2D.translate(x, y);
                g2D.scale((float)icon.getIconHeight() / icon.getIconWidth(), 1);
                icon.paintIcon(c, g2D, 0, 0);
                g2D.setTransform(previousTransform);
              } else {
                icon.paintIcon(c, g, x, y);
              }
            }
View Full Code Here

Examples of javax.swing.Icon.paintIcon()

                g2D.translate(x, y);
                g2D.scale((float)icon.getIconHeight() / icon.getIconWidth(), 1);
                icon.paintIcon(c, g2D, 0, 0);
                g2D.setTransform(previousTransform);
              } else {
                icon.paintIcon(c, g, x, y);
              }
            }
          });
        setFont(texture.isModifiable() ? this.modifiablePieceFont : this.defaultFont);
        return component;
View Full Code Here

Examples of javax.swing.Icon.paintIcon()

                    floorTextureImagesCache.put(floorTexture.getImage(), ERROR_TEXTURE_IMAGE);                   
                  } else {
                    BufferedImage textureIconImage = new BufferedImage(
                        textureIcon.getIconWidth(), textureIcon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
                    Graphics2D g2DIcon = (Graphics2D)textureIconImage.getGraphics();
                    textureIcon.paintIcon(this, g2DIcon, 0, 0);
                    g2DIcon.dispose();
                    floorTextureImagesCache.put(floorTexture.getImage(), textureIconImage);
                  }
                } else {
                  // Prefer to share textures images with texture manager if it's available
View Full Code Here

Examples of javax.swing.Icon.paintIcon()

              setTexturedIcon(c, ERROR_TEXTURE_IMAGE);                   
            } else {
              BufferedImage textureIconImage = new BufferedImage(
                  textureIcon.getIconWidth(), textureIcon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
              Graphics2D g2DIcon = (Graphics2D)textureIconImage.getGraphics();
              textureIcon.paintIcon(c, g2DIcon, 0, 0);
              g2DIcon.dispose();
              setTexturedIcon(c, textureIconImage);
            }
          } else {
            // Prefer to share textures images with texture manager if it's available
View Full Code Here

Examples of javax.swing.Icon.paintIcon()

      int w = overlay.getIconWidth();
      int h = overlay.getIconHeight();

      g.setColor(Color.white);
      g.fill3DRect(x1-1, y1-1, w+2, h+2, true);
      overlay.paintIcon(c, g, x1, y1);
    }
  }

  /**
   * Resizes an image using a Graphics2D object backed by a BufferedImage.
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.