diff --git a/designer-base/src/main/java/com/fr/design/gui/UIDefaultTheme.java b/designer-base/src/main/java/com/fr/design/gui/UIDefaultTheme.java index 26030c47c..78750e389 100644 --- a/designer-base/src/main/java/com/fr/design/gui/UIDefaultTheme.java +++ b/designer-base/src/main/java/com/fr/design/gui/UIDefaultTheme.java @@ -76,7 +76,6 @@ public class UIDefaultTheme extends DefaultMetalTheme { table.put("Table.background", ThemeUtils.TEXT_BG_COLOR); table.put("Table.selectionForeground", ThemeUtils.NORMAL_FOREGROUND); table.put("Table.selectionBackground", new ColorUIResource(200, 221, 233)); - table.put("Table.gridColor", new ColorUIResource(200, 221, 233)); table.put("TableHeader.background", new ColorUIResource(229, 229, 229)); table.put("ProgressBar.foreground", ThemeUtils.PROCESS_COLOR); table.put("ProgressBar.background", ThemeUtils.TEXT_BG_COLOR); @@ -85,7 +84,6 @@ public class UIDefaultTheme extends DefaultMetalTheme { table.put("ProgressBar.selectionForeground", ThemeUtils.NORMAL_FOREGROUND); table.put("ProgressBar.selectionBackground", ThemeUtils.NORMAL_FOREGROUND); table.put("PopupMenu.background", ThemeUtils.NORMAL_BG); - table.put("TabbedPane.background", ThemeUtils.TEXT_BG_COLOR); table.put("TabbedPane.background", ThemeUtils.NORMAL_BG); table.put("TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 0)); table.put("TabbedPane.tabInsets", new InsetsUIResource(1, 6, 4, 6)); @@ -108,7 +106,6 @@ public class UIDefaultTheme extends DefaultMetalTheme { table.put("ComboBox.foreground", ThemeUtils.NORMAL_FOREGROUND); table.put("ComboBox.background", ThemeUtils.TEXT_BG_COLOR); table.put("ComboBox.disabledBackground", ThemeUtils.TEXT_DISABLED_BG_COLOR); - table.put("EditorPane.background", ThemeUtils.TEXT_BG_COLOR); table.put("EditorPane.foreground", ThemeUtils.NORMAL_FOREGROUND); table.put("PasswordField.background", ThemeUtils.TEXT_BG_COLOR); table.put("PasswordField.foreground", ThemeUtils.NORMAL_FOREGROUND); diff --git a/designer-base/src/main/java/com/fr/design/gui/autocomplete/LanguageAwareCompletionProvider.java b/designer-base/src/main/java/com/fr/design/gui/autocomplete/LanguageAwareCompletionProvider.java index b9d9afcc0..8bc805f46 100644 --- a/designer-base/src/main/java/com/fr/design/gui/autocomplete/LanguageAwareCompletionProvider.java +++ b/designer-base/src/main/java/com/fr/design/gui/autocomplete/LanguageAwareCompletionProvider.java @@ -195,6 +195,9 @@ public class LanguageAwareCompletionProvider extends CompletionProviderBase // provider. We do not do function/method completions while editing // strings or comments. CompletionProvider provider = getProviderFor(tc); + if (provider == null) { + return null; + } return provider==defaultProvider ? provider.getParameterizedCompletions(tc) : null; } diff --git a/designer-base/src/main/java/com/fr/design/gui/autocomplete/ParameterizedCompletionContext.java b/designer-base/src/main/java/com/fr/design/gui/autocomplete/ParameterizedCompletionContext.java index a9dd305b0..78d5e74a4 100644 --- a/designer-base/src/main/java/com/fr/design/gui/autocomplete/ParameterizedCompletionContext.java +++ b/designer-base/src/main/java/com/fr/design/gui/autocomplete/ParameterizedCompletionContext.java @@ -517,6 +517,10 @@ class ParameterizedCompletionContext { } } + if (currentNext == null) { + return; + } + // No params after caret - go to first one if (currentNext.getStartOffset() + 1 <= dot) { int nextIndex = getFirstHighlight(highlights); diff --git a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java index 615a17bce..e94b18269 100644 --- a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java @@ -146,6 +146,8 @@ public class ColumnRowPane extends JPanel implements UIObserver { if (cftf != null) { cftf.setColumns(3); // specify more width than we need cftf.setHorizontalAlignment(UITextField.LEFT); + }else { + throw new IllegalArgumentException("Spinner'Editor can not be null!"); } ((AbstractDocument) cftf.getDocument()).setDocumentFilter(new DocumentFilter() { diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java index c5786b4c6..be169a744 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java @@ -1,8 +1,8 @@ package com.fr.design.gui.controlpane; import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; import com.fr.design.beans.BasicBeanPane; +import com.fr.stable.AssistUtils; /** * Created by plough on 2017/8/1. @@ -48,7 +48,7 @@ public abstract class ObjectUIControlPane extends UIListControlPane { if (constructor != null) { return constructor; } else { - if (cls.getName() == Object.class.getName()) { + if (AssistUtils.equals(cls.getName(),Object.class.getName())) { return null; } return getConstructor(clazz, cls.getSuperclass()); diff --git a/designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java b/designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java index fb44f618f..be3ef20a3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java +++ b/designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java @@ -157,7 +157,7 @@ public class UIDatePicker extends UIComboBox implements Serializable { /** * 设置当前选择的日期 */ - public void setSelectedDate(Date date) throws ParseException { + public synchronized void setSelectedDate(Date date) throws ParseException { if (date == null) { this.setSelectedItem(null); } else { @@ -165,6 +165,7 @@ public class UIDatePicker extends UIComboBox implements Serializable { } } + @Override public void setSelectedItem(Object anObject) { model.setSelectedItem(anObject); super.setSelectedItem(anObject); @@ -192,12 +193,14 @@ public class UIDatePicker extends UIComboBox implements Serializable { setBorder(BorderFactory.createEmptyBorder()); } + @Override public void hide() { if (isWillHide) { super.hide(); } } + @Override public void show() { if (isWillHide || UIDatePicker.this.isEnabled() == false) { return; @@ -211,6 +214,7 @@ public class UIDatePicker extends UIComboBox implements Serializable { /** * 显示弹出面板 */ + @Override protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { @@ -250,12 +254,14 @@ public class UIDatePicker extends UIComboBox implements Serializable { } } + @Override protected ComboBoxUI getUIComboBoxUI() { return new UIComboBoxUI() { + @Override protected ComboPopup createPopup() { return new DatePopup(comboBox); } - + @Override public void mousePressed(MouseEvent e) { if (UIDatePicker.this.isPopupVisible()) { isWillHide = true; diff --git a/designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java b/designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java index 2eb93ad3e..b17323774 100644 --- a/designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java +++ b/designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java @@ -35,6 +35,7 @@ public class LoadingPaneDemo extends JPanel { Thread.sleep(500); } catch (InterruptedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); } container.add(new UIButton(i + "adfadwdadawdwad")); } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java b/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java index 7c454ad71..e3a1ae7d7 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java @@ -24,6 +24,7 @@ public class LoadingBasicPaneTest { Thread.sleep(500); } catch (InterruptedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); } container.add(new UIButton(i + "adfadwdadawdwad")); } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UINumberSlidePane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UINumberSlidePane.java index 7585c0949..5faa21b3c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UINumberSlidePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UINumberSlidePane.java @@ -14,6 +14,7 @@ import javax.swing.event.ChangeListener; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.style.NumberDragBar; +import com.fr.stable.AssistUtils; /** * 拖拽的滑条和对应滑条值的数字 @@ -65,7 +66,7 @@ public class UINumberSlidePane extends BasicBeanPane { public void checkValue(double value) { value = Math.max(value, minValue); value = Math.min(value, maxValue); - if (this.value == value) { + if (AssistUtils.equals(this.value, value)) { return; } double diff = Math.abs(value - this.value); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java index ca44c8a22..798b79af0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java @@ -10,6 +10,7 @@ import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.stable.AssistUtils; import com.fr.stable.StringUtils; import javax.swing.*; @@ -81,7 +82,7 @@ public abstract class UnitInputPane extends BasicPane { floatValue = de.floatValue(); } //选中多列, 并且列宽不完全一致的话, 就不显示值了. - temp.setText(floatValue == 0 ? StringUtils.EMPTY : Utils.convertNumberStringToString(new Float(floatValue))); + temp.setText(AssistUtils.equals(floatValue, 0) ? StringUtils.EMPTY : Utils.convertNumberStringToString(new Float(floatValue))); // denny:默认应该为选中,方便用户修改 temp.selectAll();