Browse Source

Merge pull request #1039 in DESIGN/design from ~LUCIAN.CHEN/design:feature/10.0 to feature/10.0

* commit 'ff6238a50f9d5717b2c789126a71232bcdb93b91':
  无jira任务,sonar问题修复
research/11.0
Lucian.Chen 5 years ago
parent
commit
9e0151dcd1
  1. 4
      designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBoxUI.java
  3. 1
      designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBox.java
  4. 1
      designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBoxTest.java

4
designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java

@ -125,8 +125,7 @@ public class UICheckBox extends JCheckBox implements UIObserver, GlobalNameObser
private class UICheckBoxUI extends MetalCheckBoxUI { private class UICheckBoxUI extends MetalCheckBoxUI {
@Override @Override
public void paint(Graphics g, JComponent c) { public synchronized void paint(Graphics g, JComponent c) {
synchronized (this) {
AbstractButton b = (AbstractButton) c; AbstractButton b = (AbstractButton) c;
ButtonModel model = b.getModel(); ButtonModel model = b.getModel();
Dimension size = c.getSize(); Dimension size = c.getSize();
@ -179,7 +178,6 @@ public class UICheckBox extends JCheckBox implements UIObserver, GlobalNameObser
// Draw the Text // Draw the Text
drawLine(text, g, b, c, textRect, fm); drawLine(text, g, b, c, textRect, fm);
} }
}
private void drawLine(String text, Graphics g, AbstractButton b, JComponent c, Rectangle textRect, FontMetrics fm) { private void drawLine(String text, Graphics g, AbstractButton b, JComponent c, Rectangle textRect, FontMetrics fm) {
if (text != null) { if (text != null) {

2
designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBoxUI.java

@ -64,7 +64,7 @@ public class UICheckBoxUI extends MetalCheckBoxUI {
} }
} }
static BasicStroke focusStroke = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 1.0f, new float[]{1.0f / 1.0f}, 1.0f); static BasicStroke focusStroke = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 1.0f, new float[]{1.0f}, 1.0f);
protected void paintFocus(Graphics g, Rectangle t, Dimension arg2) { protected void paintFocus(Graphics g, Rectangle t, Dimension arg2) {
if (!ThemeUtils.BUTTON_FOCUS) { if (!ThemeUtils.BUTTON_FOCUS) {

1
designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBox.java

@ -84,6 +84,7 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen
LazyComboBox.this.loadList(get()); LazyComboBox.this.loadList(get());
} catch (InterruptedException | ExecutionException exception) { } catch (InterruptedException | ExecutionException exception) {
FineLoggerFactory.getLogger().debug(exception.getMessage()); FineLoggerFactory.getLogger().debug(exception.getMessage());
Thread.currentThread().interrupt();
} }
LazyComboBox.this.showPopup(); LazyComboBox.this.showPopup();
} }

1
designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBoxTest.java

@ -40,6 +40,7 @@ public class LazyComboBoxTest {
Thread.sleep(3000); Thread.sleep(3000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
Thread.currentThread().interrupt();
} }
return m; return m;
} }

Loading…
Cancel
Save