Browse Source

Merge remote-tracking branch 'origin/feature/10.0' into feature/10.0

research/11.0
Maksim 5 years ago
parent
commit
ee11415060
  1. 3
      designer-base/src/main/java/com/fr/design/gui/UIDefaultTheme.java
  2. 3
      designer-base/src/main/java/com/fr/design/gui/autocomplete/LanguageAwareCompletionProvider.java
  3. 4
      designer-base/src/main/java/com/fr/design/gui/autocomplete/ParameterizedCompletionContext.java
  4. 2
      designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java
  5. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java
  6. 10
      designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java
  7. 1
      designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java
  8. 1
      designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java
  9. 3
      designer-base/src/main/java/com/fr/design/gui/frpane/UINumberSlidePane.java
  10. 3
      designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java

3
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.background", ThemeUtils.TEXT_BG_COLOR);
table.put("Table.selectionForeground", ThemeUtils.NORMAL_FOREGROUND); table.put("Table.selectionForeground", ThemeUtils.NORMAL_FOREGROUND);
table.put("Table.selectionBackground", new ColorUIResource(200, 221, 233)); 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("TableHeader.background", new ColorUIResource(229, 229, 229));
table.put("ProgressBar.foreground", ThemeUtils.PROCESS_COLOR); table.put("ProgressBar.foreground", ThemeUtils.PROCESS_COLOR);
table.put("ProgressBar.background", ThemeUtils.TEXT_BG_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.selectionForeground", ThemeUtils.NORMAL_FOREGROUND);
table.put("ProgressBar.selectionBackground", ThemeUtils.NORMAL_FOREGROUND); table.put("ProgressBar.selectionBackground", ThemeUtils.NORMAL_FOREGROUND);
table.put("PopupMenu.background", ThemeUtils.NORMAL_BG); 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.background", ThemeUtils.NORMAL_BG);
table.put("TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 0)); table.put("TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 0));
table.put("TabbedPane.tabInsets", new InsetsUIResource(1, 6, 4, 6)); 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.foreground", ThemeUtils.NORMAL_FOREGROUND);
table.put("ComboBox.background", ThemeUtils.TEXT_BG_COLOR); table.put("ComboBox.background", ThemeUtils.TEXT_BG_COLOR);
table.put("ComboBox.disabledBackground", ThemeUtils.TEXT_DISABLED_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("EditorPane.foreground", ThemeUtils.NORMAL_FOREGROUND);
table.put("PasswordField.background", ThemeUtils.TEXT_BG_COLOR); table.put("PasswordField.background", ThemeUtils.TEXT_BG_COLOR);
table.put("PasswordField.foreground", ThemeUtils.NORMAL_FOREGROUND); table.put("PasswordField.foreground", ThemeUtils.NORMAL_FOREGROUND);

3
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 // provider. We do not do function/method completions while editing
// strings or comments. // strings or comments.
CompletionProvider provider = getProviderFor(tc); CompletionProvider provider = getProviderFor(tc);
if (provider == null) {
return null;
}
return provider==defaultProvider ? return provider==defaultProvider ?
provider.getParameterizedCompletions(tc) : null; provider.getParameterizedCompletions(tc) : null;
} }

4
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 // No params after caret - go to first one
if (currentNext.getStartOffset() + 1 <= dot) { if (currentNext.getStartOffset() + 1 <= dot) {
int nextIndex = getFirstHighlight(highlights); int nextIndex = getFirstHighlight(highlights);

2
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) { if (cftf != null) {
cftf.setColumns(3); // specify more width than we need cftf.setColumns(3); // specify more width than we need
cftf.setHorizontalAlignment(UITextField.LEFT); cftf.setHorizontalAlignment(UITextField.LEFT);
}else {
throw new IllegalArgumentException("Spinner'Editor can not be null!");
} }
((AbstractDocument) cftf.getDocument()).setDocumentFilter(new DocumentFilter() { ((AbstractDocument) cftf.getDocument()).setDocumentFilter(new DocumentFilter() {

4
designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java

@ -1,8 +1,8 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.stable.AssistUtils;
/** /**
* Created by plough on 2017/8/1. * Created by plough on 2017/8/1.
@ -48,7 +48,7 @@ public abstract class ObjectUIControlPane extends UIListControlPane {
if (constructor != null) { if (constructor != null) {
return constructor; return constructor;
} else { } else {
if (cls.getName() == Object.class.getName()) { if (AssistUtils.equals(cls.getName(),Object.class.getName())) {
return null; return null;
} }
return getConstructor(clazz, cls.getSuperclass()); return getConstructor(clazz, cls.getSuperclass());

10
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) { if (date == null) {
this.setSelectedItem(null); this.setSelectedItem(null);
} else { } else {
@ -165,6 +165,7 @@ public class UIDatePicker extends UIComboBox implements Serializable {
} }
} }
@Override
public void setSelectedItem(Object anObject) { public void setSelectedItem(Object anObject) {
model.setSelectedItem(anObject); model.setSelectedItem(anObject);
super.setSelectedItem(anObject); super.setSelectedItem(anObject);
@ -192,12 +193,14 @@ public class UIDatePicker extends UIComboBox implements Serializable {
setBorder(BorderFactory.createEmptyBorder()); setBorder(BorderFactory.createEmptyBorder());
} }
@Override
public void hide() { public void hide() {
if (isWillHide) { if (isWillHide) {
super.hide(); super.hide();
} }
} }
@Override
public void show() { public void show() {
if (isWillHide || UIDatePicker.this.isEnabled() == false) { if (isWillHide || UIDatePicker.this.isEnabled() == false) {
return; return;
@ -211,6 +214,7 @@ public class UIDatePicker extends UIComboBox implements Serializable {
/** /**
* 显示弹出面板 * 显示弹出面板
*/ */
@Override
protected void firePropertyChange(String propertyName, protected void firePropertyChange(String propertyName,
Object oldValue, Object oldValue,
Object newValue) { Object newValue) {
@ -250,12 +254,14 @@ public class UIDatePicker extends UIComboBox implements Serializable {
} }
} }
@Override
protected ComboBoxUI getUIComboBoxUI() { protected ComboBoxUI getUIComboBoxUI() {
return new UIComboBoxUI() { return new UIComboBoxUI() {
@Override
protected ComboPopup createPopup() { protected ComboPopup createPopup() {
return new DatePopup(comboBox); return new DatePopup(comboBox);
} }
@Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
if (UIDatePicker.this.isPopupVisible()) { if (UIDatePicker.this.isPopupVisible()) {
isWillHide = true; isWillHide = true;

1
designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java

@ -35,6 +35,7 @@ public class LoadingPaneDemo extends JPanel {
Thread.sleep(500); Thread.sleep(500);
} catch (InterruptedException e) { } catch (InterruptedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
Thread.currentThread().interrupt();
} }
container.add(new UIButton(i + "adfadwdadawdwad")); container.add(new UIButton(i + "adfadwdadawdwad"));
} }

1
designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java

@ -24,6 +24,7 @@ public class LoadingBasicPaneTest {
Thread.sleep(500); Thread.sleep(500);
} catch (InterruptedException e) { } catch (InterruptedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
Thread.currentThread().interrupt();
} }
container.add(new UIButton(i + "adfadwdadawdwad")); container.add(new UIButton(i + "adfadwdadawdwad"));
} }

3
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.beans.BasicBeanPane;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.gui.style.NumberDragBar; import com.fr.design.gui.style.NumberDragBar;
import com.fr.stable.AssistUtils;
/** /**
* 拖拽的滑条和对应滑条值的数字 * 拖拽的滑条和对应滑条值的数字
@ -65,7 +66,7 @@ public class UINumberSlidePane extends BasicBeanPane<Double> {
public void checkValue(double value) { public void checkValue(double value) {
value = Math.max(value, minValue); value = Math.max(value, minValue);
value = Math.min(value, maxValue); value = Math.min(value, maxValue);
if (this.value == value) { if (AssistUtils.equals(this.value, value)) {
return; return;
} }
double diff = Math.abs(value - this.value); double diff = Math.abs(value - this.value);

3
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.gui.itextfield.UINumberField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -81,7 +82,7 @@ public abstract class UnitInputPane extends BasicPane {
floatValue = de.floatValue(); 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:默认应该为选中,方便用户修改 // denny:默认应该为选中,方便用户修改
temp.selectAll(); temp.selectAll();

Loading…
Cancel
Save