Browse Source

Merge remote-tracking branch 'origin/newui' into newui

newui
lemon 4 months ago
parent
commit
2afd801e30
  1. 15
      designer-base/src/main/java/com/fine/theme/icon/IconManager.java
  2. 54
      designer-base/src/main/java/com/fine/theme/light/ui/FinePanelUI.java
  3. 4
      designer-base/src/main/java/com/fine/theme/utils/FineClientProperties.java
  4. 15
      designer-base/src/main/java/com/fine/theme/utils/FineUIConstants.java
  5. 7
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  6. 3
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  7. 1
      designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java
  8. 10
      designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java
  9. 15
      designer-base/src/main/java/com/fr/design/border/FineBorderFactory.java
  10. 2
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java
  11. 11
      designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java
  12. 62
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  13. 4
      designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java
  14. 3
      designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java
  15. 8
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  16. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java
  17. 35
      designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java
  18. 19
      designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java
  19. 139
      designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationPane.java
  20. 4
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  21. 17
      designer-base/src/main/java/com/fr/design/gui/itable/UITable.java
  22. 22
      designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java
  23. 4
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/ClassFileTree.java
  24. 15
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java
  25. 4
      designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java
  26. 6
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/LabelUtils.java
  27. 12
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java
  28. 2
      designer-base/src/main/java/com/fr/design/present/FormulaPresentPane.java
  29. 26
      designer-base/src/main/java/com/fr/env/detect/ui/EnvDetectorDialog.java
  30. 95
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  31. 3
      designer-base/src/main/java/com/fr/file/FileFILE.java
  32. 5
      designer-base/src/main/java/com/fr/file/FileNodeFILE.java
  33. 20
      designer-base/src/main/resources/com/fine/theme/icon/dataset/server_database_warning.svg
  34. 13
      designer-base/src/main/resources/com/fine/theme/icon/widget/apply_components.svg
  35. 13
      designer-base/src/main/resources/com/fine/theme/icon/widget/apply_components_disable.svg
  36. 17
      designer-base/src/main/resources/com/fine/theme/icon/widget/prewidget.svg
  37. 17
      designer-base/src/main/resources/com/fine/theme/icon/widget/prewidget_disable.svg
  38. 2
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  39. 2
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties
  40. 27
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  41. 26
      designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java
  42. 52
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  43. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java
  44. 8
      designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java
  45. 30
      designer-chart/src/main/java/com/fr/van/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java
  46. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java
  47. 5
      designer-chart/src/main/java/com/fr/van/chart/map/designer/VanChartGroupPane.java
  48. 2
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java
  49. 3
      designer-chart/src/main/java/com/fr/van/chart/scatter/data/VanChartScatterPlotTableDataContentPane.java
  50. 136
      designer-form/src/main/java/com/fr/design/parameter/ParameterToolBarPane.java
  51. 4
      designer-realize/src/main/java/com/fr/design/actions/server/WidgetManagerAction.java
  52. 4
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java
  53. 2
      designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java
  54. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java
  55. 3
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/CellDesensitizationTableModel.java
  56. 8
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellEditor.java
  57. 62
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java
  58. 7
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellRender.java
  59. 3
      designer-realize/src/main/java/com/fr/design/sort/common/SortUIExpandablePane.java
  60. 62
      designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java
  61. 67
      designer-realize/src/main/java/com/fr/design/widget/EastCellWidgetCardPane.java
  62. 29
      designer-realize/src/main/java/com/fr/design/widget/ValueWidgetPane.java
  63. 9
      designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java
  64. 44
      designer-realize/src/main/java/com/fr/design/widget/ui/DateEditorDefinePane.java
  65. 2
      designer-realize/src/main/java/com/fr/start/MainDesigner.java
  66. 12
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

15
designer-base/src/main/java/com/fine/theme/icon/IconManager.java

@ -144,6 +144,21 @@ public class IconManager {
|| FileExtension.JPG.matchExtension(path);
}
/**
* 判断是否存在指定id的icon非io读取行为而是从已注册的sourceMap中遍历判断
*
* @param id id
* @return 是否存在
*/
public static boolean existIcon(String id) {
for (IconSet set : ICON_SETS) {
if (set.getIds().contains(id)) {
return true;
}
}
return false;
}
/**
* 清理所有缓存
*/

54
designer-base/src/main/java/com/fine/theme/light/ui/FinePanelUI.java

@ -0,0 +1,54 @@
package com.fine.theme.light.ui;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatPanelUI;
import org.jetbrains.annotations.Nullable;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.plaf.ComponentUI;
import static com.fine.theme.utils.FineClientProperties.PANEL_TYPE;
import static com.fine.theme.utils.FineClientProperties.ROUNDED_PANEL;
/**
* Panel 面板UI
*
* @author Levy.Xie
* @since 11.0
* Created on 2024/08/02
*/
public class FinePanelUI extends FlatPanelUI {
/**
* @param shared
* @since 2
*/
protected FinePanelUI(boolean shared) {
super(shared);
}
/**
* 创建UI
*/
public static ComponentUI createUI(JComponent c) {
return new FinePanelUI(false);
}
@Override
protected void installDefaults(JPanel p) {
super.installDefaults(p);
if (ROUNDED_PANEL.equals(getPanelTypeStr(p))) {
this.arc = FineUIUtils.getUIInt("Panel.arc", "Component.arc");
}
}
@Nullable
static String getPanelTypeStr(JPanel p) {
Object value = p.getClientProperty(PANEL_TYPE);
if (value instanceof String) {
return (String) value;
}
return null;
}
}

4
designer-base/src/main/java/com/fine/theme/utils/FineClientProperties.java

@ -24,6 +24,10 @@ public interface FineClientProperties extends FlatClientProperties {
String BUTTON_GROUP_POSITION = "group_position";
//--------------------------- Panel ----------------------------
String PANEL_TYPE = "panelType";
String ROUNDED_PANEL = "roundedPanel";
int GROUP_BUTTON_POSITION_INNER = 0;
int GROUP_BUTTON_POSITION_LEFT = 1;
int GROUP_BUTTON_POSITION_RIGHT = 2;

15
designer-base/src/main/java/com/fine/theme/utils/FineUIConstants.java

@ -0,0 +1,15 @@
package com.fine.theme.utils;
/**
* 主题UI常量
*
* @author Levy.Xie
* @since 11.0
* Created on 2024/08/05
*/
public class FineUIConstants {
public static final int SCALE_FONT_SIZE_12 = FineUIScale.scale(12);
public static final int SCALE_FONT_SIZE_13 = FineUIScale.scale(13);
}

7
designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java

@ -33,13 +33,16 @@ public interface FineUIStyle {
String PLAIN_BUTTON = "plainButton";
String TOGGLE_GROUP = "inToggleGroup";
String COMPACT_BUTTON = "compactButton";
String ROUND_BORDER_PANEL = "roundBorder";
String MENU_TOOL_BAR = "menuToolBar";
String MENU_ITEM_TOOL_BAR = "menuItemToolBar";
String POPUP_MENU_TOOL_BAR = "popupMenuToolBar";
String POPUP_MENU_DROPDOWN = "dropdownPopupMenu";
String TRANSPARENT_TEXT_FIELD = "transparentTextField";
String PURE_LIST = "pureList";
String PURE_TREE = "pureTree";
String PASTEL_BUTTON = "pastelButton";
String ENV_DECTETOR_BUTTON = "envDetectorButton";
/**

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

@ -114,6 +114,7 @@ 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.fix;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIConstants.SCALE_FONT_SIZE_12;
import static com.fr.design.i18n.Toolkit.i18nText;
/**
@ -810,7 +811,7 @@ public class PreferencePane extends BasicPane {
i++;
}
UIDictionaryComboBox<Locale> languageComboBox = new UIDictionaryComboBox<>(keys, values);
languageComboBox.setFont(FRFont.getInstance("Dialog", Font.PLAIN, 12));//为了在中文系统中显示韩文
languageComboBox.setFont(FRFont.getInstance("Dialog", Font.PLAIN, SCALE_FONT_SIZE_12));//为了在中文系统中显示韩文
return languageComboBox;
}

1
designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java

@ -51,6 +51,7 @@ public class AboutDialog extends JDialog implements ActionListener {
tabbedPane = FineTabbedPane.builder()
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_About"), aboutPanel)
.addTab(com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Basic_System"), sysPane)
.withHeadRatio(0.3f)
.build();
buttonPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();

10
designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java

@ -60,7 +60,7 @@ public class AboutPane extends JPanel {
JPanel contentPane = column().getComponent();
centerPane.add(contentPane, BorderLayout.NORTH);
contentPane.add(new BoxCenterAligmentPane(getBuildTitle()));
contentPane.add(new BoxCenterAligmentPane(getBuildTitle(), FineUIStyle.LABEL_BOLD));
BoxCenterAlignmentCopyablePane buildCopyPane = new BoxCenterAlignmentCopyablePane(
StringUtils.EMPTY,
getVersionBuildNO(),
@ -73,7 +73,8 @@ public class AboutPane extends JPanel {
BoxCenterAligmentPane boxCenterAlignmentPane = new BoxCenterAligmentPane(getCopyRight());
contentPane.add(boxCenterAlignmentPane);
boxCenterAlignmentPane = new BoxCenterAligmentPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_About_All_Rights_Reserved"));
boxCenterAlignmentPane = new BoxCenterAligmentPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_About_All_Rights_Reserved"),
FineUIStyle.LABEL_BOLD);
contentPane.add(boxCenterAlignmentPane);
contentPane.add(new BoxCenterAlignmentCopyablePane(
@ -276,6 +277,11 @@ public class AboutPane extends JPanel {
private UILabel textLabel;
public BoxCenterAligmentPane(String text, String style) {
this(text);
FineUIStyle.setStyle(textLabel, style);
}
public BoxCenterAligmentPane(String text) {
this(new UILabel(text));
}

15
designer-base/src/main/java/com/fr/design/border/FineBorderFactory.java

@ -1,6 +1,8 @@
package com.fr.design.border;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import javax.swing.BorderFactory;
import javax.swing.border.Border;
@ -53,4 +55,17 @@ public class FineBorderFactory {
return createToplineBorder(FineUIUtils.getUIColor("Label.borderColor", "defaultBorderColor"));
}
/**
* 创建包装的圆角边框无论内部组件是否圆角可确保外部为圆角边框
*
* @return 边框
*/
public static Border createWrappedRoundBorder() {
return BorderFactory.createCompoundBorder(
new UIRoundedBorder(FlatUIUtils.getUIColor("defaultBorderColor", Color.GRAY), 1,
FlatUIUtils.getUIInt("Component.arc", 5)),
new ScaledEmptyBorder(1, 1, 1, 1)
);
}
}

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

@ -26,7 +26,7 @@ public final class ServerTableDataWrapper extends AbstractTableDataWrapper {
public Icon getIcon() {
if (tabledata instanceof DBTableData) {
if (StringUtils.isBlank(((DBTableData) tabledata).getQuery())) {
return new WarningIcon(SVGLoader.load("/com/fr/design/standard/server_database.svg"));
return new LazyIcon("server_database_warning");
}
else {
return new LazyIcon("server_database");

11
designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java

@ -40,17 +40,6 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
scrollBar = new UIScrollBar(JScrollBar.VERTICAL) {
private static final long serialVersionUID = 155777947121777223L;
@Override
public int getVisibleAmount() {
int preferheight = leftcontentPane.getPreferredSize().height;
if(preferheight <= 0) {
return 0;
}
int e = MAXVALUE * (getHeight() - 1) / preferheight;
setVisibleAmount(e);
return e;
}
@Override
public int getMaximum() {
return MAXVALUE;

62
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -2,12 +2,10 @@ package com.fr.design.formula;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatButtonBorder;
import com.formdev.flatlaf.ui.FlatRoundBorder;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.Parameter;
@ -17,9 +15,9 @@ import com.fr.base.Utils;
import com.fr.base.io.IOFile;
import com.fr.data.TableDataSource;
import com.fr.design.actions.UpdateAction;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.datapane.management.search.pane.FineSearchPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
@ -75,7 +73,6 @@ import com.fr.stable.script.Tiny;
import com.fr.stable.script.TinyHunter;
import java.awt.Window;
import javax.swing.SwingConstants;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.Icon;
@ -87,6 +84,7 @@ import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
@ -130,7 +128,6 @@ import java.util.Set;
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.flex;
/**
* 公式编辑面板
@ -148,6 +145,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private VariableTreeAndDescriptionArea variableTreeAndDescriptionArea;
private RSyntaxTextArea formulaTextArea;
private UITextField keyWordTextField = new UITextField(18);
private FineSearchPane searchPane = new FineSearchPane();
private int currentPosition = 0;
private int beginPosition = 0;
private int insertPosition = 0;
@ -238,7 +236,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
}
private void initKeyWordTextFieldKeyListener() {
keyWordTextField.addKeyListener(new KeyListener() {
searchPane.addClearActionListener(e -> searchPane.setText(StringUtils.EMPTY));
searchPane.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
//do nothing
@ -252,12 +251,16 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
String toFind = keyWordTextField.getText();
String toFind = searchPane.getText();
search(toFind, false);
popTips();
searchPane.requestFocusInWindow();
if (tipsList.getSelectedValue() != null) {
fixFunctionNameList(tipsList.getSelectedValue().toString());
}
e.consume();
}
}
});
@ -265,28 +268,17 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private JPanel initTipsPane() {
// tipsPane
UIButton searchButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Search"));
searchPane.setPlaceholder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Tree_Search_Press_Enter_For_Search"));
UILabel formulaLabel = new UILabel(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Input_Formula_In_The_Text_Area_Below") + ":", SwingConstants.LEFT);
JPanel containerSPane = row(
cell(formulaLabel),
flex(),
cell(keyWordTextField),
cell(searchButton)
cell(formulaLabel).weight(4),
cell(searchPane).weight(1)
).getComponent();
initKeyWordTextFieldKeyListener();
tipsList = new JList(listModel);
tipsList.addMouseListener(new DoubleClick());
searchButton.addActionListener(e -> {
String toFind = keyWordTextField.getText();
search(toFind, false);
popTips();
formulaTextArea.requestFocusInWindow();
if (tipsList.getSelectedValue() != null) {
fixFunctionNameList(tipsList.getSelectedValue().toString());
}
});
return containerSPane;
}
@ -322,7 +314,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
// text
initFormulaTextArea();
UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea);
formulaTextAreaScrollPane.setBorder(new FlatRoundBorder());
formulaTextAreaScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
// buttonPane
JPanel buttonPane = row(8).getComponent();
@ -653,9 +645,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
popupMenu = new JPopupMenu();
JScrollPane tipsScrollPane = new JScrollPane(tipsList);
popupMenu.add(tipsScrollPane);
tipsScrollPane.setPreferredSize(new Dimension(FineUIScale.scale(240), FineUIScale.scale(146)));
tipsScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
popupMenu.show(keyWordTextField, 0, 23);
popupMenu.setBorder(FineBorderFactory.createWrappedRoundBorder());
tipsScrollPane.setPreferredSize(FineUIScale.scale(new Dimension(172, 120)));
popupMenu.show(searchPane, 0, 28);
}
protected void search(String keyWord, boolean findDescription) {
@ -750,10 +742,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
}
public BasicDialog showLargeWindow(Window window, DialogActionListener l) {
int width = 900;
int height = 640;
BasicDialog basicDialog = super.showWindowWithCustomSize(window, l, FineUIScale.scale(new Dimension(width, height)));
basicDialog.setMinimumSize(FineUIScale.scale(new Dimension(width, height)));
Dimension dimension = new Dimension(900, 640);
BasicDialog basicDialog = super.showWindowWithCustomSize(window, l, dimension);
basicDialog.setMinimumSize(dimension);
basicDialog.setResizable(true);
return basicDialog;
}
@ -1079,7 +1070,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private JPanel initFunctionTypeList() {
functionTypeList = new QuickList(functionTypeListModel);
UIScrollPane functionTypeScrollPane = new UIScrollPane(functionTypeList);
functionTypeScrollPane.setBorder(new FineRoundBorder());
functionTypeScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
functionTypeList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
initTypeListCellRenderer();
initGroupTypeModel();
@ -1194,7 +1185,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private JPanel initFunctionNameList() {
functionNameList = new JList(new DefaultListModel());
UIScrollPane functionNameScrollPane = new UIScrollPane(functionNameList);
functionNameScrollPane.setBorder(new FlatButtonBorder());
functionNameScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
functionNameList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
initFunctionNameListCellRenderer();
initFunctionNameListSelectionListener();
@ -1207,6 +1198,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
descriptionTextArea = new UITextArea();
descriptionTextArea.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
descriptionTextArea.setLineWrap(true);
descriptionTextArea.setBorder(new ScaledEmptyBorder(4, 4, 4, 4));
descriptionTextArea.setWrapStyleWord(true);
descriptionTextArea.setEditable(false);
descriptionTextArea.addMouseListener(new MouseAdapter() {
@ -1275,7 +1267,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
// variable
variablesTree = new JTree();
UIScrollPane variablesTreePane = new UIScrollPane(variablesTree);
variablesTreePane.setBorder(new FlatRoundBorder());
variablesTreePane.setBorder(FineBorderFactory.createWrappedRoundBorder());
variablesTree.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
variablesTree.setRootVisible(false);
variablesTree.setShowsRootHandles(true);
@ -1285,7 +1277,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
initDescriptionTextArea();
UIScrollPane desScrollPane = new UIScrollPane(descriptionTextArea);
desScrollPane.setBorder(null);
desScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
initVariablesTreeSelectionListener();
return Layouts.row(LayoutConstants.HORIZONTAL_GAP,
cell(this.createNamePane(

4
designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java

@ -89,6 +89,10 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver
return formulaTextField;
}
public UIButton getFormulaTextFieldButton() {
return formulaTextFieldButton;
}
@Override
public void populateBean(String ob) {
this.formulaTextField.setText(ob);

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

@ -1,7 +1,6 @@
package com.fr.design.gui.controlpane;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
@ -94,7 +93,7 @@ public abstract class JListControlPane extends JControlPane implements ListContr
nameableList.setName(LIST_NAME);
nameableList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
leftPane.add(new UIScrollPane(nameableList), BorderLayout.CENTER);
leftPane.setBorder(new FineRoundBorder());
leftPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
nameableList.addMouseListener(listMouseListener);
nameableList.addListSelectionListener(new ListSelectionListener() {

8
designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java

@ -1,10 +1,10 @@
package com.fr.design.gui.controlpane;
import com.fine.theme.light.ui.FineButtonBorder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory;
@ -86,13 +86,11 @@ public abstract class UIControlPane extends JControlPane {
// 增加边框
JPanel leftPaneWrapper = new JPanel(new BorderLayout());
leftPaneWrapper.add(getLeftPane(), BorderLayout.CENTER);
leftPaneWrapper.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
JPanel rightPaneWrapper = new JPanel(new BorderLayout());
rightPaneWrapper.add(cardPane, BorderLayout.CENTER);
rightPaneWrapper.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
rightPaneWrapper.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
// SplitPane
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, leftPaneWrapper, rightPaneWrapper);
mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor()));
mainSplitPane.setOneTouchExpandable(true);
this.add(mainSplitPane, BorderLayout.CENTER);
mainSplitPane.setDividerLocation(getLeftPreferredSize());
@ -152,7 +150,7 @@ public abstract class UIControlPane extends JControlPane {
cell(FRWidgetFactory.createLineWrapLabel(getAddItemText())),
cell(topToolBar).with(it -> {
it.setBorderPainted(true);
it.setBorder(new FineButtonBorder());
it.setBorder(FineBorderFactory.createWrappedRoundBorder());
it.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
}).weight(1.0)
).getComponent();

4
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java

@ -1,7 +1,7 @@
package com.fr.design.gui.controlpane;
import com.formdev.flatlaf.ui.FlatRoundBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement;
@ -76,7 +76,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon
nameableList.setName(LIST_NAME);
UIScrollPane scrollPane = new UIScrollPane(nameableList);
leftPane.add(scrollPane, BorderLayout.CENTER);
leftPane.setBorder(new FlatRoundBorder());
leftPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
nameableList.addMouseListener(getHelper().getListMouseListener(nameableList, this));

35
designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java

@ -1,5 +1,7 @@
package com.fr.design.gui.date;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils;
import com.fr.base.background.GradientBackground;
import com.fr.design.carton.MonthlyCartonFile;
@ -25,6 +27,7 @@ import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList;
@ -52,6 +55,8 @@ import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import static com.fine.theme.utils.FineUIScale.scale;
public class UICalendarPanel extends JPanel {
private static final Font FONT_UI = DesignUtils.getDefaultGUIFont().applySize(12);
private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"), Font.PLAIN, 12);
@ -125,15 +130,15 @@ public class UICalendarPanel extends JPanel {
dayBttListener = createDayBttListener();
//renderer this
setPreferredSize(new Dimension(218, 179));
setBackground(new Color(0xFFFFFF));
setBorder(BorderFactory.createLineBorder(new Color(0x959595)));
setPreferredSize(scale(new Dimension(218, 179)));
setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
setBorder(new LineBorder(FlatUIUtils.getUIColor("defaultBorderColor", Color.BLACK)));
setLayout(FRGUIPaneFactory.createBorderLayout());
add(BorderLayout.NORTH, createNorthPane());
add(BorderLayout.CENTER, createCenterPane());
if (isTimerPicker) {
setPreferredSize(new Dimension(218, 209));
setPreferredSize(scale(new Dimension(218, 209)));
add(BorderLayout.SOUTH, createSouthPane());
updateHMS();
}
@ -162,7 +167,7 @@ public class UICalendarPanel extends JPanel {
BaseUtils.readIcon("/com/fr/design/images/calender/month_reduce_hover.png"),
BaseUtils.readIcon("/com/fr/design/images/calender/month_reduce_click.png")
});
monthMinus.setPreferredSize(new Dimension(20, 20));
monthMinus.setPreferredSize(scale(new Dimension(20, 20)));
pNorth.add(monthMinus);
monthLabel = new UILabel("", UILabel.CENTER);
monthLabel.setBackground(new Color(0xFFFFFF));
@ -177,7 +182,7 @@ public class UICalendarPanel extends JPanel {
BaseUtils.readIcon("/com/fr/design/images/calender/month_add_hover.png"),
BaseUtils.readIcon("/com/fr/design/images/calender/month_add_click.png")
});
monthPlus.setPreferredSize(new Dimension(20, 20));
monthPlus.setPreferredSize(scale(new Dimension(20, 20)));
monthPlus.setHorizontalAlignment(SwingConstants.RIGHT);
pNorth.add(monthPlus);
pNorth.add(Box.createHorizontalStrut(11));
@ -195,7 +200,7 @@ public class UICalendarPanel extends JPanel {
private JPanel createCenterPane() {
//星期日 星期一 星期二 星期三 星期四 星期五 星期六
JPanel pWeeks = new JPanel(new GridLayout(1, 7, 1, 0));
pWeeks.setPreferredSize(new Dimension(216, 22));
pWeeks.setPreferredSize(scale(new Dimension(216, 22)));
pWeeks.setBackground(new Color(0xFFFFFF));
pWeeks.setOpaque(true);
String[] strWeeks = new String[]{StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Mon"),
@ -214,7 +219,7 @@ public class UICalendarPanel extends JPanel {
//中间放日期的面板
days = new DayPane();
days.setOpaque(true);
days.setPreferredSize(new Dimension(216, 115));
days.setPreferredSize(scale(new Dimension(216, 115)));
JPanel pCenter = FRGUIPaneFactory.createBorderLayout_S_Pane();
pCenter.setOpaque(true);
pCenter.add(pWeeks, BorderLayout.NORTH);
@ -222,7 +227,7 @@ public class UICalendarPanel extends JPanel {
//显示今天的日期,直接单击图标跳到今天
GradientPane pToday = new GradientPane(new GradientBackground(new Color(0x097BDA), new Color(0x40A3EE), GradientBackground.TOP2BOTTOM), false);
pToday.setPreferredSize(new Dimension(216, 18));
pToday.setPreferredSize(scale(new Dimension(216, 18)));
pToday.setLayout(new BorderLayout());
lbToday = new UIDayLabel(new Date(), false);
lbToday.setForeground(new Color(0x000000));
@ -236,23 +241,23 @@ public class UICalendarPanel extends JPanel {
private JPanel createSouthPane() {
JPanel sPane = new JPanel();
sPane.setPreferredSize(new Dimension(216, 30));
sPane.setPreferredSize(scale(new Dimension(216, 30)));
sPane.setBackground(Color.WHITE);
sPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 6));
UILabel timeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Time") + ":");
timeLabel.setBorder(BorderFactory.createEmptyBorder(0, 9, 0, 5));
timeLabel.setBorder(new ScaledEmptyBorder(0, 9, 0, 5));
timeLabel.setFont(FONT_UI);
sPane.add(timeLabel);
hms = new HMSPane();
sPane.add(hms);
UILabel gap = new UILabel();
gap.setPreferredSize(new Dimension(26, 1));
gap.setPreferredSize(scale(new Dimension(26, 1)));
sPane.add(gap);
UIButton okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")) {
public Dimension getPreferredSize() {
return new Dimension(32, 18);
return scale(new Dimension(32, 18));
}
public Insets getInsets() {
@ -722,7 +727,7 @@ public class UICalendarPanel extends JPanel {
private CalendarNumberField selectedNumberField;
public HMSPane() {
this.setPreferredSize(new Dimension(101, 18));
this.setPreferredSize(scale(new Dimension(101, 18)));
this.setLayout(new BorderLayout(0, 0));
this.setBackground(null);
@ -775,7 +780,7 @@ public class UICalendarPanel extends JPanel {
};
nextButton.setRoundBorder(true, Constants.LEFT);
JPanel arrowPane = new JPanel();
arrowPane.setPreferredSize(new Dimension(11, 18));
arrowPane.setPreferredSize(scale(new Dimension(11, 18)));
arrowPane.setLayout(new GridLayout(2, 1));
arrowPane.add(preButton);
arrowPane.add(nextButton);

19
designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java

@ -1,5 +1,8 @@
package com.fr.design.gui.date;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxUI;
import com.fr.design.layout.FRGUIPaneFactory;
@ -105,7 +108,7 @@ public class UIDatePicker extends UIComboBox implements Serializable {
textField.setDocument(dateDocument);
//设置Model为单值Model
this.setModel(model);
updateUI();
setUI(getUIComboBoxUI());
}
public UIDatePicker(int formatStyle, Date initialDatetime) throws UnsupportedOperationException {
@ -290,6 +293,20 @@ public class UIDatePicker extends UIComboBox implements Serializable {
@Override
protected ComboBoxUI getUIComboBoxUI() {
return new UIComboBoxUI() {
@Override
protected UIButton createArrowButton() {
arrowButton = new UIButton(new LazyIcon("down_arrow")) {
public boolean shouldResponseChangeListener() {
return false;
}
};
arrowButton.addMouseListener(this);
comboBox.addMouseListener(this);
FineUIStyle.setStyle(arrowButton, FineUIStyle.PLAIN_BUTTON);
return (UIButton) arrowButton;
}
@Override
protected ComboPopup createPopup() {
return new DatePopup(comboBox);

139
designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationPane.java

@ -1,26 +1,27 @@
package com.fr.design.gui.frpane;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.table.TableCellEditor;
import com.fine.swing.ui.layout.Column;
import com.fine.swing.ui.layout.Layouts;
import com.fine.swing.ui.layout.Row;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.constants.UIConstants;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
@ -32,12 +33,15 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.utils.gui.GUICoreUtils;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.theme.utils.FineUIScale.scale;
/**
* @author jerry
*/
public class UICorrelationPane extends JPanel implements UIObserver {
private static int size = 20;
protected UIButton addButton;
protected UITable tablePane;
protected int columnCount;
@ -45,7 +49,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
private HeaderPane header;
/**
* @param 标题栏的名字length代表列数
* @param names 标题栏的名字length代表列数
*/
public UICorrelationPane(String... names) {
columnCount = names.length;
@ -74,12 +78,13 @@ public class UICorrelationPane extends JPanel implements UIObserver {
addButton.setVisible(false);
}
protected boolean isDeletable(){
protected boolean isDeletable() {
return true;
}
/**
* 添加按钮 是否可用
*
* @param use 是否可用
*/
public void checkBoxUse(boolean use) {
@ -116,7 +121,8 @@ public class UICorrelationPane extends JPanel implements UIObserver {
/**
*添加一行
* 添加一行
*
* @param line
*/
public void addLine(Object[] line) {
@ -125,6 +131,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
/**
* 删除某行内容
*
* @param rowIndex 行号
*/
public void removeLine(int rowIndex) {
@ -145,16 +152,20 @@ public class UICorrelationPane extends JPanel implements UIObserver {
}
protected void initLayout() {
this.setLayout(new Layout());
this.add(addButton);
if (header != null) {
this.add(header);
}
this.add(tablePane);
this.setLayout(new BorderLayout(0, scale(4)));
Column tableContent = column(
cell(header), cell(tablePane).with(it ->
it.setBorder(BorderFactory.createMatteBorder(0, 1, 0, 1,
FlatUIUtils.getUIColor("defaultBorderColor", Color.BLACK)
)))
).getComponent();
this.add(tableContent, BorderLayout.CENTER);
this.add(addButton, BorderLayout.SOUTH);
}
protected void initComponents() {
tablePane = initUITable();
tablePane.setShowVerticalLines(false);
initAddButton();
}
@ -183,6 +194,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
/**
* 停止面板编辑
*
* @param e 事件
*/
public void stopPaneEditing(ChangeEvent e) {
@ -191,6 +203,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
/**
* 创建table编辑器
*
* @return 编辑器
*/
public UITableEditor createUITableEditor() {
@ -217,8 +230,6 @@ public class UICorrelationPane extends JPanel implements UIObserver {
return false;
}
};
addButton.setBorderType(UIButton.OTHER_BORDER);
addButton.setOtherBorder(UIConstants.BS, UIConstants.LINE_COLOR);
addButton.addActionListener(getAddButtonListener());
}
@ -250,95 +261,25 @@ public class UICorrelationPane extends JPanel implements UIObserver {
return true;
}
public class Layout implements LayoutManager {
/**
* 增加组件
* @param name 组件名
* @param comp 组件
*/
public void addLayoutComponent(String name, Component comp) {
}
/**
*移除组件
* @param comp 组件
*/
public void removeLayoutComponent(Component comp) {
}
/**
*最佳大小
* @param parent 父容器
* @return 大小
*/
public Dimension preferredLayoutSize(Container parent) {
int h = addButton.getPreferredSize().height + tablePane.getPreferredSize().height;
if (header != null) {
h = header.getPreferredSize().height;
}
return new Dimension(parent.getWidth(), h + 2);
}
/**
* 最小布局大小
* @param parent 父容器
* @return 大小
*/
public Dimension minimumLayoutSize(Container parent) {
return preferredLayoutSize(parent);
}
/**
* 布局容器
* @param parent 父容器
*/
public void layoutContainer(Container parent) {
int width = parent.getWidth();
int y = 0;
if (header != null) {
header.setBounds(0, y, width - (isDeletable() ?size:0), header.getPreferredSize().height);
y = y + header.getPreferredSize().height;
}
tablePane.setBounds(0, y, width+(isDeletable() ?0:size), tablePane.getPreferredSize().height);
y += tablePane.getPreferredSize().height + 2;
addButton.setBounds(0, y, width, addButton.getPreferredSize().height);
}
}
private class HeaderPane extends JPanel {
private static class HeaderPane extends Row {
public HeaderPane(String[] names) {
UILabel[] labels = new UILabel[names.length];
this.setLayout(new GridLayout(0, names.length));
for (int i = 0; i < names.length; i++) {
labels[i] = new UILabel(names[i], UILabel.CENTER) {
@Override
public void paint(Graphics g) {
super.paint(g);
int width = getWidth();
int height = getHeight();
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(UIConstants.LINE_COLOR);
g2d.drawLine(4, height - 1, width - 4, height - 1);
}
};
this.add(labels[i]);
labels[i] = new UILabel(names[i], UILabel.LEFT);
Layouts.populate(this, cell(labels[i]).weight(1));
}
}
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width - (isDeletable() ?size:0), size);
setBorder(BorderFactory.createCompoundBorder(
new LineBorder(FlatUIUtils.getUIColor("defaultBorderColor", Color.BLACK)),
new ScaledEmptyBorder(6, 6, 6, 6)
));
}
}
/**
* 增加监听
*
* @param l 监听
*/
public void addChangeListener(ChangeListener l) {
@ -347,6 +288,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
/**
* 移除监听
*
* @param l 监听
*/
public void removeChangeListener(ChangeListener l) {
@ -368,7 +310,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
public Dimension getPreferredSize() {
Dimension dim = new Dimension();
dim.width = super.getPreferredSize().width;
dim.height = addButton.getPreferredSize().height + tablePane.getPreferredSize().height + 2;
dim.height = addButton.getPreferredSize().height + tablePane.getPreferredSize().height + scale(6);
if (header != null) {
dim.height += header.getPreferredSize().height;
}
@ -382,6 +324,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
/**
* 主函数
*
* @param args 参数
*/
public static void main(String... args) {

4
designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -272,6 +272,8 @@ public class UIEastResizableContainer extends JPanel {
private class TopToolPane extends JPanel {
private int model = UIConstants.MODEL_NORMAL;
private int buttonSize = FineUIScale.scale(12);
public TopToolPane() {
super();
@ -328,7 +330,7 @@ public class UIEastResizableContainer extends JPanel {
} else {
button = new LazyIcon("drag_right");
}
button.paintIcon(this, g, 12, 12);
button.paintIcon(this, g, buttonSize, buttonSize);
}
}
}

17
designer-base/src/main/java/com/fr/design/gui/itable/UITable.java

@ -1,13 +1,12 @@
package com.fr.design.gui.itable;
import com.fr.design.constants.UIConstants;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import org.jetbrains.annotations.NotNull;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JTable;
import javax.swing.event.CellEditorListener;
@ -27,12 +26,14 @@ import java.awt.event.FocusEvent;
import java.awt.event.MouseEvent;
import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale;
public class UITable extends JTable implements UIObserver {
private static final int OFF_LEFT = 10;
private static final int STEP = 2;
private static final int DEFAULT_ROW_HEIGHT = 20;
private static final int DEFAULT_ROW_HEIGHT = 24;
private UIObserverListener uiObserverListener;
UITableEditor editor;
private boolean shouldResponseAwt;
@ -101,7 +102,7 @@ public class UITable extends JTable implements UIObserver {
if (event instanceof MouseEvent) {
MouseEvent mv = (MouseEvent) event;
if (mv.getClickCount() > 0) {
Point point = new Point((int) (mv.getLocationOnScreen().getX()) - 2 * OFF_LEFT, (int) mv.getLocationOnScreen().getY());
Point point = new Point((int) (mv.getLocationOnScreen().getX()) - 2 * scale(OFF_LEFT), (int) mv.getLocationOnScreen().getY());
// 判断鼠标点击是否在边界内
if (!bounds.contains(point) && shouldResponseAwt) {
if (!isEditingStopped) {
@ -219,8 +220,6 @@ public class UITable extends JTable implements UIObserver {
}
});
setBackground(UIConstants.NORMAL_BACKGROUND);
setDefaultEditor(UITable.class, editor);
setDefaultRenderer(UITable.class, new UITableRender());
setUI(getUI());
@ -228,7 +227,7 @@ public class UITable extends JTable implements UIObserver {
TableColumn deleteTableColumn = new TableColumn(getTableDataModel().getColumnCount());
deleteTableColumn.setCellEditor(null);
deleteTableColumn.setCellRenderer(null);
deleteTableColumn.setMaxWidth(20);
deleteTableColumn.setMaxWidth(scale(24));
getColumnModel().addColumn(deleteTableColumn);
}
@ -253,7 +252,7 @@ public class UITable extends JTable implements UIObserver {
}
protected int getRowHeight4Table() {
return DEFAULT_ROW_HEIGHT;
return scale(DEFAULT_ROW_HEIGHT);
}
@ -335,7 +334,7 @@ public class UITable extends JTable implements UIObserver {
Object value, boolean isSelected, boolean hasFocus, int row,
int column) {
JComponent comp = getRenderCompoment(value, row, column);
comp.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
comp.setBorder(new ScaledEmptyBorder(6, 6, 6, 6));
return comp;
}
}

22
designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java

@ -6,9 +6,9 @@ import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Stroke;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import javax.swing.CellRendererPane;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
@ -17,7 +17,8 @@ import javax.swing.plaf.basic.BasicTableUI;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableModel;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.mainframe.DesignerContext;
@ -25,8 +26,10 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUIPaintUtils;
import static com.fine.theme.utils.FineUIScale.scale;
public class UITableUI extends BasicTableUI {
private static BufferedImage closeIcon = BaseUtils.readImageWithCache("com/fr/design/images/toolbarbtn/close.png");
private static final Icon CLOSE_ICON = new LazyIcon("remove");
protected boolean isReleased = true;
protected int rollOverRowIndex = -1;
protected int dragStartRowIndex = -1;
@ -35,7 +38,7 @@ public class UITableUI extends BasicTableUI {
private int startColumn;
private int startRow;
private boolean draggingRow = false;
private static final int WIDTH_GAP = 20;
private static final int WIDTH_GAP = 24;
private int startDragPoint;
private int dyOffset;
@ -48,7 +51,7 @@ public class UITableUI extends BasicTableUI {
public UITableUI(JComponent table) {
super();
this.table = (JTable) table;
this.table.setRowHeight(20);
this.table.setRowHeight(scale(WIDTH_GAP));
}
@Override
@ -95,13 +98,14 @@ public class UITableUI extends BasicTableUI {
if(!isDeletable()){
return;
}
g2d.drawImage(closeIcon, table.getWidth() - 20, rollOverRowIndex * table.getRowHeight() + 1, closeIcon.getWidth(), closeIcon.getHeight(), table);
CLOSE_ICON.paintIcon(table, g2d, table.getWidth() - scale(WIDTH_GAP), rollOverRowIndex * table.getRowHeight() + 1);
}
private void paintRolloverBackground(Graphics2D g2d) {
if (rollOverRowIndex != -1) {
g2d.setColor(UIConstants.FLESH_BLUE);
GUIPaintUtils.fillPaint(g2d, 1, rollOverRowIndex * table.getRowHeight(), table.getWidth() - 2, table.getRowHeight(), true, Constants.NULL, UIConstants.FLESH_BLUE, UIConstants.LARGEARC);
Color selectionColor = FlatUIUtils.getUIColor("List.selectionBackground", UIConstants.FLESH_BLUE);
g2d.setColor(selectionColor);
GUIPaintUtils.fillPaint(g2d, 1, rollOverRowIndex * table.getRowHeight(), table.getWidth() - 2, table.getRowHeight(), true, Constants.NULL, selectionColor, 0);
}
}
@ -124,7 +128,7 @@ public class UITableUI extends BasicTableUI {
@Override
public void mousePressed(MouseEvent e) {
super.mousePressed(e);
if (e.getX() >= table.getWidth() - WIDTH_GAP) {
if (e.getX() >= table.getWidth() - scale(WIDTH_GAP)) {
if (table.isEditing()) {
table.getCellEditor(startRow, startColumn).stopCellEditing();
}

4
designer-base/src/main/java/com/fr/design/gui/itree/filetree/ClassFileTree.java

@ -2,6 +2,8 @@ package com.fr.design.gui.itree.filetree;
import java.io.File;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.border.FineBorderFactory;
import com.fr.file.filetree.FileNode;
import com.fr.file.filetree.IOFileNodeFilter;
import com.fr.stable.project.ProjectConstants;
@ -12,6 +14,8 @@ import com.fr.stable.project.ProjectConstants;
public class ClassFileTree extends EnvFileTree {
public ClassFileTree() {
super(ProjectConstants.CLASSES_NAME, null, new IOFileNodeFilter(new String[]{"class"}));
FineUIStyle.setStyle(this, FineUIStyle.PURE_TREE);
setBorder(FineBorderFactory.createWrappedRoundBorder());
}
/*

15
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java

@ -8,6 +8,8 @@
*/
package com.fr.design.gui.syntax.ui.rtextarea;
import com.fine.theme.utils.FineUIScale;
import java.awt.AWTEvent;
import java.awt.Color;
import java.awt.Font;
@ -31,6 +33,9 @@ import javax.swing.text.BadLocationException;
import javax.swing.text.Caret;
import javax.swing.text.StyleContext;
import static com.fine.theme.utils.FineUIConstants.SCALE_FONT_SIZE_12;
import static com.fine.theme.utils.FineUIConstants.SCALE_FONT_SIZE_13;
/**
* This is the base class for <code>RTextArea</code>; basically it's just an
@ -428,19 +433,19 @@ int currentCaretY; // Used to know when to rehighlight current line.
if (isOSX()) {
// Snow Leopard (1.6) uses Menlo as default monospaced font,
// pre-Snow Leopard used Monaco.
font = sc.getFont("Menlo", Font.PLAIN, 12);
font = sc.getFont("Menlo", Font.PLAIN, SCALE_FONT_SIZE_12);
if (!"Menlo".equals(font.getFamily())) {
font = sc.getFont("Monaco", Font.PLAIN, 12);
font = sc.getFont("Monaco", Font.PLAIN, SCALE_FONT_SIZE_12);
if (!"Monaco".equals(font.getFamily())) { // Shouldn't happen
font = sc.getFont("Monospaced", Font.PLAIN, 13);
font = sc.getFont("Monospaced", Font.PLAIN, SCALE_FONT_SIZE_13);
}
}
}
else {
// Consolas added in Vista, used by VS2010+.
font = sc.getFont("Consolas", Font.PLAIN, 13);
font = sc.getFont("Consolas", Font.PLAIN, SCALE_FONT_SIZE_13);
if (!"Consolas".equals(font.getFamily())) {
font = sc.getFont("Monospaced", Font.PLAIN, 13);
font = sc.getFont("Monospaced", Font.PLAIN, SCALE_FONT_SIZE_13);
}
}

4
designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java

@ -1,5 +1,6 @@
package com.fr.design.javascript;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.dialog.BasicDialog;
@ -80,9 +81,8 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane<JavaScript> {
}
protected void initLayout() {
this.setLayout(new BorderLayout(0, 6));
this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
JPanel northPane = new JPanel(new BorderLayout());
northPane.setBorder(BorderFactory.createEmptyBorder(3, 10, 0, 10));
this.add(northPane, BorderLayout.NORTH);
northPane.add(jcb, BorderLayout.CENTER);
this.add(cardPane, BorderLayout.CENTER);

6
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/LabelUtils.java

@ -9,6 +9,8 @@ import javax.swing.plaf.basic.BasicTextAreaUI;
import java.awt.Color;
import java.awt.Font;
import static com.fine.theme.utils.FineUIConstants.SCALE_FONT_SIZE_12;
/**
* @author Starryi
* @version 1.0
@ -20,7 +22,7 @@ public class LabelUtils {
}
public static UILabel createLabel(String title, Color color) {
return createLabel(title, color, 12);
return createLabel(title, color, SCALE_FONT_SIZE_12);
}
public static UILabel createLabel(String title, Color color, int size) {
UILabel uiLabel = new UILabel(title);
@ -34,7 +36,7 @@ public class LabelUtils {
JTextArea tipLabel = new JTextArea();
tipLabel.setUI(new BasicTextAreaUI());
tipLabel.setForeground(color);
Font newFont = FRFont.getInstance(tipLabel.getFont().getFontName(), Font.PLAIN, 12);
Font newFont = FRFont.getInstance(tipLabel.getFont().getFontName(), Font.PLAIN, SCALE_FONT_SIZE_12);
tipLabel.setFont(newFont);
tipLabel.setBorder(BorderFactory.createEmptyBorder());
tipLabel.setEditable(false);

12
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java

@ -1,13 +1,12 @@
package com.fr.design.mainframe.vcs.ui;
import com.fr.base.svg.IconUtils;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.lock.LockInfoUtils;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.vcs.VcsOperatorWorker;
@ -17,10 +16,7 @@ import com.fr.design.mainframe.vcs.common.VcsCloseTemplateHelper;
import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode;
import com.fr.report.entity.VcsEntity;
import com.fr.report.lock.LockInfoOperator;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.vcs.VcsOperator;
@ -50,9 +46,9 @@ public class VcsCenterPane extends VcsNewPane {
private UILabel open;
private UILabel delete;
private static final Icon MANAGER_ICON = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_center_manager");
private static final Icon DELETE_ICON = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_operator_delete");
private static final Icon OPEN_ICON = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_center_open");
private static final Icon MANAGER_ICON = new LazyIcon("vcs_list");
private static final Icon DELETE_ICON = new LazyIcon("remove");
private static final Icon OPEN_ICON = new LazyIcon("openTemplate");
private static final Class[] CLASSES = new Class[]{
Boolean.class,
UILabel.class,

2
designer-base/src/main/java/com/fr/design/present/FormulaPresentPane.java

@ -18,7 +18,7 @@ public class FormulaPresentPane extends FurtherBasicBeanPane<FormulaPresent> {
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
tinyFormulaPane = new TinyFormulaPane();
this.add(tinyFormulaPane, BorderLayout.CENTER);
this.add(tinyFormulaPane, BorderLayout.NORTH);
}
@Override

26
designer-base/src/main/java/com/fr/env/detect/ui/EnvDetectorDialog.java vendored

@ -146,27 +146,8 @@ public class EnvDetectorDialog extends JDialog {
JPanel headerPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
headerPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 12, 0));
this.detectButton = new UIToggleButton(buttonStatus.getDesc()) {
@Override
public ButtonUI getUI() {
return new UIButtonUI() {
@Override
protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) {
if (isPressed(b) && b.isPressedPainted()) {
GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles),
DesignerColor.Button.Primary.PRESSED);
} else if (isRollOver(b)) {
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(),
DesignerColor.Button.Primary.HOVER);
} else if (b.isNormalPainted()) {
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(),
DesignerColor.Button.Primary.NORMAL);
}
}
};
}
};
this.detectButton = new UIButton(buttonStatus.getDesc());
FineUIStyle.setStyle(detectButton, FineUIStyle.ENV_DECTETOR_BUTTON);
detectButton.setToolTipText(buttonStatus.getDesc());
detectButton.addActionListener(event -> {
if (buttonStatus.isNotExecuting()) {
@ -175,9 +156,6 @@ public class EnvDetectorDialog extends JDialog {
stopDetecting(detectButton);
}
});
detectButton.setForeground(FineUIUtils.getUIColor("background.normal", "background.normal"));
detectButton.setBackground(FineUIUtils.getUIColor("EnvDetectorButton.background", "EnvDetectorButton.background"));
headerPanel.add(detectButton, BorderLayout.WEST);
UILabel openUtilBoxLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Carton_Feedback_ToolBox"));

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

@ -1,11 +1,15 @@
package com.fr.file;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.extension.FileExtension;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.dialog.UIDialog;
@ -78,7 +82,6 @@ import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.filechooser.FileSystemView;
import javax.swing.plaf.basic.BasicArrowButton;
import javax.swing.plaf.basic.BasicButtonUI;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
@ -105,6 +108,10 @@ import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static javax.swing.JOptionPane.DEFAULT_OPTION;
import static javax.swing.JOptionPane.WARNING_MESSAGE;
@ -304,12 +311,10 @@ public class FILEChooserPane extends BasicPane {
locationPane.add(mkdirButton, BorderLayout.EAST);
JPanel centerLeftPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
// centerLeftPanel.setLayout(FRGUIPaneFactory.createBorderLayout());
// Richie:placesList includes C,D,E,F and DeskTop etc.
placesList = new JList();
FineUIStyle.setStyle(placesList, FineUIStyle.PURE_LIST);
centerLeftPanel.add(placesList, BorderLayout.CENTER);
centerLeftPanel.setBorder(BorderFactory.createLineBorder(Color.GRAY));
centerLeftPanel.setPreferredSize(new Dimension(120, 1));
placesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
placesList.setCellRenderer(new DefaultListCellRenderer() {
@ -359,12 +364,10 @@ public class FILEChooserPane extends BasicPane {
}
});
// centerRightPane
JPanel centerRightPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel subFilePanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
// 以后rightPanel要用JTable
subFileList = new JList(new DefaultListModel<>());
FineUIStyle.setStyle(subFileList, FineUIStyle.PURE_LIST);
/*
* JList的CellRenderer
*/
@ -456,27 +459,45 @@ public class FILEChooserPane extends BasicPane {
});
scrollPane = new JScrollPane(subFileList);
subFilePanel.add(scrollPane, BorderLayout.CENTER);
centerRightPane.add(subFilePanel, BorderLayout.CENTER);
subFilePanel.setBorder(FineBorderFactory.createWrappedRoundBorder());
// 用createTableLayoutPane布局下fileNamePane
UIButton cancelButton;
Component[][] coms = new Component[][]{
new Component[]{GUICoreUtils.createBorderPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Utils_File_Name") + ":"), BorderLayout.WEST),
fileNameTextField = new UIAutoCompletionField(), okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Utils_Design_File_Open"))
},
new Component[]{GUICoreUtils.createBorderPane(new UILabel(Toolkit.i18nText("Fine-Design_Report_Utils_File_Type") + ":"), BorderLayout.WEST),
postfixComboBox = new UIComboBox(), cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Utils_Design_Action_Cancel"))
}};
JPanel fileNamePane = TableLayoutHelper.createGapTableLayoutPane(coms, new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED,
TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.FILL, TableLayout.PREFERRED}, 24, 4);
centerRightPane.add(fileNamePane, BorderLayout.SOUTH);
Component[][] outComponents = new Component[][]{
new Component[]{GUICoreUtils.createBorderPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_App_File_Lookup_range") + ":"), BorderLayout.WEST), locationPane},
new Component[]{centerLeftPanel, centerRightPane}};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(outComponents, new double[]{TableLayout.PREFERRED, TableLayout.FILL},
new double[]{TableLayout.PREFERRED, TableLayout.FILL});
fileNameTextField = new UIAutoCompletionField();
postfixComboBox = new UIComboBox();
okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Utils_Design_File_Open"));
UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Utils_Design_Action_Cancel"));
JPanel fileNamePane = column(10,
row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Utils_File_Name"))).weight(1),
cell(fileNameTextField).weight(5)
),
row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Utils_File_Type"))).weight(1),
cell(postfixComboBox).weight(5)
)
).getComponent();
JPanel centerRightPane = column(10,
cell(subFilePanel).weight(1),
cell(fileNamePane)
).getComponent();
JPanel contentPane = column(10,
row(10,
column(10,
cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_App_File_Lookup_range")))
.with(it -> FineUIStyle.setStyle(it, FineUIStyle.LABEL_BOLD)),
cell(centerLeftPanel).with(it -> it.setBorder(FineBorderFactory.createWrappedRoundBorder())).weight(1)
).weight(1),
column(10,
cell(locationPane),
cell(centerRightPane).weight(1)
).weight(3)
).weight(1),
row(10,
flex(), cell(cancelButton), cell(okButton).with(it -> FineUIStyle.setStyle(it, FineUIStyle.STYLE_PRIMARY))
)
).getComponent();
this.add(contentPane, BorderLayout.CENTER);
okButton.addActionListener(new ActionListener() {
@Override
@ -1262,7 +1283,7 @@ public class FILEChooserPane extends BasicPane {
@Override
public Icon getIcon() {
return BaseUtils.readIcon("/com/fr/base/images/oem/logo.png");
return new LazyIcon("logo");
}
}
}
@ -1382,7 +1403,7 @@ public class FILEChooserPane extends BasicPane {
@Override
public Icon getIcon() {
if (ComparatorUtils.equals(getTotalName(), ProjectConstants.REPORTLETS_NAME)) {
return BaseUtils.readIcon("/com/fr/base/images/oem/logo.png");
return new LazyIcon("logo");
} else {
return FileTreeIcon.getIcon(new File(this.getPath()), false);
}
@ -1479,7 +1500,7 @@ public class FILEChooserPane extends BasicPane {
dirPath = dirPath + SEPARATOR_STRING;
}
if (ComparatorUtils.equals(actionPath, dirPath)) {
this.buttonList.get(i).setForeground(Color.BLUE);
this.buttonList.get(i).setForeground(FlatUIUtils.getUIColor("brand.normal", Color.BLUE));
}
}
}
@ -1681,42 +1702,30 @@ public class FILEChooserPane extends BasicPane {
private UIButton createBlankButton(SetDirectoryAction setDirectoryAction) {
final Color brighter = this.getBackground().brighter();
final Color darker = this.getBackground().darker();
final UIButton blankButton = new UIButton(setDirectoryAction);
blankButton.setMargin(new Insets(0, 0, 0, 0));
blankButton.setUI(new BasicButtonUI());
blankButton.setHorizontalTextPosition(SwingConstants.CENTER);
blankButton.setBorderPainted(false);
blankButton.setBorder(BorderFactory.createRaisedBevelBorder());
blankButton.setBackground(darker);
blankButton.setBackground(null);
blankButton.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
blankButton.setBackground(brighter);
blankButton.setBorderPainted(true);
blankButton.repaint();
}
@Override
public void mouseExited(MouseEvent e) {
blankButton.setBackground(darker);
blankButton.setBorderPainted(false);
blankButton.repaint();
}
@Override
public void mousePressed(MouseEvent e) {
blankButton.setBackground(brighter);
blankButton.setBorderPainted(false);
blankButton.repaint();
}
@Override
public void mouseReleased(MouseEvent e) {
blankButton.setBackground(darker);
blankButton.setBorderPainted(true);
blankButton.repaint();
}
@ -1730,7 +1739,7 @@ public class FILEChooserPane extends BasicPane {
*/
private UIButton initMkdirButton() {
UIButton folderButton = new UIButton();
folderButton.setIcon(BaseUtils.readIcon("com/fr/design/images/icon_NewFolderIcon_normal.png"));
folderButton.setIcon(new LazyIcon("new_folder"));
folderButton.setUI(new UIButtonUI());
folderButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Utils_New_Folder"));
folderButton.addActionListener(new ActionListener() {

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

@ -73,9 +73,8 @@ public class FileFILE implements FILE {
if (file == null) {
return FileTreeIcon.BLANK_IMAGE_ICON;
}
FileSystemView view = FileSystemView.getFileSystemView();
try {
return view.getSystemIcon(file);
return FileTreeIcon.getIcon(file);
} catch (Exception e) {
/*
* alex:在显示Mac里面某个目录的时候,居然会抛

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

@ -1,8 +1,7 @@
package com.fr.file;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.FRContext;
import com.fr.base.svg.IconUtils;
import com.fr.design.file.TemplateResourceManager;
import com.fr.io.FineEncryptUtils;
import com.fr.base.io.XMLEncryptUtils;
@ -169,7 +168,7 @@ public class FileNodeFILE implements FILE {
}
if (ComparatorUtils.equals(node.getEnvPath(), ProjectConstants.REPORTLETS_NAME)) {
return IconUtils.readIcon("/com/fr/base/images/oem/logo.svg");
return new LazyIcon("logo");
} else {
if (!hasFullAuth) {

20
designer-base/src/main/resources/com/fine/theme/icon/dataset/server_database_warning.svg

@ -0,0 +1,20 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 4.1C3 3.21634 3.71634 2.5 4.6 2.5H27.4C28.2837 2.5 29 3.21634 29 4.1V8.9C29 9.78366 28.2837 10.5 27.4 10.5H4.6C3.71634 10.5 3 9.78366 3 8.9V4.1Z" fill="#5493F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M27.4 3.7H4.6C4.37909 3.7 4.2 3.87909 4.2 4.1V8.9C4.2 9.12091 4.37909 9.3 4.6 9.3H27.4C27.6209 9.3 27.8 9.12091 27.8 8.9V4.1C27.8 3.87909 27.6209 3.7 27.4 3.7ZM4.6 2.5C3.71634 2.5 3 3.21634 3 4.1V8.9C3 9.78366 3.71634 10.5 4.6 10.5H27.4C28.2837 10.5 29 9.78366 29 8.9V4.1C29 3.21634 28.2837 2.5 27.4 2.5H4.6Z" fill="#1E65CD"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 13.6C3 12.7163 3.71634 12 4.6 12H27.4C28.2837 12 29 12.7163 29 13.6V18.4C29 19.1461 28.4893 19.773 27.7984 19.95C26.498 18.1646 24.3673 17 21.9565 17C19.5234 17 17.3754 18.1863 16.0786 20H4.6C3.71634 20 3 19.2837 3 18.4V13.6ZM12.874 21.5H4.6C3.71634 21.5 3 22.2163 3 23.1V27.9C3 28.7837 3.71634 29.5 4.6 29.5H10.9664C10.356 28.6062 10 27.5313 10 26.375C10 24.2912 11.1561 22.472 12.874 21.5ZM27.9272 29.4111C27.7621 29.4687 27.5847 29.5 27.4 29.5H23.3779L18 28.5C16.8369 28.5 16.492 28.8245 16.4169 28.7709C16.3555 28.7271 16.4743 28.4311 16.4743 27.5C16.4743 26.6611 16.0498 25.7635 15.6851 24.9924C15.1494 23.8597 14.7428 23 16 23C16.1308 23 16.1965 23.1231 16.2629 23.2476C16.3241 23.3623 16.3859 23.4782 16.5 23.5C16.5352 23.5067 16.7146 23.6402 16.9213 23.794C17.4639 24.1977 18.1947 24.7415 17 23.5C17.022 23.4132 17.267 23.327 17.5093 23.2418C17.7413 23.1603 17.9708 23.0796 18 23C18.4893 21.6664 19.076 21.8003 20.0969 22.0332C20.5986 22.1477 21.2051 22.2861 21.9565 22.2861C22.651 22.2861 23.1889 22.2057 23.6169 22.1417C24.6907 21.9812 25.0726 21.9241 25.5 23.5C27.2389 23.8532 28 24.566 28 26.375C28 26.7806 28.0282 27.1712 28.0546 27.5371C28.1095 28.2974 28.1566 28.951 27.9272 29.4111Z" fill="#5493F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M27.4 13.2H4.6C4.37909 13.2 4.2 13.3791 4.2 13.6V18.4C4.2 18.6209 4.37909 18.8 4.6 18.8H17.1632C16.757 19.1579 16.3928 19.5605 16.0786 20H4.6C3.71634 20 3 19.2837 3 18.4V13.6C3 12.7163 3.71634 12 4.6 12H27.4C28.2837 12 29 12.7163 29 13.6V18.4C29 19.1461 28.4893 19.773 27.7984 19.95C27.4924 19.53 27.1405 19.1443 26.7498 18.8H27.4C27.6209 18.8 27.8 18.6209 27.8 18.4V13.6C27.8 13.3791 27.6209 13.2 27.4 13.2ZM27.9272 29.4111C27.7621 29.4687 27.5847 29.5 27.4 29.5H23.3779L18 28.5C16.8369 28.5 16.492 28.8245 16.4169 28.7709C16.3785 28.7435 16.4105 28.6177 16.4399 28.3H27.4C27.6209 28.3 27.8 28.1209 27.8 27.9V25.0526C27.9351 25.4122 28 25.8469 28 26.375C28 26.7806 28.0282 27.1712 28.0546 27.5371C28.1095 28.2974 28.1566 28.951 27.9272 29.4111ZM12.874 21.5H4.6C3.71634 21.5 3 22.2163 3 23.1V27.9C3 28.7837 3.71634 29.5 4.6 29.5H10.9664C10.7129 29.1288 10.5033 28.7265 10.3449 28.3H4.6C4.37909 28.3 4.2 28.1209 4.2 27.9V23.1C4.2 22.8791 4.37909 22.7 4.6 22.7H11.3941C11.814 22.2235 12.3142 21.8167 12.874 21.5ZM18.1229 22.7H25.2257C24.8783 21.9531 24.4618 22.0154 23.6169 22.1417C23.1889 22.2057 22.651 22.2861 21.9565 22.2861C21.2051 22.2861 20.5986 22.1477 20.0969 22.0332C19.1599 21.8194 18.5887 21.6891 18.1229 22.7Z" fill="#1E65CD"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M26.2105 30H15.7895C13.6966 30 12 28.3584 12 26.3333C12 24.3083 13.6966 22.6667 15.7895 22.6667C16.1722 22.6667 16.5417 22.7216 16.8899 22.8237C17.453 20.6277 19.5037 19 21.9474 19C24.361 19 26.3913 20.5879 26.9834 22.743C28.7056 23.0883 30 24.5646 30 26.3333C30 28.2032 28.5535 29.7461 26.6842 29.9716V30H26.2105Z" fill="#57C4FB"/>
<path d="M8.5 6.5C8.5 6.91421 8.16421 7.25 7.75 7.25C7.33579 7.25 7 6.91421 7 6.5C7 6.08579 7.33579 5.75 7.75 5.75C8.16421 5.75 8.5 6.08579 8.5 6.5Z" fill="white"/>
<path d="M8.5 16C8.5 16.4142 8.16421 16.75 7.75 16.75C7.33579 16.75 7 16.4142 7 16C7 15.5858 7.33579 15.25 7.75 15.25C8.16421 15.25 8.5 15.5858 8.5 16Z" fill="white"/>
<path d="M8.5 25.5C8.5 25.9142 8.16421 26.25 7.75 26.25C7.33579 26.25 7 25.9142 7 25.5C7 25.0858 7.33579 24.75 7.75 24.75C8.16421 24.75 8.5 25.0858 8.5 25.5Z" fill="white"/>
<path d="M12 6.5C12 6.91421 11.6642 7.25 11.25 7.25C10.8358 7.25 10.5 6.91421 10.5 6.5C10.5 6.08579 10.8358 5.75 11.25 5.75C11.6642 5.75 12 6.08579 12 6.5Z" fill="white"/>
<path d="M12 16C12 16.4142 11.6642 16.75 11.25 16.75C10.8358 16.75 10.5 16.4142 10.5 16C10.5 15.5858 10.8358 15.25 11.25 15.25C11.6642 15.25 12 15.5858 12 16Z" fill="white"/>
<path d="M8.5 6.5C8.5 6.91421 8.16421 7.25 7.75 7.25C7.33579 7.25 7 6.91421 7 6.5C7 6.08579 7.33579 5.75 7.75 5.75C8.16421 5.75 8.5 6.08579 8.5 6.5Z" stroke="white" stroke-width="0.5"/>
<path d="M8.5 16C8.5 16.4142 8.16421 16.75 7.75 16.75C7.33579 16.75 7 16.4142 7 16C7 15.5858 7.33579 15.25 7.75 15.25C8.16421 15.25 8.5 15.5858 8.5 16Z" stroke="white" stroke-width="0.5"/>
<path d="M8.5 25.5C8.5 25.9142 8.16421 26.25 7.75 26.25C7.33579 26.25 7 25.9142 7 25.5C7 25.0858 7.33579 24.75 7.75 24.75C8.16421 24.75 8.5 25.0858 8.5 25.5Z" stroke="white" stroke-width="0.5"/>
<path d="M12 6.5C12 6.91421 11.6642 7.25 11.25 7.25C10.8358 7.25 10.5 6.91421 10.5 6.5C10.5 6.08579 10.8358 5.75 11.25 5.75C11.6642 5.75 12 6.08579 12 6.5Z" stroke="white" stroke-width="0.5"/>
<path d="M12 16C12 16.4142 11.6642 16.75 11.25 16.75C10.8358 16.75 10.5 16.4142 10.5 16C10.5 15.5858 10.8358 15.25 11.25 15.25C11.6642 15.25 12 15.5858 12 16Z" stroke="white" stroke-width="0.5"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M29.875 22C29.875 26.3489 26.3489 29.875 22 29.875C17.6511 29.875 14.125 26.3489 14.125 22C14.125 17.6511 17.6511 14.125 22 14.125C26.3489 14.125 29.875 17.6511 29.875 22Z" fill="#F9AE31"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.3626 24.5785C21.1876 24.7535 21.1001 24.966 21.1001 25.216C21.1001 25.466 21.1876 25.6785 21.3626 25.8535C21.5376 26.0285 21.7501 26.116 22.0001 26.116C22.2501 26.116 22.4626 26.0285 22.6376 25.8535C22.8126 25.6785 22.9001 25.466 22.9001 25.216C22.9001 24.966 22.8126 24.7535 22.6376 24.5785C22.4626 24.4035 22.2501 24.316 22.0001 24.316C21.7501 24.316 21.5376 24.4035 21.3626 24.5785Z" fill="white"/>
<rect x="21.2124" y="17.749" width="1.575" height="5.625" rx="0.7" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 6.0 KiB

13
designer-base/src/main/resources/com/fine/theme/icon/widget/apply_components.svg

@ -0,0 +1,13 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5185_49403)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M24 11H8V8H24V11ZM6 13V7C6 6.44772 6.44772 6 7 6H25C25.5523 6 26 6.44772 26 7V13H6Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 17H8V24H11V17ZM6 15V25C6 25.5523 6.44772 26 7 26H13V15H6Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M17 17H24V24H17V17ZM26 15V25C26 25.5523 25.5523 26 25 26H15V15H26Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.5 2C2.67157 2 2 2.67157 2 3.5V28.5C2 29.3284 2.67157 30 3.5 30H28.5C29.3284 30 30 29.3284 30 28.5V3.5C30 2.67157 29.3284 2 28.5 2H3.5ZM4 28V4H28V28H4Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_5185_49403">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 962 B

13
designer-base/src/main/resources/com/fine/theme/icon/widget/apply_components_disable.svg

@ -0,0 +1,13 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5830_164273)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M24 11H8V8H24V11ZM6 13V7C6 6.44772 6.44772 6 7 6H25C25.5523 6 26 6.44772 26 7V13H6Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 17H8V24H11V17ZM6 15V25C6 25.5523 6.44772 26 7 26H13V15H6Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M17 17H24V24H17V17ZM26 15V25C26 25.5523 25.5523 26 25 26H15V15H26Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.5 2C2.67157 2 2 2.67157 2 3.5V28.5C2 29.3284 2.67157 30 3.5 30H28.5C29.3284 30 30 29.3284 30 28.5V3.5C30 2.67157 29.3284 2 28.5 2H3.5ZM4 28V4H28V28H4Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_5830_164273">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 968 B

17
designer-base/src/main/resources/com/fine/theme/icon/widget/prewidget.svg

@ -1,13 +1,8 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5185_49403)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M24 11H8V8H24V11ZM6 13V7C6 6.44772 6.44772 6 7 6H25C25.5523 6 26 6.44772 26 7V13H6Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 17H8V24H11V17ZM6 15V25C6 25.5523 6.44772 26 7 26H13V15H6Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M17 17H24V24H17V17ZM26 15V25C26 25.5523 25.5523 26 25 26H15V15H26Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.5 2C2.67157 2 2 2.67157 2 3.5V28.5C2 29.3284 2.67157 30 3.5 30H28.5C29.3284 30 30 29.3284 30 28.5V3.5C30 2.67157 29.3284 2 28.5 2H3.5ZM4 28V4H28V28H4Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_5185_49403">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.5 30.8492C14.2239 30.8492 14 30.6254 14 30.3492V28.0208L25.5836 16.4372L28.412 19.2657L16.8284 30.8492H14.5ZM29.8262 17.8514L30.2635 17.4142C31.0445 16.6332 31.0445 15.3668 30.2635 14.5858C29.4824 13.8047 28.2161 13.8047 27.435 14.5858L26.9978 15.023L29.8262 17.8514Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 5H26V13.1165C26.5752 12.5843 27.2705 12.2423 28 12.0907V5C28 3.89543 27.1046 3 26 3H4C2.89543 3 2 3.89543 2 5V26C2 27.1046 2.89543 28 4 28H11.449C11.391 27.7925 11.3601 27.5743 11.3601 27.3492V26H4L4 5ZM24.08 26L22 28H26C27.1046 28 28 27.1046 28 26V22.5061L26 24.4292V26H24.08Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M6 10.6255C6 9.7968 6.6718 9.125 7.5005 9.125C8.32921 9.125 9.00101 9.7968 9.00101 10.6255V10.7245C9.00101 11.5532 8.32921 12.225 7.5005 12.225C6.6718 12.225 6 11.5532 6 10.7245V10.6255Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.6286 7C11.0763 7 10.6286 7.44772 10.6286 8V13.4375C10.6286 13.9898 11.0763 14.4375 11.6286 14.4375H23C23.5523 14.4375 24 13.9898 24 13.4375V8C24 7.44772 23.5523 7 23 7H11.6286ZM21.943 9.125H12.6859V12.3125H21.943V9.125Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M6 20.188C6 19.3593 6.6718 18.6875 7.5005 18.6875C8.32921 18.6875 9.00101 19.3593 9.00101 20.188V20.287C9.00101 21.1157 8.32921 21.7875 7.5005 21.7875C6.6718 21.7875 6 21.1157 6 20.287V20.188Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M23.3744 16.635C23.2588 16.5882 23.1324 16.5625 23 16.5625H11.6286C11.0763 16.5625 10.6286 17.0102 10.6286 17.5625V23C10.6286 23.5523 11.0763 24 11.6286 24H16.2446L18.3017 21.875H12.6859V18.6875H21.3874L23.3744 16.635Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

Before

Width:  |  Height:  |  Size: 962 B

After

Width:  |  Height:  |  Size: 1.8 KiB

17
designer-base/src/main/resources/com/fine/theme/icon/widget/prewidget_disable.svg

@ -1,13 +1,8 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5830_164273)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M24 11H8V8H24V11ZM6 13V7C6 6.44772 6.44772 6 7 6H25C25.5523 6 26 6.44772 26 7V13H6Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 17H8V24H11V17ZM6 15V25C6 25.5523 6.44772 26 7 26H13V15H6Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M17 17H24V24H17V17ZM26 15V25C26 25.5523 25.5523 26 25 26H15V15H26Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.5 2C2.67157 2 2 2.67157 2 3.5V28.5C2 29.3284 2.67157 30 3.5 30H28.5C29.3284 30 30 29.3284 30 28.5V3.5C30 2.67157 29.3284 2 28.5 2H3.5ZM4 28V4H28V28H4Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_5830_164273">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.5 30.8492C14.2239 30.8492 14 30.6254 14 30.3492V28.0208L25.5836 16.4372L28.412 19.2657L16.8284 30.8492H14.5ZM29.8262 17.8514L30.2635 17.4142C31.0445 16.6332 31.0445 15.3668 30.2635 14.5858C29.4824 13.8047 28.2161 13.8047 27.435 14.5858L26.9978 15.023L29.8262 17.8514Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 5H26V13.1165C26.5752 12.5843 27.2705 12.2423 28 12.0907V5C28 3.89543 27.1046 3 26 3H4C2.89543 3 2 3.89543 2 5V26C2 27.1046 2.89543 28 4 28H11.449C11.391 27.7925 11.3601 27.5743 11.3601 27.3492V26H4L4 5ZM24.08 26L22 28H26C27.1046 28 28 27.1046 28 26V22.5061L26 24.4292V26H24.08Z" fill="#0A1C38" fill-opacity="0.29"/>
<path d="M6 10.6255C6 9.7968 6.6718 9.125 7.5005 9.125C8.32921 9.125 9.00101 9.7968 9.00101 10.6255V10.7245C9.00101 11.5532 8.32921 12.225 7.5005 12.225C6.6718 12.225 6 11.5532 6 10.7245V10.6255Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.6286 7C11.0763 7 10.6286 7.44772 10.6286 8V13.4375C10.6286 13.9898 11.0763 14.4375 11.6286 14.4375H23C23.5523 14.4375 24 13.9898 24 13.4375V8C24 7.44772 23.5523 7 23 7H11.6286ZM21.943 9.125H12.6859V12.3125H21.943V9.125Z" fill="#0A1C38" fill-opacity="0.29"/>
<path d="M6 20.188C6 19.3593 6.6718 18.6875 7.5005 18.6875C8.32921 18.6875 9.00101 19.3593 9.00101 20.188V20.287C9.00101 21.1157 8.32921 21.7875 7.5005 21.7875C6.6718 21.7875 6 21.1157 6 20.287V20.188Z" fill="#0A1C38" fill-opacity="0.29"/>
<path d="M23.3744 16.635C23.2588 16.5882 23.1324 16.5625 23 16.5625H11.6286C11.0763 16.5625 10.6286 17.0102 10.6286 17.5625V23C10.6286 23.5523 11.0763 24 11.6286 24H16.2446L18.3017 21.875H12.6859V18.6875H21.3874L23.3744 16.635Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

Before

Width:  |  Height:  |  Size: 968 B

After

Width:  |  Height:  |  Size: 1.8 KiB

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

@ -49,6 +49,7 @@
"batch_esd_off": "dataset/batch_esd_off.svg",
"edit": "dataset/edit.svg",
"server_database": "dataset/server_database.svg",
"server_database_warning": "dataset/server_database_warning.svg",
"field": "dataset/field.svg",
"folder": "filetree/folder.svg",
"folder_open": "filetree/folder_open.svg",
@ -310,6 +311,7 @@
"password_field": "widget/password_field.svg",
"picture": "widget/picture.svg",
"widget_preview": "widget/preview.svg",
"apply_components": "widget/apply_components.svg",
"prewidget": "widget/prewidget.svg",
"tab": "widget/tab.svg",
"text_area": "widget/text_area.svg",

2
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties

@ -18,7 +18,7 @@ MenuBarUI=com.formdev.flatlaf.ui.FlatMenuBarUI
MenuItemUI=com.fine.theme.light.ui.FineMenuItemUI
TemplateListMenuItemUI=com.fine.theme.light.ui.FineTemplateListMenuItemUI
OptionPaneUI=com.formdev.flatlaf.ui.FlatOptionPaneUI
PanelUI=com.formdev.flatlaf.ui.FlatPanelUI
PanelUI=com.fine.theme.light.ui.FinePanelUI
PasswordFieldUI=com.formdev.flatlaf.ui.FlatPasswordFieldUI
PopupMenuUI=com.fine.theme.light.ui.FinePopupMenuUI
PopupMenuSeparatorUI=com.fine.theme.light.ui.FinePopupMenuSeparatorUI

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

@ -124,7 +124,7 @@ controlDkShadow = darken($controlShadow,15%)
DarkenedFontColor = #091E40
defaultBorderColor = #DADEE7
defaultHighlightBorderColor = #2576EF
defaultBorderFocusShadow = #2576ef19
defaultBorderFocusShadow = $defaultBorderColor
defaultBorderFocusWidth = 0
brand.normal=#2576EF
color.brand4=#84B1F6
@ -223,7 +223,6 @@ CombinationButton.background = $Button.background
CombinationButton.borderColor = $Component.borderColor
CombinationButton.arc = $Button.arc
EnvDetecorButton.background = #FF419BF9
#---- CheckBox ----
CheckBox.arc = 4
@ -671,6 +670,9 @@ ScrollBar.largeBar.showButtons = true
ScrollBar.largeBar.thumbInsets = 0,4,0,4
ScrollBar.largeBar.buttonBackground = $ScrollBar.track
#---- Panel ----
Panel.arc = 5
#---- ScrollPane ----
ScrollPane.border = null
@ -898,7 +900,7 @@ Table.focusCellHighlightBorder = com.formdev.flatlaf.ui.FlatTableCellBorder$Focu
Table.focusSelectedCellHighlightBorder = com.formdev.flatlaf.ui.FlatTableCellBorder$Selected
Table.focusCellBackground = $Table.background
Table.focusCellForeground = $Table.foreground
Table.background = @componentBackground
Table.background = $fill.normal
Table.selectionInactiveBackground = @selectionInactiveBackground
Table.selectionInactiveForeground = @selectionInactiveForeground
Table.dropCellBackground = @dropCellBackground
@ -1053,7 +1055,7 @@ ToggleButton.group.selectedBackground = #2576EF
ToggleButton.group.selectedForeground = #FFF
#---- HeadGroup ----
HeadGroup.background= #E9ECF1
HeadGroup.background= #E6E9EF
HeadGroup.arc= $Component.arc
#---- HeadMenu ----
HeadMenu.borderMargins=5,9,5,10
@ -1261,9 +1263,6 @@ CellOtherSetPane.height=$Component.defaultHeight
[style]Panel.lightGrey=\
background: $Center.OuterShadowColor
[style]Panel.roundBorder=\
arc: 5
[style]Panel.menuBar=\
background: $MenuBar.background
@ -1322,5 +1321,19 @@ CellOtherSetPane.height=$Component.defaultHeight
selectedBackground : null; \
pressedBackground : null
[style]Button.pastelButton = \
border: null; \
background: #2576ef1e
[style]ToggleButton.compactButton = \
margin: 2,0,2,0
[style]List.pureList = \
background: $fill.normal
[style]Tree.pureTree = \
background: $fill.normal
[style]Button.envDetectorButton = \
foreground: #FFF; \
background: #2576EF

26
designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java

@ -1,5 +1,6 @@
package com.fr.design.chart;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.ScreenResolution;
import com.fr.base.chart.BaseChartPainter;
import com.fr.base.chart.chartdata.CallbackEvent;
@ -13,18 +14,18 @@ import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader;
import javax.swing.Icon;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Paint;
/**
* 图表的缩略图Icon, 在选择图表类型界面 用到.
*/
public class ChartIcon implements Icon, XMLable {
private static final int WIDTH = 400;
private static final int HEIGHT = 225;
private static final int WIDTH = FineUIScale.scale(215);
private static final int HEIGHT = FineUIScale.scale(100);
private ChartCollection chartCollection;
@ -78,26 +79,23 @@ public class ChartIcon implements Icon, XMLable {
public void paintIcon(Component c, Graphics g, int x, int y) {
BaseChartPainter chartPainter = getChartPainter();
Graphics2D g2d = (Graphics2D) g.create();
//插入图表的宽度是固定的,resolution直接获取屏幕分辨率,resolution现在只会影响到老图表
int resolution = ScreenResolution.getScreenResolution();
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0f));
Graphics2D g2d = (Graphics2D) g;
Paint oldPaint = g2d.getPaint();
g.translate(x, y);
g2d.setPaint(Color.white);
g2d.setColor(new Color(0, 0, 0, 0));
g2d.fillRect(0, 0, getIconWidth(), getIconHeight());
chartPainter.paint(g2d, getIconWidth(), getIconHeight(), resolution, null, callbackEvent);
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f));
g.translate(-x, -y);
g2d.setPaint(oldPaint);
chartPainter.paint(g2d, getIconWidth(), getIconHeight(), ScreenResolution.getScreenResolution(), null, callbackEvent);
g2d.dispose();
}
protected BaseChartPainter getChartPainter() {
BaseChartPainter painter = chartCollection.createResultChartPainterWithOutDealFormula(Calculator.createCalculator(),
return chartCollection.createResultChartPainterWithOutDealFormula(Calculator.createCalculator(),
WebChartIDInfo.createEmptyDesignerInfo(), getIconWidth(), getIconHeight());
return painter;
}

52
designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java

@ -4,8 +4,9 @@ package com.fr.design.chart;
*/
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.chart.chartattr.ChartCollection;
@ -13,21 +14,25 @@ import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.JLayer;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.ListCellRenderer;
import javax.swing.SwingConstants;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.Color;
@ -35,6 +40,10 @@ import java.awt.Component;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
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.fix;
public class ChartTypePane extends ChartCommonWizardPane implements CallbackEvent {
private static final long serialVersionUID = -1175602484968520546L;
@ -60,9 +69,9 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
defaultListModel.insertElementAt(ChartTypeInterfaceManager.getInstance().getName(chartIDs[i]), i);
}
mainTypeList.addListSelectionListener(listSelectionListener);
FineUIStyle.setStyle(mainTypeList, FineUIStyle.PURE_LIST);
JScrollPane typeScrollPane = new JScrollPane(mainTypeList);
typeScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
JLayer<UIScrollPane> typeScrollPane = FineUIUtils.createCollapsibleScrollBarLayer(mainTypeList);
iconViewList = new JList();
@ -71,15 +80,16 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
iconViewList.setVisibleRowCount(0);
iconViewList.setLayoutOrientation(JList.HORIZONTAL_WRAP);
iconViewList.setCellRenderer(iconCellRenderer);
iconViewList.setLayoutOrientation(JList.HORIZONTAL_WRAP);
JScrollPane subListPane = new JScrollPane(iconViewList);
//iconPane.add
mainTypeList.setSelectedIndex(0);
JSplitPane spane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, typeScrollPane, subListPane);
spane.setDividerLocation(150);
JPanel leftPanel = FineLayoutBuilder.asBorderLayoutWrapped(typeScrollPane);
leftPanel.setBorder(FineBorderFactory.createWrappedRoundBorder());
Column center = (Column) FineUIUtils.wrapComponentWithTitle(spane, Toolkit.i18nText("Fine-Design_Chart_M_Popup_Chart_Type"));
JPanel center = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1, 2.5}, leftPanel, subListPane);
center.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
this.add(center);
@ -90,17 +100,23 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
private static final long serialVersionUID = 956888843609479566L;
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
this.setText("");
if (value instanceof ChartIcon) {
this.setIcon((ChartIcon) value);
setHorizontalAlignment(UILabel.CENTER);
ChartIcon chartIcon = (ChartIcon) value;
if (isSelected) {
// 深蓝色.
this.setBackground(FlatUIUtils.getUIColor("Tree.selectionBackground", new Color(57, 107, 181)));
}
this.setBorder(GUICoreUtils.createTitledBorder(getChartName(chartIcon)));
UILabel centerImg = new UILabel(chartIcon);
UILabel text = new UILabel(getChartName(chartIcon), SwingConstants.CENTER);
Column component = column(
fix(5),
cell(centerImg), cell(text),
fix(5)
).getComponent();
Color borderColor = isSelected ? FineUIUtils.getUIColor("defaultHighlightBorderColor", "Component.focusedBorderColor")
: FineUIUtils.getUIColor("defaultBorderColor", "Component.borderColor");
UIRoundedBorder roundedBorder = new UIRoundedBorder(borderColor, 1, 5);
component.setBorder(BorderFactory.createCompoundBorder(
new ScaledEmptyBorder(0, 10, 10, 0), roundedBorder));
component.setBackground(Color.WHITE);
return component;
}
return this;

6
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java

@ -1,5 +1,7 @@
package com.fr.design.mainframe.chart.gui.data.report;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
import com.fr.chart.chartattr.ChartCollection;
@ -170,6 +172,10 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane<ChartC
TinyFormulaPane editor = getEditorComponent();
editor.getUITextField().setText(Utils.objectToString(value));
editor.setBorder(new ScaledEmptyBorder(2, 2, 2, 2));
FineUIStyle.setStyle(editor.getUITextField(), FineUIStyle.TRANSPARENT_TEXT_FIELD);
FineUIStyle.setStyle(editor.getFormulaTextFieldButton(), FineUIStyle.PLAIN_BUTTON);
editor.setOpaque(false);
return editor;
}

8
designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java

@ -42,10 +42,10 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup {
FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
NameableCreator[] related4ChartHyper = {
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float_Chart"), new LazyIcon("cellHyperLinkAttr"), ChartHyperPoplink.class, ChartHyperPoplinkPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Cell"), new LazyIcon("cellHyperLinkAttr"), ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float"), new LazyIcon("cellHyperLinkAttr"), ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyperlink_Form_Link"), new LazyIcon("cellHyperLinkAttr"), formHyperlink.getClass(), FormHyperlinkPane.class)};
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float_Chart"), ChartHyperPoplink.class, ChartHyperPoplinkPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Cell"), ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float"), ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyperlink_Form_Link"), formHyperlink.getClass(), FormHyperlinkPane.class)};
return ArrayUtils.addAll(super.getHyperlinkCreators(), related4ChartHyper);
}

30
designer-chart/src/main/java/com/fr/van/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java

@ -1,13 +1,16 @@
package com.fr.van.chart.bubble.data;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.BubblePlot;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.BubbleTableDefinition;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
@ -15,18 +18,15 @@ import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.List;
public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataContentPane {
private static final Dimension PREFERRED_SIZE = new Dimension(100, 20);
protected UIComboBox seriesName;
protected UIComboBox xCombox;
protected UIComboBox yCombox;
@ -41,20 +41,10 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon
dataScreeningPane = new ChartDataFilterPane(new BubblePlot(), parent);
seriesName.setPreferredSize(PREFERRED_SIZE);
xCombox.setPreferredSize(PREFERRED_SIZE);
yCombox.setPreferredSize(PREFERRED_SIZE);
seriesName.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
initBubbleSize();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize_north = {f, COMPONENT_WIDTH};
double[] rowSize_north = {p, p, p, p};
Component[][] components_north = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name")), seriesName},
new Component[]{new UILabel("x" ), xCombox},
@ -62,15 +52,14 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Value")), bubbleSize},
};
JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north,rowSize_north,columnSize_north);
north.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15));
JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),dataScreeningPane);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,5));
filterPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,5));
JPanel north = FineLayoutBuilder.compatibleTableLayout(10, components_north, new double[]{1.2, 3});
north.setBorder(BorderFactory.createCompoundBorder(
FineBorderFactory.createDefaultUnderlineBorder(), new ScaledEmptyBorder(0, 0, 10, 0)
));
JPanel filterPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),dataScreeningPane);
this.setLayout(new BorderLayout());
this.add(getJSeparator(), BorderLayout.NORTH);
this.add(north, BorderLayout.CENTER);
this.add(filterPane, BorderLayout.SOUTH);
@ -82,7 +71,6 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon
protected void initBubbleSize() {
bubbleSize = new UIComboBox();
bubbleSize.setPreferredSize(new Dimension(100, 20));
}
/**

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java

@ -155,7 +155,7 @@ public class VanChartAxisStyleSettingPane extends BasicBeanPane<VanChartAxisLabe
JPanel gapDetailPane = FineLayoutBuilder.compatibleTableLayout(10, gapComponents, new double[]{1.2, 3});
labelGapValuePane = FineLayoutBuilder.asBorderLayoutWrapped(labelGapValue);
JPanel panel = new JPanel(new BorderLayout());
JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
panel.add(gapDetailPane, BorderLayout.CENTER);
panel.add(labelGapValuePane, BorderLayout.SOUTH);

5
designer-chart/src/main/java/com/fr/van/chart/map/designer/VanChartGroupPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.map.designer;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.ibutton.UIButtonGroup;
import javax.swing.JPanel;
@ -38,8 +39,8 @@ public abstract class VanChartGroupPane extends JPanel{
tabChanged(buttonGroup.getSelectedIndex());
}
});
buttonGroup.setBorder(getButtonGroupBorder());
this.setLayout(new BorderLayout(0, 4));
this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
this.setLayout(new BorderLayout());
this.add(buttonGroup, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER);
}

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

@ -1,7 +1,6 @@
package com.fr.van.chart.map.designer.type;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.foldablepane.UIExpandablePane;
@ -43,7 +42,6 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
new Component[]{mapStatusPaneWithTitle}
};
JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(0, comps, new double[]{1});
this.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
this.add(contentPane, BorderLayout.CENTER);
}

3
designer-chart/src/main/java/com/fr/van/chart/scatter/data/VanChartScatterPlotTableDataContentPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.scatter.data;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartdata.BubbleTableDefinition;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
@ -18,7 +19,7 @@ public class VanChartScatterPlotTableDataContentPane extends VanChartBubblePlotT
@Override
protected void initBubbleSize() {
bubbleSize = new UIComboBox();
bubbleSize.setPreferredSize(new Dimension(100, 20));
bubbleSize.setPreferredSize(FineUIScale.scale(new Dimension(100, 20)));
bubbleSize.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
}

136
designer-form/src/main/java/com/fr/design/parameter/ParameterToolBarPane.java

@ -1,20 +1,25 @@
package com.fr.design.parameter;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Parameter;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.BorderFactory;
import javax.swing.SwingConstants;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.LayoutManager;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* 参数点击动作条
@ -22,43 +27,35 @@ import java.util.ArrayList;
* */
public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
private Parameter[] parameterList;
private ArrayList<UIButton> parameterSelectedLabellist = new ArrayList<UIButton>();
private MouseListener paraMouseListner;
private UIButton addAll;
private UILabel label;
private int breakid;
private static final int GAP_H = 4;
private static final int GAP_V = 6;
private static final int GAP_BV = 4;
private static final int BUTTON_HEIGHT = 20;
private static final int WIDTH = 225;
private static final int L_H = 18;
private static final int LABEL_PADDING_LEFT = 4;
private final ArrayList<UIButton> parameterSelectedLabelList = new ArrayList<>();
private MouseListener paraMouseListener;
private final UIButton addAll;
private final UILabel label;
public ParameterToolBarPane() {
this.setLayout(new FlowParameterPaneLayout());
label = new UILabel() {
private static final long serialVersionUID = 1L;
this.setLayout(new BorderLayout());
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 18);
}
};
label.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Following_parameters_are_not_generated") + ":");
label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Following_parameters_are_not_generated") + ":");
label.setHorizontalAlignment(SwingConstants.LEFT);
label.setBorder(BorderFactory.createEmptyBorder(0, LABEL_PADDING_LEFT, 0, 0));
this.add(label);
addAll = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Add_all"));
this.add(addAll);
initLayout();
}
private void initLayout() {
Column buttonTable = FineLayoutBuilder.createCommonTableLayout(4, 5, 10, parameterSelectedLabelList);
this.add(column(6,
cell(label),
cell(buttonTable).weight(1),
cell(addAll)
).weight(1).with(it -> it.setBorder(BorderFactory.createCompoundBorder(
FineBorderFactory.createDefaultUnderlineBorder(), new ScaledEmptyBorder(0, 10, 10, 10)
))).getComponent());
}
public boolean hasSelectedLabelItem() {
return !parameterSelectedLabellist.isEmpty();
return !parameterSelectedLabelList.isEmpty();
}
@Override
@ -67,7 +64,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
}
public Parameter getTargetParameter(UIButton button) {
int index = parameterSelectedLabellist.indexOf(button);
int index = parameterSelectedLabelList.indexOf(button);
if (index < 0 || index > parameterList.length - 1) {
return null;
}
@ -76,11 +73,9 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
@Override
public void populateBean(Parameter[] parameterArray) {
parameterSelectedLabellist.clear();
parameterSelectedLabelList.clear();
this.removeAll();
this.add(label);
if (parameterArray.length == 0) {
this.setVisible(false);
this.repaint();
@ -90,18 +85,17 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
}
parameterList = parameterArray;
for (int i = 0; i < parameterList.length; i++) {
UIButton parameterSelectedLabel = new UIButton(parameterList[i].getName());
parameterSelectedLabellist.add(parameterSelectedLabel);
this.add(parameterSelectedLabel);
for (Parameter parameter : parameterList) {
UIButton parameterSelectedLabel = new UIButton(parameter.getName());
parameterSelectedLabelList.add(parameterSelectedLabel);
FineUIStyle.setStyle(parameterSelectedLabel, FineUIStyle.PASTEL_BUTTON);
}
for(UIButton parameterSelectedLabel : parameterSelectedLabellist) {
parameterSelectedLabel.addMouseListener(paraMouseListner);
for(UIButton parameterSelectedLabel : parameterSelectedLabelList) {
parameterSelectedLabel.addMouseListener(paraMouseListener);
}
this.add(addAll);
this.doLayout();
initLayout();
this.repaint();
}
@ -111,63 +105,11 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
}
public void setParaMouseListener(MouseListener l) {
this.paraMouseListner = l;
this.paraMouseListener = l;
}
public void addActionListener(ActionListener l) {
addAll.addActionListener(l);
}
// ParameterToolBarPane 的布局
private class FlowParameterPaneLayout implements LayoutManager {
public FlowParameterPaneLayout() {
// do nothing
}
public void addLayoutComponent(String name, Component comp) {
// do nothing
}
public void removeLayoutComponent(Component comp) {
// do nothing
}
public Dimension preferredLayoutSize(Container parent) {
int w = parent.getWidth();
layoutContainer(parent);
int h= (parameterSelectedLabellist.isEmpty() ? 0 : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height);
return new Dimension(w, h);
}
public Dimension minimumLayoutSize(Container parent) {
return new Dimension(0, 0);
}
public void layoutContainer(Container parent) {
int width = parent.getWidth() == 0 ? WIDTH : parent.getWidth();
int x = 0;
int y = L_H + GAP_H;
label.setBounds(0, 0, width, L_H);
breakid = 1;
for (UIButton tab : parameterSelectedLabellist) {
Dimension dim = tab.getPreferredSize();
if (x + dim.width > width) {
breakid++;
x = 0;
y += (dim.height + GAP_V);
}
tab.setBounds(x, y, dim.width, dim.height);
x += (dim.width + GAP_H);
}
addAll.setBounds(0, y + GAP_V + BUTTON_HEIGHT, width, addAll.getPreferredSize().height);
}
}
}

4
designer-realize/src/main/java/com/fr/design/actions/server/WidgetManagerAction.java

@ -16,13 +16,11 @@ import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import javax.swing.KeyStroke;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class WidgetManagerAction extends UpdateAction {
public static final Dimension WINDOW_CUSTOM_SIZE = new Dimension(720, 600);
public WidgetManagerAction() {
this.setMenuKeySet(WIDGET_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
@ -70,7 +68,7 @@ public class WidgetManagerAction extends UpdateAction {
}
}));
}
}, WINDOW_CUSTOM_SIZE);
}, BasicDialog.LARGE);
widgetConfigDialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {

4
designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java

@ -24,6 +24,7 @@ import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.cell.cellattr.core.group.SelectCount;
import javax.swing.JPanel;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.CardLayout;
@ -61,7 +62,8 @@ public class DSColumnAdvancedPane extends BasicPane {
private void initScrollPane() {
this.setLayout(new BorderLayout());
UIScrollPane scrollPane = new UIScrollPane(contentPane);
UIScrollPane scrollPane = new UIScrollPane(contentPane,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
this.add(scrollPane);
}

2
designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java

@ -81,7 +81,7 @@ public class CellWidgetPropertyPane extends BasicPane {
public void reInit(ElementCasePane ePane) {
this.ePane = ePane;
cellEditorDefPane = new WidgetPane(ePane);
cellEditorDefPane = new WidgetPane(ePane, true);
this.removeAll();
this.add(cellEditorDefPane, BorderLayout.CENTER);

4
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java

@ -1,7 +1,7 @@
package com.fr.design.mainframe.cell.settingpane.desensitization;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
@ -92,7 +92,7 @@ public class CellDesensitizationGroupsPane extends JPanel {
this.add(pane, BorderLayout.CENTER);
}
};
tableEditorPane.setBorder(new FineRoundBorder());
tableEditorPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
return tableEditorPane;
}

3
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/CellDesensitizationTableModel.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.cell.settingpane.desensitization.model;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.itableeditorpane.UITableEditAction;
import com.fr.design.gui.itableeditorpane.UITableModelAdapter;
import com.fr.design.i18n.Toolkit;
@ -18,7 +19,7 @@ import java.awt.event.ActionEvent;
* Created by Leo.Qin on 2023/1/4
*/
public class CellDesensitizationTableModel extends UITableModelAdapter<CellDesensitizationBean> {
private final int ROW_HEIGHT = 60;
private final int ROW_HEIGHT = FineUIScale.scale(72);
/**
* 属性面板
*/

8
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellEditor.java

@ -3,12 +3,9 @@ package com.fr.design.mainframe.cell.settingpane.desensitization.model;
import com.fr.report.cell.desensitization.CellDesensitizationBean;
import javax.swing.AbstractCellEditor;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SwingWorker;
import javax.swing.border.LineBorder;
import javax.swing.table.TableCellEditor;
import java.awt.Color;
import java.awt.Component;
import java.util.Map;
@ -33,10 +30,7 @@ public class DesensitizationCellEditor extends AbstractCellEditor implements Tab
editPane.populate((CellDesensitizationBean) value, row);
JPanel editPanel = editPane.getEditPanel();
editPanel.setBorder(new LineBorder(Color.LIGHT_GRAY));
return editPanel;
return editPane.getEditPanel();
}

62
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java

@ -1,36 +1,31 @@
package com.fr.design.mainframe.cell.settingpane.desensitization.model;
import com.fr.base.operator.org.OrganizationOperator;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.data.desensitize.rule.DesensitizationRuleManager;
import com.fr.data.desensitize.rule.base.DesensitizationRule;
import com.fr.data.desensitize.rule.base.DesensitizationRuleSource;
import com.fr.data.desensitize.rule.base.DesensitizationRuleStatus;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.data.datapane.preview.desensitization.view.rule.DesensitizationRulePane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.event.UIObserverListener;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombocheckbox.UIComboCheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JTemplateActionListener;
import com.fr.report.cell.desensitization.CellDesensitizationBean;
import com.fr.stable.StringUtils;
import com.fr.third.org.apache.commons.collections4.map.HashedMap;
import com.fr.workspace.WorkContext;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
@ -43,7 +38,12 @@ import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.theme.utils.FineUIStyle.PLAIN_BUTTON;
import static com.fine.theme.utils.FineUIStyle.TRANSPARENT_TEXT_FIELD;
import static com.fine.theme.utils.FineUIStyle.setStyle;
/**
* 单元格脱敏规则设置面板
@ -78,19 +78,18 @@ public class DesensitizationCellPane extends BasicBeanPane {
}
private void initComponent() {
editPanel = new JPanel();
editPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true));
label = new UILabel();
label.setEnabled(false);
editPanel.add(label);
ruleButton = new UIButton(APOSTROPHE);
setStyle(ruleButton, PLAIN_BUTTON);
ruleTextField = new UITextField();
ruleTextField.setEnabled(true);
ruleTextField.setEditable(false);
ruleTextField.setPlaceholder(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Place_Holder"));
setStyle(ruleTextField, TRANSPARENT_TEXT_FIELD);
roleMap = new HashedMap<>();
rolesComboBox = new RuleUIComboCheckBox();
@ -100,9 +99,26 @@ public class DesensitizationCellPane extends BasicBeanPane {
emptyTextField = new UITextField();
emptyTextField.setEnabled(false);
emptyTextField.setOpaque(false);
setStyle(emptyTextField, TRANSPARENT_TEXT_FIELD);
Color borderColor = FlatUIUtils.getUIColor("defaultBorderColor", Color.GRAY);
setInsideBorder(borderColor);
editPanel = FineLayoutBuilder.asBorderLayoutWrapped(
column(
cell(label).with(it -> it.setBorder(
BorderFactory.createMatteBorder(1, 0, 1, 0, borderColor))).weight(1),
cell(initTableCellPanel()) .weight(2)
).getComponent()
);
editPanel.add(initTableCellPanel());
}
private void setInsideBorder(Color borderColor) {
ruleButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, borderColor));
emptyTextField.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, borderColor));
ruleTextField.setBorder(FineBorderFactory.createDefaultUnderlineBorder());
}
@ -110,17 +126,11 @@ public class DesensitizationCellPane extends BasicBeanPane {
* 初始化单元格中的panel
*/
private JPanel initTableCellPanel() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = new double[]{f, f};
double[] columnSize = new double[]{p, f};
Component[][] components = new Component[][]{
new Component[]{ruleButton, ruleTextField},
new Component[]{emptyTextField, rolesComboBox}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 0);
return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1, 4});
}
private void addListener() {
@ -280,8 +290,12 @@ public class DesensitizationCellPane extends BasicBeanPane {
protected void setLayoutAndAddComponents() {
// 使用BorderLayout,否则默认使用的FlowLayout会让整个下拉选框使用最小Size,然后TableCell这边会出现空白
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(getEditor(), BorderLayout.CENTER);
this.add(getArrowButton(), BorderLayout.EAST);
UITextField editor = getEditor();
UIButton arrowButton = getArrowButton();
setStyle(editor, TRANSPARENT_TEXT_FIELD);
setStyle(arrowButton, PLAIN_BUTTON);
this.add(editor, BorderLayout.CENTER);
this.add(arrowButton, BorderLayout.EAST);
}
@Override

7
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellRender.java

@ -1,8 +1,10 @@
package com.fr.design.mainframe.cell.settingpane.desensitization.model;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.report.cell.desensitization.CellDesensitizationBean;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.border.LineBorder;
import javax.swing.table.DefaultTableCellRenderer;
@ -41,8 +43,9 @@ public class DesensitizationCellRender extends DefaultTableCellRenderer {
} else {
editPane.getEditPanel().setBorder(BorderFactory.createEmptyBorder());
}
return editPane.getEditPanel();
JPanel editPanel = editPane.getEditPanel();
editPanel.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
return editPanel;
}

3
designer-realize/src/main/java/com/fr/design/sort/common/SortUIExpandablePane.java

@ -5,6 +5,7 @@ import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -40,7 +41,7 @@ public class SortUIExpandablePane extends JPanel {
this.sortGroupPane = sortGroupPane;
this.contentPane = contentPane;
initComponents();
wrapPane.setBorder(new FineRoundBorder());
wrapPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
wrapPane.setBackground(Color.WHITE);
}

62
designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java

@ -1,12 +1,13 @@
package com.fr.design.widget;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fine.swing.ui.layout.BaseLayoutContainer;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.dialog.AttrScrollPane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.FineTabbedPane;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane;
@ -18,6 +19,7 @@ import com.fr.form.ui.Widget;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.util.ArrayList;
import static com.fine.swing.ui.layout.Layouts.cell;
@ -34,9 +36,7 @@ public class CellWidgetCardPane extends BasicPane {
private WidgetMobilePane currentWidgetMobilePane;
//属性配置切换面板
private ArrayList<JPanel> paneList;
private JPanel center;
private UIHeadGroup tabsHeaderIconPane;
private CardLayout tabbedPane;
private BaseLayoutContainer tabsHeaderIconPane;
private BasicWidgetPropertySettingPane widgetPropertyPane;
//通用属性容器
@ -64,23 +64,29 @@ public class CellWidgetCardPane extends BasicPane {
this.removeAll();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
tabbedPane = new CardLayout();
center = new JPanel(tabbedPane);
final String[] tabTitles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attribute"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal")};
tabsHeaderIconPane = new UIHeadGroup(tabTitles) {
@Override
public void tabChanged(int index) {
tabbedPane.show(center, tabTitles[index]);
Component component = initTabPane();
initTabHead(tabTitles, component);
this.add(tabsHeaderIconPane, BorderLayout.CENTER);
initPaneList();
}
};
JPanel wrapperPane = new JPanel(new BorderLayout());
wrapperPane.add(tabsHeaderIconPane, BorderLayout.NORTH);
wrapperPane.add(center, BorderLayout.CENTER);
wrapperPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 10));
this.add(wrapperPane, BorderLayout.CENTER);
private void initTabHead(String[] tabTitles, Component component) {
tabsHeaderIconPane = FineTabbedPane.builder()
.addTab(tabTitles[0], component)
.addTab(tabTitles[1], eventTabPane)
.addTab(tabTitles[2], mobileTabPane)
.withHeadRatio(1.0f)
.build();
}
protected Component initTabPane() {
// 属性
attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
BasicScrollPane basicScrollPane = new AttrScrollPane() {
@ -112,14 +118,10 @@ public class CellWidgetCardPane extends BasicPane {
mobileTabPane.add(mobileCardPane, BorderLayout.CENTER);
mobileCardLayout = (CardLayout) mobileCardPane.getLayout();
center.add(basicScrollPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attribute"));
center.add(eventTabPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"));
center.add(mobileTabPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal"));
initPaneList();
return basicScrollPane;
}
private void initPaneList() {
protected void initPaneList() {
paneList = new ArrayList<JPanel>();
paneList.add(attriTabPane);
paneList.add(eventPane);
@ -137,7 +139,10 @@ public class CellWidgetCardPane extends BasicPane {
public void populate(Widget cellWidget) {
initComponents(pane);
populateWidget(cellWidget);
}
protected void populateWidget(Widget cellWidget) {
WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() {
@Override
public void did(DataCreatorUI ui, String cardName) {
@ -160,8 +165,9 @@ public class CellWidgetCardPane extends BasicPane {
mobileCardLayout.show(mobileCardPane, mobilePane.getClass().toString());
currentWidgetMobilePane = mobilePane;
tabsHeaderIconPane.setSelectedIndex(0);
if (tabsHeaderIconPane instanceof UIHeadGroup) {
((UIHeadGroup) tabsHeaderIconPane).setSelectedIndex(0);
}
}
public Widget update() {
@ -195,4 +201,12 @@ public class CellWidgetCardPane extends BasicPane {
eventPane.checkValid();
}
protected JPanel getEventTabPane() {
return this.eventTabPane;
}
protected JPanel getMobileTabPane() {
return this.mobileTabPane;
}
}

67
designer-realize/src/main/java/com/fr/design/widget/EastCellWidgetCardPane.java

@ -0,0 +1,67 @@
package com.fr.design.widget;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.form.ui.Widget;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
/**
* 东区控件面板子类
* @author Renekton
* @since 2024/8/6.
* Created on 2024/8/6.
*/
public class EastCellWidgetCardPane extends CellWidgetCardPane {
private CardLayout tabbedPane;
private JPanel center;
private UIHeadGroup tabsHeaderIconPane;
public EastCellWidgetCardPane(ElementCasePane pane) {
super(pane);
}
private void initComponents() {
this.removeAll();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
tabbedPane = new CardLayout();
center = new JPanel(tabbedPane);
final String[] tabTitles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attribute"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal")};
tabsHeaderIconPane = new UIHeadGroup(tabTitles) {
@Override
public void tabChanged(int index) {
tabbedPane.show(center, tabTitles[index]);
}
};
JPanel wrapperPane = new JPanel(new BorderLayout());
wrapperPane.add(tabsHeaderIconPane, BorderLayout.NORTH);
wrapperPane.add(center, BorderLayout.CENTER);
wrapperPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 10));
this.add(wrapperPane, BorderLayout.CENTER);
Component component = initTabPane();
center.add(component, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attribute"));
center.add(getEventTabPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"));
center.add(getMobileTabPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal"));
initPaneList();
}
/**
* 东区面板
*/
public void populate(Widget cellWidget) {
initComponents();
super.populateWidget(cellWidget);
}
}

29
designer-realize/src/main/java/com/fr/design/widget/ValueWidgetPane.java

@ -4,16 +4,17 @@ import javax.swing.*;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.form.ui.DataControl;
import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetValue;
import java.awt.*;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public class ValueWidgetPane extends WidgetPane {
private JPanel widgetValuePane;
@ -27,18 +28,20 @@ public class ValueWidgetPane extends WidgetPane {
public JPanel initNorthPane(){
JPanel northPane = super.initNorthPane();
label = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Value")+ ":");
label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Value"));
label.setVisible(false);
widgetValuePane = new JPanel();
widgetValuePane.setLayout(FRGUIPaneFactory.createBorderLayout());
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, p, f};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{northPane, label,widgetValuePane},
};
JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel jPanel = new JPanel(FRGUIPaneFactory.createBorderLayout());
jPanel.add(column(10,
cell(northPane),
column(
row(
cell(label).weight(LEFT_WEIGHT),
cell(widgetValuePane).weight(RIGHT_WEIGHT)
)
)
).getComponent());
return jPanel;
}

9
designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java

@ -50,6 +50,8 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
private boolean shouldFireSelectedEvent = true;
private JComponent northPane;
private boolean eastRegion = false;
public WidgetPane() {
this(null);
}
@ -61,6 +63,11 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
this.initComponents(pane);
}
public WidgetPane(ElementCasePane pane, boolean eastRegion) {
this.eastRegion = eastRegion;
this.initComponents(pane);
}
public boolean isShouldFireSelectedEvent(){
return shouldFireSelectedEvent;
@ -97,7 +104,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
}
protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane) {
return new CellWidgetCardPane(pane);
return eastRegion ? new EastCellWidgetCardPane(pane) : new CellWidgetCardPane(pane);
}
protected JPanel createContentPane() {

44
designer-realize/src/main/java/com/fr/design/widget/ui/DateEditorDefinePane.java

@ -1,16 +1,14 @@
package com.fr.design.widget.ui;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.FRContext;
import com.fr.data.core.FormatField;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.DateValuePane;
import com.fr.design.widget.component.UIComboBoxNoArrow;
import com.fr.design.widget.ui.designer.date.DateFormatCheckManager;
@ -31,6 +29,12 @@ import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.Date;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> {
private UIButtonGroup returnTypeComboBox;
@ -57,27 +61,22 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
JPanel formatHead = createFormatHead();
startDv = new DateValuePane();
endDv = new DateValuePane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
UILabel formatLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Format"));
formatLabel.setVerticalAlignment(SwingConstants.TOP);
UILabel startDateLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_Start_Date"));
startDateLabel.setVerticalAlignment(SwingConstants.TOP);
UILabel endDateLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_End_Date"));
endDateLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] components = new Component[][]{
new Component[]{formatLabel, formatHead},
new Component[]{startDateLabel, startDv},
new Component[]{endDateLabel, endDv},
new Component[]{waterMarkDictPane, null},
new Component[]{extraPane, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type")), returnTypeComboBox }
};
double[] rowSize = {p, p, p, p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1},{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
UILabel returnLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type"));
JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout());
panel.add(column(10,
row(cell(formatLabel).weight(LEFT_WEIGHT), cell(formatHead).weight(RIGHT_WEIGHT)),
row(cell(startDateLabel).weight(LEFT_WEIGHT), cell(startDv).weight(RIGHT_WEIGHT)),
row(cell(endDateLabel).weight(LEFT_WEIGHT), cell(endDv).weight(RIGHT_WEIGHT)),
cell(waterMarkDictPane),
cell(extraPane),
row(cell(returnLabel).weight(LEFT_WEIGHT), cell(returnTypeComboBox).weight(RIGHT_WEIGHT))
).getComponent());
return panel;
}
@ -134,7 +133,8 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
});
final UILabel dateSampleLabel = createSamplePane();
final UILabel timeSampleLabel = createSamplePane();
JPanel fomatHeadPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel formatHeadPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
formatHeadPane.setBorder(new ScaledEmptyBorder(5, 0, 5, 0));
final CardLayout cardLayout = new CardLayout();
final JPanel customPane = new JPanel(cardLayout);
JPanel dateFormatPane = createFormatPane(dateFormatComboBox, dateSampleLabel);
@ -158,9 +158,9 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
refreshPreviewLabel();
}
});
fomatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH);
fomatHeadPane.add(customPane, BorderLayout.CENTER);
return fomatHeadPane;
formatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH);
formatHeadPane.add(customPane, BorderLayout.CENTER);
return formatHeadPane;
}

2
designer-realize/src/main/java/com/fr/start/MainDesigner.java

@ -157,7 +157,7 @@ public class MainDesigner extends BaseDesigner {
FineLoggerFactory.getLogger().info("Designer started.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS));
SwitchForSwingChecker.initThreadMonitoring();
new UiInspector();
// new UiInspector();
// EdtInvocationManager.installEDTCheckers();
}

12
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -342,12 +342,12 @@ public class DesignerActivator extends Activator implements Prepare {
private static NameableCreator[] hyperlinkTypes() {
return new NameableCreator[]{
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet"), new LazyIcon("cellHyperLinkAttr"), ReportletHyperlink.class, ReportletHyperlinkPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"), new LazyIcon("cellHyperLinkAttr"), EmailJavaScript.class, EmailPane.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Web_Link"), new LazyIcon("cellHyperLinkAttr"), WebHyperlink.class, WebHyperlinkPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_JavaScript_Dynamic_Parameters"), new LazyIcon("cellHyperLinkAttr"), ParameterJavaScript.class, ParameterJavaScriptPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript"), new LazyIcon("cellHyperLinkAttr"), JavaScriptImpl.class, JavaScriptImplPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup"), new LazyIcon("cellHyperLinkAttr"), MobilePopupHyperlink.class, MobilePopupPane.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"), EmailJavaScript.class, EmailPane.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Web_Link"), WebHyperlink.class, WebHyperlinkPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_JavaScript_Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript"), JavaScriptImpl.class, JavaScriptImplPane.ChartNoRename.class),
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup"), MobilePopupHyperlink.class, MobilePopupPane.class),
};
}

Loading…
Cancel
Save