From 55bb2395ac9a8e22275d2572cbe32dffd43ea4b0 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 19 Nov 2019 15:24:26 +0800 Subject: [PATCH 1/5] =?UTF-8?q?REPORT-23978=20=E4=BB=A3=E7=A0=81=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 94 +++++++++++-------- 1 file changed, 56 insertions(+), 38 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 4a1c208c9..11ed79a71 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 @@ -47,10 +47,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; @@ -208,7 +234,7 @@ public class PreferencePane extends BasicPane { joinProductImproveCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Join_Product_Improve")); improvePane.add(joinProductImproveCheckBox); - if(SupportOSImpl.AUTOPUSHUPDATE.support()){ + if (SupportOSImpl.AUTOPUSHUPDATE.support()) { autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update")); improvePane.add(autoPushUpdateCheckBox); } @@ -486,23 +512,8 @@ public class PreferencePane extends BasicPane { JPanel logLevelPane = FRGUIPaneFactory.createTitledBorderPane("log" + i18nText("Fine-Design_Basic_Level_Setting")); logPane.add(logLevelPane); logLevelComboBox = new UIComboBox(LOG); + logLevelComboBox.setEnabled(WorkContext.getCurrent().isLocal()); logLevelPane.add(logLevelComboBox); - logLevelComboBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - Configurations.update(new Worker() { - @Override - public void run() { - Log4jConfig.getInstance().setRootLevel((Level) logLevelComboBox.getSelectedItem()); - } - - @Override - public Class[] targets() { - return new Class[]{Log4jConfig.class}; - } - }); - } - }); } private void createLanPane(JPanel generalPane) { @@ -530,8 +541,8 @@ public class PreferencePane extends BasicPane { }); UILabel noticeLabel = new UILabel(i18nText("Fine-Design_Basic_Work_After_Restart_Designer"));//sail:提示重启后生效 double p = TableLayout.PREFERRED; - double rowSize[] = {p}; - double columnSize[] = {p, p, p}; + double[] rowSize = {p}; + double[] columnSize = {p, p, p}; Component[][] components = { {languageLabel, languageComboBox, noticeLabel}, }; @@ -571,7 +582,7 @@ public class PreferencePane extends BasicPane { private void createLengthPane(JPanel advancePane) { double p = TableLayout.PREFERRED; - double rowSize[] = {p}; + double[] rowSize = {p}; // 长度单位选择 JPanel lengthPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Setting_Ruler_Units")); @@ -593,8 +604,8 @@ public class PreferencePane extends BasicPane { private void createServerPane(JPanel advancePane) { double p = TableLayout.PREFERRED; - double rowSize[] = {p}; - double columnSize[] = {p, p, p}; + double[] rowSize = {p}; + double[] columnSize = {p, p, p}; JPanel serverPortPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Web_Preview_Port_Setting")); advancePane.add(serverPortPane); @@ -633,7 +644,7 @@ public class PreferencePane extends BasicPane { /** * The method of populate. * - * @param designerEnvManager + * @param designerEnvManager 设计器环境管理器 */ public void populate(DesignerEnvManager designerEnvManager) { if (designerEnvManager == null) { @@ -662,7 +673,7 @@ public class PreferencePane extends BasicPane { defaultStringToFormulaBox.setSelected(false); } VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager(); - if (FineClusterConfig.getInstance().isCluster()) { + if (ClusterBridge.isClusterMode()) { vcsEnableCheckBox.setEnabled(false); gcEnableCheckBox.setEnabled(false); } @@ -801,17 +812,24 @@ public class PreferencePane extends BasicPane { designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50); } - Configurations.update(new Worker() { - @Override - public void run() { - Log4jConfig.getInstance().setRootLevel(((Level) logLevelComboBox.getSelectedItem())); - } + if (WorkContext.getCurrent().isLocal()) { + Configurations.update(new Worker() { + @Override + public void run() { + Level level = (Level) logLevelComboBox.getSelectedItem(); + if (level != null) { + Log4jConfig.getInstance().setRootLevel(level); + } + } - @Override - public Class[] targets() { - return new Class[]{Log4jConfig.class}; - } - }); + @Override + public Class[] targets() { + @SuppressWarnings("unchecked") + Class[] classes = new Class[]{Log4jConfig.class}; + return classes; + } + }); + } Configurations.update(new Worker() { @Override From aa6c95aef5283f74b64adee223918a9fd4272679 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 19 Nov 2019 15:28:12 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9C=89=E4=BA=9B=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E6=B2=A1=E9=85=8D=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chartx/data/drillMap/EachLayerDataDefinitionPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java index 39e7d9451..90cb153db 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java @@ -87,7 +87,7 @@ public class EachLayerDataDefinitionPane extends MultiTabPane Date: Tue, 19 Nov 2019 18:22:28 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chartx/data/drillMap/EachLayerDataDefinitionPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java index 90cb153db..02c6c4d08 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java @@ -83,7 +83,7 @@ public class EachLayerDataDefinitionPane extends MultiTabPane eachLayerDataDefinitionList = drillMapChartDataDefinition.getEachLayerDataDefinitionList(); - if (eachLayerDataDefinitionList == null || eachLayerDataDefinitionList.size() == 0) { + if (eachLayerDataDefinitionList == null) { return; } From af3ab4f439c2c7a0bf6685ecb4caea7ee83630f1 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Thu, 21 Nov 2019 00:15:29 +0800 Subject: [PATCH 4/5] =?UTF-8?q?CHART-11093=20fix=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/chartx/AbstractChartDataPane.java | 24 ++++++++++++++++++- .../fr/design/chartx/single/CellDataPane.java | 4 ++++ .../fr/design/chartx/single/DataSetPane.java | 4 ++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java index d072905e6..04412c0a5 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java @@ -5,8 +5,11 @@ import com.fr.chartx.data.ChartDataDefinitionProvider; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.plugin.chart.vanchart.VanChart; +import com.fr.stable.AssistUtils; import java.awt.BorderLayout; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; /** * Created by shine on 2019/4/15. @@ -42,12 +45,31 @@ public abstract class AbstractChartDataPane { @Override public void populateBean(CellDataDefinition ob) { + if (ob == null || ob.getColumnFieldCollection() == null) { + return; + } + Type dataType = ((ParameterizedType) cellDataFieldsPane.getClass().getGenericSuperclass()).getActualTypeArguments()[0]; if (AssistUtils.equals(ob.getColumnFieldCollection().getClass(), dataType)) { cellDataFieldsPane.populateBean(ob.getColumnFieldCollection()); diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java index 91d1a0688..5875b480a 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java @@ -100,6 +100,10 @@ public class DataSetPane extends FurtherBasicBeanPane { @Override public void populateBean(DataSetDefinition ob) { + if (ob == null || ob.getColumnFieldCollection() == null) { + return; + } + refreshBoxList(); checkBoxUse(); From 9060dc508ebed5ecf443a6081bee15462277758b Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Thu, 21 Nov 2019 10:14:49 +0800 Subject: [PATCH 5/5] =?UTF-8?q?CHART-11424=20fix=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E9=9D=A2=E6=9D=BF-=E6=95=B0=E6=8D=AE=E7=AD=9B?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java | 2 +- .../fr/design/chartx/fields/diff/GaugeDataSetFieldsPane.java | 2 +- .../fr/design/chartx/fields/diff/ScatterDataSetFieldsPane.java | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java index c24a23b4e..aa1c9fe28 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java @@ -57,7 +57,7 @@ public class FunnelDataSetFieldsPane extends AbstractDataSetFieldsWithSeriesValu ColumnFieldCollectionWithSeriesValue collection = new ColumnFieldCollectionWithSeriesValue(); updateSeriesValuePane(collection); SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = collection.getSeriesValueCorrelationDefinition(); - filterPane.updateBean(seriesValueCorrelationDefinition.getFilterProperties()); + seriesValueCorrelationDefinition.setFilterProperties(filterPane.updateBean()); return collection; } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/GaugeDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/GaugeDataSetFieldsPane.java index 9c09cc63c..2ff333cc7 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/GaugeDataSetFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/GaugeDataSetFieldsPane.java @@ -69,7 +69,7 @@ public class GaugeDataSetFieldsPane extends AbstractDataSetFieldsPane