Browse Source

Merge pull request #1047 in DESIGN/design from ~BRYANT/design:feature/10.0 to feature/10.0

* commit '07c249e6611740fee333c64b5760daf612e2201a':
  无jira任务 sonar问题修复
research/11.0
Bryant 5 years ago
parent
commit
ff6261213a
  1. 2
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaEditorKit.java
  2. 10
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/VolatileImageBackgroundPainterStrategy.java
  3. 6
      designer-base/src/main/java/com/fr/design/icon/LockIcon.java
  4. 1
      designer-base/src/main/java/com/fr/design/icon/WarningIcon.java

2
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaEditorKit.java

@ -902,6 +902,8 @@ public class RTextAreaEditorKit extends DefaultEditorKit {
} }
} catch (BadLocationException bl) { } catch (BadLocationException bl) {
} }
}else if (textArea == null) {
throw new IllegalArgumentException("RTextArea can not be null!");
} }
if (beep) if (beep)

10
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/VolatileImageBackgroundPainterStrategy.java

@ -9,6 +9,8 @@
*/ */
package com.fr.design.gui.syntax.ui.rtextarea; package com.fr.design.gui.syntax.ui.rtextarea;
import com.fr.log.FineLoggerFactory;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Image; import java.awt.Image;
import java.awt.image.VolatileImage; import java.awt.image.VolatileImage;
@ -95,9 +97,9 @@ public class VolatileImageBackgroundPainterStrategy
try { try {
tracker.waitForID(1); tracker.waitForID(1);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); FineLoggerFactory.getLogger().error(e.getMessage(),e);
bgImage = null; bgImage = null;
return; Thread.currentThread().interrupt();
} finally { } finally {
tracker.removeImage(i, 1); tracker.removeImage(i, 1);
} }
@ -106,9 +108,9 @@ public class VolatileImageBackgroundPainterStrategy
try { try {
tracker.waitForID(0); tracker.waitForID(0);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); FineLoggerFactory.getLogger().error(e.getMessage(),e);
bgImage = null; bgImage = null;
return; Thread.currentThread().interrupt();
} finally { } finally {
tracker.removeImage(bgImage, 0); tracker.removeImage(bgImage, 0);
} }

6
designer-base/src/main/java/com/fr/design/icon/LockIcon.java

@ -34,6 +34,7 @@ public class LockIcon extends ImageIcon {
} }
} }
@Override
public void paintIcon(Component c, Graphics g, int x, int y) { public void paintIcon(Component c, Graphics g, int x, int y) {
if (mainImage != null) { if (mainImage != null) {
g.drawImage(mainImage, x, y, c); g.drawImage(mainImage, x, y, c);
@ -48,6 +49,7 @@ public class LockIcon extends ImageIcon {
* *
* @param image the image * @param image the image
*/ */
@Override
protected void loadImage(Image image) { protected void loadImage(Image image) {
synchronized (tracker) { synchronized (tracker) {
tracker.addImage(image, 0); tracker.addImage(image, 0);
@ -55,6 +57,7 @@ public class LockIcon extends ImageIcon {
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();
} }
loadStatus = tracker.statusID(0, false); loadStatus = tracker.statusID(0, false);
@ -70,6 +73,7 @@ public class LockIcon extends ImageIcon {
* *
* @return the <code>Image</code> object for this <code>ImageIcon</code> * @return the <code>Image</code> object for this <code>ImageIcon</code>
*/ */
@Override
public Image getImage() { public Image getImage() {
return mainImage; return mainImage;
} }
@ -85,6 +89,7 @@ public class LockIcon extends ImageIcon {
* *
* @return the width in pixels of this icon * @return the width in pixels of this icon
*/ */
@Override
public int getIconWidth() { public int getIconWidth() {
return width; return width;
} }
@ -94,6 +99,7 @@ public class LockIcon extends ImageIcon {
* *
* @return the height in pixels of this icon * @return the height in pixels of this icon
*/ */
@Override
public int getIconHeight() { public int getIconHeight() {
return height; return height;
} }

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

@ -59,6 +59,7 @@ public class WarningIcon extends ImageIcon {
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();
} }
tracker.statusID(0, false); tracker.statusID(0, false);

Loading…
Cancel
Save