Browse Source

Merge branch 'release/11.0' of https://code.fineres.com/scm/~henry.wang/design into release/11.0

fix-lag
Henry.Wang 3 years ago
parent
commit
d21b416daa
  1. 6
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 12
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  3. 8
      designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java
  4. 24
      designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java
  5. 26
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  6. 2
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  7. 47
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/db/DBTableDataSavedHook.java
  8. 27
      designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java
  9. 2
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  10. 11
      designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java
  11. 11
      designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java
  12. 34
      designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxUI.java
  13. 13
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIScrollPane.java
  14. 9
      designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java
  15. 4
      designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java
  16. 4
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  17. 15
      designer-base/src/main/java/com/fr/env/handler/WorkspaceExceptionHandler.java
  18. 1
      designer-base/src/main/resources/com/fr/env/jarVersion.properties
  19. 25
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  20. 1
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java
  21. 6
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  22. 10
      designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java
  23. 1
      designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java
  24. 27
      designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java
  25. 10
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java
  26. 12
      designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java
  27. 2
      designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java
  28. 17
      designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java
  29. 1
      designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

6
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -20,7 +20,7 @@ import com.fr.design.notification.NotificationCenter;
import com.fr.design.utils.DesignUtils;
import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.env.EnvListPane;
import com.fr.env.handler.RemoteDesignExceptionHandler;
import com.fr.env.handler.WorkspaceExceptionHandler;
import com.fr.exit.DesignerExiter;
import com.fr.general.GeneralUtils;
import com.fr.invoke.Reflect;
@ -139,7 +139,7 @@ public class EnvChangeEntrance {
pluginErrorRemind();
} catch (Exception exception) {
// 失败的处理
RemoteDesignExceptionHandler.getInstance().handleInSwitch(exception, selectedEnv);
WorkspaceExceptionHandler.getInstance().handleInSwitch(exception, selectedEnv);
return false;
}
TemplateTreePane.getInstance().refreshDockingView();
@ -436,7 +436,7 @@ public class EnvChangeEntrance {
}
});
if (e != null) {
RemoteDesignExceptionHandler.getInstance().handleInStart(e, workspaceInfo);
WorkspaceExceptionHandler.getInstance().handleInStart(e, workspaceInfo);
}
envListDialog.setVisible(true);
}

12
designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

@ -161,10 +161,18 @@ public abstract class DesignTableDataManager {
}
public static String getChangedDsNameByOldDsName(String oldDsName) {
String changeName;
if (isDsNameChanged(oldDsName)) {
return dsNameChangedMap.get(oldDsName);
changeName = dsNameChangedMap.get(oldDsName);
} else {
changeName = StringUtils.EMPTY;
}
if (StringUtils.isNotEmpty(changeName)) {
return getChangedDsNameByOldDsName(changeName);
} else {
return StringUtils.EMPTY;
return oldDsName;
}
}

8
designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java

@ -9,6 +9,7 @@ import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.file.TableDataConfig;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
@ -80,12 +81,13 @@ public class TreeTableDataComboBox extends UIComboBox {
}
public void setSelectedTableDataByName(String name) {
refresh();
TableDataWrapper tableDataWrapper;
if (res_map.get(name) != null) {
tableDataWrapper = res_map.get(name);
} else {
String changeName = DesignTableDataManager.getChangedDsNameByOldDsName(name);
if (StringUtils.isNotEmpty(changeName)) {
tableDataWrapper = res_map.get(changeName);
} else {
tableDataWrapper = res_map.get(name);
}
this.getModel().setSelectedItem(tableDataWrapper);
}

24
designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java

@ -64,7 +64,7 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
tableFlowPane.add(tableDataNameComboBox);
tableDataNameComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
tdChange();
tdChange(true);
}
});
tableFlowPane.add(new PreviewLabel(this));
@ -73,19 +73,21 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
this.add(centerPane, BorderLayout.CENTER);
parentMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Parent_Marked_Filed"), true);
lengthMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Marked_Filed_Length"));
parentMarkRadio.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
parentMarkRadio.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (isBuildByParentFiled()) {
makeParentEnable();
tdChange();
tdChange(false);
}
}
});
lengthMarkRadio.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
lengthMarkRadio.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (!isBuildByParentFiled()) {
makeLengthEnable();
tdChange();
tdChange(false);
}
}
});
@ -169,7 +171,7 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
}
private void tdChange() {
private void tdChange(boolean isChangeDS) {
TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem();
if (tableDataWrappe == null) {
return;
@ -186,8 +188,10 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
String[] columnNames = new String[len];
namelist.toArray(columnNames);
for (int i = 0; i < valueEditorPanes.length; i++) {
if (isChangeDS || isNoSelectedColumnName(valueEditorPanes[i])) {
valueEditorPanes[i].setEditors(new Editor[]{new ColumnNameEditor(columnNames), new ColumnIndexEditor(len)}, columnNames[0]);
}
}
} catch (Exception e) {
for (int i = 0; i < valueEditorPanes.length; i++) {
valueEditorPanes[i].setEditors(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}, 1);
@ -197,6 +201,10 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
}
}
private boolean isNoSelectedColumnName(ValueEditorPane valueEditorPane) {
return (Integer) valueEditorPane.update() == -1;
}
@Override
protected String title4PopupWindow() {
return "TreeTableDataDictionay";

26
designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -7,6 +7,7 @@ import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxUI;
import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength;
@ -32,6 +33,8 @@ import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.plaf.ComboBoxUI;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
@ -275,8 +278,9 @@ public class JDBCDefPane extends JPanel {
}
dbtypeComboBox.addActionListener(dbtypeActionListener);
dbtypeComboBox.setMaximumRowCount(10);
driverLoaderBox = new UIComboBox();
driverLoaderBox = new SpecialUIComboBox();
refreshDriverLoader();
driverLoaderBox.setPreferredSize(new Dimension(200, driverLoaderBox.getPreferredSize().height));
driverLoaderBox.setEditable(false);
driverManageBox = new UIComboBox();
refreshDriverManage(true);
@ -350,7 +354,7 @@ public class JDBCDefPane extends JPanel {
odbcTipsPane.add(driverManageLabel);
odbcTipsPane.add(odbcTipsLink);
JPanel driverComboBoxAndTips = new JPanel(new BorderLayout());
JPanel normalFlowInnerContainer_s_pane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
JPanel normalFlowInnerContainer_s_pane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(0, 5, 0);
normalFlowInnerContainer_s_pane.add(driverManageBox);
normalFlowInnerContainer_s_pane.add(driverComboBox);
normalFlowInnerContainer_s_pane.add(driverLoaderBox);
@ -717,4 +721,22 @@ public class JDBCDefPane extends JPanel {
private String driver;
private String url;
}
private static class SpecialUIComboBox extends UIComboBox {
@Override
public ComboBoxUI getUIComboBoxUI() {
return new SpecialUIComboBoxUI();
}
}
private static class SpecialUIComboBoxUI extends UIComboBoxUI {
@Override
public ComboPopup createPopup() {
return createHorizontalNeverUIComboPopUp();
}
}
}

2
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -19,7 +19,6 @@ import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.data.datapane.preview.sql.PreviewPerformedSqlPane;
import com.fr.design.data.datapane.sqlpane.SQLEditPane;
import com.fr.design.data.tabledata.strategy.StrategyConfigHandler;
import com.fr.design.data.tabledata.tabledatapane.db.DBTableDataSavedHook;
import com.fr.design.data.tabledata.tabledatapane.db.StrategyConfigFrom;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
@ -45,6 +44,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.esd.core.strategy.config.StrategyConfig;
import com.fr.esd.core.strategy.config.StrategyConfigHelper;
import com.fr.esd.core.strategy.config.service.StrategyConfigService;
import com.fr.esd.data.db.DBTableDataSavedHook;
import com.fr.esd.event.DSMapping;
import com.fr.esd.event.DsNameTarget;
import com.fr.esd.event.StrategyEventsNotifier;

47
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/db/DBTableDataSavedHook.java

@ -1,47 +0,0 @@
package com.fr.design.data.tabledata.tabledatapane.db;
import com.fr.data.impl.DBTableData;
import com.fr.esd.event.DSMapping;
import com.fr.esd.event.DsNameTarget;
import com.fr.esd.event.StrategyEventsNotifier;
import com.fr.esd.event.xml.XMLSavedHook;
import com.fr.stable.StringUtils;
public class DBTableDataSavedHook implements XMLSavedHook<DBTableData> {
private static final long serialVersionUID = 4925391747683335372L;
private final String tplPath;
private String origName;
private String origConnection;
private String origQuery;
public DBTableDataSavedHook(String tplPath, DBTableData origDBTableData) {
this.tplPath = tplPath;
this.origName = origDBTableData.getDsName();
this.origConnection = origDBTableData.getDatabase().toString();
this.origQuery = origDBTableData.getQuery();
}
@Override
public void doAfterSaved(DBTableData saved) {
String dsName = saved.getDsName();
String conn = saved.getDatabase().toString();
String query = saved.getQuery();
//检查数据集名称、数据链接和sql是否修改,如果修改需要触发缓存监听事件
if (!dsName.equals(origName) || !conn.equals(origConnection) || !query.equals(origQuery)) {
if (StringUtils.isNotEmpty(tplPath) && StringUtils.isNotEmpty(origName)) {
//新建数据集的origName为null,不用触发
StrategyEventsNotifier.modifyDataSet(new DSMapping(tplPath, new DsNameTarget(origName)));
}
}
this.origName = dsName;
this.origConnection = conn;
this.origQuery = query;
}
}

27
designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java vendored

@ -1,18 +1,37 @@
package com.fr.design.env;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;
import com.fr.locale.InterProviderFactory;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.engine.exception.MainVersionNotMatchException;
import java.io.File;
import java.util.Properties;
/**
* Created by juhaoyu on 2018/6/15.
*/
public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
private static final String REPORT_ENGINE_KEY = "report-engine-key";
private static final String REPORT_ENGINE_JAR;
private static final String PROP_PATH = "/com/fr/env/jarVersion.properties";
static {
Properties properties = new Properties();
try {
properties.load(LocalDesignerWorkspaceInfo.class.getResourceAsStream(PROP_PATH));
} catch (Exception ignored) {
}
REPORT_ENGINE_JAR = properties.getProperty(REPORT_ENGINE_KEY, "default.jar");
}
private String name;
private String path;
@ -86,6 +105,14 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
return false;
}
File engineLib = new File(StableUtils.pathJoin(this.path, ProjectConstants.LIB_NAME, REPORT_ENGINE_JAR));
// 非安装版本允许自由切换
boolean notExistLib = !ComparatorUtils.equals(GeneralUtils.readFullBuildNO(), InterProviderFactory.getProvider().getLocText("Fine-Core_Basic_About_No_Build"))
&& !engineLib.exists();
if (notExistLib) {
throw new MainVersionNotMatchException();
}
return true;
}
}

2
designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

@ -93,7 +93,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
@Override
public void mousePressed(MouseEvent evt) {
if (evt.getClickCount() == 2) {
if (reportletsTree.getPathForLocation(evt.getX(), evt.getY()) != null && evt.getClickCount() == 2) {
openFile();
}
}

11
designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java

@ -27,13 +27,16 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.stable.StringUtils;
import java.awt.*;
import javax.swing.JPanel;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;
import javax.swing.*;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
public class JTreeAutoBuildPane extends BasicPane implements PreviewLabel.Previewable, EditOrNewLabel.Editable {
private TreeTableDataComboBox treeTableDataComboBox;

11
designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java

@ -10,6 +10,7 @@ import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.GeneralUtils;
import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils;
@ -27,6 +28,7 @@ import java.math.BigDecimal;
* For input Number.
*/
public abstract class UnitInputPane extends BasicPane {
private static final double MAX_NUM = 3000.0D;
private static final double NUM_POINT = 0.000001;
private int scale = -1;
String title;
@ -46,7 +48,7 @@ public abstract class UnitInputPane extends BasicPane {
centerPane.add(titleLabel);
// Denny:在对话框中加入JSpinner对象
numberFieldSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 999, 1));
numberFieldSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, MAX_NUM, 1));
GUICoreUtils.setColumnForSpinner(numberFieldSpinner, 24);
numberFieldSpinner.setPreferredSize(new Dimension(60, 20));
numberFieldSpinner.setMinimumSize(new Dimension(60, 20));
@ -71,11 +73,11 @@ public abstract class UnitInputPane extends BasicPane {
public void populate(float floatValue) {
popValue = floatValue;
numberFieldSpinner.setModel(new SpinnerNumberModel(0.00, 0.00, 999.00, 0.01));
numberFieldSpinner.setModel(new SpinnerNumberModel(0.00, 0.00, MAX_NUM, 0.01));
JFormattedTextField temp = GUICoreUtils.getSpinnerTextField(numberFieldSpinner);
addChangeListener(temp);
BigDecimal de = new BigDecimal(floatValue + "");
BigDecimal de = new BigDecimal(GeneralUtils.objectToString(floatValue));
if (scale > 0) {
floatValue = de.setScale(scale, BigDecimal.ROUND_DOWN).floatValue();
} else {
@ -108,7 +110,8 @@ public abstract class UnitInputPane extends BasicPane {
if (temp.getText().length() == 0) {
return 0;
}
BigDecimal de = new BigDecimal(temp.getText());
BigDecimal de = new BigDecimal(GeneralUtils.objectToString(temp.getValue()));
if (scale > 0) {
return de.setScale(scale, BigDecimal.ROUND_DOWN).floatValue();
} else {

34
designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxUI.java

@ -10,12 +10,26 @@ import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import sun.swing.DefaultLookup;
import javax.swing.*;
import javax.swing.AbstractButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ListCellRenderer;
import javax.swing.ScrollPaneConstants;
import javax.swing.UIManager;
import javax.swing.plaf.ButtonUI;
import javax.swing.plaf.basic.BasicComboBoxUI;
import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.*;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
@ -159,6 +173,10 @@ public class UIComboBoxUI extends BasicComboBoxUI implements MouseListener {
return new UIComboPopup(comboBox);
}
protected ComboPopup createHorizontalNeverUIComboPopUp() {
return new HorizontalNeverUIComboPopup(comboBox);
}
private void setRollover(boolean isRollover) {
if (this.isRollover != isRollover) {
this.isRollover = isRollover;
@ -270,4 +288,16 @@ public class UIComboBoxUI extends BasicComboBoxUI implements MouseListener {
}
}
private class HorizontalNeverUIComboPopup extends UIComboPopup {
public HorizontalNeverUIComboPopup(JComboBox comboBox) {
super(comboBox);
}
@Override
protected JScrollPane createScroller() {
return new UIScrollPane(list, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
}
}
}

13
designer-base/src/main/java/com/fr/design/gui/icontainer/UIScrollPane.java

@ -3,8 +3,11 @@ package com.fr.design.gui.icontainer;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.iscrollbar.UIScrollBar;
import javax.swing.*;
import java.awt.*;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import java.awt.Color;
import java.awt.Component;
/**
* @author zhou
@ -16,7 +19,11 @@ public class UIScrollPane extends JScrollPane {
private static final int INCREAMENT = 30;
public UIScrollPane(Component c) {
super(c, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
this(c, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
}
public UIScrollPane(Component c, int vertical, int horizontal) {
super(c, vertical, horizontal);
this.setHorizontalScrollBar(createHorizontalScrollBar());
this.getVerticalScrollBar().setUnitIncrement(INCREAMENT);
this.getVerticalScrollBar().setBlockIncrement(INCREAMENT);

9
designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java

@ -117,7 +117,9 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
private JPanel initParamsPane() {
extendParametersCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Extends_Report_Parameters"));
extendParametersCheckBox.setSelected(true);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setVisible(false);
parameterViewPane.addTableEditorListener(new TableModelListener() {
public void tableChanged(TableModelEvent e) {
List<ParameterProvider> list = parameterViewPane.update();
@ -158,6 +160,7 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
customNameRadio = new UIRadioButton(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Filename_Custom"));
addRadioToGroup(fileNameRadioGroup, defaultNameRadio, customNameRadio);
fileNameFormulaEditor = new FormulaEditor(Toolkit.i18nText("Fine-Design_Report_Parameter_Formula"));
fileNameFormulaEditor.setEnabled(false);
fileNameRadioGroup.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -220,10 +223,8 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
@Override
public void actionPerformed(ActionEvent e) {
if (currentTemplateRadio.isSelected()) {
reportPathTextField.setEnabled(false);
browserButton.setEnabled(false);
} else {
reportPathTextField.setEnabled(true);
browserButton.setEnabled(true);
}
}
@ -234,11 +235,13 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
JPanel reportletNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
// 路径输入框
reportPathTextField = new UITextField(20);
reportPathTextField.setEnabled(false);
reportletNamePane.add(reportPathTextField, BorderLayout.CENTER);
// 选择路径按钮
browserButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Select"));
browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, 20));
browserButton.setEnabled(false);
reportletNamePane.add(browserButton, BorderLayout.EAST);
browserButton.addActionListener(new ActionListener() {
@Override
@ -272,10 +275,8 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
}
this.templateRadioGroup.selectIndexButton(ob.isCurrentTemplate() ? 0 : 1);
if (ob.isCurrentTemplate()) {
this.reportPathTextField.setEnabled(false);
this.browserButton.setEnabled(false);
} else {
this.reportPathTextField.setEnabled(true);
this.browserButton.setEnabled(true);
this.reportPathTextField.setText(ob.getTemplatePath());
}

4
designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java

@ -47,12 +47,12 @@ public class FRGUIPaneFactory {
}
/**
* 创建一个靠左的布局上下间隔为0左右间隔为常量
* 创建一个靠左的布局上下间隔为0左右间隔为常量首间隔为0
*
* @return FlowLayout对象
*/
public static LayoutManager createLeftZeroVgapNormalHgapLayout() {
return new FlowLayout(FlowLayout.LEFT, 5, 0);
return new FRLeftFlowLayout(0, 5, 0);
}

4
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -21,7 +21,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.scrollruler.ModLineBorder;
import com.fr.env.handler.RemoteDesignExceptionHandler;
import com.fr.env.handler.WorkspaceExceptionHandler;
import com.fr.stable.StringUtils;
import com.fr.third.guava.base.Strings;
import com.fr.workspace.WorkContext;
@ -596,7 +596,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
}
} catch (Exception e) {
dialog.dispose();
RemoteDesignExceptionHandler.getInstance().handleInTest(e, remoteEnv);
WorkspaceExceptionHandler.getInstance().handleInTest(e, remoteEnv);
}
dialogDownPane.remove(cancelButton);
dialogDownPane.revalidate();

15
designer-base/src/main/java/com/fr/env/handler/RemoteDesignExceptionHandler.java → designer-base/src/main/java/com/fr/env/handler/WorkspaceExceptionHandler.java vendored

@ -1,5 +1,6 @@
package com.fr.env.handler;
import com.fr.base.exception.ExceptionDescriptor;
import com.fr.design.EnvChangeEntrance;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.env.DesignerWorkspaceInfo;
@ -11,6 +12,7 @@ import com.fr.env.handler.impl.CommonHandler;
import com.fr.env.handler.impl.ExecutionHandler;
import com.fr.env.handler.impl.UnexpectedHandler;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import java.util.ArrayList;
import java.util.List;
import javax.swing.UIManager;
@ -23,11 +25,11 @@ import static javax.swing.JOptionPane.ERROR_MESSAGE;
* @version 10.0
* Created by hades on 2021/8/5
*/
public class RemoteDesignExceptionHandler {
public class WorkspaceExceptionHandler {
private static final RemoteDesignExceptionHandler INSTANCE = new RemoteDesignExceptionHandler();
private static final WorkspaceExceptionHandler INSTANCE = new WorkspaceExceptionHandler();
public static RemoteDesignExceptionHandler getInstance() {
public static WorkspaceExceptionHandler getInstance() {
return INSTANCE;
}
@ -35,7 +37,7 @@ public class RemoteDesignExceptionHandler {
private final List<Handler<RefWrapper, ResultWrapper>> switchList = new ArrayList<>();
private RemoteDesignExceptionHandler() {
private WorkspaceExceptionHandler() {
// 要保证顺序
testList.add(new CancelHandler());
testList.add(new ExecutionHandler());
@ -65,11 +67,15 @@ public class RemoteDesignExceptionHandler {
public void handleInSwitch(Throwable e, DesignerWorkspaceInfo workspaceInfo) {
if (workspaceInfo == null || workspaceInfo.getType() == DesignerWorkspaceType.Local) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
if (e instanceof ExceptionDescriptor) {
new CommonHandler(true).handle(new RefWrapper(e, StringUtils.EMPTY));
} else {
FineJOptionPane.showMessageDialog(EnvChangeEntrance.getInstance().getDialog(),
Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"),
Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"),
ERROR_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon"));
}
return;
}
handle(e, switchList, workspaceInfo);
@ -78,6 +84,7 @@ public class RemoteDesignExceptionHandler {
public void handleInStart(Throwable e, DesignerWorkspaceInfo workspaceInfo) {
if (workspaceInfo == null || workspaceInfo.getType() == DesignerWorkspaceType.Local) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
new CommonHandler(false).handle(new RefWrapper(e, StringUtils.EMPTY));
return;
}
handle(e, testList, workspaceInfo);

1
designer-base/src/main/resources/com/fr/env/jarVersion.properties vendored

@ -0,0 +1 @@
report-engine-key=fine-report-engine-10.0.jar

25
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -25,17 +25,19 @@ import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils;
import javax.swing.JPanel;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/**
* 图表 属性表, 类型选择 界面.
@ -99,6 +101,19 @@ public class ChartTypePane extends AbstractChartAttrPane {
buttonPane.setEditingChartPane(chartTypeComBox);
buttonPane.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
buttonPane.requestFocus();
}
});
chartTypeComBox.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
content.requestFocus();
}
});
return content;
}

1
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java

@ -72,6 +72,7 @@ public class ChartImagePane extends ChartSelectDemoPane {
}else{
this.isDoubleClicked = false;
}
this.requestFocus();
super.mouseClicked(e);
}

6
designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java

@ -783,6 +783,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
// 不超过可绘制区域
int extraX = Math.min(creatorRightX, formDesignerWidth);
int extraY = creatorRightY < 0 ? 0 : Math.min(creatorRightY, formDesignerHeight);
if (designer.isFormParaDesigner() && extraY + this.getHeight() >= formDesignerHeight) {
popup.setVisible(false);
return;
}
// 放到事件尾部执行
SwingUtilities.invokeLater(new Runnable() {
@Override

10
designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java

@ -103,6 +103,16 @@ public class XWParameterLayout extends XWAbsoluteLayout {
return false;
}
@Override
public boolean canEnterIntoAbsolutePane() {
return false;
}
@Override
public boolean canEnterIntoAdaptPane() {
return false;
}
/**
* 该组件是否可以拖拽(表单中参数面板和自适应布局不可以拖拽)
* @return 是则返回true

1
designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java

@ -39,6 +39,7 @@ public class TemplateTool {
@Override
public void on(Event event, JTemplate jTemplate) {
if (!(jTemplate instanceof JForm)) {
JFormType.OLD_TYPE.switchUIMode();
return;
}
JFormType currentType = JFormType.OLD_TYPE;

27
designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java

@ -10,6 +10,7 @@ import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.XWScaleLayout;
import com.fr.design.designer.creator.XWTitleLayout;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
@ -60,6 +61,11 @@ public class FormSelectionUtils {
*/
public static void paste2Container(FormDesigner designer, XLayoutContainer parent,
FormSelection clipboard, int x, int y) {
clipboard = filterFormSelection(clipboard, parent);
if (clipboard.isEmpty()) {
Toolkit.getDefaultToolkit().beep();
return;
}
LayoutAdapter adapter = parent.getLayoutAdapter();
if (parent instanceof XWAbsoluteLayout) {
//绝对布局
@ -77,6 +83,27 @@ public class FormSelectionUtils {
Toolkit.getDefaultToolkit().beep();
}
private static FormSelection filterFormSelection(FormSelection clipboard, XLayoutContainer parent) {
FormSelection newSelection = new FormSelection();
for (XCreator xCreator : clipboard.getSelectedCreators()) {
if (parent.acceptType(XWParameterLayout.class)) {
if (xCreator.canEnterIntoParaPane()) {
newSelection.addSelectedCreator(xCreator);
}
} else if (parent.acceptType(XWAbsoluteLayout.class)) {
if (xCreator.canEnterIntoAbsolutePane()) {
newSelection.addSelectedCreator(xCreator);
}
} else if (parent.acceptType(XWFitLayout.class)) {
if (xCreator.canEnterIntoAdaptPane()) {
newSelection.addSelectedCreator(xCreator);
}
}
}
return newSelection;
}
private static boolean isExtraContainer(XLayoutContainer parent) {
if (parent != null) {
Set<FormWidgetOptionProvider> set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG);

10
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java

@ -14,6 +14,7 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
@ -164,9 +165,14 @@ public class OnlineWidgetRepoPane extends BasicPane {
tipLabel1.setForeground(Color.decode("#8F8F92"));
UILabel tipLabel2 = tipLabel(Toolkit.i18nText("Fine-Design_Share_Internet_Connect_Failed_Tip2"));
tipLabel2.setForeground(Color.decode("#8F8F92"));
UILabel tipLabel3 = tipLabel(MARKET_URL);
tipLabel3.setForeground(Color.decode("#8F8F92"));
JTextField tipLabel3 = new JTextField(MARKET_URL);
tipLabel3.setHorizontalAlignment(JTextField.CENTER);
tipLabel3.setPreferredSize(new Dimension(240, 20));
tipLabel3.setEditable(false);
tipLabel3.setForeground(Color.decode("#8F8F92"));
tipLabel3.setBackground(null);
tipLabel3.setBorder(null);
UILabel emptyLabel = tipLabel(StringUtils.EMPTY);
panel.add(uiLabel);

12
designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java

@ -107,17 +107,17 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
// 移动端弹窗
MobilePopupPane mobilePopupPane = new MobilePopupPane();
hyperlinkPane.add(MOBILEPOPUP, mobilePopupPane);
// 导出事件
if (workbook) {
ExportJavaScriptPane exportJavaScriptPane = new ExportJavaScriptPane();
hyperlinkPane.add(EXPORT, exportJavaScriptPane);
cards.add(exportJavaScriptPane);
}
cards.add(javaScriptPane);
cards.add(commit2DBJavaScriptPane);
cards.add(customActionPane);
cards.add(emailPane);
cards.add(mobilePopupPane);
// 导出事件 这里要按顺序添加
if (workbook) {
ExportJavaScriptPane exportJavaScriptPane = new ExportJavaScriptPane();
hyperlinkPane.add(EXPORT, exportJavaScriptPane);
cards.add(exportJavaScriptPane);
}
//其他事件
addOtherEvent();
hyperlinkPane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_JavaScript_Set")));

2
designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java

@ -779,7 +779,7 @@ public class PageSetupPane extends BasicPane {
//使用科学计数法显示长度的时候,限制纵向显示长度为9位
if (h_str.contains(E)) {
String str1 = h_str.substring(h_str.indexOf(E));
String str2 = h_str.substring(0, 9 - str1.length());
String str2 = h_str.substring(0, Math.min(h_str.length(), 9) - str1.length());
h_str = str2 + str1;
} else if (h_str.indexOf(CoreConstants.DOT) > 0) {
h_str = h_str.substring(0, h_str.indexOf(CoreConstants.DOT) + 2);

17
designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java

@ -157,7 +157,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
dragType = GridUtils.DRAG_CELL_SIZE;
isDragPermited = true;
dragIndex = index;
showToolTip(evt, createToolTipString(sizeList.get(dragIndex).toPixD(resolution), sizeList.getRangeValue(0, dragIndex + 1).toPixD(resolution)));
showToolTip(evt, createToolTipString(sizeList.get(dragIndex), sizeList.getRangeValue(0, dragIndex + 1)));
return true;
}
if (between(evt, tmpSize1, tmpSize2)) {
@ -301,21 +301,18 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
protected abstract void resetGridSelectionBySelect(int index, ElementCasePane ePane);
private String createToolTipString(double doubleValue, double totalDoubleValue) {
private String createToolTipString(UNIT unitValue, UNIT totalUnitValue) {
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
// int resolution = ScreenResolution.getScreenResolution();
FU ulen = FU.valueOfPix((int) doubleValue, resolution);
FU tulen = FU.valueOfPix((int) totalDoubleValue, resolution);
ReportLengthUNITProvider lengthUNIT = DesignerUIModeConfig.getInstance().parseLengthUNIT(unitType);
String unit = lengthUNIT.unitText();
double len = lengthUNIT.unit2Value4Scale(ulen);
double tlen = lengthUNIT.unit2Value4Scale(tulen);
double len = lengthUNIT.unit2Value4Scale(unitValue);
double tlen = lengthUNIT.unit2Value4Scale(totalUnitValue);
StringBuilder sb = new StringBuilder();
sb.append(String.format("%.2f", new Double(len)))
.append('/').append(String.format("%.2f", new Double(tlen)))
.append(unit).append('(')
.append((int)(doubleValue)).append('/')
.append((int)(totalDoubleValue))
.append((int)(unitValue.toPixD(resolution))).append('/')
.append((int)(totalUnitValue.toPixD(resolution)))
.append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px"))
.append(')');
return sb.toString();
@ -416,7 +413,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
DynamicUnitList sizeList = getSizeList(report);
// int resolution = ScreenResolution.getScreenResolution();
this.setToolTipText2(this.createToolTipString(sizeList.get(dragIndex).toPixD(resolution), sizeList.getRangeValue(0, dragIndex + 1).toPixD(resolution)));
this.setToolTipText2(this.createToolTipString(sizeList.get(dragIndex), sizeList.getRangeValue(0, dragIndex + 1)));
}
ePane.repaint();

1
designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

@ -9,7 +9,6 @@ import com.fr.design.env.DesignerWorkspaceGenerator;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.LocalDesignerWorkspaceInfo;
import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.env.handler.RemoteDesignExceptionHandler;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;

Loading…
Cancel
Save