Browse Source

REPORT-113994 【NewUI】面板翻新问题收尾

newui
Levy.Xie-解安森 4 months ago
parent
commit
5a2dc912de
  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. 5
      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. 11
      designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java
  11. 62
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  12. 14
      designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java
  13. 3
      designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java
  14. 8
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  15. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java
  16. 35
      designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java
  17. 19
      designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java
  18. 155
      designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationPane.java
  19. 4
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  20. 17
      designer-base/src/main/java/com/fr/design/gui/itable/UITable.java
  21. 22
      designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java
  22. 4
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/ClassFileTree.java
  23. 15
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java
  24. 4
      designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java
  25. 6
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/LabelUtils.java
  26. 12
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java
  27. 2
      designer-base/src/main/java/com/fr/design/present/FormulaPresentPane.java
  28. 95
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  29. 3
      designer-base/src/main/java/com/fr/file/FileFILE.java
  30. 5
      designer-base/src/main/java/com/fr/file/FileNodeFILE.java
  31. 2
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties
  32. 22
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  33. 26
      designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java
  34. 52
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  35. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java
  36. 30
      designer-chart/src/main/java/com/fr/van/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java
  37. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java
  38. 5
      designer-chart/src/main/java/com/fr/van/chart/map/designer/VanChartGroupPane.java
  39. 2
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java
  40. 3
      designer-chart/src/main/java/com/fr/van/chart/scatter/data/VanChartScatterPlotTableDataContentPane.java
  41. 136
      designer-form/src/main/java/com/fr/design/parameter/ParameterToolBarPane.java
  42. 4
      designer-realize/src/main/java/com/fr/design/actions/server/WidgetManagerAction.java
  43. 4
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java
  44. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java
  45. 3
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/CellDesensitizationTableModel.java
  46. 8
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellEditor.java
  47. 62
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java
  48. 7
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellRender.java
  49. 3
      designer-realize/src/main/java/com/fr/design/sort/common/SortUIExpandablePane.java
  50. 2
      designer-realize/src/main/java/com/fr/start/MainDesigner.java

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

@ -144,6 +144,21 @@ public class IconManager {
|| FileExtension.JPG.matchExtension(path); || 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"; 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_INNER = 0;
int GROUP_BUTTON_POSITION_LEFT = 1; int GROUP_BUTTON_POSITION_LEFT = 1;
int GROUP_BUTTON_POSITION_RIGHT = 2; 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);
}

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

@ -33,13 +33,14 @@ public interface FineUIStyle {
String PLAIN_BUTTON = "plainButton"; String PLAIN_BUTTON = "plainButton";
String TOGGLE_GROUP = "inToggleGroup"; String TOGGLE_GROUP = "inToggleGroup";
String COMPACT_BUTTON = "compactButton"; String COMPACT_BUTTON = "compactButton";
String ROUND_BORDER_PANEL = "roundBorder";
String MENU_TOOL_BAR = "menuToolBar"; String MENU_TOOL_BAR = "menuToolBar";
String MENU_ITEM_TOOL_BAR = "menuItemToolBar"; String MENU_ITEM_TOOL_BAR = "menuItemToolBar";
String POPUP_MENU_TOOL_BAR = "popupMenuToolBar"; String POPUP_MENU_TOOL_BAR = "popupMenuToolBar";
String POPUP_MENU_DROPDOWN = "dropdownPopupMenu"; String POPUP_MENU_DROPDOWN = "dropdownPopupMenu";
String TRANSPARENT_TEXT_FIELD = "transparentTextField"; String TRANSPARENT_TEXT_FIELD = "transparentTextField";
String PURE_LIST = "pureList";
String PURE_TREE = "pureTree";
String PASTEL_BUTTON = "pastelButton";
String ENV_DECTETOR_BUTTON = "envDetectorButton"; 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.column;
import static com.fine.swing.ui.layout.Layouts.fix; import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row; 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; import static com.fr.design.i18n.Toolkit.i18nText;
/** /**
@ -810,7 +811,7 @@ public class PreferencePane extends BasicPane {
i++; i++;
} }
UIDictionaryComboBox<Locale> languageComboBox = new UIDictionaryComboBox<>(keys, values); 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; 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() 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_About"), aboutPanel)
.addTab(com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Basic_System"), sysPane) .addTab(com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Basic_System"), sysPane)
.withHeadRatio(0.3f)
.build(); .build();
buttonPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); 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(); JPanel contentPane = column().getComponent();
centerPane.add(contentPane, BorderLayout.NORTH); centerPane.add(contentPane, BorderLayout.NORTH);
contentPane.add(new BoxCenterAligmentPane(getBuildTitle())); contentPane.add(new BoxCenterAligmentPane(getBuildTitle(), FineUIStyle.LABEL_BOLD));
BoxCenterAlignmentCopyablePane buildCopyPane = new BoxCenterAlignmentCopyablePane( BoxCenterAlignmentCopyablePane buildCopyPane = new BoxCenterAlignmentCopyablePane(
StringUtils.EMPTY, StringUtils.EMPTY,
getVersionBuildNO(), getVersionBuildNO(),
@ -73,7 +73,8 @@ public class AboutPane extends JPanel {
BoxCenterAligmentPane boxCenterAlignmentPane = new BoxCenterAligmentPane(getCopyRight()); BoxCenterAligmentPane boxCenterAlignmentPane = new BoxCenterAligmentPane(getCopyRight());
contentPane.add(boxCenterAlignmentPane); 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(boxCenterAlignmentPane);
contentPane.add(new BoxCenterAlignmentCopyablePane( contentPane.add(new BoxCenterAlignmentCopyablePane(
@ -276,6 +277,11 @@ public class AboutPane extends JPanel {
private UILabel textLabel; private UILabel textLabel;
public BoxCenterAligmentPane(String text, String style) {
this(text);
FineUIStyle.setStyle(textLabel, style);
}
public BoxCenterAligmentPane(String text) { public BoxCenterAligmentPane(String text) {
this(new UILabel(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; package com.fr.design.border;
import com.fine.theme.utils.FineUIUtils; 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.BorderFactory;
import javax.swing.border.Border; import javax.swing.border.Border;
@ -53,4 +55,17 @@ public class FineBorderFactory {
return createToplineBorder(FineUIUtils.getUIColor("Label.borderColor", "defaultBorderColor")); 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)
);
}
} }

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

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

@ -20,12 +20,12 @@ import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* *
* @author zhou * @author zhou
* @since 2012-6-1下午3:50:37 * @since 2012-6-1下午3:50:37
*/ */
public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver{ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
protected UITextField formulaTextField; protected UITextField formulaTextField;
protected UIButton formulaTextFieldButton; protected UIButton formulaTextFieldButton;
@ -77,18 +77,22 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver
cell(formulaTextField).weight(2.4), flex(0.1), cell(formulaTextFieldButton).weight(0.5) cell(formulaTextField).weight(2.4), flex(0.1), cell(formulaTextFieldButton).weight(0.5)
).getComponent()) ; ).getComponent()) ;
} }
/** /**
* 公式窗口点击确定后的事件接口 * 公式窗口点击确定后的事件接口
*/ */
public void okEvent() { public void okEvent() {
} }
public UITextField getUITextField() { public UITextField getUITextField() {
return formulaTextField; return formulaTextField;
} }
public UIButton getFormulaTextFieldButton() {
return formulaTextFieldButton;
}
@Override @Override
public void populateBean(String ob) { public void populateBean(String ob) {
this.formulaTextField.setText(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; package com.fr.design.gui.controlpane;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
@ -94,7 +93,7 @@ public abstract class JListControlPane extends JControlPane implements ListContr
nameableList.setName(LIST_NAME); nameableList.setName(LIST_NAME);
nameableList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); nameableList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
leftPane.add(new UIScrollPane(nameableList), BorderLayout.CENTER); leftPane.add(new UIScrollPane(nameableList), BorderLayout.CENTER);
leftPane.setBorder(new FineRoundBorder()); leftPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
nameableList.addMouseListener(listMouseListener); nameableList.addMouseListener(listMouseListener);
nameableList.addListSelectionListener(new ListSelectionListener() { 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; package com.fr.design.gui.controlpane;
import com.fine.theme.light.ui.FineButtonBorder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory; import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory;
@ -86,13 +86,11 @@ public abstract class UIControlPane extends JControlPane {
// 增加边框 // 增加边框
JPanel leftPaneWrapper = new JPanel(new BorderLayout()); JPanel leftPaneWrapper = new JPanel(new BorderLayout());
leftPaneWrapper.add(getLeftPane(), BorderLayout.CENTER); leftPaneWrapper.add(getLeftPane(), BorderLayout.CENTER);
leftPaneWrapper.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
JPanel rightPaneWrapper = new JPanel(new BorderLayout()); JPanel rightPaneWrapper = new JPanel(new BorderLayout());
rightPaneWrapper.add(cardPane, BorderLayout.CENTER); rightPaneWrapper.add(cardPane, BorderLayout.CENTER);
rightPaneWrapper.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6)); rightPaneWrapper.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
// SplitPane // SplitPane
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, leftPaneWrapper, rightPaneWrapper); JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, leftPaneWrapper, rightPaneWrapper);
mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor()));
mainSplitPane.setOneTouchExpandable(true); mainSplitPane.setOneTouchExpandable(true);
this.add(mainSplitPane, BorderLayout.CENTER); this.add(mainSplitPane, BorderLayout.CENTER);
mainSplitPane.setDividerLocation(getLeftPreferredSize()); mainSplitPane.setDividerLocation(getLeftPreferredSize());
@ -152,7 +150,7 @@ public abstract class UIControlPane extends JControlPane {
cell(FRWidgetFactory.createLineWrapLabel(getAddItemText())), cell(FRWidgetFactory.createLineWrapLabel(getAddItemText())),
cell(topToolBar).with(it -> { cell(topToolBar).with(it -> {
it.setBorderPainted(true); it.setBorderPainted(true);
it.setBorder(new FineButtonBorder()); it.setBorder(FineBorderFactory.createWrappedRoundBorder());
it.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE)); it.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
}).weight(1.0) }).weight(1.0)
).getComponent(); ).getComponent();

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

@ -1,7 +1,7 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.formdev.flatlaf.ui.FlatRoundBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
@ -76,7 +76,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon
nameableList.setName(LIST_NAME); nameableList.setName(LIST_NAME);
UIScrollPane scrollPane = new UIScrollPane(nameableList); UIScrollPane scrollPane = new UIScrollPane(nameableList);
leftPane.add(scrollPane, BorderLayout.CENTER); leftPane.add(scrollPane, BorderLayout.CENTER);
leftPane.setBorder(new FlatRoundBorder()); leftPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
nameableList.addMouseListener(getHelper().getListMouseListener(nameableList, this)); 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; 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.BaseUtils;
import com.fr.base.background.GradientBackground; import com.fr.base.background.GradientBackground;
import com.fr.design.carton.MonthlyCartonFile; import com.fr.design.carton.MonthlyCartonFile;
@ -25,6 +27,7 @@ import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList; import javax.swing.event.EventListenerList;
@ -52,6 +55,8 @@ import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import static com.fine.theme.utils.FineUIScale.scale;
public class UICalendarPanel extends JPanel { public class UICalendarPanel extends JPanel {
private static final Font FONT_UI = DesignUtils.getDefaultGUIFont().applySize(12); 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); 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(); dayBttListener = createDayBttListener();
//renderer this //renderer this
setPreferredSize(new Dimension(218, 179)); setPreferredSize(scale(new Dimension(218, 179)));
setBackground(new Color(0xFFFFFF)); setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
setBorder(BorderFactory.createLineBorder(new Color(0x959595))); setBorder(new LineBorder(FlatUIUtils.getUIColor("defaultBorderColor", Color.BLACK)));
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
add(BorderLayout.NORTH, createNorthPane()); add(BorderLayout.NORTH, createNorthPane());
add(BorderLayout.CENTER, createCenterPane()); add(BorderLayout.CENTER, createCenterPane());
if (isTimerPicker) { if (isTimerPicker) {
setPreferredSize(new Dimension(218, 209)); setPreferredSize(scale(new Dimension(218, 209)));
add(BorderLayout.SOUTH, createSouthPane()); add(BorderLayout.SOUTH, createSouthPane());
updateHMS(); 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_hover.png"),
BaseUtils.readIcon("/com/fr/design/images/calender/month_reduce_click.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); pNorth.add(monthMinus);
monthLabel = new UILabel("", UILabel.CENTER); monthLabel = new UILabel("", UILabel.CENTER);
monthLabel.setBackground(new Color(0xFFFFFF)); 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_hover.png"),
BaseUtils.readIcon("/com/fr/design/images/calender/month_add_click.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); monthPlus.setHorizontalAlignment(SwingConstants.RIGHT);
pNorth.add(monthPlus); pNorth.add(monthPlus);
pNorth.add(Box.createHorizontalStrut(11)); pNorth.add(Box.createHorizontalStrut(11));
@ -195,7 +200,7 @@ public class UICalendarPanel extends JPanel {
private JPanel createCenterPane() { private JPanel createCenterPane() {
//星期日 星期一 星期二 星期三 星期四 星期五 星期六 //星期日 星期一 星期二 星期三 星期四 星期五 星期六
JPanel pWeeks = new JPanel(new GridLayout(1, 7, 1, 0)); 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.setBackground(new Color(0xFFFFFF));
pWeeks.setOpaque(true); 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"), 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 = new DayPane();
days.setOpaque(true); days.setOpaque(true);
days.setPreferredSize(new Dimension(216, 115)); days.setPreferredSize(scale(new Dimension(216, 115)));
JPanel pCenter = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel pCenter = FRGUIPaneFactory.createBorderLayout_S_Pane();
pCenter.setOpaque(true); pCenter.setOpaque(true);
pCenter.add(pWeeks, BorderLayout.NORTH); 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); 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()); pToday.setLayout(new BorderLayout());
lbToday = new UIDayLabel(new Date(), false); lbToday = new UIDayLabel(new Date(), false);
lbToday.setForeground(new Color(0x000000)); lbToday.setForeground(new Color(0x000000));
@ -236,23 +241,23 @@ public class UICalendarPanel extends JPanel {
private JPanel createSouthPane() { private JPanel createSouthPane() {
JPanel sPane = new JPanel(); JPanel sPane = new JPanel();
sPane.setPreferredSize(new Dimension(216, 30)); sPane.setPreferredSize(scale(new Dimension(216, 30)));
sPane.setBackground(Color.WHITE); sPane.setBackground(Color.WHITE);
sPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 6)); sPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 6));
UILabel timeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Time") + ":"); 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); timeLabel.setFont(FONT_UI);
sPane.add(timeLabel); sPane.add(timeLabel);
hms = new HMSPane(); hms = new HMSPane();
sPane.add(hms); sPane.add(hms);
UILabel gap = new UILabel(); UILabel gap = new UILabel();
gap.setPreferredSize(new Dimension(26, 1)); gap.setPreferredSize(scale(new Dimension(26, 1)));
sPane.add(gap); sPane.add(gap);
UIButton okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")) { UIButton okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")) {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(32, 18); return scale(new Dimension(32, 18));
} }
public Insets getInsets() { public Insets getInsets() {
@ -722,7 +727,7 @@ public class UICalendarPanel extends JPanel {
private CalendarNumberField selectedNumberField; private CalendarNumberField selectedNumberField;
public HMSPane() { public HMSPane() {
this.setPreferredSize(new Dimension(101, 18)); this.setPreferredSize(scale(new Dimension(101, 18)));
this.setLayout(new BorderLayout(0, 0)); this.setLayout(new BorderLayout(0, 0));
this.setBackground(null); this.setBackground(null);
@ -775,7 +780,7 @@ public class UICalendarPanel extends JPanel {
}; };
nextButton.setRoundBorder(true, Constants.LEFT); nextButton.setRoundBorder(true, Constants.LEFT);
JPanel arrowPane = new JPanel(); JPanel arrowPane = new JPanel();
arrowPane.setPreferredSize(new Dimension(11, 18)); arrowPane.setPreferredSize(scale(new Dimension(11, 18)));
arrowPane.setLayout(new GridLayout(2, 1)); arrowPane.setLayout(new GridLayout(2, 1));
arrowPane.add(preButton); arrowPane.add(preButton);
arrowPane.add(nextButton); 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; 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.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxUI; import com.fr.design.gui.icombobox.UIComboBoxUI;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -105,7 +108,7 @@ public class UIDatePicker extends UIComboBox implements Serializable {
textField.setDocument(dateDocument); textField.setDocument(dateDocument);
//设置Model为单值Model //设置Model为单值Model
this.setModel(model); this.setModel(model);
updateUI(); setUI(getUIComboBoxUI());
} }
public UIDatePicker(int formatStyle, Date initialDatetime) throws UnsupportedOperationException { public UIDatePicker(int formatStyle, Date initialDatetime) throws UnsupportedOperationException {
@ -290,6 +293,20 @@ public class UIDatePicker extends UIComboBox implements Serializable {
@Override @Override
protected ComboBoxUI getUIComboBoxUI() { protected ComboBoxUI getUIComboBoxUI() {
return new UIComboBoxUI() { 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 @Override
protected ComboPopup createPopup() { protected ComboPopup createPopup() {
return new DatePopup(comboBox); return new DatePopup(comboBox);

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

@ -1,26 +1,27 @@
package com.fr.design.gui.frpane; package com.fr.design.gui.frpane;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension; 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.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.table.TableCellEditor; 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.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.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -32,12 +33,15 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.utils.gui.GUICoreUtils; 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 * @author jerry
*/ */
public class UICorrelationPane extends JPanel implements UIObserver { public class UICorrelationPane extends JPanel implements UIObserver {
private static int size = 20;
protected UIButton addButton; protected UIButton addButton;
protected UITable tablePane; protected UITable tablePane;
protected int columnCount; protected int columnCount;
@ -45,7 +49,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
private HeaderPane header; private HeaderPane header;
/** /**
* @param 标题栏的名字length代表列数 * @param names 标题栏的名字length代表列数
*/ */
public UICorrelationPane(String... names) { public UICorrelationPane(String... names) {
columnCount = names.length; columnCount = names.length;
@ -74,12 +78,13 @@ public class UICorrelationPane extends JPanel implements UIObserver {
addButton.setVisible(false); addButton.setVisible(false);
} }
protected boolean isDeletable(){ protected boolean isDeletable() {
return true; return true;
} }
/** /**
* 添加按钮 是否可用 * 添加按钮 是否可用
*
* @param use 是否可用 * @param use 是否可用
*/ */
public void checkBoxUse(boolean use) { public void checkBoxUse(boolean use) {
@ -116,7 +121,8 @@ public class UICorrelationPane extends JPanel implements UIObserver {
/** /**
*添加一行 * 添加一行
*
* @param line * @param line
*/ */
public void addLine(Object[] line) { public void addLine(Object[] line) {
@ -125,6 +131,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
/** /**
* 删除某行内容 * 删除某行内容
*
* @param rowIndex 行号 * @param rowIndex 行号
*/ */
public void removeLine(int rowIndex) { public void removeLine(int rowIndex) {
@ -145,16 +152,20 @@ public class UICorrelationPane extends JPanel implements UIObserver {
} }
protected void initLayout() { protected void initLayout() {
this.setLayout(new Layout()); this.setLayout(new BorderLayout(0, scale(4)));
this.add(addButton); Column tableContent = column(
if (header != null) { cell(header), cell(tablePane).with(it ->
this.add(header); it.setBorder(BorderFactory.createMatteBorder(0, 1, 0, 1,
} FlatUIUtils.getUIColor("defaultBorderColor", Color.BLACK)
this.add(tablePane); )))
).getComponent();
this.add(tableContent, BorderLayout.CENTER);
this.add(addButton, BorderLayout.SOUTH);
} }
protected void initComponents() { protected void initComponents() {
tablePane = initUITable(); tablePane = initUITable();
tablePane.setShowVerticalLines(false);
initAddButton(); initAddButton();
} }
@ -183,6 +194,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
/** /**
* 停止面板编辑 * 停止面板编辑
*
* @param e 事件 * @param e 事件
*/ */
public void stopPaneEditing(ChangeEvent e) { public void stopPaneEditing(ChangeEvent e) {
@ -191,6 +203,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
/** /**
* 创建table编辑器 * 创建table编辑器
*
* @return 编辑器 * @return 编辑器
*/ */
public UITableEditor createUITableEditor() { public UITableEditor createUITableEditor() {
@ -217,8 +230,6 @@ public class UICorrelationPane extends JPanel implements UIObserver {
return false; return false;
} }
}; };
addButton.setBorderType(UIButton.OTHER_BORDER);
addButton.setOtherBorder(UIConstants.BS, UIConstants.LINE_COLOR);
addButton.addActionListener(getAddButtonListener()); addButton.addActionListener(getAddButtonListener());
} }
@ -233,112 +244,42 @@ public class UICorrelationPane extends JPanel implements UIObserver {
} }
/** /**
* 给组件登记一个观察者监听事件 * 给组件登记一个观察者监听事件
* *
* @param listener 观察者监听事件 * @param listener 观察者监听事件
*/ */
public void registerChangeListener(UIObserverListener listener) { public void registerChangeListener(UIObserverListener listener) {
uiObserverListener = listener; uiObserverListener = listener;
} }
/** /**
* 组件是否需要响应添加的观察者事件 * 组件是否需要响应添加的观察者事件
* *
* @return 如果需要响应观察者事件则返回true否则返回false * @return 如果需要响应观察者事件则返回true否则返回false
*/ */
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return true; return true;
} }
public class Layout implements LayoutManager { private static class HeaderPane extends Row {
/**
* 增加组件
* @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 {
public HeaderPane(String[] names) { public HeaderPane(String[] names) {
UILabel[] labels = new UILabel[names.length]; UILabel[] labels = new UILabel[names.length];
this.setLayout(new GridLayout(0, names.length));
for (int i = 0; i < names.length; i++) { for (int i = 0; i < names.length; i++) {
labels[i] = new UILabel(names[i], UILabel.CENTER) { labels[i] = new UILabel(names[i], UILabel.LEFT);
@Override Layouts.populate(this, cell(labels[i]).weight(1));
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]);
} }
} setBorder(BorderFactory.createCompoundBorder(
new LineBorder(FlatUIUtils.getUIColor("defaultBorderColor", Color.BLACK)),
@Override new ScaledEmptyBorder(6, 6, 6, 6)
public Dimension getPreferredSize() { ));
return new Dimension(super.getPreferredSize().width - (isDeletable() ?size:0), size);
} }
} }
/** /**
* 增加监听 * 增加监听
*
* @param l 监听 * @param l 监听
*/ */
public void addChangeListener(ChangeListener l) { public void addChangeListener(ChangeListener l) {
@ -347,6 +288,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
/** /**
* 移除监听 * 移除监听
*
* @param l 监听 * @param l 监听
*/ */
public void removeChangeListener(ChangeListener l) { public void removeChangeListener(ChangeListener l) {
@ -368,7 +310,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Dimension dim = new Dimension(); Dimension dim = new Dimension();
dim.width = super.getPreferredSize().width; 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) { if (header != null) {
dim.height += header.getPreferredSize().height; dim.height += header.getPreferredSize().height;
} }
@ -382,6 +324,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
/** /**
* 主函数 * 主函数
*
* @param args 参数 * @param args 参数
*/ */
public static void main(String... 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 class TopToolPane extends JPanel {
private int model = UIConstants.MODEL_NORMAL; private int model = UIConstants.MODEL_NORMAL;
private int buttonSize = FineUIScale.scale(12);
public TopToolPane() { public TopToolPane() {
super(); super();
@ -328,7 +330,7 @@ public class UIEastResizableContainer extends JPanel {
} else { } else {
button = new LazyIcon("drag_right"); 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; 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.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import javax.swing.BorderFactory;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.event.CellEditorListener; import javax.swing.event.CellEditorListener;
@ -27,12 +26,14 @@ import java.awt.event.FocusEvent;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.List; import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale;
public class UITable extends JTable implements UIObserver { public class UITable extends JTable implements UIObserver {
private static final int OFF_LEFT = 10; private static final int OFF_LEFT = 10;
private static final int STEP = 2; 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; private UIObserverListener uiObserverListener;
UITableEditor editor; UITableEditor editor;
private boolean shouldResponseAwt; private boolean shouldResponseAwt;
@ -101,7 +102,7 @@ public class UITable extends JTable implements UIObserver {
if (event instanceof MouseEvent) { if (event instanceof MouseEvent) {
MouseEvent mv = (MouseEvent) event; MouseEvent mv = (MouseEvent) event;
if (mv.getClickCount() > 0) { 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 (!bounds.contains(point) && shouldResponseAwt) {
if (!isEditingStopped) { if (!isEditingStopped) {
@ -219,8 +220,6 @@ public class UITable extends JTable implements UIObserver {
} }
}); });
setBackground(UIConstants.NORMAL_BACKGROUND);
setDefaultEditor(UITable.class, editor); setDefaultEditor(UITable.class, editor);
setDefaultRenderer(UITable.class, new UITableRender()); setDefaultRenderer(UITable.class, new UITableRender());
setUI(getUI()); setUI(getUI());
@ -228,7 +227,7 @@ public class UITable extends JTable implements UIObserver {
TableColumn deleteTableColumn = new TableColumn(getTableDataModel().getColumnCount()); TableColumn deleteTableColumn = new TableColumn(getTableDataModel().getColumnCount());
deleteTableColumn.setCellEditor(null); deleteTableColumn.setCellEditor(null);
deleteTableColumn.setCellRenderer(null); deleteTableColumn.setCellRenderer(null);
deleteTableColumn.setMaxWidth(20); deleteTableColumn.setMaxWidth(scale(24));
getColumnModel().addColumn(deleteTableColumn); getColumnModel().addColumn(deleteTableColumn);
} }
@ -253,7 +252,7 @@ public class UITable extends JTable implements UIObserver {
} }
protected int getRowHeight4Table() { 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, Object value, boolean isSelected, boolean hasFocus, int row,
int column) { int column) {
JComponent comp = getRenderCompoment(value, row, 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; 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.Rectangle;
import java.awt.Stroke; import java.awt.Stroke;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import javax.swing.CellRendererPane; import javax.swing.CellRendererPane;
import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JTable; import javax.swing.JTable;
@ -17,7 +17,8 @@ import javax.swing.plaf.basic.BasicTableUI;
import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellEditor;
import javax.swing.table.TableModel; 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.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -25,8 +26,10 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.design.utils.gui.GUIPaintUtils;
import static com.fine.theme.utils.FineUIScale.scale;
public class UITableUI extends BasicTableUI { 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 boolean isReleased = true;
protected int rollOverRowIndex = -1; protected int rollOverRowIndex = -1;
protected int dragStartRowIndex = -1; protected int dragStartRowIndex = -1;
@ -35,7 +38,7 @@ public class UITableUI extends BasicTableUI {
private int startColumn; private int startColumn;
private int startRow; private int startRow;
private boolean draggingRow = false; private boolean draggingRow = false;
private static final int WIDTH_GAP = 20; private static final int WIDTH_GAP = 24;
private int startDragPoint; private int startDragPoint;
private int dyOffset; private int dyOffset;
@ -48,7 +51,7 @@ public class UITableUI extends BasicTableUI {
public UITableUI(JComponent table) { public UITableUI(JComponent table) {
super(); super();
this.table = (JTable) table; this.table = (JTable) table;
this.table.setRowHeight(20); this.table.setRowHeight(scale(WIDTH_GAP));
} }
@Override @Override
@ -95,13 +98,14 @@ public class UITableUI extends BasicTableUI {
if(!isDeletable()){ if(!isDeletable()){
return; 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) { private void paintRolloverBackground(Graphics2D g2d) {
if (rollOverRowIndex != -1) { if (rollOverRowIndex != -1) {
g2d.setColor(UIConstants.FLESH_BLUE); Color selectionColor = FlatUIUtils.getUIColor("List.selectionBackground", UIConstants.FLESH_BLUE);
GUIPaintUtils.fillPaint(g2d, 1, rollOverRowIndex * table.getRowHeight(), table.getWidth() - 2, table.getRowHeight(), true, Constants.NULL, UIConstants.FLESH_BLUE, UIConstants.LARGEARC); 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 @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
super.mousePressed(e); super.mousePressed(e);
if (e.getX() >= table.getWidth() - WIDTH_GAP) { if (e.getX() >= table.getWidth() - scale(WIDTH_GAP)) {
if (table.isEditing()) { if (table.isEditing()) {
table.getCellEditor(startRow, startColumn).stopCellEditing(); 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 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.FileNode;
import com.fr.file.filetree.IOFileNodeFilter; import com.fr.file.filetree.IOFileNodeFilter;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
@ -12,6 +14,8 @@ import com.fr.stable.project.ProjectConstants;
public class ClassFileTree extends EnvFileTree { public class ClassFileTree extends EnvFileTree {
public ClassFileTree() { public ClassFileTree() {
super(ProjectConstants.CLASSES_NAME, null, new IOFileNodeFilter(new String[]{"class"})); 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; package com.fr.design.gui.syntax.ui.rtextarea;
import com.fine.theme.utils.FineUIScale;
import java.awt.AWTEvent; import java.awt.AWTEvent;
import java.awt.Color; import java.awt.Color;
import java.awt.Font; import java.awt.Font;
@ -31,6 +33,9 @@ import javax.swing.text.BadLocationException;
import javax.swing.text.Caret; import javax.swing.text.Caret;
import javax.swing.text.StyleContext; 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 * 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()) { if (isOSX()) {
// Snow Leopard (1.6) uses Menlo as default monospaced font, // Snow Leopard (1.6) uses Menlo as default monospaced font,
// pre-Snow Leopard used Monaco. // 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())) { 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 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 { else {
// Consolas added in Vista, used by VS2010+. // 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())) { 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; package com.fr.design.javascript;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
@ -80,9 +81,8 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane<JavaScript> {
} }
protected void initLayout() { protected void initLayout() {
this.setLayout(new BorderLayout(0, 6)); this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
JPanel northPane = new JPanel(new BorderLayout()); JPanel northPane = new JPanel(new BorderLayout());
northPane.setBorder(BorderFactory.createEmptyBorder(3, 10, 0, 10));
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
northPane.add(jcb, BorderLayout.CENTER); northPane.add(jcb, BorderLayout.CENTER);
this.add(cardPane, 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.Color;
import java.awt.Font; import java.awt.Font;
import static com.fine.theme.utils.FineUIConstants.SCALE_FONT_SIZE_12;
/** /**
* @author Starryi * @author Starryi
* @version 1.0 * @version 1.0
@ -20,7 +22,7 @@ public class LabelUtils {
} }
public static UILabel createLabel(String title, Color color) { 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) { public static UILabel createLabel(String title, Color color, int size) {
UILabel uiLabel = new UILabel(title); UILabel uiLabel = new UILabel(title);
@ -34,7 +36,7 @@ public class LabelUtils {
JTextArea tipLabel = new JTextArea(); JTextArea tipLabel = new JTextArea();
tipLabel.setUI(new BasicTextAreaUI()); tipLabel.setUI(new BasicTextAreaUI());
tipLabel.setForeground(color); 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.setFont(newFont);
tipLabel.setBorder(BorderFactory.createEmptyBorder()); tipLabel.setBorder(BorderFactory.createEmptyBorder());
tipLabel.setEditable(false); 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; 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.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.TemplateTreePane; import com.fr.design.file.TemplateTreePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.lock.LockInfoUtils;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.vcs.VcsOperatorWorker; 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.FileNodeFILE;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.report.entity.VcsEntity; 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.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.server.vcs.VcsOperator; import com.fr.workspace.server.vcs.VcsOperator;
@ -50,9 +46,9 @@ public class VcsCenterPane extends VcsNewPane {
private UILabel open; private UILabel open;
private UILabel delete; private UILabel delete;
private static final Icon MANAGER_ICON = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_center_manager"); private static final Icon MANAGER_ICON = new LazyIcon("vcs_list");
private static final Icon DELETE_ICON = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_operator_delete"); private static final Icon DELETE_ICON = new LazyIcon("remove");
private static final Icon OPEN_ICON = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_center_open"); private static final Icon OPEN_ICON = new LazyIcon("openTemplate");
private static final Class[] CLASSES = new Class[]{ private static final Class[] CLASSES = new Class[]{
Boolean.class, Boolean.class,
UILabel.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() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
tinyFormulaPane = new TinyFormulaPane(); tinyFormulaPane = new TinyFormulaPane();
this.add(tinyFormulaPane, BorderLayout.CENTER); this.add(tinyFormulaPane, BorderLayout.NORTH);
} }
@Override @Override

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

@ -1,11 +1,15 @@
package com.fr.file; 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.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
@ -78,7 +82,6 @@ import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import javax.swing.filechooser.FileSystemView; import javax.swing.filechooser.FileSystemView;
import javax.swing.plaf.basic.BasicArrowButton; import javax.swing.plaf.basic.BasicArrowButton;
import javax.swing.plaf.basic.BasicButtonUI;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
@ -105,6 +108,10 @@ import java.util.Set;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; 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.DEFAULT_OPTION;
import static javax.swing.JOptionPane.WARNING_MESSAGE; import static javax.swing.JOptionPane.WARNING_MESSAGE;
@ -304,12 +311,10 @@ public class FILEChooserPane extends BasicPane {
locationPane.add(mkdirButton, BorderLayout.EAST); locationPane.add(mkdirButton, BorderLayout.EAST);
JPanel centerLeftPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel centerLeftPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
// centerLeftPanel.setLayout(FRGUIPaneFactory.createBorderLayout());
// Richie:placesList includes C,D,E,F and DeskTop etc. // Richie:placesList includes C,D,E,F and DeskTop etc.
placesList = new JList(); placesList = new JList();
FineUIStyle.setStyle(placesList, FineUIStyle.PURE_LIST);
centerLeftPanel.add(placesList, BorderLayout.CENTER); centerLeftPanel.add(placesList, BorderLayout.CENTER);
centerLeftPanel.setBorder(BorderFactory.createLineBorder(Color.GRAY));
centerLeftPanel.setPreferredSize(new Dimension(120, 1));
placesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); placesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
placesList.setCellRenderer(new DefaultListCellRenderer() { 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(); JPanel subFilePanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
// 以后rightPanel要用JTable // 以后rightPanel要用JTable
subFileList = new JList(new DefaultListModel<>()); subFileList = new JList(new DefaultListModel<>());
FineUIStyle.setStyle(subFileList, FineUIStyle.PURE_LIST);
/* /*
* JList的CellRenderer * JList的CellRenderer
*/ */
@ -456,27 +459,45 @@ public class FILEChooserPane extends BasicPane {
}); });
scrollPane = new JScrollPane(subFileList); scrollPane = new JScrollPane(subFileList);
subFilePanel.add(scrollPane, BorderLayout.CENTER); subFilePanel.add(scrollPane, BorderLayout.CENTER);
centerRightPane.add(subFilePanel, BorderLayout.CENTER); subFilePanel.setBorder(FineBorderFactory.createWrappedRoundBorder());
// 用createTableLayoutPane布局下fileNamePane // 用createTableLayoutPane布局下fileNamePane
UIButton cancelButton; fileNameTextField = new UIAutoCompletionField();
Component[][] coms = new Component[][]{ postfixComboBox = new UIComboBox();
new Component[]{GUICoreUtils.createBorderPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Utils_File_Name") + ":"), BorderLayout.WEST), okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Utils_Design_File_Open"));
fileNameTextField = new UIAutoCompletionField(), 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"));
},
new Component[]{GUICoreUtils.createBorderPane(new UILabel(Toolkit.i18nText("Fine-Design_Report_Utils_File_Type") + ":"), BorderLayout.WEST), JPanel fileNamePane = column(10,
postfixComboBox = new UIComboBox(), cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Utils_Design_Action_Cancel")) row(
}}; cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Utils_File_Name"))).weight(1),
cell(fileNameTextField).weight(5)
JPanel fileNamePane = TableLayoutHelper.createGapTableLayoutPane(coms, new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, ),
TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.FILL, TableLayout.PREFERRED}, 24, 4); row(
centerRightPane.add(fileNamePane, BorderLayout.SOUTH); cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Utils_File_Type"))).weight(1),
cell(postfixComboBox).weight(5)
Component[][] outComponents = new Component[][]{ )
new Component[]{GUICoreUtils.createBorderPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_App_File_Lookup_range") + ":"), BorderLayout.WEST), locationPane}, ).getComponent();
new Component[]{centerLeftPanel, centerRightPane}}; JPanel centerRightPane = column(10,
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(outComponents, new double[]{TableLayout.PREFERRED, TableLayout.FILL}, cell(subFilePanel).weight(1),
new double[]{TableLayout.PREFERRED, TableLayout.FILL}); 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); this.add(contentPane, BorderLayout.CENTER);
okButton.addActionListener(new ActionListener() { okButton.addActionListener(new ActionListener() {
@Override @Override
@ -1262,7 +1283,7 @@ public class FILEChooserPane extends BasicPane {
@Override @Override
public Icon getIcon() { 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 @Override
public Icon getIcon() { public Icon getIcon() {
if (ComparatorUtils.equals(getTotalName(), ProjectConstants.REPORTLETS_NAME)) { if (ComparatorUtils.equals(getTotalName(), ProjectConstants.REPORTLETS_NAME)) {
return BaseUtils.readIcon("/com/fr/base/images/oem/logo.png"); return new LazyIcon("logo");
} else { } else {
return FileTreeIcon.getIcon(new File(this.getPath()), false); return FileTreeIcon.getIcon(new File(this.getPath()), false);
} }
@ -1479,7 +1500,7 @@ public class FILEChooserPane extends BasicPane {
dirPath = dirPath + SEPARATOR_STRING; dirPath = dirPath + SEPARATOR_STRING;
} }
if (ComparatorUtils.equals(actionPath, dirPath)) { 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) { private UIButton createBlankButton(SetDirectoryAction setDirectoryAction) {
final Color brighter = this.getBackground().brighter();
final Color darker = this.getBackground().darker();
final UIButton blankButton = new UIButton(setDirectoryAction); final UIButton blankButton = new UIButton(setDirectoryAction);
blankButton.setMargin(new Insets(0, 0, 0, 0)); blankButton.setMargin(new Insets(0, 0, 0, 0));
blankButton.setUI(new BasicButtonUI());
blankButton.setHorizontalTextPosition(SwingConstants.CENTER); blankButton.setHorizontalTextPosition(SwingConstants.CENTER);
blankButton.setBorderPainted(false); blankButton.setBorderPainted(false);
blankButton.setBorder(BorderFactory.createRaisedBevelBorder()); blankButton.setBorder(BorderFactory.createRaisedBevelBorder());
blankButton.setBackground(darker); blankButton.setBackground(null);
blankButton.addMouseListener(new MouseAdapter() { blankButton.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
blankButton.setBackground(brighter);
blankButton.setBorderPainted(true);
blankButton.repaint(); blankButton.repaint();
} }
@Override @Override
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
blankButton.setBackground(darker);
blankButton.setBorderPainted(false);
blankButton.repaint(); blankButton.repaint();
} }
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
blankButton.setBackground(brighter);
blankButton.setBorderPainted(false);
blankButton.repaint(); blankButton.repaint();
} }
@Override @Override
public void mouseReleased(MouseEvent e) { public void mouseReleased(MouseEvent e) {
blankButton.setBackground(darker);
blankButton.setBorderPainted(true);
blankButton.repaint(); blankButton.repaint();
} }
@ -1730,7 +1739,7 @@ public class FILEChooserPane extends BasicPane {
*/ */
private UIButton initMkdirButton() { private UIButton initMkdirButton() {
UIButton folderButton = new UIButton(); 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.setUI(new UIButtonUI());
folderButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Utils_New_Folder")); folderButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Utils_New_Folder"));
folderButton.addActionListener(new ActionListener() { 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) { if (file == null) {
return FileTreeIcon.BLANK_IMAGE_ICON; return FileTreeIcon.BLANK_IMAGE_ICON;
} }
FileSystemView view = FileSystemView.getFileSystemView();
try { try {
return view.getSystemIcon(file); return FileTreeIcon.getIcon(file);
} catch (Exception e) { } catch (Exception e) {
/* /*
* alex:在显示Mac里面某个目录的时候,居然会抛 * alex:在显示Mac里面某个目录的时候,居然会抛

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

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

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 MenuItemUI=com.fine.theme.light.ui.FineMenuItemUI
TemplateListMenuItemUI=com.fine.theme.light.ui.FineTemplateListMenuItemUI TemplateListMenuItemUI=com.fine.theme.light.ui.FineTemplateListMenuItemUI
OptionPaneUI=com.formdev.flatlaf.ui.FlatOptionPaneUI 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 PasswordFieldUI=com.formdev.flatlaf.ui.FlatPasswordFieldUI
PopupMenuUI=com.fine.theme.light.ui.FinePopupMenuUI PopupMenuUI=com.fine.theme.light.ui.FinePopupMenuUI
PopupMenuSeparatorUI=com.fine.theme.light.ui.FinePopupMenuSeparatorUI PopupMenuSeparatorUI=com.fine.theme.light.ui.FinePopupMenuSeparatorUI

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

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

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

@ -1,5 +1,6 @@
package com.fr.design.chart; package com.fr.design.chart;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.base.chart.BaseChartPainter; import com.fr.base.chart.BaseChartPainter;
import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.chartdata.CallbackEvent;
@ -13,18 +14,18 @@ import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import javax.swing.Icon; import javax.swing.Icon;
import java.awt.AlphaComposite;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Paint;
/** /**
* 图表的缩略图Icon, 在选择图表类型界面 用到. * 图表的缩略图Icon, 在选择图表类型界面 用到.
*/ */
public class ChartIcon implements Icon, XMLable { public class ChartIcon implements Icon, XMLable {
private static final int WIDTH = 400; private static final int WIDTH = FineUIScale.scale(215);
private static final int HEIGHT = 225; private static final int HEIGHT = FineUIScale.scale(100);
private ChartCollection chartCollection; private ChartCollection chartCollection;
@ -78,26 +79,23 @@ public class ChartIcon implements Icon, XMLable {
public void paintIcon(Component c, Graphics g, int x, int y) { public void paintIcon(Component c, Graphics g, int x, int y) {
BaseChartPainter chartPainter = getChartPainter(); BaseChartPainter chartPainter = getChartPainter();
Graphics2D g2d = (Graphics2D) g.create();
//插入图表的宽度是固定的,resolution直接获取屏幕分辨率,resolution现在只会影响到老图表 g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0f));
int resolution = ScreenResolution.getScreenResolution();
Graphics2D g2d = (Graphics2D) g; g2d.setColor(new Color(0, 0, 0, 0));
Paint oldPaint = g2d.getPaint();
g.translate(x, y);
g2d.setPaint(Color.white);
g2d.fillRect(0, 0, getIconWidth(), getIconHeight()); 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); chartPainter.paint(g2d, getIconWidth(), getIconHeight(), ScreenResolution.getScreenResolution(), null, callbackEvent);
g2d.setPaint(oldPaint);
g2d.dispose();
} }
protected BaseChartPainter getChartPainter() { protected BaseChartPainter getChartPainter() {
BaseChartPainter painter = chartCollection.createResultChartPainterWithOutDealFormula(Calculator.createCalculator(), return chartCollection.createResultChartPainterWithOutDealFormula(Calculator.createCalculator(),
WebChartIDInfo.createEmptyDesignerInfo(), getIconWidth(), getIconHeight()); 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.swing.ui.layout.Column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.chart.chartattr.ChartCollection; 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.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.base.mode.DesignModeContext; 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.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.van.chart.config.DefaultStyleHelper4Van; import com.fr.van.chart.config.DefaultStyleHelper4Van;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
import javax.swing.JLayer;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.ListCellRenderer; import javax.swing.ListCellRenderer;
import javax.swing.SwingConstants;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import java.awt.Color; import java.awt.Color;
@ -35,6 +40,10 @@ import java.awt.Component;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; 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 { public class ChartTypePane extends ChartCommonWizardPane implements CallbackEvent {
private static final long serialVersionUID = -1175602484968520546L; 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); defaultListModel.insertElementAt(ChartTypeInterfaceManager.getInstance().getName(chartIDs[i]), i);
} }
mainTypeList.addListSelectionListener(listSelectionListener); mainTypeList.addListSelectionListener(listSelectionListener);
FineUIStyle.setStyle(mainTypeList, FineUIStyle.PURE_LIST);
JScrollPane typeScrollPane = new JScrollPane(mainTypeList); JLayer<UIScrollPane> typeScrollPane = FineUIUtils.createCollapsibleScrollBarLayer(mainTypeList);
typeScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
iconViewList = new JList(); iconViewList = new JList();
@ -71,15 +80,16 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
iconViewList.setVisibleRowCount(0); iconViewList.setVisibleRowCount(0);
iconViewList.setLayoutOrientation(JList.HORIZONTAL_WRAP); iconViewList.setLayoutOrientation(JList.HORIZONTAL_WRAP);
iconViewList.setCellRenderer(iconCellRenderer); iconViewList.setCellRenderer(iconCellRenderer);
iconViewList.setLayoutOrientation(JList.HORIZONTAL_WRAP);
JScrollPane subListPane = new JScrollPane(iconViewList); JScrollPane subListPane = new JScrollPane(iconViewList);
//iconPane.add //iconPane.add
mainTypeList.setSelectedIndex(0); mainTypeList.setSelectedIndex(0);
JSplitPane spane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, typeScrollPane, subListPane); JPanel leftPanel = FineLayoutBuilder.asBorderLayoutWrapped(typeScrollPane);
spane.setDividerLocation(150); 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)); center.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
this.add(center); this.add(center);
@ -90,17 +100,23 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
private static final long serialVersionUID = 956888843609479566L; private static final long serialVersionUID = 956888843609479566L;
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
this.setText("");
if (value instanceof ChartIcon) { if (value instanceof ChartIcon) {
this.setIcon((ChartIcon) value);
setHorizontalAlignment(UILabel.CENTER);
ChartIcon chartIcon = (ChartIcon) value; ChartIcon chartIcon = (ChartIcon) value;
if (isSelected) { UILabel centerImg = new UILabel(chartIcon);
// 深蓝色. UILabel text = new UILabel(getChartName(chartIcon), SwingConstants.CENTER);
this.setBackground(FlatUIUtils.getUIColor("Tree.selectionBackground", new Color(57, 107, 181)));
} Column component = column(
this.setBorder(GUICoreUtils.createTitledBorder(getChartName(chartIcon))); 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; 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; 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.BaseFormula;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
@ -170,6 +172,10 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane<ChartC
TinyFormulaPane editor = getEditorComponent(); TinyFormulaPane editor = getEditorComponent();
editor.getUITextField().setText(Utils.objectToString(value)); 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; return editor;
} }

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; 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.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.BubblePlot; import com.fr.chart.chartattr.BubblePlot;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.BubbleTableDefinition; 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.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; 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.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; 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.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.util.List; import java.util.List;
public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataContentPane { public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataContentPane {
private static final Dimension PREFERRED_SIZE = new Dimension(100, 20);
protected UIComboBox seriesName; protected UIComboBox seriesName;
protected UIComboBox xCombox; protected UIComboBox xCombox;
protected UIComboBox yCombox; protected UIComboBox yCombox;
@ -40,21 +40,11 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon
yCombox = new UIComboBox(); yCombox = new UIComboBox();
dataScreeningPane = new ChartDataFilterPane(new BubblePlot(), parent); 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")); seriesName.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
initBubbleSize(); 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[][]{ 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(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name")), seriesName},
new Component[]{new UILabel("x" ), xCombox}, 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}, 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); JPanel north = FineLayoutBuilder.compatibleTableLayout(10, components_north, new double[]{1.2, 3});
north.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15)); north.setBorder(BorderFactory.createCompoundBorder(
JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),dataScreeningPane); FineBorderFactory.createDefaultUnderlineBorder(), new ScaledEmptyBorder(0, 0, 10, 0)
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); ));
filterPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); JPanel filterPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),dataScreeningPane);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(getJSeparator(), BorderLayout.NORTH);
this.add(north, BorderLayout.CENTER); this.add(north, BorderLayout.CENTER);
this.add(filterPane, BorderLayout.SOUTH); this.add(filterPane, BorderLayout.SOUTH);
@ -82,7 +71,6 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon
protected void initBubbleSize() { protected void initBubbleSize() {
bubbleSize = new UIComboBox(); 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}); JPanel gapDetailPane = FineLayoutBuilder.compatibleTableLayout(10, gapComponents, new double[]{1.2, 3});
labelGapValuePane = FineLayoutBuilder.asBorderLayoutWrapped(labelGapValue); 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(gapDetailPane, BorderLayout.CENTER);
panel.add(labelGapValuePane, BorderLayout.SOUTH); 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; package com.fr.van.chart.map.designer;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -38,8 +39,8 @@ public abstract class VanChartGroupPane extends JPanel{
tabChanged(buttonGroup.getSelectedIndex()); tabChanged(buttonGroup.getSelectedIndex());
} }
}); });
buttonGroup.setBorder(getButtonGroupBorder()); this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
this.setLayout(new BorderLayout(0, 4)); this.setLayout(new BorderLayout());
this.add(buttonGroup, BorderLayout.NORTH); this.add(buttonGroup, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); 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; package com.fr.van.chart.map.designer.type;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
@ -43,7 +42,6 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
new Component[]{mapStatusPaneWithTitle} new Component[]{mapStatusPaneWithTitle}
}; };
JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(0, comps, new double[]{1}); JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(0, comps, new double[]{1});
this.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
this.add(contentPane, BorderLayout.CENTER); 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; package com.fr.van.chart.scatter.data;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartdata.BubbleTableDefinition; import com.fr.chart.chartdata.BubbleTableDefinition;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
@ -18,7 +19,7 @@ public class VanChartScatterPlotTableDataContentPane extends VanChartBubblePlotT
@Override @Override
protected void initBubbleSize() { protected void initBubbleSize() {
bubbleSize = new UIComboBox(); 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")); 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; 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.base.Parameter;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.Component; import java.awt.*;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.LayoutManager;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.util.ArrayList; 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[]> { public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
private Parameter[] parameterList; private Parameter[] parameterList;
private ArrayList<UIButton> parameterSelectedLabellist = new ArrayList<UIButton>(); private final ArrayList<UIButton> parameterSelectedLabelList = new ArrayList<>();
private MouseListener paraMouseListner; private MouseListener paraMouseListener;
private UIButton addAll; private final UIButton addAll;
private UILabel label; private final 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;
public ParameterToolBarPane() { public ParameterToolBarPane() {
this.setLayout(new FlowParameterPaneLayout()); this.setLayout(new BorderLayout());
label = new UILabel() {
private static final long serialVersionUID = 1L;
@Override label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Following_parameters_are_not_generated") + ":");
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.setHorizontalAlignment(SwingConstants.LEFT); 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")); 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() { public boolean hasSelectedLabelItem() {
return !parameterSelectedLabellist.isEmpty(); return !parameterSelectedLabelList.isEmpty();
} }
@Override @Override
@ -67,7 +64,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
} }
public Parameter getTargetParameter(UIButton button) { public Parameter getTargetParameter(UIButton button) {
int index = parameterSelectedLabellist.indexOf(button); int index = parameterSelectedLabelList.indexOf(button);
if (index < 0 || index > parameterList.length - 1) { if (index < 0 || index > parameterList.length - 1) {
return null; return null;
} }
@ -76,11 +73,9 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
@Override @Override
public void populateBean(Parameter[] parameterArray) { public void populateBean(Parameter[] parameterArray) {
parameterSelectedLabellist.clear(); parameterSelectedLabelList.clear();
this.removeAll(); this.removeAll();
this.add(label);
if (parameterArray.length == 0) { if (parameterArray.length == 0) {
this.setVisible(false); this.setVisible(false);
this.repaint(); this.repaint();
@ -90,18 +85,17 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
} }
parameterList = parameterArray; parameterList = parameterArray;
for (int i = 0; i < parameterList.length; i++) { for (Parameter parameter : parameterList) {
UIButton parameterSelectedLabel = new UIButton(parameterList[i].getName()); UIButton parameterSelectedLabel = new UIButton(parameter.getName());
parameterSelectedLabellist.add(parameterSelectedLabel); parameterSelectedLabelList.add(parameterSelectedLabel);
this.add(parameterSelectedLabel); FineUIStyle.setStyle(parameterSelectedLabel, FineUIStyle.PASTEL_BUTTON);
} }
for(UIButton parameterSelectedLabel : parameterSelectedLabellist) { for(UIButton parameterSelectedLabel : parameterSelectedLabelList) {
parameterSelectedLabel.addMouseListener(paraMouseListner); parameterSelectedLabel.addMouseListener(paraMouseListener);
} }
this.add(addAll); initLayout();
this.doLayout();
this.repaint(); this.repaint();
} }
@ -111,63 +105,11 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
} }
public void setParaMouseListener(MouseListener l) { public void setParaMouseListener(MouseListener l) {
this.paraMouseListner = l; this.paraMouseListener = l;
} }
public void addActionListener(ActionListener l) { public void addActionListener(ActionListener l) {
addAll.addActionListener(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 com.fr.transaction.WorkerFacade;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
public class WidgetManagerAction extends UpdateAction { public class WidgetManagerAction extends UpdateAction {
public static final Dimension WINDOW_CUSTOM_SIZE = new Dimension(720, 600);
public WidgetManagerAction() { public WidgetManagerAction() {
this.setMenuKeySet(WIDGET_MANAGER); this.setMenuKeySet(WIDGET_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setName(getMenuKeySet().getMenuKeySetName() + "...");
@ -70,7 +68,7 @@ public class WidgetManagerAction extends UpdateAction {
} }
})); }));
} }
}, WINDOW_CUSTOM_SIZE); }, BasicDialog.LARGE);
widgetConfigDialog.addWindowListener(new WindowAdapter() { widgetConfigDialog.addWindowListener(new WindowAdapter() {
@Override @Override
public void windowClosed(WindowEvent e) { 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 com.fr.report.cell.cellattr.core.group.SelectCount;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
@ -61,7 +62,8 @@ public class DSColumnAdvancedPane extends BasicPane {
private void initScrollPane() { private void initScrollPane() {
this.setLayout(new BorderLayout()); 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); this.add(scrollPane);
} }

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; package com.fr.design.mainframe.cell.settingpane.desensitization;
import com.fine.swing.ui.layout.Layouts; 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.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -92,7 +92,7 @@ public class CellDesensitizationGroupsPane extends JPanel {
this.add(pane, BorderLayout.CENTER); this.add(pane, BorderLayout.CENTER);
} }
}; };
tableEditorPane.setBorder(new FineRoundBorder()); tableEditorPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
return tableEditorPane; 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; 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.UITableEditAction;
import com.fr.design.gui.itableeditorpane.UITableModelAdapter; import com.fr.design.gui.itableeditorpane.UITableModelAdapter;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
@ -18,7 +19,7 @@ import java.awt.event.ActionEvent;
* Created by Leo.Qin on 2023/1/4 * Created by Leo.Qin on 2023/1/4
*/ */
public class CellDesensitizationTableModel extends UITableModelAdapter<CellDesensitizationBean> { 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 com.fr.report.cell.desensitization.CellDesensitizationBean;
import javax.swing.AbstractCellEditor; import javax.swing.AbstractCellEditor;
import javax.swing.JPanel;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import javax.swing.border.LineBorder;
import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellEditor;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.util.Map; import java.util.Map;
@ -33,10 +30,7 @@ public class DesensitizationCellEditor extends AbstractCellEditor implements Tab
editPane.populate((CellDesensitizationBean) value, row); editPane.populate((CellDesensitizationBean) value, row);
JPanel editPanel = editPane.getEditPanel(); return editPane.getEditPanel();
editPanel.setBorder(new LineBorder(Color.LIGHT_GRAY));
return editPanel;
} }

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; 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.DesensitizationRuleManager;
import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRule;
import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; import com.fr.data.desensitize.rule.base.DesensitizationRuleSource;
import com.fr.data.desensitize.rule.base.DesensitizationRuleStatus; import com.fr.data.desensitize.rule.base.DesensitizationRuleStatus;
import com.fr.design.beans.BasicBeanPane; 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.data.datapane.preview.desensitization.view.rule.DesensitizationRulePane;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombocheckbox.UIComboCheckBox; import com.fr.design.gui.icombocheckbox.UIComboCheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; 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.report.cell.desensitization.CellDesensitizationBean;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.org.apache.commons.collections4.map.HashedMap; 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.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
@ -43,7 +38,12 @@ import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import java.util.Set; 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() { private void initComponent() {
editPanel = new JPanel();
editPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true));
label = new UILabel(); label = new UILabel();
label.setEnabled(false); label.setEnabled(false);
editPanel.add(label);
ruleButton = new UIButton(APOSTROPHE); ruleButton = new UIButton(APOSTROPHE);
setStyle(ruleButton, PLAIN_BUTTON);
ruleTextField = new UITextField(); ruleTextField = new UITextField();
ruleTextField.setEnabled(true); ruleTextField.setEnabled(true);
ruleTextField.setEditable(false); ruleTextField.setEditable(false);
ruleTextField.setPlaceholder(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Place_Holder")); ruleTextField.setPlaceholder(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Place_Holder"));
setStyle(ruleTextField, TRANSPARENT_TEXT_FIELD);
roleMap = new HashedMap<>(); roleMap = new HashedMap<>();
rolesComboBox = new RuleUIComboCheckBox(); rolesComboBox = new RuleUIComboCheckBox();
@ -100,9 +99,26 @@ public class DesensitizationCellPane extends BasicBeanPane {
emptyTextField = new UITextField(); emptyTextField = new UITextField();
emptyTextField.setEnabled(false); 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 * 初始化单元格中的panel
*/ */
private JPanel initTableCellPanel() { 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[][]{ Component[][] components = new Component[][]{
new Component[]{ruleButton, ruleTextField}, new Component[]{ruleButton, ruleTextField},
new Component[]{emptyTextField, rolesComboBox} new Component[]{emptyTextField, rolesComboBox}
}; };
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 0); return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1, 4});
} }
private void addListener() { private void addListener() {
@ -280,8 +290,12 @@ public class DesensitizationCellPane extends BasicBeanPane {
protected void setLayoutAndAddComponents() { protected void setLayoutAndAddComponents() {
// 使用BorderLayout,否则默认使用的FlowLayout会让整个下拉选框使用最小Size,然后TableCell这边会出现空白 // 使用BorderLayout,否则默认使用的FlowLayout会让整个下拉选框使用最小Size,然后TableCell这边会出现空白
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(getEditor(), BorderLayout.CENTER); UITextField editor = getEditor();
this.add(getArrowButton(), BorderLayout.EAST); UIButton arrowButton = getArrowButton();
setStyle(editor, TRANSPARENT_TEXT_FIELD);
setStyle(arrowButton, PLAIN_BUTTON);
this.add(editor, BorderLayout.CENTER);
this.add(arrowButton, BorderLayout.EAST);
} }
@Override @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; package com.fr.design.mainframe.cell.settingpane.desensitization.model;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.report.cell.desensitization.CellDesensitizationBean; import com.fr.report.cell.desensitization.CellDesensitizationBean;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.border.LineBorder; import javax.swing.border.LineBorder;
import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableCellRenderer;
@ -41,8 +43,9 @@ public class DesensitizationCellRender extends DefaultTableCellRenderer {
} else { } else {
editPane.getEditPanel().setBorder(BorderFactory.createEmptyBorder()); editPane.getEditPanel().setBorder(BorderFactory.createEmptyBorder());
} }
JPanel editPanel = editPane.getEditPanel();
return 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.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
@ -40,7 +41,7 @@ public class SortUIExpandablePane extends JPanel {
this.sortGroupPane = sortGroupPane; this.sortGroupPane = sortGroupPane;
this.contentPane = contentPane; this.contentPane = contentPane;
initComponents(); initComponents();
wrapPane.setBorder(new FineRoundBorder()); wrapPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
wrapPane.setBackground(Color.WHITE); wrapPane.setBackground(Color.WHITE);
} }

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)); FineLoggerFactory.getLogger().info("Designer started.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS));
SwitchForSwingChecker.initThreadMonitoring(); SwitchForSwingChecker.initThreadMonitoring();
new UiInspector(); // new UiInspector();
// EdtInvocationManager.installEDTCheckers(); // EdtInvocationManager.installEDTCheckers();
} }

Loading…
Cancel
Save