1 7 8 package javax.swing.plaf; 9 10 import java.awt.Component ; 11 import java.awt.Graphics ; 12 import java.io.Serializable ; 13 import javax.swing.Icon ; 14 import javax.swing.plaf.UIResource ; 15 16 38 public class IconUIResource implements Icon , UIResource , Serializable 39 { 40 private Icon delegate; 41 42 47 public IconUIResource(Icon delegate) { 48 if (delegate == null) { 49 throw new IllegalArgumentException ("null delegate icon argument"); 50 } 51 this.delegate = delegate; 52 } 53 54 public void paintIcon(Component c, Graphics g, int x, int y) { 55 delegate.paintIcon(c, g, x, y); 56 } 57 58 public int getIconWidth() { 59 return delegate.getIconWidth(); 60 } 61 62 public int getIconHeight() { 63 return delegate.getIconHeight(); 64 } 65 66 } 67 | Popular Tags |