From a2465e553a198da5b3947fe2d2b7db5b6e68f2bf Mon Sep 17 00:00:00 2001 From: bryant Date: Sat, 10 Oct 2020 15:01:46 +0800 Subject: [PATCH 1/5] =?UTF-8?q?REPORT-37609=20-=20=E6=97=A5=E6=96=87?= =?UTF-8?q?=E7=89=88=E5=B1=8F=E8=94=BD=E6=9B=B4=E6=96=B0=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/locale/impl/SupportLocaleImpl.java | 17 ++++++++-- .../mainframe/toolbar/ToolBarMenuDock.java | 34 ++++--------------- .../java/com/fr/design/upm/UpmFinder.java | 12 ++++--- 3 files changed, 29 insertions(+), 34 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java index 904a6c18b..39bad349a 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java @@ -156,7 +156,20 @@ public enum SupportLocaleImpl implements SupportLocale { set.add(Locale.TAIWAN); return set; } - } - + }, + /** + * 更新升级-社区菜单下 + */ + UPDATE_COMMUNITY { + @Override + public Set support() { + Set set = new HashSet<>(); + set.add(Locale.US); + set.add(Locale.KOREA); + set.add(Locale.CHINA); + set.add(Locale.TAIWAN); + return set; + } + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index c81c6749f..8973ceced 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -530,35 +530,18 @@ public abstract class ToolBarMenuDock { * @return 帮组菜单的子菜单 */ public ShortCut[] createHelpShortCuts() { - final java.util.List shortCuts = new ArrayList(); + final java.util.List shortCuts = new ArrayList<>(); - Locale locale = GeneralContext.getLocale(); + LocaleCenter.buildAction(() -> shortCuts.add(new VideoAction()), SupportLocaleImpl.VIDEO); - LocaleCenter.buildAction(new LocaleAction() { - @Override - public void execute() { - shortCuts.add(new VideoAction()); - } - }, SupportLocaleImpl.VIDEO); - - LocaleCenter.buildAction(new LocaleAction() { - @Override - public void execute() { - shortCuts.add(new TutorialAction()); - } - }, SupportLocaleImpl.TUTORIAL_HELP); + LocaleCenter.buildAction(() -> shortCuts.add(new TutorialAction()), SupportLocaleImpl.TUTORIAL_HELP); - LocaleCenter.buildAction(new LocaleAction() { - @Override - public void execute() { - shortCuts.add(new TechSupportAction()); - } - }, SupportLocaleImpl.TECH_SUPPORT_HELP); + LocaleCenter.buildAction(() -> shortCuts.add(new TechSupportAction()), SupportLocaleImpl.TECH_SUPPORT_HELP); //远程不使用更新升级,产品演示 if (WorkContext.getCurrent().isLocal()) { shortCuts.add(new WebDemoAction()); - shortCuts.add(new SoftwareUpdateAction()); + LocaleCenter.buildAction(() -> shortCuts.add(new SoftwareUpdateAction()), SupportLocaleImpl.UPDATE_COMMUNITY); } if (AlphaFineConfigManager.isALPHALicAvailable()) { shortCuts.add(new AlphaFineAction()); @@ -566,12 +549,7 @@ public abstract class ToolBarMenuDock { shortCuts.add(SeparatorDef.DEFAULT); if (DesignerEnvManager.getEnvManager().isOpenDebug()) { - OSSupportCenter.buildAction(new OSBasedAction() { - @Override - public void execute(Object... objects) { - shortCuts.add(new FineUIAction()); - } - }, SupportOSImpl.FINEUI); + OSSupportCenter.buildAction(objects -> shortCuts.add(new FineUIAction()), SupportOSImpl.FINEUI); } shortCuts.add(new AboutAction()); diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java index 4febad3a9..75d7f1b1e 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java @@ -10,6 +10,7 @@ import com.fr.design.update.ui.dialog.UpdateMainDialog; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; +import com.fr.general.GeneralContext; import com.fr.log.FineLoggerFactory; import com.fr.stable.StableUtils; import com.fr.workspace.Workspace; @@ -17,6 +18,7 @@ import com.fr.workspace.WorkspaceEvent; import javax.swing.*; import java.io.File; +import java.util.Locale; /** * @author richie @@ -88,10 +90,12 @@ public class UpmFinder { dialog.setVisible(true); } } else { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message")); - UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); - dialog.setAutoUpdateAfterInit(); - dialog.showDialog(); + if (!GeneralContext.getLocale().equals(Locale.JAPAN)) { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message")); + UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); + dialog.setAutoUpdateAfterInit(); + dialog.showDialog(); + } } } From a52a32cc6744d05f7f933477792699fbe5a70526 Mon Sep 17 00:00:00 2001 From: bryant Date: Sat, 10 Oct 2020 15:04:25 +0800 Subject: [PATCH 2/5] =?UTF-8?q?REPORT-37609=20-=20=E6=97=A5=E6=96=87?= =?UTF-8?q?=E7=89=88=E5=B1=8F=E8=94=BD=E6=9B=B4=E6=96=B0=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/locale/impl/SupportLocaleImpl.java | 4 ++-- .../java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java index 39bad349a..0373dad03 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java @@ -159,9 +159,9 @@ public enum SupportLocaleImpl implements SupportLocale { }, /** - * 更新升级-社区菜单下 + * 更新升级-帮助菜单下 */ - UPDATE_COMMUNITY { + UPDATE_HELP { @Override public Set support() { Set set = new HashSet<>(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 8973ceced..53bf18bce 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -541,7 +541,7 @@ public abstract class ToolBarMenuDock { //远程不使用更新升级,产品演示 if (WorkContext.getCurrent().isLocal()) { shortCuts.add(new WebDemoAction()); - LocaleCenter.buildAction(() -> shortCuts.add(new SoftwareUpdateAction()), SupportLocaleImpl.UPDATE_COMMUNITY); + LocaleCenter.buildAction(() -> shortCuts.add(new SoftwareUpdateAction()), SupportLocaleImpl.UPDATE_HELP); } if (AlphaFineConfigManager.isALPHALicAvailable()) { shortCuts.add(new AlphaFineAction()); From 66f78364b137cc7bc2dc865b774aabcade339453 Mon Sep 17 00:00:00 2001 From: bryant Date: Sat, 10 Oct 2020 16:48:17 +0800 Subject: [PATCH 3/5] =?UTF-8?q?REPORT-37609=20-=20=E6=97=A5=E6=96=87?= =?UTF-8?q?=E7=89=88=E5=B1=8F=E8=94=BD=E6=9B=B4=E6=96=B0=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/upm/UpmFinder.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java index 75d7f1b1e..c72fa5bcd 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java @@ -89,13 +89,11 @@ public class UpmFinder { } dialog.setVisible(true); } - } else { - if (!GeneralContext.getLocale().equals(Locale.JAPAN)) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message")); - UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); - dialog.setAutoUpdateAfterInit(); - dialog.showDialog(); - } + } else if (!GeneralContext.getLocale().equals(Locale.JAPAN)) { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message")); + UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); + dialog.setAutoUpdateAfterInit(); + dialog.showDialog(); } } From 88cc1266fabbe4d0114de23f19fb5e39d3fb039d Mon Sep 17 00:00:00 2001 From: bryant Date: Mon, 12 Oct 2020 18:17:25 +0800 Subject: [PATCH 4/5] =?UTF-8?q?REPORT-37609=20-=20=E6=97=A5=E6=96=87?= =?UTF-8?q?=E7=89=88=E5=B1=8F=E8=94=BD=E6=9B=B4=E6=96=B0=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/upm/UpmFinder.java | 65 +++++++++++-------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java index c72fa5bcd..2aaa9556b 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java @@ -29,6 +29,7 @@ public class UpmFinder { private static final String UPM_DIR = "/upm"; private static final String MAIN_RESOURCE_PATH = UPM_DIR + "/plugin_design.html"; + private static final String JXBROWSER = "com.teamdev.jxbrowser.chromium.Browser"; public static String installHome = FRContext.getCommonOperator().getWebRootPath(); @@ -58,39 +59,49 @@ public class UpmFinder { } public static void showUPMDialog() { - boolean flag = true; + boolean hasJxBrowser = true; try { - Class.forName("com.teamdev.jxbrowser.chromium.Browser"); + Class.forName(JXBROWSER); } catch (ClassNotFoundException e) { - flag = false; + hasJxBrowser = false; } - if (flag) { - if (!checkUPMResourcesExist()){ - // upm下载 - int val = FineJOptionPane.showConfirmDialog(null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Need_Install"), - Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE); - if (val == JOptionPane.OK_OPTION){ - try { - UpmResourceLoader.INSTANCE.download(); - UpmResourceLoader.INSTANCE.install(); - FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Installed"), - Toolkit.i18nText("Fine-Design_Basic_Message"), JOptionPane.INFORMATION_MESSAGE); - } catch (Exception e){ - FineLoggerFactory.getLogger().error(e.getMessage(), e); - FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Updater_Download_Failed"), - Toolkit.i18nText("Fine-Design_Basic_Message"), JOptionPane.INFORMATION_MESSAGE); - } + if (hasJxBrowser) { + showUpmPane(); + } else { + showUpdatePane(); + } + } + + private static void showUpmPane() { + if (!checkUPMResourcesExist()){ + // upm下载 + int val = FineJOptionPane.showConfirmDialog(null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Need_Install"), + Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE); + if (val == JOptionPane.OK_OPTION){ + try { + UpmResourceLoader.INSTANCE.download(); + UpmResourceLoader.INSTANCE.install(); + FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Installed"), + Toolkit.i18nText("Fine-Design_Basic_Message"), JOptionPane.INFORMATION_MESSAGE); + } catch (Exception e){ + FineLoggerFactory.getLogger().error(e.getMessage(), e); + FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Updater_Download_Failed"), + Toolkit.i18nText("Fine-Design_Basic_Message"), JOptionPane.INFORMATION_MESSAGE); } } - else { - UpmShowPane upmPane = new UpmShowPane(); - if (dialog == null) { - dialog = new UpmShowDialog(DesignerContext.getDesignerFrame(), upmPane); - } - dialog.setVisible(true); + } + else { + UpmShowPane upmPane = new UpmShowPane(); + if (dialog == null) { + dialog = new UpmShowDialog(DesignerContext.getDesignerFrame(), upmPane); } - } else if (!GeneralContext.getLocale().equals(Locale.JAPAN)) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message")); + dialog.setVisible(true); + } + } + + private static void showUpdatePane() { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message")); + if (!GeneralContext.getLocale().equals(Locale.JAPAN)) { UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); dialog.setAutoUpdateAfterInit(); dialog.showDialog(); From 0f4cae075fc9ee2387b748b385386e32958873da Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 13 Oct 2020 09:53:14 +0800 Subject: [PATCH 5/5] =?UTF-8?q?REPORT-40853=20=E6=8F=90=E4=BA=A4=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E7=BB=84=E5=A4=9A=E6=AC=A1=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=8D=A1=E6=AD=BB=20&&=20REPORT-40843=20=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=EF=BC=8C=E7=82=B9=E5=87=BB=E5=88=B0?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F-=E5=8D=95=E5=85=83=E6=A0=BC=EF=BC=8C?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E5=8C=96=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E6=89=93=E5=BC=80=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=B4=A9?= =?UTF-8?q?=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../background/gradient/GradientBackgroundPane.java | 3 ++- .../design/style/background/gradient/GradientBar.java | 10 +++++++++- .../com/fr/design/write/submit/DBManipulationPane.java | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java index 59aed2a6f..1cbf543a4 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java @@ -26,6 +26,7 @@ import java.awt.event.ActionListener; */ public class GradientBackgroundPane extends BackgroundDetailPane { private static final long serialVersionUID = -6854603990673031897L; + public static final int DEFAULT_GRADIENT_WIDTH = 254; private UIRadioButton left2right, top2bottom; private GradientBar gradientBar; @@ -41,7 +42,7 @@ public class GradientBackgroundPane extends BackgroundDetailPane { // neil:增加渐变色拖动条 JPanel gradientPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel blankJp = new JPanel(); - gradientBar = new GradientBar(4, 254); + gradientBar = new GradientBar(4, DEFAULT_GRADIENT_WIDTH); blankJp.add(gradientBar); UILabel jl = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Drag_To_Select_Gradient")); jl.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20)); diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java index 46d1b9165..b088864c0 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java @@ -192,7 +192,15 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab } float[] dist = new float[list.size()]; for (int i = 0; i < list.size(); i++) { - dist[i] = (float) ((list.get(i).getX() - 4) / (max - 4)); + double value = list.get(i).getX() - 4; + double defaultMax = max - 4; + if (Double.compare(value, defaultMax) > 0) { + // 设置了预定义的渐变色 渐变色起始位置比较大 然后由预定义样式切换到自定义样式 做下等比例转换 + dist[i] = (float) (value / (GradientBackgroundPane.DEFAULT_GRADIENT_WIDTH - 4)); + list.get(i).setX(max * dist[i]); + } else { + dist[i] = (float) (value / defaultMax); + } } LinearGradientPaint paint = new LinearGradientPaint(start, end, dist, c); diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 590f9d112..ccf01dd5e 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -53,6 +53,7 @@ import javax.swing.BorderFactory; import javax.swing.DefaultCellEditor; import javax.swing.DefaultComboBoxModel; import javax.swing.Icon; +import javax.swing.JFrame; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -867,13 +868,14 @@ public class DBManipulationPane extends BasicBeanPane { textLabel = new UILabel(); textLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { + vPaneDLG.setAlwaysOnTop(true); vPaneDLG.setVisible(true); } }); vPane = new ValuePane(types); - vPaneDLG = vPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + vPaneDLG = vPane.showSmallWindow(new JFrame(), new DialogActionAdapter() { public void doOk() { fireEditingStopped(); // Make the renderer // reappear.