Package javax.swing

Examples of javax.swing.Icon.paintIcon()


        int h = icon.getIconHeight();
        int w = icon.getIconWidth();
        int x = b.getWidth()/2 - w/2;
        int y = b.getHeight()/2 - h/2;

        icon.paintIcon(b, g, x, y);
    }

    protected Icon getIcon(AbstractButton button) {
        boolean active = isParentActive(button);
View Full Code Here


        Icon icon = titlebar.getIcon();
        Rectangle r = getIconRect(titlebar);

        Rectangle paintRect = getPaintRect(titlebar);
        g.translate(paintRect.x, paintRect.y);
        icon.paintIcon(titlebar, g, r.x, r.y);
        g.translate(-paintRect.x, -paintRect.y);
    }

    protected Rectangle getIconRect(Titlebar titlebar) {
        Icon icon = titlebar.getIcon();
View Full Code Here

              Icon icon = ti.getIcon();
              if (icon!=null) {
                int lineY = rsta.yForLine(line);
                if (lineY>=y && lineY<=visibleRect.y+visibleRect.height) {
                  int y2 = lineY + (cellHeight-icon.getIconHeight())/2;
                  icon.paintIcon(this, g, 0, y2);
                  lastLine = line-1; // Paint only 1 icon per line
                }
              }
            } catch (BadLocationException ble) {
              ble.printStackTrace(); // Never happens
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

    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

    private void displayException(Thread t, Throwable e) {
        final JFrame exceptionFrame = new JFrame("Uncaught exception: " + e.getMessage());
        Icon errorIcon = UIManager.getIcon("OptionPane.errorIcon");
        BufferedImage errorImage = new BufferedImage(
                errorIcon.getIconWidth(), errorIcon.getIconHeight(), BufferedImage.TYPE_INT_RGB);
        errorIcon.paintIcon(null, errorImage.getGraphics(), 0, 0);
        exceptionFrame.setIconImage(errorImage);
        exceptionFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        JPanel contentPanel = new JPanel(new BorderLayout(5, 5));
        contentPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        contentPanel.add(new JLabel("An uncaught exception has occurred: "), BorderLayout.NORTH);
View Full Code Here

        Graphics g = painter.getGraphics();
        g.setColor(Color.black);
        if (painter.getGateShape() == AppPreferences.SHAPE_RECTANGULAR) {
            Icon iconRect = getIconRectangular();
            if (iconRect != null) {
                iconRect.paintIcon(painter.getDestination(), g, 2, 2);
            } else {
                paintIconRectangular(painter);
            }
        } else if (painter.getGateShape() == AppPreferences.SHAPE_DIN40700) {
            Icon iconDin = getIconDin40700();
View Full Code Here

                paintIconRectangular(painter);
            }
        } else if (painter.getGateShape() == AppPreferences.SHAPE_DIN40700) {
            Icon iconDin = getIconDin40700();
            if (iconDin != null) {
                iconDin.paintIcon(painter.getDestination(), g, 2, 2);
            } else {
                paintIconRectangular(painter);
            }
        } else {
            Icon iconShaped = getIconShaped();
View Full Code Here

                paintIconRectangular(painter);
            }
        } else {
            Icon iconShaped = getIconShaped();
            if (iconShaped != null) {
                iconShaped.paintIcon(painter.getDestination(), g, 2, 2);
            } else {
                paintIconShaped(painter);
            }
        }
    }
View Full Code Here

    @Override
    public void paintIcon(InstancePainter painter) {
        Graphics g = painter.getGraphics();
        Icon icon = isInverter ? ICON_INVERTER : ICON_BUFFER;
        if (icon != null) {
            icon.paintIcon(painter.getDestination(), g, 2, 2);
        } else {
            int x = isInverter ? 0 : 2;
            g.setColor(Color.BLACK);
            int[] xp = new int[] { x + 15, x + 1, x + 1, x + 15 };
            int[] yp = new int[] { 10,     3,     17,    10 };
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.