Package javax.swing

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


              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

      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

    final int gap = getIconTextGap();
    final String text = getText();
    final Insets insets = getInsets();
    if (icon != null && text != null)
    {
      icon.paintIcon(this, g2, insets.left, insets.top);
      g2.setFont(getFont());
      final FontMetrics fontMetrics = g2.getFontMetrics();
      final LineMetrics lineMetrics = fontMetrics.getLineMetrics(text, g2);
      final float baseLine = lineMetrics.getAscent();
      final float iconWidth = icon.getIconWidth();
View Full Code Here

      final float textY = insets.top + baseLine + (iconHeight - lineMetrics.getHeight());
      g2.drawString(text, textX, textY);
    }
    else if (icon != null)
    {
      icon.paintIcon(this, g2, insets.left, insets.top);
    }
    else if (text != null)
    {
      g2.setFont(getFont());
      final FontMetrics fontMetrics = g2.getFontMetrics();
View Full Code Here

            if (iCon != null) {
              x += getXoffset();
              w = iCon.getIconWidth();
              h = iCon.getIconHeight();
              y += (rect.height - h) / 2;
              iCon.paintIcon(this, g, x, y);
            }
          }
          g.setColor(Color.LIGHT_GRAY);
          if (status == PRESSED) {
            g.draw3DRect(x, y, w, h, false);
View Full Code Here

          if (iCon != null) {
            x += getXoffset();
            y += getYoffset();
            w = iCon.getIconWidth();
            h = iCon.getIconHeight();
            iCon.paintIcon(this, g, x, y);
          }
        }
        g.setColor(Color.LIGHT_GRAY);
        if (status == PRESSED) {
          g.draw3DRect(x, y, w, h, false);
View Full Code Here

          if (iCon != null) {
            x += icon * rect.width / 6 - iCon.getIconWidth() / 2;
            y += (rect.height - iCon.getIconHeight()) / 2;
            w = iCon.getIconWidth();
            h = iCon.getIconHeight();
            iCon.paintIcon(this, g, x, y);
          }
        }
        g.setColor(Color.LIGHT_GRAY);
        if (status == PRESSED) {
          g.draw3DRect(x, y, w, h, false);
View Full Code Here

    if( isEnabled() ) {
      icn = locked ? icnLocked : icnUnlocked;
    } else {
      icn = locked ? icnLockedD : icnUnlockedD;
    }
    icn.paintIcon( this, g, (getWidth() - 16) >> 1, (getHeight() - 16) >> 1 );
  }
}
View Full Code Here

            check.paintIcon(c, g, checkX, checkY);
        }

        icon = ButtonCommons.getCurrentIcon(item);
        if (icon != null) {
            icon.paintIcon(c, g, iconR.x, iconR.y);
        }
        paintText(g, item, textR, item.getText());
        paintAccelerator(g, viewR, iconR, textR, textIconGap, isLTR);
        g.setColor(oldColor);
    }
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.