Package javax.swing

Examples of javax.swing.ImageIcon$AccessibleImageIcon


    /** Tool interface method. */
    public Container getFace() {
        JButton b = null;
        if (getUseAsTool()) {
            URL url = getClass().getResource("overview.gif");
            b = new JButton(new ImageIcon(url, frameTitle));
            b.setToolTipText(frameTitle);
            b.setMargin(new Insets(0, 0, 0, 0));
            b.addActionListener(getOverviewFrameActionListener());
            b.setBorderPainted(false);
        }
View Full Code Here


    public void resetButtons(boolean enableBackButton,
                             boolean enableForwardButton) {

        if (backIcon == null) {
            backIcon = new ImageIcon(getClass().getResource(backName));
        }

        if (dimBackIcon == null) {
            dimBackIcon = new ImageIcon(getClass().getResource(dimBackName));
        }

        if (forwardIcon == null) {
            forwardIcon = new ImageIcon(getClass().getResource(forwardName));
        }

        if (dimForwardIcon == null) {
            dimForwardIcon = new ImageIcon(getClass().getResource(dimForwardName));
        }

        ImageIcon active;
        String toolTip;
        String disabled = " ("
                + i18n.get(ProjectionStackTool.class, "disabled", "disabled")
                + ")";
        int size;
View Full Code Here

      {
          BufferedImage closeImage = getImageResource( "close.png" );
          BufferedImage closeHighlightImage = getImageResource( "close-highlight.png" );

          if( closeImage != null ) {
             closeIcon = new ImageIcon( closeImage );
          }

         if( closeHighlightImage != null ) {
            closeHighlightIcon = new ImageIcon( closeHighlightImage );
         }
      }

      closeLabel = new JLabel( closeIcon );
      closeLabel.addMouseListener( new MouseAdapter() {
View Full Code Here

            InputStream inputStream = resourceClass.getResourceAsStream(imageResourceName);
            if (inputStream != null) {
                try {
                    BufferedImage image = ImageIO.read(inputStream);

                    button = new BorderlessImageButton( action, new ImageIcon(image) );
                }
                catch (IOException e) {
                    LOGGER.error("Reading image " + imageResourceName, e);
                }
            }
View Full Code Here

   public static JToggleButton createToggleButton( Class resourceClass, String imageResourceName, String tooltip, Action action ) {

      JToggleButton button = null;

       if (imageResourceName != null) {
          ImageIcon icon = getImageIcon( resourceClass, imageResourceName );
          if( icon != null ) {
             button = new BorderlessImageToggleButton( action, icon );
          }
       }
View Full Code Here

       JMenuItem item = new JMenuItem( action );
       item.setText( name );

       if( imageResourceName != null )
       {
          ImageIcon icon = getImageIcon( resourceClass, imageResourceName );
          item.setIcon( icon );
       }

       return item;
    }
View Full Code Here

   {
      InputStream inputStream = resourceClass.getResourceAsStream(imageResourceName);
      if (inputStream != null) {
          try {
              BufferedImage image = ImageIO.read(inputStream);
              return new ImageIcon( image );
             }
          catch (IOException e) {
              LOGGER.error("Reading image " + imageResourceName, e);
          }
      }
View Full Code Here

     * with a specified image type (ARGB, RGB, etc). This will return
     * an empty ImageIcon, and you'd have to do the rendering into its
     * image.
     */
    public static ImageIcon createImageIcon(int width, int height, int imageType) {
        return new ImageIcon(new BufferedImage(width, height, imageType));
    }
View Full Code Here

     * DrawingAttributes can be used to add color/texture to the
     * IconPart geometries.
     */
    public static ImageIcon getIcon(int width, int height, IconPart geometry,
                                    DrawingAttributes appDA) {
        ImageIcon icon = createImageIcon(width, height);
        Graphics2D g = (Graphics2D) icon.getImage().getGraphics();
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);

        geometry.render(g, width, height, appDA);
        return icon;
View Full Code Here

            url = properties.getProperty(LPC_LINKRASTERIMAGEURL);

            if (url != null) {
                switch (renderType) {
                case RENDERTYPE_OFFSET:
                    raster = new OMRaster(lat, lon, x, y, new ImageIcon(url));
                    break;
                case RENDERTYPE_XY:
                    raster = new OMRaster(x, y, new ImageIcon(url));
                    break;
                case RENDERTYPE_LATLON:
                default:
                    raster = new OMRaster(lat, lon, new ImageIcon(url));
                }
            }
        }

        if (raster != null) {
View Full Code Here

TOP

Related Classes of javax.swing.ImageIcon$AccessibleImageIcon

Copyright © 2018 www.massapicom. 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.