16 package net.squiz.matrix.assetmap;
31 protected static final int[]
35 protected static final int[]
68 if (decorator.getIconWidth() > mainIcon.getIconWidth()) {
69 throw new IllegalArgumentException(
70 "decorator icon is wider than main icon");
72 if (decorator.getIconHeight() > mainIcon.getIconHeight()) {
73 throw new IllegalArgumentException(
74 "decorator icon is higher than main icon");
77 throw new IllegalArgumentException(
78 "xAlignment must be LEFT, RIGHT or CENTER");
81 throw new IllegalArgumentException(
82 "yAlignment must be TOP, BOTTOM or CENTER");
86 this.decorator = decorator;
99 for (
int i = 0; i < legal.length; i++) {
100 if (value == legal[i])
112 Image grayImage = GrayFilter.createDisabledImage(((ImageIcon)
mainIcon).getImage());
113 return new ImageIcon(grayImage);
143 public void paintIcon(Component c, Graphics g,
int x,
int y) {
149 x += (w - decorator.getIconWidth()) / 2;
152 x += (w - decorator.getIconWidth());
155 y += (h - decorator.getIconHeight()) / 2;
158 y += (h - decorator.getIconHeight());
160 decorator.paintIcon(c, g, x, y);