Esempio n. 1
0
 public static Dimension getScaledDimension(int width, int height) {
   if (FontUtils.getScale() == 1) {
     // dont need to scale
     return new Dimension(width, height);
   }
   return new Dimension(
       (int) (width * FontUtils.getScale()), (int) (height * FontUtils.getScale()));
 }
Esempio n. 2
0
 public static ImageIcon getScaledIcon(ImageIcon icon) {
   if (!isScaleImages()
       || icon == null
       || FontUtils.getScale() == 1
       || icon.getIconHeight() > STD_HEIGHT) {
     // dont need to scale
     return icon;
   }
   return new ImageIcon(
       ((ImageIcon) icon)
           .getImage()
           .getScaledInstance(
               (int) (icon.getIconWidth() * FontUtils.getScale()),
               (int) (icon.getIconHeight() * FontUtils.getScale()),
               Image.SCALE_SMOOTH));
 }
Esempio n. 3
0
 public static Icon getScaledIcon(Icon icon) {
   if (!isScaleImages()
       || icon == null
       || FontUtils.getScale() == 1
       || !(icon instanceof ImageIcon)) {
     // dont need to scale (or cant)
     return icon;
   }
   return getScaledIcon((ImageIcon) icon);
 }
Esempio n. 4
0
 public static int getScaledSize(int size) {
   return (int) (size * FontUtils.getScale());
 }