Package javax.swing

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


        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

        }
        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

        }
      }
      toPaint = new ImageIcon(image);
      this.iconMap.put(fadePos, toPaint);
    }
    toPaint.paintIcon(c, g, x, y);
  }
}
View Full Code Here

    // Necessary as some icons (like JInternalFrame's) don't have
    // disabled icons.
    if (icon!=null) {
      Graphics2D g2d = (Graphics2D)g;
      g2d.setComposite(OfficeXPUtilities.ICON_COMPOSITE);
      icon.paintIcon(b, g2d, iconRect.x, iconRect.y);
      g2d = null;
    }
  }

View Full Code Here

      if(icon == null) {
        // Use default icon
        icon = (Icon) menuItem.getIcon();
      }
      if (icon!=null)
        icon.paintIcon(menuItem,g, iconRect.x,iconRect.y);
    }

    else {
      icon = (Icon) menuItem.getIcon();
      if (icon!=null) {
View Full Code Here

        if (model.isArmed()|| (menuItem instanceof JMenu && model.isSelected())) {
          Icon disabledIcon = (Icon)menuItem.getDisabledIcon();
          // Sometimes this is null.  This will result in no
          // shadow under the "raised up" icon, but oh well...
          if (disabledIcon!=null)
            disabledIcon.paintIcon(menuItem,g, iconRect.x,iconRect.y);
          icon.paintIcon(menuItem,g, iconRect.x-2,iconRect.y-2);
        }
        else
          icon.paintIcon(menuItem,g, iconRect.x,iconRect.y);
      }
View Full Code Here

      OfficeXPUtilities.paintDisabledButtonIcon(g, b, iconRect);
    }
    else {
      icon = (Icon)b.getIcon();
      if (icon!=null)
        icon.paintIcon(c,g, iconRect.x, iconRect.y);
    }

  }

View Full Code Here

  public void paintIcon(ComponentDrawContext c, int x, int y) {
    FactoryDescription desc = description;
    if (desc != null && !desc.isFactoryLoaded()) {
      Icon icon = desc.getIcon();
      if (icon != null) {
        icon.paintIcon(c.getDestination(), c.getGraphics(), x + 2, y + 2);
        return;
      }
    }
   
    ComponentFactory source = getFactory();
View Full Code Here

        if (tool == listener.toolPressed && listener.inTool) {
          g.setColor(Color.darkGray);
          g.fillRect(x, y, ICON_WIDTH, ICON_HEIGHT);
        }
        Icon icon = tool.getIcon();
        if (icon != null) icon.paintIcon(this, g, x, y);
        if (tool == current) {
          GraphicsUtil.switchToWidth(g, 2);
          g.setColor(Color.black);
          g.drawRect(x - 1, y - 1, ICON_WIDTH + 2, ICON_HEIGHT + 2);
        }
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.