Browse Source

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

fbp/release
Anner 1 month ago
parent
commit
377245fada
  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. 26
      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. 6
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java
  51. 19
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java
  52. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java
  53. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java
  54. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java
  55. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java
  56. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java
  57. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java
  58. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java
  59. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java
  60. 87
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java
  61. 1
      designer-realize/src/main/java/com/fanruan/boot/env/DesignFunctionComponent.java
  62. 34
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignAnalyzerComponent.java
  63. 5
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignDatasourceComponent.java
  64. 3
      designer-realize/src/main/java/com/fanruan/boot/env/function/app/DesignAppComponent.java
  65. 13
      designer-realize/src/main/java/com/fanruan/boot/pre/DesignPreStartComponent.java
  66. 3
      designer-realize/src/main/java/com/fr/design/actions/file/newReport/NewWorkBookAction.java
  67. 2
      designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java
  68. 31
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarButton.java
  69. 2
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarPane.java
  70. 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.FineClientProperties;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatComboBoxUI; import com.formdev.flatlaf.ui.FlatComboBoxUI;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import org.jetbrains.annotations.Nullable;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Rectangle;
/** /**
* 提供 {@link javax.swing.JComboBox} 的UI类 * 提供 {@link javax.swing.JComboBox} 的UI类
@ -47,8 +52,10 @@ public class FineComboBoxUI extends FlatComboBoxUI {
@Override @Override
public Dimension getMinimumSize(JComponent c) { public Dimension getMinimumSize(JComponent c) {
// ComboBox基于子组件计算适配尺寸性能一般,仅考虑部分ComboBox进行适配计算,其他采用默认值 // ComboBox基于子组件计算适配尺寸性能一般,仅考虑部分ComboBox进行适配计算,其他采用默认值
if (FineClientProperties.ADAPTIVE_COMBO_BOX.equals(getComboBoxTypeStr(c))) { if (isAdaptiveComboBox(c)) {
return super.getMinimumSize(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( return FineUIScale.scale(new Dimension(
FlatUIUtils.getUIInt("ComboBox.minimumWidth", 72), FlatUIUtils.getUIInt("ComboBox.minimumWidth", 72),
@ -56,12 +63,41 @@ public class FineComboBoxUI extends FlatComboBoxUI {
)); ));
} }
@Nullable static boolean isAdaptiveComboBox(JComponent c) {
static String getComboBoxTypeStr(JComponent c) {
Object value = c.getClientProperty(FineClientProperties.COMBO_BOX_TYPE); Object value = c.getClientProperty(FineClientProperties.COMBO_BOX_TYPE);
if (value instanceof String) { 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"); selectionBackground = UIManager.getColor("Table.background");
} }
setBackground(selectionBackground); setBackground(selectionBackground);
setText(value == null ? StringUtils.BLANK : String.valueOf(value));
setToolTipText(table, value, column); setToolTipText(table, value, column);
setBorder(border); setBorder(border);
setValue(value);
return this; 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.impl.storeproc.StoreProcedureHelper;
import com.fr.data.operator.DataOperator; import com.fr.data.operator.DataOperator;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.cache.DesignCacheManager;
import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.data.tabledata.wrapper.MultiResultTableDataNameWrapper; import com.fr.design.data.tabledata.wrapper.MultiResultTableDataNameWrapper;
import com.fr.design.data.tabledata.wrapper.MultiResultTableDataWrapper; 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) { private static void addServerData(java.util.Map<String, TableDataWrapper> resMap) {
Map<String, TableData> tableDataMap; Map<String, TableData> tableDataMap = TableDataFactory.getTableDatas();
if (DesignCacheManager.useDataCache()) {
FineLoggerFactory.getLogger().debug("use cache Table data wrapper.");
tableDataMap = DesignCacheManager.getCacheTableData().get();
} else {
tableDataMap = TableDataFactory.getTableDatas();
}
for (Entry<String, TableData> entry : tableDataMap.entrySet()) { for (Entry<String, TableData> entry : tableDataMap.entrySet()) {
if (globalDsCache.containsKey(entry.getKey())) { if (globalDsCache.containsKey(entry.getKey())) {
resMap.put(entry.getKey(), globalDsCache.get(entry.getKey())); resMap.put(entry.getKey(), globalDsCache.get(entry.getKey()));

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

@ -1,6 +1,8 @@
package com.fr.design.data.datapane; package com.fr.design.data.datapane;
import com.fr.design.constants.UIConstants;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map.Entry; import java.util.Map.Entry;
@ -43,22 +45,29 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC
this.treeName = treeName; this.treeName = treeName;
this.setRenderer(new UIComboBoxRenderer() { this.setRenderer(new UIComboBoxRenderer() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private boolean labelVisible = true;
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
JLabel renderer = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, 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.setIcon(null);
renderer.setText(StringUtils.EMPTY); 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; return renderer;
} }
@Override
public Dimension getPreferredSize() {
return labelVisible ? super.getPreferredSize() : new Dimension(super.getPreferredSize().width, 0);
}
}); });
refresh(source); refresh(source);
registerDSChangeListener(); registerDSChangeListener();
@ -75,6 +84,7 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC
setDsMap(); setDsMap();
DefaultComboBoxModel model = new DefaultComboBoxModel(); DefaultComboBoxModel model = new DefaultComboBoxModel();
this.setModel(model); this.setModel(model);
model.addElement(UIConstants.PENDING);
// 遍历添加所有数据项到模型 // 遍历添加所有数据项到模型
Iterator<Entry<String, TableDataWrapper>> entryIt = dsMap.entrySet().iterator(); Iterator<Entry<String, TableDataWrapper>> entryIt = dsMap.entrySet().iterator();
while (entryIt.hasNext()) { while (entryIt.hasNext()) {
@ -83,8 +93,6 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC
model.addElement(tableDataWrapper); model.addElement(tableDataWrapper);
} }
} }
// 设置默认选项为空白
this.setSelectedItem(null);
if (dataWrapper != null) { if (dataWrapper != null) {
if (DesignTableDataManager.isDsNameChanged(dataWrapper.getTableDataName())) { if (DesignTableDataManager.isDsNameChanged(dataWrapper.getTableDataName())) {
this.setSelectedTableDataByName(DesignTableDataManager.getChangedDsNameByOldDsName(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) { for (ServerDataSetBean bean : deleteDatas) {
TableDataRepository.getInstance().delete(bean); TableDataRepository.getInstance().delete(bean);
} }
TableDataRepository.getInstance().invalidCache();
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), 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.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.cache.DesignCacheManager;
import com.fr.design.data.BasicTableDataTreePane; import com.fr.design.data.BasicTableDataTreePane;
import com.fr.design.data.BasicTableDataUtils; import com.fr.design.data.BasicTableDataUtils;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
@ -461,7 +460,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
if (!ComparatorUtils.equals(oldName, tdName)) { if (!ComparatorUtils.equals(oldName, tdName)) {
map.put(oldName, tdName); map.put(oldName, tdName);
} }
DesignCacheManager.processByCacheTableData(() -> fireDSChanged(map)); fireDSChanged(map);
tc.fireTargetModified(); tc.fireTargetModified();
tc.parameterChanged(); tc.parameterChanged();
int[] rows = tableDataTree.getSelectionRows(); int[] rows = tableDataTree.getSelectionRows();
@ -1023,7 +1022,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
@Override @Override
public void actionPerformed(ActionEvent e) { 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() { BasicDialog basicDialog = basicPane.showSmallWindow(SwingUtilities.getWindowAncestor(TableDataTreePane.this), new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
DesignCacheManager.processByCacheTableData(this::processRemove); processRemove();
} }
private void processRemove() { private void processRemove() {
@ -1203,7 +1202,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
DesignCacheManager.processByCacheTableData(this::doPaste); doPaste();
} }
private void 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()) { if (!WorkContext.getCurrent().isLocal()) {
EventDispatcher.fire(RemoteConfigEvent.EDIT, "ConnectionConfig"); EventDispatcher.fire(RemoteConfigEvent.EDIT, "ConnectionConfig");
} }
ConnectionRepository.getInstance().invalidCache();
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
throw 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; package com.fr.design.data.datapane.connect;
import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; 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.DriverClassNotFoundException;
import com.fr.data.driver.DriverLoader;
import com.fr.data.driver.config.DriverLoaderConfig;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.decision.webservice.bean.datasource.ConnectionInfoBean; import com.fr.decision.webservice.bean.datasource.ConnectionInfoBean;
import com.fr.decision.webservice.exception.general.DriverNotFoundException; 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.data.datapane.preview.ConnectionInfoBeanHelper;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.security.encryption.transmission.TransmissionEncryptionManager;
import com.fr.workspace.engine.exception.DriverUnExistException; import com.fr.workspace.engine.exception.DriverUnExistException;
import com.fr.workspace.server.repository.connection.BaseConnectionSource; import com.fr.workspace.server.repository.connection.BaseConnectionSource;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 本地Connection资源操作 * 本地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 @Override
public boolean lock(String str) { 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()); type.addActionListener(e -> changePaneForType());
fileChooserButton.addActionListener(e -> { 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); int type = fileChooser.showOpenDialog(SshPane.this, StringUtils.EMPTY);
if (type == FILEChooserPane.OK_OPTION) { if (type == FILEChooserPane.OK_OPTION) {
final FILE file = fileChooser.getSelectedFILE(); 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.UpdateAction;
import com.fr.design.actions.file.LocateAction; import com.fr.design.actions.file.LocateAction;
import com.fr.design.actions.template.NewWorkBookToolButtonAction; import com.fr.design.actions.template.NewWorkBookToolButtonAction;
import com.fr.design.cache.DesignCacheManager;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.MenuHandler; import com.fr.design.fun.MenuHandler;
@ -837,13 +836,13 @@ public class MultiTemplateTabPane extends Row {
setIsCloseCurrent(true); setIsCloseCurrent(true);
} }
closeFormat(template); closeFormat(template);
DesignCacheManager.processByCacheTableData(() -> closeSpecifiedTemplate(template)); closeSpecifiedTemplate(template);
DesignerContext.getDesignerFrame().getContentFrame().repaint(); DesignerContext.getDesignerFrame().getContentFrame().repaint();
isShowList = false; isShowList = false;
} else { } else {
//没有点击关闭和ListDown按钮,则切换到点击的模板处 //没有点击关闭和ListDown按钮,则切换到点击的模板处
closeIconIndex = -1; closeIconIndex = -1;
DesignCacheManager.processByCacheTableData(() -> switchJTemplate(getTemplateIndex(evtX))); switchJTemplate(getTemplateIndex(evtX));
clodeIcon = new LazyIcon("clear"); clodeIcon = new LazyIcon("clear");
switchJTemplate(getTemplateIndex(evtX)); switchJTemplate(getTemplateIndex(evtX));
isShowList = false; 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.fanruan.repository.TemplateRepository;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.cache.DesignCacheManager;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.TemplateTreeDefineProcessor; import com.fr.design.fun.TemplateTreeDefineProcessor;
import com.fr.design.gui.itree.filetree.TemplateFileTree; import com.fr.design.gui.itree.filetree.TemplateFileTree;
@ -105,7 +104,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
return; return;
} }
if (evt.getClickCount() == 2) { 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(); 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.setBackground(list.getBackground());
this.setForeground(list.getForeground()); this.setForeground(list.getForeground());
} }
if (cellHasFocus) {
this.setBorder(UIManager.getBorder("List.focusCellHighlightBorder"));
} else {
this.setBorder(NO_FOCUS_BORDER);
}
return this; 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.ActionEvent;
import java.awt.event.ActionListener; 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.row;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
@ -37,7 +36,7 @@ public class ReportletPane extends BasicPane {
UILabel tipLabel = new UILabel(); 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.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")); 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); this.add(centerPane, BorderLayout.CENTER);
switchButton = new UIButton("switch"); switchButton = new UIButton("switch");
@ -53,13 +52,14 @@ public class ReportletPane extends BasicPane {
cardPane.setLayout(card = new CardLayout()); cardPane.setLayout(card = new CardLayout());
templateReportletTree = new TemplateFileTree(); templateReportletTree = new TemplateFileTree();
templateReportletTree.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal")); templateReportletTree.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal"));
templateReportletTree.setBorder(FineBorderFactory.createWrappedRoundBorder());
IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt", ".class", ".frm", ".form", ".cptx"}); IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt", ".class", ".frm", ".form", ".cptx"});
templateReportletTree.setFileNodeFilter(filter); templateReportletTree.setFileNodeFilter(filter);
cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE"); cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE");
classReportletTree = new ClassFileTree(); classReportletTree = new ClassFileTree();
cardPane.add(c_panel = new JScrollPane(classReportletTree), "CLASS"); 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(); 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 javax.swing.*;
import com.fine.theme.utils.FineUIScale;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.design.mainframe.widget.wrappers.BackgroundWrapper; import com.fr.design.mainframe.widget.wrappers.BackgroundWrapper;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
@ -29,7 +30,7 @@ public class AccessibleBackgroundEditor extends UneditableAccessibleEditor {
protected void showEditorPane() { protected void showEditorPane() {
if (backgroundPane == null) { if (backgroundPane == null) {
backgroundPane = new BackgroundPane(); backgroundPane = new BackgroundPane();
backgroundPane.setPreferredSize(new Dimension(600, 400)); backgroundPane.setPreferredSize(FineUIScale.createScaleDimension(600, 400));
} }
BasicDialog dlg = backgroundPane.showWindow(SwingUtilities.getWindowAncestor(this)); BasicDialog dlg = backgroundPane.showWindow(SwingUtilities.getWindowAncestor(this));
dlg.addDialogActionListener(new DialogActionAdapter() { 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 com.fr.workspace.WorkContext;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.KeyStroke;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import static com.fine.theme.utils.FineUIScale.createScaleDimension; import static com.fine.theme.utils.FineUIScale.createScaleDimension;
import static com.fine.theme.utils.FineUIScale.unscale; 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 static final String TITLE = "Remote Design NetWork";
public RemoteDesignNetWorkAction() { public RemoteDesignNetWorkAction() {
setName(TITLE); this.setName(TITLE);
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, DEFAULT_MODIFIER));
} }
@Override @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 com.fr.stable.StringUtils;
import javax.swing.UIManager;
import java.awt.Color;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
@ -14,6 +16,9 @@ import java.util.Date;
* Created on 2024/10/11 * Created on 2024/10/11
*/ */
public class RemoteDesignNetWorkHelper { public class RemoteDesignNetWorkHelper {
static final Color DEFAULT_COLOR = UIManager.getColor("Table.foreground");
private static final int UNIT = 1000; private static final int UNIT = 1000;
private static final int UNIT_BYTES = 1024; private static final int UNIT_BYTES = 1024;
private static final String SECOND = "s"; 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("request");
model.addColumn("response"); model.addColumn("response");
uiTable = new JTable(model); 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.setRowSorter(new RemoteDesignNetWorkTableRowSorter(model));
uiTable.getTableHeader().setDefaultRenderer(new HeaderRenderer());
add(new JScrollPane(uiTable), BorderLayout.CENTER); 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(4, Comparator.comparingLong(RemoteDesignNetWorkHelper::parseCostToMS));
setComparator(5, Comparator.comparingLong(RemoteDesignNetWorkHelper::parseSizeToBytes)); setComparator(5, Comparator.comparingLong(RemoteDesignNetWorkHelper::parseSizeToBytes));
setComparator(6, Comparator.comparingLong(RemoteDesignNetWorkHelper::parseSizeToBytes)); setComparator(6, Comparator.comparingLong(RemoteDesignNetWorkHelper::parseSizeToBytes));
setMaxSortKeys(1);
} }
@Override @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()); quickPane = BackgroundFactory.createIfAbsent(background == null ? null : background.getClass());
cacheMap.put(index, quickPane); cacheMap.put(index, quickPane);
} }
tabbedPane.setSelectedIndex(index);
return quickPane; 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() { 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(); Color[] colorArray = this.getColorArray();
for (int i = 0; i < colorArray.length; i++) { for (int i = 0; i < colorArray.length; i++) {
Color color = colorArray[i] == null ? UsedColorPane.DEFAULT_COLOR : colorArray[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.cell;
import static com.fine.swing.ui.layout.Layouts.row; 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 { public class IconDefinePane extends BasicPane {
@ -66,8 +68,9 @@ public class IconDefinePane extends BasicPane {
showIconImageLable.setIcon(null); showIconImageLable.setIcon(null);
} }
}); });
JPanel iconButtonPane = row(LayoutConstants.HORIZONTAL_GAP, cell(this.showIconImageLable),
JPanel iconButtonPane = row(LayoutConstants.HORIZONTAL_GAP, cell(this.showIconImageLable), cell(this.editIconButton), cell(this.removeIconButton)).getComponent(); column(flex(), row(LayoutConstants.HORIZONTAL_GAP, cell(this.editIconButton), cell(this.removeIconButton)), flex())
).getComponent();
iconButtonPane.setBorder(new ScaledEmptyBorder(0,0,0,0)); iconButtonPane.setBorder(new ScaledEmptyBorder(0,0,0,0));
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(iconButtonPane, BorderLayout.CENTER); this.add(iconButtonPane, BorderLayout.CENTER);
@ -92,16 +95,6 @@ public class IconDefinePane extends BasicPane {
setShowIconImage(); setShowIconImage();
} }
/**
* 直接更新icon
* @param iconName
* @param icon
*/
public void populateIcon(String iconName, Icon icon) {
this.curIconName = iconName;
showIconImageLable.setIcon(icon);
}
public String update() { public String update() {
return this.curIconName; 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; package com.fr.design.widget.component;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; 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.cell;
import static com.fine.swing.ui.layout.Layouts.column; 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.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT; import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_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); backgroundHead = new UIButtonGroup(titles);
panel = column(VERTICAL_GAP, panel = column(VERTICAL_GAP,
row( row(
flex(LEFT_WEIGHT),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Initial"))).weight(RIGHT_WEIGHT / 2), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Initial"))).weight(RIGHT_WEIGHT / 2),
cell(initialBackgroundEditor).weight(RIGHT_WEIGHT / 2) cell(initialBackgroundEditor).weight(RIGHT_WEIGHT / 2)
), ),
row( row(
flex(LEFT_WEIGHT),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Over"))).weight(RIGHT_WEIGHT / 2), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Over"))).weight(RIGHT_WEIGHT / 2),
cell(overBackgroundEditor).weight(RIGHT_WEIGHT / 2) cell(overBackgroundEditor).weight(RIGHT_WEIGHT / 2)
), ),
row( row(
flex(LEFT_WEIGHT),
cell(getClickLabel()).weight(RIGHT_WEIGHT / 2), cell(getClickLabel()).weight(RIGHT_WEIGHT / 2),
cell(clickBackgroundEditor).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, this.add(column(VERTICAL_GAP,
row( row(
cell(headLabel).weight(LEFT_WEIGHT), cell(headLabel).weight(LEFT_WEIGHT),
cell(backgroundHead).weight(RIGHT_WEIGHT) cell(backgroundHead).weight(RIGHT_WEIGHT)
) ),
cell(panel)
).getComponent()); ).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(); helpButton.set4ToolbarButton();
buttonGroup.add(row(5, cell(UpdateCheckBox), checkBoxUpdatePane.add(row(5, cell(UpdateCheckBox), cell(helpButton)).getComponent());
cell(helpButton))); buttonGroup.add(cell(checkBoxUpdatePane));
controlBtnPane.add(column(5, buttonGroup.toArray(new Layouts.Cell[0])).getComponent()); 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.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.server.repository.tabledata.TableDataRepository; import com.fr.workspace.server.repository.tabledata.TableDataRepository;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@ -98,6 +99,9 @@ public class FileDataFILE extends FileNodeFILE{
FileDataFILE root = null; FileDataFILE root = null;
if (!this.builded) { if (!this.builded) {
root = buildTree(); root = buildTree();
if (root == null) {
return new FILE[0];
}
FileDataFILE dataFILE = root.getFileDataFILE(this.id); FileDataFILE dataFILE = root.getFileDataFILE(this.id);
this.setChildren(dataFILE.getChildren()); this.setChildren(dataFILE.getChildren());
this.setType(dataFILE.getType()); this.setType(dataFILE.getType());
@ -125,7 +129,7 @@ public class FileDataFILE extends FileNodeFILE{
return null; return null;
} }
private FileDataFILE buildTree() { private @Nullable FileDataFILE buildTree() {
List<FileNodeBean> beans = TableDataRepository.getInstance().getFileList(type); List<FileNodeBean> beans = TableDataRepository.getInstance().getFileList(type);
Map<String, FileDataFILE> tree = new HashMap<>(); Map<String, FileDataFILE> tree = new HashMap<>();
FileDataFILE root = null; 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.cell;
import static com.fine.swing.ui.layout.Layouts.column; 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 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 = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
colorSelectBox.setSelectObject(WidgetThemeDisplayConstants.DEFAULT_THEME_COLOR); colorSelectBox.setSelectObject(WidgetThemeDisplayConstants.DEFAULT_THEME_COLOR);
widgetBgColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); widgetBgColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
widgetBgAlphaDragPane = new UINumberDragPaneWithPercent(0, 100, 1); widgetBgAlphaDragPane = new UIPercentDragPane();
initLineBox(); initLineBox();
borderRadiusSpinner = new UISpinner(0, Integer.MAX_VALUE, 1); borderRadiusSpinner = new UISpinner(0, Integer.MAX_VALUE, 1);
iconColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); 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", "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" : "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.border = com.fine.theme.light.ui.FineRoundBorder
ComboBox.padding = @componentMargin ComboBox.padding = @componentMargin
ComboBox.minimumWidth = 72 ComboBox.minimumWidth = 72
ComboBox.maximumWidth = 400
ComboBox.editorColumns = 0 ComboBox.editorColumns = 0
ComboBox.maximumRowCount = 15 ComboBox.maximumRowCount = 15
[mac]ComboBox.showPopupOnNavigation = true [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; package com.fr.design.chartx.component;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chartx.TwoTuple; import com.fr.chartx.TwoTuple;
@ -48,8 +47,8 @@ import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import static com.fine.theme.utils.FineClientProperties.ADAPTIVE_COMBO_BOX; import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.theme.utils.FineClientProperties.COMBO_BOX_TYPE; import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIScale.scale; import static com.fine.theme.utils.FineUIScale.scale;
/** /**
@ -102,12 +101,13 @@ public class MapAreaMatchPane extends BasicBeanPane<MapMatchResult> {
} }
private JPanel createContentPane() { private JPanel createContentPane() {
tableNameCombox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX); return row(10,
areaNameBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX); cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data") + ":")),
return FineLayoutBuilder.createHorizontalLayout(10, cell(tableNameCombox).weight(1),
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data") + ":"), tableNameCombox, cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Name") + ":")),
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Name") + ":"), areaNameBox, cell(areaNameBox).weight(1),
refreshLabel); cell(refreshLabel)
).getComponent();
} }
private void initTable(TwoTuple<DefaultMutableTreeNode, Set<String>> treeNodeAndItems) { private void initTable(TwoTuple<DefaultMutableTreeNode, Set<String>> treeNodeAndItems) {

6
designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java

@ -17,6 +17,8 @@ import java.awt.Toolkit;
import java.awt.event.AWTEventListener; import java.awt.event.AWTEventListener;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import static com.fine.theme.utils.FineUIScale.scale;
//august: //august:
public class FormWidgetPopWindow extends JWindow { public class FormWidgetPopWindow extends JWindow {
private WidgetOption[] options; private WidgetOption[] options;
@ -127,8 +129,8 @@ public class FormWidgetPopWindow extends JWindow {
public Dimension preferredLayoutSize(Container parent) { public Dimension preferredLayoutSize(Container parent) {
Insets insets = parent.getInsets(); Insets insets = parent.getInsets();
int nmembers = parent.getComponentCount(); int nmembers = parent.getComponentCount();
return new Dimension(maxLine * 28 + insets.left + insets.right + right + left, (nmembers / maxLine + 1) return new Dimension(maxLine * scale(28) + insets.left + insets.right + scale(right) + scale(left),
* 24 + insets.top + insets.bottom + top + bottom); (int) Math.ceil((float) nmembers / maxLine) * scale(26) + insets.top + insets.bottom + scale(top) + scale(bottom));
} }
@Override @Override

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; 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.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.stable.StringUtils;
import javax.swing.Icon;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -16,11 +19,21 @@ public abstract class AbstractMultiSelectionArrangementButton extends UIButton i
public AbstractMultiSelectionArrangementButton(MultiSelectionArrangement arrangement) { public AbstractMultiSelectionArrangementButton(MultiSelectionArrangement arrangement) {
super(); super();
this.arrangement = arrangement; this.arrangement = arrangement;
this.setNormalPainted(false);
this.setBorderPaintedOnlyWhenPressed(true);
this.setIcon(getIcon());
this.setToolTipText(getTipText()); this.setToolTipText(getTipText());
this.addActionListener(getActionListener()); 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 @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.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class BottomAlignButton extends AbstractMultiSelectionArrangementButton { public class BottomAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 2397455240682353024L; private static final long serialVersionUID = 2397455240682353024L;
@ -15,8 +12,8 @@ public class BottomAlignButton extends AbstractMultiSelectionArrangementButton {
} }
@Override @Override
public Icon getIcon() { public String getIconId() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_bottom_align.png"); return "arrange_bottom_align";
} }
@Override @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.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class HorizontalCenterButton extends AbstractMultiSelectionArrangementButton { public class HorizontalCenterButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 6290178236460051049L; private static final long serialVersionUID = 6290178236460051049L;
@ -15,8 +12,8 @@ public class HorizontalCenterButton extends AbstractMultiSelectionArrangementBut
} }
@Override @Override
public Icon getIcon() { public String getIconId() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_horizontal_center_align.png"); return "arrange_horizontal_center";
} }
@Override @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.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class HorizontalDistributionButton extends AbstractMultiSelectionArrangementButton { public class HorizontalDistributionButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 5052092252720664954L; private static final long serialVersionUID = 5052092252720664954L;
@ -15,8 +12,8 @@ public class HorizontalDistributionButton extends AbstractMultiSelectionArrangem
} }
@Override @Override
public Icon getIcon() { public String getIconId() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_horizontal_auto_spacing.png"); return "arrange_horizontal_distribute";
} }
@Override @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.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class LeftAlignButton extends AbstractMultiSelectionArrangementButton { public class LeftAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = -8177637788632733710L; private static final long serialVersionUID = -8177637788632733710L;
@ -15,8 +12,8 @@ public class LeftAlignButton extends AbstractMultiSelectionArrangementButton {
} }
@Override @Override
public Icon getIcon() { public String getIconId() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_left_align.png"); return "arrange_left_align";
} }
@Override @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.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class RightAlignButton extends AbstractMultiSelectionArrangementButton { public class RightAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = -8698936349956288409L; private static final long serialVersionUID = -8698936349956288409L;
@ -15,8 +12,8 @@ public class RightAlignButton extends AbstractMultiSelectionArrangementButton {
} }
@Override @Override
public Icon getIcon() { public String getIconId() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_right_align.png"); return "arrange_right_align";
} }
@Override @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.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class TopAlignButton extends AbstractMultiSelectionArrangementButton { public class TopAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 2896267783075870924L; private static final long serialVersionUID = 2896267783075870924L;
@ -15,8 +12,8 @@ public class TopAlignButton extends AbstractMultiSelectionArrangementButton {
} }
@Override @Override
public Icon getIcon() { public String getIconId() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_top_align.png"); return "arrange_top_align";
} }
@Override @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.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class VerticalCenterButton extends AbstractMultiSelectionArrangementButton { public class VerticalCenterButton extends AbstractMultiSelectionArrangementButton {
public VerticalCenterButton(MultiSelectionArrangement arrangement) { public VerticalCenterButton(MultiSelectionArrangement arrangement) {
@ -13,8 +10,8 @@ public class VerticalCenterButton extends AbstractMultiSelectionArrangementButto
} }
@Override @Override
public Icon getIcon() { public String getIconId() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_vertical_center_align.png"); return "arrange_vertical_center";
} }
@Override @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.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class VerticalDistributionButton extends AbstractMultiSelectionArrangementButton { public class VerticalDistributionButton extends AbstractMultiSelectionArrangementButton {
public VerticalDistributionButton(MultiSelectionArrangement arrangement) { public VerticalDistributionButton(MultiSelectionArrangement arrangement) {
@ -13,8 +10,8 @@ public class VerticalDistributionButton extends AbstractMultiSelectionArrangemen
} }
@Override @Override
public Icon getIcon() { public String getIconId() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_vertical_auto_spacing.png"); return "arrange_vertical_distribute";
} }
@Override @Override

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

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

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

@ -1,6 +1,5 @@
package com.fanruan.boot.env; package com.fanruan.boot.env;
import com.fanruan.carina.annotions.ActivatorRefer;
import com.fanruan.carina.annotions.DependsOn; import com.fanruan.carina.annotions.DependsOn;
import com.fanruan.carina.annotions.FineComponent; import com.fanruan.carina.annotions.FineComponent;
import com.fanruan.carina.annotions.Start; 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.Start;
import com.fanruan.carina.annotions.Supplemental; import com.fanruan.carina.annotions.Supplemental;
import com.fanruan.carina.core.partition.ResourceAffiliate; 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.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.advice.FineAdviceAssistant;
import com.fr.record.analyzer.configuration.AnalyzerAssemblyFactory; import com.fr.record.analyzer.configuration.AnalyzerAssemblyFactory;
import com.fr.record.analyzer.configuration.FineAnalyzerAssemblyFactory; 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 org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List; 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.datapane.connect.LocalConnectionSource;
import com.fr.design.data.tabledata.LocalTableDataSource; import com.fr.design.data.tabledata.LocalTableDataSource;
import com.fr.file.TableDataConfigWrapper; 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.ConnectionWriterShell;
import com.fr.workspace.server.repository.connection.LocalConnectionShell; import com.fr.workspace.server.repository.connection.LocalConnectionShell;
import com.fr.workspace.server.repository.tabledata.LocalTableDataShell; 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 @Stop
public void 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.AppGroup;
import com.fr.design.mainframe.JTemplateFactory; import com.fr.design.mainframe.JTemplateFactory;
import com.fr.nx.app.designer.CptxApp; import com.fr.nx.app.designer.CptxApp;
import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -43,7 +44,7 @@ public class DesignAppComponent {
*/ */
@Stop @Stop
public void stop() { public void stop() {
RemoteAuthorityRepository.getInstance().invalidCache();
List<App> appList = new ArrayList<>(Carina.getApplicationContext().group(AppGroup.class).getAll()); List<App> appList = new ArrayList<>(Carina.getApplicationContext().group(AppGroup.class).getAll());
for (App app : appList) { for (App app : appList) {
JTemplateFactory.remove(app); JTemplateFactory.remove(app);

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

@ -1,12 +1,6 @@
package com.fanruan.boot.pre; package com.fanruan.boot.pre;
import com.fanruan.boot.FSProperties; 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.boot.key.StartupArgsShell;
import com.fanruan.carina.Carina; import com.fanruan.carina.Carina;
import com.fanruan.carina.annotions.FineComponent; 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.ConfigRealm;
import com.fanruan.config.realm.ConfigRepositoryFactory; import com.fanruan.config.realm.ConfigRepositoryFactory;
import com.fanruan.config.realm.local.LocalConfigRepositoryBuilder; 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.CarinaMQ;
import com.fanruan.mq.InternalMQProvider; import com.fanruan.mq.InternalMQProvider;
import com.fanruan.product.ProductConstants;
import com.fr.base.function.UITerminator; import com.fr.base.function.UITerminator;
import com.fr.carina.util.CarinaResourceUtils; import com.fr.carina.util.CarinaResourceUtils;
import com.fr.carina.util.provider.CarinaResourceProvider; 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.DesignerEnvManager;
import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.constants.DesignerLaunchStatus;
import com.fr.design.deeplink.DeepLinkManager; 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.runtime.FineRuntime;
import com.fr.stable.CommonCodeUtils; import com.fr.stable.CommonCodeUtils;
import com.fr.stable.CommonUtils; import com.fr.stable.CommonUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.lifecycle.FineLifecycleFatalError; import com.fr.stable.lifecycle.FineLifecycleFatalError;
import com.fr.stable.project.ProjectConstants; 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.fine.theme.icon.LazyIcon;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.cache.DesignCacheManager;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JWorkBook; import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
@ -35,7 +34,7 @@ public class NewWorkBookAction extends UpdateAction {
* @param e 事件 * @param e 事件
*/ */
public void actionPerformed(ActionEvent 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() { 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.icon.setSelected(button.isShowIcon());
this.text.setSelected(button.isShowText()); this.text.setSelected(button.isShowText());
this.nameField.setText(button.getText()); 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; 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.base.vcs.DesignerMode;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext; 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.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.stable.StringUtils;
import com.fr.form.ui.WidgetInfoConfig;
import java.awt.Insets; import java.awt.Insets;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.ImageIcon;
public class ToolBarButton extends UIButton implements MouseListener { public class ToolBarButton extends UIButton implements MouseListener {
private Widget widget; private Widget widget;
private WidgetOption no; 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) { public ToolBarButton(Icon icon, Widget widget) {
this(null, icon, widget); this(null, icon, widget);
@ -30,15 +36,30 @@ public class ToolBarButton extends UIButton implements MouseListener {
public ToolBarButton(String text, Icon icon, Widget widget) { public ToolBarButton(String text, Icon icon, Widget widget) {
super(text, icon); super(text, icon);
this.widget = widget; this.widget = widget;
//直接设置Icon图标 if (widget instanceof com.fr.form.ui.Button) {
setIcon(icon); com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget;
if (icon instanceof LazyIcon) { String iconName = button.getIconName();
setDisabledIcon(((LazyIcon) icon).disabled()); if (StringUtils.isNotEmpty(iconName)) {
Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconName);
if (iimage != null) {
setIcon(new ImageIcon(iimage));
}
}
} }
this.addMouseListener(this); this.addMouseListener(this);
setMargin(new Insets(0, 0, 0, 0)); 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.validate();
this.repaint(); this.repaint();
} }
// this.getFToolBar().setBackground(toolbar.getBackground()); this.getFToolBar().setBackground(toolbar.getBackground());
this.getFToolBar().setDefault(toolbar.isDefault()); this.getFToolBar().setDefault(toolbar.isDefault());
this.getFToolBar().setButtonBgColorMode(toolbar.getButtonBgColorMode()); this.getFToolBar().setButtonBgColorMode(toolbar.getButtonBgColorMode());
setPopulateFinished(true); 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.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.editor.ValueEditorPaneFactory; 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.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -47,7 +48,9 @@ import java.awt.Component;
import java.awt.Container; import java.awt.Container;
import java.awt.Dialog; import java.awt.Dialog;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.EventObject;
import java.util.List; import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale; import static com.fine.theme.utils.FineUIScale.scale;
@ -374,7 +377,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
ColumnRowGroupCellRenderer2 cellRenderer2 = new ColumnRowGroupCellRenderer2(); ColumnRowGroupCellRenderer2 cellRenderer2 = new ColumnRowGroupCellRenderer2();
cellRenderer2.setHorizontalAlignment(SwingConstants.LEFT); cellRenderer2.setHorizontalAlignment(SwingConstants.LEFT);
column2.setCellRenderer(cellRenderer2); column2.setCellRenderer(cellRenderer2);
column2.setCellEditor(new ColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor())); column2.setCellEditor(new SmartColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor()));
} else { } else {
SelectedColumnValueTableCellRenderer renderer = new SelectedColumnValueTableCellRenderer(); SelectedColumnValueTableCellRenderer renderer = new SelectedColumnValueTableCellRenderer();
renderer.setHorizontalAlignment(SwingConstants.LEFT); 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