Package javax.swing

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


  @Override
  public void paint(final Graphics g) {
    final Icon latexIcon = teXFormula.createTeXIcon(TeXConstants.STYLE_DISPLAY, DEFAULT_FONT_SIZE * zoom);
    final Insets insets = getInsets();
    latexIcon.paintIcon(this, g, insets.left, insets.top);
    super.paint(g);
  }

  public void setModel(final LatexExtension latexExtension) {
    model = latexExtension;
View Full Code Here

      final Icon icon = uiIcon.getIcon();
      final int width = icon.getIconWidth();
      final int height = icon.getIconHeight();
      final BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
      final Graphics2D g = image.createGraphics();
      icon.paintIcon(null, g, 0, 0);
      final Image scaledImage = image.getScaledInstance((int) (width * zoom), (int) (height * zoom),
          Image.SCALE_SMOOTH);
      zoomedIcon = new ImageIcon(scaledImage);
      icons.put(zoom, zoomedIcon);
      g.dispose();
View Full Code Here

        if(this.image != null)return;
       
        Icon icon = fsView.getSystemIcon(this.item.getFile());
        BufferedImage img = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_RGB);      
        Graphics g = img.createGraphics();
        icon.paintIcon(this, g, icon.getIconWidth(), icon.getIconHeight());
        this.image = img;
        this.repaint();
    }
   
    /**
 
View Full Code Here

      super.paintComponent(g);
      if (! cell.isEmpty())
      {
        Icon image = cell.getTop().getImage();
      int y = (getHeight() - image.getIconHeight()) / 2;
      image.paintIcon(this, g, 0, y);
          if (isSelected)
          {
            g.setColor(highlight);
          g.fillRect(0, y, cardWidth, cardHeight);
          }
View Full Code Here

  {
      super.paintComponent(g);
      Icon image = Card.getBack();
        int x = (getWidth() - image.getIconWidth()) / 2;
        int y = (getHeight() - image.getIconHeight()) / 2;
        image.paintIcon(this, g, x, y);
  }
}
View Full Code Here

        Rectangle paintViewR = new Rectangle();
        Rectangle paintIconR = new Rectangle();
    Rectangle paintTextR = new Rectangle();
    layoutCL(label, null, null, icon, paintViewR, paintIconR, paintTextR);
        if (icon != null) {
            icon.paintIcon(label, g, paintIconR.x, paintIconR.y);
        }
        textRenderingIcon.paintIcon(label, g, paintTextR.x, paintTextR.y);
  }

  @Override
View Full Code Here

      {
        for (Card c: cell)
        {
          image = c.getImage();
          x = (getWidth() - image.getIconWidth()) / 2;
          image.paintIcon(this, g, x, y);
          y += 22;
        }
      }
      else {
        image = Card.getBack();
View Full Code Here

      if (! cell.isEmpty())
      {
        image = cell.getTop().getImage();
        int x = (getWidth() - image.getIconWidth()) / 2;
        int y = (getHeight() - image.getIconHeight()) / 2;
        image.paintIcon(this, g, x, y);
      }
      else
      {       
        image = Card.getBack();
        g.setColor(Color.white);
View Full Code Here

                        picture.setSize(thumbnailSize);
                        picture.runValidate();
                        Image im = picture.getImage(obs);
                        Graphics2D g = Sprite.wrapRendering(Sprite._createImageGraphics(im));
                        Icon ic = UIMessage._getIcon(UIMessage.LOAD_TYPE, false);
                        ic.paintIcon(obs, g, (int) ((float) (picture.getWidth() - ic.getIconWidth()) / 2f), (int) ((float) (picture.getWidth() - ic.getIconWidth()) / 2f));
                        g.dispose();
                }
                picture.setMultiThreadingEnabled(multiThreading);
                updateIIOListeners(picture);
                picture.setMt(mt, obs);
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.