1 package jalview.util.imagemaker;
3 import jalview.bin.Cache;
5 public class BitmapImageSizing
7 public final float scale;
9 public final int width;
11 public final int height;
13 public BitmapImageSizing(float scale, int width, int height)
20 public boolean isNull()
22 return scale == 0.0f && width == 0 && height == 0;
25 public static BitmapImageSizing nullBitmapImageSizing()
27 return new BitmapImageSizing(0.0f, 0, 0);
30 public static final String BITMAP_SCALE = "BITMAP_SCALE";
32 public static final String BITMAP_HEIGHT = "BITMAP_HEIGHT";
34 public static final String BITMAP_WIDTH = "BITMAP_WIDTH";
38 * @return bean configured from Cache keys
40 public static BitmapImageSizing defaultBitmapImageSizing()
43 return new BitmapImageSizing(Cache.getDefault(BITMAP_SCALE, 0) / 10f,
44 Cache.getDefault(BITMAP_WIDTH, 0),
45 Cache.getDefault(BITMAP_HEIGHT, 0));