Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

feature/big-screen
Yyming 4 years ago
parent
commit
e137cbc235
  1. 46
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java
  2. 3
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java
  3. 1
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/UIComboBoxWithEditLabel.java
  4. 2
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java
  5. 17
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnLabelConditionPane.java
  6. 25
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelNoCheckPane.java
  7. 2
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

46
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java

@ -15,20 +15,31 @@ import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iprogressbar.AutoProgressBar;
import com.fr.design.gui.itable.SortableJTable;
import com.fr.design.gui.itable.TableSorter;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.ui.util.UIUtil;
import com.fr.function.TIME;
import com.fr.general.FRFont;
import com.fr.log.FineLoggerFactory;
import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingWorker;
import javax.swing.UIManager;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;
@ -81,7 +92,7 @@ public class PreviewTablePane extends BasicPane {
JPanel currentPreviewPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
previewNumberPanel.add(currentPreviewPanel);
currentPreviewPanel.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Current_Preview_Rows") + ":"));
currentPreviewPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Current_Preview_Rows") + ":"));
currentRowsField = new UINumberField();
currentPreviewPanel.add(currentRowsField);
@ -91,7 +102,7 @@ public class PreviewTablePane extends BasicPane {
JPanel maxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
previewNumberPanel.add(maxPanel);
maxPanel.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Maximum_Number_of_Preview_Rows") + ":"));
maxPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Datasource_Maximum_Number_of_Preview_Rows") + ":"));
maxPreviewNumberField = new UINumberField();
maxPanel.add(maxPreviewNumberField);
@ -158,7 +169,7 @@ public class PreviewTablePane extends BasicPane {
if (this.dialog == null) {
this.dialog = this.showWindow(new JFrame());
}
progressBar = new AutoProgressBar(this, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) {
progressBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) {
public void doMonitorCanceled() {
if (getWorker() != null) {
getWorker().cancel(true);
@ -174,7 +185,7 @@ public class PreviewTablePane extends BasicPane {
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview");
return Toolkit.i18nText("Fine-Design_Basic_Preview");
}
private void addLoadedListener(LoadedEventListener l) {
@ -268,7 +279,7 @@ public class PreviewTablePane extends BasicPane {
*/
public static EmbeddedTableData previewTableData(TableData tableData, final int keyIndex, final int valueIndex) {
PreviewTablePane previewTablePane = new PreviewTablePane();
previewTablePane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Data")));
previewTablePane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Basic_Data")));
try {
previewTablePane.populate(tableData);
previewTablePane.resetPreviewTableColumnColor();
@ -298,13 +309,13 @@ public class PreviewTablePane extends BasicPane {
try {
int choiceColumn = Integer.parseInt(columnErrMessage.trim());
int tatalColumn = Integer.parseInt(tatolColumnErrMessage.trim());
columnErrMessage = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Preview_Warn_Text", choiceColumn + 1, tatalColumn);
columnErrMessage = Toolkit.i18nText("Fine-Design_Basic_Tabledata_Preview_Warn_Text", choiceColumn + 1, tatalColumn);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return;
}
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), columnErrMessage, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE);
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), columnErrMessage, Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE);
}
private void populate(TableData tableData) throws Exception {
@ -317,7 +328,7 @@ public class PreviewTablePane extends BasicPane {
}
private void previewTableDataSQL() throws Exception {
connectionBar = new AutoProgressBar(this, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Now_Create_Connection"), "", 0, 100) {
connectionBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Utils_Now_Create_Connection"), "", 0, 100) {
public void doMonitorCanceled() {
getWorker().cancel(true);
getDialog().setVisible(false);
@ -365,13 +376,14 @@ public class PreviewTablePane extends BasicPane {
if (tableData instanceof DBTableData) {
boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase());
if (!status) {
throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));
throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));
}
}
} finally {
connectionBar.close();
// 将close操作放到EDT线程中
UIUtil.invokeLaterIfNeeded(() -> connectionBar.close());
}
TableDataSource dataSource = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getTarget();
TableDataSource dataSource = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget();
previewTableData = DesignTableDataManager.previewTableDataNeedInputParameters(dataSource, tableData, (int) maxPreviewNumberField.getValue(), true, progressBar);
// parameterInputDialog
// update之后的parameters,转成一个parameterMap,用于预览TableData
@ -396,7 +408,7 @@ public class PreviewTablePane extends BasicPane {
if (!(e instanceof CancellationException)) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"));
Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"));
}
dialog.setVisible(false);
} finally {
@ -425,7 +437,7 @@ public class PreviewTablePane extends BasicPane {
public static void previewStoreData(final ProcedureDataModel storeProcedureDataModel, final int keyIndex, final int valueIndex) {
final PreviewTablePane previewTablePane = new PreviewTablePane();
previewTablePane.storeProcedureDataModel = storeProcedureDataModel;
previewTablePane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Data")));
previewTablePane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Basic_Data")));
try {
previewTablePane.populateStoreDataSQL();
@ -456,7 +468,7 @@ public class PreviewTablePane extends BasicPane {
for (int i = 0; i < tableSize; i++) {
PreviewTablePane previewTablePane = new PreviewTablePane();
previewTablePane.storeProcedureDataModel = storeProcedureDataModels[i];
previewTablePane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Data")));
previewTablePane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Basic_Data")));
try {
previewTablePane.populateStoreDataSQL();
} catch (Exception e) {
@ -469,7 +481,7 @@ public class PreviewTablePane extends BasicPane {
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview");
return Toolkit.i18nText("Fine-Design_Basic_Preview");
}
};

3
designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java

@ -15,10 +15,10 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.List;
public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPane {
@ -66,6 +66,7 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa
private JPanel createUIComboBoxPane(UIComboBox comboBox, String title) {
UILabel label = new UILabel(title);
label.setPreferredSize(new Dimension(80, 20));
comboBox.setPreferredSize(new Dimension(100, 20));
JPanel panel = new JPanel();

1
designer-chart/src/main/java/com/fr/van/chart/box/data/table/UIComboBoxWithEditLabel.java

@ -31,6 +31,7 @@ public abstract class UIComboBoxWithEditLabel extends JPanel implements UIObserv
editLabel.setPreferredSize(new Dimension(80, 20));
comboBox = new UIComboBox();
comboBox.setPreferredSize(new Dimension(100, 20));
this.setLayout(new BorderLayout(4, 0));
this.add(editLabel, BorderLayout.WEST);

2
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java

@ -49,7 +49,7 @@ public class VanChartColumnConditionPane extends DataSeriesConditionPane{
classPaneMap.put(AttrBackground.class, new VanChartColumnSeriesColorConditionPane(this));
classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this));
classPaneMap.put(AttrBorder.class, new VanChartColumnLabelBorderPane(this));
classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot));
classPaneMap.put(AttrLabel.class, new VanChartColumnLabelConditionPane(this, plot));
classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this));
classPaneMap.put(VanChartAttrTrendLine.class, new VanChartTrendLineConditionPane(this));
classPaneMap.put(AttrSeriesImageBackground.class, new VanChartSeriesImageBackgroundConditionPane(this));

17
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnLabelConditionPane.java

@ -0,0 +1,17 @@
package com.fr.van.chart.column;
import com.fr.chart.chartattr.Plot;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane;
import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane;
public class VanChartColumnLabelConditionPane extends VanChartLabelConditionPane {
public VanChartColumnLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) {
super(conditionAttributesPane, plot);
}
protected VanChartPlotLabelPane createLabelPane() {
return new VanChartColumnPlotLabelNoCheckPane(getPlot(),null);
}
}

25
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelNoCheckPane.java

@ -0,0 +1,25 @@
package com.fr.van.chart.column;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.van.chart.designer.style.VanChartStylePane;
import java.awt.BorderLayout;
public class VanChartColumnPlotLabelNoCheckPane extends VanChartColumnPlotLabelPane {
public VanChartColumnPlotLabelNoCheckPane(Plot plot, VanChartStylePane parent) {
super(plot, parent);
}
protected void addComponents() {
this.setLayout(new BorderLayout());
this.add(getLabelPane(), BorderLayout.CENTER);
}
public void populate(AttrLabel attr) {
super.populate(attr);
getLabelShowCheckBox().setSelected(true);
getLabelPane().setVisible(true);
}
}

2
designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

@ -157,7 +157,7 @@
return {
isAuto: this.model.isAuto,
content: value
content: BI.NicEditor.htmlDecode(value)
};
},

Loading…
Cancel
Save