Browse Source

Merge pull request #2473 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit '0b89e08fe725a0a9d45b5c999035e532f5969457':
  REPORT-38653 设计器在线更新升级适配jdk11
  REPORT-38681 向右再移动一个位置 避免光标太接近文字内容
  REPORT-38681 修复数据集-sql面板光标显示不正常
research/11.0
superman 4 years ago
parent
commit
20042f18cf
  1. 4
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 8
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/ConfigurableCaret.java
  3. 38
      designer-base/src/main/java/com/fr/design/jdk/JdkVersion.java
  4. 4
      designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java

4
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -20,6 +20,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iprogressbar.UIProgressBarUI; import com.fr.design.gui.iprogressbar.UIProgressBarUI;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.jdk.JdkVersion;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -39,6 +40,7 @@ import com.fr.general.log.Log4jConfig;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StableUtils;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.third.apache.log4j.Level; import com.fr.third.apache.log4j.Level;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
@ -216,7 +218,7 @@ public class PreferencePane extends BasicPane {
oracleSpace = new UICheckBox(i18nText("Fine-Design_Basic_Show_All_Oracle_Tables")); oracleSpace = new UICheckBox(i18nText("Fine-Design_Basic_Show_All_Oracle_Tables"));
oraclePane.add(oracleSpace); oraclePane.add(oracleSpace);
if (!OperatingSystem.isLinux()) { if (!OperatingSystem.isLinux() && JdkVersion.LE_8.support()) {
JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Update_Plugin_Manager")); JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Update_Plugin_Manager"));
useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager")); useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager"));
upmSelectorPane.add(useOptimizedUPMCheckbox); upmSelectorPane.add(useOptimizedUPMCheckbox);

8
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/ConfigurableCaret.java

@ -12,6 +12,7 @@ import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.awt.datatransfer.*; import java.awt.datatransfer.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.geom.Line2D;
import java.io.*; import java.io.*;
import javax.swing.*; import javax.swing.*;
import javax.swing.plaf.*; import javax.swing.plaf.*;
@ -454,9 +455,10 @@ public class ConfigurableCaret extends DefaultCaret {
// A thicker vertical line. // A thicker vertical line.
case THICK_VERTICAL_LINE_STYLE: case THICK_VERTICAL_LINE_STYLE:
g.drawLine(r.x,r.y, r.x,r.y+r.height); Graphics2D g2 = (Graphics2D) g;
r.x++; g2.setStroke(new BasicStroke(2));
g.drawLine(r.x,r.y, r.x,r.y+r.height); // 向右再移动一个位置 避免光标太接近文字内容
g2.draw(new Line2D.Float(r.x + 1, r.y, r.x + 1, r.y + r.height));
break; break;
} // End of switch (style). } // End of switch (style).

38
designer-base/src/main/java/com/fr/design/jdk/JdkVersion.java

@ -0,0 +1,38 @@
package com.fr.design.jdk;
import com.fr.stable.StableUtils;
/**
* 设计器运行jdk版本
*
* @author hades
* @version 10.0
* Created by hades on 2020/9/27
*/
public enum JdkVersion {
/**
* 小于或等于jdk 8
*/
LE_8 {
@Override
public boolean support() {
return StableUtils.getMajorJavaVersion() <= 8;
}
},
/**
* 大于或等于jdk 9
*/
GE_9 {
@Override
public boolean support() {
return StableUtils.getMajorJavaVersion() >= 9;
}
};
abstract public boolean support();
}

4
designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java

@ -2,8 +2,10 @@ package com.fr.design.os.impl;
import com.fr.config.ServerPreferenceConfig; import com.fr.config.ServerPreferenceConfig;
import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.extra.WebViewDlgHelper;
import com.fr.design.jdk.JdkVersion;
import com.fr.design.upm.UpmFinder; import com.fr.design.upm.UpmFinder;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.os.Arch; import com.fr.stable.os.Arch;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSBasedAction;
@ -21,7 +23,7 @@ public class PMDialogAction implements OSBasedAction {
DesignUtils.visitEnvServerByParameters( PLUGIN_MANAGER_ROUTE,null,null); DesignUtils.visitEnvServerByParameters( PLUGIN_MANAGER_ROUTE,null,null);
return; return;
} }
if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM()) { if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM() && JdkVersion.LE_8.support()) {
UpmFinder.showUPMDialog(); UpmFinder.showUPMDialog();
} else { } else {
WebViewDlgHelper.createPluginDialog(); WebViewDlgHelper.createPluginDialog();

Loading…
Cancel
Save