Example #1
0
 /**
  * returns a high quality icon for this domain. most domains do not support this and will return
  * null; the icon is NOT cached. use with care
  *
  * @param i
  * @return
  */
 public Icon getIcon(int size) {
   Icon ret = null;
   if (NewTheme.I().hasIcon("fav/big." + getTld())) {
     ret = NewTheme.I().getIcon("fav/big." + getTld(), -1);
   }
   if (ret == null && NewTheme.I().hasIcon("fav/" + getTld())) {
     ret = NewTheme.I().getIcon("fav/" + getTld(), -1);
   }
   if (ret != null && ret.getIconHeight() >= size && ret.getIconWidth() >= size) {
     return IconIO.getScaledInstance(ret, size, size);
   }
   ret = FavIcons.getFavIcon(getTld(), null);
   if (ret.getIconHeight() >= size && ret.getIconWidth() >= size) {
     return IconIO.getScaledInstance(ret, size, size);
   }
   return null;
 }
Example #2
0
 /**
  * @param resource
  * @param i
  * @return
  */
 public static ImageIcon getImageIcon(final URL resource, final int size) {
   if (size <= 0) {
     return new ImageIcon(IconIO.getImage(resource));
   } else {
     return new ImageIcon(
         IconIO.getScaledInstance(
             IconIO.getImage(resource), size, size, Interpolation.BICUBIC, true));
   }
 }
Example #3
0
 public Icon setFavIcon(Icon icon) {
   if (icon == null) {
     icon = hosterIcon;
     if (icon != null) {
       return icon;
     }
     icon = FavIcons.getFavIcon(getTld(), this);
   }
   if (icon != null) {
     icon = IconIO.getScaledInstance(icon, WIDTH, HEIGHT, Interpolation.BICUBIC);
   }
   hosterIcon = icon;
   return icon;
 }
Example #4
0
 /**
  * @param image
  * @param i
  * @param j
  * @return
  */
 public static BufferedImage getScaledInstance(
     final Image img, final int width, final int height) {
   // TODO Auto-generated method stub
   return IconIO.getScaledInstance(img, width, height, Interpolation.BICUBIC, true);
 }
Example #5
0
 public static Icon getScaledInstance(final Icon icon, final int width, final int height) {
   // TODO Auto-generated method stub
   return IconIO.getScaledInstance(icon, width, height, Interpolation.BICUBIC);
 }