Examples of paintIcon()


Examples of javax.swing.Icon.paintIcon()

    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

Examples of javax.swing.Icon.paintIcon()

      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

Examples of javax.swing.Icon.paintIcon()

            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

Examples of javax.swing.Icon.paintIcon()

          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

Examples of javax.swing.Icon.paintIcon()

          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

Examples of javax.swing.Icon.paintIcon()

    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

Examples of javax.swing.Icon.paintIcon()

            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

Examples of javax.swing.Icon.paintIcon()

                                      viewRect, iconRect, textRect);

        int textY = Utilities.getTextY(fm, textRect);

        if (icon != null) {
            icon.paintIcon(label, g, iconRect.x, iconRect.y);
        }
        if (label.isEnabled()) {
            paintEnabledText(label, g, clippedText, textRect.x, textY);
        } else {
            paintDisabledText(label, g, clippedText, textRect.x, textY);
View Full Code Here

Examples of javax.swing.Icon.paintIcon()

        paintTitleBackground(g);

        if (menuBar == null) {
            Icon frameIcon = internals.getFrameIcon();
            if (frameIcon != null) {
                frameIcon.paintIcon(this, g, menuBarBounds.x, menuBarBounds.y);
            }
        }

        g.setColor(internals.isSelected()
                   ? selectedTextColor
View Full Code Here

Examples of javax.swing.Icon.paintIcon()

        }
        if (toPaint!=null) {
          Icon icon = toPaint.getIcon();
          if (icon!=null) {
            int y2 = y + (cellHeight-icon.getIconHeight())/2;
            icon.paintIcon(this, g, 0, y2);
          }
        }
      }

      // The next possible y-coordinate is just after the last line
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.