Package javax.swing

Examples of javax.swing.Icon.paintIcon()


 
  @Override
  public void paintIcon(InstancePainter painter) {
    Object type = painter.getAttributeValue(ATTR_TYPE);
    Icon icon = type == TYPE_N ? ICON_N : ICON_P;
    icon.paintIcon(painter.getDestination(), painter.getGraphics(), 2, 2);
  }

  @Override
  public void paintInstance(InstancePainter painter) {
    drawInstance(painter, false);
View Full Code Here


          i = Icons.getIcon(n);
          if (i == null) n = null;
        }
      }
      if (i != null) {
        i.paintIcon(context.getDestination(), g, x + 2, y + 2);
      } else {
        super.paintIcon(context, x, y, attrs);
      }
    }
  }
View Full Code Here

    if (painter.getGateShape() == AppPreferences.SHAPE_SHAPED) {
      icon = ICON_SHAPED;
    } else {
      icon = ICON_RECTANGULAR;
    }
    icon.paintIcon(painter.getDestination(), painter.getGraphics(), 2, 2);
  }
 
  @Override
  public void paintGhost(InstancePainter painter) {
    Value pull = getPullValue(painter.getAttributeSet());
View Full Code Here

        int height = icon.getIconHeight();
        if (height < 0)
          height = PictureGraphic.this.getHeight() - ins.top - ins.bottom;
        BufferedImage buf = new BufferedImage(width, height,
            BufferedImage.TYPE_INT_ARGB);
        icon.paintIcon(label, buf.createGraphics(), 0, 0);
        if (label.negative) {
          buf = UIutils.invert(buf);
        } else if (!label.isOpaque()) {
          /*
           * for transparent pictures
View Full Code Here

        int height = icon.getIconHeight();
        if (height < 0)
          height = PictureGraphic.this.getHeight() - ins.top - ins.bottom;
        BufferedImage buf = new BufferedImage(width, height,
            BufferedImage.TYPE_INT_ARGB);
        icon.paintIcon(label, buf.createGraphics(), 0, 0);
        if (label.negative) {
          buf = UIutils.invert(buf);
        } else if (!label.isOpaque()) {
          /*
           * for transparent pictures
View Full Code Here

   */
  protected static void loadSystemIcon(String id, String name, YMessagesDialog ymd) {
    try {
      Icon e = UIManager.getIcon(name);
      ImageIcon i = new ImageIcon(new BufferedImage(e.getIconWidth(), e.getIconHeight(), BufferedImage.TYPE_4BYTE_ABGR));
      e.paintIcon(new JLabel(""), i.getImage().getGraphics(), 0, 0);
      add(id, i);
    } catch (Throwable t) {
      ymd.add(I18N.t("Kann Systemicon {0} nicht laden.", id), Level.INFO_INT);
      Log.ger.info("Can not load system icon " + name, t);
      addPNG(IconCache.class, "ico/" + id);
View Full Code Here

   */
  protected static void loadSystemIcon(String id, String name, YMessagesDialog ymd) {
    try {
      Icon e = UIManager.getIcon(name);
      ImageIcon i = new ImageIcon(new BufferedImage(e.getIconWidth(), e.getIconHeight(), BufferedImage.TYPE_4BYTE_ABGR));
      e.paintIcon(new JLabel(""), i.getImage().getGraphics(), 0, 0);
      add(id, i);
    } catch (Throwable t) {
      ymd.add(I18N.t("Kann Systemicon {0} nicht laden.", id), Priority.INFO_INT);
      Log.ger.info("Can not load system icon " + name, t);
      addPNG("ico/" + id, IconCache.class);
View Full Code Here

        int height = icon.getIconHeight();
        if (height < 0)
          height = PictureGraphic.this.getHeight() - ins.top - ins.bottom;
        BufferedImage buf = new BufferedImage(width, height,
            BufferedImage.TYPE_INT_ARGB);
        icon.paintIcon(label, buf.createGraphics(), 0, 0);
        if (label.negative) {
          buf = UIutils.invert(buf);
        } else if (!label.isOpaque()) {
          /*
           * for transparent pictures
View Full Code Here

        if (icon == null) {
            icon = getDefaultIcon();
        }
        if (icon != null) {
            icon.paintIcon(button, g, iconRect.x, iconRect.y);
        }
    }

}
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

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.