Browse Source

Merge pull request #15124 in DESIGN/design from fbp/release to fbp/master

* commit '05c4d0a98077be88529cc0d558579eab57183360': (25 commits)
  REPORT-137543 【fr-fbp冒烟】【数据源】设计器数据连接 重命名判断异常
  修改注释
  REPORT-137695【fr-fbp回归】填报入库设置智能设置单元格组交互效果不对
  REPORT-137586 fix: 控件背景交互逻辑修复
  REPORT-137786 fix: comboBox提供最大尺寸及下拉框大小计算逻辑优化
  REPORT-135889 fix: 去除西区折叠面板点击事件
  REPORT-137712 fix: 控件对齐面板翻新
  REPORT-137896 fix:checkBoxList边框问题修复
  REPORT-137930【fr-fbp回归】填报属性中,未修改不更新的设置项效果不对
  REPORT-137698 fix修复数据字典数据查询无法展开数据列选择问题
  REPORT-137781 设计器设置文件数据集选择文件npe
  REPORT-137781 设计器设置文件数据集选择文件npe
  控件显示增强不透明度组件替换
  REPORT-137866 【fr-fbp冒烟】【数据源】数据连接-ssh设置-公钥认证,读不到私钥文件
  REPORT-137327 - 远程设计下切换目录卡顿优化 自动启动
  无jira任务 增加复用性
  无jira任务 优化使用
  REPORT-137327 - 远程设计下切换目录卡顿优化 修改缓存机制
  Revert "REPORT-135888 fix:高分屏启动页缩放适配"
  REPORT-137327 - 远程设计下切换目录卡顿优化
  ...
fbp/master
superman 1 month ago
parent
commit
20d54e7e80
  1. 50
      designer-base/src/main/java/com/fine/theme/light/ui/FineComboBoxUI.java
  2. 2
      designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java
  3. 62
      designer-base/src/main/java/com/fr/design/cache/DesignCacheManager.java
  4. 9
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  5. 28
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java
  6. 1
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  7. 9
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  8. 1
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  9. 27
      designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java
  10. 2
      designer-base/src/main/java/com/fr/design/data/datapane/connect/SshPane.java
  11. 5
      designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java
  12. 3
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  13. 15
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  14. 7
      designer-base/src/main/java/com/fr/design/gui/ilist/CheckBoxList.java
  15. 8
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java
  16. 3
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBackgroundEditor.java
  17. 52
      designer-base/src/main/java/com/fr/design/remote/ui/debug/HeaderRenderer.java
  18. 6
      designer-base/src/main/java/com/fr/design/remote/ui/debug/RemoteDesignNetWorkAction.java
  19. 5
      designer-base/src/main/java/com/fr/design/remote/ui/debug/RemoteDesignNetWorkHelper.java
  20. 5
      designer-base/src/main/java/com/fr/design/remote/ui/debug/RemoteDesignNetWorkTablePane.java
  21. 1
      designer-base/src/main/java/com/fr/design/remote/ui/debug/RemoteDesignNetWorkTableRowSorter.java
  22. 37
      designer-base/src/main/java/com/fr/design/remote/ui/debug/SizeColorCellRenderer.java
  23. 38
      designer-base/src/main/java/com/fr/design/remote/ui/debug/TimeColorCellRenderer.java
  24. 1
      designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java
  25. 2
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java
  26. 17
      designer-base/src/main/java/com/fr/design/widget/IconDefinePane.java
  27. 10
      designer-base/src/main/java/com/fr/design/widget/component/BackgroundCompPane.java
  28. 4
      designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java
  29. 6
      designer-base/src/main/java/com/fr/file/FileDataFILE.java
  30. 5
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java
  31. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_bottom_align.svg
  32. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_bottom_align_disable.svg
  33. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_center.svg
  34. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_center_disable.svg
  35. 8
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_distribute.svg
  36. 5
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_distribute_disable.svg
  37. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_left_align.svg
  38. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_left_align_disable.svg
  39. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_right_align.svg
  40. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_right_align_disable.svg
  41. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_top_align.svg
  42. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_top_align_disable.svg
  43. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_center.svg
  44. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_center_disable.svg
  45. 8
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_distribute.svg
  46. 5
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_distribute_disable.svg
  47. 11
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  48. 1
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  49. 18
      designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java
  50. 19
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java
  51. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java
  52. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java
  53. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java
  54. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java
  55. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java
  56. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java
  57. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java
  58. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java
  59. 97
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java
  60. 1
      designer-realize/src/main/java/com/fanruan/boot/env/DesignFunctionComponent.java
  61. 34
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignAnalyzerComponent.java
  62. 5
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignDatasourceComponent.java
  63. 3
      designer-realize/src/main/java/com/fanruan/boot/env/function/app/DesignAppComponent.java
  64. 13
      designer-realize/src/main/java/com/fanruan/boot/pre/DesignPreStartComponent.java
  65. 3
      designer-realize/src/main/java/com/fr/design/actions/file/newReport/NewWorkBookAction.java
  66. 2
      designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java
  67. 31
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarButton.java
  68. 2
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarPane.java
  69. 25
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

50
designer-base/src/main/java/com/fine/theme/light/ui/FineComboBoxUI.java

@ -2,16 +2,21 @@ package com.fine.theme.light.ui;
import com.fine.theme.utils.FineClientProperties;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatComboBoxUI;
import com.formdev.flatlaf.ui.FlatUIUtils;
import org.jetbrains.annotations.Nullable;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingConstants;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Rectangle;
/**
* 提供 {@link javax.swing.JComboBox} 的UI类
@ -47,8 +52,10 @@ public class FineComboBoxUI extends FlatComboBoxUI {
@Override
public Dimension getMinimumSize(JComponent c) {
// ComboBox基于子组件计算适配尺寸性能一般,仅考虑部分ComboBox进行适配计算,其他采用默认值
if (FineClientProperties.ADAPTIVE_COMBO_BOX.equals(getComboBoxTypeStr(c))) {
return super.getMinimumSize(c);
if (isAdaptiveComboBox(c)) {
Dimension dimension = super.getMinimumSize(c);
return new Dimension(Math.min(dimension.width,
FineUIUtils.getAndScaleInt("ComboBox.maximumWidth", 400)), dimension.height);
}
return FineUIScale.scale(new Dimension(
FlatUIUtils.getUIInt("ComboBox.minimumWidth", 72),
@ -56,12 +63,41 @@ public class FineComboBoxUI extends FlatComboBoxUI {
));
}
@Nullable
static String getComboBoxTypeStr(JComponent c) {
static boolean isAdaptiveComboBox(JComponent c) {
Object value = c.getClientProperty(FineClientProperties.COMBO_BOX_TYPE);
if (value instanceof String) {
return (String) value;
return FineClientProperties.ADAPTIVE_COMBO_BOX.equals(value);
}
return false;
}
@Override
protected ComboPopup createPopup() {
return new FineComboPopup(this.comboBox);
}
protected class FineComboPopup extends FlatComboPopup {
protected FineComboPopup(JComboBox combo) {
super(combo);
}
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
Rectangle fitRectangle = super.computePopupBounds(px, py, pw, ph);
// 限制最大宽度,如超出则高度预留展示横向滚动条所需宽度
int comboWidth = comboBox.getWidth();
if (fitRectangle.width > comboWidth) {
return new Rectangle(px, py, comboWidth, fitRectangle.height + FlatUIUtils.getUIInt("ScrollBar.width", 10));
}
return fitRectangle;
}
@Override
protected JScrollPane createScroller() {
return new JScrollPane( list,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
}
return null;
}
}

2
designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java

@ -101,9 +101,9 @@ public class FineTableHeaderUI extends FlatTableHeaderUI {
selectionBackground = UIManager.getColor("Table.background");
}
setBackground(selectionBackground);
setText(value == null ? StringUtils.BLANK : String.valueOf(value));
setToolTipText(table, value, column);
setBorder(border);
setValue(value);
return this;
}

62
designer-base/src/main/java/com/fr/design/cache/DesignCacheManager.java vendored

@ -1,62 +0,0 @@
package com.fr.design.cache;
import com.fr.base.TableData;
import com.fr.design.data.tabledata.wrapper.TableDataFactory;
import java.util.Map;
/**
* 设计器缓存管理
*
* @author Destiny.Lin
* @since 11.0
* Created on 2024/8/11
*/
public class DesignCacheManager {
public static ThreadLocal<Map<String, TableData>> cacheTableData = new ThreadLocal<>();
/**
* 处理任务使用数据集缓存
*/
public static void processByCacheTableData(Task task) {
try {
cacheTableData.set(TableDataFactory.getTableDatas());
task.process();
} finally {
cacheTableData.remove();
}
}
/**
* 是否使用数据集的缓存
*/
public static boolean useDataCache() {
return cacheTableData.get() != null;
}
/**
* 获取数据集缓存
*/
public static ThreadLocal<Map<String, TableData>> getCacheTableData() {
return cacheTableData;
}
/**
* 设置数据集缓存
*/
public static void setCacheTableData(ThreadLocal<Map<String, TableData>> cacheTableData) {
DesignCacheManager.cacheTableData = cacheTableData;
}
/**
* 任务
*/
public interface Task {
/**
* 处理
*/
void process();
}
}

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

@ -19,7 +19,6 @@ import com.fr.data.impl.storeproc.StoreProcedureConstants;
import com.fr.data.impl.storeproc.StoreProcedureHelper;
import com.fr.data.operator.DataOperator;
import com.fr.design.DesignModelAdapter;
import com.fr.design.cache.DesignCacheManager;
import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.data.tabledata.wrapper.MultiResultTableDataNameWrapper;
import com.fr.design.data.tabledata.wrapper.MultiResultTableDataWrapper;
@ -449,13 +448,7 @@ public abstract class DesignTableDataManager {
}
private static void addServerData(java.util.Map<String, TableDataWrapper> resMap) {
Map<String, TableData> tableDataMap;
if (DesignCacheManager.useDataCache()) {
FineLoggerFactory.getLogger().debug("use cache Table data wrapper.");
tableDataMap = DesignCacheManager.getCacheTableData().get();
} else {
tableDataMap = TableDataFactory.getTableDatas();
}
Map<String, TableData> tableDataMap = TableDataFactory.getTableDatas();
for (Entry<String, TableData> entry : tableDataMap.entrySet()) {
if (globalDsCache.containsKey(entry.getKey())) {
resMap.put(entry.getKey(), globalDsCache.get(entry.getKey()));

28
designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java

@ -1,6 +1,8 @@
package com.fr.design.data.datapane;
import com.fr.design.constants.UIConstants;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.util.Iterator;
import java.util.Map.Entry;
@ -23,7 +25,7 @@ import com.fr.stable.StringUtils;
/**
* 包含所有数据集的下拉框
*
*
* @author zhou
* @since 2012-4-20上午10:34:30
*/
@ -43,22 +45,29 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC
this.treeName = treeName;
this.setRenderer(new UIComboBoxRenderer() {
private static final long serialVersionUID = 1L;
private boolean labelVisible = true;
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
JLabel renderer = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (index == -1 && value == null) {
// 显示空白
if (value instanceof TableDataWrapper) {
labelVisible = true;
TableDataWrapper tableDataWrapper = (TableDataWrapper)value;
renderer.setIcon(tableDataWrapper.getIcon());
renderer.setText(tableDataWrapper.getTableDataName());
renderer.setToolTipText(tableDataWrapper.getTableDataName());
} else {
labelVisible = false;
renderer.setIcon(null);
renderer.setText(StringUtils.EMPTY);
}else if (value instanceof TableDataWrapper) {
TableDataWrapper tabledatawrappe = (TableDataWrapper)value;
renderer.setIcon(tabledatawrappe.getIcon());
renderer.setText(tabledatawrappe.getTableDataName());
renderer.setToolTipText(tabledatawrappe.getTableDataName());
}
return renderer;
}
@Override
public Dimension getPreferredSize() {
return labelVisible ? super.getPreferredSize() : new Dimension(super.getPreferredSize().width, 0);
}
});
refresh(source);
registerDSChangeListener();
@ -75,6 +84,7 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC
setDsMap();
DefaultComboBoxModel model = new DefaultComboBoxModel();
this.setModel(model);
model.addElement(UIConstants.PENDING);
// 遍历添加所有数据项到模型
Iterator<Entry<String, TableDataWrapper>> entryIt = dsMap.entrySet().iterator();
while (entryIt.hasNext()) {
@ -83,8 +93,6 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC
model.addElement(tableDataWrapper);
}
}
// 设置默认选项为空白
this.setSelectedItem(null);
if (dataWrapper != null) {
if (DesignTableDataManager.isDsNameChanged(dataWrapper.getTableDataName())) {
this.setSelectedTableDataByName(DesignTableDataManager.getChangedDsNameByOldDsName(dataWrapper.getTableDataName()));

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

@ -336,6 +336,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
for (ServerDataSetBean bean : deleteDatas) {
TableDataRepository.getInstance().delete(bean);
}
TableDataRepository.getInstance().invalidCache();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}

9
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -12,7 +12,6 @@ import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.cache.DesignCacheManager;
import com.fr.design.data.BasicTableDataTreePane;
import com.fr.design.data.BasicTableDataUtils;
import com.fr.design.data.DesignTableDataManager;
@ -461,7 +460,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
if (!ComparatorUtils.equals(oldName, tdName)) {
map.put(oldName, tdName);
}
DesignCacheManager.processByCacheTableData(() -> fireDSChanged(map));
fireDSChanged(map);
tc.fireTargetModified();
tc.parameterChanged();
int[] rows = tableDataTree.getSelectionRows();
@ -1023,7 +1022,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
@Override
public void actionPerformed(ActionEvent e) {
DesignCacheManager.processByCacheTableData(() -> dgEdit(getTableDataInstance().creatTableDataPane(), createDsName(getNamePrefix()), false));
dgEdit(getTableDataInstance().creatTableDataPane(), createDsName(getNamePrefix()), false);
}
}
@ -1129,7 +1128,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
BasicDialog basicDialog = basicPane.showSmallWindow(SwingUtilities.getWindowAncestor(TableDataTreePane.this), new DialogActionAdapter() {
@Override
public void doOk() {
DesignCacheManager.processByCacheTableData(this::processRemove);
processRemove();
}
private void processRemove() {
@ -1203,7 +1202,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
@Override
public void actionPerformed(ActionEvent e) {
DesignCacheManager.processByCacheTableData(this::doPaste);
doPaste();
}
private void doPaste() {

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

@ -360,6 +360,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
if (!WorkContext.getCurrent().isLocal()) {
EventDispatcher.fire(RemoteConfigEvent.EDIT, "ConnectionConfig");
}
ConnectionRepository.getInstance().invalidCache();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
throw e;

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

@ -1,7 +1,10 @@
package com.fr.design.data.datapane.connect;
import com.fanruan.config.impl.data.ConnectionConfigProviderFactory;
import com.fanruan.datasource.driver.bean.DriverLoaderBean;
import com.fr.data.driver.DriverClassNotFoundException;
import com.fr.data.driver.DriverLoader;
import com.fr.data.driver.config.DriverLoaderConfig;
import com.fr.data.impl.Connection;
import com.fr.decision.webservice.bean.datasource.ConnectionInfoBean;
import com.fr.decision.webservice.exception.general.DriverNotFoundException;
@ -9,13 +12,15 @@ import com.fr.decision.webservice.v10.datasource.connection.processor.impl.Conne
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.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 本地Connection资源操作
@ -98,6 +103,26 @@ public class LocalConnectionSource extends BaseConnectionSource {
}
@Override
public Map<String, DriverLoaderBean> getDriverLoaders() throws Exception {
return DriverLoaderConfig.getInstance().getDriverLoaders().entrySet().stream()
.collect(Collectors.toMap(Map.Entry::getKey, entry -> convertDriverLoader(entry.getValue()), (a, b) -> a, LinkedHashMap::new));
}
private DriverLoaderBean convertDriverLoader(DriverLoader driverLoader) {
if (driverLoader == null) {
return null;
}
DriverLoaderBean driverLoaderBean = new DriverLoaderBean();
driverLoaderBean.setName(driverLoader.getName());
driverLoaderBean.setDriverClass(driverLoader.getDriverClass());
driverLoaderBean.setDriverList(driverLoader.getDriverList());
driverLoaderBean.setDriverJarFiles(driverLoader.getDriverJarFiles());
driverLoaderBean.setLoadingStrategy(driverLoader.getLoadingStrategy());
return driverLoaderBean;
}
@Override
public boolean lock(String str) {
// 本地默认锁定成功,让其执行后续动作

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

@ -97,7 +97,7 @@ public class SshPane extends BasicPane {
type.addActionListener(e -> changePaneForType());
fileChooserButton.addActionListener(e -> {
FILEChooserPane fileChooser = FILEChooserPane.getInstanceWithDesignatePath(SslUtils.PREFIX, new ChooseFileFilter(true), SslUtils.CERTIFICATES);
FILEChooserPane fileChooser = FILEChooserPane.getFileCAChoosePane(new ChooseFileFilter(true));
int type = fileChooser.showOpenDialog(SshPane.this, StringUtils.EMPTY);
if (type == FILEChooserPane.OK_OPTION) {
final FILE file = fileChooser.getSelectedFILE();

5
designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java

@ -13,7 +13,6 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.file.LocateAction;
import com.fr.design.actions.template.NewWorkBookToolButtonAction;
import com.fr.design.cache.DesignCacheManager;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.MenuHandler;
@ -837,13 +836,13 @@ public class MultiTemplateTabPane extends Row {
setIsCloseCurrent(true);
}
closeFormat(template);
DesignCacheManager.processByCacheTableData(() -> closeSpecifiedTemplate(template));
closeSpecifiedTemplate(template);
DesignerContext.getDesignerFrame().getContentFrame().repaint();
isShowList = false;
} else {
//没有点击关闭和ListDown按钮,则切换到点击的模板处
closeIconIndex = -1;
DesignCacheManager.processByCacheTableData(() -> switchJTemplate(getTemplateIndex(evtX)));
switchJTemplate(getTemplateIndex(evtX));
clodeIcon = new LazyIcon("clear");
switchJTemplate(getTemplateIndex(evtX));
isShowList = false;

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

@ -5,7 +5,6 @@ package com.fr.design.file;
import com.fanruan.repository.TemplateRepository;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.cache.DesignCacheManager;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.TemplateTreeDefineProcessor;
import com.fr.design.gui.itree.filetree.TemplateFileTree;
@ -105,7 +104,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
return;
}
if (evt.getClickCount() == 2) {
DesignCacheManager.processByCacheTableData(() -> openFile());
openFile();
}
}

15
designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -452,21 +452,6 @@ public class UIResizableContainer extends JPanel {
repaint();
}
@Override
public void mouseClicked(MouseEvent e) {
if (e.getY() <= ARROW_RANGE_VERTICAL) {
if (containerWidth == toolPaneHeight) {
containerWidth = preferredWidth;
} else {
setPreferredWidth(containerWidth);
containerWidth = toolPaneHeight;
}
refreshContainer();
if (DesignModeContext.isAuthorityEditing()) {
DesignerContext.getDesignerFrame().doResize();
}
}
}
});
}

7
designer-base/src/main/java/com/fr/design/gui/ilist/CheckBoxList.java

@ -256,13 +256,6 @@ public class CheckBoxList extends JComponent {
this.setBackground(list.getBackground());
this.setForeground(list.getForeground());
}
if (cellHasFocus) {
this.setBorder(UIManager.getBorder("List.focusCellHighlightBorder"));
} else {
this.setBorder(NO_FOCUS_BORDER);
}
return this;
}
}

8
designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java

@ -15,7 +15,6 @@ import java.awt.CardLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.cell;
@ -37,7 +36,7 @@ public class ReportletPane extends BasicPane {
UILabel tipLabel = new UILabel();
tipLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Schedule_The_Selected_File_Must_Be_End_With_Filter"));
tipLabel.setForeground(FineUIUtils.getUIColor("Label.tipColor", "Label.tipColor"));
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel centerPane = new JPanel(FRGUIPaneFactory.createScaledBorderLayout(0, 6));
this.add(centerPane, BorderLayout.CENTER);
switchButton = new UIButton("switch");
@ -53,13 +52,14 @@ public class ReportletPane extends BasicPane {
cardPane.setLayout(card = new CardLayout());
templateReportletTree = new TemplateFileTree();
templateReportletTree.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal"));
templateReportletTree.setBorder(FineBorderFactory.createWrappedRoundBorder());
IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt", ".class", ".frm", ".form", ".cptx"});
templateReportletTree.setFileNodeFilter(filter);
cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE");
classReportletTree = new ClassFileTree();
cardPane.add(c_panel = new JScrollPane(classReportletTree), "CLASS");
centerPane.add(column(6, cell(buttonPane), cell(cardPane)).getComponent());
cardPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
centerPane.add(buttonPane, BorderLayout.NORTH);
centerPane.add(cardPane, BorderLayout.CENTER);
this.refreshEnv();
}

3
designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBackgroundEditor.java

@ -7,6 +7,7 @@ import java.awt.*;
import javax.swing.*;
import com.fine.theme.utils.FineUIScale;
import com.fr.general.Background;
import com.fr.design.mainframe.widget.wrappers.BackgroundWrapper;
import com.fr.design.dialog.BasicDialog;
@ -29,7 +30,7 @@ public class AccessibleBackgroundEditor extends UneditableAccessibleEditor {
protected void showEditorPane() {
if (backgroundPane == null) {
backgroundPane = new BackgroundPane();
backgroundPane.setPreferredSize(new Dimension(600, 400));
backgroundPane.setPreferredSize(FineUIScale.createScaleDimension(600, 400));
}
BasicDialog dlg = backgroundPane.showWindow(SwingUtilities.getWindowAncestor(this));
dlg.addDialogActionListener(new DialogActionAdapter() {

52
designer-base/src/main/java/com/fr/design/remote/ui/debug/HeaderRenderer.java

@ -0,0 +1,52 @@
package com.fr.design.remote.ui.debug;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineTableHeaderUI;
import javax.swing.Icon;
import javax.swing.JTable;
import javax.swing.RowSorter;
import javax.swing.SortOrder;
import java.awt.Component;
/**
* 远程调试界面表头
*
* @author vito
* @since 11.0
* Created on 2024/10/17
*/
public class HeaderRenderer extends FineTableHeaderUI.TableHeaderRenderer {
private final Icon ascendingIcon = new LazyIcon("sort_asc");
private final Icon descendingIcon = new LazyIcon("sort_desc");
private final Icon nosortIcon = new LazyIcon("nosort");
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus,
int row, int col) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
int modelColumn = table.convertColumnIndexToModel(col);
setIcon(null);
RemoteDesignNetWorkTableRowSorter sorter = (RemoteDesignNetWorkTableRowSorter) table.getRowSorter();
if (!sorter.isSortable(modelColumn)) {
return this;
}
SortOrder sortOrder = sorter.getSortKeys().stream()
.filter(key -> key.getColumn() == modelColumn)
.map(RowSorter.SortKey::getSortOrder)
.findFirst()
.orElse(null);
if (sortOrder == SortOrder.ASCENDING) {
setIcon(ascendingIcon);
} else if (sortOrder == SortOrder.DESCENDING) {
setIcon(descendingIcon);
} else {
setIcon(nosortIcon);
}
return this;
}
}

6
designer-base/src/main/java/com/fr/design/remote/ui/debug/RemoteDesignNetWorkAction.java

@ -8,13 +8,16 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.workspace.WorkContext;
import javax.swing.JDialog;
import javax.swing.KeyStroke;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import static com.fine.theme.utils.FineUIScale.createScaleDimension;
import static com.fine.theme.utils.FineUIScale.unscale;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* 远程设计网络调试
@ -27,7 +30,8 @@ public class RemoteDesignNetWorkAction extends UpdateAction {
public static final String TITLE = "Remote Design NetWork";
public RemoteDesignNetWorkAction() {
setName(TITLE);
this.setName(TITLE);
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, DEFAULT_MODIFIER));
}
@Override

5
designer-base/src/main/java/com/fr/design/remote/ui/debug/RemoteDesignNetWorkHelper.java

@ -2,6 +2,8 @@ package com.fr.design.remote.ui.debug;
import com.fr.stable.StringUtils;
import javax.swing.UIManager;
import java.awt.Color;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -14,6 +16,9 @@ import java.util.Date;
* Created on 2024/10/11
*/
public class RemoteDesignNetWorkHelper {
static final Color DEFAULT_COLOR = UIManager.getColor("Table.foreground");
private static final int UNIT = 1000;
private static final int UNIT_BYTES = 1024;
private static final String SECOND = "s";

5
designer-base/src/main/java/com/fr/design/remote/ui/debug/RemoteDesignNetWorkTablePane.java

@ -86,7 +86,11 @@ public class RemoteDesignNetWorkTablePane extends JPanel {
model.addColumn("request");
model.addColumn("response");
uiTable = new JTable(model);
uiTable.getColumnModel().getColumn(4).setCellRenderer(new TimeColorCellRenderer());
uiTable.getColumnModel().getColumn(5).setCellRenderer(new SizeColorCellRenderer());
uiTable.getColumnModel().getColumn(6).setCellRenderer(new SizeColorCellRenderer());
uiTable.setRowSorter(new RemoteDesignNetWorkTableRowSorter(model));
uiTable.getTableHeader().setDefaultRenderer(new HeaderRenderer());
add(new JScrollPane(uiTable), BorderLayout.CENTER);
}
@ -155,5 +159,4 @@ public class RemoteDesignNetWorkTablePane extends JPanel {
}
}
}

1
designer-base/src/main/java/com/fr/design/remote/ui/debug/RemoteDesignNetWorkTableRowSorter.java

@ -19,6 +19,7 @@ public class RemoteDesignNetWorkTableRowSorter extends TableRowSorter<DefaultTab
setComparator(4, Comparator.comparingLong(RemoteDesignNetWorkHelper::parseCostToMS));
setComparator(5, Comparator.comparingLong(RemoteDesignNetWorkHelper::parseSizeToBytes));
setComparator(6, Comparator.comparingLong(RemoteDesignNetWorkHelper::parseSizeToBytes));
setMaxSortKeys(1);
}
@Override

37
designer-base/src/main/java/com/fr/design/remote/ui/debug/SizeColorCellRenderer.java

@ -0,0 +1,37 @@
package com.fr.design.remote.ui.debug;
import com.fine.theme.light.ui.FineTableHeaderUI;
import java.awt.Color;
import static com.fr.design.remote.ui.debug.RemoteDesignNetWorkHelper.DEFAULT_COLOR;
/**
* 大小多颜色渲染
*
* @author vito
* @since 11.0
* Created on 2024/10/16
*/
public class SizeColorCellRenderer extends FineTableHeaderUI.TableRenderer {
private static final int UNIT_BYTES = 1024;
private static final int SIZE_MIDDLE = UNIT_BYTES * 100;
private static final int SIZE_LARGE = UNIT_BYTES * 200;
@Override
protected void setValue(Object value) {
if (value instanceof String) {
long parsed = RemoteDesignNetWorkHelper.parseSizeToBytes((String) value);
if (parsed > SIZE_LARGE) {
setForeground(Color.RED);
} else if (parsed > SIZE_MIDDLE) {
setForeground(Color.ORANGE);
} else {
setForeground(DEFAULT_COLOR);
}
}
setText((value == null) ? "" : value.toString());
}
}

38
designer-base/src/main/java/com/fr/design/remote/ui/debug/TimeColorCellRenderer.java

@ -0,0 +1,38 @@
package com.fr.design.remote.ui.debug;
import com.fine.theme.light.ui.FineTableHeaderUI;
import java.awt.Color;
import static com.fr.design.remote.ui.debug.RemoteDesignNetWorkHelper.DEFAULT_COLOR;
/**
* 时间多颜色渲染
*
* @author vito
* @since 11.0
* Created on 2024/10/16
*/
public class TimeColorCellRenderer extends FineTableHeaderUI.TableRenderer {
private static final int SIZE_MIDDLE = 1000;
private static final int SIZE_LARGE = 5000;
@Override
protected void setValue(Object value) {
if (value instanceof String) {
long parsed = RemoteDesignNetWorkHelper.parseCostToMS((String) value);
if (parsed > SIZE_LARGE) {
setForeground(Color.RED);
} else if (parsed > SIZE_MIDDLE) {
setForeground(Color.ORANGE);
} else {
setForeground(DEFAULT_COLOR);
}
}
setText((value == null) ? "" : value.toString());
}
}

1
designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java

@ -92,6 +92,7 @@ public class BackgroundPane extends BasicPane {
quickPane = BackgroundFactory.createIfAbsent(background == null ? null : background.getClass());
cacheMap.put(index, quickPane);
}
tabbedPane.setSelectedIndex(index);
return quickPane;
}

2
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

@ -267,7 +267,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
private void initMenuColorPane() {
menuColorPane.setLayout(new GridLayout(5, 8, DEFAULT_COLOR_HOR_INTERVAL, 0));
menuColorPane.setLayout(new GridLayout(4, 10, DEFAULT_COLOR_HOR_INTERVAL, 0));
Color[] colorArray = this.getColorArray();
for (int i = 0; i < colorArray.length; i++) {
Color color = colorArray[i] == null ? UsedColorPane.DEFAULT_COLOR : colorArray[i];

17
designer-base/src/main/java/com/fr/design/widget/IconDefinePane.java

@ -23,6 +23,8 @@ import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
public class IconDefinePane extends BasicPane {
@ -66,8 +68,9 @@ public class IconDefinePane extends BasicPane {
showIconImageLable.setIcon(null);
}
});
JPanel iconButtonPane = row(LayoutConstants.HORIZONTAL_GAP, cell(this.showIconImageLable), cell(this.editIconButton), cell(this.removeIconButton)).getComponent();
JPanel iconButtonPane = row(LayoutConstants.HORIZONTAL_GAP, cell(this.showIconImageLable),
column(flex(), row(LayoutConstants.HORIZONTAL_GAP, cell(this.editIconButton), cell(this.removeIconButton)), flex())
).getComponent();
iconButtonPane.setBorder(new ScaledEmptyBorder(0,0,0,0));
this.setLayout(new BorderLayout());
this.add(iconButtonPane, BorderLayout.CENTER);
@ -92,16 +95,6 @@ public class IconDefinePane extends BasicPane {
setShowIconImage();
}
/**
* 直接更新icon
* @param iconName
* @param icon
*/
public void populateIcon(String iconName, Icon icon) {
this.curIconName = iconName;
showIconImageLable.setIcon(icon);
}
public String update() {
return this.curIconName;
}

10
designer-base/src/main/java/com/fr/design/widget/component/BackgroundCompPane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.component;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
@ -12,7 +13,6 @@ import javax.swing.JPanel;
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.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
@ -40,26 +40,24 @@ public abstract class BackgroundCompPane<T extends Widget> extends BasicPane {
backgroundHead = new UIButtonGroup(titles);
panel = column(VERTICAL_GAP,
row(
flex(LEFT_WEIGHT),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Initial"))).weight(RIGHT_WEIGHT / 2),
cell(initialBackgroundEditor).weight(RIGHT_WEIGHT / 2)
),
row(
flex(LEFT_WEIGHT),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Over"))).weight(RIGHT_WEIGHT / 2),
cell(overBackgroundEditor).weight(RIGHT_WEIGHT / 2)
),
row(
flex(LEFT_WEIGHT),
cell(getClickLabel()).weight(RIGHT_WEIGHT / 2),
cell(clickBackgroundEditor).weight(RIGHT_WEIGHT / 2)
)
).getComponent();
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 0))).getComponent();
this.add(column(VERTICAL_GAP,
row(
cell(headLabel).weight(LEFT_WEIGHT),
cell(backgroundHead).weight(RIGHT_WEIGHT)
)
),
cell(panel)
).getComponent());
}

4
designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java

@ -238,8 +238,8 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
}
});
helpButton.set4ToolbarButton();
buttonGroup.add(row(5, cell(UpdateCheckBox),
cell(helpButton)));
checkBoxUpdatePane.add(row(5, cell(UpdateCheckBox), cell(helpButton)).getComponent());
buttonGroup.add(cell(checkBoxUpdatePane));
controlBtnPane.add(column(5, buttonGroup.toArray(new Layouts.Cell[0])).getComponent());
}
}

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

@ -9,6 +9,7 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.workspace.server.repository.tabledata.TableDataRepository;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.HashMap;
@ -98,6 +99,9 @@ public class FileDataFILE extends FileNodeFILE{
FileDataFILE root = null;
if (!this.builded) {
root = buildTree();
if (root == null) {
return new FILE[0];
}
FileDataFILE dataFILE = root.getFileDataFILE(this.id);
this.setChildren(dataFILE.getChildren());
this.setType(dataFILE.getType());
@ -125,7 +129,7 @@ public class FileDataFILE extends FileNodeFILE{
return null;
}
private FileDataFILE buildTree() {
private @Nullable FileDataFILE buildTree() {
List<FileNodeBean> beans = TableDataRepository.getInstance().getFileList(type);
Map<String, FileDataFILE> tree = new HashMap<>();
FileDataFILE root = null;

5
designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java

@ -34,6 +34,7 @@ import java.awt.Component;
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.row;
/**
@ -68,7 +69,7 @@ public class WidgetStyleEditPane<T extends TemplateTheme> extends BasicBeanPane<
* 控件背景和透明度配置面板
*/
protected NewColorSelectBox widgetBgColorSelectBox;
protected UINumberDragPaneWithPercent widgetBgAlphaDragPane;
protected UIPercentDragPane widgetBgAlphaDragPane;
/**
* 图标颜色
*/
@ -131,7 +132,7 @@ public class WidgetStyleEditPane<T extends TemplateTheme> extends BasicBeanPane<
colorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
colorSelectBox.setSelectObject(WidgetThemeDisplayConstants.DEFAULT_THEME_COLOR);
widgetBgColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
widgetBgAlphaDragPane = new UINumberDragPaneWithPercent(0, 100, 1);
widgetBgAlphaDragPane = new UIPercentDragPane();
initLineBox();
borderRadiusSpinner = new UISpinner(0, Integer.MAX_VALUE, 1);
iconColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_bottom_align.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 d="M20 2C20.5523 2 21 2.44772 21 3L21 25C21 25.5523 20.5523 26 20 26H12C11.4477 26 11 25.5523 11 25L11 3C11 2.44772 11.4477 2 12 2L20 2Z" fill="#5493F2"/>
<path d="M30 29C30 29.5523 29.5523 30 29 30L3 30C2.44772 30 2 29.5523 2 29C2 28.4477 2.44772 28 3 28L29 28C29.5523 28 30 28.4477 30 29Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 437 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_bottom_align_disable.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 d="M20 2C20.5523 2 21 2.44772 21 3L21 25C21 25.5523 20.5523 26 20 26H12C11.4477 26 11 25.5523 11 25L11 3C11 2.44772 11.4477 2 12 2L20 2Z" fill="#A3ADBD"/>
<path d="M30 29C30 29.5523 29.5523 30 29 30L3 30C2.44771 30 2 29.5523 2 29C2 28.4477 2.44772 28 3 28L29 28C29.5523 28 30 28.4477 30 29Z" fill="#CFD4DC"/>
</svg>

After

Width:  |  Height:  |  Size: 418 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_center.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 d="M17 2C17.5523 2 18 2.44772 18 3L18 29C18 29.5523 17.5523 30 17 30H15C14.4477 30 14 29.5523 14 29L14 3C14 2.44771 14.4477 2 15 2L17 2Z" fill="#A3ADBD"/>
<path d="M30 21C30 21.5523 29.5523 22 29 22L3 22C2.44771 22 2 21.5523 2 21L2 11C2 10.4477 2.44772 10 3 10L29 10C29.5523 10 30 10.4477 30 11V21Z" fill="#5493F2"/>
</svg>

After

Width:  |  Height:  |  Size: 426 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_center_disable.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 d="M17 2C17.5523 2 18 2.44772 18 3L18 29C18 29.5523 17.5523 30 17 30H15C14.4477 30 14 29.5523 14 29L14 3C14 2.44771 14.4477 2 15 2L17 2Z" fill="#CFD4DC"/>
<path d="M30 21C30 21.5523 29.5523 22 29 22L3 22C2.44771 22 2 21.5523 2 21L2 11C2 10.4477 2.44772 10 3 10L29 10C29.5523 10 30 10.4477 30 11V21Z" fill="#A3ADBD"/>
</svg>

After

Width:  |  Height:  |  Size: 426 B

8
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_distribute.svg

@ -0,0 +1,8 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 28C11.4477 28 11 27.5523 11 27L11 5C11 4.44772 11.4477 4 12 4L20 4C20.5523 4 21 4.44771 21 5L21 27C21 27.5523 20.5523 28 20 28H12Z" fill="#A3ADBD"/>
<path d="M12 28C11.4477 28 11 27.5523 11 27L11 5C11 4.44772 11.4477 4 12 4L20 4C20.5523 4 21 4.44771 21 5L21 27C21 27.5523 20.5523 28 20 28H12Z" fill="#105DD1"/>
<path d="M5 2C5.55229 2 6 2.44772 6 3L6 29C6 29.5523 5.55228 30 5 30H3C2.44772 30 2 29.5523 2 29L2 3C2 2.44771 2.44772 2 3 2L5 2Z" fill="#CFD4DC"/>
<path d="M5 2C5.55229 2 6 2.44772 6 3L6 29C6 29.5523 5.55228 30 5 30H3C2.44772 30 2 29.5523 2 29L2 3C2 2.44771 2.44772 2 3 2L5 2Z" fill="#5493F2"/>
<path d="M29 2C29.5523 2 30 2.44772 30 3L30 29C30 29.5523 29.5523 30 29 30H27C26.4477 30 26 29.5523 26 29L26 3C26 2.44771 26.4477 2 27 2L29 2Z" fill="#CFD4DC"/>
<path d="M29 2C29.5523 2 30 2.44772 30 3L30 29C30 29.5523 29.5523 30 29 30H27C26.4477 30 26 29.5523 26 29L26 3C26 2.44771 26.4477 2 27 2L29 2Z" fill="#5493F2"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

5
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_distribute_disable.svg

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 28C11.4477 28 11 27.5523 11 27L11 5C11 4.44772 11.4477 4 12 4L20 4C20.5523 4 21 4.44771 21 5L21 27C21 27.5523 20.5523 28 20 28H12Z" fill="#A3ADBD"/>
<path d="M5 2C5.55229 2 6 2.44772 6 3L6 29C6 29.5523 5.55228 30 5 30H3C2.44772 30 2 29.5523 2 29L2 3C2 2.44771 2.44772 2 3 2L5 2Z" fill="#CFD4DC"/>
<path d="M29 2C29.5523 2 30 2.44772 30 3L30 29C30 29.5523 29.5523 30 29 30H27C26.4477 30 26 29.5523 26 29L26 3C26 2.44771 26.4477 2 27 2L29 2Z" fill="#CFD4DC"/>
</svg>

After

Width:  |  Height:  |  Size: 574 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_left_align.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 d="M3 2C3.55229 2 4 2.44772 4 3L4 29C4 29.5523 3.55228 30 3 30C2.44771 30 2 29.5523 2 29L2 3C2 2.44771 2.44772 2 3 2Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M6 12C6 11.4477 6.44772 11 7 11H29C29.5523 11 30 11.4477 30 12V20C30 20.5523 29.5523 21 29 21H7C6.44772 21 6 20.5523 6 20V12Z" fill="#5493F2"/>
</svg>

After

Width:  |  Height:  |  Size: 417 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_left_align_disable.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 d="M3 2C3.55229 2 4 2.44772 4 3L4 29C4 29.5523 3.55228 30 3 30C2.44771 30 2 29.5523 2 29L2 3C2 2.44771 2.44772 2 3 2Z" fill="#CFD4DC"/>
<path d="M6 12C6 11.4477 6.44772 11 7 11H29C29.5523 11 30 11.4477 30 12V20C30 20.5523 29.5523 21 29 21H7C6.44772 21 6 20.5523 6 20V12Z" fill="#A3ADBD"/>
</svg>

After

Width:  |  Height:  |  Size: 398 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_right_align.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 d="M2 12C2 11.4477 2.44772 11 3 11H25C25.5523 11 26 11.4477 26 12V20C26 20.5523 25.5523 21 25 21H3C2.44772 21 2 20.5523 2 20V12Z" fill="#5493F2"/>
<path d="M29 2C29.5523 2 30 2.44772 30 3L30 29C30 29.5523 29.5523 30 29 30C28.4477 30 28 29.5523 28 29L28 3C28 2.44771 28.4477 2 29 2Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 428 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_right_align_disable.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 d="M2 12C2 11.4477 2.44772 11 3 11H25C25.5523 11 26 11.4477 26 12V20C26 20.5523 25.5523 21 25 21H3C2.44772 21 2 20.5523 2 20V12Z" fill="#A3ADBD"/>
<path d="M29 2C29.5523 2 30 2.44772 30 3L30 29C30 29.5523 29.5523 30 29 30C28.4477 30 28 29.5523 28 29L28 3C28 2.44771 28.4477 2 29 2Z" fill="#CFD4DC"/>
</svg>

After

Width:  |  Height:  |  Size: 409 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_top_align.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 d="M12 30C11.4477 30 11 29.5523 11 29L11 7C11 6.44772 11.4477 6 12 6L20 6C20.5523 6 21 6.44772 21 7L21 29C21 29.5523 20.5523 30 20 30H12Z" fill="#5493F2"/>
<path d="M2 3C2 2.44771 2.44772 2 3 2H29C29.5523 2 30 2.44771 30 3C30 3.55228 29.5523 4 29 4H3C2.44771 4 2 3.55228 2 3Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 422 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_top_align_disable.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 d="M12 30C11.4477 30 11 29.5523 11 29L11 7C11 6.44772 11.4477 6 12 6L20 6C20.5523 6 21 6.44771 21 7V29C21 29.5523 20.5523 30 20 30H12Z" fill="#A3ADBD"/>
<path d="M2 3C2 2.44771 2.44772 2 3 2H29C29.5523 2 30 2.44771 30 3C30 3.55228 29.5523 4 29 4H3C2.44771 4 2 3.55228 2 3Z" fill="#CFD4DC"/>
</svg>

After

Width:  |  Height:  |  Size: 400 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_center.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 d="M2 15C2 14.4477 2.44772 14 3 14H29C29.5523 14 30 14.4477 30 15V17C30 17.5523 29.5523 18 29 18H3C2.44771 18 2 17.5523 2 17V15Z" fill="#A3ADBD"/>
<path d="M21 2C21.5523 2 22 2.44772 22 3L22 29C22 29.5523 21.5523 30 21 30H11C10.4477 30 10 29.5523 10 29L10 3C10 2.44771 10.4477 2 11 2L21 2Z" fill="#5493F2"/>
</svg>

After

Width:  |  Height:  |  Size: 417 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_center_disable.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 d="M2 15C2 14.4477 2.44772 14 3 14H29C29.5523 14 30 14.4477 30 15V17C30 17.5523 29.5523 18 29 18H3C2.44771 18 2 17.5523 2 17V15Z" fill="#CFD4DC"/>
<path d="M21 2C21.5523 2 22 2.44772 22 3L22 29C22 29.5523 21.5523 30 21 30H11C10.4477 30 10 29.5523 10 29L10 3C10 2.44771 10.4477 2 11 2L21 2Z" fill="#A3ADBD"/>
</svg>

After

Width:  |  Height:  |  Size: 417 B

8
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_distribute.svg

@ -0,0 +1,8 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="4" y="11" width="24" height="10" rx="1" fill="#A3ADBD"/>
<rect x="4" y="11" width="24" height="10" rx="1" fill="#105DD1"/>
<rect x="30" y="6" width="28" height="4" rx="1" transform="rotate(-180 30 6)" fill="#CFD4DC"/>
<rect x="30" y="6" width="28" height="4" rx="1" transform="rotate(-180 30 6)" fill="#5493F2"/>
<rect x="30" y="30" width="28" height="4" rx="1" transform="rotate(-180 30 30)" fill="#CFD4DC"/>
<rect x="30" y="30" width="28" height="4" rx="1" transform="rotate(-180 30 30)" fill="#5493F2"/>
</svg>

After

Width:  |  Height:  |  Size: 619 B

5
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_distribute_disable.svg

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 12C4 11.4477 4.44772 11 5 11H27C27.5523 11 28 11.4477 28 12V20C28 20.5523 27.5523 21 27 21H5C4.44772 21 4 20.5523 4 20V12Z" fill="#A3ADBD"/>
<path d="M30 5C30 5.55229 29.5523 6 29 6L3 6C2.44771 6 2 5.55228 2 5L2 3C2 2.44772 2.44772 2 3 2L29 2C29.5523 2 30 2.44772 30 3V5Z" fill="#CFD4DC"/>
<path d="M30 29C30 29.5523 29.5523 30 29 30L3 30C2.44771 30 2 29.5523 2 29L2 27C2 26.4477 2.44772 26 3 26L29 26C29.5523 26 30 26.4477 30 27V29Z" fill="#CFD4DC"/>
</svg>

After

Width:  |  Height:  |  Size: 567 B

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

@ -472,7 +472,14 @@
"layout_top_right": "layout/layout_top_right.svg",
"theme_edit": "theme_edit.svg",
"folder_half_authority" : "filetree/folder_half_authority.svg",
"folder_half_authority_open" : "filetree/folder_half_authority_open.svg"
"folder_half_authority_open" : "filetree/folder_half_authority_open.svg",
"arrange_left_align": "arrange/arrange_left_align.svg",
"arrange_horizontal_center": "arrange/arrange_horizontal_center.svg",
"arrange_right_align": "arrange/arrange_right_align.svg",
"arrange_top_align": "arrange/arrange_top_align.svg",
"arrange_vertical_center": "arrange/arrange_vertical_center.svg",
"arrange_bottom_align": "arrange/arrange_bottom_align.svg",
"arrange_horizontal_distribute": "arrange/arrange_horizontal_distribute.svg",
"arrange_vertical_distribute": "arrange/arrange_vertical_distribute.svg"
}
}

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

@ -302,6 +302,7 @@ ColorChooser.swatchesDefaultRecentColor = $control
ComboBox.border = com.fine.theme.light.ui.FineRoundBorder
ComboBox.padding = @componentMargin
ComboBox.minimumWidth = 72
ComboBox.maximumWidth = 400
ComboBox.editorColumns = 0
ComboBox.maximumRowCount = 15
[mac]ComboBox.showPopupOnNavigation = true

18
designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java

@ -1,7 +1,6 @@
package com.fr.design.chartx.component;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chartx.TwoTuple;
@ -48,8 +47,8 @@ import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import static com.fine.theme.utils.FineClientProperties.ADAPTIVE_COMBO_BOX;
import static com.fine.theme.utils.FineClientProperties.COMBO_BOX_TYPE;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIScale.scale;
/**
@ -102,12 +101,13 @@ public class MapAreaMatchPane extends BasicBeanPane<MapMatchResult> {
}
private JPanel createContentPane() {
tableNameCombox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
areaNameBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
return FineLayoutBuilder.createHorizontalLayout(10,
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data") + ":"), tableNameCombox,
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Name") + ":"), areaNameBox,
refreshLabel);
return row(10,
cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data") + ":")),
cell(tableNameCombox).weight(1),
cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Name") + ":")),
cell(areaNameBox).weight(1),
cell(refreshLabel)
).getComponent();
}
private void initTable(TwoTuple<DefaultMutableTreeNode, Set<String>> treeNodeAndItems) {

19
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java

@ -1,10 +1,13 @@
package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.stable.StringUtils;
import javax.swing.Icon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -16,11 +19,21 @@ public abstract class AbstractMultiSelectionArrangementButton extends UIButton i
public AbstractMultiSelectionArrangementButton(MultiSelectionArrangement arrangement) {
super();
this.arrangement = arrangement;
this.setNormalPainted(false);
this.setBorderPaintedOnlyWhenPressed(true);
this.setIcon(getIcon());
this.setToolTipText(getTipText());
this.addActionListener(getActionListener());
setBorderPainted(false);
setBackground(null);
setBackground(null);
}
@Override
public Icon getIcon() {
LazyIcon icon = new LazyIcon(getIconId());
return isEnabled() ? icon : icon.disabled();
}
public String getIconId() {
return StringUtils.EMPTY;
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class BottomAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 2397455240682353024L;
@ -15,8 +12,8 @@ public class BottomAlignButton extends AbstractMultiSelectionArrangementButton {
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_bottom_align.png");
public String getIconId() {
return "arrange_bottom_align";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class HorizontalCenterButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 6290178236460051049L;
@ -15,8 +12,8 @@ public class HorizontalCenterButton extends AbstractMultiSelectionArrangementBut
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_horizontal_center_align.png");
public String getIconId() {
return "arrange_horizontal_center";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class HorizontalDistributionButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 5052092252720664954L;
@ -15,8 +12,8 @@ public class HorizontalDistributionButton extends AbstractMultiSelectionArrangem
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_horizontal_auto_spacing.png");
public String getIconId() {
return "arrange_horizontal_distribute";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class LeftAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = -8177637788632733710L;
@ -15,8 +12,8 @@ public class LeftAlignButton extends AbstractMultiSelectionArrangementButton {
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_left_align.png");
public String getIconId() {
return "arrange_left_align";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class RightAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = -8698936349956288409L;
@ -15,8 +12,8 @@ public class RightAlignButton extends AbstractMultiSelectionArrangementButton {
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_right_align.png");
public String getIconId() {
return "arrange_right_align";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class TopAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 2896267783075870924L;
@ -15,8 +12,8 @@ public class TopAlignButton extends AbstractMultiSelectionArrangementButton {
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_top_align.png");
public String getIconId() {
return "arrange_top_align";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class VerticalCenterButton extends AbstractMultiSelectionArrangementButton {
public VerticalCenterButton(MultiSelectionArrangement arrangement) {
@ -13,8 +10,8 @@ public class VerticalCenterButton extends AbstractMultiSelectionArrangementButto
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_vertical_center_align.png");
public String getIconId() {
return "arrange_vertical_center";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class VerticalDistributionButton extends AbstractMultiSelectionArrangementButton {
public VerticalDistributionButton(MultiSelectionArrangement arrangement) {
@ -13,8 +10,8 @@ public class VerticalDistributionButton extends AbstractMultiSelectionArrangemen
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_vertical_auto_spacing.png");
public String getIconId() {
return "arrange_vertical_distribute";
}
@Override

97
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java

@ -1,5 +1,8 @@
package com.fr.design.mainframe.widget.ui;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.ibutton.UIButton;
@ -24,7 +27,6 @@ import com.fr.general.IOUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
@ -43,93 +45,46 @@ public class FormMultiWidgetCardPane extends FormWidgetCardPane {
public void initPropertyPane() {
arrangement = new MultiSelectionArrangement(designer);
content.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 0));
content.add(createArrangementLayoutPane(), BorderLayout.CENTER);
this.listener = new AttributeChangeListener() {
@Override
public void attributeChange() {
designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_RESIZED);
}
};
setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
this.listener = () -> designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_RESIZED);
}
// 整个排列分布面板的layout,可以看成一个三行一列的表格,第一行是分布,第二行是自动间距,第三行是手动间距
/**
* 整个排列分布面板的layout可以看成一个两行一列的表格第一行是分布第二行是自动间距
*/
private JPanel createArrangementLayoutPane() {
double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED};
double[] columnSize = {TableLayout.PREFERRED};
Component[][] components = new Component[][] {
new Component[] {
createAlignmentPane()
},
new Component[] {
createAutoSpacingPane()
}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 16);
return FineLayoutBuilder.createVerticalLayout(10, createAlignmentPane(), createAutoSpacingPane());
}
// 对齐
private JPanel createAlignmentPane() {
double[] rowSize = {TableLayout.PREFERRED};
double[] columnSize = {
TableLayout.PREFERRED,
TableLayout.PREFERRED,
TableLayout.PREFERRED,
TableLayout.PREFERRED,
TableLayout.PREFERRED,
TableLayout.PREFERRED
};
Component[][] components = new Component[][] {
new Component[] {
new LeftAlignButton(arrangement),
new HorizontalCenterButton(arrangement),
new RightAlignButton(arrangement),
new TopAlignButton(arrangement),
new VerticalCenterButton(arrangement),
new BottomAlignButton(arrangement)
}
};
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 18, 0);
JPanel centerPane = FineLayoutBuilder.createHorizontalLayout(16,
new LeftAlignButton(arrangement),
new HorizontalCenterButton(arrangement),
new RightAlignButton(arrangement),
new TopAlignButton(arrangement),
new VerticalCenterButton(arrangement),
new BottomAlignButton(arrangement));
return createTitleLayout(Toolkit.i18nText("Fine-Design_Multi_Selection_Align"), centerPane);
}
// 自动间距
private JPanel createAutoSpacingPane() {
double[] rowSize = {TableLayout.PREFERRED};
double[] columnSize = {
TableLayout.PREFERRED,
TableLayout.PREFERRED
};
UIButton horizontalAutoSpacingBtn = new HorizontalDistributionButton(arrangement);
UIButton verticalAutoSpacingBtn = new VerticalDistributionButton(arrangement);
if (designer.getSelectionModel().getSelection().size() < 3) {
horizontalAutoSpacingBtn.setEnabled(false);
verticalAutoSpacingBtn.setEnabled(false);
}
Component[][] components = new Component[][] {
new Component[] {
horizontalAutoSpacingBtn,
verticalAutoSpacingBtn
}
};
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 18, 0);
JPanel centerPane = FineLayoutBuilder.createHorizontalLayout(16, horizontalAutoSpacingBtn, verticalAutoSpacingBtn);
UILabel tip = new UILabel(IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_auto_spacing_tip.png"));
UILabel tip = new UILabel(new LazyIcon("jumpHelp", 12));
tip.setToolTipText(Toolkit.i18nText("Fine-Design_Multi_Selection_Auto_Spacing_Tip"));
Component[][] titleComponents = new Component[][] {
new Component[] {
new UILabel(Toolkit.i18nText("Fine-Design_Multi_Selection_Auto_Spacing")),
tip
}
};
JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(titleComponents, rowSize, columnSize, 5, 0);
JPanel northPane = FineLayoutBuilder.createHorizontalLayout(5, new UILabel(Toolkit.i18nText("Fine-Design_Multi_Selection_Auto_Spacing")), tip);
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout(0, 8));
jPanel.add(northPane, BorderLayout.NORTH);
jPanel.add(centerPane, BorderLayout.CENTER);
return jPanel;
return FineLayoutBuilder.createVerticalLayout(10, northPane, centerPane);
}
// 手动间距
@ -195,13 +150,11 @@ public class FormMultiWidgetCardPane extends FormWidgetCardPane {
}
}
// 创建一个BorderLayout布局,上面是标题,例如“对齐”,下面是个容器
/**
* 创建一个面板上面是标题例如对齐下面是个容器
*/
private JPanel createTitleLayout(String title, JPanel centerPane) {
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout(0, 8));
jPanel.add(new UILabel(title), BorderLayout.NORTH);
jPanel.add(centerPane, BorderLayout.CENTER);
return jPanel;
return FineLayoutBuilder.createVerticalLayout(10, new UILabel(title), centerPane);
}
@Override

1
designer-realize/src/main/java/com/fanruan/boot/env/DesignFunctionComponent.java vendored

@ -1,6 +1,5 @@
package com.fanruan.boot.env;
import com.fanruan.carina.annotions.ActivatorRefer;
import com.fanruan.carina.annotions.DependsOn;
import com.fanruan.carina.annotions.FineComponent;
import com.fanruan.carina.annotions.Start;

34
designer-realize/src/main/java/com/fanruan/boot/env/function/DesignAnalyzerComponent.java vendored

@ -7,47 +7,13 @@ import com.fanruan.carina.annotions.FineComponent;
import com.fanruan.carina.annotions.Start;
import com.fanruan.carina.annotions.Supplemental;
import com.fanruan.carina.core.partition.ResourceAffiliate;
import com.fr.base.OptimizeUtil;
import com.fr.collect.Collect;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.constants.DesignerLaunchStatus;
import com.fr.design.record.analyzer.DesignerAnalyzer;
import com.fr.design.record.analyzer.Interceptor.CollectInterceptor;
import com.fr.design.record.analyzer.advice.CollectAdvice;
import com.fr.design.record.analyzer.advice.DBMonitorAdvice;
import com.fr.design.record.analyzer.advice.FaultToleranceAdvice;
import com.fr.design.record.analyzer.advice.FocusAdvice;
import com.fr.design.record.analyzer.advice.MonitorAdvice;
import com.fr.design.record.analyzer.advice.PerformancePointAdvice;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.event.Null;
import com.fr.intelli.metrics.Compute;
import com.fr.intelli.record.Focus;
import com.fr.intelli.record.PerformancePoint;
import com.fr.jvm.assist.FineAssist;
import com.fr.record.analyzer.AnalyzerConfiguration;
import com.fr.record.analyzer.AnalyzerKey;
import com.fr.record.analyzer.Assistant;
import com.fr.record.analyzer.DBMetrics;
import com.fr.record.analyzer.FineAnalyzer;
import com.fr.record.analyzer.advice.AnalyzerAdviceKey;
import com.fr.record.analyzer.advice.FineAdviceAssistant;
import com.fr.record.analyzer.configuration.AnalyzerAssemblyFactory;
import com.fr.record.analyzer.configuration.FineAnalyzerAssemblyFactory;
import com.fr.stable.collections.CollectionUtils;
import com.fr.third.net.bytebuddy.description.type.TypeDescription;
import com.fr.third.net.bytebuddy.dynamic.DynamicType;
import com.fr.third.net.bytebuddy.implementation.MethodDelegation;
import com.fr.third.net.bytebuddy.matcher.ElementMatchers;
import com.fr.third.net.bytebuddy.utility.JavaModule;
import com.fr.tolerance.FaultTolerance;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
/**
* 设计器埋点及分析组件

5
designer-realize/src/main/java/com/fanruan/boot/env/function/DesignDatasourceComponent.java vendored

@ -43,9 +43,11 @@ import com.fr.decision.webservice.v10.datasource.dataset.processor.impl.DataSetP
import com.fr.design.data.datapane.connect.LocalConnectionSource;
import com.fr.design.data.tabledata.LocalTableDataSource;
import com.fr.file.TableDataConfigWrapper;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import com.fr.workspace.server.repository.connection.ConnectionWriterShell;
import com.fr.workspace.server.repository.connection.LocalConnectionShell;
import com.fr.workspace.server.repository.tabledata.LocalTableDataShell;
import com.fr.workspace.server.repository.tabledata.TableDataRepository;
/**
@ -102,7 +104,8 @@ public class DesignDatasourceComponent extends DatasourceComponent {
*/
@Stop
public void stop() {
ConnectionRepository.getInstance().invalidCache();
TableDataRepository.getInstance().invalidCache();
}
/**

3
designer-realize/src/main/java/com/fanruan/boot/env/function/app/DesignAppComponent.java vendored

@ -10,6 +10,7 @@ import com.fr.design.mainframe.App;
import com.fr.design.mainframe.AppGroup;
import com.fr.design.mainframe.JTemplateFactory;
import com.fr.nx.app.designer.CptxApp;
import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
import java.util.ArrayList;
import java.util.List;
@ -43,7 +44,7 @@ public class DesignAppComponent {
*/
@Stop
public void stop() {
RemoteAuthorityRepository.getInstance().invalidCache();
List<App> appList = new ArrayList<>(Carina.getApplicationContext().group(AppGroup.class).getAll());
for (App app : appList) {
JTemplateFactory.remove(app);

13
designer-realize/src/main/java/com/fanruan/boot/pre/DesignPreStartComponent.java

@ -1,12 +1,6 @@
package com.fanruan.boot.pre;
import com.fanruan.boot.FSProperties;
import com.fanruan.fs.FileServer;
import com.fanruan.fs.RepositoryFactory;
import com.fanruan.fs.repository.local.LocalFileRepository;
import com.fanruan.product.ProductConstants;
import com.fr.decision.inject.node.impl.DecisionSystemInjectNode;
import com.fr.design.ConfigHelper;
import com.fanruan.boot.key.StartupArgsShell;
import com.fanruan.carina.Carina;
import com.fanruan.carina.annotions.FineComponent;
@ -18,11 +12,17 @@ import com.fanruan.config.impl.ShareConfigProviderImpl;
import com.fanruan.config.realm.ConfigRealm;
import com.fanruan.config.realm.ConfigRepositoryFactory;
import com.fanruan.config.realm.local.LocalConfigRepositoryBuilder;
import com.fanruan.fs.FileServer;
import com.fanruan.fs.RepositoryFactory;
import com.fanruan.fs.repository.local.LocalFileRepository;
import com.fanruan.mq.CarinaMQ;
import com.fanruan.mq.InternalMQProvider;
import com.fanruan.product.ProductConstants;
import com.fr.base.function.UITerminator;
import com.fr.carina.util.CarinaResourceUtils;
import com.fr.carina.util.provider.CarinaResourceProvider;
import com.fr.decision.inject.node.impl.DecisionSystemInjectNode;
import com.fr.design.ConfigHelper;
import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.DesignerLaunchStatus;
import com.fr.design.deeplink.DeepLinkManager;
@ -47,7 +47,6 @@ import com.fr.module.engine.event.LifecycleErrorEvent;
import com.fr.runtime.FineRuntime;
import com.fr.stable.CommonCodeUtils;
import com.fr.stable.CommonUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.lifecycle.FineLifecycleFatalError;
import com.fr.stable.project.ProjectConstants;

3
designer-realize/src/main/java/com/fr/design/actions/file/newReport/NewWorkBookAction.java

@ -3,7 +3,6 @@ package com.fr.design.actions.file.newReport;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.actions.UpdateAction;
import com.fr.design.cache.DesignCacheManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.MenuKeySet;
@ -35,7 +34,7 @@ public class NewWorkBookAction extends UpdateAction {
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
DesignCacheManager.processByCacheTableData(() -> DesignerContext.getDesignerFrame().addAndActivateJTemplate(new JWorkBook()));
DesignerContext.getDesignerFrame().addAndActivateJTemplate(new JWorkBook());
}
public static final MenuKeySet NEW_WORK_BOOK = new MenuKeySet() {

2
designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java

@ -667,7 +667,7 @@ public class EditToolBar extends BasicPane {
this.icon.setSelected(button.isShowIcon());
this.text.setSelected(button.isShowText());
this.nameField.setText(button.getText());
this.iconPane.populateIcon(((Button) widget).getIconName(), icon);
this.iconPane.populate(((Button) widget).getIconName());
}
/**

31
designer-realize/src/main/java/com/fr/design/webattr/ToolBarButton.java

@ -1,6 +1,6 @@
package com.fr.design.webattr;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext;
@ -8,16 +8,22 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
import com.fr.form.ui.Widget;
import com.fr.stable.StringUtils;
import com.fr.form.ui.WidgetInfoConfig;
import java.awt.Insets;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.Icon;
import javax.swing.ImageIcon;
public class ToolBarButton extends UIButton implements MouseListener {
private Widget widget;
private WidgetOption no;
private final int ICON_WIDTH = FineUIScale.scale(16);
private final int ICON_HEIGHT = FineUIScale.scale(16);
public ToolBarButton(Icon icon, Widget widget) {
this(null, icon, widget);
@ -30,15 +36,30 @@ public class ToolBarButton extends UIButton implements MouseListener {
public ToolBarButton(String text, Icon icon, Widget widget) {
super(text, icon);
this.widget = widget;
//直接设置Icon图标
setIcon(icon);
if (icon instanceof LazyIcon) {
setDisabledIcon(((LazyIcon) icon).disabled());
if (widget instanceof com.fr.form.ui.Button) {
com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget;
String iconName = button.getIconName();
if (StringUtils.isNotEmpty(iconName)) {
Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconName);
if (iimage != null) {
setIcon(new ImageIcon(iimage));
}
}
}
this.addMouseListener(this);
setMargin(new Insets(0, 0, 0, 0));
}
@Override
public void setIcon(Icon icon) {
if (icon instanceof ImageIcon) {
//自定义上传的图标在设计器工具栏显示需要按照16*16进行缩放
Image originalImage = ((ImageIcon) icon).getImage();
Image scaledImage = originalImage.getScaledInstance(ICON_WIDTH, ICON_HEIGHT, Image.SCALE_SMOOTH);
icon = new ImageIcon(scaledImage);
}
super.setIcon(icon);
}
/**
* 改变按钮的权限细粒度状态

2
designer-realize/src/main/java/com/fr/design/webattr/ToolBarPane.java

@ -154,7 +154,7 @@ public class ToolBarPane extends BasicBeanPane<ToolBar> {
this.validate();
this.repaint();
}
// this.getFToolBar().setBackground(toolbar.getBackground());
this.getFToolBar().setBackground(toolbar.getBackground());
this.getFToolBar().setDefault(toolbar.isDefault());
this.getFToolBar().setButtonBgColorMode(toolbar.getButtonBgColorMode());
setPopulateFinished(true);

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

@ -12,6 +12,7 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.editor.editor.Editor;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.ilable.UILabel;
@ -47,7 +48,9 @@ import java.awt.Component;
import java.awt.Container;
import java.awt.Dialog;
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.EventObject;
import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale;
@ -374,7 +377,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
ColumnRowGroupCellRenderer2 cellRenderer2 = new ColumnRowGroupCellRenderer2();
cellRenderer2.setHorizontalAlignment(SwingConstants.LEFT);
column2.setCellRenderer(cellRenderer2);
column2.setCellEditor(new ColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor()));
column2.setCellEditor(new SmartColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor()));
} else {
SelectedColumnValueTableCellRenderer renderer = new SelectedColumnValueTableCellRenderer();
renderer.setHorizontalAlignment(SwingConstants.LEFT);
@ -612,4 +615,24 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
}
}
}
protected class SmartColumnValueEditor extends ColumnValueEditor {
protected SmartColumnValueEditor(Editor<?>[] types) {
super(types);
}
/**
* 双击修改
* @param anEvent 事件
* @return 是否可编辑
*/
@Override
public boolean isCellEditable(EventObject anEvent) {
if (anEvent instanceof MouseEvent) {
return ((MouseEvent) anEvent).getClickCount() >= 2;
}
return true;
}
}
}

Loading…
Cancel
Save