Browse Source

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

release/10.0
Hoky 3 years ago
parent
commit
cdab3bde0f
  1. 11
      designer-base/src/main/java/com/fr/design/dialog/InformationWarnPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  3. 6
      designer-form/src/main/java/com/fr/design/mainframe/share/sort/OnlineWidgetSortType.java

11
designer-base/src/main/java/com/fr/design/dialog/InformationWarnPane.java

@ -37,6 +37,17 @@ public class InformationWarnPane extends JPanel{
public void show() {
showWindow(SwingUtilities.getWindowAncestor(this)).setVisible(true);
}
public void showOnFront() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
AlertDialog dialog = showWindow(SwingUtilities.getWindowAncestor(InformationWarnPane.this));
dialog.setVisible(true);
dialog.toFront();
}
});
}
public InformationWarnPane(String infor, String moreInfo, String title) {
this.title = title;

4
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -1096,7 +1096,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
String info = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open-New_Form_Tip");
String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info");
if (showTipPane) {
new InformationWarnPane(info, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show();
new InformationWarnPane(info, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).showOnFront();
}
return true;
}
@ -1119,7 +1119,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
String infor = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", DesignUtils.parseVersion(xmlDesignerVersion));
String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info");
if (showTipPane) {
new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show();
new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).showOnFront();
}
return true;
}

6
designer-form/src/main/java/com/fr/design/mainframe/share/sort/OnlineWidgetSortType.java

@ -27,7 +27,11 @@ public enum OnlineWidgetSortType implements SortType<OnlineShareWidget> {
public int compare(OnlineShareWidget o1, OnlineShareWidget o2) {
double t1 = getSortValue(o1, parameterMap);
double t2 = getSortValue(o2, parameterMap);
return ComparatorUtils.compareCommonType(t2, t1);
// Comparator中比较double/float相等时,不允许误差. 否则会违背 "若x = y , y = z, 则x = z"的约定。
// 因为允许误差的情况下,x和y间的误差在允许范围内,被判定相等,y和间的误差在允许范围内,被判定相等,
// 但x和z间的误差可能超出允许范围,从而不相等,因此会违背上述约定。
// 产生IllegalArgumentException: Comparison method violates its general contract!
return Double.compare(t2, t1);
}
});
}

Loading…
Cancel
Save