Browse Source

Fixed merge conflict

bugfix/11.0
zheng 3 years ago
parent
commit
5fa2312daf
  1. 2
      build.gradle
  2. 8
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  3. 16
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  4. 260
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  5. 2
      designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java
  6. 2
      designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java
  7. 14
      designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java
  8. 14
      designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java
  9. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  10. 5
      designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java
  11. 5
      designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java
  12. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java
  13. 4
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java
  14. 24
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java
  15. 13
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java
  16. 4
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AbstractTemplateStylePane.java
  17. 5
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleTemplateStyleEditor.java
  18. 7
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java
  19. 5
      designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java
  20. 61
      designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java
  21. 16
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  22. 22
      designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java
  23. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  24. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  25. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  26. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  27. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  28. 9
      designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java
  29. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java
  30. 91
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java
  31. 186
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java
  32. 3
      designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java
  33. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java
  34. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java
  35. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java
  36. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java
  37. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  38. 2
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java
  39. 3
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  40. 47
      designer-form/src/main/java/com/fr/design/designer/ui/PopupDialogContext.java
  41. 17
      designer-form/src/main/java/com/fr/design/designer/ui/SelectedPopupDialog.java
  42. 3
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java
  43. 2
      designer-realize/src/main/java/com/fr/design/actions/server/ServerConfigManagerAction.java
  44. 3
      designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java
  45. 1
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  46. 9
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

2
build.gradle

@ -68,7 +68,7 @@ allprojects {
implementation 'org.swingexplorer:swexpl:2.0.1' implementation 'org.swingexplorer:swexpl:2.0.1'
implementation 'org.swingexplorer:swag:1.0' implementation 'org.swingexplorer:swag:1.0'
implementation 'net.java.dev.jna:jna:5.4.0' implementation 'net.java.dev.jna:jna:5.4.0'
implementation 'org.apache.tomcat:tomcat-catalina:8.5.69' implementation 'org.apache.tomcat:tomcat-catalina:8.5.72'
implementation 'io.socket:socket.io-client:0.7.0' implementation 'io.socket:socket.io-client:0.7.0'
implementation 'com.fr.third:fine-third:' + frVersion implementation 'com.fr.third:fine-third:' + frVersion
implementation 'com.fr.core:fine-core:' + frDevVersion implementation 'com.fr.core:fine-core:' + frDevVersion

8
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -885,6 +885,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
designerLoginConfigManager.setPluginRemindOnFirstLaunch(pluginRemindOnFirstLaunch); designerLoginConfigManager.setPluginRemindOnFirstLaunch(pluginRemindOnFirstLaunch);
} }
public boolean isUseOldVersionLogin() {
return designerLoginConfigManager.isUseOldVersionLogin();
}
public void setUseOldVersionLogin(boolean useOldVersionLogin) {
designerLoginConfigManager.setUseOldVersionLogin(useOldVersionLogin);
}
/** /**
* 内置服务器是否使用时启动 * 内置服务器是否使用时启动
* *

16
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -11,6 +11,7 @@ import com.fr.design.fun.ConnectionProvider;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
@ -30,6 +31,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.UUID;
/** /**
* Connection List Pane. * Connection List Pane.
@ -190,4 +192,18 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
connectionListDialog.addDialogActionListener(new ConnectionListDialogActionAdapter(connectionManagerPane, connectionListDialog, connectionConfig)); connectionListDialog.addDialogActionListener(new ConnectionListDialogActionAdapter(connectionManagerPane, connectionListDialog, connectionConfig));
connectionListDialog.setVisible(true); connectionListDialog.setVisible(true);
} }
@Override
public void onCopyItem() {
super.onCopyItem();
ListModelElement selectedValue = getSelectedValue();
// identity 需要重置
if (selectedValue != null && selectedValue.wrapper != null) {
Object temp = ((NameObject) selectedValue.wrapper).getObject();
if (temp instanceof JDBCDatabaseConnection) {
JDBCDatabaseConnection object = (JDBCDatabaseConnection) temp;
object.setIdentity(UUID.randomUUID().toString());
}
}
}
} }

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

@ -1,10 +1,13 @@
package com.fr.design.data.datapane.connect; package com.fr.design.data.datapane.connect;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.data.driver.DriverLoader;
import com.fr.data.driver.config.DriverLoaderConfig;
import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.design.border.UITitledBorder; import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox; 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.ActionLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength;
@ -21,6 +24,8 @@ import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.guava.collect.HashBiMap;
import com.fr.workspace.WorkContext;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
@ -28,6 +33,8 @@ import javax.swing.JPanel;
import javax.swing.JPasswordField; import javax.swing.JPasswordField;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.plaf.ComboBoxUI;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
@ -45,6 +52,7 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -101,8 +109,60 @@ public class JDBCDefPane extends JPanel {
private JDBCDatabaseConnection jdbcDatabase; private JDBCDatabaseConnection jdbcDatabase;
private boolean needRefresh = true; private boolean needRefresh = true;
private UIComboBox driverManageBox;
private ActionLabel driverManageLabel;
private UIComboBox driverLoaderBox;
ActionListener driverManageListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
boolean selectSelfDefine = isSelfDefine();
driverManageLabel.setVisible(selectSelfDefine);
driverLoaderBox.setVisible(selectSelfDefine);
driverComboBox.setVisible(!selectSelfDefine);
// 选中自定义的话,将odbc的屏蔽,选中默认的话,重新触发一次driverComboBox的事件
if (selectSelfDefine) {
odbcTipsLink.setVisible(false);
} else {
driverComboBox.setSelectedItem(driverComboBox.getSelectedItem());
}
}
};
ActionListener dbtypeActionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
urlTextField.setText(StringUtils.EMPTY);
driverComboBox.removeAllItems();
driverManageBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Driver_Manage_Default"));
if (driverLoaderBox.getItemCount() > 0) {
driverLoaderBox.setSelectedIndex(0);
}
if (ComparatorUtils.equals(dbtypeComboBox.getSelectedItem(), StringUtils.EMPTY)) {
driverComboBox.setSelectedItem(StringUtils.EMPTY);
return;
}
DriverURLName[] dus = jdbcMap.get(dbtypeComboBox.getSelectedItem());
for (int i = 0, len = dus.length; i < len; i++) {
driverComboBox.addItem(dus[i].getDriver());
if (i == 0) {
driverComboBox.setSelectedItem(dus[i].getDriver());
urlTextField.setText(dus[i].getURL());
}
}
// 更改数据库类型后 数据库名称置空和之前逻辑保持一致
if (needRefresh) {
jdbcDatabase.setDatabase(StringUtils.EMPTY);
}
changePane(dbtypeComboBox.getSelectedItem());
JDBCConnectionDef.getInstance().setConnection((String) dbtypeComboBox.getSelectedItem(), jdbcDatabase);
DatabaseConnectionPane.JDBC.getAdvancedAttrPane().populate(jdbcDatabase);
}
};
private HashBiMap<String, String> nameAndRepresent;
public JDBCDefPane() { public JDBCDefPane() {
initMap();
this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":")); this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":"));
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
JPanel innerthis = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel innerthis = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
@ -115,7 +175,15 @@ public class JDBCDefPane extends JPanel {
} }
dbtypeComboBox.addActionListener(dbtypeActionListener); dbtypeComboBox.addActionListener(dbtypeActionListener);
dbtypeComboBox.setMaximumRowCount(10); dbtypeComboBox.setMaximumRowCount(10);
driverLoaderBox = new SpecialUIComboBox();
refreshDriverLoader();
driverLoaderBox.setPreferredSize(new Dimension(200, driverLoaderBox.getPreferredSize().height));
driverLoaderBox.setEditable(false);
driverManageBox = new UIComboBox();
refreshDriverManage(true);
driverManageBox.setEditable(false);
driverManageBox.addActionListener(driverManageListener);
driverLoaderBox.setVisible(isSelfDefine());
driverComboBox = new UIComboBox(); driverComboBox = new UIComboBox();
driverComboBox.setEditable(true); driverComboBox.setEditable(true);
driverComboBox.addActionListener(driverListener); driverComboBox.addActionListener(driverListener);
@ -163,9 +231,33 @@ public class JDBCDefPane extends JPanel {
BrowseUtils.browser(url); BrowseUtils.browser(url);
} }
}); });
driverManageLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Driver_Manage_Add_Driver")) {
@Override
public void paintComponent(Graphics _gfx) {
super.paintComponent(_gfx);
_gfx.setColor(Color.blue);
_gfx.drawLine(0, this.getHeight() - 1, GraphHelper.getWidth(this.getText()), this.getHeight() - 1);
}
};
driverManageLabel.setPreferredSize(new Dimension(GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Driver_Manage_Add_Driver")), driverManageLabel.getPreferredSize().height));
driverManageLabel.setVisible(isSelfDefine());
driverManageLabel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
String url = CloudCenter.getInstance().acquireUrlByKind("driver.add.help");
BrowseUtils.browser(url);
}
});
odbcTipsPane.add(driverManageLabel);
odbcTipsPane.add(odbcTipsLink);
JPanel driverComboBoxAndTips = new JPanel(new BorderLayout()); JPanel driverComboBoxAndTips = new JPanel(new BorderLayout());
driverComboBoxAndTips.add(driverComboBox, BorderLayout.WEST); 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);
driverComboBoxAndTips.add(normalFlowInnerContainer_s_pane, BorderLayout.WEST);
driverComboBoxAndTips.add(odbcTipsPane, BorderLayout.CENTER); driverComboBoxAndTips.add(odbcTipsPane, BorderLayout.CENTER);
JPanel hostPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); JPanel hostPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
@ -225,7 +317,71 @@ public class JDBCDefPane extends JPanel {
innerthis.add(centerPanel); innerthis.add(centerPanel);
} }
private void refreshDriverLoader() {
Set<String> representSet = nameAndRepresent.values();
driverLoaderBox.clearBoxItems();
for (String represent : representSet) {
driverLoaderBox.addItem(represent);
}
}
private String getRepresent(String driverClass, String driverName) {
return driverClass + "(" + driverName + ")";
}
private boolean isSelfDefine() {
return ComparatorUtils.equals(Toolkit.i18nText("Fine-Design_Driver_Manage_Self_Define"), driverManageBox.getSelectedItem());
}
private void refreshDriverManage(boolean addSelfDefine) {
driverManageBox.clearBoxItems();
driverManageBox.addItem(Toolkit.i18nText("Fine-Design_Driver_Manage_Default"));
if (addSelfDefine) {
driverManageBox.addItem(Toolkit.i18nText("Fine-Design_Driver_Manage_Self_Define"));
}
}
private void initMap() {
Map<String, DriverLoader> driverLoaders = DriverLoaderConfig.getInstance().getDriverLoaders();
nameAndRepresent = getDriverLoaderAndRepresent(driverLoaders);
}
private HashBiMap<String, String> getDriverLoaderAndRepresent(Map<String, DriverLoader> driverLoaders) {
HashBiMap<String, String> driverHashBiMap = HashBiMap.create();
if (WorkContext.getCurrent().isWarDeploy()) {
return driverHashBiMap;
}
// name 是唯一的,name+driver自然也是唯一的
for (DriverLoader driverLoader : driverLoaders.values()) {
driverHashBiMap.put(driverLoader.getName(), getRepresent(driverLoader.getDriverClass(), driverLoader.getName()));
}
return driverHashBiMap;
}
protected JDBCDatabaseConnection getJDBCDatabase() {
return this.jdbcDatabase;
}
private void changePane(Object dbType) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f, 22};
if (ComparatorUtils.equals(dbType, OTHER_DB) || ComparatorUtils.equals(dbType, "Access") || ComparatorUtils.equals(dbType, "SQLite")) {
if (this.centerPanel.getComponentCount() != partComponents.length * 2) {
centerPanel.removeAll();
TableLayoutHelper.addComponent2ResultPane(partComponents, new double[]{p, p, p, p, p}, columnSize, centerPanel);
}
} else if (this.centerPanel.getComponentCount() != allComponents.length * 2) {
centerPanel.removeAll();
TableLayoutHelper.addComponent2ResultPane(allComponents, new double[]{p, p, p, p, p, p, p, p}, columnSize, centerPanel);
}
}
public void populate(JDBCDatabaseConnection jdbcDatabase) { public void populate(JDBCDatabaseConnection jdbcDatabase) {
// 单例对象,重新打开的时候并不会新建,但是由于driverloaderbox里面需要是动态内容,因此需要进行刷新动作
initMap();
refreshDriverLoader();
needRefresh = false; needRefresh = false;
if (jdbcDatabase == null) { if (jdbcDatabase == null) {
jdbcDatabase = new JDBCDatabaseConnection(); jdbcDatabase = new JDBCDatabaseConnection();
@ -255,7 +411,24 @@ public class JDBCDefPane extends JPanel {
this.dbtypeComboBox.setSelectedItem(OTHER_DB); this.dbtypeComboBox.setSelectedItem(OTHER_DB);
} }
} }
// jdbcDatabase.getDriverSource() 只会是空或者是有值,但是为了保险起见,还是应该做个处理
String driverSource = jdbcDatabase.getDriverSource();
if (driverSource == null) {
driverSource = StringUtils.EMPTY;
}
if (driverSource.isEmpty()) {
refreshDriverManage(!nameAndRepresent.isEmpty());
this.driverManageBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Driver_Manage_Default"));
this.driverComboBox.setSelectedItem(jdbcDatabase.getDriver()); this.driverComboBox.setSelectedItem(jdbcDatabase.getDriver());
} else {
refreshDriverManage(true);
this.driverManageBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Driver_Manage_Self_Define"));
String represent = getRepresent(jdbcDatabase.getDriver(), jdbcDatabase.getDriverSource());
if (!nameAndRepresent.containsValue(represent)) {
this.driverLoaderBox.addItem(represent);
}
this.driverLoaderBox.setSelectedItem(represent);
}
this.urlTextField.setText(jdbcDatabase.getURL()); this.urlTextField.setText(jdbcDatabase.getURL());
this.userNameTextField.setText(jdbcDatabase.getUser()); this.userNameTextField.setText(jdbcDatabase.getUser());
this.passwordTextField.setText(jdbcDatabase.getPassword()); this.passwordTextField.setText(jdbcDatabase.getPassword());
@ -268,31 +441,10 @@ public class JDBCDefPane extends JPanel {
needRefresh = false; needRefresh = false;
} }
protected JDBCDatabaseConnection getJDBCDatabase() {
return this.jdbcDatabase;
}
private void changePane(Object dbType) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f, 22};
if (ComparatorUtils.equals(dbType, OTHER_DB) || ComparatorUtils.equals(dbType, "Access") || ComparatorUtils.equals(dbType, "SQLite")) {
if (this.centerPanel.getComponentCount() != partComponents.length * 2) {
centerPanel.removeAll();
TableLayoutHelper.addComponent2ResultPane(partComponents, new double[]{p, p, p, p, p}, columnSize, centerPanel);
}
} else if (this.centerPanel.getComponentCount() != allComponents.length * 2) {
centerPanel.removeAll();
TableLayoutHelper.addComponent2ResultPane(allComponents, new double[]{p, p, p, p, p, p, p, p}, columnSize, centerPanel);
}
}
public JDBCDatabaseConnection update() { public JDBCDatabaseConnection update() {
if (jdbcDatabase == null) { if (jdbcDatabase == null) {
jdbcDatabase = new JDBCDatabaseConnection(); jdbcDatabase = new JDBCDatabaseConnection();
} }
Object driveItem = this.driverComboBox.getSelectedItem();
jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString().trim());
jdbcDatabase.setURL(this.urlTextField.getText().trim()); jdbcDatabase.setURL(this.urlTextField.getText().trim());
jdbcDatabase.setUser(this.userNameTextField.getText().trim()); jdbcDatabase.setUser(this.userNameTextField.getText().trim());
jdbcDatabase.setPassword(new String(this.passwordTextField.getPassword()).trim()); jdbcDatabase.setPassword(new String(this.passwordTextField.getPassword()).trim());
@ -304,36 +456,30 @@ public class JDBCDefPane extends JPanel {
jdbcDatabase.setNewCharsetName(EncodeConstants.ENCODING_GBK); jdbcDatabase.setNewCharsetName(EncodeConstants.ENCODING_GBK);
jdbcDatabase.setOriginalCharsetName(((String) this.charSetComboBox.getSelectedItem())); jdbcDatabase.setOriginalCharsetName(((String) this.charSetComboBox.getSelectedItem()));
} }
return jdbcDatabase; String driverLoader = (String) this.driverLoaderBox.getSelectedItem();
if (driverLoader == null) {
driverLoader = StringUtils.EMPTY;
} }
if (isSelfDefine()) {
ActionListener dbtypeActionListener = new ActionListener() { String[] split = driverLoader.split("\\(");
public void actionPerformed(ActionEvent evt) { if (split.length > 1) {
String name = split[1];
urlTextField.setText(StringUtils.EMPTY); if (name.length() > 0) {
driverComboBox.removeAllItems(); jdbcDatabase.setDriverSource(name.substring(0, name.length() - 1));
if (ComparatorUtils.equals(dbtypeComboBox.getSelectedItem(), StringUtils.EMPTY)) { } else {
driverComboBox.setSelectedItem(StringUtils.EMPTY); jdbcDatabase.setDriverSource(StringUtils.EMPTY);
return;
}
DriverURLName[] dus = jdbcMap.get(dbtypeComboBox.getSelectedItem());
for (int i = 0, len = dus.length; i < len; i++) {
driverComboBox.addItem(dus[i].getDriver());
if (i == 0) {
driverComboBox.setSelectedItem(dus[i].getDriver());
urlTextField.setText(dus[i].getURL());
} }
} else {
jdbcDatabase.setDriverSource(StringUtils.EMPTY);
} }
// 更改数据库类型后 数据库名称置空和之前逻辑保持一致 jdbcDatabase.setDriver(split[0]);
if (needRefresh) { } else {
jdbcDatabase.setDatabase(StringUtils.EMPTY); Object driveItem = this.driverComboBox.getSelectedItem();
jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString().trim());
jdbcDatabase.setDriverSource(StringUtils.EMPTY);
} }
changePane(dbtypeComboBox.getSelectedItem()); return jdbcDatabase;
JDBCConnectionDef.getInstance().setConnection((String) dbtypeComboBox.getSelectedItem(), jdbcDatabase);
DatabaseConnectionPane.JDBC.getAdvancedAttrPane().populate(jdbcDatabase);
} }
};
ActionListener driverListener = new ActionListener() { ActionListener driverListener = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -579,4 +725,22 @@ public class JDBCDefPane extends JPanel {
private String driver; private String driver;
private String url; 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/dialog/UIDetailErrorLinkDialog.java

@ -92,7 +92,7 @@ public class UIDetailErrorLinkDialog extends UIDialog {
contentPane.add(link, BorderLayout.SOUTH); contentPane.add(link, BorderLayout.SOUTH);
// 确定 + 取消 // 确定 + 取消
JPanel actionPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, GAP_10, GAP_10)); JPanel actionPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, GAP_10, GAP_5));
actionPane.add(createButton(Toolkit.i18nText("Fine-Design_Report_OK"))); actionPane.add(createButton(Toolkit.i18nText("Fine-Design_Report_OK")));
actionPane.add(createButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"))); actionPane.add(createButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")));
this.getContentPane().add(topPane, BorderLayout.NORTH); this.getContentPane().add(topPane, BorderLayout.NORTH);

2
designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java

@ -47,7 +47,7 @@ public class DesignerLoginHelper {
} }
public static void showLoginDialog(DesignerLoginSource source, Map<String, String> params, Window window) { public static void showLoginDialog(DesignerLoginSource source, Map<String, String> params, Window window) {
if (!SupportOSImpl.DESIGNER_LOGIN.support()) { if (!SupportOSImpl.DESIGNER_LOGIN.support() || DesignerEnvManager.getEnvManager().isUseOldVersionLogin()) {
WebViewDlgHelper.createLoginDialog(window); WebViewDlgHelper.createLoginDialog(window);
return; return;
} }

14
designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java

@ -70,6 +70,10 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter {
* 插件管理第一次启动时的提醒 * 插件管理第一次启动时的提醒
*/ */
private boolean pluginRemindOnFirstLaunch = true; private boolean pluginRemindOnFirstLaunch = true;
/**
* 使用旧版登录
*/
private boolean useOldVersionLogin = false;
private DesignerLoginConfigManager() { private DesignerLoginConfigManager() {
@ -98,6 +102,7 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter {
this.setLastLoginAccount(reader.getAttrAsString("lastLoginAccount", StringUtils.EMPTY)); this.setLastLoginAccount(reader.getAttrAsString("lastLoginAccount", StringUtils.EMPTY));
this.setLoginRemindBeforeJumpBBS(reader.getAttrAsBoolean("loginRemindBeforeJumpBBS", true)); this.setLoginRemindBeforeJumpBBS(reader.getAttrAsBoolean("loginRemindBeforeJumpBBS", true));
this.setPluginRemindOnFirstLaunch(reader.getAttrAsBoolean("pluginRemindOnFirstLaunch", true)); this.setPluginRemindOnFirstLaunch(reader.getAttrAsBoolean("pluginRemindOnFirstLaunch", true));
this.setUseOldVersionLogin(reader.getAttrAsBoolean("useOldVersionLogin", false));
} }
} }
@ -117,6 +122,7 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter {
writer.attr("lastLoginAccount", lastLoginAccount); writer.attr("lastLoginAccount", lastLoginAccount);
writer.attr("loginRemindBeforeJumpBBS", loginRemindBeforeJumpBBS); writer.attr("loginRemindBeforeJumpBBS", loginRemindBeforeJumpBBS);
writer.attr("pluginRemindOnFirstLaunch", pluginRemindOnFirstLaunch); writer.attr("pluginRemindOnFirstLaunch", pluginRemindOnFirstLaunch);
writer.attr("useOldVersionLogin", useOldVersionLogin);
writer.end(); writer.end();
} }
@ -223,4 +229,12 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter {
public void setPluginRemindOnFirstLaunch(boolean pluginRemindOnFirstLaunch) { public void setPluginRemindOnFirstLaunch(boolean pluginRemindOnFirstLaunch) {
this.pluginRemindOnFirstLaunch = pluginRemindOnFirstLaunch; this.pluginRemindOnFirstLaunch = pluginRemindOnFirstLaunch;
} }
public boolean isUseOldVersionLogin() {
return useOldVersionLogin;
}
public void setUseOldVersionLogin(boolean useOldVersionLogin) {
this.useOldVersionLogin = useOldVersionLogin;
}
} }

14
designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java

@ -8,9 +8,7 @@ import com.fr.design.login.utils.DesignerLoginUtils;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.update.push.DesignerPushUpdateManager; import com.fr.design.update.push.DesignerPushUpdateManager;
import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory;
import com.fr.general.CloudCenterConfig;
import com.fr.general.http.HttpToolbox;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.WindowConstants; import javax.swing.WindowConstants;
@ -39,7 +37,11 @@ public class DesignerGuideHelper {
public static void prepareShowGuideDialog() { public static void prepareShowGuideDialog() {
// 如果存在更新升级的弹窗,则不显示引导页面 // 如果存在更新升级的弹窗,则不显示引导页面
if (!DesignerLoginUtils.isOnline() || !SupportOSImpl.DESIGNER_LOGIN.support() || !FRContext.isChineseEnv() || DesignerPushUpdateManager.getInstance().isShouldPopUp()) { if (!DesignerLoginUtils.isOnline()
|| !SupportOSImpl.DESIGNER_LOGIN.support()
|| !FRContext.isChineseEnv()
|| DesignerPushUpdateManager.getInstance().isShouldPopUp()
|| DesignerEnvManager.getEnvManager().isUseOldVersionLogin()) {
return; return;
} }
if (isActivatedForOneWeek()) { if (isActivatedForOneWeek()) {
@ -52,7 +54,11 @@ public class DesignerGuideHelper {
DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() {
@Override @Override
public void designerOpened() { public void designerOpened() {
try {
showGuideDialog(); showGuideDialog();
} catch (Throwable t) {
FineLoggerFactory.getLogger().warn(t.getMessage(), t);
}
} }
}); });
} }

2
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -441,8 +441,10 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
*/ */
@Deprecated @Deprecated
public void refreshResource() { public void refreshResource() {
if (JTemplateFactory.isAvailable()) {
refreshResource(this.editingFILE); refreshResource(this.editingFILE);
} }
}
public void refreshResource(FILE file) { public void refreshResource(FILE file) {

5
designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java

@ -93,4 +93,7 @@ public final class JTemplateFactory {
ALL_APP.remove(app); ALL_APP.remove(app);
} }
} }
}
public static boolean isAvailable() {
return !ALL_APP.isEmpty();
}}

5
designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java

@ -288,6 +288,8 @@ public class ComponentCollector implements XMLable {
private JSONArray getGroupingDetail() { private JSONArray getGroupingDetail() {
JSONArray ja = JSONFactory.createJSON(JSON.ARRAY); JSONArray ja = JSONFactory.createJSON(JSON.ARRAY);
try {
DefaultShareGroupManager.getInstance().refresh();
Group[] groups = DefaultShareGroupManager.getInstance().getAllGroup(); Group[] groups = DefaultShareGroupManager.getInstance().getAllGroup();
for(Group group : groups) { for(Group group : groups) {
JSONObject jo = JSONFactory.createJSON(JSON.OBJECT); JSONObject jo = JSONFactory.createJSON(JSON.OBJECT);
@ -295,6 +297,9 @@ public class ComponentCollector implements XMLable {
jo.put(CONTAIN_AMOUNT, group.getAllBindInfoList().length); jo.put(CONTAIN_AMOUNT, group.getAllBindInfoList().length);
ja.add(jo); ja.add(jo);
} }
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage());
}
return ja; return ja;
} }

2
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java

@ -41,7 +41,7 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane<ReportTheme
public ReportThemePreviewPane() { public ReportThemePreviewPane() {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
chartPreviewPane = new ChartPreviewPane(); chartPreviewPane = new ChartPreviewPane();
chartPreviewPane.setPreferredSize(new Dimension(615, 237)); chartPreviewPane.setPreferredSize(new Dimension(615, 207));
chartPreviewPane.populate(initColumnChart()); chartPreviewPane.populate(initColumnChart());
chartPreviewPane.setCallbackEvent(this); chartPreviewPane.setCallbackEvent(this);
reportPreviewPane = new ECReportPreviewPane(); reportPreviewPane = new ECReportPreviewPane();

4
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java

@ -30,6 +30,10 @@ public abstract class AbstractECPreviewPane extends UINoOpaquePanel implements T
return getCellStyle(cellStyleList.getUse4SmallTitle()); return getCellStyle(cellStyleList.getUse4SmallTitle());
} }
protected Style getAssistMsgStyle(ThemedCellStyleList cellStyleList) {
return getCellStyle(cellStyleList.getUse4SupportInfo());
}
private Style getCellStyle(ThemedCellStyle themedCellStyle) { private Style getCellStyle(ThemedCellStyle themedCellStyle) {
if (themedCellStyle == null) { if (themedCellStyle == null) {
return Style.DEFAULT_STYLE; return Style.DEFAULT_STYLE;

24
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java

@ -24,15 +24,18 @@ public class ECPreviewPane extends AbstractECPreviewPane {
private final List<AbstractPreviewCell> headerCellList = new ArrayList<>(); private final List<AbstractPreviewCell> headerCellList = new ArrayList<>();
private final List<AbstractPreviewCell> contentCellList = new ArrayList<>(); private final List<AbstractPreviewCell> contentCellList = new ArrayList<>();
private final List<AbstractPreviewCell> highLightCellList = new ArrayList<>(); private final List<AbstractPreviewCell> highLightCellList = new ArrayList<>();
private final List<AbstractPreviewCell> assistCellList = new ArrayList<>();
private static final int COL_COUNT = 5; private static final int COL_COUNT = 5;
private static final int CONTENT_ROW_COUNT = 2; private static final int CONTENT_ROW_COUNT = 2;
public ECPreviewPane() { public ECPreviewPane() {
this.setPreferredSize(new Dimension(517, 147)); this.setPreferredSize(new Dimension(517, 158));
this.setBorder(BorderFactory.createEmptyBorder(0, 1, 2, 1)); this.setBorder(BorderFactory.createEmptyBorder(0, 1, 2, 1));
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel titlePane = new UINoOpaquePanel(new GridLayout()); JPanel titlePane = new UINoOpaquePanel(new GridLayout());
this.add(titlePane, BorderLayout.NORTH); JPanel extCenterPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
this.add(extCenterPane, BorderLayout.CENTER);
extCenterPane.add(titlePane, BorderLayout.NORTH);
for (int i = 0; i < COL_COUNT; i++) { for (int i = 0; i < COL_COUNT; i++) {
PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header"));
cell.setPreferredSize(new Dimension(103, 36)); cell.setPreferredSize(new Dimension(103, 36));
@ -40,22 +43,29 @@ public class ECPreviewPane extends AbstractECPreviewPane {
headerCellList.add(cell); headerCellList.add(cell);
} }
JPanel contentPane = new UINoOpaquePanel(new GridLayout(2, 5, 0, 0)); JPanel contentPane = new UINoOpaquePanel(new GridLayout(2, 5, 0, 0));
this.add(contentPane, BorderLayout.CENTER); extCenterPane.add(contentPane, BorderLayout.CENTER);
for (int i = 0; i < COL_COUNT * CONTENT_ROW_COUNT; i++) { for (int i = 0; i < COL_COUNT * CONTENT_ROW_COUNT; i++) {
PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text")); PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text"));
cell.setPreferredSize(new Dimension(103, 33)); cell.setPreferredSize(new Dimension(103, 30));
contentPane.add(cell); contentPane.add(cell);
contentCellList.add(cell); contentCellList.add(cell);
} }
JPanel endPane = new UINoOpaquePanel(new GridLayout()); JPanel endPane = new UINoOpaquePanel(new GridLayout());
this.add(endPane, BorderLayout.SOUTH); extCenterPane.add(endPane, BorderLayout.SOUTH);
for (int i = 0; i < COL_COUNT; i++) { for (int i = 0; i < COL_COUNT; i++) {
PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text")); PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text"));
cell.setPreferredSize(new Dimension(103, 33)); cell.setPreferredSize(new Dimension(103, 30));
endPane.add(cell); endPane.add(cell);
highLightCellList.add(cell); highLightCellList.add(cell);
} }
JPanel extSouthPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
PreviewCell assistCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Assist_Text"));
assistCell.setPreferredSize(new Dimension(123, 30));
assistCellList.add(assistCell);
extSouthPane.add(assistCell);
this.add(extSouthPane, BorderLayout.SOUTH);
} }
@Override @Override
@ -64,6 +74,8 @@ public class ECPreviewPane extends AbstractECPreviewPane {
refresh(headerCellList, getReportHeaderStyle(cellStyleConfig)); refresh(headerCellList, getReportHeaderStyle(cellStyleConfig));
refresh(contentCellList, getMainContentStyle(cellStyleConfig)); refresh(contentCellList, getMainContentStyle(cellStyleConfig));
refresh(highLightCellList, getHighLightStyle(cellStyleConfig)); refresh(highLightCellList, getHighLightStyle(cellStyleConfig));
refresh(highLightCellList, getHighLightStyle(cellStyleConfig));
refresh(assistCellList, getAssistMsgStyle(cellStyleConfig));
} }

13
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java

@ -27,6 +27,7 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
private final List<AbstractPreviewCell> titleCellList = new ArrayList<>(); private final List<AbstractPreviewCell> titleCellList = new ArrayList<>();
private final List<AbstractPreviewCell> contentCellList = new ArrayList<>(); private final List<AbstractPreviewCell> contentCellList = new ArrayList<>();
private final List<AbstractPreviewCell> highLightCellList = new ArrayList<>(); private final List<AbstractPreviewCell> highLightCellList = new ArrayList<>();
private final List<AbstractPreviewCell> assistCellList = new ArrayList<>();
private static final int CONTENT_ROW_COUNT = 3; private static final int CONTENT_ROW_COUNT = 3;
private static final int COL_COUNT = 5; private static final int COL_COUNT = 5;
@ -54,8 +55,10 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel northPane = createNorthPane(); JPanel northPane = createNorthPane();
JPanel centerPane = createCenterPane(); JPanel centerPane = createCenterPane();
JPanel southPane = createSouthPane();
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
this.add(southPane, BorderLayout.SOUTH);
} }
private JPanel createNorthPane() { private JPanel createNorthPane() {
@ -126,6 +129,15 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
return centerPane; return centerPane;
} }
private JPanel createSouthPane(){
JPanel southPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
PreviewCell assistCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Assist_Text"));
assistCell.setPreferredSize(new Dimension(123, 30));
assistCellList.add(assistCell);
southPane.add(assistCell, BorderLayout.CENTER);
return southPane;
}
@Override @Override
public void refresh(TemplateTheme theme) { public void refresh(TemplateTheme theme) {
ThemedCellStyleList cellStyleConfig = theme.getCellStyleList(); ThemedCellStyleList cellStyleConfig = theme.getCellStyleList();
@ -134,6 +146,7 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
refresh(contentCellList, getMainContentStyle(cellStyleConfig)); refresh(contentCellList, getMainContentStyle(cellStyleConfig));
refresh(titleCellList, getSmallTitleStyle(cellStyleConfig)); refresh(titleCellList, getSmallTitleStyle(cellStyleConfig));
refresh(highLightCellList, getHighLightStyle(cellStyleConfig)); refresh(highLightCellList, getHighLightStyle(cellStyleConfig));
refresh(assistCellList, getAssistMsgStyle(cellStyleConfig));
} }
} }
} }

4
designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AbstractTemplateStylePane.java

@ -7,4 +7,8 @@ public abstract class AbstractTemplateStylePane<T> extends BasicPane {
public abstract void populate(T ob); public abstract void populate(T ob);
public abstract T update(); public abstract T update();
public AbstractTemplateStylePane<T> generateCleanPane() {
return this;
}
} }

5
designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleTemplateStyleEditor.java

@ -32,6 +32,11 @@ public class AccessibleTemplateStyleEditor extends UneditableAccessibleEditor {
setValue(stylePane.update()); setValue(stylePane.update());
fireStateChanged(); fireStateChanged();
} }
@Override
public void doCancel() {
stylePane = stylePane.generateCleanPane();
}
}); });
stylePane.populate(getValue()); stylePane.populate(getValue());
dlg.setVisible(true); dlg.setVisible(true);

7
designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java

@ -44,12 +44,14 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane<MobileTem
private JPanel right; private JPanel right;
private CardLayout card; private CardLayout card;
private Set<Class<? extends MobileTemplateStyle>> extraStyle = new HashSet<>(); private Set<Class<? extends MobileTemplateStyle>> extraStyle = new HashSet<>();
private WCardTagLayout tagLayout;
public MobileTemplateStylePane(WCardTagLayout tagLayout){ public MobileTemplateStylePane(WCardTagLayout tagLayout){
init(tagLayout); init(tagLayout);
} }
public void init(WCardTagLayout tagLayout){ public void init(WCardTagLayout tagLayout){
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.tagLayout = tagLayout;
listModel = new DefaultListModel(); listModel = new DefaultListModel();
card = new CardLayout(); card = new CardLayout();
right = FRGUIPaneFactory.createCardLayout_S_Pane(); right = FRGUIPaneFactory.createCardLayout_S_Pane();
@ -147,4 +149,9 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane<MobileTem
list.addAll(sets); list.addAll(sets);
return Collections.unmodifiableList(list); return Collections.unmodifiableList(list);
} }
@Override
public AbstractTemplateStylePane<MobileTemplateStyle> generateCleanPane() {
return new MobileTemplateStylePane(this.tagLayout);
}
} }

5
designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java

@ -2,6 +2,7 @@ package com.fr.design.notification.ui;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.notification.Notification; import com.fr.design.notification.Notification;
import com.fr.design.notification.NotificationCenter; import com.fr.design.notification.NotificationCenter;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -119,7 +120,7 @@ public class NotificationCenterDialog extends JDialog {
if (winSize.width > screenSize.width) { if (winSize.width > screenSize.width) {
winSize.width = screenSize.width; winSize.width = screenSize.width;
} }
//这里设置位置:水平居中,竖直偏上 win.setLocation((DesignerContext.getDesignerFrame().getWidth() - winSize.width - 100 + DesignerContext.getDesignerFrame().getX()),
win.setLocation(screenSize.width - winSize.width - 90, 50); DesignerContext.getDesignerFrame().getY() + winSize.height);
} }
} }

61
designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java

@ -1,30 +1,33 @@
package com.fr.design.style; package com.fr.design.style;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundJComponent;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants;
import javax.swing.AbstractButton;
import javax.swing.JPanel;
import javax.swing.JWindow;
import javax.swing.border.AbstractBorder;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.plaf.ButtonUI;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Insets; import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints; import java.awt.RenderingHints;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import javax.swing.AbstractButton;
import javax.swing.JPanel;
import javax.swing.border.AbstractBorder;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.plaf.ButtonUI;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.design.style.background.BackgroundJComponent;
import com.fr.stable.Constants;
/** /**
* @author kunsnat E-mail:kunsnat@gmail.com * @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2011-10-31 下午03:28:31 类说明: 抽象出来的弹出box. 可以弹出颜色选择, 图案选择, 纹理选择. * @version 创建时间2011-10-31 下午03:28:31 类说明: 抽象出来的弹出box. 可以弹出颜色选择, 图案选择, 纹理选择.
@ -93,6 +96,34 @@ public abstract class AbstractSelectBox<T> extends AbstractPopBox implements Mou
hidePopupMenu(); hidePopupMenu();
} }
}); });
displayComponent.addMouseListener(new MouseAdapter() {
@Override
public void mouseExited(MouseEvent e) {
if (!isPopupVisible()) {
//如果弹出框==null 或者 弹出框不可见 直接return
return;
}
Point popMenuP = getControlWindow().getLocation();
Point displayComponentP = displayComponent.getLocationOnScreen();
if (popMenuP.getX() < displayComponentP.getX() - 1) {
//如果 弹出框横向超出屏幕 往左调整了 和displayComponent横向错开 就不处理了
return;
}
Rectangle rectangle = displayComponent.getBounds();
boolean bottomPopAndExitTop = displayComponentP.getY() < popMenuP.getY() && e.getY() <= rectangle.y;
boolean topPopAndExitBottom = displayComponentP.getY() > popMenuP.getY() && e.getY() >= rectangle.y + rectangle.getHeight();
boolean exitLeftOrRight = rectangle.x > e.getX() || rectangle.x + rectangle.getWidth() < e.getX();
if (bottomPopAndExitTop || topPopAndExitBottom || exitLeftOrRight) {
//弹出框在displayComponent下面 且 鼠标是从displayComponent上面离开的,隐藏弹出界面。
//弹出框在displayComponent上面 且 鼠标是从displayComponent下面离开的,隐藏弹出界面。
//鼠标从displayComponent左边 或者 右边 离开,隐藏弹出界面。
hidePopupMenu();
}
}
});
} }
public void setEnabled(boolean enabled) { public void setEnabled(boolean enabled) {

16
designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java

@ -64,6 +64,11 @@ public class VersionCheckUtils {
private static final String ID = "id"; private static final String ID = "id";
private static final String VERSION = "version"; private static final String VERSION = "version";
private static final String NAME = "name"; private static final String NAME = "name";
private static final String RUNNING = "running";
private static final String SYNC = "sync";
private static final String GROUP = "group";
private static final String BI = "bi";
private static final String BIPREFIX = "com.finebi";
private static final Set<String> pluginsNeedIgnore = new HashSet<>(); private static final Set<String> pluginsNeedIgnore = new HashSet<>();
static { static {
pluginsNeedIgnore.addAll(Arrays.asList( pluginsNeedIgnore.addAll(Arrays.asList(
@ -263,13 +268,10 @@ public class VersionCheckUtils {
Map<String, String> pluginsNameMap = ReportHelper.getPluginNameMap(); Map<String, String> pluginsNameMap = ReportHelper.getPluginNameMap();
for (int i = 0; i < remotePlugins.size(); i++) { for (int i = 0; i < remotePlugins.size(); i++) {
remotePlugin = remotePlugins.getJSONObject(i); remotePlugin = remotePlugins.getJSONObject(i);
if (ComparatorUtils.equals(remotePlugin.getString("running"), "false") || (remotePlugin.containsKey("sync") && !remotePlugin.getBoolean("sync"))) { if (isPluginNeedIgnore(remotePlugin)) {
continue; continue;
} }
String remotePluginID = remotePlugin.getString(ID); String remotePluginID = remotePlugin.getString(ID);
if (pluginsNeedIgnore.contains(remotePluginID)) {
continue;
}
if (localPluginsMap.containsKey(remotePluginID)) { if (localPluginsMap.containsKey(remotePluginID)) {
if (ComparatorUtils.equals(localPluginsMap.get(remotePluginID).getVersion(), remotePlugin.getString(VERSION))) { if (ComparatorUtils.equals(localPluginsMap.get(remotePluginID).getVersion(), remotePlugin.getString(VERSION))) {
continue; continue;
@ -290,6 +292,12 @@ public class VersionCheckUtils {
return differentPlugins; return differentPlugins;
} }
private static boolean isPluginNeedIgnore(JSONObject remotePlugin) {
return ComparatorUtils.equals(remotePlugin.getString(RUNNING), "false") || (remotePlugin.containsKey(SYNC) && !remotePlugin.getBoolean(SYNC))
|| (remotePlugin.containsKey(GROUP) && ComparatorUtils.equals(remotePlugin.containsKey(GROUP), BI) || remotePlugin.getString(ID).startsWith(BIPREFIX)
|| pluginsNeedIgnore.contains(remotePlugin.getString(ID)));
}
public static JSONArray syncPlugins(JSONArray differentPlugins) { public static JSONArray syncPlugins(JSONArray differentPlugins) {
Set<String> uninstallFailed = uninstallPlugins(differentPlugins); Set<String> uninstallFailed = uninstallPlugins(differentPlugins);
List<PluginMarker> plugins = getSyncPlugins(differentPlugins, uninstallFailed); List<PluginMarker> plugins = getSyncPlugins(differentPlugins, uninstallFailed);

22
designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java

@ -1,6 +1,10 @@
package com.fr.design.widget.component; package com.fr.design.widget.component;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.ErrorMsgTextFieldAdapter;
import com.fr.design.beans.UITextFieldAdapter;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.fun.TextFieldAdapterProvider;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
@ -9,6 +13,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.NumberEditor; import com.fr.form.ui.NumberEditor;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.AssistUtils; import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -35,7 +40,7 @@ public class NumberEditorValidatePane extends JPanel {
private UISpinner minValueSpinner; private UISpinner minValueSpinner;
private UISpinner decimalLength; private UISpinner decimalLength;
private JPanel limitNumberPane; private JPanel limitNumberPane;
private UITextField errorMsgTextField; private ErrorMsgTextFieldAdapter errorMsgTextField;
private JPanel errorMsgTextFieldPane; private JPanel errorMsgTextFieldPane;
private ActionListener allowDecimalsListener; private ActionListener allowDecimalsListener;
@ -100,9 +105,20 @@ public class NumberEditorValidatePane extends JPanel {
} }
private void initErrorMsgPane() { private void initErrorMsgPane() {
errorMsgTextField = new UITextField(); TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG);
if (provider != null) {
try {
errorMsgTextField = provider.createTextFieldAdapter();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
errorMsgTextField = new UITextFieldAdapter();
}
} else {
errorMsgTextField = new UITextFieldAdapter();
}
errorMsgTextFieldPane = TableLayoutHelper.createGapTableLayoutPane( errorMsgTextFieldPane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip")), errorMsgTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1); new Component[][]{new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip")), errorMsgTextField.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
} }

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -1,6 +1,6 @@
com.fr.design.mainframe.check.CheckButton=305*118 com.fr.design.mainframe.check.CheckButton=305*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=630*185 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=630*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=630*31 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=570*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=630*280 com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=630*280
com.fr.design.report.ReportColumnsPane=800*600 com.fr.design.report.ReportColumnsPane=800*600
com.fr.env.RemoteEnvPane.dialog=458*132 com.fr.env.RemoteEnvPane.dialog=458*132

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

@ -1,6 +1,6 @@
com.fr.design.mainframe.check.CheckButton=280*118 com.fr.design.mainframe.check.CheckButton=280*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=610*185 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=610*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=610*31 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=550*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=610*280 com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=610*280
com.fr.env.RemoteEnvPane.dialog=458*132 com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=430*95 com.fr.design.version.check.dialog=430*95

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

@ -1,7 +1,7 @@
com.fr.design.mainframe.check.CheckButton=230*118 com.fr.design.mainframe.check.CheckButton=230*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=490*185 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=550*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=490*35 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=490*35
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=490*280 com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=550*280
com.fr.env.RemoteEnvPane.dialog=458*132 com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=450*95 com.fr.design.version.check.dialog=450*95
com.fr.design.version.detail.label=700*30 com.fr.design.version.detail.label=700*30

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -1,7 +1,7 @@
# \u9ED8\u8BA4\u4E3A\u7C7B\u7684\u5168\u9650\u5B9A\u540D\uFF08\u53EF\u81EA\u5B9A\u4E49key\uFF09= width * height # \u9ED8\u8BA4\u4E3A\u7C7B\u7684\u5168\u9650\u5B9A\u540D\uFF08\u53EF\u81EA\u5B9A\u4E49key\uFF09= width * height
com.fr.design.mainframe.check.CheckButton=250*118 com.fr.design.mainframe.check.CheckButton=250*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=385*31 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=325*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280 com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280
com.fr.env.RemoteEnvPane.dialog=308*132 com.fr.env.RemoteEnvPane.dialog=308*132
com.fr.design.version.check.dialog=230*95 com.fr.design.version.check.dialog=230*95

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -1,6 +1,6 @@
com.fr.design.mainframe.check.CheckButton=250*118 com.fr.design.mainframe.check.CheckButton=250*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=385*31 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=325*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280 com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280
com.fr.env.RemoteEnvPane.dialog=308*132 com.fr.env.RemoteEnvPane.dialog=308*132
com.fr.design.version.check.dialog=230*95 com.fr.design.version.check.dialog=230*95

9
designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java

@ -16,7 +16,6 @@ import com.fr.design.gui.chart.ChartEditPaneProvider;
import com.fr.design.gui.frpane.UITitlePanel; import com.fr.design.gui.frpane.UITitlePanel;
import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.AssistUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
@ -36,9 +35,6 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
protected ChartEditPane chartEditPane; protected ChartEditPane chartEditPane;
//ID一样的话 不用新建chartEditPane
private String currentID;
private ChartPropertyPane() { private ChartPropertyPane() {
initComponent(); initComponent();
} }
@ -50,14 +46,9 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
@Override @Override
public void updateChartEditPane(String plotID) { public void updateChartEditPane(String plotID) {
if (!AssistUtils.equals(currentID, plotID)) {
chartEditPane = ChartTypeInterfaceManager.getInstance().getChartEditPane(plotID); chartEditPane = ChartTypeInterfaceManager.getInstance().getChartEditPane(plotID);
chartEditPane.setContainer(container); chartEditPane.setContainer(container);
currentID = plotID;
resetChartEditPane(); resetChartEditPane();
} else {
chartEditPane.resetLastChartCollection();
}
} }
@Override @Override

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java

@ -22,9 +22,11 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.ChartTypePane; import com.fr.design.mainframe.chart.gui.ChartTypePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.form.main.Form; import com.fr.form.main.Form;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -334,7 +336,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare
String chartID = chart.getID(); String chartID = chart.getID();
boolean currentPane = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartID); boolean currentPane = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartID);
return (currentPane != isDefaultPane) || (!currentPane && lastIndex != currentIndex); boolean duchampCustomChart = ChartEditContext.duchampMode()
&& VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID.equals(chartID);
return (currentPane != isDefaultPane) || (!currentPane && lastIndex != currentIndex) || duchampCustomChart;
} }
return false; return false;
} }

91
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java

@ -0,0 +1,91 @@
package com.fr.van.chart.config;
import com.fr.base.ChartPreStyleConfig;
import com.fr.chart.base.ChartBaseUtils;
import com.fr.chart.base.ChartConstants;
import com.fr.general.Background;
import com.fr.general.FRFont;
import com.fr.general.GeneralUtils;
import com.fr.stable.CodeUtils;
import com.fr.stable.Constants;
import java.awt.Color;
import java.awt.Font;
/**
* @author shine
* @version 10.0
* Created by shine on 2021/6/25
*/
public class DefaultStyleConstants {
static final FRFont TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.BOLD, 14, new Color(241, 246, 255));
static final FRFont LEGEND = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191));
static final FRFont AXIS_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191));
static final FRFont AXIS_TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(200, 211, 228));
static final Color AXIS_LINE = new Color(46, 75, 102);
static final Color GRID_LINE = new Color(30, 55, 78);
static final FRFont ALERT_FONT = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(255, 0, 0));
static final FRFont DATA_SHEET = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191));
static final Color DATA_SHEET_BORDER = new Color(46, 75, 102);
static final Color BORDER = Color.BLACK;
static final int BORDER_WIDTH = Constants.LINE_NONE;
static final int SPECIAL_BORDER_WIDTH = Constants.LINE_THIN;
static final FRFont PIE_CATEGORY_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 10, new Color(232, 232, 232));
static final Color GAUGE_PANE_BACK_COLOR = null;
static final Color GAUGE_HINGE = null;
static final Color GAUGE_PANE_BACK_COLOR_4_RING = new Color(72, 73, 79);
static final Color GAUGE_SLOT_BACKGROUND_COLOR = new Color(72, 73, 79);
private static final String FONT_NAME = ChartBaseUtils.getLocalDefaultFont("verdana");
static final FRFont THERMOMETER_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.BOLD, 9, new Color(232, 232, 232));//试管仪表盘标签的默认样式
static final FRFont THERMOMETER_AXIS_LABEL = FRFont.getInstance(FONT_NAME, Font.PLAIN, 8, new Color(159, 173, 191));
static final FRFont RING_VALUE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, ChartConstants.AUTO_FONT_SIZE, new Color(232, 232, 232));//百分比圆环仪表盘值标签的默认样式
static final FRFont POINTER_VALUE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, ChartConstants.AUTO_FONT_SIZE, new Color(232, 232, 232));//多指针仪表盘值标签的默认样式
static final FRFont POINTER_CATE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, 10, new Color(232, 232, 232));//多指针仪表盘分类标签的默认样式
static final Color MAP_NULL_VALUE_COLOR = new Color(168, 168, 168);
static final Color MAP_BORDER = Color.BLACK;
static final Color MAP_LEGEND_BACK = Color.BLACK;
static final Color MAP_TITLE_BACK = Color.BLACK;
static final Color DRILL_MAP_DRILL_TOOLS_BACK = Color.BLACK;
static final float DRILL_MAP_DRILL_TOOLS_BACK_OPACITY = 0.8f;
//todo vancharts
private static final Color GANTT_OUT_LINE = GRID_LINE;
private static final FRFont GANTT_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 8, new Color(217, 217, 217));
private static final Color GANTT_BORDER_LINE = new Color(30, 36, 58);
private static final Color GAUGE_TICK = new Color(39, 49, 71);
static final Background BACK = null;
static String COLORS = null;
static {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
try {
DefaultStyleConstants.COLORS = CodeUtils.cjkDecode("\u7ecf\u5178\u9ad8\u4eae");
// 没有经典高亮, 用新特性
if (config.getPreStyle(DefaultStyleConstants.COLORS) == null) {
DefaultStyleConstants.COLORS = CodeUtils.cjkDecode("\u65b0\u7279\u6027");
}
// 没有新特性, 用第一个配色
if (config.getPreStyle(DefaultStyleConstants.COLORS) == null) {
if (config.names().hasNext()) {
String name = GeneralUtils.objectToString(config.names().next());
if (config.getPreStyle(name) != null) {
DefaultStyleConstants.COLORS = name;
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

186
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java

@ -0,0 +1,186 @@
package com.fr.van.chart.config;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.DataSheet;
import com.fr.config.predefined.ColorFillStyle;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.AttrLabelDetail;
import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.type.GaugeStyle;
/**
* @author shine
* @version 10.0
* Created by shine on 2021/10/22
* vanchart的抽出来因为主体代码 新增y轴 组合图新增图表都要用
*/
public class DefaultStyleHelper4Van {
public static void dealVanPlot4Custom(VanChartPlot plot, CustomPlotType customPlotType) {
if (!ChartEditContext.duchampMode()) {
return;
}
dealVanPlotCommonAttr(plot);
switch (customPlotType) {
case PIE:
case DIFFERENT_PIE:
case SAME_PIE:
dealPie(plot);
break;
case SLOT:
case POINTER_360:
case POINTER_180:
case CUVETTE:
case RING:
dealGauge(plot);
break;
case COLUMN:
case LINE:
case AREA:
case BUBBLE:
case RADAR:
case STACK_RADAR:
case SCATTER:
default:
break;
}
}
public static VanChartAxis dealAxisDefault(VanChartAxis axis) {
if (!ChartEditContext.duchampMode()) {
return axis;
}
axis.getTitle().getTextAttr().setFRFont(DefaultStyleConstants.AXIS_TITLE);
axis.getTextAttr().setFRFont(DefaultStyleConstants.AXIS_LABEL);
axis.setAxisColor(DefaultStyleConstants.AXIS_LINE);
axis.setMainGridColor(DefaultStyleConstants.GRID_LINE);
return axis;
}
public static void dealAxisAlert(VanChartAlertValue vanChartAlertValue) {
if (!ChartEditContext.duchampMode()) {
return;
}
vanChartAlertValue.setAlertFont(DefaultStyleConstants.ALERT_FONT);
}
static void dealVanPlotCommonAttr(Plot plot) {
if (!ChartEditContext.duchampMode()) {
return;
}
if (plot instanceof VanChartPlot) {
VanChartPlot vanChartPlot = (VanChartPlot) plot;
ColorFillStyle colorFillStyle = new ColorFillStyle();
colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC);
colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS);
AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle();
if (plotFillStyle == null) {
plotFillStyle = new AttrFillStyle();
vanChartPlot.setPlotFillStyle(plotFillStyle);
}
plotFillStyle.setColorFillStyle(colorFillStyle);
if (vanChartPlot.getLegend() != null) {
vanChartPlot.getLegend().setFRFont(DefaultStyleConstants.LEGEND);
}
if (vanChartPlot instanceof VanChartRectanglePlot) {
VanChartRectanglePlot vanChartRectanglePlot = (VanChartRectanglePlot) vanChartPlot;
for (VanChartAxis axis : vanChartRectanglePlot.getXAxisList()) {
dealAxisDefault(axis);
}
for (VanChartAxis axis : vanChartRectanglePlot.getYAxisList()) {
dealAxisDefault(axis);
}
}
dealBorder(vanChartPlot);
DataSheet dataSheet = vanChartPlot.getDataSheet();
dataSheet.getTextAttr().setFRFont(DefaultStyleConstants.DATA_SHEET);
dataSheet.setBorderColor(DefaultStyleConstants.DATA_SHEET_BORDER);
}
}
private static void dealBorder(VanChartPlot vanChartPlot) {
ConditionAttr defaultAttr = vanChartPlot.getConditionCollection().getDefaultAttr();
AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class);
if (attrBorder != null) {
attrBorder.setBorderColor(DefaultStyleConstants.BORDER);
attrBorder.setBorderStyle(defaultBorderWidth(vanChartPlot));
}
}
private static int defaultBorderWidth(VanChartPlot vanChartPlot) {
//pie multipie treemap map drillmap heatmap
if (vanChartPlot instanceof PiePlot4VanChart
|| vanChartPlot instanceof VanChartMapPlot) {
return DefaultStyleConstants.SPECIAL_BORDER_WIDTH;
}
return DefaultStyleConstants.BORDER_WIDTH;
}
static void dealPie(Plot plot) {
if (plot instanceof PiePlot4VanChart) {
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
AttrLabel attrLabel = defaultAttr.getExisted(AttrLabel.class);
if (attrLabel == null) {
attrLabel = ((PiePlot4VanChart) plot).getDefaultAttrLabel();
defaultAttr.addDataSeriesCondition(attrLabel);
}
attrLabel.getSecondLabelDetail().getTextAttr().setFRFont(DefaultStyleConstants.PIE_CATEGORY_LABEL);
}
}
static void dealGauge(Plot param) {
if (!(param instanceof VanChartGaugePlot)) {
return;
}
VanChartGaugePlot plot = (VanChartGaugePlot) param;
plot.getGaugeDetailStyle().setPaneBackgroundColor(plot.getGaugeStyle() == GaugeStyle.RING ? DefaultStyleConstants.GAUGE_PANE_BACK_COLOR_4_RING : DefaultStyleConstants.GAUGE_PANE_BACK_COLOR);
plot.getGaugeDetailStyle().setSlotBackgroundColor(DefaultStyleConstants.GAUGE_SLOT_BACKGROUND_COLOR);
plot.getGaugeDetailStyle().setHingeColor(DefaultStyleConstants.GAUGE_HINGE);
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
AttrLabel attrLabel = defaultAttr.getExisted(AttrLabel.class);
if (attrLabel != null) {
AttrLabelDetail detail = attrLabel.getAttrLabelDetail();
AttrLabelDetail valueDetail = attrLabel.getGaugeValueLabelDetail();
switch (plot.getGaugeStyle()) {
case POINTER:
case POINTER_SEMI:
detail.getContent().getCategoryFormat().setEnable(false);
detail.getTextAttr().setFRFont(DefaultStyleConstants.POINTER_CATE_LABEL_FONT);
valueDetail.getTextAttr().setFRFont(DefaultStyleConstants.POINTER_VALUE_LABEL_FONT);
break;
case RING:
case SLOT:
valueDetail.getTextAttr().setFRFont(DefaultStyleConstants.RING_VALUE_LABEL_FONT);
break;
case THERMOMETER:
detail.getTextAttr().setFRFont(DefaultStyleConstants.THERMOMETER_LABEL_FONT);
valueDetail.getTextAttr().setFRFont(DefaultStyleConstants.THERMOMETER_LABEL_FONT);
plot.getGaugeAxis().getTextAttr().setFRFont(DefaultStyleConstants.THERMOMETER_AXIS_LABEL);
break;
}
}
}
}

3
designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java

@ -6,13 +6,13 @@ import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.custom.type.CustomPlotType; import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.plugin.chart.custom.type.CustomStyle; import com.fr.plugin.chart.custom.type.CustomStyle;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.custom.CustomPlotDesignerPaneFactory; import com.fr.van.chart.custom.CustomPlotDesignerPaneFactory;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
@ -260,6 +260,7 @@ public class VanChartCustomPlotSelectPane extends BasicBeanPane<Chart> {
CustomPlotType customPlotType = selectedPlotTypeList.get(i); CustomPlotType customPlotType = selectedPlotTypeList.get(i);
if (!CustomPlotFactory.customPlotContains(newCustomPlotList, customPlotType)){ if (!CustomPlotFactory.customPlotContains(newCustomPlotList, customPlotType)){
VanChartPlot vanChartPlot = CustomPlotFactory.getCustomPlot(customPlotType); VanChartPlot vanChartPlot = CustomPlotFactory.getCustomPlot(customPlotType);
DefaultStyleHelper4Van.dealVanPlot4Custom(vanChartPlot, customPlotType);
vanChartPlot.setCustomType(CustomStyle.CUSTOM.toString()); vanChartPlot.setCustomType(CustomStyle.CUSTOM.toString());
//设置公共属性 //设置公共属性
setCommonAttr(vanChartPlot, customPlot); setCommonAttr(vanChartPlot, customPlot);

7
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java

@ -5,6 +5,7 @@ import com.fr.design.constants.KeyWords;
import com.fr.design.gui.autocomplete.AutoCompletion; import com.fr.design.gui.autocomplete.AutoCompletion;
import com.fr.design.gui.autocomplete.BasicCompletion; import com.fr.design.gui.autocomplete.BasicCompletion;
import com.fr.design.gui.autocomplete.DefaultCompletionProvider; import com.fr.design.gui.autocomplete.DefaultCompletionProvider;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
@ -45,7 +46,7 @@ public class VanChartHtmlLabelPane extends JPanel {
private UICheckBox isCustomHeight; private UICheckBox isCustomHeight;
private UITextField customHeight; private UITextField customHeight;
private VanChartStylePane parent; private AbstractAttrNoScrollPane parent;
private JPanel widthAndHeightPane; private JPanel widthAndHeightPane;
@ -53,7 +54,7 @@ public class VanChartHtmlLabelPane extends JPanel {
contentTextArea.setText(text); contentTextArea.setText(text);
} }
public void setParent(VanChartStylePane parent) { public void setParent(AbstractAttrNoScrollPane parent) {
this.parent = parent; this.parent = parent;
} }
@ -126,7 +127,7 @@ public class VanChartHtmlLabelPane extends JPanel {
}; };
} }
private void fireJSChange() { protected void fireJSChange() {
if (parent != null) { if (parent != null) {
parent.attributeChanged(); parent.attributeChanged();
} }

7
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java

@ -14,16 +14,17 @@ import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.AttrSeriesStackAndAxis; import com.fr.plugin.chart.base.AttrSeriesStackAndAxis;
import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.axis.component.VanChartAxisButtonPane; import com.fr.van.chart.designer.style.axis.component.VanChartAxisButtonPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.awt.BorderLayout;
import java.awt.CardLayout;
/** /**
* 样式-坐标轴界面 * 样式-坐标轴界面
@ -104,6 +105,7 @@ public class VanChartAxisPane extends BasicBeanPane<VanChart> {
List<VanChartAxis> xAxisList = editingPlot.getXAxisList(); List<VanChartAxis> xAxisList = editingPlot.getXAxisList();
VanChartAxis axis = editingPlot.createXAxis(name, VanChartConstants.AXIS_BOTTOM); VanChartAxis axis = editingPlot.createXAxis(name, VanChartConstants.AXIS_BOTTOM);
xAxisList.add(axis); xAxisList.add(axis);
DefaultStyleHelper4Van.dealAxisDefault(axis);
VanChartXYAxisPaneInterface axisPane = initXAxisPane(axis); VanChartXYAxisPaneInterface axisPane = initXAxisPane(axis);
axisPane.populate(axis); axisPane.populate(axis);
@ -119,6 +121,7 @@ public class VanChartAxisPane extends BasicBeanPane<VanChart> {
List<VanChartAxis> yAxisList = editingPlot.getYAxisList(); List<VanChartAxis> yAxisList = editingPlot.getYAxisList();
VanChartAxis axis = editingPlot.createYAxis(name, VanChartConstants.AXIS_LEFT); VanChartAxis axis = editingPlot.createYAxis(name, VanChartConstants.AXIS_LEFT);
yAxisList.add(axis); yAxisList.add(axis);
DefaultStyleHelper4Van.dealAxisDefault(axis);
VanChartXYAxisPaneInterface axisPane = initYAxisPane(axis); VanChartXYAxisPaneInterface axisPane = initYAxisPane(axis);
axisPane.populate(axis); axisPane.populate(axis);

7
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java

@ -11,6 +11,7 @@ import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartTimeAxis; import com.fr.plugin.chart.attr.axis.VanChartTimeAxis;
import com.fr.plugin.chart.attr.axis.VanChartValueAxis; import com.fr.plugin.chart.attr.axis.VanChartValueAxis;
import com.fr.plugin.chart.type.AxisType; import com.fr.plugin.chart.type.AxisType;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
@ -84,9 +85,9 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
public void populate(VanChartAxis axis){ public void populate(VanChartAxis axis){
AxisType axisType = axis.getAxisType(); AxisType axisType = axis.getAxisType();
textAxisPane.populateBean(new VanChartAxis(axis.getAxisName(), axis.getPosition())); textAxisPane.populateBean(DefaultStyleHelper4Van.dealAxisDefault(new VanChartAxis(axis.getAxisName(), axis.getPosition())));
timeAxisPane.populateBean(new VanChartTimeAxis(axis.getAxisName(), axis.getPosition())); timeAxisPane.populateBean(DefaultStyleHelper4Van.dealAxisDefault(new VanChartTimeAxis(axis.getAxisName(), axis.getPosition())));
valueAxisPane.populateBean(new VanChartValueAxis(axis.getAxisName(), axis.getPosition())); valueAxisPane.populateBean(DefaultStyleHelper4Van.dealAxisDefault(new VanChartValueAxis(axis.getAxisName(), axis.getPosition())));
if(ComparatorUtils.equals(axisType, AxisType.AXIS_CATEGORY)){ if(ComparatorUtils.equals(axisType, AxisType.AXIS_CATEGORY)){
textAxisPane.populateBean(axis); textAxisPane.populateBean(axis);
} else if(ComparatorUtils.equals(axisType, AxisType.AXIS_TIME)){ } else if(ComparatorUtils.equals(axisType, AxisType.AXIS_TIME)){

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java

@ -3,10 +3,11 @@ package com.fr.van.chart.designer.style.background;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper; import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.log.FineLoggerFactory;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue; import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
@ -37,6 +38,7 @@ public class ChartNameObjectCreator extends NameObjectCreator {
VanChartAlertValue vanChartAlertValue = constructor.newInstance(); VanChartAlertValue vanChartAlertValue = constructor.newInstance();
vanChartAlertValue.setAxisNamesArray((String[]) object); vanChartAlertValue.setAxisNamesArray((String[]) object);
vanChartAlertValue.setAxisName(((String[]) object)[0]); vanChartAlertValue.setAxisName(((String[]) object)[0]);
DefaultStyleHelper4Van.dealAxisAlert(vanChartAlertValue);
return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue); return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue);
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {

3
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -159,6 +159,9 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
// ((VanChart) chart4Update).setAutoThemeCustom(); // ((VanChart) chart4Update).setAutoThemeCustom();
} }
} }
if (!ChartEditContext.supportTheme()) {
chart.setAutoThemeCustom();
}
if (!acceptDefinition(chart.getChartDataDefinition(), newPlot)) { if (!acceptDefinition(chart.getChartDataDefinition(), newPlot)) {
chart.setChartDataDefinition(null); chart.setChartDataDefinition(null);
} }

2
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

@ -85,7 +85,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
private JPanel createGISLayerPane() { private JPanel createGISLayerPane() {
gisButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"), gisButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"),
Toolkit.i18nText("Fine-Design_Form_Widget_Style_Standard"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); Toolkit.i18nText("Fine-Design_Form_Widget_Style_Standard"), Toolkit.i18nText("Fine-Design_Chart_Custom")});
gisButton.setSelectedIndex(0); gisButton.setSelectedIndex(ChartEditContext.supportTheme() ? 0 : 1);
gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems()); gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems());
gisButton.addActionListener(event -> { gisButton.addActionListener(event -> {
refreshZoomLevel(); refreshZoomLevel();

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

@ -13,6 +13,7 @@ import com.fr.design.designer.creator.operate.XCreatorBaseOperate;
import com.fr.design.designer.creator.operate.DefaultXCreatorBaseOperate; import com.fr.design.designer.creator.operate.DefaultXCreatorBaseOperate;
import com.fr.design.designer.treeview.DefaultXCreatorTreeCellRender; import com.fr.design.designer.treeview.DefaultXCreatorTreeCellRender;
import com.fr.design.designer.treeview.XCreatorTreeCellRender; import com.fr.design.designer.treeview.XCreatorTreeCellRender;
import com.fr.design.designer.ui.PopupDialogContext;
import com.fr.design.designer.ui.SelectedPopupDialog; import com.fr.design.designer.ui.SelectedPopupDialog;
import com.fr.design.fun.ShareWidgetUIProcessor; import com.fr.design.fun.ShareWidgetUIProcessor;
import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.WidgetPropertyUIProvider;
@ -796,6 +797,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
if (popup == null) { if (popup == null) {
popup = new SelectedPopupDialog(this, designer); popup = new SelectedPopupDialog(this, designer);
} }
PopupDialogContext.checkSelectedPop(this);
JFrame frame = LogMessageBar.getInstance().getLogFrame(); JFrame frame = LogMessageBar.getInstance().getLogFrame();
if (frame!= null && frame.isActive()) { if (frame!= null && frame.isActive()) {
return; return;
@ -894,6 +896,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
if (popup != null) { if (popup != null) {
popup.setVisible(false); popup.setVisible(false);
} }
PopupDialogContext.checkSelectedPop(this);
} }
public void processPopup(boolean canVisible) { public void processPopup(boolean canVisible) {

47
designer-form/src/main/java/com/fr/design/designer/ui/PopupDialogContext.java

@ -0,0 +1,47 @@
package com.fr.design.designer.ui;
import com.fr.design.designer.creator.XCreator;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* 把弹窗统一管理起来 防止出现异常情况下游离的弹窗
*
* @author hades
* @version 10.0
* Created by hades on 2021/11/02
*/
public class PopupDialogContext {
private static List<SelectedPopupDialog> dialogs = new ArrayList<>();
public static void add(SelectedPopupDialog selectedPopupDialog) {
if (dialogs.contains(selectedPopupDialog)) {
return;
}
dialogs.add(selectedPopupDialog);
}
public static void remove(SelectedPopupDialog selectedPopupDialog) {
dialogs.remove(selectedPopupDialog);
}
public static void checkSelectedPop(XCreator creator) {
Iterator<SelectedPopupDialog> iterator = dialogs.iterator();
List<SelectedPopupDialog> removedDialog = new ArrayList<>();
while (iterator.hasNext()) {
SelectedPopupDialog dialog = iterator.next();
if (dialog.isVisible() && creator != dialog.getCreator()) {
iterator.remove();
removedDialog.add(dialog);
}
}
for (SelectedPopupDialog dialog : removedDialog) {
dialog.setVisible(false);
}
}
}

17
designer-form/src/main/java/com/fr/design/designer/ui/SelectedPopupDialog.java

@ -25,11 +25,14 @@ public class SelectedPopupDialog extends JDialog {
private boolean canVisible = true; private boolean canVisible = true;
private final XCreator creator;
public SelectedPopupDialog(XCreator creator, FormDesigner designer) { public SelectedPopupDialog(XCreator creator, FormDesigner designer) {
super(OperatingSystem.isMacos() ? new JFrame() : DesignerContext.getDesignerFrame()); super(OperatingSystem.isMacos() ? new JFrame() : DesignerContext.getDesignerFrame());
this.setUndecorated(true); this.setUndecorated(true);
this.setModal(false); this.setModal(false);
this.setFocusableWindowState(false); this.setFocusableWindowState(false);
this.creator = creator;
controlPanel = new PopupControlPanel(creator, designer); controlPanel = new PopupControlPanel(creator, designer);
this.getContentPane().add(controlPanel); this.getContentPane().add(controlPanel);
this.setSize(controlPanel.getDefaultDimension()); this.setSize(controlPanel.getDefaultDimension());
@ -44,6 +47,16 @@ public class SelectedPopupDialog extends JDialog {
return controlPanel.hasVisibleButtons(); return controlPanel.hasVisibleButtons();
} }
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible) {
PopupDialogContext.add(this);
} else {
PopupDialogContext.remove(this);
}
}
public void setRelativeBounds(Rectangle rectangle) { public void setRelativeBounds(Rectangle rectangle) {
this.controlPanel.setRelativeBounds(rectangle); this.controlPanel.setRelativeBounds(rectangle);
} }
@ -55,4 +68,8 @@ public class SelectedPopupDialog extends JDialog {
public void setCanVisible(boolean canVisible) { public void setCanVisible(boolean canVisible) {
this.canVisible = canVisible; this.canVisible = canVisible;
} }
public XCreator getCreator() {
return this.creator;
}
} }

3
designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -97,7 +97,8 @@ public class FormWidgetDetailPane extends FormDockView{
} }
headGroup = new UIHeadGroup(paneNames) { headGroup = new UIHeadGroup(paneNames) {
protected void tabChanged(int newSelectedIndex) { protected void tabChanged(int newSelectedIndex) {
if (newSelectedIndex == 1) { //初始化还未展示的时候不需要收集其 marketClick
if (this.isShowing() && newSelectedIndex == 1) {
ComponentCollector.getInstance().collectMarkerClick(); ComponentCollector.getInstance().collectMarkerClick();
} }
cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle()); cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle());

2
designer-realize/src/main/java/com/fr/design/actions/server/ServerConfigManagerAction.java

@ -27,7 +27,7 @@ import java.awt.event.WindowEvent;
* Server Config Manager * Server Config Manager
*/ */
public class ServerConfigManagerAction extends UpdateAction { public class ServerConfigManagerAction extends UpdateAction {
public static final Dimension DEFAULT = new Dimension(700, 630); public static final Dimension DEFAULT = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.actions.server.dialog");
public ServerConfigManagerAction() { public ServerConfigManagerAction() {
this.setMenuKeySet(SERVER_CONFIG_MANAGER); this.setMenuKeySet(SERVER_CONFIG_MANAGER);

3
designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java

@ -105,8 +105,7 @@ class CptApp extends AbstractWorkBookApp {
final JDialog jd = new JDialog(); final JDialog jd = new JDialog();
// 模态一下,因为可能会多个样式丢失 // 模态一下,因为可能会多个样式丢失
// jd.setModal(true); jd.setModal(true);
jd.setAlwaysOnTop(true);
jd.setSize(450, 150); jd.setSize(450, 150);
jd.setResizable(false); jd.setResizable(false);
jd.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); jd.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png"));

1
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -115,6 +115,7 @@ public class DesignerSocketIO {
private static IO.Options createOptions() { private static IO.Options createOptions() {
IO.Options options = new IO.Options(); IO.Options options = new IO.Options();
options.path = WebSocketConfig.getInstance().getSocketContext();
try { try {
if (ComparatorUtils.equals(currentProtocol, HTTPS)) { if (ComparatorUtils.equals(currentProtocol, HTTPS)) {
options.sslContext = getSSLContext(); options.sslContext = getSSLContext();

9
designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -431,7 +431,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
if (oriCellSelection != null && isSameStartPoint(cellselection, oriCellSelection)) { if (oriCellSelection != null && isSameStartPoint(cellselection, oriCellSelection)) {
dealDragSelection(add, cellselection, newValue); dealDragSelection(add, cellselection, newValue);
} else if (cellselection.getSelectedType() == CellSelection.CHOOSE_ROW || cellselection.getSelectedType() == CellSelection.CHOOSE_COLUMN) { } else if (cellselection.getSelectedType() == CellSelection.CHOOSE_ROW || cellselection.getSelectedType() == CellSelection.CHOOSE_COLUMN) {
dealSelectColRow(add, cellselection); dealSelectColRow(add, cellselection, newValue);
} else { } else {
ColumnRow columnRow = ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow()); ColumnRow columnRow = ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow());
String allColumnRow = newValue.toString(); String allColumnRow = newValue.toString();
@ -503,12 +503,15 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
return cs1.getColumn() == cs2.getColumn() && cs1.getRow() == cs2.getRow(); return cs1.getColumn() == cs2.getColumn() && cs1.getRow() == cs2.getRow();
} }
private void dealSelectColRow(ColumnRowGroup add, CellSelection se) { private void dealSelectColRow(ColumnRowGroup add, CellSelection se, ColumnRowGroup newValue) {
int c = se.getColumn(), cs = se.getColumnSpan(), int c = se.getColumn(), cs = se.getColumnSpan(),
r = se.getRow(), rs = se.getRowSpan(); r = se.getRow(), rs = se.getRowSpan();
for (int i = 0; i < cs; i++) { for (int i = 0; i < cs; i++) {
for (int j = 0; j < rs; j++) { for (int j = 0; j < rs; j++) {
add.addColumnRow(ColumnRow.valueOf(c + i, r + j)); ColumnRow columnRow = ColumnRow.valueOf(c + i, r + j);
if (!newValue.contains(columnRow)) {
add.addColumnRow(columnRow);
}
} }
} }
} }

Loading…
Cancel
Save