From af80cfe6620a9e77dc72ae283c6de896156fcfdc Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Fri, 1 Nov 2019 15:57:59 +0800 Subject: [PATCH 01/11] =?UTF-8?q?REPORT-22046=20cpt=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=86=BB=E7=BB=93=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E6=9C=89=E4=B8=AA=E9=94=99=E8=AF=AF=E7=9A=84=E5=BC=95=E5=AF=BC?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/freeze/RepeatAndFreezeSettingPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index 1dd75e1633..3fc32f575a 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -216,12 +216,12 @@ public class RepeatAndFreezeSettingPane extends BasicPane { JPanel freezePanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); //自适应插件 - if (shouldShowTip()) { +/* if (shouldShowTip()) { JPanel infoPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attention")); BoxCenterAligmentPane actionLabel = getURLActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Form_Fit_Tip")); infoPane.add(actionLabel, BorderLayout.SOUTH); this.add(infoPane, BorderLayout.SOUTH); - } + }*/ outfreezePanel.add(freezePanel); // 重复打印部分 // 重复打印标题的起始行 From b7d2d199ec1c4da5f06c7f41aa9fe98a2ee447cd Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Mon, 11 Nov 2019 10:53:13 +0800 Subject: [PATCH 02/11] =?UTF-8?q?REPORT-23627=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=A2=9C=E8=89=B2=E8=AE=BE=E7=BD=AE=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=A1=B5=E9=9D=A2=E4=B8=ADRGB=E5=92=8CHSL=E4=BA=92?= =?UTF-8?q?=E7=9B=B8=E8=BD=AC=E6=8D=A2=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/color/CustomChooserPanel.java | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java b/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java index 79ecdc9461..49a3a91254 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java +++ b/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java @@ -142,13 +142,13 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec */ private static final UILabel B = new UILabel("B"); - private static final int H_MAX = 365; + private static final int H_MAX = 360; private static final int S_MAX = 100; - private static final int L_MAX = 100; + private static final int B_MAX = 100; private static final float HSPINNER_VALUE = 360f; private static final float SSPINNER_VALUE = 100f; - private static final float LSPINNER_VALUE = 100f; + private static final float BSPINNER_VALUE = 100f; private static final int BINARY_FOR_EIGHT = 255; private static final int BINARY_FOR_FOUR = 16; @@ -321,7 +321,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec internalChange = true; sSpinner.setValue(new Integer((int) (s * S_MAX))); internalChange = false; - bSpinner.setValue(new Integer((int) (b * L_MAX))); + bSpinner.setValue(new Integer((int) (b * B_MAX))); revalidate(); } @@ -338,7 +338,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec internalChange = true; hSpinner.setValue(new Integer((int) (h * H_MAX))); internalChange = false; - bSpinner.setValue(new Integer((int) (b * L_MAX))); + bSpinner.setValue(new Integer((int) (b * B_MAX))); revalidate(); } @@ -431,7 +431,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec } /** - * hsl 监听 + * hsb 监听 */ class ImageScrollListener implements ChangeListener { /** @@ -506,7 +506,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec null); internalChange = true; - adjustHSLValue(hsbVals); + adjustHSBValue(hsbVals); internalChange = false; @@ -521,11 +521,11 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec updateHexFields(); } - private void adjustHSLValue(float[] hsbVals) { + private void adjustHSBValue(float[] hsbVals) { if (!spinnerTrigger) { hSpinner.setValue(new Integer((int) (hsbVals[0] * HSPINNER_VALUE))); sSpinner.setValue(new Integer((int) (hsbVals[1] * SSPINNER_VALUE))); - bSpinner.setValue(new Integer((int) (hsbVals[2] * LSPINNER_VALUE))); + bSpinner.setValue(new Integer((int) (hsbVals[2] * BSPINNER_VALUE))); } switch (locked) { case HLOCKED: @@ -536,7 +536,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec gradientPoint.x = (int) ((1 - ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE) * IMG_WIDTH); gradientPoint.y = (int) ((1 - - ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT); + - ((Number) bSpinner.getValue()).intValue() / BSPINNER_VALUE) * IMG_HEIGHT); } break; case SLOCKED: @@ -546,7 +546,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec if (!handlingMouse) { gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE * IMG_WIDTH); gradientPoint.y = (int) ((1 - - ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT); + - ((Number) bSpinner.getValue()).intValue() / BSPINNER_VALUE) * IMG_HEIGHT); } break; case BLOCKED: @@ -565,7 +565,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec private void updateImageAndTrack() { float h = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; float s = ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE; - float b = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; + float b = ((Number) bSpinner.getValue()).intValue() / BSPINNER_VALUE; spinnerTrigger = true; getColorSelectionModel().setSelectedColor(new Color(Color.HSBtoRGB(h, s, b))); @@ -691,11 +691,11 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec container.add(label); container.add(mainPanel); - // hsl和rgb面板 - JPanel hslAndRgbPanel = new JPanel(); - hslAndRgbPanel.setLayout(new BorderLayout(0, 16)); - hslAndRgbPanel.add(initialHSLPanel(), BorderLayout.CENTER); - hslAndRgbPanel.add(initialRGBPanel(), BorderLayout.SOUTH); + // hsb和rgb面板 + JPanel hsbAndRgbPanel = new JPanel(); + hsbAndRgbPanel.setLayout(new BorderLayout(0, 16)); + hsbAndRgbPanel.add(initialHSBPanel(), BorderLayout.CENTER); + hsbAndRgbPanel.add(initialRGBPanel(), BorderLayout.SOUTH); // 十六进制面板 JPanel hexPanel = new JPanel(); @@ -703,7 +703,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec hexPanel.add(new UILabel("#")); hexPanel.add(field); - mainPanel.add(hslAndRgbPanel, BorderLayout.CENTER); + mainPanel.add(hsbAndRgbPanel, BorderLayout.CENTER); mainPanel.add(hexPanel, BorderLayout.SOUTH); JPanel rightPane = new JPanel(new BorderLayout()); @@ -719,11 +719,11 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec return container; } - //初始化HSL部分 - private JPanel initialHSLPanel() { + //初始化HSB部分 + private JPanel initialHSBPanel() { hRadio = new UIRadioButton("H"); sRadio = new UIRadioButton("S"); - bRadio = new UIRadioButton("L"); + bRadio = new UIRadioButton("B"); ButtonGroup group = new ButtonGroup(); group.add(hRadio); group.add(sRadio); @@ -748,27 +748,27 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec sSpinner.addChangeListener(scroll); bSpinner.addChangeListener(scroll); - JPanel hslPanel = new JPanel(); - hslPanel.setLayout(new GridLayout(3, 0, 0, 5)); + JPanel hsbPanel = new JPanel(); + hsbPanel.setLayout(new GridLayout(3, 0, 0, 5)); JPanel hPanel = new JPanel(); hPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); hPanel.add(hRadio); hPanel.add(hSpinner); - hslPanel.add(hPanel); + hsbPanel.add(hPanel); JPanel sPanel = new JPanel(); sPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); sPanel.add(sRadio); sPanel.add(sSpinner); - hslPanel.add(sPanel); + hsbPanel.add(sPanel); JPanel lPanel = new JPanel(); lPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); lPanel.add(bRadio); lPanel.add(bSpinner); - hslPanel.add(lPanel); - return hslPanel; + hsbPanel.add(lPanel); + return hsbPanel; } private JPanel initialRGBPanel() { @@ -856,7 +856,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec */ private void updateBLockImage() { int[] pix = new int[IMG_WIDTH * IMG_HEIGHT]; - float bValue = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; + float bValue = ((Number) bSpinner.getValue()).intValue() / BSPINNER_VALUE; int index = 0; for (int j = 0; j < IMG_HEIGHT; j++) { @@ -1028,7 +1028,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec int[] trackPix = new int[TRACK_WIDTH * IMG_HEIGHT]; float hValue = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; - float bValue = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; + float bValue = ((Number) bSpinner.getValue()).intValue() / BSPINNER_VALUE; int trackIndex = 0; for (int j = 0; j < IMG_HEIGHT; j++) { From 514f3e64081b9cee67dee5c11bac5878fbd42e48 Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Thu, 14 Nov 2019 14:54:03 +0800 Subject: [PATCH 03/11] =?UTF-8?q?REPORT-17192=20=E6=A8=A1=E6=9D=BFWeb?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E4=B8=AD=EF=BC=8C=E5=88=86=E9=A1=B5=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E8=AE=BE=E7=BD=AE=EF=BC=8C=E9=87=87=E7=94=A8=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E8=AE=BE=E7=BD=AE=E5=8F=8C=E5=87=BB=E7=BD=AE?= =?UTF-8?q?=E7=81=B0=E5=B7=A5=E5=85=B7=E6=A0=8F=E5=8F=AF=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/webattr/ToolBarDragPane.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java b/designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java index fc3d813523..a8cd06a9b3 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java @@ -227,6 +227,15 @@ public class ToolBarDragPane extends WidgetToolBarPane { GUICoreUtils.setEnabled(this, b); isEnabled = b; removeAllListener(northToolBar.getToolBarButtons()); + removeAllListener(southToolBar.getToolBarButtons()); + removeToolBarListener(northToolBar); + removeToolBarListener(southToolBar); + } + + private void removeToolBarListener(ToolBarPane toolBarPane) { + if (!isEnabled) { + toolBarPane.removeDefaultMouseListener(); + } } private void removeAllListener(List toolBarButtons) { From 03e9ea5e795a9f50ebf318dba90666fbe1bddd87 Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Thu, 14 Nov 2019 17:02:43 +0800 Subject: [PATCH 04/11] =?UTF-8?q?REPORT-22046=20cpt=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=86=BB=E7=BB=93=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E6=9C=89=E4=B8=AA=E9=94=99=E8=AF=AF=E7=9A=84=E5=BC=95=E5=AF=BC?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/report/freeze/RepeatAndFreezeSettingPane.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index 3fc32f575a..17cf8566a9 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -214,14 +214,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { JPanel repeatPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); repeatPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); JPanel freezePanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - - //自适应插件 -/* if (shouldShowTip()) { - JPanel infoPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attention")); - BoxCenterAligmentPane actionLabel = getURLActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Form_Fit_Tip")); - infoPane.add(actionLabel, BorderLayout.SOUTH); - this.add(infoPane, BorderLayout.SOUTH); - }*/ + outfreezePanel.add(freezePanel); // 重复打印部分 // 重复打印标题的起始行 From bc561230078d7f398ac75103029b66bb30f19314 Mon Sep 17 00:00:00 2001 From: rinoux Date: Tue, 19 Nov 2019 17:54:05 +0800 Subject: [PATCH 05/11] =?UTF-8?q?REPORT-22877=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E9=9B=86?= =?UTF-8?q?=E7=BE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 38 +++++++++++++++---- .../com/fr/design/env/RemoteWorkspace.java | 8 +++- .../DesignerFrameFileDealerPane.java | 4 +- .../mainframe/vcs/common/VcsHelper.java | 5 +-- 4 files changed, 40 insertions(+), 15 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index e982d04cd5..55ccfce636 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -1,7 +1,5 @@ package com.fr.design.actions.file; -import com.fr.cluster.ClusterBridge; -import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.config.Configuration; import com.fr.config.ServerPreferenceConfig; import com.fr.design.DesignerEnvManager; @@ -47,10 +45,36 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.server.vcs.VcsOperator; import com.fr.workspace.server.vcs.git.config.GcConfig; -import javax.swing.*; -import javax.swing.event.*; -import java.awt.*; -import java.awt.event.*; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import javax.swing.Timer; +import javax.swing.UIManager; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Window; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; import java.io.File; import java.text.DecimalFormat; import java.util.Locale; @@ -663,7 +687,7 @@ public class PreferencePane extends BasicPane { defaultStringToFormulaBox.setSelected(false); } VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager(); - if (FineClusterConfig.getInstance().isCluster()) { + if (WorkContext.getCurrent().isCluster()) { vcsEnableCheckBox.setEnabled(false); gcEnableCheckBox.setEnabled(false); } diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java index 36d8e7f7a5..6a582f1faa 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java @@ -1,5 +1,6 @@ package com.fr.design.env; +import com.fr.cluster.engine.remote.ClusterOperator; import com.fr.design.i18n.Toolkit; import com.fr.stable.AssistUtils; import com.fr.workspace.WorkContext; @@ -66,7 +67,12 @@ public class RemoteWorkspace implements Workspace { } return isRoot; } - + + @Override + public boolean isCluster() { + return WorkContext.getCurrent().get(ClusterOperator.class).isCluster(); + } + @Override public WorkspaceConnection getConnection() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 2071215985..f24375da1f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -3,8 +3,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; -import com.fr.cluster.ClusterBridge; -import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -369,7 +367,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt private void fireVcsActionChange() { if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() || VcsHelper.getInstance().isUnSelectedTemplate() - || FineClusterConfig.getInstance().isCluster()) { + || WorkContext.getCurrent().isCluster()) { setEnabled(false); return; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java index 547ddf6ae6..8229c9f8d8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java @@ -1,7 +1,5 @@ package com.fr.design.mainframe.vcs.common; -import com.fr.cluster.ClusterBridge; -import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.file.HistoryTemplateListCache; @@ -27,7 +25,6 @@ import com.fr.workspace.server.vcs.git.config.GcConfig; import javax.swing.Icon; import javax.swing.border.EmptyBorder; import java.awt.Color; - import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -174,7 +171,7 @@ public class VcsHelper implements JTemplateActionListener { public void templateSaved(JTemplate jt) { if (needInit() && DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() - && !FineClusterConfig.getInstance().isCluster()) { + && !WorkContext.getCurrent().isCluster()) { fireVcs(jt); } } From 7c5e9cc3cc715bd5b3f7738aa7304c5b147a2f7a Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 22 Nov 2019 19:53:13 +0800 Subject: [PATCH 06/11] =?UTF-8?q?REPORT-24176=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=20=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/DesignTableDataManager.java | 14 +++++++--- .../data/datapane/TableDataComboBox.java | 28 ++++++++++++------- .../fr/design/present/DictPresentPane.java | 7 ++++- .../design/present/dict/DictionaryPane.java | 8 +++++- .../present/dict/TableDataDictPane.java | 8 +++++- .../com/fr/design/present/PresentPane.java | 1 + 6 files changed, 49 insertions(+), 17 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 0018d5333b..6cf3d90629 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -20,7 +20,7 @@ import com.fr.design.data.tabledata.wrapper.TableDataFactory; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -160,13 +160,20 @@ public abstract class DesignTableDataManager { } } + public static void addDsChangeListener(ChangeListener l) { + addDsChangeListener(l, HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()); + } + + public static void addGlobalDsChangeListener(ChangeListener l) { + addDsChangeListener(l, null); + } + /** * 添加模板数据集改变 监听事件. * * @param l ChangeListener监听器 */ - public static void addDsChangeListener(ChangeListener l) { - JTemplate template = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + private static void addDsChangeListener(ChangeListener l, JTemplate template) { String key = StringUtils.EMPTY; if (template != null) { key = template.getPath(); @@ -178,7 +185,6 @@ public abstract class DesignTableDataManager { } dsListeners.add(l); } - /** * 获取数据源source中dsName的所有字段 * diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java index dddb269bc8..ebbdbf0f35 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java @@ -34,6 +34,7 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC private static final long serialVersionUID = 1L; private boolean refresModel = false; private String treeName; //树数据集本身的名字 + private ChangeListener changeListener; public TableDataComboBox(TableDataSource source){ this(source,StringUtils.EMPTY); @@ -136,15 +137,22 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC } } - /** - *注册listener,相应数据集改变 - */ - public void registerDSChangeListener() { - DesignTableDataManager.addDsChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - TableDataComboBox.this.refresh(DesignTableDataManager.getEditingTableDataSource()); - } - }); - } + /** + *注册listener,相应数据集改变 + */ + @Override + public void registerDSChangeListener() { + changeListener = new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + TableDataComboBox.this.refresh(DesignTableDataManager.getEditingTableDataSource()); + } + }; + DesignTableDataManager.addDsChangeListener(changeListener); + } + + public void registerGlobalDSChangeListener() { + DesignTableDataManager.addGlobalDsChangeListener(changeListener); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java index 17733fb1bb..cba37ea19e 100644 --- a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java +++ b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java @@ -5,6 +5,7 @@ import java.awt.event.ItemListener; import com.fr.base.present.DictPresent; import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.present.dict.DictionaryPane; @@ -13,7 +14,7 @@ import com.fr.design.present.dict.DictionaryPane; * @author zhou * @since 2012-5-31上午10:54:20 */ -public class DictPresentPane extends FurtherBasicBeanPane { +public class DictPresentPane extends FurtherBasicBeanPane implements Prepare4DataSourceChange { private DictionaryPane dictionaryPane; public DictPresentPane() { @@ -50,4 +51,8 @@ public class DictPresentPane extends FurtherBasicBeanPane { dictionaryPane.reset(); } + @Override + public void registerDSChangeListener() { + dictionaryPane.registerDSChangeListener(); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java index 3f62c01703..e50ed86b93 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java @@ -5,6 +5,7 @@ import com.fr.data.impl.DynamicSQLDict; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.constants.LayoutConstants; import com.fr.design.data.DataCreatorUI; +import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; @@ -20,7 +21,7 @@ import java.util.List; * @author zhou * @since 2012-5-31下午12:20:41 */ -public class DictionaryPane extends UIComboBoxPane implements DataCreatorUI { +public class DictionaryPane extends UIComboBoxPane implements DataCreatorUI, Prepare4DataSourceChange { private TableDataDictPane tableDataDictPane; @Override @@ -77,4 +78,9 @@ public class DictionaryPane extends UIComboBoxPane implements DataCr paneList.add(new FormulaDictPane()); return paneList; } + + @Override + public void registerDSChangeListener() { + tableDataDictPane.registerDSChangeListener(); + } } diff --git a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java index ab9d8d90c8..3c08c1c9da 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java @@ -16,6 +16,7 @@ import com.fr.design.data.datapane.TableDataComboBox; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.data.datapane.preview.PreviewLabel; import com.fr.design.data.datapane.preview.PreviewLabel.Previewable; +import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.editor.DoubleDeckValueEditorPane; @@ -48,7 +49,7 @@ import java.util.List; * @editor zhou * @since 2012-3-29下午1:49:24 */ -public class TableDataDictPane extends FurtherBasicBeanPane implements Previewable, UIObserver { +public class TableDataDictPane extends FurtherBasicBeanPane implements Previewable, UIObserver, Prepare4DataSourceChange { private static final int BEGIN = 1; private static final int END = 10; private static final int VGAP = 24; @@ -368,4 +369,9 @@ public class TableDataDictPane extends FurtherBasicBeanPane public boolean shouldResponseChangeListener() { return true; } + + @Override + public void registerDSChangeListener() { + tableDataNameComboBox.registerGlobalDSChangeListener(); + } } diff --git a/designer-realize/src/main/java/com/fr/design/present/PresentPane.java b/designer-realize/src/main/java/com/fr/design/present/PresentPane.java index fa7683bb02..8e8a669c9f 100644 --- a/designer-realize/src/main/java/com/fr/design/present/PresentPane.java +++ b/designer-realize/src/main/java/com/fr/design/present/PresentPane.java @@ -75,6 +75,7 @@ public class PresentPane extends UIComboBoxPane { displays.add(none.title4PopupWindow()); dictPresentPane = new DictPresentPane(); + dictPresentPane.registerDSChangeListener(); paneList.add(dictPresentPane); keys.add(DictPresent.class.getName()); displays.add(dictPresentPane.title4PopupWindow()); From 9daf000d59be72c07c6431d800079dbe0def7925 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 25 Nov 2019 17:06:40 +0800 Subject: [PATCH 07/11] fix --- .../design/data/DesignTableDataManager.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 6cf3d90629..44ec26127b 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -73,7 +73,7 @@ public abstract class DesignTableDataManager { */ private static java.util.Map globalDsCache = new java.util.HashMap(); private static java.util.Map dsNameChangedMap = new HashMap(); -// private static List dsListeners = new ArrayList(); + private static List globalDsListeners = new ArrayList<>(); private static Map> dsListenersMap = new HashMap>(); @@ -95,15 +95,19 @@ public abstract class DesignTableDataManager { * 响应数据集改变. */ private static void fireDsChanged() { + fireDsChanged(globalDsListeners); for (Entry> listenerEntry : dsListenersMap.entrySet()) { List dsListeners = listenerEntry.getValue(); - for (int i = 0; i < dsListeners.size(); i++) { - //增强for循环用的iterator实现的, 如果中间哪个listener修改或删除了(如ChartEditPane.dsChangeListener), - // 由于dsListeners是arraylist, 此时会ConcurrentModifyException -// for (ChangeListener l : dsListeners) { - ChangeEvent e = null; - dsListeners.get(i).stateChanged(e); - } + fireDsChanged(dsListeners); + } + } + + private static void fireDsChanged(List dsListeners) { + for (int i = 0; i < dsListeners.size(); i++) { + //增强for循环用的iterator实现的, 如果中间哪个listener修改或删除了(如ChartEditPane.dsChangeListener), + // 由于dsListeners是arraylist, 此时会ConcurrentModifyException + ChangeEvent e = null; + dsListeners.get(i).stateChanged(e); } } @@ -160,12 +164,8 @@ public abstract class DesignTableDataManager { } } - public static void addDsChangeListener(ChangeListener l) { - addDsChangeListener(l, HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()); - } - public static void addGlobalDsChangeListener(ChangeListener l) { - addDsChangeListener(l, null); + globalDsListeners.add(l); } /** @@ -173,7 +173,8 @@ public abstract class DesignTableDataManager { * * @param l ChangeListener监听器 */ - private static void addDsChangeListener(ChangeListener l, JTemplate template) { + public static void addDsChangeListener(ChangeListener l) { + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); String key = StringUtils.EMPTY; if (template != null) { key = template.getPath(); From 2927a00a09911be6c9d1dab7be5e26c0a457b0b8 Mon Sep 17 00:00:00 2001 From: pengda Date: Tue, 26 Nov 2019 09:51:35 +0800 Subject: [PATCH 08/11] =?UTF-8?q?REPORT-23954=20=20linux=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-rhel=E7=B3=BB=E7=BB=9F=EF=BC=8C=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/controlpane/UIControlPane.java | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index d47805de96..6319b239bb 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -9,18 +9,9 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.ShortCut; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; - -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.JDialog; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JSplitPane; -import javax.swing.border.EmptyBorder; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Cursor; @@ -34,6 +25,14 @@ import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.Window; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JSplitPane; +import javax.swing.border.EmptyBorder; + import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; @@ -72,7 +71,6 @@ abstract class UIControlPane extends JControlPane { this.creators = this.createNameableCreators(); initCardPane(); - if (isNewStyle()) { getPopupEditDialog(cardPane); this.add(getLeftPane(), BorderLayout.CENTER); @@ -148,9 +146,7 @@ abstract class UIControlPane extends JControlPane { topToolBar.setLayout(new BorderLayout()); ShortCut addItem = shortCutFactory.addItemShortCut().getShortCut(); addItem.intoJToolBar(topToolBar); - JPanel leftTopPane = getLeftTopPane(topToolBar); - leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0)); leftPane.add(leftTopPane, BorderLayout.NORTH); @@ -171,7 +167,6 @@ abstract class UIControlPane extends JControlPane { JPanel leftTopPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); leftTopPane.add(toolBarPane, BorderLayout.EAST); leftTopPane.add(addItemLabel, BorderLayout.CENTER); - return leftTopPane; } @@ -202,7 +197,6 @@ abstract class UIControlPane extends JControlPane { topToolBar.validate(); this.controlUpdatePane = createControlUpdatePane();//REPORT-4841 刷新一下编辑面板 cardPane.add(controlUpdatePane, "EDIT"); - this.repaint(); } @@ -248,7 +242,6 @@ abstract class UIControlPane extends JControlPane { return; } } - // 要隐藏 先检查有没有非法输入 // 非法输入检查放在最后,因为可能出现面板弹出新弹框而失去焦点的情况,比如 输入公式时,弹出公式编辑对话框 try { @@ -268,6 +261,8 @@ abstract class UIControlPane extends JControlPane { addWindowFocusListener(new WindowAdapter() { @Override public void windowLostFocus(WindowEvent e) { + //在Linux上拉回焦点,不然导致一些面板关不掉 + requestFocus(); hideDialog(); } }); From b8177b3b489de5572618c0a03a03ee8968d67f4e Mon Sep 17 00:00:00 2001 From: pengda Date: Tue, 26 Nov 2019 09:59:10 +0800 Subject: [PATCH 09/11] =?UTF-8?q?REPORT-23960=20linux=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-rhel=E7=B3=BB=E7=BB=9F=EF=BC=8C=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/HyperlinkGroupPaneActionImpl.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java b/designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java index fcade7789b..71a37e42f0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java @@ -3,7 +3,7 @@ package com.fr.design.mainframe; import com.fr.base.Style; import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.designer.TargetComponent; -import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; import com.fr.general.FRFont; @@ -24,7 +24,7 @@ import java.awt.Color; */ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionProvider { private static HyperlinkGroupPaneActionProvider instance; - + private static Selection selection ; private HyperlinkGroupPaneActionImpl() { } @@ -40,7 +40,9 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro ElementCasePane reportPane = (ElementCasePane)elementCasePane; final TemplateElementCase report = reportPane.getEditingElementCase(); NameJavaScriptGroup nameHyperlinks = getNameJSGroup(reportPane, report); + selection = reportPane.getSelection(); hyperlinkGroupPane.populate(nameHyperlinks); + } private NameJavaScriptGroup getNameJSGroup(ElementCasePane reportPane, final TemplateElementCase report) { @@ -67,13 +69,12 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro } ElementCasePane reportPane = (ElementCasePane)jt.getCurrentElementCasePane(); final TemplateElementCase report = reportPane.getEditingElementCase(); - final Selection sel = reportPane.getSelection(); final NameJavaScriptGroup updateNameHyperlinks = hyperlinkGroupPane.updateJSGroup(); - if (sel instanceof FloatSelection) { - FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)sel).getSelectedFloatName()); + if (selection instanceof FloatSelection) { + FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)selection).getSelectedFloatName()); selectedFloatElement.setNameHyperlinkGroup(updateNameHyperlinks); } else { - ReportActionUtils.actionIterateWithCellSelection((CellSelection)sel, report, new ReportActionUtils.IterAction() { + ReportActionUtils.actionIterateWithCellSelection((CellSelection)selection, report, new ReportActionUtils.IterAction() { public void dealWith(CellElement editCellElement) { Style elementStyle = editCellElement.getStyle(); FRFont frFont = elementStyle.getFRFont(); @@ -94,7 +95,6 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro } }); } - - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified(); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); } } From 1b936122d0bd92763e207a70250635f2a116b2c2 Mon Sep 17 00:00:00 2001 From: pengda Date: Tue, 26 Nov 2019 10:31:27 +0800 Subject: [PATCH 10/11] =?UTF-8?q?REPORT-23943=20=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=A2=84=E5=AE=9A=E4=B9=89=E6=8E=A7=E4=BB=B6=EF=BC=8C=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E6=97=A0=E6=B3=95=E7=BC=A9=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/FormWidgetPopWindow.java | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java index fc3967a992..7f1304d3a1 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java @@ -12,14 +12,11 @@ import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.AWTEventListener; import java.awt.event.MouseEvent; - import javax.swing.JPanel; import javax.swing.JWindow; - import com.fr.design.constants.UIConstants; -import com.fr.design.designer.beans.location.Location; import com.fr.design.gui.core.WidgetOption; -import com.fr.stable.OperatingSystem; +import com.fr.stable.os.OperatingSystem; //august: public class FormWidgetPopWindow extends JWindow { @@ -52,24 +49,28 @@ public class FormWidgetPopWindow extends JWindow { if (event instanceof MouseEvent) { MouseEvent mv = (MouseEvent) event; if (mv.getClickCount() > 0) { - Point point = new Point((int) (mv.getLocationOnScreen().getX()), (int) mv.getLocationOnScreen().getY()); - if (OperatingSystem.isWindows()) { - if(!FormWidgetPopWindow.this.contains(point)) { - FormWidgetPopWindow.this.setVisible(false); - } - } else if (OperatingSystem.isMacOS()) { - Dimension d = FormWidgetPopWindow.this.getSize(); - Point p = FormWidgetPopWindow.this.getLocation(); - Rectangle rect = new Rectangle(p, d); - if (!rect.contains(point)) { - FormWidgetPopWindow.this.setVisible(false); - } - } + hideWindow(mv); } } } }; + private void hideWindow(MouseEvent mv){ + Point point = new Point((int) (mv.getLocationOnScreen().getX()), (int) mv.getLocationOnScreen().getY()); + if (OperatingSystem.isWindows()) { + if (!FormWidgetPopWindow.this.contains(point)) { + FormWidgetPopWindow.this.setVisible(false); + } + }else if(OperatingSystem.isMacos() || OperatingSystem.isLinux()){ + Dimension d = FormWidgetPopWindow.this.getSize(); + Point p = FormWidgetPopWindow.this.getLocation(); + Rectangle rect = new Rectangle(p, d); + if (!rect.contains(point)) { + FormWidgetPopWindow.this.setVisible(false); + } + } + } + private class EditorChoosePane extends JPanel { public EditorChoosePane() { super(); From ffa155d0108bee325988142e5789b6352d46c90d Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 26 Nov 2019 14:35:51 +0800 Subject: [PATCH 11/11] =?UTF-8?q?REPORT-24357=20[=E5=86=92=E7=83=9F]?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E4=B8=AD=E7=BC=A9=E8=BF=9B?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=EF=BC=8C=E8=AE=BE=E7=BD=AE=E5=AE=8C=E6=AF=95?= =?UTF-8?q?=E4=B8=8D=E7=82=B9=E5=87=BB=E5=8E=9F=E6=9D=A5=E7=9A=84=E7=84=A6?= =?UTF-8?q?=E7=82=B9=EF=BC=8C=E7=BC=A9=E8=BF=9B=E8=B7=9D=E7=A6=BB=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=BF=9D=E5=AD=98=2010.0=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ispinner/UIBasicSpinner.java | 13 +++++++++++++ .../main/java/com/fr/design/condition/WHPane.java | 11 ----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/UIBasicSpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/UIBasicSpinner.java index 4b71a2c752..9c9f48fae2 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/UIBasicSpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/UIBasicSpinner.java @@ -7,6 +7,9 @@ import javax.swing.*; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import java.awt.*; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.text.ParseException; /** * Created by IntelliJ IDEA. @@ -56,7 +59,17 @@ public class UIBasicSpinner extends JSpinner implements UIObserver { } }); } + final JFormattedTextField textField = ((JSpinner.DefaultEditor) this.getEditor()).getTextField(); + textField.addFocusListener(new FocusAdapter() { + @Override + public void focusLost(FocusEvent e) { + try { + textField.commitEdit(); + } catch (ParseException ignore) { + } + } + }); } diff --git a/designer-realize/src/main/java/com/fr/design/condition/WHPane.java b/designer-realize/src/main/java/com/fr/design/condition/WHPane.java index e92bf212ee..dce2d466ad 100644 --- a/designer-realize/src/main/java/com/fr/design/condition/WHPane.java +++ b/designer-realize/src/main/java/com/fr/design/condition/WHPane.java @@ -33,17 +33,6 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane