Browse Source

常量命名规范修复

release/11.0
obo 2 years ago
parent
commit
1a040cf5cd
  1. 22
      designer-base/src/main/java/com/fr/design/icon/WarningIcon.java

22
designer-base/src/main/java/com/fr/design/icon/WarningIcon.java

@ -16,10 +16,10 @@ import java.awt.image.ImageObserver;
* @since 2012-3-28下午10:20:29 * @since 2012-3-28下午10:20:29
*/ */
public class WarningIcon extends ImageIcon { public class WarningIcon extends ImageIcon {
protected final static Component component = new Component() { protected final static Component COMPONENT = new Component() {
}; };
protected final static MediaTracker tracker = new MediaTracker(component); protected final static MediaTracker TRACKER = new MediaTracker(COMPONENT);
private final static Image warnighImage = SVGLoader.load("/com/fr/design/standard/warning.svg"); private final static Image WARNING_IMAGE = SVGLoader.load("/com/fr/design/standard/warning.svg");
private Image mainImage = null; private Image mainImage = null;
private ImageObserver imageObserver; private ImageObserver imageObserver;
@ -40,8 +40,8 @@ public class WarningIcon extends ImageIcon {
if (mainImage != null) { if (mainImage != null) {
g.drawImage(mainImage, x, y, c); g.drawImage(mainImage, x, y, c);
} }
if (warnighImage != null) { if (WARNING_IMAGE != null) {
g.drawImage(warnighImage, x, y, c); g.drawImage(WARNING_IMAGE, x, y, c);
} }
SvgPaintUtils.afterPaint((Graphics2D) g); SvgPaintUtils.afterPaint((Graphics2D) g);
} }
@ -53,17 +53,17 @@ public class WarningIcon extends ImageIcon {
* the image * the image
*/ */
protected void loadImage(Image image) { protected void loadImage(Image image) {
synchronized (tracker) { synchronized (TRACKER) {
tracker.addImage(image, 0); TRACKER.addImage(image, 0);
try { try {
tracker.waitForID(0, 0); TRACKER.waitForID(0, 0);
} catch (InterruptedException e) { } catch (InterruptedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} }
tracker.statusID(0, false); TRACKER.statusID(0, false);
tracker.removeImage(image, 0); TRACKER.removeImage(image, 0);
width = image.getWidth(imageObserver); width = image.getWidth(imageObserver);
height = image.getHeight(imageObserver); height = image.getHeight(imageObserver);
@ -104,6 +104,6 @@ public class WarningIcon extends ImageIcon {
} }
{ {
loadImage(warnighImage); loadImage(WARNING_IMAGE);
} }
} }
Loading…
Cancel
Save