Browse Source

Merge pull request #14777 in DESIGN/design from fbp/release to fbp/feature

* commit '249f552c4b3eff636e841b9d8da918025efe1417':
  REPORT-133888 - 【fr-fbp回归】文件数据集excel只能被选一次
  REPORT-133863 【fr-fbp回归】数据字典获取数据库字段空白
  REPORT-133186 【fr-fbp回归】【数据集】fbp设计器远程设计,新建mysql数据连接,开启SSL通道后读不到CA证书
  REPORT-133186 【fr-fbp回归】【数据集】fbp设计器远程设计,新建mysql数据连接,开启SSL通道后读不到CA证书
  REPORT-133110 【fr-fbp回归】【FR图表】区域地图-类型-地图边界,地理信息和自定义图片无法选中并展开选择子层级内容
  缩放以及事件不响应
  REPORT-132393 & REPORT-133561 fix:NewUI 修复图标问题&图表区域遗漏翻新布局
  fix: 回退调整滚动条的代码
  REPORT-132393 & REPORT-133561 fix:NewUI 修复图标问题&图表区域遗漏翻新布局
  fix: 解决代码规范问题
  REPORT-132393 & REPORT-133561 fix:NewUI 修复图标问题&图表区域遗漏翻新布局
  REPORT-127437 fix: newui 视觉修复
  REPORT-133442 【fr-fbp回归】【数据集】数据连接驱动选择自定义,保存后二次编辑,仍选择默认驱动
fbp/research
superman 4 months ago
parent
commit
e336bba752
  1. 11
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  2. 2
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  3. 6
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java
  4. 10
      designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java
  5. 10
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java
  6. 14
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  7. 19
      designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java
  8. 2
      designer-base/src/main/java/com/fr/design/data/datapane/connect/SslPane.java
  9. 140
      designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java
  10. 198
      designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java
  11. 43
      designer-base/src/main/java/com/fr/design/data/tabledata/LocalTableDataSource.java
  12. 28
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java
  13. 16
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TableDataFactory.java
  14. 3
      designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java
  15. 2
      designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java
  16. 6
      designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java
  17. 2
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java
  18. 17
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java
  19. 3
      designer-base/src/main/java/com/fr/design/i18n/DesignSizeI18nManager.java
  20. 8
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  21. 1
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java
  22. 31
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java
  23. 7
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java
  24. 8
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java
  25. 8
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/AbstractChartStylePane.java
  26. 18
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java
  27. 7
      designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java
  28. 65
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  29. 22
      designer-base/src/main/java/com/fr/file/FILEFactory.java
  30. 167
      designer-base/src/main/java/com/fr/file/FileCAFILE.java
  31. 11
      designer-base/src/main/java/com/fr/file/FileDataFILE.java
  32. 13
      designer-base/src/main/resources/com/fine/theme/icon/filetree/folder_half_authority.svg
  33. 9
      designer-base/src/main/resources/com/fine/theme/icon/filetree/folder_half_authority_open.svg
  34. 4
      designer-base/src/main/resources/com/fine/theme/icon/tip/waiting.svg
  35. 5
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  36. 1
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  37. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  38. 2
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java
  39. 17
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java
  40. 11
      designer-chart/src/main/java/com/fr/van/chart/bubble/component/VanChartBubblePane.java
  41. 2
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java
  42. 41
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java
  43. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartAreaSeriesFillColorPane.java
  44. 21
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  45. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java
  46. 39
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java
  47. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java
  48. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java
  49. 29
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java
  50. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  51. 21
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java
  52. 2
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java
  53. 21
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelSeriesPane.java
  54. 3
      designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java
  55. 14
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java
  56. 17
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java
  57. 11
      designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieSeriesPane.java
  58. 7
      designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java
  59. 17
      designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarSeriesPane.java
  60. 11
      designer-chart/src/main/java/com/fr/van/chart/range/component/GradualIntervalConfigPane.java
  61. 15
      designer-chart/src/main/java/com/fr/van/chart/range/component/LegendLabelFormatPane.java
  62. 9
      designer-chart/src/main/java/com/fr/van/chart/treemap/style/VanChartTreeMapSeriesPane.java
  63. 4
      designer-realize/src/main/java/com/fanruan/data/ConnectionConfigWrapper.java
  64. 8
      designer-realize/src/main/java/com/fanruan/fs/DesignFileRepository.java
  65. 10
      designer-realize/src/main/java/com/fr/design/cell/editor/BiasTextPainterCellEditor.java

11
designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java

@ -8,7 +8,8 @@ import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.workspace.server.repository.tabledata.TableDataBeanHelper;
import com.fr.design.data.datapane.preview.ConnectionInfoBeanHelper;
import com.fr.design.data.datapane.preview.TableDataBeanHelper;
import com.fr.design.data.tabledata.ResponseDataSourceChange;
import com.fr.design.data.tabledata.tabledatapane.TableDataManagerPane;
import com.fr.design.dialog.BasicDialog;
@ -24,10 +25,8 @@ import com.fr.esd.event.DSMapping;
import com.fr.esd.event.DsNameTarget;
import com.fr.esd.event.StrategyEventsNotifier;
import com.fr.file.TableDataConfig;
import com.fr.report.LockItem;
import com.fr.security.encryption.transmission.TransmissionEncryptionManager;
import com.fr.workspace.server.entity.connection.ConnectionBean;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import com.fr.workspace.server.repository.tabledata.TableDataRepository;
@ -85,11 +84,7 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
// 锁定成功,执行后续操作
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final List<ServerDataSetBean> beans = TableDataRepository.getInstance().getAllTableData();
final List<ConnectionBean> connectionInfoBeans = ConnectionRepository.getInstance().getAll();
final Map<String, Connection> connectionMap = new HashMap<>();
for (ConnectionBean bean : connectionInfoBeans) {
connectionMap.put(bean.getName(), bean.getConnection());
}
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
final Map<String, TableData> tableDataMap = new HashMap<>();
try {
TransmissionEncryptionManager.setTransEncryptionLevel(1);

2
designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -10,7 +10,7 @@ import com.fr.decision.webservice.bean.dataset.ServerDataSetBean;
import com.fr.design.data.BasicTableDataUtils;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.MapCompareUtils;
import com.fr.workspace.server.repository.tabledata.TableDataBeanHelper;
import com.fr.design.data.datapane.preview.TableDataBeanHelper;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator;

6
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java

@ -64,11 +64,11 @@ public class TableDataTree extends UserObjectRefreshJTree<TableDataSourceOP> {
} else if (nameObject.getObject() instanceof Integer) {
int num = (Integer) nameObject.getObject();
if (num == TableDataSourceOP.SERVER_TABLE_DATA) {
this.setIcon(IconUtils.readIcon(IconPathConstants.STD_SHOW_ICON_PATH));
this.setIcon(new LazyIcon("server_database"));
} else if (num == TableDataSourceOP.STORE_PRECEDURE_DATA) {
this.setIcon(IconUtils.readIcon(IconPathConstants.SP_SHOW_ICON_PATH));
this.setIcon(new LazyIcon("store_procedure"));
} else {
this.setIcon(IconUtils.readIcon(IconPathConstants.DS_QUERY_ICON_PATH));
this.setIcon(new LazyIcon("database"));
}
} else {
this.setIcon(new LazyIcon("store_procedure"));

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

@ -6,7 +6,8 @@ import com.fr.data.impl.Connection;
import com.fr.data.impl.RecursionTableData;
import com.fr.decision.webservice.bean.dataset.ServerDataSetBean;
import com.fr.design.data.DesignTableDataManager;
import com.fr.workspace.server.repository.tabledata.TableDataBeanHelper;
import com.fr.design.data.datapane.preview.ConnectionInfoBeanHelper;
import com.fr.design.data.datapane.preview.TableDataBeanHelper;
import com.fr.design.data.tabledata.wrapper.ServerTableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
@ -14,7 +15,6 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.security.encryption.transmission.TransmissionEncryptionManager;
import com.fr.stable.StringUtils;
import com.fr.workspace.server.entity.connection.ConnectionBean;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import com.fr.workspace.server.repository.tabledata.TableDataRepository;
@ -71,11 +71,7 @@ public class TreeTableDataComboBox extends UIComboBox {
// 全局数据集
List<ServerDataSetBean> beans = TableDataRepository.getInstance().getAllTableData();
Map<String, TableData> map = new HashMap<>();
final List<ConnectionBean> connectionInfoBeans = ConnectionRepository.getInstance().getAll();
final Map<String, Connection> connectionMap = new HashMap<>();
for (ConnectionBean bean : connectionInfoBeans) {
connectionMap.put(bean.getName(), bean.getConnection());
}
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
try {
TransmissionEncryptionManager.setTransEncryptionLevel(1);
for (ServerDataSetBean bean : beans) {

10
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java

@ -7,6 +7,7 @@ import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection;
import com.fr.design.DesignerEnvManager;
import com.fr.design.data.datapane.preview.ConnectionInfoBeanHelper;
import com.fr.design.editlock.ConnectionLockChangeChecker;
import com.fr.design.editlock.EditLockUtils;
import com.fr.design.gui.ibutton.UIButton;
@ -28,6 +29,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* 选择数据连接的下拉框
@ -89,13 +91,13 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
if (noAuthConnections == null) {
return nameList.iterator();
}
List<ConnectionBean> beans = ConnectionRepository.getInstance().getAll();
for (ConnectionBean bean : beans) {
String conName = bean.getName();
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
for (Map.Entry<String, Connection> connectionEntry : connectionMap.entrySet()) {
String conName = connectionEntry.getKey();
if (noAuthConnections.contains(conName)) {
continue;
}
filterConnection(bean.getConnection(), conName, nameList);
filterConnection(connectionEntry.getValue(), conName, nameList);
}
return nameList.iterator();
}

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

@ -190,11 +190,11 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
public void populate(Map<String, Connection> connectionMap) {
List<NameObject> nameObjectList = new ArrayList<NameObject>();
populatedConnectionsSnapshot.clear();
List<com.fr.workspace.server.entity.connection.ConnectionBean> beans = ConnectionRepository.getInstance().getAll();
for (com.fr.workspace.server.entity.connection.ConnectionBean entry : beans) {
nameObjectList.add(new NameObject(entry.getName(), entry.getConnection()));
final Map<String, Connection> map = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
for (Map.Entry<String, Connection> entry : map.entrySet()) {
nameObjectList.add(new NameObject(entry.getKey(), entry.getValue()));
try {
populatedConnectionsSnapshot.put(entry.getName(), (Connection) entry.getConnection().clone());
populatedConnectionsSnapshot.put(entry.getKey(), (Connection) entry.getValue().clone());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
@ -365,11 +365,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
}
public static void showDialog(Window parent) {
List<ConnectionBean> beans = ConnectionRepository.getInstance().getAll();
Map<String, Connection> connectionMap = new HashMap<>();
for (ConnectionBean bean : beans) {
connectionMap.put(bean.getName(), bean.getConnection());
}
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
final ConnectionManagerPane connectionManagerPane = new ConnectionManagerPane() {
@Override
public void complete() {

19
designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java

@ -1,16 +1,21 @@
package com.fr.design.data.datapane.connect;
import com.fanruan.config.impl.data.ConnectionConfigProviderFactory;
import com.fr.data.driver.DriverClassNotFoundException;
import com.fr.data.impl.Connection;
import com.fr.decision.webservice.bean.datasource.ConnectionInfoBean;
import com.fr.decision.webservice.exception.general.DriverNotFoundException;
import com.fr.decision.webservice.v10.datasource.connection.processor.impl.ConnectionProcessorFactory;
import com.fr.design.data.datapane.preview.ConnectionInfoBeanHelper;
import com.fr.design.i18n.Toolkit;
import com.fr.log.FineLoggerFactory;
import com.fr.security.encryption.transmission.TransmissionEncryptionManager;
import com.fr.workspace.engine.exception.DriverUnExistException;
import com.fr.workspace.server.repository.connection.BaseConnectionSource;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 本地Connection资源操作
@ -21,6 +26,20 @@ import java.sql.SQLException;
*/
public class LocalConnectionSource extends BaseConnectionSource {
@Override
public ConnectionInfoBean[] getAll(){
Map<String, Connection> map = ConnectionConfigProviderFactory.getConfigProvider().getConnections();
List<ConnectionInfoBean> beans = new ArrayList<>();
for (String name : map.keySet()) {
try {
beans.add(ConnectionInfoBeanHelper.createConnectionInfoBean(name, map.get(name)));
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return beans.toArray(new ConnectionInfoBean[0]);
}
@Override
public void testConnection(ConnectionInfoBean database) throws Exception {
try {

2
designer-base/src/main/java/com/fr/design/data/datapane/connect/SslPane.java

@ -146,7 +146,7 @@ public class SslPane extends BasicPane {
@Override
public void actionPerformed(ActionEvent e) {
FILEChooserPane fileChooser = FILEChooserPane.getInstanceWithDesignatePath(SslUtils.PREFIX, new ChooseFileFilter(true), SslUtils.CERTIFICATES);
FILEChooserPane fileChooser = FILEChooserPane.getFileCAChoosePane(new ChooseFileFilter(true));
int type = fileChooser.showOpenDialog(SslPane.this, StringUtils.EMPTY);
if (type == FILEChooserPane.OK_OPTION) {
final FILE file = fileChooser.getSelectedFILE();

140
designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java

@ -3,6 +3,7 @@ package com.fr.design.data.datapane.preview;
import com.fr.data.auth.AuthenticationType;
import com.fr.data.auth.kerberos.KerberosAuthentication;
import com.fr.data.auth.kerberos.KerberosUtils;
import com.fr.data.core.db.dialect.DialectFactory;
import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.NameDatabaseConnection;
@ -10,7 +11,9 @@ import com.fr.data.pool.DBCPConnectionPoolAttr;
import com.fr.data.security.ssh.BaseSsh;
import com.fr.data.security.ssh.SshType;
import com.fr.data.security.ssh.impl.KeyVerifySsh;
import com.fr.data.security.ssh.impl.NormalSsh;
import com.fr.data.security.ssl.BaseSsl;
import com.fr.data.security.ssl.Ssl;
import com.fr.data.security.ssl.SslType;
import com.fr.data.security.ssl.impl.NormalSsl;
import com.fr.decision.privilege.TransmissionTool;
@ -19,11 +22,21 @@ import com.fr.decision.webservice.bean.datasource.JDBCConnectionBean;
import com.fr.decision.webservice.utils.DecisionServiceConstants;
import com.fr.decision.webservice.v10.datasource.connection.processor.impl.ConnectionProcessorFactory;
import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JDBCConnectionProcessor;
import com.fr.log.FineLoggerFactory;
import com.fr.module.tool.ActivatorToolBox;
import com.fr.security.encryption.transmission.TransmissionEncryptionManager;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import com.fr.third.fasterxml.jackson.core.JsonProcessingException;
import com.fr.third.fasterxml.jackson.databind.ObjectMapper;
import com.fr.third.springframework.beans.BeanUtils;
import com.fr.workspace.server.repository.WorkplaceConstants;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import com.fr.workspace.server.repository.tabledata.DataEncryptionHelper;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
/**
* 数据连接传输工具类
@ -34,6 +47,36 @@ import com.fr.workspace.server.repository.connection.ConnectionRepository;
*/
public class ConnectionInfoBeanHelper {
private static ObjectMapper objectMapper = new ObjectMapper();
private static final Map<String, Integer> FETCH_SIZE_MAP = ActivatorToolBox.sandbox(new HashMap<String, Integer>());
private static final int ORACLE_DEFAULT_FETCH_SIZE = 128;
private static final int DB2_DEFAULT_FETCH_SIZE = 50;
private static final int POSTGRE_DEFAULT_FETCH_SIZE = 10000;
static {
FETCH_SIZE_MAP.put("oracle", ORACLE_DEFAULT_FETCH_SIZE);
FETCH_SIZE_MAP.put("ibm-db2", DB2_DEFAULT_FETCH_SIZE);
FETCH_SIZE_MAP.put("postgresql", POSTGRE_DEFAULT_FETCH_SIZE);
}
/**
* 获取连接Map
*/
public static Map<String, Connection> createConnectionMap(ConnectionInfoBean[] beans) {
Map<String, Connection> ans = new HashMap<>();
for (ConnectionInfoBean infoBean : beans) {
try {
if (JDBCConnectionProcessor.KEY.acceptConnectionTypes().contains(infoBean.getConnectionType())) {
ans.put(infoBean.getConnectionName(), createJDBCConnection(infoBean));
} else {
ans.put(infoBean.getConnectionName(), ConnectionProcessorFactory.createConnection(infoBean, true));
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return ans;
}
/**
* 创建数据连接Bean可自定义是否携带密码
@ -137,4 +180,101 @@ public class ConnectionInfoBeanHelper {
return TransmissionEncryptionManager.getInstance().getEncryption(WorkplaceConstants.getEncryptionMode()).encrypt(password, WorkplaceConstants.getEncryptionKey());
}
private static Connection createJDBCConnection(ConnectionInfoBean connectionInfoBean) throws Exception {
String name = connectionInfoBean.getConnectionName();
if (StringUtils.isNotEmpty(connectionInfoBean.getConnectionId())) {
name = connectionInfoBean.getConnectionId();
}
JDBCDatabaseConnection connection = new JDBCDatabaseConnection();
JDBCConnectionBean bean = objectMapper.readValue(connectionInfoBean.getConnectionData(), JDBCConnectionBean.class);
if (StringUtils.isNotEmpty(name)) {
bean.setConnectionName(name);
}
DBCPConnectionPoolAttr connectionPoolAttr = new DBCPConnectionPoolAttr();
BeanUtils.copyProperties(bean.getConnectionPoolAttr(), connectionPoolAttr);
connectionPoolAttr.setValidationQuery(DataEncryptionHelper.decrypt(connectionPoolAttr.getValidationQuery()));
connectionPoolAttr.setMinEvictableIdleTimeMillis(bean.getConnectionPoolAttr().getMinEvictableIdleTimeMillis() * Constants.MILLS_PER_SECOND);
connectionPoolAttr.setMaxEvictableIdleTimeMillis((long) bean.getConnectionPoolAttr().getMaxEvictableIdleTimeMillis() * Constants.MILLS_PER_SECOND);
connection.setDatabase(bean.getDatabase());
connection.setSchema(bean.getSchema());
connection.setDriver(bean.getDriver());
connection.setURL(bean.getUrl());
connection.setOriginalCharsetName(StringUtils.isEmpty(bean.getOriginalCharsetName()) ? null : bean.getOriginalCharsetName());
connection.setNewCharsetName(StringUtils.isEmpty(bean.getNewCharsetName()) ? null : bean.getNewCharsetName());
connection.setCreator(bean.getCreator());
connection.setDriverSource(bean.getDriverSource());
connection.setDbcpAttr(connectionPoolAttr);
if (StringUtils.isNotEmpty(bean.getAuthType())) {
connection.setAuthentication(new KerberosAuthentication(bean.getPrincipal(), bean.getKeyPath(), bean.isUseJaas()));
}
connection.setUser(bean.getUser());
TransmissionEncryptionManager.getInstance().setCurrentEncryptionMode(WorkplaceConstants.getDecryptionMode());
connection.setPassword(DataEncryptionHelper.decrypt(bean.getPassword()));
connection.setProperties(bean.getProperties());
setFetchSize(bean, connection);
if (bean.getIdentity() != null) {
connection.setIdentity(bean.getIdentity());
}
BaseSsh baseSsh;
String sshType = bean.getSshType();
if (SshType.KEY.toString().equals(sshType)) {
baseSsh = new KeyVerifySsh();
((KeyVerifySsh) baseSsh).setPrivateKeyPath(bean.getSshPrivateKeyPath());
} else {
baseSsh = new NormalSsh();
}
baseSsh.setIp(bean.getSshIp());
baseSsh.setUsingSsh(bean.isUsingSsh());
baseSsh.setPort(bean.getSshPort());
baseSsh.setUser(bean.getSshUser());
baseSsh.setRedirectIp(bean.getRedirectIp());
baseSsh.setRedirectPort(bean.getRedirectPort());
baseSsh.setSecret(DataEncryptionHelper.decrypt(bean.getSshSecret()));
baseSsh.setKeepAlive(bean.getSshKeepAlive());
baseSsh.setTimeOut(bean.getSshTimeOut());
connection.setSsh(baseSsh);
connection.setSsl(createSsl(bean));
return connection;
}
private static Ssl createSsl(JDBCConnectionBean bean) {
//目前只有NormalSsl
BaseSsl baseSsl = new NormalSsl();
if (SslType.NORMAL.toString().equals(bean.getSslType())) {
((NormalSsl) baseSsl).setVerifyCa(bean.isVerifyCa());
((NormalSsl) baseSsl).setCipher(bean.getSslCipher());
}
baseSsl.setUsingSsl(bean.isUsingSsl());
baseSsl.setClientCertificate(bean.getSslClientCertificate());
baseSsl.setClientPrivateKey(bean.getSslClientPrivateKey());
baseSsl.setCaCertificate(bean.getCaCertificate());
return baseSsl;
}
/**
* 前端客户设置了一个fetchSize
* 1. 如果是合法值(>0)就使用
* 2. 如果是非法值(<=0)
* 2.1 如果我们对这种数据库有默认的fetchSize就用默认的
* 2.2 如果没有默认值就不进行任何设置
* @param bean bean
* @param connection connection
*/
private static void setFetchSize(JDBCConnectionBean bean, Connection connection) {
int connectionBeanFetchSize = bean.getFetchSize();
String connectionBeanDatabaseName = bean.getDatabase();
if (DialectFactory.isValidFetchSize(connectionBeanFetchSize)) {
connection.setFetchSize(connectionBeanFetchSize);
} else if (FETCH_SIZE_MAP.containsKey(connectionBeanDatabaseName)) {
Optional.ofNullable(FETCH_SIZE_MAP.get(connectionBeanDatabaseName)).ifPresent(connection::setFetchSize);
}
FineLoggerFactory.getLogger().info("[Connection] fetchSize set to {} for connection {}", connection.getFetchSize(), bean.getConnectionName());
}
}

198
designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java

@ -0,0 +1,198 @@
package com.fr.design.data.datapane.preview;
import com.fr.base.DataSetProcessors;
import com.fr.base.Parameter;
import com.fr.base.ParameterHelper;
import com.fr.base.ParameterTypeHandler;
import com.fr.base.StoreProcedureParameter;
import com.fr.base.TableData;
import com.fr.data.impl.Connection;
import com.fr.data.impl.DBTableData;
import com.fr.data.impl.NameDatabaseConnection;
import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.decision.fun.UniversalServerTableDataProvider;
import com.fr.decision.webservice.bean.dataset.ParameterBean;
import com.fr.decision.webservice.bean.dataset.ParameterExternal;
import com.fr.decision.webservice.bean.dataset.SQLDataSetBean;
import com.fr.decision.webservice.bean.dataset.ServerDataSetBean;
import com.fr.decision.webservice.bean.dataset.StoreProcedureBean;
import com.fr.decision.webservice.v10.datasource.dataset.processor.impl.SQLDataSetProcessor;
import com.fr.decision.webservice.v10.datasource.dataset.processor.impl.StoreProcedureProcessor;
import com.fr.general.GeneralUtils;
import com.fr.general.sql.SqlUtils;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.script.Calculator;
import com.fr.security.encryption.transmission.TransmissionEncryptionManager;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import com.fr.workspace.server.repository.tabledata.DataEncryptionHelper;
import com.fr.workspace.server.repository.tabledata.TableDataRepository;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 数据集bean工具类
*
* @author Destiny.Lin
* @since 11.0
* Created on 2024/8/9
*/
public class TableDataBeanHelper {
/**
* 获取服务器数据集
*/
public static Map<String, TableData> getServerTableDatas() {
final List<ServerDataSetBean> beans = TableDataRepository.getInstance().getAllTableData();
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
final Map<String, TableData> tableDataMap = new HashMap<>();
try {
TransmissionEncryptionManager.setTransEncryptionLevel(1);
for (ServerDataSetBean bean : beans) {
tableDataMap.put(bean.getDatasetName() , TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData()));
}
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
TransmissionEncryptionManager.removeTransEncryptionLevel();
}
return tableDataMap;
}
/**
* 根据序列化数据生成tabledata
*/
public static TableData getTableDataSet(Map<String, Connection> connectionMap, String type, String tableDataSetData) throws Exception {
if (DataSetProcessors.getProcessors().containsKey(type)) {
if (StringUtils.equals(SQLDataSetProcessor.TYPE, type)) {
return deserialize4SQL(connectionMap, null, new JSONObject(tableDataSetData));
} else if (StringUtils.equals(StoreProcedureProcessor.TYPE, type)) {
return deserialize4Procedure(connectionMap, null, new JSONObject(tableDataSetData));
} else {
UniversalServerTableDataProvider processor = DataSetProcessors.getProcessors().get(type);
return (TableData) processor.deserialize(null, new JSONObject(tableDataSetData));
}
}
return null;
}
private static TableData deserialize4Procedure(Map<String, Connection> connectionMap, DBTableData oldDataSet, JSONObject object) {
StoreProcedure storeProcedure = new StoreProcedure();
StoreProcedureBean bean = object.mapTo(StoreProcedureBean.class);
storeProcedure.setShare(bean.isShare());
storeProcedure.setMaxMemRowCount(bean.getMaxMemRowCount());
storeProcedure.setQuery(bean.getQuery());
if (StringUtils.isNotEmpty(bean.getDatabase())) {
Connection connection = connectionMap.get(bean.getDatabase());
if (connection != null) {
storeProcedure.setDatabaseConnection(new NameDatabaseConnection(bean.getDatabase()));
} else {
FineLoggerFactory.getLogger().info("not find conn by {}", bean.getDatabase());
}
}
Parameter[] parameters = new Parameter[bean.getParameters().size()];
for (int i = 0; i < parameters.length; i++) {
ParameterBean parameterBean = bean.getParameters().get(i);
parameters[i] = (Parameter) ParameterTypeHandler.getInstance().parseParameter(parameterBean, new Parameter(parameterBean.getName()));
}
List<ParameterExternal> externals = bean.getStoreProcedureParameterBeanList();
StoreProcedureParameter[] procedureParameters = new StoreProcedureParameter[bean.getParameters().size()];
for (int i = 0; i < procedureParameters.length; i++) {
StoreProcedureParameter storeProcedureParameter = new StoreProcedureParameter();
storeProcedureParameter.setName(parameters[i].getName());
storeProcedureParameter.setValue(parameters[i].getValue());
storeProcedureParameter.setSchema(externals.get(i).getSchema());
storeProcedureParameter.setType(externals.get(i).getTypeInt());
procedureParameters[i] = storeProcedureParameter;
}
storeProcedure.setParameters(procedureParameters);
return storeProcedure;
}
/**
* 获取服务器数据集传输的bean
*/
public static ServerDataSetBean getServerDataSetBean(String name, TableData tableData) {
for (UniversalServerTableDataProvider processor : DataSetProcessors.getProcessors().values()) {
if (SQLDataSetProcessor.KEY.classForTableData() == tableData.getClass()) {
return serialize4SQL(name, tableData);
} else if (processor.classForTableData() == tableData.getClass()) {
ServerDataSetBean bean = new ServerDataSetBean();
try {
bean.setDatasetData(processor.serialize(tableData).toString());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
bean.setDatasetData(StringUtils.EMPTY);
}
bean.setDatasetName(name);
bean.setDatasetId(name);
bean.setDatasetType(processor.nameForTableData());
return bean;
}
}
return new ServerDataSetBean(name);
}
private static ServerDataSetBean serialize4SQL(String name, TableData tableData) {
ServerDataSetBean bean = new ServerDataSetBean();
try {
bean.setDatasetData(serialize4SQL0((DBTableData) tableData).toString());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
bean.setDatasetData(StringUtils.EMPTY);
}
bean.setDatasetName(name);
bean.setDatasetId(name);
bean.setDatasetType(SQLDataSetProcessor.KEY.nameForTableData());
return bean;
}
private static Object serialize4SQL0(DBTableData dataSet) {
SQLDataSetBean bean = new SQLDataSetBean();
if (dataSet.getDatabase() instanceof NameDatabaseConnection) {
bean.setDatabase(((NameDatabaseConnection) dataSet.getDatabase()).getName());
}
bean.setQuery(DataEncryptionHelper.encrypt(dataSet.getQuery()));
List<ParameterBean> parameterBeans = new ArrayList<>();
ParameterProvider[] parameters = dataSet.getParameters(Calculator.createCalculator());
for (ParameterProvider parameter : parameters) {
parameterBeans.add(new ParameterBean(parameter.getValue().getClass().getSimpleName(), parameter.getName(), GeneralUtils.objectToString(parameter.getValue())));
}
bean.setParameters(parameterBeans);
return JSONObject.mapFrom(bean);
}
private static TableData deserialize4SQL(Map<String, Connection> connectionMap, DBTableData oldDataSet, JSONObject object) {
DBTableData tableData = new DBTableData();
SQLDataSetBean bean = object.mapTo(SQLDataSetBean.class);
tableData.setQuery(DataEncryptionHelper.decrypt(bean.getQuery()));
Connection connection = connectionMap.get(bean.getDatabase());
if (connection != null) {
tableData.setDatabase(new NameDatabaseConnection(bean.getDatabase()));
} else {
FineLoggerFactory.getLogger().info("not find conn by {}", bean.getDatabase());
}
String sql = SqlUtils.clearSqlComments(DataEncryptionHelper.decrypt(bean.getQuery()));
Parameter[] parameters = new Parameter[bean.getParameters().size()];
for (int i = 0; i < parameters.length; i++) {
ParameterBean parameterBean = bean.getParameters().get(i);
parameters[i] = (Parameter) ParameterTypeHandler.getInstance().parseParameter(parameterBean, new Parameter(parameterBean.getName()));
}
tableData.setParameters(ParameterHelper.analyzeAndUnionSameParameters(new String[]{sql}, parameters));
if (oldDataSet != null) {
tableData.setMaxMemRowCount(oldDataSet.getMaxMemRowCount());
tableData.setPageQuerySql(oldDataSet.getPageQuerySql());
tableData.setShare(oldDataSet.isShare());
tableData.setDataQueryProcessor(oldDataSet.getDataQueryProcessor());
}
return tableData;
}
}

43
designer-base/src/main/java/com/fr/design/data/tabledata/LocalTableDataSource.java

@ -1,13 +1,21 @@
package com.fr.design.data.tabledata;
import com.fanruan.config.impl.data.ConnectionConfigProviderFactory;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.base.TableData;
import com.fr.decision.webservice.bean.dataset.FileDataSetBean;
import com.fr.decision.webservice.bean.dataset.ServerDataSetBean;
import com.fr.decision.webservice.bean.entry.FileNodeBean;
import com.fr.decision.webservice.v10.datasource.dataset.processor.impl.FileProcessor;
import com.fr.decision.webservice.v10.file.FileNodeService;
import com.fr.design.data.datapane.preview.TableDataBeanHelper;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.CommonUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.server.repository.tabledata.BaseTableDataSource;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@ -61,4 +69,39 @@ public class LocalTableDataSource extends BaseTableDataSource {
return false;
}
}
@Override
public List<FileNodeBean> getCertificatesFile(String keyword) throws Exception {
String pPath = CommonUtils.pathJoin(ProjectConstants.RESOURCES_NAME, ProjectConstants.CERTIFICATES_DIRECTORY);
return FileNodeService.getInstance().getAllRecursiveFileNodes(pPath, ProjectConstants.RESOURCES_NAME, keyword);
}
@Override
public List<ServerDataSetBean> getAllTableData() {
List<ServerDataSetBean> beans = new ArrayList<>();
TableData[] tableDatas = TableDataConfigProviderFactory.getInstance().getTableDatas().values().toArray(new TableData[0]);
for (TableData data : tableDatas) {
beans.add(TableDataBeanHelper.getServerDataSetBean(data.getName(), data));
}
return beans;
}
@Override
public void add(ServerDataSetBean bean) throws Exception {
TableDataConfigProviderFactory.getInstance().addTableData(bean.getDatasetName(), TableDataBeanHelper.getTableDataSet(ConnectionConfigProviderFactory.getConfigProvider().getConnections(), bean.getDatasetType(), bean.getDatasetData()));
}
@Override
public void delete(ServerDataSetBean bean) throws Exception {
TableDataConfigProviderFactory.getInstance().removeTableData(bean.getDatasetName());
}
@Override
public void update(ServerDataSetBean bean) throws Exception {
TableDataConfigProviderFactory.getInstance().updateTableData(bean.getDatasetName(), TableDataBeanHelper.getTableDataSet(ConnectionConfigProviderFactory.getConfigProvider().getConnections(), bean.getDatasetType(), bean.getDatasetData()));
}
}

28
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java

@ -6,6 +6,8 @@ import com.fr.base.svg.SVGLoader;
import com.fr.data.impl.ClassTableData;
import com.fr.data.impl.DBTableData;
import com.fr.data.impl.EmbeddedTableData;
import com.fr.data.impl.FileTableData;
import com.fr.data.impl.MultiTDTableData;
import com.fr.data.impl.RecursionTableData;
import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.design.icon.WarningIcon;
@ -25,13 +27,10 @@ public final class ServerTableDataWrapper extends AbstractTableDataWrapper {
@Override
public Icon getIcon() {
if (tabledata instanceof DBTableData) {
if (StringUtils.isBlank(((DBTableData) tabledata).getQuery())) {
return new LazyIcon("server_database_warning");
}
else {
return new LazyIcon("server_database");
}
} else if (tabledata instanceof ClassTableData) {
return getDBTableDataIcon();
}
if (tabledata instanceof ClassTableData) {
return new LazyIcon("class_table_data");
} else if (tabledata instanceof EmbeddedTableData) {
return new LazyIcon("data_table");
@ -39,10 +38,23 @@ public final class ServerTableDataWrapper extends AbstractTableDataWrapper {
return new LazyIcon("tree");
} else if (tabledata instanceof StoreProcedure) {
return new LazyIcon("store_procedure");
}
} else if (tabledata instanceof FileTableData) {
return new LazyIcon("file");
} else if (tabledata instanceof MultiTDTableData) {
return new LazyIcon("multi");
}
return new LazyIcon("server_database");
}
private Icon getDBTableDataIcon() {
if (StringUtils.isBlank(((DBTableData) tabledata).getQuery())) {
return new LazyIcon("server_database_warning");
}
else {
return new LazyIcon("server_database");
}
}
/**
* 是否异常
* @return

16
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TableDataFactory.java

@ -15,6 +15,7 @@ import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.datacenters.tabledata.DCTableData;
import com.fr.decision.webservice.bean.dataset.ServerDataSetBean;
import com.fr.design.data.datapane.TableDataNameObjectCreator;
import com.fr.design.data.datapane.preview.ConnectionInfoBeanHelper;
import com.fr.design.data.tabledata.datacenter.DCTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.ClassTableDataPane;
@ -29,9 +30,8 @@ import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.workspace.server.entity.connection.ConnectionBean;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import com.fr.workspace.server.repository.tabledata.TableDataBeanHelper;
import com.fr.design.data.datapane.preview.TableDataBeanHelper;
import com.fr.workspace.server.repository.tabledata.TableDataRepository;
import javax.swing.Icon;
@ -205,11 +205,7 @@ public abstract class TableDataFactory {
clearAll();
try {
List<ServerDataSetBean> beans = TableDataRepository.getInstance().getAllTableData();
final List<ConnectionBean> connectionInfoBeans = ConnectionRepository.getInstance().getAll();
final Map<String, Connection> connectionMap = new HashMap<>();
for (ConnectionBean bean : connectionInfoBeans) {
connectionMap.put(bean.getName(), bean.getConnection());
}
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
Map<String, TableData> tableDataMap = new HashMap<>();
for (ServerDataSetBean bean : beans) {
tableDataMap.put(bean.getDatasetName(), TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData()));
@ -233,11 +229,7 @@ public abstract class TableDataFactory {
Map<String, TableData> tableDataMap = new HashMap<>();
try {
List<ServerDataSetBean> beans = TableDataRepository.getInstance().getAllTableData();
final List<ConnectionBean> connectionInfoBeans = ConnectionRepository.getInstance().getAll();
final Map<String, Connection> connectionMap = new HashMap<>();
for (ConnectionBean bean : connectionInfoBeans) {
connectionMap.put(bean.getName(), bean.getConnection());
}
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
for (ServerDataSetBean bean : beans) {
tableDataMap.put(bean.getDatasetName(), TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData()));
}

3
designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java

@ -30,6 +30,7 @@ import javax.swing.JPopupMenu;
import javax.swing.ListCellRenderer;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout;
@ -381,7 +382,7 @@ public abstract class JListControlPane extends JControlPane implements ListContr
@Override
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
setPreferredSize(new Dimension(list.getWidth(), FineUIScale.scale(24)));
setPreferredSize(new Dimension(list.getWidth(), FineUIScale.scale(UIManager.getInt("List.cellRender.height"))));
if (value instanceof ListModelElement) {
ListModelElement element = ((ListModelElement) value);
Nameable nameable = element.wrapper;

2
designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java

@ -29,7 +29,7 @@ public class UIDayLabel extends UILabel {
public UIDayLabel(Date date, boolean isSmallLabel) {
setHorizontalAlignment(UILabel.CENTER);
setFont(DesignUtils.getDefaultGUIFont());
setFont(DesignUtils.getDefaultGUIFont().applySize(scale(12)));
this.date = date;
setPreferredSize(scale(new Dimension(30, 18)));
if (isSmallLabel) {

6
designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java

@ -22,10 +22,10 @@ import java.util.Vector;
public class JNameEdList extends UIList implements CellEditorListener {
/**
* 原值为20,设计器图标由png替换为svg之后JNameEdList的icon大小为16x16
* 原值为20,设计器图标由png替换为svg之后JNameEdList的icon大小为24x24
* 重命名是会出现左侧一部分带有背景色的渲染
*/
private static final int ICON_WIDTH = 16;
private static final int ICON_WIDTH = 24;
private boolean editable = true;
// kunsnat: 是否强制ListName是数字 (int型)
@ -240,7 +240,7 @@ public class JNameEdList extends UIList implements CellEditorListener {
return false;
}
Rectangle rect = this.getCellBounds(index, index);
// alex:所有的JNameEdList都有Icon,空出前面20 * 20的位置就是放的Icon
// alex:所有的JNameEdList都有Icon,空出前面24 * 24的位置就是放的Icon
rect.setRect(createRect(rect, getIconWidth()));
editorComp.setBounds(rect);

2
designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java

@ -77,7 +77,7 @@ public class EnvFileTree extends RefreshableJTree {
}
this.setIcon(FileTreeIcon.getIconWithExpandAttr(node, expanded));
} else {
this.setIcon(FileTreeIcon.getFolderHalfImageIcon());
this.setIcon(FileTreeIcon.getFolderHalfImageIcon(expanded));
}
this.setText(name);
} else if (userObj == PENDING) {

17
designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java

@ -49,9 +49,10 @@ public class FileTreeIcon {
public static final Icon FRM_FILE_LOCK_ICON = new LazyIcon("frm_locked");
public static final Icon FVS_FILE_LOCK_ICON = new LazyIcon("fvs_locked");
// TODO: 以下Icon视觉暂未提供,需提供后替换
public static final Icon FOLDER_HALF_IMAGE_ICON = new LazyIcon("folder_half_authority");
public static final Icon FOLDER_HALF_IMAGE_ICON_OPEN = new LazyIcon("folder_half_authority_open");
public static final Icon BLANK_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/blank.gif");
public static final Icon FOLDER_HALF_IMAGE_ICON = IconUtils.readIcon("/com/fr/design/standard/fileicon/folder_half_authority.svg");
public static final Icon CPTX_LOCKED_ICON = IconUtils.readIcon("/com/fr/design/standard/fileicon/cptx_icon_locked.svg");
public static final LockIcon FOLDER_LOCK_ICON =
@ -130,7 +131,17 @@ public class FileTreeIcon {
}
public static Icon getFolderHalfImageIcon() {
return FOLDER_HALF_IMAGE_ICON;
return getFolderHalfImageIcon(false);
}
/**
* 获取文件夹有部分权限时的图标
*
* @param isExpand 文件夹是否已打开
* @return 图标
*/
public static Icon getFolderHalfImageIcon(boolean isExpand) {
return isExpand ? FOLDER_HALF_IMAGE_ICON_OPEN : FOLDER_HALF_IMAGE_ICON;
}
/**

3
designer-base/src/main/java/com/fr/design/i18n/DesignSizeI18nManager.java

@ -1,5 +1,6 @@
package com.fr.design.i18n;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.dialog.BasicDialog;
import com.fr.general.GeneralContext;
import com.fr.locale.LocaleManager;
@ -52,6 +53,6 @@ public class DesignSizeI18nManager {
if (arr.length < SPLIT_LENGTH) {
return BasicDialog.DEFAULT;
}
return new Dimension(Integer.parseInt(arr[WIDTH_INDEX]), Integer.parseInt(arr[HEIGHT_INDEX]));
return FineUIScale.scale(new Dimension(Integer.parseInt(arr[WIDTH_INDEX]), Integer.parseInt(arr[HEIGHT_INDEX])));
}
}

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

@ -107,6 +107,8 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CopyOnWriteArrayList;
import static com.fine.theme.utils.FineUIScale.scale;
public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener {
private static final String DESIGNER_FRAME_NAME = "designer_frame";
@ -115,7 +117,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
private static final long serialVersionUID = -8732559571067484460L;
private static final int MENU_HEIGHT = 26;
private static final int MENU_HEIGHT = scale(26);
private static final Integer SECOND_LAYER = 100;
@ -578,8 +580,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
closeButton.setBorder(null);
int x = contentWidth - EastRegionContainerPane.getInstance().getContainerWidth() - closeMode.getIconWidth() / 2;
int y = MENU_HEIGHT - closeMode.getIconHeight() / 2;
closeButton.setBounds(x, y, UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH,
UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH);
closeButton.setBounds(x, y, scale(UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH),
scale(UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH));
}
/**

1
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java

@ -91,7 +91,6 @@ public class GradientBackgroundQuickPane extends BackgroundQuickPane {
*/
@Override
public void registerChangeListener(final UIObserverListener listener) {
gradientBar.addChangeListener(new ChangeListenerImpl(listener));
directionPane.addChangeListener(new ChangeListenerImpl(listener));
}

31
designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.check;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIButton;
@ -24,7 +25,7 @@ import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import java.awt.FlowLayout;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
@ -32,6 +33,10 @@ import java.awt.event.WindowEvent;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog;
import static javax.swing.JOptionPane.OK_CANCEL_OPTION;
import static javax.swing.JOptionPane.OK_OPTION;
@ -73,7 +78,7 @@ public class CheckButton extends UIButton {
}
if (set.isEmpty()) {
okButton.setEnabled(true);
imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png"));
imageLabel.setIcon(new LazyIcon("success", 20));
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Success") + "</html>");
} else {
if (dialog != null) {
@ -172,7 +177,7 @@ public class CheckButton extends UIButton {
@Override
public Void callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) {
imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png"));
imageLabel.setIcon(new LazyIcon("error", 20));
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Upgrade") + "</html>");
okButton.setEnabled(true);
return null;
@ -198,16 +203,16 @@ public class CheckButton extends UIButton {
dialog.setSize(DesignSizeI18nManager.getInstance().i18nDimension(this.getClass().getName()));
JPanel jp = new JPanel();
JPanel upPane = new JPanel();
JPanel downPane = new JPanel();
imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/waiting.png"));
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
upPane.add(imageLabel);
upPane.add(message);
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0));
downPane.add(okButton);
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));
jp.add(upPane);
jp.add(downPane);
JPanel downPane = new JPanel(new BorderLayout());
imageLabel = new UILabel(new LazyIcon("waiting", 20));
upPane.add(row(10,
column(cell(imageLabel),flex()), cell(message)
).getComponent());
downPane.add(okButton, BorderLayout.EAST);
jp.setLayout(new BorderLayout());
jp.add(column(flex(), cell(upPane), flex()).getComponent());
jp.add(downPane, BorderLayout.SOUTH);
jp.setBorder(new ScaledEmptyBorder(10, 10, 10,10));
dialog.add(jp);
dialog.setResizable(false);
dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this));

7
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java

@ -46,6 +46,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale;
import static com.fr.design.i18n.Toolkit.i18nText;
/**
@ -127,8 +128,8 @@ public class CellStyleListEditPane extends JListControlPane {
this.setCreators(this.createNameableCreators());
initCardPane();
JPanel leftPane = getLeftPane();
leftPane.setPreferredSize(new Dimension(90, 0));
cardPane.setPreferredSize(new Dimension(270, 0));
leftPane.setPreferredSize(new Dimension(scale(90), super.getPreferredSize().height));
cardPane.setPreferredSize(new Dimension(scale(270), super.getPreferredSize().height));
JPanel mainSplitPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
mainSplitPane.add(leftPane, BorderLayout.WEST);
mainSplitPane.add(cardPane, BorderLayout.CENTER);
@ -292,7 +293,7 @@ public class CellStyleListEditPane extends JListControlPane {
Component component = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (component instanceof NameableListCellRenderer) {
((NameableListCellRenderer) component).setIcon(null);
((NameableListCellRenderer) component).setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
((NameableListCellRenderer) component).setBorder(new ScaledEmptyBorder(0, 4, 0, 0));
}
return component;
}

8
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme.edit.cell;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.CellBorderStyle;
import com.fr.base.Style;
import com.fr.base.theme.settings.ThemedCellStyle;
@ -24,6 +25,7 @@ import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale;
import static com.fr.design.i18n.Toolkit.i18nText;
@ -129,14 +131,14 @@ public class CellStyleEditPane extends MultiTabPane<ThemedCellStyle> {
@Override
protected void initLayout() {
this.setLayout(new BorderLayout(0, 10));
this.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
this.setBorder(new ScaledEmptyBorder(0, 4, 0, 4));
JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
previewArea = new CellRectangleStylePreviewPane(true);
previewArea.setPreferredSize(new Dimension(207, 48));
previewArea.setPreferredSize(scale(new Dimension(207, 48)));
previewPane.setBorder(BorderFactory.createCompoundBorder(
BorderUtils.createTitleBorder(i18nText("Fine-Design_Basic_Preview")),
BorderFactory.createEmptyBorder(4, 4, 4, 4)));
new ScaledEmptyBorder(4, 4, 4, 4)));
previewPane.add(previewArea, BorderLayout.NORTH);
this.add(previewPane, BorderLayout.NORTH);

8
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/AbstractChartStylePane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme.edit.chart;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.theme.settings.ThemedChartStyle;
@ -31,11 +32,8 @@ public abstract class AbstractChartStylePane extends BasicPane {
protected void initPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
double labelWidth = 90;
double totalWidth = 190;
double p = TableLayout.PREFERRED;
double[] columnSize = {labelWidth, totalWidth};
JPanel gapTableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getComponent(), getRows(p), columnSize, 5, LayoutConstants.VGAP_LARGE);
JPanel gapTableLayoutPane = FineLayoutBuilder.compatibleTableLayout(10, getComponent(), new double[]{1.2, 3});
gapTableLayoutPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
UIScrollPane rightTopPane = new UIScrollPane(gapTableLayoutPane);
rightTopPane.setBorder(BorderFactory.createEmptyBorder());

18
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java

@ -1,6 +1,8 @@
package com.fr.design.mainframe.theme.edit.chart;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.FRContext;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
@ -9,6 +11,7 @@ import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.FineUITable;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -24,6 +27,9 @@ import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Font;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author Bjorn
* @version 10.0
@ -67,8 +73,8 @@ public class ChartFontPane extends BasicPane {
Component[] components = new Component[]{
fontSizeComboBox, fontColor, italic, bold
};
JPanel buttonPane = new JPanel();
buttonPane.add(GUICoreUtils.createFlowPane(components, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE));
JPanel buttonPane = new JPanel(new BorderLayout());
buttonPane.add(row(4, cell(fontSizeComboBox), cell(fontColor), cell(italic), cell(bold)).getComponent());
this.setLayout(new BorderLayout());
this.add(getContentPane(buttonPane), BorderLayout.CENTER);
@ -77,11 +83,7 @@ public class ChartFontPane extends BasicPane {
}
protected JPanel getContentPane(JPanel buttonPane) {
double labelWidth = 90;
double totalWidth = 190;
double p = TableLayout.PREFERRED;
double[] rows = {p, p, p};
double[] columnSize = {labelWidth, totalWidth};
UILabel text = new UILabel(getUILabelText(), SwingConstants.LEFT);
text.setToolTipText(getUILabelText());
Component[][] components = {
@ -90,7 +92,7 @@ public class ChartFontPane extends BasicPane {
new Component[]{null, buttonPane}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rows, columnSize, 5, 10);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
public String getUILabelText() {

7
designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java

@ -6,6 +6,7 @@ import com.fr.base.TableData;
import com.fr.data.core.DataCoreUtils;
import com.fr.data.core.db.DBUtils;
import com.fr.data.core.db.dialect.Dialect;
import com.fr.data.impl.Connection;
import com.fr.data.impl.DatabaseDictionary;
import com.fr.data.impl.NameDatabaseConnection;
import com.fr.design.beans.FurtherBasicBeanPane;
@ -25,6 +26,7 @@ import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.stable.StringUtils;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@ -176,8 +178,9 @@ public class DatabaseDictPane extends FurtherBasicBeanPane<DatabaseDictionary> i
if (StringUtils.isBlank(para.getDatabaseName())) {
dbDict.setDatabaseConnection(null);
} else {
database = DBUtils.checkDBConnection(para.getDatabaseName());
if (database != null) {
Connection connection = ConnectionRepository.getInstance().getByName(para.getDatabaseName()).getConnection();
if (connection != null) {
database = new NameDatabaseConnection(para.getDatabaseName());
dbDict.setDatabaseConnection(database);
}
}

65
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -252,6 +252,21 @@ public class FILEChooserPane extends BasicPane {
return chooserPane;
}
/**
* 获取CA证书的文件选择面板
*/
public static FILEChooserPane getFileCAChoosePane(FILEFilter filter) {
FILEChooserPane chooserPane = new FILEChooserPane();
chooserPane.showEnv = true;
chooserPane.showLoc = false;
chooserPane.showWebReport = false;
// 替换掉 PlaceListModel
chooserPane.setFileCAPlaceListModel();
chooserPane.removeAllFilter();
chooserPane.addChooseFILEFilter(filter, 0);
return chooserPane;
}
/**
* @param showEnv
@ -1128,6 +1143,13 @@ public class FILEChooserPane extends BasicPane {
setPlaceListModel(new FileDataPlaceListModel(type));
}
protected void setFileCAPlaceListModel() {
if (placesList == null) {
return;
}
setPlaceListModel(new FileCAPlaceListModel());
}
/*
* 选中文件
*/
@ -1362,6 +1384,7 @@ public class FILEChooserPane extends BasicPane {
private class FileDataPlaceListModel extends AbstractPlaceListModel {
private FileDataFILE envFILE;
private String type;
FileDataPlaceListModel(String type) {
envFILE = new FileDataFILE(new FileNode(StableUtils.pathJoin(ProjectConstants.ASSETS_NAME, FileDataFILE.FILE_DATASET_NAME), true), false, StableUtils.pathJoin(ProjectConstants.ASSETS_NAME, FileDataFILE.FILE_DATASET_NAME)) {
@ -1371,6 +1394,45 @@ public class FILEChooserPane extends BasicPane {
}
};
envFILE.setType(type);
FileDataPlaceListModel.this.setType(type);
}
@Override
public FILE getElementAt(int index) {
return envFILE;
}
@Override
public int getSize() {
return 1 + filesOfSystem.size();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
protected void setCD(FILE lastDirectory) {
super.setCD(lastDirectory);
if (lastDirectory instanceof FileDataFILE) {
((FileDataFILE)lastDirectory).setType(type);
}
}
}
private class FileCAPlaceListModel extends AbstractPlaceListModel {
private FileCAFILE envFILE;
FileCAPlaceListModel() {
envFILE = new FileCAFILE(new FileNode(StableUtils.pathJoin(ProjectConstants.RESOURCES_NAME, ProjectConstants.CERTIFICATES_DIRECTORY), true), false, StableUtils.pathJoin(ProjectConstants.RESOURCES_NAME, ProjectConstants.CERTIFICATES_DIRECTORY)) {
@Override
public String getName() {
return getEnvProjectName();
}
};
}
@Override
@ -1385,6 +1447,7 @@ public class FILEChooserPane extends BasicPane {
}
private class MultiLocalEnvPlaceListModel extends AbstractPlaceListModel {
private static final long serialVersionUID = 6300018896958532154L;
@ -1596,7 +1659,7 @@ public class FILEChooserPane extends BasicPane {
this.buttonList.add(createBlankButton((new SetDirectoryAction(btn_text + '/',
// alex:dir.prefix不和btn_path一起参与pathJoin,因为btn_path是否以/打头在unix,linux
// OS中意义很不一样
FILEFactory.createFolder(dir.prefix() + StableUtils.pathJoin(btn_path, "/")), !needTopPath))));
FILEFactory.createFolder(dir, dir.prefix() + StableUtils.pathJoin(btn_path, "/")), !needTopPath))));
}
maxPathIndex = calculateMaxPathIndex();

22
designer-base/src/main/java/com/fr/file/FILEFactory.java

@ -9,6 +9,7 @@ public class FILEFactory {
public static final String FILE_PREFIX = "file://";
public static final String ENV_PREFIX = "env://";
public static final String FILE_DATA_PREFIX = "filedata://";
public static final String FILE_CA_PREFIX = "ca://";
public static final String WEBREPORT_PREFIX = "webreport://";
public static final String SEPARATOR = "/";
@ -38,12 +39,22 @@ public class FILEFactory {
return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length())));
} else if (path.startsWith(FILE_DATA_PREFIX)) {
return new FileDataFILE(new FileNode(path.substring(FILE_DATA_PREFIX.length()), false), false, path.substring(FILE_DATA_PREFIX.length()));
} else if (path.startsWith(FILE_CA_PREFIX)) {
return new FileCAFILE(new FileNode(path.substring(FILE_CA_PREFIX.length()), false), false, path.substring(FILE_CA_PREFIX.length()));
} else {
return new FileNodeFILE(new FileNode(path, WorkContext.getWorkResource().isDirectory(path)));
}
}
public static FILE createFolder(String path) {
return createFolder(null, path);
}
/**
* 传递依据的基础文件并创建文件夹
*/
public static FILE createFolder(FILE origin, String path) {
if (path == null) {
return null;
} else if (path.startsWith(MEM_PREFIX)) {
@ -57,8 +68,15 @@ public class FILEFactory {
} else if (path.startsWith(FILE_PREFIX)) {
return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length())));
} else if (path.startsWith(FILE_DATA_PREFIX)) {
return new FileDataFILE(new FileNode(path.substring(FILE_DATA_PREFIX.length()), true), false, path.substring(FILE_DATA_PREFIX.length()));
} else {
FileDataFILE file = new FileDataFILE(new FileNode(path.substring(FILE_DATA_PREFIX.length()), true), false, path.substring(FILE_DATA_PREFIX.length()));
if (origin instanceof FileDataFILE) {
file.setType(((FileDataFILE) origin).getType());
}
return file;
} else if (path.startsWith(FILE_CA_PREFIX)) {
return new FileCAFILE(new FileNode(path.substring(FILE_CA_PREFIX.length()), true), false, path.substring(FILE_CA_PREFIX.length()));
}
else {
return new FileNodeFILE(new FileNode(path, WorkContext.getWorkResource().isDirectory(path)));
}
}

167
designer-base/src/main/java/com/fr/file/FileCAFILE.java

@ -0,0 +1,167 @@
package com.fr.file;
import com.fr.decision.webservice.bean.entry.FileNodeBean;
import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.server.repository.tabledata.TableDataRepository;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* CA证书文件相关
*
* @author Destiny.Lin
* @since 11.0
* Created on 2024/9/8
*/
public class FileCAFILE extends FileNodeFILE{
public static final String ROOT = ProjectConstants.CERTIFICATES_DIRECTORY;
private List<FileCAFILE> children = new ArrayList<>();
private boolean builded = false;
private String id = StringUtils.EMPTY;
public FileCAFILE(FileNode node) {
super(node);
}
public FileCAFILE(FileNode node, boolean builded, String id) {
super(node);
this.builded = builded;
this.id = id;
}
/**
* 添加子
*/
private void addChild(FileCAFILE file) {
children.add(file);
}
public List<FileCAFILE> getChildren() {
return children;
}
public void setChildren(List<FileCAFILE> children) {
this.children = children;
}
public boolean isBuilded() {
return builded;
}
public void setBuilded(boolean builded) {
this.builded = builded;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public FILE[] listFiles() {
if (ComparatorUtils.equals(node, null)) {
node = new FileNode(CoreConstants.SEPARATOR, true);
}
if (!node.isDirectory()) {
return new FILE[]{this};
}
try {
FileCAFILE root = null;
if (!this.builded) {
root = buildTree();
FileCAFILE dataFILE = root.getFileCAFILE(this.id);
this.setChildren(dataFILE.getChildren());
this.builded = true;
}
return this.getChildren().toArray(new FILE[0]);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return new FILE[0];
}
}
private List<FileNodeBean> getBeans() {
try {
return TableDataRepository.getInstance().getCertificatesFile(StringUtils.EMPTY);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 递归获取指定id的文件
*/
public FileCAFILE getFileCAFILE(String id) {
if (StringUtils.equals(this.id, id) || StringUtils.equals(StableUtils.pathJoin(this.id, StringUtils.EMPTY), id)) {
return this;
}
for (FileCAFILE file : getChildren()) {
return file.getFileCAFILE(id);
}
return null;
}
private FileCAFILE buildTree() {
List<FileNodeBean> beans = getBeans();
Map<String, FileCAFILE> tree = new HashMap<>();
FileCAFILE root = null;
// id , 父
for (FileNodeBean bean : beans) {
FileNode fileNode = new FileNode();
fileNode.setEnvPath(bean.getPath());
fileNode.setDirectory(bean.getIsParent());
tree.putIfAbsent(bean.getId(), new FileCAFILE(fileNode, true, bean.getId()));
if (StringUtils.isEmpty(bean.getpId())) {
root = tree.get(bean.getId());
} else {
tree.putIfAbsent(bean.getpId(), createParent(bean.getpId(), beans));
FileCAFILE file = tree.get(bean.getpId());
if (file != null) {
file.addChild(tree.get(bean.getId()));
}
}
}
for (Map.Entry<String, FileCAFILE> entry : tree.entrySet()) {
if (entry.getKey().endsWith(ROOT)) {
root = entry.getValue();
root.setId(StableUtils.pathJoin(ProjectConstants.RESOURCES_NAME, ProjectConstants.CERTIFICATES_DIRECTORY));
break;
}
}
return root;
}
private FileCAFILE createParent(String s, List<FileNodeBean> beans) {
for (FileNodeBean bean : beans) {
if (StringUtils.equals(bean.getId(), s)) {
FileNode fileNode = new FileNode();
fileNode.setEnvPath(bean.getPath());
fileNode.setDirectory(bean.getIsParent());
return new FileCAFILE(fileNode, true, bean.getId());
}
}
FileNode fileNode = new FileNode();
fileNode.setEnvPath(s);
fileNode.setDirectory(true);
return new FileCAFILE(fileNode, true, ROOT);
}
@Override
public String prefix() {
return FILEFactory.FILE_CA_PREFIX;
}
}

11
designer-base/src/main/java/com/fr/file/FileDataFILE.java

@ -42,6 +42,13 @@ public class FileDataFILE extends FileNodeFILE{
this.id = id;
}
public FileDataFILE(FileNode node, boolean builded, String id, String type) {
super(node);
this.builded = builded;
this.id = id;
this.type = type;
}
private void addChild(FileDataFILE file) {
children.add(file);
}
@ -127,7 +134,7 @@ public class FileDataFILE extends FileNodeFILE{
FileNode fileNode = new FileNode();
fileNode.setEnvPath(bean.getPath());
fileNode.setDirectory(bean.getIsParent());
tree.putIfAbsent(bean.getId(), new FileDataFILE(fileNode, true, bean.getId()));
tree.putIfAbsent(bean.getId(), new FileDataFILE(fileNode, true, bean.getId(), type));
if (StringUtils.isEmpty(bean.getpId())) {
root = tree.get(bean.getId());
} else {
@ -147,7 +154,7 @@ public class FileDataFILE extends FileNodeFILE{
FileNode fileNode = new FileNode();
fileNode.setEnvPath(bean.getPath());
fileNode.setDirectory(bean.getIsParent());
return new FileDataFILE(fileNode, true, bean.getId());
return new FileDataFILE(fileNode, true, bean.getId(), type);
}
}
return null;

13
designer-base/src/main/resources/com/fine/theme/icon/filetree/folder_half_authority.svg

@ -0,0 +1,13 @@
<svg width="28" height="24" viewBox="0 0 28 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group 7828">
<path id="Rectangle 34624470" d="M1 2C1 0.89543 1.89543 0 3 0L11.0925 0.499999C11.6692 0.499999 12.2178 0.74896 12.5976 1.18299L14.9024 3.81701C15.2822 4.25104 15.8308 4.5 16.4075 4.5L24.5 3.81701C25.6046 3.81701 26.5 4.71244 26.5 5.81701L25.5 20.5C25.5 21.6046 24.6046 22.5 23.5 22.5H3.5C2.39543 22.5 1.5 21.6046 1.5 20.5L1 2Z" fill="#FFD46C"/>
<path id="Union (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M26.5 21.2502V21.625L27 22C27.0027 22 27.004 21.9982 27.0039 21.9947C27.0039 21.9914 27.0025 21.9866 27 21.9802C26.982 21.935 26.9027 21.8132 26.77 21.625C26.7307 21.5693 26.6868 21.5077 26.6383 21.4406C26.5956 21.3814 26.5495 21.3179 26.5 21.2502ZM26 18.0264L25 16.6595V22.375L25.1667 22.5H2.5C2.22386 22.5 2 22.2761 2 22V2C2 1.72386 2.22386 1.5 2.5 1.5H11.0925C11.2366 1.5 11.3738 1.56224 11.4688 1.67075L13.7735 4.30477C14.4381 5.06432 15.3983 5.5 16.4075 5.5H25.5C25.7761 5.5 26 5.72386 26 6V18.0264ZM26 20.8834V21.616L25.5043 21.9787C25.5052 21.8943 25.5132 21.8012 25.5329 21.7027C25.5378 21.6781 25.5437 21.6521 25.5507 21.625C25.5794 21.5137 25.6266 21.3835 25.703 21.2502C25.774 21.1264 25.8702 20.9998 26 20.8834ZM27.5 22C27.5 22.5072 27.3112 22.9703 27 23.3229C26.9447 23.3856 26.8856 23.4447 26.8229 23.5C26.4703 23.8112 26.0072 24 25.5 24H2.5C1.39543 24 0.5 23.1046 0.5 22V2C0.5 0.89543 1.39543 0 2.5 0H11.0925C11.6692 0 12.2178 0.248961 12.5976 0.682991L14.9024 3.31701C15.2822 3.75104 15.8308 4 16.4075 4H25.5C26.6046 4 27.5 4.89543 27.5 6V22Z" fill="#E2900B"/>
<path id="Rectangle 34624473" d="M0.5 10H26.5V22.1429C26.5 23.1685 25.5688 24 24.42 24H2.58C1.43125 24 0.5 23.1685 0.5 22.1429V10Z" fill="#F9AE31"/>
<path id="Rectangle 34624473 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M26 10.5H2V22.1429C2 22.1826 2.01471 22.2536 2.10824 22.3371C2.20445 22.4231 2.36696 22.5 2.58 22.5H25.42C25.633 22.5 25.7955 22.4231 25.8918 22.3371C25.9853 22.2536 26 22.1826 26 22.1429V10.5ZM0.5 9V22.1429C0.5 23.1685 1.43125 24 2.58 24H25.42C26.5688 24 27.5 23.1685 27.5 22.1429V9H0.5Z" fill="#E2900B"/>
<g id="Group 1210707205">
<circle id="Ellipse 321" cx="13.75" cy="14.125" r="2.125" stroke="white" stroke-width="1.5"/>
<path id="Rectangle 34627591" d="M13 16.75H14.5V20.75C14.5 21.1642 14.1642 21.5 13.75 21.5C13.3358 21.5 13 21.1642 13 20.75V16.75Z" fill="white"/>
<path id="Rectangle 34627592" d="M15.75 17.75C16.1642 17.75 16.5 18.0858 16.5 18.5C16.5 18.9142 16.1642 19.25 15.75 19.25L13 19.25L13 17.75L15.75 17.75Z" fill="white"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

9
designer-base/src/main/resources/com/fine/theme/icon/filetree/folder_half_authority_open.svg

@ -0,0 +1,9 @@
<svg width="28" height="24" viewBox="0 0 28 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group 7828">
<path id="Rectangle 34624470" d="M1.00007 3C1.00007 1.89543 0.395507 0.5 1.50008 0.5L10.5925 1C11.1693 1 11.7179 1.24896 12.0977 1.68299L14.4025 4.31701C14.7822 4.75104 15.3309 5 15.9076 5L22.5001 4.5C23.6046 4.5 24.0001 5.89543 24.0001 7L23.0001 22C23.0001 23.1046 23.1046 24 22.0001 24H3.00007C1.8955 24 1.00007 23.1046 1.00007 22V3Z" fill="#FFD46C"/>
<path id="Union (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M23.5 18.0264L22.5 16.6595V22.375L22.6667 22.5H2C1.72386 22.5 1.5 22.2761 1.5 22V2C1.5 1.72386 1.72386 1.5 2 1.5H9.59246C9.73664 1.5 9.87381 1.56224 9.96875 1.67075L12.2735 4.30477C12.9381 5.06432 13.8983 5.5 14.9075 5.5H23C23.2761 5.5 23.5 5.72386 23.5 6V18.0264ZM23.5 20.8834V21.616L23.0043 21.9787C23.0052 21.8943 23.0132 21.8012 23.0329 21.7027C23.0378 21.6781 23.0437 21.6521 23.0507 21.625C23.0794 21.5137 23.1266 21.3835 23.203 21.2502C23.274 21.1264 23.3702 20.9998 23.5 20.8834ZM25 22C25 22.5072 24.8112 22.9703 24.5 23.3229C24.4447 23.3856 24.3856 23.4447 24.3229 23.5C23.9703 23.8112 23.5072 24 23 24H2C0.895431 24 0 23.1046 0 22V2C0 0.89543 0.895431 0 2 0H9.59246C10.1692 0 10.7178 0.248961 11.0976 0.682991L13.4024 3.31701C13.7822 3.75104 14.3308 4 14.9075 4H23C24.1046 4 25 4.89543 25 6V22Z" fill="#E2900B"/>
<path id="Rectangle 34624994" d="M3.85904 12.4118C4.11725 11.5726 4.89258 11 5.77059 11H24.5855C25.9311 11 26.8928 12.3021 26.4971 13.5882L23.7279 22.5882C23.4696 23.4274 22.6943 24 21.8163 24H3.00136C1.65575 24 0.69408 22.6979 1.0898 21.4118L3.85904 12.4118Z" fill="#F9AE31"/>
<path id="Rectangle 34624994 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M25.9957 12.5H5.18075C4.96125 12.5 4.76741 12.6432 4.70286 12.853L1.93363 21.853C1.8347 22.1745 2.07512 22.5 2.41152 22.5H23.2264C23.446 22.5 23.6398 22.3568 23.7043 22.147L26.4736 13.147C26.5725 12.8255 26.3321 12.5 25.9957 12.5ZM5.18075 11C4.30274 11 3.5274 11.5726 3.26919 12.4118L0.499961 21.4118C0.104236 22.6979 1.06591 24 2.41152 24H23.2264C24.1045 24 24.8798 23.4274 25.138 22.5882L27.9072 13.5882C28.303 12.3021 27.3413 11 25.9957 11H5.18075Z" fill="#E2900B"/>
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M14.125 17.5C14.125 16.7406 13.5094 16.125 12.75 16.125C11.9906 16.125 11.375 16.7406 11.375 17.5C11.375 18.2594 11.9906 18.875 12.75 18.875C13.5094 18.875 14.125 18.2594 14.125 17.5ZM12.75 14.625C14.0784 14.625 15.1963 15.5259 15.5262 16.75L16.375 16.75L16.375 15.5C16.375 15.0858 16.7108 14.75 17.125 14.75C17.5392 14.75 17.875 15.0858 17.875 15.5L17.875 16.75L19.375 16.75C19.7892 16.75 20.125 17.0858 20.125 17.5C20.125 17.9142 19.7892 18.25 19.375 18.25L17.875 18.25L16.375 18.25L15.5262 18.25C15.1963 19.4741 14.0784 20.375 12.75 20.375C11.1622 20.375 9.875 19.0878 9.875 17.5C9.875 15.9122 11.1622 14.625 12.75 14.625Z" fill="white"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

4
designer-base/src/main/resources/com/fine/theme/icon/tip/waiting.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M30 16C30 23.7313 23.7313 30 16 30C8.26871 30 2 23.7313 2 16C2 8.26871 8.26871 2 16 2C23.7313 2 30 8.26871 30 16Z" fill="#2576EF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.96855 8.00001L9.97222 8H22.0278L22.0314 8.00001H22.2222L22.2201 8.01902C22.6649 8.10828 23 8.50112 23 8.97222C23 9.50917 22.5647 9.94444 22.0278 9.94444H22.0062L21.8879 11.0091C21.7678 12.0894 21.2815 13.1137 20.4912 13.9505L18.4461 16.1159L20.3508 17.9646C21.2301 18.8181 21.7783 19.8932 21.9168 21.0359L22.0337 22C22.5679 22.0032 23 22.4373 23 22.9722C23 23.5092 22.5647 23.9445 22.0278 23.9445H9.97222C9.43528 23.9445 9 23.5092 9 22.9722C9 22.4373 9.4321 22.0032 9.96633 22L10.0832 21.0359C10.2217 19.8932 10.7699 18.8181 11.6492 17.9646L13.5539 16.1159L11.5088 13.9505C10.7185 13.1137 10.2322 12.0894 10.1121 11.0091L9.99383 9.94444H9.97222C9.43528 9.94444 9 9.50917 9 8.97222C9 8.50112 9.33507 8.10828 9.77989 8.01902L9.77778 8.00001H9.96855ZM11.6014 9.94444L11.7046 10.8736C11.7938 11.6762 12.1551 12.4371 12.7421 13.0586L15.4038 15.8768C15.5498 16.0315 15.5445 16.2748 15.3919 16.4229L12.8376 18.902C12.1844 19.5361 11.7772 20.3347 11.6743 21.1836L11.5753 22H20.4247L20.3257 21.1836C20.2228 20.3347 19.8156 19.5361 19.1624 18.902L16.6081 16.4229C16.4555 16.2748 16.4502 16.0315 16.5962 15.8768L19.2579 13.0586C19.8449 12.4371 20.2062 11.6762 20.2954 10.8736L20.3986 9.94444H11.6014ZM16.7778 18.1111C16.7778 18.5407 16.4296 18.8889 16 18.8889C15.5704 18.8889 15.2222 18.5407 15.2222 18.1111C15.2222 17.6816 15.5704 17.3333 16 17.3333C16.4296 17.3333 16.7778 17.6816 16.7778 18.1111ZM18.3333 12.5528C18.3333 12.4009 18.2102 12.2778 18.0583 12.2778H13.9417C13.7898 12.2778 13.6667 12.4009 13.6667 12.5528C13.6667 12.6257 13.6956 12.6956 13.7472 12.7472L15.725 14.725C15.8769 14.8769 16.1231 14.8769 16.275 14.725L18.2528 12.7472C18.3044 12.6956 18.3333 12.6257 18.3333 12.5528Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

5
designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json

@ -439,6 +439,7 @@
"top": "border/top.svg",
"all":"border/all.svg",
"error":"tip/error.svg",
"waiting":"tip/waiting.svg",
"information":"tip/information.svg",
"new_information":"tip/new_information.svg",
"success":"tip/success.svg",
@ -448,7 +449,9 @@
"layout_left": "layout/layout_left.svg",
"layout_right": "layout/layout_right.svg",
"layout_top_right": "layout/layout_top_right.svg",
"theme_edit": "theme_edit.svg"
"theme_edit": "theme_edit.svg",
"folder_half_authority" : "filetree/folder_half_authority.svg",
"folder_half_authority_open" : "filetree/folder_half_authority_open.svg"
}
}

1
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties

@ -450,6 +450,7 @@ List.showCellFocusIndicator = false
List.cellRender.background = #FFF
List.cellRender.button.width = 28
List.cellRender.button.height = 24
List.cellRender.height = 24
List.wrapper.text.fontColor = #0a1c3877
#---- Menu ----

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

@ -1,5 +1,5 @@
# \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=360*160
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=360*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=325*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=360*280

2
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java

@ -74,7 +74,7 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
this.add(column(20,
cell(FineUIUtils.wrapComponentWithTitle(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyper_Related_Float"))),
cell(FineUIUtils.wrapComponentWithTitle(parameterViewPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyper_Related_Float"))).weight(1)
cell(FineUIUtils.wrapComponentWithTitle(parameterViewPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"))).weight(1)
).getComponent());
}

17
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java

@ -1,17 +1,16 @@
package com.fr.van.chart.bubble;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.van.chart.bubble.component.VanChartBubblePane;
import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.series.VanChartColorValueSeriesPane;
import com.fr.van.chart.designer.style.series.VanChartStackedAndAxisListControlPane;
@ -31,12 +30,6 @@ public class VanChartBubbleSeriesPane extends VanChartColorValueSeriesPane {
}
protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p, p, p};
double[] col = {f};
Component[][] components = new Component[][]{
new Component[]{createBubblePane()},
new Component[]{createStackedAndAxisPane()},
@ -47,7 +40,7 @@ public class VanChartBubbleSeriesPane extends VanChartColorValueSeriesPane {
components[2] = new Component[]{createLargeDataModelPane()};
}
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
contentPane = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
return contentPane;
}
@ -71,13 +64,13 @@ public class VanChartBubbleSeriesPane extends VanChartColorValueSeriesPane {
return Toolkit.i18nText("Fine-Design_Chart_Custom_Axis");
}
};
stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane);
stackAndAxisEditExpandablePane = new UIExpandablePane(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane);
return stackAndAxisEditExpandablePane;
}
private JPanel createBubblePane() {
bubblePane = new VanChartBubblePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Bubble"), bubblePane);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Bubble"), bubblePane, true);
}
protected void populateCondition(ConditionAttr defaultAttr) {

11
designer-chart/src/main/java/com/fr/van/chart/bubble/component/VanChartBubblePane.java

@ -1,12 +1,11 @@
package com.fr.van.chart.bubble.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
@ -39,17 +38,11 @@ public class VanChartBubblePane extends BasicBeanPane<VanChartAttrBubble> {
}
protected JPanel getContentPane () {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p, p};
double[] col = {p, f};
return TableLayoutHelper.createTableLayoutPane(getComponent(), row, col);
return FineLayoutBuilder.compatibleTableLayout(10, getComponent(), new double[]{1.2, 3});
}
protected Component[][] getComponent () {
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Min_Diameter")), minDiameter},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Diameter")), maxDiameter},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Shadow")), shadow},

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

@ -79,7 +79,7 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane {
isFixedWidth.addActionListener(e -> checkColumnWidth());
isFillWithImage.addActionListener(e -> checkImagePane());
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image"), borderPane);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image"), borderPane, true);
}
private void checkAll() {

41
designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java

@ -1,29 +1,26 @@
package com.fr.van.chart.column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.data.condition.AbstractCondition;
import com.fr.data.condition.ListCondition;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.LiteConditionPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.plugin.chart.base.AttrSeriesStackAndAxis;
import com.fr.van.chart.designer.style.series.VanChartSeriesConditionPane;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.ScrollPaneConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* 堆积和坐标轴设置
*/
@ -42,36 +39,26 @@ public class VanChartCustomStackAndAxisConditionPane extends BasicBeanPane<Condi
}
private void doLayoutPane() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
this.removeAll();
//配置界面
JPanel deployPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
deployPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Deploy") + ":", null));
deployPane.add(createDeployPane());
UIScrollPane scrollPane = new UIScrollPane(deployPane);
scrollPane.setBorder(BorderFactory.createEmptyBorder());
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
this.add(scrollPane);
Component deployPane = FineUIUtils.wrapComponentWithTitle(createDeployPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Deploy"));
this.add(deployPane, BorderLayout.NORTH);
//条件界面
JPanel conditionPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(conditionPane);
conditionPane.setBorder(BorderFactory.createEmptyBorder());
JPanel conditionPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
conditionPane.add(liteConditionPane = new VanChartSeriesConditionPane());
liteConditionPane.setPreferredSize(new Dimension(300, 300));
this.add(conditionPane, BorderLayout.CENTER);
this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
}
private JPanel createDeployPane() {
isStacked = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_YES"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_NO")});
isPercentStacked = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_YES"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_NO")});
double p = TableLayout.PREFERRED;
double[] columnSize = {p, p};
double[] rowSize = {p, p, p, p};
return TableLayoutHelper.createTableLayoutPane(getDeployComponents(), rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, getDeployComponents(), new double[]{1.2, 3});
}
protected Component[][] getDeployComponents() {

14
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartAreaSeriesFillColorPane.java

@ -1,14 +1,14 @@
package com.fr.van.chart.designer.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.base.AttrAreaSeriesFillColorBackground;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.background.VanChartMarkerBackgroundPane;
import javax.swing.JPanel;
@ -24,14 +24,9 @@ public class VanChartAreaSeriesFillColorPane extends BasicPane {
private UINumberDragPane transparent;
public VanChartAreaSeriesFillColorPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p};
double[] col = {f};
fillColorPane = new VanChartMarkerBackgroundPane(){
protected Component[][] getPaneComponents() {
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fill_Color")), typeComboBox},
new Component[]{null, centerPane},
};
@ -39,9 +34,10 @@ public class VanChartAreaSeriesFillColorPane extends BasicPane {
};
transparent = new UINumberDragPaneWithPercent(0, 100);
JPanel transparentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha"), transparent);
JPanel transparentPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent);
this.setLayout(new BorderLayout());
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
this.add(fillColorPane, BorderLayout.NORTH);
this.add(transparentPane, BorderLayout.CENTER);
}

21
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -38,7 +38,6 @@ import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.axis.component.VanChartCategoryStylePaneWithCheckBox;
@ -372,19 +371,15 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
maxProportion = new UINumberDragPaneWithPercent(0, 100, 1);
axisLimitSize = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Limit"), Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), axisLimitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
JPanel limitSizePane = FineLayoutBuilder.createHorizontalLayout(10, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Size")), axisLimitSize);
maxProportionPane = FineLayoutBuilder.createHorizontalLayout(10, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Max_Proportion")), maxProportion);
JPanel panel = column(10,
cell(limitSizePane), cell(maxProportionPane)
).getComponent();
axisLimitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
axisLimitSize.addActionListener(e -> checkMaxProPortionUse());
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel, true);

3
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java

@ -10,6 +10,7 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.VanChartAttrHelper;
@ -56,7 +57,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane<VanChartAxisPlot> {
public VanChartAxisButtonPane(VanChartAxisPane vanChartAxisPane) {
this.parent = vanChartAxisPane;
this.setLayout(new BorderLayout());
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(10, 0));
addButton = new AddButton(new LazyIcon("add_popup"));
JPanel eastPane = new JPanel(new BorderLayout());

39
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java

@ -1,5 +1,8 @@
package com.fr.van.chart.designer.style.background;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
import com.fr.chart.base.AttrColor;
@ -14,12 +17,8 @@ import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.gui.style.FRFontPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.general.GeneralUtils;
import com.fr.plugin.chart.VanChartAttrHelper;
@ -29,10 +28,10 @@ import com.fr.stable.Constants;
import com.fr.stable.StableUtils;
import com.fr.van.chart.designer.component.LineTypeComboBox;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
@ -108,26 +107,24 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
private void doLayoutPane() {
this.removeAll();
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setLayout(new BorderLayout());
Column column = new Column();
column.setSpacing(10);
this.add(column, BorderLayout.CENTER);
//警戒线设置
JPanel top = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(top);
top.setBorder(GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Chart_Alert_Set") + ":", null));
top.add(createTopPane());
Component top = FineUIUtils.wrapComponentWithTitle(createTopPane(), Toolkit.i18nText("Fine-Design_Chart_Alert_Set"));
column.add(top);
//提示文字
JPanel bottom = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(bottom);
bottom.setBorder(GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Chart_Alert_Text") + ":", null));
bottom.add(createBottomPane());
Component bottom = FineUIUtils.wrapComponentWithTitle(createBottomPane(), Toolkit.i18nText("Fine-Design_Chart_Alert_Text"));
column.add(bottom);
}
protected JPanel createTopPane() {
double p = TableLayout.PREFERRED;
double[] columnSize = {p, p};
double[] rowSize = {p, p, p, p, p};
Component[][] components = getTopPaneComponents();
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
protected Component[][] getTopPaneComponents() {
@ -141,10 +138,6 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
}
private JPanel createBottomPane() {
alertTextPosition.setSelectedIndex(0);
double p = TableLayout.PREFERRED;
double[] columnSize = {p, p};
double[] rowSize = {p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), alertTextPosition},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Content")), alertText},
@ -153,7 +146,7 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), fontColor},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
private void checkPositionPane() {

9
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java

@ -1,12 +1,14 @@
package com.fr.van.chart.designer.style.background;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.van.chart.designer.AbstractVanChartScrollPane;
@ -15,7 +17,6 @@ import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWith
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
import com.fr.van.chart.designer.style.background.radar.VanChartRadarAxisAreaPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
@ -44,7 +45,7 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
@Override
protected JPanel createContentPane() {
contentPane = new JPanel(new BorderLayout());
contentPane = new JPanel(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
chartBorderPane = new VanChartBorderWithRadiusPane();
if(isPlot) {
chartBackgroundPane = new VanChartBackgroundPane();
@ -61,7 +62,6 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
if (!isPlot) {
tooltipLabel = new UILabel("<html>" + Toolkit.i18nText("Fine-Design_Chart_Background_Tooltip") + "</html>");
tooltipLabel.setForeground(Color.gray);
tooltipLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 5, 10));
contentPane.add(tooltipLabel, BorderLayout.NORTH);
tooltipLabel.setVisible(false);
}
@ -87,7 +87,8 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
};
}
JPanel panel = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
panel.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
contentPane.add(panel, BorderLayout.CENTER);
parent.initAllListeners();

3
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java

@ -8,6 +8,7 @@ import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.gui.style.ColorSelectBoxWithThemeStyle;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.ComparatorUtils;
@ -154,7 +155,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
checkCardPane();
}
});
JPanel intervalPane = new JPanel(new BorderLayout(0, 6));
JPanel intervalPane = new JPanel(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
JPanel panel1 = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Interval_Background")), isDefaultIntervalBackground);
intervalPane.add(panel1, BorderLayout.NORTH);

29
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java

@ -1,5 +1,7 @@
package com.fr.van.chart.designer.style.background;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
import com.fr.design.beans.BasicBeanPane;
@ -9,19 +11,14 @@ import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.axis.VanChartCustomIntervalBackground;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
/**
* 自定义间隔背景设置
@ -38,25 +35,17 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
private VanChartCustomIntervalBackground customIntervalBackground;
private void doLayoutPane(){
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
//
JPanel top = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.setLayout(new BorderLayout());
this.removeAll();
this.add(top);
top.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Interval_Background") + ":", null));
top.add(createContentPane());
this.add(FineUIUtils.wrapComponentWithTitle(createContentPane(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Interval_Background")), BorderLayout.CENTER);
}
private JPanel createContentPane() {
bottomValue = new DefaultTinyFormulaPane();
topValue = new DefaultTinyFormulaPane();
bottomValue.setPreferredSize(new Dimension(124,20));
topValue.setPreferredSize(new Dimension(124,20));
color = new ColorSelectBox(100);
transparent = new UINumberDragPaneWithPercent(0,100);
double p = TableLayout.PREFERRED;
double[] columnSize = {p,p};
double[] rowSize = {p,p,p};
JPanel axisPane = TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), backgroundAxis);
@ -64,19 +53,19 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Bottom_Value")),bottomValue},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Top_Value")),topValue},
};
JPanel temp = TableLayoutHelper.createTableLayoutPane(rangeComponents, rowSize, columnSize);
JPanel temp = FineLayoutBuilder.compatibleTableLayout(10, rangeComponents, new double[]{1.2, 3});
JPanel rangePane = TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Range"), temp);
Component[][] styleComponents = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),color},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")),transparent},
};
temp = TableLayoutHelper.createTableLayoutPane(styleComponents, rowSize, columnSize);
temp = FineLayoutBuilder.compatibleTableLayout(10, styleComponents, new double[]{1.2, 3});
JPanel stylePane = TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Name"), temp);
Component[][] components = getPaneComponents(axisPane, rangePane, stylePane);
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
protected Component[][] getPaneComponents(JPanel axisPane, JPanel rangePane, JPanel stylePane) {

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java

@ -152,7 +152,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//趋势线
protected JPanel createTrendLinePane() {
trendLinePane = new VanChartTrendLinePane();
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_TrendLine"), trendLinePane, true);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_TrendLine"), trendLinePane);
}
//线
@ -181,7 +181,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
protected JPanel createBorderPane() {
borderPane = createDiffBorderPane();
borderPane.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane, true);
}

21
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java

@ -2,12 +2,12 @@ package com.fr.van.chart.drillmap.designer.data.comp;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.drillmap.DrillMapHelper;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
@ -15,10 +15,8 @@ import com.fr.plugin.chart.map.data.MapMatchResult;
import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper;
import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.type.ZoomLevel;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.map.designer.type.MapStatusPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.tree.DefaultMutableTreeNode;
import java.util.ArrayList;
@ -66,7 +64,9 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
}
JPanel mapDataTreePanel = new JPanel(new BorderLayout());
mapDataTreePanel.add(mapDataTree);
UIScrollPane treeScrollPane = new UIScrollPane(mapDataTree);
treeScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
mapDataTreePanel.add(treeScrollPane, BorderLayout.CENTER);
Component[][] components = new Component[][]{
new Component[]{new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Tree"), mapDataTreePanel, true)},
@ -78,28 +78,23 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
}
private JPanel createLayerDetailPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, p, p};
double[] rowSize = new double[depth + 1];
detailComps = new Component[depth + 1][3];
rowSize[0] = p;
detailComps[0] = new Component[]{
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Descriptor")),
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Zoom_Layer")),
null,
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Map_Type"))
};
for (int i = 0; i < depth; i++) {
rowSize[i + 1] = p;
int d = i + 1;
UILabel label = new UILabel(String.format("%s%d%s", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Index_Article"), d, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Index_Layer")));
UIComboBox level = new UIComboBox(MapStatusPane.ZOOM_LEVELS);
level.setEnabled(i != 0);
UIComboBox type = new UIComboBox(TEMP.get(oldMapType));
detailComps[i + 1] = new Component[]{label, level, type};
detailComps[i + 1] = new Component[]{label, level, null, type};
}
return TableLayoutHelper.createGapTableLayoutPane(detailComps, rowSize, columnSize, 5, 6);
return FineLayoutBuilder.compatibleTableLayout(10, detailComps, new double[]{1.2, 1.4, 0.2, 1.4});
}
/**

2
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java

@ -1,7 +1,6 @@
package com.fr.van.chart.drillmap.designer.data.comp;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.border.FineBorderFactory;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
@ -35,7 +34,6 @@ public class MapDataTree extends JTree {
this.setShowsRootHandles(true);
this.setInvokesStopCellEditing(true);
this.setCellRenderer(treeCellRenderer);
setBorder(FineBorderFactory.createWrappedRoundBorder());
setStyle(this, PURE_TREE);
}

21
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelSeriesPane.java

@ -1,15 +1,14 @@
package com.fr.van.chart.funnel.designer.style;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.funnel.FunnelSortType;
import com.fr.plugin.chart.funnel.VanChartFunnelPlot;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import javax.swing.JPanel;
@ -27,16 +26,12 @@ public class VanChartFunnelSeriesPane extends VanChartAbstractPlotSeriesPane {
}
protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p,p,p,p,p,p,p,p,p,p};
Component[][] components = new Component[][]{
new Component[]{createFunnelStylePane()},
new Component[]{createBorderPane()},
};
contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
contentPane = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
return contentPane;
}
@ -57,20 +52,14 @@ public class VanChartFunnelSeriesPane extends VanChartAbstractPlotSeriesPane {
Toolkit.i18nText("Fine-Design_Chart_Origin_Sort")
});
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p,p,p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Continuity")), useSameSlantAngle},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Sort")), sort},
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Style_Name"), panel);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Style_Name"), panel, true);
}
public void populateBean(Plot plot) {

3
designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java

@ -11,6 +11,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
@ -273,7 +274,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
//获取颜色面板
private JPanel getColorPane(MapType paneType) {
JPanel panel = new JPanel(new BorderLayout());
JPanel panel = new JPanel(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
stylePane = createStylePane();
mapType = ((VanChartMapPlot) plot).getAllLayersMapType();
if (mapType != MapType.CUSTOM && mapType != MapType.DRILL_CUSTOM) {

14
designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java

@ -1,10 +1,11 @@
package com.fr.van.chart.map.designer.style.label;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.jxbrowser.JxUIPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat;
import com.fr.plugin.chart.base.format.AttrTooltipFormat;
@ -13,7 +14,6 @@ import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat;
import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat;
import com.fr.plugin.chart.base.format.AttrTooltipValueFormat;
import com.fr.plugin.chart.type.TextAlign;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartLabelContentPane;
import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox;
@ -67,18 +67,12 @@ public class VanChartMapLabelContentPane extends VanChartLabelContentPane {
protected JPanel getLabelContentPane(JPanel contentPane) {
showAllSeries = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Show_All_Series"));
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double p = TableLayout.PREFERRED;
double[] row = {p, p};
Component[][] components = {
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy")), showAllSeries}
};
checkPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize);
checkPane = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3});
JPanel panel = new JPanel(new BorderLayout());
JPanel panel = new JPanel(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
panel.add(contentPane, BorderLayout.CENTER);
panel.add(checkPane, BorderLayout.SOUTH);
return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Content"), panel);

17
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java

@ -1,6 +1,7 @@
package com.fr.van.chart.map.designer.type;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -9,11 +10,10 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.base.GisLayer;
import com.fr.plugin.chart.map.layer.WMSLayer;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
@ -55,24 +55,19 @@ public class WMSLayerPane extends JPanel implements UIObserver {
public WMSLayerPane() {
final double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, 84, 44};
wmsUrl = new UITextArea();
connectButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Connect_WMP"));
Component[][] comps = new Component[][]{
new Component[]{new UILabel("url"), wmsUrl, connectButton}
new Component[]{new UILabel("url"), wmsUrl, null, connectButton}
};
JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, COLUMN_SIZE);
northPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER);
JPanel northPane = FineLayoutBuilder.compatibleTableLayout(10, comps, new double[]{1.2, 1.4, 0.2, 1.4});
wmsLayerPane = new JPanel(new BorderLayout());
resetWMSLayerPane(new ArrayList<>());
this.setLayout(new BorderLayout(0, 6));
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
this.add(northPane, BorderLayout.NORTH);
this.add(wmsLayerPane, BorderLayout.CENTER);
addListener();
@ -136,7 +131,7 @@ public class WMSLayerPane extends JPanel implements UIObserver {
wmsLayerCheckBoxs.add(checkBox);
}
wmsLayerPane.add(TableLayoutHelper.createCommonTableLayoutPane(comps, rowSize, COLUMN_SIZE, 0), BorderLayout.CENTER);
wmsLayerPane.add(FineLayoutBuilder.compatibleTableLayout(10, comps, new double[]{1.2, 3}), BorderLayout.CENTER);
updateUI();
}

11
designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieSeriesPane.java

@ -1,15 +1,15 @@
package com.fr.van.chart.multilayer.style;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartBeautyPane;
import com.fr.van.chart.pie.VanChartPieSeriesPane;
@ -39,7 +39,7 @@ public class VanChartMultiPieSeriesPane extends VanChartPieSeriesPane {
new Component[]{createBorderPane()},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
}
protected JPanel createSeriesStylePane(double[] row, double[] col) {
@ -54,7 +54,6 @@ public class VanChartMultiPieSeriesPane extends VanChartPieSeriesPane {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
Component[][] components = new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gradual_Level") ),gradualLevel},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Angle") ),startAngle},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Angle")),endAngle},
@ -63,8 +62,8 @@ public class VanChartMultiPieSeriesPane extends VanChartPieSeriesPane {
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Rotation")),supportRotation}
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel, true);
}
protected void populatePieAttr() {

7
designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java

@ -1,6 +1,7 @@
package com.fr.van.chart.pie;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.UINumberDragPane;
@ -9,7 +10,6 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.i18n.Toolkit;
@ -48,7 +48,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
new Component[]{createBorderPane()},
};
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
}
@ -60,7 +60,6 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
Component[][] components = new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Start_Angle")),startAngle},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_End_Angle")),endAngle},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Inner_Radius")),innerRadius},
@ -69,7 +68,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel, true);
}

17
designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarSeriesPane.java

@ -1,15 +1,15 @@
package com.fr.van.chart.radar;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.radar.VanChartRadarPlot;
import com.fr.plugin.chart.type.RadarType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartLineTypePane;
import com.fr.van.chart.designer.component.VanChartLineWidthPane;
import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
@ -32,12 +32,8 @@ public class VanChartRadarSeriesPane extends VanChartAbstractPlotSeriesPane {
}
protected JPanel getContentInPlotType(){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p,p,p,p,p};
double[] col = {f};
contentPane = TableLayoutHelper.createTableLayoutPane(getPaneComponents(), row, col);
contentPane = FineLayoutBuilder.compatibleTableLayout(10, getPaneComponents(), new double[]{1});
return contentPane;
}
@ -67,8 +63,9 @@ public class VanChartRadarSeriesPane extends VanChartAbstractPlotSeriesPane {
private JPanel createRadarTypePane() {
radarType = new UIButtonGroup<String>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Circle"), Toolkit.i18nText("Fine-Design_Chart_Polygonal")},
new String[]{RadarType.CIRCLE.getType(), RadarType.POLYGON.getType()});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Shape"), radarType);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Style_Present"), panel);
JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shape")), radarType);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Style_Present"), panel, true);
}
protected VanChartLineTypePane getLineTypePane() {

11
designer-chart/src/main/java/com/fr/van/chart/range/component/GradualIntervalConfigPane.java

@ -1,11 +1,10 @@
package com.fr.van.chart.range.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent;
import com.fr.plugin.chart.range.GradualIntervalConfig;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.axis.component.MinMaxValuePaneWithOutTick;
import javax.swing.JPanel;
@ -51,16 +50,10 @@ public class GradualIntervalConfigPane extends JPanel {
legendGradientBar = createLegendGradientBar();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] col = new double[]{f, e};
double[] row = new double[]{p, p, p, p};
Component[][] components = getPaneComponents(minMaxValuePane, colorSelectBox, numberDragPane, legendGradientBar);
//控件承载面板
JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
this.setLayout(new BorderLayout());
this.add(contentPane, BorderLayout.CENTER);
}

15
designer-chart/src/main/java/com/fr/van/chart/range/component/LegendLabelFormatPane.java

@ -1,12 +1,12 @@
package com.fr.van.chart.range.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.base.LegendLabelFormat;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.style.FormatPane;
import com.fr.design.layout.TableLayout;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPaneWithOutWidthAndHeight;
import com.fr.van.chart.designer.component.format.FormatPaneWithOutFont;
import com.fr.van.chart.designer.style.VanChartStylePane;
@ -47,7 +47,6 @@ public class LegendLabelFormatPane extends JPanel {
}
};
htmlLabelPane = new VanChartHtmlLabelPaneWithOutWidthAndHeight();
htmlLabelPane.setBorder(BorderFactory.createEmptyBorder(0, (int) TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL, 0, 0));
centerPane = new JPanel(new CardLayout()) {
@Override
@ -63,17 +62,11 @@ public class LegendLabelFormatPane extends JPanel {
centerPane.add(htmlLabelPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom"));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Format"), SwingConstants.LEFT), labelFormatStyle},
new Component[]{centerPane, null},
};
JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
labelFormatStyle.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -82,7 +75,7 @@ public class LegendLabelFormatPane extends JPanel {
});
labelFormatStyle.setSelectedIndex(0);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Format"), contentPane);
JPanel panel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Format"), contentPane, true);
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
}

9
designer-chart/src/main/java/com/fr/van/chart/treemap/style/VanChartTreeMapSeriesPane.java

@ -1,11 +1,13 @@
package com.fr.van.chart.treemap.style;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.treemap.VanChartTreeMapPlot;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.multilayer.style.VanChartMultiPieSeriesPane;
import javax.swing.JPanel;
@ -22,8 +24,9 @@ public class VanChartTreeMapSeriesPane extends VanChartMultiPieSeriesPane {
protected JPanel createSeriesStylePane(double[] row, double[] col) {
supportDrill = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Drill"), supportDrill);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel);
JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Drill")), supportDrill);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel, true);
}
protected void populatePieAttr() {

4
designer-realize/src/main/java/com/fanruan/data/ConnectionConfigWrapper.java

@ -7,6 +7,8 @@ import com.fr.file.ConnectionConfig;
import com.fr.log.FineLoggerFactory;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerAdaptor;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -106,7 +108,7 @@ public class ConnectionConfigWrapper implements ConnectionConfigProvider, Connec
@Override
public @Nullable Connection getConnection(@NotNull String connectionName) {
Connection connection = ConnectionConfig.getInstance().getConnection(connectionName);
Connection connection = WorkContext.getCurrent().isLocal() ? ConnectionConfig.getInstance().getConnection(connectionName) : ConnectionRepository.getInstance().getByName(connectionName).getConnection();
if (connection != null) {
connection.setConnectionName(connectionName);
}

8
designer-realize/src/main/java/com/fanruan/fs/DesignFileRepository.java

@ -7,6 +7,9 @@ import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.server.entity.resource.ResourceBean;
import com.fr.workspace.server.repository.resource.PublicResourceRepository;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
/**
* DesignFileRepository
@ -31,4 +34,9 @@ public class DesignFileRepository extends LocalFileRepository {
public FineFileEntry[] listEntry(String dir) {
return PublicResourceRepository.getInstance().listEntry(new ResourceBean(dir));
}
@Override
public InputStream openStream(String path) {
return new ByteArrayInputStream(PublicResourceRepository.getInstance().openStream(path));
}
}

10
designer-realize/src/main/java/com/fr/design/cell/editor/BiasTextPainterCellEditor.java

@ -4,8 +4,8 @@
package com.fr.design.cell.editor;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIRadioButton;
@ -84,7 +84,7 @@ public class BiasTextPainterCellEditor extends AbstractCellEditor {
Window parentWindow = SwingUtilities.getWindowAncestor(grid);
this.biasTextPainterPane = new BiasTextPainterPane();
Dimension wrapDimension = FineUIScale.scale(new Dimension(360, 172));
Dimension wrapDimension = FineUIScale.scale(new Dimension(360, 212));
this.biasTextPainterPane.populate(biasTextPainter);
return this.biasTextPainterPane.showWindowWithCustomSize(parentWindow, new DialogActionAdapter() {
@ -113,7 +113,7 @@ public class BiasTextPainterCellEditor extends AbstractCellEditor {
formulaTextArea = new UITextArea();
JScrollPane scrollPane = new JScrollPane(formulaTextArea);
scrollPane.setBorder(new FineRoundBorder());
scrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
formulaTextArea.setBorder(null);
String leftToLowerText = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Slope_Line_Upper_Left_To_Lower_Right");
@ -130,8 +130,8 @@ public class BiasTextPainterCellEditor extends AbstractCellEditor {
group.add(choice2);
add(Layouts.column(10,
Layouts.cell(formulaLabel).weight(0.1), Layouts.cell(scrollPane).weight(0.12),
Layouts.row(5, Layouts.cell(choice1).weight(1), Layouts.cell(choice2).weight(1)).weight(0.12)).getComponent());
Layouts.cell(formulaLabel), Layouts.cell(scrollPane).weight(1),
Layouts.row(5, Layouts.cell(choice1).weight(1), Layouts.cell(choice2).weight(1))).getComponent());
}
@Override

Loading…
Cancel
Save