Browse Source

Merge branch 'feature/10.0' of https://cloud.finedevelop.com/scm/~bjorn/design into feature/10.0

persist/11.0
白岳 5 years ago
parent
commit
2570ebc9dc
  1. 94
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 24
      designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java
  3. 4
      designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java
  4. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java
  5. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/GaugeDataSetFieldsPane.java
  6. 3
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/ScatterDataSetFieldsPane.java
  7. 4
      designer-chart/src/main/java/com/fr/design/chartx/single/CellDataPane.java
  8. 4
      designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java

94
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<? extends Configuration>[] 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<? extends Configuration>[] targets() {
return new Class[]{Log4jConfig.class};
}
});
@Override
public Class<? extends Configuration>[] targets() {
@SuppressWarnings("unchecked")
Class<? extends Configuration>[] classes = new Class[]{Log4jConfig.class};
return classes;
}
});
}
Configurations.update(new Worker() {
@Override

24
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<T extends ChartDataDefinitionProvide
ChartDataDefinitionProvider dataSetCollection = vanChart.getChartDataDefinition();
populate((T) dataSetCollection);
if (isMatchedDataType(dataSetCollection)) {
populate((T) dataSetCollection);
}
this.initAllListeners();
this.validate();
}
private boolean isMatchedDataType(ChartDataDefinitionProvider dataDefinition) {
if (dataDefinition == null) {
return true;
}
Type dataType = this.getClass().getGenericSuperclass();
if (dataType instanceof ParameterizedType) {
dataType = ((ParameterizedType) dataType).getActualTypeArguments()[0];
return AssistUtils.equals(dataDefinition.getClass(), dataType);
} else if (dataType instanceof Class) {
dataType = ((ParameterizedType) (((Class) dataType).getGenericSuperclass())).getActualTypeArguments()[0];
return ((Class) dataType).isAssignableFrom(dataDefinition.getClass());
}
return true;
}
@Override
public void update(ChartCollection collection) {

4
designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java

@ -83,11 +83,11 @@ public class EachLayerDataDefinitionPane extends MultiTabPane<DrillMapChartDataD
public void populateBean(DrillMapChartDataDefinition drillMapChartDataDefinition) {
List<AbstractDataDefinition> eachLayerDataDefinitionList = drillMapChartDataDefinition.getEachLayerDataDefinitionList();
if (eachLayerDataDefinitionList == null || eachLayerDataDefinitionList.size() == 0) {
if (eachLayerDataDefinitionList == null) {
return;
}
for (int i = 0, len = paneList.size(); i < len; i++) {
for (int i = 0, len = Math.min(paneList.size(), eachLayerDataDefinitionList.size()); i < len; i++) {
BasicPane basicPane = paneList.get(i);
if (basicPane instanceof SingleDataPane) {
((SingleDataPane) basicPane).populateBean(eachLayerDataDefinitionList.get(i));

2
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;
}

2
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/GaugeDataSetFieldsPane.java

@ -69,7 +69,7 @@ public class GaugeDataSetFieldsPane extends AbstractDataSetFieldsPane<GaugeColum
GaugeColumnFieldCollection gauge = new GaugeColumnFieldCollection();
updateField(category, gauge.getCategory());
updateField(value, gauge.getValue());
filterPane.updateBean(gauge.getCategory().getFilterProperties());
gauge.getCategory().setFilterProperties(filterPane.updateBean());
return gauge;
}

3
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/ScatterDataSetFieldsPane.java

@ -24,7 +24,6 @@ public class ScatterDataSetFieldsPane extends AbstractDataSetFieldsPane<BubbleCo
private UIComboBox yField;
private UIComboBoxWithNone size;
//todo 数据筛选
private AbstractSingleFilterPane filterPane;
@ -81,7 +80,7 @@ public class ScatterDataSetFieldsPane extends AbstractDataSetFieldsPane<BubbleCo
updateField(xField, field.getXField());
updateField(yField, field.getYField());
updateField(size, field.getSizeField());
filterPane.updateBean(field.getSeriesName().getFilterProperties());
field.getSeriesName().setFilterProperties(filterPane.updateBean());
return collection;
}

4
designer-chart/src/main/java/com/fr/design/chartx/single/CellDataPane.java

@ -47,6 +47,10 @@ public class CellDataPane extends FurtherBasicBeanPane<CellDataDefinition> {
@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());

4
designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java

@ -100,6 +100,10 @@ public class DataSetPane extends FurtherBasicBeanPane<DataSetDefinition> {
@Override
public void populateBean(DataSetDefinition ob) {
if (ob == null || ob.getColumnFieldCollection() == null) {
return;
}
refreshBoxList();
checkBoxUse();

Loading…
Cancel
Save