Package javax.swing

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


            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

            icon = getDefaultIcon();
        }

        String clippedText = ButtonCommons.getPaintingParameters(button, viewR, iconR, textR, icon);
        if (icon != null) {
            icon.paintIcon(button, g, iconR.x, iconR.y);
        }
        textR.x += getTextShiftOffset();
        textR.y += getTextShiftOffset();
        paintText(g, button, textR, clippedText, getDisabledTextColor());
        if (button.isEnabled() && button.isFocusPainted() && button.isFocusOwner()) {
View Full Code Here

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

}
View Full Code Here

                                      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

      g2.translate(-c.getWidth(), -c.getHeight());
      break;
    }

    if(icon != null) {
      icon.paintIcon(c, g, paintIconR.x, paintIconR.y);
    }

    if(text != null) {
      int textX = paintTextR.x;
      int textY = paintTextR.y + fm.getAscent();
View Full Code Here

    Graphics      graphics = image.getGraphics();
   
    for (int i = 0; i < PlotConstants.MAX_NUMBER_OF_DATA_ITEMS_ON_A_PLOT; i++) {
      JMenuItem item = (JMenuItem) menu.getComponent(i);
      Icon      icon = item.getIcon();
      icon.paintIcon(item, graphics, 0, 0);
      int drawnRGB = image.getRGB(2, 2); // Go a couple pixels in, in case icon has border
      Assert.assertEquals(PlotLineColorPalette.getColor(i).getRGB(), drawnRGB);
    }
  }
 
View Full Code Here

        g.setColor(oldColor);
      }
     
      if (showToggle) {
        Icon drawIcon = (toggleState ? expandedIcon : collapsedIcon);
        drawIcon.paintIcon(c, g,
          x + indentWidth + (HOTSPOT_SIZE - 2 - drawIcon.getIconWidth()) / 2,
          y + (height - drawIcon.getIconHeight()) / 2);
      }
    }
View Full Code Here

                            img = ((ImageIcon) icn).getImage();
                        } else {
                            img = new BufferedImage(icn.getIconWidth(),
                                                    icn.getIconWidth(), BufferedImage.TYPE_4BYTE_ABGR);
                            Graphics g = img.getGraphics();
                            icn.paintIcon(c, g, 0, 0);
                        }
                    }
                    if (img == null) {
                        dge.startDrag(null, t, this);
                    } else {
View Full Code Here

        g2.setColor(getBackground());
        g2.fillRect(0, 0, getWidth(), getHeight());

        // draw in the icon
        if (icon != null) {
            icon.paintIcon(this, g2, insets.left, insets.top);
        }

        // figure out the text color
        Color textColor = selected ? SELECTED_TEXT_COLOR : TEXT_COLOR;
        if (transparent) {
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.