krysalis-jplugin/src/java/org/krysalis/swingx/swing EmptyIcon.java,NONE,1.1

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/krysalis-jplugin/src/java/org/krysalis/swingx/swing
In directory sc8-pr-cvs1:/tmp/cvs-serv26144/src/java/org/krysalis/swingx/swing

Added Files:
	EmptyIcon.java 
Log Message:
empty icon

--- NEW FILE: EmptyIcon.java ---
/*****************************************************************************
 * Copyright (C) The Krysalis project. All rights reserved.                  *
 * ------------------------------------------------------------------------- *
 * This software is published under the terms of the Krysalis Software       *
 * License version 1.1_01, a copy of which has been included  with this      *
 * distribution in the LICENSE file.                                         *
 *****************************************************************************/
package  org.krysalis.swingx.swing;

import java.awt.Component;
import java.awt.Graphics;
import javax.swing.Icon;

/**
* An icon having no graphical content, especially useful to align menu items.
*
* @author [email protected]
*/
final class EmptyIcon implements Icon {

  /**
  * Convenience objects for typical icons
  */
  static final EmptyIcon I16 = new EmptyIcon(16);
  static final EmptyIcon I24 = new EmptyIcon(24);
  static final EmptyIcon I32 = new EmptyIcon(32);
  static final EmptyIcon I48 = new EmptyIcon(48);
  static final EmptyIcon I64 = new EmptyIcon(64);
  static final EmptyIcon I128 = new EmptyIcon(128);
          
  private int size;
  
  /**
  * Constructor
  *
  * @param aSize length of any side of the icon in pixels, must 
  * be in the range 1..100 (inclusive).
  */
  EmptyIcon(int size) {
    this.size=size;
  }

  /**
  * Return the icon size (width is same as height).
  */
  public int getIconWidth() {
    return size;
  }

  /**
  * Return the icon size (width is same as height).
  */
  public int getIconHeight() {
    return size;
  }

  /**
  *  Paints nothing, it's an *empty* icon
  */
  public void paintIcon(Component c, Graphics g, int x, int y) {
    //...
  }

}




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.