Package javax.swing

Examples of javax.swing.Icon.paintIcon()


    Graphics g = painter.getGraphics();
    g.setColor(Color.black);
    if (painter.getGateShape() == AppPreferences.SHAPE_RECTANGULAR) {
      Icon iconRect = getIconRectangular();
      if (iconRect != null) {
        iconRect.paintIcon(painter.getDestination(), g, 2, 2);
      } else {
        paintIconRectangular(painter);
      }
    } else if (painter.getGateShape() == AppPreferences.SHAPE_DIN40700) {
      Icon iconDin = getIconDin40700();
View Full Code Here


        paintIconRectangular(painter);
      }
    } else if (painter.getGateShape() == AppPreferences.SHAPE_DIN40700) {
      Icon iconDin = getIconDin40700();
      if (iconDin != null) {
        iconDin.paintIcon(painter.getDestination(), g, 2, 2);
      } else {
        paintIconRectangular(painter);
      }
    } else {
      Icon iconShaped = getIconShaped();
View Full Code Here

  @Override
  public void paintIcon(InstancePainter painter) {
    Graphics g = painter.getGraphics();
    Icon icon = isInverter ? ICON_INVERTER : ICON_BUFFER;
    if (icon != null) {
      icon.paintIcon(painter.getDestination(), g, 2, 2);
    } else {
      int x = isInverter ? 0 : 2;
      g.setColor(Color.BLACK);
      int[] xp = new int[] { x + 15, x + 1, x + 1, x + 15 };
      int[] yp = new int[] { 10,     3,     17,    10 };
View Full Code Here

        }
        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

          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

  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

            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

              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

              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

                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

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.