Browse Source

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

newui
lemon 9 months ago
parent
commit
176bc51aac
  1. 27
      designer-base/src/main/java/com/fine/theme/light/ui/RectangleButtonUI.java
  2. 8
      designer-base/src/main/java/com/fine/theme/light/ui/laf/FineLaf.java
  3. 21
      designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java
  4. 16
      designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java
  5. 10
      designer-base/src/main/java/com/fine/theme/utils/FineUIConstants.java
  6. 2
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  7. 17
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  8. 68
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
  9. 42
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java
  10. 22
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java
  11. 8
      designer-base/src/main/java/com/fr/design/dialog/AbstractTemplateServerSettingPane.java
  12. 11
      designer-base/src/main/java/com/fr/design/file/TemplateListMenuItem.java
  13. 1
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  14. 3
      designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java
  15. 2
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java
  16. 3
      designer-base/src/main/java/com/fr/design/gui/controlpane/UINameableListCellRenderer.java
  17. 10
      designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java
  18. 29
      designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java
  19. 3
      designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java
  20. 6
      designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java
  21. 4
      designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java
  22. 7
      designer-base/src/main/java/com/fr/design/gui/imenu/UIScrollPopUpMenu.java
  23. 13
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextArea.java
  24. 3
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  25. 15
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java
  26. 13
      designer-base/src/main/java/com/fr/design/report/WatermarkPane.java
  27. 12
      designer-base/src/main/java/com/fr/design/report/fit/FormFitConfigPane.java
  28. 50
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java
  29. 64
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  30. 14
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  31. 5
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java
  32. 3
      designer-chart/src/main/java/com/fr/design/gui/xcombox/MarkerComboBox.java
  33. 95
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java
  34. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  35. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java
  36. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java
  37. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  38. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java
  39. 2
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java
  40. 2
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java
  41. 26
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java
  42. 13
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java
  43. 3
      designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java
  44. 14
      designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java
  45. 18
      designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java
  46. 7
      designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java
  47. 7
      designer-realize/src/main/java/com/fr/design/report/mobile/MobileRadioGroupPane.java
  48. 7
      designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java
  49. 25
      designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileTemplateSettingsPane.java
  50. 11
      designer-realize/src/main/java/com/fr/design/webattr/ViewWebSettingPane.java
  51. 5
      designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java
  52. 20
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java
  53. 12
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/PageMarginSettingPane.java
  54. 3
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java
  55. 2
      designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java
  56. 5
      designer-realize/src/main/java/com/fr/grid/GridCorner.java
  57. 22
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellImageQuickEditor.java
  58. 14
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java

27
designer-base/src/main/java/com/fine/theme/light/ui/RectangleButtonUI.java

@ -1,10 +1,14 @@
package com.fine.theme.light.ui; package com.fine.theme.light.ui;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatButtonUI; import com.formdev.flatlaf.ui.FlatButtonUI;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import javax.swing.AbstractButton;
import javax.swing.JComponent; import javax.swing.JComponent;
import java.awt.*; import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
/** /**
* 矩形按钮UI忽略圆角属性 * 矩形按钮UI忽略圆角属性
@ -20,6 +24,13 @@ public class RectangleButtonUI extends FlatButtonUI {
super(shared); super(shared);
} }
@Override
protected void installDefaults(AbstractButton b) {
super.installDefaults(b);
selectedBackground = FineUIUtils.getUIColor( "East.TabSelectedColor", "fill.deep");
}
@Override @Override
protected void paintBackground(Graphics g, JComponent c) { protected void paintBackground(Graphics g, JComponent c) {
Color background = getBackground(c); Color background = getBackground(c);
@ -36,4 +47,18 @@ public class RectangleButtonUI extends FlatButtonUI {
g2.dispose(); g2.dispose();
} }
} }
@Override
protected Color getBackground(JComponent c) {
if( ((AbstractButton)c).isSelected() ) {
return selectedBackground;
}
return buttonStateColor( c,
getBackgroundBase( c, false ),
disabledBackground,
isCustomBackground( c.getBackground() ) ? null : focusedBackground,
hoverBackground,
pressedBackground );
}
} }

8
designer-base/src/main/java/com/fine/theme/light/ui/laf/FineLaf.java

@ -33,10 +33,16 @@ public abstract class FineLaf extends FlatLaf {
public void initialize() { public void initialize() {
super.initialize(); super.initialize();
resetWindowDecorations(); resetWindowDecorations();
// flat默认使用系统弹窗,3.3 版本之前无法实现圆角弹窗。 // flat默认使用系统弹窗,3.4版本mac及win11上支持圆角边框和阴影效果
// popup弹窗不使用flat提供的工具,使用swing原生自带的 // popup弹窗不使用flat提供的工具,使用swing原生自带的
if (shouldUseNativePopupFactory()) {
PopupFactory.setSharedInstance(new PopupFactory()); PopupFactory.setSharedInstance(new PopupFactory());
} }
}
private static boolean shouldUseNativePopupFactory() {
return !SystemInfo.isMacOS && !SystemInfo.isWindows_11_orLater;
}
/** /**
* 在win10和win11下重置窗口装饰恢复系统原生 * 在win10和win11下重置窗口装饰恢复系统原生

21
designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java

@ -5,6 +5,14 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JPanel;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIStyle.STYLE_PRIMARY;
import static com.fine.theme.utils.FineUIStyle.setStyle;
/** /**
* 设计器典型组件组合工厂 * 设计器典型组件组合工厂
@ -41,4 +49,17 @@ public class FineComponentsFactory {
return new UIButtonGroup<>(alignmentIconArray, alignment); return new UIButtonGroup<>(alignmentIconArray, alignment);
} }
/**
* 创建确认&取消按钮组间距为8右对齐
*
* @param confirmButton 确认按钮
* @param cancelButton 取消按钮
* @return 确认&取消按钮组面板
*/
public static JPanel createConfirmCancelButtonPane(JButton confirmButton, JButton cancelButton) {
setStyle(confirmButton, STYLE_PRIMARY);
return row(8,
flex(), cell(confirmButton), cell(cancelButton)).getComponent();
}
} }

16
designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java

@ -157,6 +157,22 @@ public class FineLayoutBuilder {
return row; return row;
} }
/**
* 创建水平布局面板
*
* @param spacing 间距
* @param elements 面板元素
* @return 面板
*/
public static Row createHorizontalLayout(int spacing, Component... elements) {
Row row = new Row();
row.setSpacing(spacing);
for (Component element : elements) {
Layouts.populate(row, cell(element));
}
return row;
}
/** /**
* 组件包装于BorderLayout中 * 组件包装于BorderLayout中

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

@ -1,5 +1,7 @@
package com.fine.theme.utils; package com.fine.theme.utils;
import java.awt.Dimension;
/** /**
* 主题UI常量 * 主题UI常量
* *
@ -12,4 +14,12 @@ public class FineUIConstants {
public static final int SCALE_FONT_SIZE_12 = FineUIScale.scale(12); public static final int SCALE_FONT_SIZE_12 = FineUIScale.scale(12);
public static final int SCALE_FONT_SIZE_13 = FineUIScale.scale(13); public static final int SCALE_FONT_SIZE_13 = FineUIScale.scale(13);
/**
* 对话框常量
*/
public static class Dialog {
public static final Dimension POP_DIALOG_MEDIUM = FineUIScale.scale(new Dimension(360, 400));
}
} }

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

@ -28,6 +28,7 @@ public interface FineUIStyle {
String BRAND_COLOR_LABEL = "brandColorLabel"; String BRAND_COLOR_LABEL = "brandColorLabel";
String BUTTON_TAB_ACTION = "tabAction"; String BUTTON_TAB_ACTION = "tabAction";
String LABEL_BOLD = "boldLabel"; String LABEL_BOLD = "boldLabel";
String LABEL_SECONDARY = "secondaryLabel";
String LABEL_TIP = "tipLabel"; String LABEL_TIP = "tipLabel";
String LABEL_WARNING_TIP = "warningTipLabel"; String LABEL_WARNING_TIP = "warningTipLabel";
String LABEL_UILIST = "uiListLabel"; String LABEL_UILIST = "uiListLabel";
@ -41,6 +42,7 @@ public interface FineUIStyle {
String TRANSPARENT_TEXT_FIELD = "transparentTextField"; String TRANSPARENT_TEXT_FIELD = "transparentTextField";
String TRANSPARENT_BACKGROUND = "transparentBackground"; String TRANSPARENT_BACKGROUND = "transparentBackground";
String PURE_LIST = "pureList"; String PURE_LIST = "pureList";
String NO_BORDER_LIST = "noBorderList";
String PURE_TREE = "pureTree"; String PURE_TREE = "pureTree";
String PASTEL_BUTTON = "pastelButton"; String PASTEL_BUTTON = "pastelButton";
String BREADCRUMB_BUTTON = "breadcrumbButton"; String BREADCRUMB_BUTTON = "breadcrumbButton";

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

@ -1,5 +1,6 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import com.fine.swing.ui.layout.Row;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
@ -478,17 +479,20 @@ public class PreferencePane extends BasicPane {
//gc面板 //gc面板
gcControlPane = createGcControlPane(); gcControlPane = createGcControlPane();
boolean supportV2 = VcsHelper.getInstance().checkV2FunctionSupport();
boolean legacyMode = VcsHelper.getInstance().isLegacyMode();
Component savePane = FineUIUtils.wrapComponentWithTitle(column(10, Component savePane = FineUIUtils.wrapComponentWithTitle(column(10,
cell(vcsEnableCheckBox), cell(vcsEnableCheckBox),
cell(saveIntervalPane).with(it -> it.setVisible(VcsHelper.getInstance().checkV2FunctionSupport())) cell(saveIntervalPane).with(it -> it.setVisible(supportV2))
).getComponent(), i18nText("Fine-Design_Vcs_Save_Setting")); ).getComponent(), i18nText("Fine-Design_Vcs_Save_Setting"));
Component vcsPane = FineUIUtils.wrapComponentWithTitle(column(10, Component vcsPane = FineUIUtils.wrapComponentWithTitle(column(10,
cell(remindVcsLabel), cell(remindVcsLabel),
cell(intervalPanel), cell(intervalPanel),
cell(saveCommitCheckBox).with(it -> it.setVisible(VcsHelper.getInstance().isLegacyMode())), cell(saveCommitCheckBox).with(it -> it.setVisible(legacyMode)),
cell(autoCleanPane), cell(autoCleanPane).with(it -> it.setVisible(supportV2)),
cell(gcControlPane).with(it -> it.setVisible(VcsHelper.getInstance().isLegacyMode())) cell(gcControlPane).with(it -> it.setVisible(legacyMode))
).getComponent(), i18nText("Fine-Design_Vcs_Clean_Setting")); ).getComponent(), i18nText("Fine-Design_Vcs_Clean_Setting"));
JPanel containPane = column(SETTING_V_GAP, JPanel containPane = column(SETTING_V_GAP,
cell(savePane), cell(savePane),
@ -522,12 +526,15 @@ public class PreferencePane extends BasicPane {
}; };
private JPanel createAutoCleanPane() { private JPanel createAutoCleanPane() {
JPanel autoCleanPane = new JPanel(FRGUIPaneFactory.createLeftZeroLayout()); Row autoCleanPane = new Row();
autoCleanPane.setSpacing(2);
useVcsAutoCleanScheduleCheckBox = new UICheckBox(); useVcsAutoCleanScheduleCheckBox = new UICheckBox();
autoCleanIntervalComboBox = new UIComboBox(INTERVAL); autoCleanIntervalComboBox = new UIComboBox(INTERVAL);
autoCleanIntervalComboBox.setSelectedIndex(DEFAULT_INDEX); autoCleanIntervalComboBox.setSelectedIndex(DEFAULT_INDEX);
autoCleanRetainIntervalComboBox = new UIComboBox(INTERVAL); autoCleanRetainIntervalComboBox = new UIComboBox(INTERVAL);
autoCleanRetainIntervalComboBox.setSelectedIndex(DEFAULT_INDEX); autoCleanRetainIntervalComboBox.setSelectedIndex(DEFAULT_INDEX);
autoCleanIntervalComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
autoCleanRetainIntervalComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
autoCleanPane.add(useVcsAutoCleanScheduleCheckBox); autoCleanPane.add(useVcsAutoCleanScheduleCheckBox);
autoCleanPane.add(new UILabel(i18nText("Fine-Design_Vcs_Auto_Clean_Every"))); autoCleanPane.add(new UILabel(i18nText("Fine-Design_Vcs_Auto_Clean_Every")));
autoCleanPane.add(autoCleanIntervalComboBox); autoCleanPane.add(autoCleanIntervalComboBox);

68
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java

@ -1,6 +1,7 @@
package com.fr.design.data.tabledata.tabledatapane; package com.fr.design.data.tabledata.tabledatapane;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIStyle;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.data.impl.ClassTableData; import com.fr.data.impl.ClassTableData;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
@ -13,16 +14,13 @@ import com.fr.design.gui.itableeditorpane.UITableEditAction;
import com.fr.design.gui.itableeditorpane.UITableEditorPane; import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.IOUtils;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Dialog; import java.awt.Dialog;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -32,6 +30,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.flex; import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.fix;
public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> { public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
private UITextField classNameTextField; private UITextField classNameTextField;
@ -39,7 +38,20 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
public ClassTableDataPane() { public ClassTableDataPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
// 数据集默认参数
editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel() {
@Override
public UITableEditAction[] createAction() {
return new UITableEditAction[]{
new AddParaAction(),
new RemoveParaAction()
};
}
}, " " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Default_Para"));
this.add(column(cell(initNorthPanel()), fix(LayoutConstants.VERTICAL_GAP), cell(editorPane).weight(1)).getComponent());
}
private JPanel initNorthPanel() {
//类名 //类名
classNameTextField = new UITextField(); classNameTextField = new UITextField();
UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select"));
@ -61,50 +73,32 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
} }
}); });
JPanel tipPanel = column(LayoutConstants.VERTICAL_GAP, return column(LayoutConstants.VERTICAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function_The_Class_Must_Implement_The_Interface") + "\"com.fr.data.Tabledata\"")),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") + ":\"com.fr.data.impl.ArrayTableData\"")),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Location_Description", StableUtils.pathJoin(ProjectConstants.WEBINF_NAME, ProjectConstants.CLASSES_NAME))))
).getComponent();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HGAP_LARGE, row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Class_Name"))).weight(0.12), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Class_Name"))).weight(0.12),
row(LayoutConstants.HGAP_LARGE, row(LayoutConstants.HGAP_LARGE, cell(classNameTextField).weight(0.85), cell(browserButton).weight(0.15)).weight(0.58),
cell(classNameTextField).weight(0.85),
cell(browserButton).weight(0.15)
).weight(0.58),
flex(0.3) flex(0.3)
), ),
row(LayoutConstants.HGAP_LARGE, flex(0.12), cell(tipPanel).weight(0.88)) row(LayoutConstants.HGAP_LARGE, flex(0.12), cell(getTipPanel()).weight(0.88))
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0,10, 0))).getComponent()); ).getComponent();
this.add(northPane, BorderLayout.NORTH);
this.add(initSouthPanel(), BorderLayout.CENTER);
} }
private JPanel initSouthPanel() {
JPanel jpanel = new JPanel();
jpanel.setPreferredSize(new Dimension(-1, 150));
jpanel.setLayout(new BorderLayout());
editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel() { private JPanel getTipPanel() {
@Override return column(
public UITableEditAction[] createAction() { cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function_The_Class_Must_Implement_The_Interface") +
return new UITableEditAction[]{ "\"com.fr.data.Tabledata\"", FineUIStyle.LABEL_TIP)),
new AddParaAction(), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Location_Description",
new RemoveParaAction() StableUtils.pathJoin(ProjectConstants.WEBINF_NAME, ProjectConstants.CLASSES_NAME)), FineUIStyle.LABEL_TIP)),
}; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") +
":\"com.fr.data.impl.ArrayTableData\"", FineUIStyle.LABEL_TIP))
).getComponent();
} }
}, " " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Default_Para"));
jpanel.add(editorPane, BorderLayout.CENTER);
return jpanel;
}
public class AddParaAction extends UITableEditAction { public class AddParaAction extends UITableEditAction {
public AddParaAction() { public AddParaAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); this.setSmallIcon(new LazyIcon("add"));
} }
@Override @Override
@ -122,7 +116,7 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
private class RemoveParaAction extends UITableEditAction { private class RemoveParaAction extends UITableEditAction {
public RemoveParaAction() { public RemoveParaAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/control/remove.png")); this.setSmallIcon(new LazyIcon("remove"));
} }
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

42
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java

@ -2,13 +2,13 @@ package com.fr.design.data.tabledata.tabledatapane;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.EmbeddedTableData;
import com.fr.design.constants.LayoutConstants;
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.gui.date.UIDatePicker; import com.fr.design.gui.date.UIDatePicker;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UITableScrollPane; import com.fr.design.gui.icontainer.UITableScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -34,6 +34,10 @@ import java.awt.event.MouseEvent;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableData> { public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableData> {
private static final int MIN_CELL_WIDTH = 30; private static final int MIN_CELL_WIDTH = 30;
@ -44,7 +48,6 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
private UILabel coordinatelabel; private UILabel coordinatelabel;
private UIButton insertRowButton; private UIButton insertRowButton;
private UIButton removeRowButton; private UIButton removeRowButton;
private UIButton columnSetButton;
/** /**
* Constructor * Constructor
@ -61,8 +64,7 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// prepare the data in this way as default if no arguments is passed in // prepare the data in this way as default if no arguments is passed in
EmbeddedTableModel tableModel = new EmbeddedTableModel(new EmbeddedTableData()); EmbeddedTableModel tableModel = new EmbeddedTableModel(new EmbeddedTableData());
dataJTable = new JTable(tableModel); dataJTable = new JTable(tableModel);
scrollPane = new UITableScrollPane(dataJTable); scrollPane = new UITableScrollPane(dataJTable);;
this.add(scrollPane, BorderLayout.CENTER);
// 显示double,date类;渲染date类 // 显示double,date类;渲染date类
dataJTable.setDefaultRenderer(Double.class, new DoubleRenderer()); dataJTable.setDefaultRenderer(Double.class, new DoubleRenderer());
@ -80,21 +82,10 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
editbysingleclick(dataJTable, Integer.class); editbysingleclick(dataJTable, Integer.class);
// AUTO RESIZE // AUTO RESIZE
// dataJTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
dataJTable.setAutoResizeMode(tableModel.getColumnCount() * PREVIEW_TABLE_MIN_COLUMN_WIDTH <= PREVIEW_TABLE_WIDTH ? JTable.AUTO_RESIZE_ALL_COLUMNS : JTable.AUTO_RESIZE_OFF); dataJTable.setAutoResizeMode(tableModel.getColumnCount() * PREVIEW_TABLE_MIN_COLUMN_WIDTH <= PREVIEW_TABLE_WIDTH ? JTable.AUTO_RESIZE_ALL_COLUMNS : JTable.AUTO_RESIZE_OFF);
dataJTable.setRowSelectionAllowed(true); dataJTable.setRowSelectionAllowed(true);
dataJTable.setColumnSelectionAllowed(true); dataJTable.setColumnSelectionAllowed(true);
// peter:控制Panel
JPanel northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
this.add(northPane, BorderLayout.NORTH);
// kel:在左上角加一个JLabel用来显示坐标,方便用户查看。
coordinatelabel = new UILabel("0/0,0/0");
coordinatelabel.setHorizontalAlignment(UILabel.CENTER);
northPane.add(coordinatelabel);
dataJTable.addMouseListener(new MouseAdapter() { dataJTable.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
// kel:加上一个鼠标点击的监控,鼠标点击时,返回选中的行坐标和列坐标。 // kel:加上一个鼠标点击的监控,鼠标点击时,返回选中的行坐标和列坐标。
@ -114,14 +105,17 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
checkButtonEnabled(); checkButtonEnabled();
} }
}); });
initOtherNorthPaneComponents(northPane); this.add(column(LayoutConstants.VERTICAL_GAP, cell(getNorthPaneComponents()), cell(scrollPane).weight(1)).getComponent());
} }
private void initOtherNorthPaneComponents(JPanel northPane) { private JPanel getNorthPaneComponents() {
// kel:在左上角加一个JLabel用来显示坐标,方便用户查看。
coordinatelabel = new UILabel("0/0,0/0");
coordinatelabel.setHorizontalAlignment(UILabel.CENTER);
// 表结构设置 // 表结构设置
columnSetButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Embedded_Table_Design")); UIButton columnSetButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Embedded_Table_Design"));
columnSetButton.setMnemonic('C'); columnSetButton.setMnemonic('C');
northPane.add(columnSetButton);
columnSetButton.addActionListener(new ActionListener() { columnSetButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
@ -140,7 +134,6 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
dataJTable.repaint(); dataJTable.repaint();
} }
}; };
BasicDialog dlg = columnSetPane.showWindow(DesignerContext.getDesignerFrame(), l); BasicDialog dlg = columnSetPane.showWindow(DesignerContext.getDesignerFrame(), l);
dlg.setAlwaysOnTop(true); dlg.setAlwaysOnTop(true);
dlg.setVisible(true); dlg.setVisible(true);
@ -150,7 +143,6 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// DataSourceEditor-Insert_Row // DataSourceEditor-Insert_Row
insertRowButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Insert_Row")); insertRowButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Insert_Row"));
insertRowButton.setMnemonic('I'); insertRowButton.setMnemonic('I');
northPane.add(insertRowButton);
insertRowButton.addActionListener(new ActionListener() { insertRowButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
insertRow(); insertRow();
@ -160,7 +152,6 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// DataSourceEditor-Remove_Row // DataSourceEditor-Remove_Row
removeRowButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Delete_Row")); removeRowButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Delete_Row"));
removeRowButton.setMnemonic('R'); removeRowButton.setMnemonic('R');
northPane.add(removeRowButton);
removeRowButton.addActionListener(new ActionListener() { removeRowButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
removeRow(); removeRow();
@ -169,6 +160,13 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// 初始化时更新按钮状态 // 初始化时更新按钮状态
checkButtonEnabled(); checkButtonEnabled();
// peter:控制Panel
return row(LayoutConstants.VGAP_SMALL,
cell(coordinatelabel),
cell(columnSetButton), cell(insertRowButton), cell(removeRowButton),
flex()
).getComponent();
} }
/** /**

22
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java

@ -1,7 +1,7 @@
package com.fr.design.data.tabledata.tabledatapane; package com.fr.design.data.tabledata.tabledatapane;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale; 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.base.Parameter; import com.fr.base.Parameter;
@ -103,7 +103,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private UIRadioButton localFileRadioButton; private UIRadioButton localFileRadioButton;
private UIRadioButton urlFileRadioButton; private UIRadioButton urlFileRadioButton;
private UITableEditorPane<ParameterProvider> editorPane; private UITableEditorPane<ParameterProvider> editorPane;
private UILabel tips; private JPanel tipPanel;
private UIComboBox xmlKyePoint;// xml关键节点 private UIComboBox xmlKyePoint;// xml关键节点
private UIComboBox encodingComboBox;// xml编码 private UIComboBox encodingComboBox;// xml编码
private FileTableData fileTableData; private FileTableData fileTableData;
@ -200,9 +200,11 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
testConnection.setEnabled(false); testConnection.setEnabled(false);
testConnection.addActionListener(testConnectionListener); testConnection.addActionListener(testConnectionListener);
// 提示信息 // 提示信息
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + "txt" + "<br>" tipPanel = column(
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> "; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter_Desc"), FineUIStyle.LABEL_TIP)),
tips = new UILabel(tipContent); cell(new UILabel("reportlets/excel/FineReport${abc}." + "txt", FineUIStyle.LABEL_TIP)),
cell(new UILabel("http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp", FineUIStyle.LABEL_TIP))
).getComponent();
return column( return column(
LayoutConstants.VERTICAL_GAP, LayoutConstants.VERTICAL_GAP,
row( row(
@ -217,7 +219,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
cell(urlText).weight(urlWidthRatio), cell(urlText).weight(urlWidthRatio),
cell(testConnection).weight(0.75 - urlWidthRatio) cell(testConnection).weight(0.75 - urlWidthRatio)
), ),
cell(tips) cell(tipPanel)
).getComponent(); ).getComponent();
} }
@ -497,9 +499,11 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
} else { } else {
rightPanel.add(getTextSetPanel()); rightPanel.add(getTextSetPanel());
} }
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + getFileSuffixToString() + "<br>" tipPanel = column(
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> "; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter_Desc"), FineUIStyle.LABEL_TIP)),
tips.setText(tipContent); cell(new UILabel("reportlets/excel/FineReport${abc}." + getFileSuffixToString(), FineUIStyle.LABEL_TIP)),
cell(new UILabel("http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp", FineUIStyle.LABEL_TIP))
).getComponent();
rightPanel.revalidate(); rightPanel.revalidate();
} }
}; };

8
designer-base/src/main/java/com/fr/design/dialog/AbstractTemplateServerSettingPane.java

@ -44,14 +44,10 @@ public abstract class AbstractTemplateServerSettingPane extends BasicPane {
chooseComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX); chooseComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
//以下设置,部分面板通用 //以下设置,部分面板通用
UILabel belowSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set")); UILabel belowSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set"));
buttonPane = row(32, buttonPane = row(32, cell(belowSetLabel), cell(chooseComboBox), flex()).getComponent();
cell(belowSetLabel),
cell(chooseComboBox),
flex()
).with(it -> it.setBorder(new ScaledEmptyBorder(0,10,0,0))).getComponent();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.contentPane = getContentPane(); this.contentPane = getContentPane();
this.add(column(cell(buttonPane), cell(contentPane)).getComponent()); this.add(column(cell(buttonPane), cell(contentPane).weight(1)).getComponent());
} }
/** /**

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

@ -4,6 +4,7 @@ import com.fine.swing.ui.layout.Row;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
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.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.TemplateUtils; import com.fr.design.utils.TemplateUtils;
@ -26,6 +27,7 @@ import static com.fine.swing.ui.layout.Layouts.cell;
*/ */
public class TemplateListMenuItem extends Row { public class TemplateListMenuItem extends Row {
private static final String UI_CLASS_ID = "TemplateListMenuItemUI"; private static final String UI_CLASS_ID = "TemplateListMenuItemUI";
private static final String UNSAVED_SUFFIX = " *";
private static final int WIDTH = 200; private static final int WIDTH = 200;
@ -55,10 +57,17 @@ public class TemplateListMenuItem extends Row {
* item[1] 切换模板按钮初始化 * item[1] 切换模板按钮初始化
*/ */
private UIButton createTemplateButton(JTemplate<?, ?> template) { private UIButton createTemplateButton(JTemplate<?, ?> template) {
String templateName = template.getTemplateName();
if (!template.isSaved() && !templateName.endsWith(UNSAVED_SUFFIX)) {
templateName += UNSAVED_SUFFIX;
}
UIButton button = new UIButton( UIButton button = new UIButton(
TemplateUtils.createLockeTemplatedName(template, template.getTemplateName()), template.getIcon()); TemplateUtils.createLockeTemplatedName(template, templateName), template.getIcon());
button.setContentAreaFilled(false); button.setContentAreaFilled(false);
button.setHorizontalAlignment(SwingConstants.LEFT); button.setHorizontalAlignment(SwingConstants.LEFT);
if (template == HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()) {
button.setForeground(UIConstants.FLESH_BLUE);
}
return button; return button;
} }

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

@ -314,6 +314,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
// text // text
initFormulaTextArea(); initFormulaTextArea();
UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea); UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea);
formulaTextArea.setBorder(null);
formulaTextAreaScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder()); formulaTextAreaScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
// buttonPane // buttonPane

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

@ -1,5 +1,6 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
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;
import com.fr.design.border.FineBorderFactory; import com.fr.design.border.FineBorderFactory;
@ -29,7 +30,7 @@ import java.util.stream.Stream;
* Time: 15:07 * Time: 15:07
*/ */
abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, ShortCutListenerProvider { abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, ShortCutListenerProvider {
private static final int SHORT_WIDTH = 30; //每加一个short Divider位置加30 private static final int SHORT_WIDTH = FineUIScale.scale(30); //每加一个short Divider位置加30
private static final String SELECT = "SELECT"; private static final String SELECT = "SELECT";
private static final String EDIT = "EDIT"; private static final String EDIT = "EDIT";
JPanel controlUpdatePane; JPanel controlUpdatePane;

2
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

@ -555,7 +555,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
super.paint(g); super.paint(g);
} }
}; };
label.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, FineUIUtils.getUIColor("fill.hover", "fill.hover"))); label.setBorder(BorderFactory.createMatteBorder(0, 0, FineUIScale.scale(1), 0, FineUIUtils.getUIColor("fill.hover", "fill.hover")));
label.setForeground(UIManager.getColor("List.wrapper.text.fontColor")); label.setForeground(UIManager.getColor("List.wrapper.text.fontColor"));
label.setFont(label.getFont().deriveFont(11F)); label.setFont(label.getFont().deriveFont(11F));
label.setPreferredSize(new Dimension(this.getPreferredSize().width, FineUIScale.scale(24))); label.setPreferredSize(new Dimension(this.getPreferredSize().width, FineUIScale.scale(24)));

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

@ -1,6 +1,7 @@
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.utils.FineUIScale;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
@ -43,7 +44,7 @@ public class UINameableListCellRenderer extends
private void initComponents() { private void initComponents() {
editButton = new UILabel() { editButton = new UILabel() {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT); return FineUIScale.scale(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
} }
}; };
editButton.setIcon(isNewStyle ? LIST_EDIT_ICON : CPT_ICON); editButton.setIcon(isNewStyle ? LIST_EDIT_ICON : CPT_ICON);

10
designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java

@ -9,6 +9,7 @@ import com.fr.design.utils.ColorUtils;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
@ -164,11 +165,20 @@ public class FineTabbedPane extends Box {
private void initListeners() { private void initListeners() {
tabGroup.addChangeListener((e) -> { tabGroup.addChangeListener((e) -> {
cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem())); cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem()));
// tab切换时触发事件
fireStateChanged();
}); });
tabGroup.setSelectedIndex(0); tabGroup.setSelectedIndex(0);
cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem())); cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem()));
} }
private void fireStateChanged() {
ChangeEvent evt = new ChangeEvent(this);
for (ChangeListener listener : listenerList.getListeners(ChangeListener.class)) {
listener.stateChanged(evt);
}
}
/** /**
* 添加事件监听 * 添加事件监听
* *

29
designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java

@ -9,22 +9,15 @@ import com.fr.stable.Constants;
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.border.Border;
import java.awt.AWTEvent; import java.awt.AWTEvent;
import java.awt.BasicStroke;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.Dialog; import java.awt.Dialog;
import java.awt.Frame; import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Point; import java.awt.Point;
import java.awt.Polygon; import java.awt.Polygon;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Shape; import java.awt.Shape;
import java.awt.Stroke;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.Window; import java.awt.Window;
import java.awt.event.AWTEventListener; import java.awt.event.AWTEventListener;
@ -326,27 +319,7 @@ public abstract class UIBubbleFloatPane<T> extends BasicBeanPane<T> {
final JPanel contentPane = (JPanel) this.getContentPane(); final JPanel contentPane = (JPanel) this.getContentPane();
this.setLayout(null); this.setLayout(null);
contentPane.add(UIBubbleFloatPane.this); contentPane.add(UIBubbleFloatPane.this);
contentPane.setBorder(new Border() { contentPane.setBorder(null);
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
Graphics2D g2d = (Graphics2D) g;
Stroke oldStroke = g2d.getStroke();
g2d.setStroke(new BasicStroke(2, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND));
g2d.setColor(new Color(51, 51, 51));
g2d.drawPolygon((Polygon) getShape4Board());
g2d.setStroke(oldStroke);
}
@Override
public Insets getBorderInsets(Component c) {
return null;
}
@Override
public boolean isBorderOpaque() {
return false;
}
});
} }
/** /**

3
designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java

@ -1,5 +1,6 @@
package com.fr.design.gui.icombobox; package com.fr.design.gui.icombobox;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.ChartColorMatching; import com.fr.base.ChartColorMatching;
import com.fr.base.ChartPreStyleConfig; import com.fr.base.ChartPreStyleConfig;
import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateTheme;
@ -232,7 +233,7 @@ public class ColorSchemeComboBox extends UIComboBox {
@Override @Override
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Dimension preferredSize = super.getPreferredSize(); Dimension preferredSize = super.getPreferredSize();
preferredSize.setSize(super.getPreferredSize().getWidth(), HEIGHT); preferredSize.setSize(super.getPreferredSize().getWidth(), FineUIScale.scale(HEIGHT));
return preferredSize; return preferredSize;
} }

6
designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java

@ -1,5 +1,6 @@
package com.fr.design.gui.ilable; package com.fr.design.gui.ilable;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.gui.core.UITextComponent; import com.fr.design.gui.core.UITextComponent;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -37,6 +38,11 @@ public class UILabel extends JLabel implements UITextComponent {
super(text); super(text);
} }
public UILabel(String text, String style) {
super(text);
FineUIStyle.setStyle(this, style);
}
public UILabel(String text, boolean enable) { public UILabel(String text, boolean enable) {
super(text); super(text);
this.setEnabled(enable); this.setEnabled(enable);

4
designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java

@ -1,11 +1,14 @@
package com.fr.design.gui.ilist; package com.fr.design.gui.ilist;
import com.fine.theme.utils.FineUIStyle;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import javax.swing.ListModel; import javax.swing.ListModel;
import java.awt.Point; import java.awt.Point;
import static com.fine.theme.utils.FineUIStyle.setStyle;
/** /**
* Created by plough on 2017/7/23. * Created by plough on 2017/7/23.
*/ */
@ -14,6 +17,7 @@ public class UINameEdList extends JNameEdList {
protected UINameEdList(ListModel dataModel) { protected UINameEdList(ListModel dataModel) {
super(dataModel); super(dataModel);
setStyle(this, FineUIStyle.NO_BORDER_LIST);
} }
public Object getType(int index) { public Object getType(int index) {

7
designer-base/src/main/java/com/fr/design/gui/imenu/UIScrollPopUpMenu.java

@ -184,7 +184,7 @@ public class UIScrollPopUpMenu extends UIPopupMenu {
public void layoutContainer(Container parent) { public void layoutContainer(Container parent) {
Insets insets = parent.getInsets(); Insets insets = parent.getInsets();
int width = parent.getPreferredSize().width - insets.left - insets.right; int width = parent.getWidth() - insets.left - insets.right;
int height = parent.getHeight() - insets.top - insets.bottom; int height = parent.getHeight() - insets.top - insets.bottom;
int x = insets.left; int x = insets.left;
@ -195,13 +195,13 @@ public class UIScrollPopUpMenu extends UIPopupMenu {
if ((comp instanceof UIScrollBar) && comp.isVisible()) { if ((comp instanceof UIScrollBar) && comp.isVisible()) {
UIScrollBar scrollBar = (UIScrollBar) comp; UIScrollBar scrollBar = (UIScrollBar) comp;
Dimension dim = scrollBar.getPreferredSize(); Dimension dim = scrollBar.getPreferredSize();
scrollBar.setBounds(x + width - 1, y, dim.width, height); scrollBar.setBounds(x + width - dim.width, y, dim.width, height);
width -= dim.width; width -= dim.width;
position = scrollBar.getValue(); position = scrollBar.getValue();
} }
} }
y -= position; y = insets.top - position;
for (Component comp : parent.getComponents()) { for (Component comp : parent.getComponents()) {
if (!(comp instanceof UIScrollBar) && comp.isVisible()) { if (!(comp instanceof UIScrollBar) && comp.isVisible()) {
Dimension pref = comp.getPreferredSize(); Dimension pref = comp.getPreferredSize();
@ -209,7 +209,6 @@ public class UIScrollPopUpMenu extends UIPopupMenu {
y += pref.height; y += pref.height;
} }
} }
} }
} }
} }

13
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextArea.java

@ -39,6 +39,7 @@ import javax.swing.text.Document;
import javax.swing.text.Element; import javax.swing.text.Element;
import javax.swing.text.Highlighter; import javax.swing.text.Highlighter;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.focusabletip.FocusableTip; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.focusabletip.FocusableTip;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.folding.Fold; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.folding.Fold;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.folding.FoldManager; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.folding.FoldManager;
@ -318,6 +319,7 @@ private boolean fractionalFontMetricsEnabled;
* Constructor. * Constructor.
*/ */
public RSyntaxTextArea() { public RSyntaxTextArea() {
initBorder();
} }
@ -328,6 +330,7 @@ private boolean fractionalFontMetricsEnabled;
*/ */
public RSyntaxTextArea(RSyntaxDocument doc) { public RSyntaxTextArea(RSyntaxDocument doc) {
super(doc); super(doc);
initBorder();
} }
/** /**
@ -337,6 +340,7 @@ private boolean fractionalFontMetricsEnabled;
*/ */
public RSyntaxTextArea(String text) { public RSyntaxTextArea(String text) {
super(text); super(text);
initBorder();
} }
@ -350,6 +354,7 @@ private boolean fractionalFontMetricsEnabled;
*/ */
public RSyntaxTextArea(int rows, int cols) { public RSyntaxTextArea(int rows, int cols) {
super(rows, cols); super(rows, cols);
initBorder();
} }
@ -364,6 +369,7 @@ private boolean fractionalFontMetricsEnabled;
*/ */
public RSyntaxTextArea(String text, int rows, int cols) { public RSyntaxTextArea(String text, int rows, int cols) {
super(text, rows, cols); super(text, rows, cols);
initBorder();
} }
@ -379,6 +385,7 @@ private boolean fractionalFontMetricsEnabled;
*/ */
public RSyntaxTextArea(RSyntaxDocument doc, String text,int rows,int cols) { public RSyntaxTextArea(RSyntaxDocument doc, String text,int rows,int cols) {
super(doc, text, rows, cols); super(doc, text, rows, cols);
initBorder();
} }
@ -390,6 +397,7 @@ private boolean fractionalFontMetricsEnabled;
*/ */
public RSyntaxTextArea(int textMode) { public RSyntaxTextArea(int textMode) {
super(textMode); super(textMode);
initBorder();
} }
@ -435,6 +443,11 @@ private boolean fractionalFontMetricsEnabled;
} }
protected void initBorder() {
setBorder(FineBorderFactory.createWrappedRoundBorder());
}
/** /**
* Adds the parser to "validate" the source code in this text area. This * Adds the parser to "validate" the source code in this text area. This

3
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -974,6 +974,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public void resetButtonIcon() { public void resetButtonIcon() {
button.setBackground(new Color(0, 0, 0, 0)); button.setBackground(new Color(0, 0, 0, 0));
button.setSelected(false);
if (iconSuffix.equals(ICON_SUFFIX_SELECTED)) { if (iconSuffix.equals(ICON_SUFFIX_SELECTED)) {
iconSuffix = ICON_SUFFIX_NORMAL; iconSuffix = ICON_SUFFIX_NORMAL;
button.setIcon(new LazyIcon(getBtnIconId(), ICON_WIDTH)); button.setIcon(new LazyIcon(getBtnIconId(), ICON_WIDTH));
@ -994,8 +995,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
iconSuffix = ICON_SUFFIX_SELECTED_DEPRECATED; iconSuffix = ICON_SUFFIX_SELECTED_DEPRECATED;
button.setIcon(IconUtils.readIcon(getBtnIconUrl())); button.setIcon(IconUtils.readIcon(getBtnIconUrl()));
} }
button.setBackground(selectedBtnBackground);
button.setOpaque(true); button.setOpaque(true);
button.setSelected(true);
selectedItem = this; selectedItem = this;
} }

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

@ -1,6 +1,6 @@
package com.fr.design.mainframe.theme.edit.chart; package com.fr.design.mainframe.theme.edit.chart;
import com.fr.base.BaseUtils; import com.fine.theme.icon.LazyIcon;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
@ -54,8 +54,8 @@ public class ChartFontPane extends BasicPane {
private void initState() { private void initState() {
fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report());
fontSizeComboBox = new UIComboBox(FONT_SIZES); fontSizeComboBox = new UIComboBox(FONT_SIZES);
bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); bold = new UIToggleButton(new LazyIcon("bold"));
italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); italic = new UIToggleButton(new LazyIcon("italic"));
fontColor = getColorButton(); fontColor = getColorButton();
} }
@ -65,11 +65,10 @@ public class ChartFontPane extends BasicPane {
protected void initComponents() { protected void initComponents() {
Component[] components = new Component[]{ Component[] components = new Component[]{
fontColor, italic, bold fontSizeComboBox, fontColor, italic, bold
}; };
JPanel buttonPane = new JPanel(new BorderLayout()); JPanel buttonPane = new JPanel();
buttonPane.add(fontSizeComboBox, BorderLayout.CENTER); buttonPane.add(GUICoreUtils.createFlowPane(components, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE));
buttonPane.add(GUICoreUtils.createFlowPane(components, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.EAST);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(getContentPane(buttonPane), BorderLayout.CENTER); this.add(getContentPane(buttonPane), BorderLayout.CENTER);
@ -90,7 +89,7 @@ public class ChartFontPane extends BasicPane {
new Component[]{null, buttonPane} new Component[]{null, buttonPane}
}; };
return TableLayoutHelper.createGapTableLayoutPane(components, rows, columnSize, 5, LayoutConstants.VGAP_LARGE); return TableLayoutHelper.createGapTableLayoutPane(components, rows, columnSize, 5, 0);
} }
public String getUILabelText() { public String getUILabelText() {

13
designer-base/src/main/java/com/fr/design/report/WatermarkPane.java

@ -15,7 +15,6 @@ import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.UnsignedIntUISpinner; import com.fr.design.gui.ispinner.UnsignedIntUISpinner;
import com.fr.design.gui.style.FRFontPane; import com.fr.design.gui.style.FRFontPane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.color.NewColorSelectPane; import com.fr.design.style.color.NewColorSelectPane;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
@ -80,16 +79,15 @@ public class WatermarkPane extends BasicPane {
private void initComponents() { private void initComponents() {
message = new UILabel(); message = new UILabel();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
//左侧预览面板 //左侧预览面板
JPanel previewPaneWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel previewPaneWrapper = new JPanel(new BorderLayout());
//预览外边框,宽度跟随全局权重 //预览外边框,宽度跟随全局权重
previewPaneWrapper.setBorder(new FineRoundBorder()); previewPaneWrapper.setBorder(new FineRoundBorder());
previewPaneWrapper.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); previewPaneWrapper.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
watermarkPreviewPane = new WatermarkPreviewPane(); watermarkPreviewPane = new WatermarkPreviewPane();
watermarkPreviewPane.setOpaque(false); watermarkPreviewPane.setOpaque(false);
previewPaneWrapper.add(watermarkPreviewPane, BorderLayout.CENTER); previewPaneWrapper.add(watermarkPreviewPane);
leftPane = column( leftPane = column(
LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Style_Preview"))), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Style_Preview"))),
@ -102,10 +100,9 @@ public class WatermarkPane extends BasicPane {
row(LayoutConstants.HORIZONTAL_GAP, row(LayoutConstants.HORIZONTAL_GAP,
cell(leftPane).weight(0.55), cell(leftPane).weight(0.55),
cell(wrapComponentWithTitle(getRightPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Config"))).weight(0.45) cell(wrapComponentWithTitle(getRightPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Config"))).weight(0.45)
) ).weight(1)
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 10))
).getComponent(); ).getComponent();
this.add(centerPanel, BorderLayout.CENTER); this.add(centerPanel);
} }
public void populate(WatermarkAttr watermark) { public void populate(WatermarkAttr watermark) {

12
designer-base/src/main/java/com/fr/design/report/fit/FormFitConfigPane.java

@ -45,7 +45,7 @@ public class FormFitConfigPane extends ReportFitConfigPane {
if (fitAttrModel.getFitTypeNames().length != 0) { if (fitAttrModel.getFitTypeNames().length != 0) {
Component[] ecComponents = new Component[fitAttrModel.getFitTypeNames().length + 1]; Component[] ecComponents = new Component[fitAttrModel.getFitTypeNames().length + 1];
initRadioGroup(ecConfigRadioGroup, fitAttrModel.getFitName(), fitAttrModel.getFitTypeNames(), ecComponents); initRadioGroup(ecConfigRadioGroup, fitAttrModel.getFitName(), fitAttrModel.getFitTypeNames(), ecComponents);
jPanel.add(column(10, cell(createSubAttrPane(ecComponents)), cell(createTipPane())).getComponent()); jPanel.add(column(LayoutConstants.VERTICAL_GAP, cell(createSubAttrPane(ecComponents)), cell(createTipPane())).getComponent());
} }
return jPanel; return jPanel;
} }
@ -139,13 +139,9 @@ public class FormFitConfigPane extends ReportFitConfigPane {
} }
private JPanel createTipPane() { private JPanel createTipPane() {
JPanel jPanel = new JPanel(new BorderLayout()); return column(cell(new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip1"), FineUIStyle.LABEL_TIP)),
UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip1")); cell(new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip2"), FineUIStyle.LABEL_TIP))
FineUIStyle.setStyle(label1, FineUIStyle.LABEL_TIP); ).getComponent();
UILabel label2 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip2"));
FineUIStyle.setStyle(label2, FineUIStyle.LABEL_TIP);
jPanel.add(column(LayoutConstants.HORIZONTAL_GAP, cell(label1), cell(label2)).getComponent());
return jPanel;
} }
protected void refreshPreviewJPanel() { protected void refreshPreviewJPanel() {

50
designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

@ -1,11 +1,11 @@
package com.fr.design.web; package com.fr.design.web;
import com.fine.theme.light.ui.FineRoundBorder; import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.Icon; import com.fr.base.Icon;
import com.fr.base.IconManager; import com.fr.base.IconManager;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
@ -16,14 +16,10 @@ import com.fr.design.gui.ifilechooser.FileChooserFactory;
import com.fr.design.gui.ifilechooser.FileChooserProvider; import com.fr.design.gui.ifilechooser.FileChooserProvider;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.iscrollbar.UIScrollBar;
import com.fr.design.gui.itextarea.DescriptionTextArea;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
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.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.ImageUtils; import com.fr.design.utils.ImageUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.WidgetInfoConfig; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -35,15 +31,12 @@ import com.fr.transaction.WorkerFacade;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import java.awt.Window; import java.awt.Window;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -63,8 +56,9 @@ import java.awt.event.FocusListener;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
/** /**
@ -116,7 +110,7 @@ public class CustomIconPane extends BasicPane {
cell(desLabel).weight(0.1) cell(desLabel).weight(0.1)
).getComponent()); ).getComponent());
JPanel eastPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); JPanel eastPane = new JPanel(new BorderLayout());
JPanel buttonPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); JPanel buttonPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
// 增加、删除、编辑按钮 // 增加、删除、编辑按钮
@ -124,7 +118,7 @@ public class CustomIconPane extends BasicPane {
initRemoveButton(buttonPane); initRemoveButton(buttonPane);
initEditButton(buttonPane); initEditButton(buttonPane);
eastPane.add(buttonPane); eastPane.add(buttonPane, BorderLayout.NORTH);
this.add(column(10, this.add(column(10,
cell(iconLabel), cell(iconLabel),
row(10, cell(centerPane).weight(0.9), cell(eastPane).weight(0.1)).weight(1.0) row(10, cell(centerPane).weight(0.9), cell(eastPane).weight(0.1)).weight(1.0)
@ -425,19 +419,11 @@ public class CustomIconPane extends BasicPane {
private void init() { private void init() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p};
double[] columnSize = {p, p};
UIButton browseButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon")); UIButton browseButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon"));
browseButton.setPreferredSize(new Dimension(80, 25));
browseButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_this_button")); browseButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_this_button"));
nameTextField = new UITextField(20); nameTextField = new UITextField(20);
browseButton.addActionListener(new ActionListener() { browseButton.addActionListener(e -> onBrowseButtonClicked(SwingUtilities.getWindowAncestor(EditIconDialog.this)));
public void actionPerformed(ActionEvent e) {
onBrowseButtonClicked(SwingUtilities.getWindowAncestor(EditIconDialog.this));
}
});
// 焦点丢失时看看名称是否已经存在 // 焦点丢失时看看名称是否已经存在
nameTextField.addFocusListener(new FocusListener() { nameTextField.addFocusListener(new FocusListener() {
@ -458,16 +444,22 @@ public class CustomIconPane extends BasicPane {
} }
}); });
JPanel imagePane = new JPanel();
imagePane.setLayout(new FlowLayout(FlowLayout.LEFT, 30, 0));
showImageLabel = new UILabel(); showImageLabel = new UILabel();
showImageLabel.setPreferredSize(new Dimension(50, 50)); showImageLabel.setPreferredSize(FineUIScale.scale(new Dimension(50, 50)));
imagePane.add(showImageLabel);
imagePane.add(browseButton); JPanel centerPane = column(10,
Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"), nameTextField}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":"), imagePane}}; row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":")).weight(1.2),
JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); cell(nameTextField).weight(3)
this.add(centerPane, BorderLayout.CENTER); ),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":")).weight(1.2),
row(
cell(showImageLabel), column(fix(13), cell(browseButton), fix(13)).weight(1)
).weight(3)
)
).getComponent();
this.add(centerPane, BorderLayout.WEST);
} }
private void onBrowseButtonClicked(Window parent) { private void onBrowseButtonClicked(Window parent) {

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

@ -1,8 +1,11 @@
package com.fr.file; package com.fr.file;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineComponentsFactory;
import com.fine.theme.utils.FineLayoutBuilder;
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.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;
@ -28,8 +31,6 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itree.filetree.FileTreeIcon; import com.fr.design.gui.itree.filetree.FileTreeIcon;
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.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
@ -86,7 +87,6 @@ import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets; import java.awt.Insets;
import java.awt.Window; import java.awt.Window;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -112,6 +112,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.flex; import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIScale.scale;
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;
@ -1788,10 +1789,6 @@ public class FILEChooserPane extends BasicPane {
UILabel newNameLabel = new UILabel(Toolkit.i18nText( UILabel newNameLabel = new UILabel(Toolkit.i18nText(
"Fine-Design_Basic_Enter_New_Folder_Name") "Fine-Design_Basic_Enter_New_Folder_Name")
); );
newNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
newNameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
newNameLabel.setPreferredSize(new Dimension(118, 15));
// 文件名输入框 // 文件名输入框
nameField = new UITextField(); nameField = new UITextField();
nameField.getDocument().addDocumentListener(new DocumentListener() { nameField.getDocument().addDocumentListener(new DocumentListener() {
@ -1809,12 +1806,9 @@ public class FILEChooserPane extends BasicPane {
} }
}); });
nameField.selectAll(); nameField.selectAll();
nameField.setPreferredSize(new Dimension(180, 20)); JPanel topPanel = FineLayoutBuilder.createHorizontalLayout(10, new double[]{1,1},
newNameLabel, nameField
JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5)); );
topPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 0, 15));
topPanel.add(newNameLabel);
topPanel.add(nameField);
// 增加enter以及esc快捷键的支持 // 增加enter以及esc快捷键的支持
nameField.addKeyListener(new KeyAdapter() { nameField.addKeyListener(new KeyAdapter() {
@ -1831,54 +1825,32 @@ public class FILEChooserPane extends BasicPane {
}); });
// 重名提示 // 重名提示
warnLabel = new UILabel(); warnLabel = new UILabel();
warnLabel.setPreferredSize(new Dimension(300, 30)); FineUIStyle.setStyle(warnLabel, FineUIStyle.LABEL_WARNING_TIP);
warnLabel.setHorizontalAlignment(SwingConstants.LEFT);
warnLabel.setForeground(Color.RED);
warnLabel.setVisible(false); warnLabel.setVisible(false);
JPanel midPanel = new JPanel(new BorderLayout()); JPanel midPanel = new JPanel(new BorderLayout());
midPanel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 15));
midPanel.add(warnLabel, BorderLayout.WEST); midPanel.add(warnLabel, BorderLayout.WEST);
// 确认按钮 // 确认按钮
confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm")); confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm"));
confirmButton.setPreferredSize(new Dimension(60, 25)); confirmButton.addActionListener(e -> confirmClose());
confirmButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
confirmClose();
}
});
// 取消按钮 // 取消按钮
UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"));
cancelButton.setPreferredSize(new Dimension(60, 25));
cancelButton.addActionListener(new ActionListener() { cancelButton.addActionListener(e -> dispose());
public void actionPerformed(ActionEvent e) {
dispose();
}
});
JPanel bottomPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JPanel bottomPanel = FineComponentsFactory.createConfirmCancelButtonPane(confirmButton, cancelButton);
bottomPanel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 15));
bottomPanel.add(confirmButton);
bottomPanel.add(cancelButton);
this.add(
TableLayoutHelper.createTableLayoutPane(
new Component[][]{
new Component[]{topPanel},
new Component[]{midPanel},
new Component[]{bottomPanel}
},
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL},
new double[]{TableLayout.FILL}
),
BorderLayout.CENTER);
JPanel panel = new JPanel(new BorderLayout(0, scale(10)));
panel.add(topPanel, BorderLayout.NORTH);
panel.add(midPanel, BorderLayout.CENTER);
panel.add(bottomPanel, BorderLayout.SOUTH);
panel.setBorder(new ScaledEmptyBorder(20, 10, 20, 10));
this.add(panel, BorderLayout.CENTER);
this.setSize(340, 180); this.setSize(scale(new Dimension(360, 180)));
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Mkdir")); this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Mkdir"));
this.setResizable(false); this.setResizable(false);
this.setAlwaysOnTop(true); this.setAlwaysOnTop(true);

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

@ -52,7 +52,7 @@ Component.defaultVGap=10
@BrandHoverColor = #5493F2 @BrandHoverColor = #5493F2
@BrandPressedColor = #105DD1 @BrandPressedColor = #105DD1
@BrandHoverColorSP = #2576EF 12% @BrandHoverColorSP = #2576EF 12%
@BrandTipColor = #0a1c3877 @BrandTipColor = #0A1C3877
@marginSmall = 4 @marginSmall = 4
@marginLarge = 10 @marginLarge = 10
@ -404,6 +404,7 @@ Label.borderColor = $defaultBorderColor
Label.hyperLinkColor = #2576EF Label.hyperLinkColor = #2576EF
Label.strongHintColor = #FF0000 Label.strongHintColor = #FF0000
Label.warningColor = #F1393C Label.warningColor = #F1393C
Label.secondaryColor = #0A1C38A8
#---- HelpButton ---- #---- HelpButton ----
@ -426,7 +427,7 @@ HelpButton.innerFocusWidth = $?Button.innerFocusWidth
#---- List ---- #---- List ----
List.border = 0,0,0,0 List.border = 4,0,4,0
List.cellMargins = 1,12,1,12 List.cellMargins = 1,12,1,12
List.selectionInsets = 0,4,0,4 List.selectionInsets = 0,4,0,4
List.selectionArc = 2 List.selectionArc = 2
@ -1166,7 +1167,7 @@ HeaderPane.height=$Component.defaultHeight
#---- East ---- #---- East ----
East.border = $defaultBorderColor East.border = $defaultBorderColor
East.TabSelectedColor = #B3CFF9 East.TabSelectedColor = @selectionBackground
#---- South ---- #---- South ----
South.SheetTabRadius = 6 South.SheetTabRadius = 6
@ -1194,6 +1195,7 @@ Center.ZoneBorderColor = #E6E9EF
Center.GridColumnRowColor=#e8e8e9 Center.GridColumnRowColor=#e8e8e9
Center.GridColumnRowSelectedColor=fade(@BrandColor, 12%) Center.GridColumnRowSelectedColor=fade(@BrandColor, 12%)
Center.GridColumnRowEditedColor=#e9ecf1 Center.GridColumnRowEditedColor=#e9ecf1
Center.GridCornerFill=fade(#0A1C38, 47%)
Center.SpaceColor = #FFF Center.SpaceColor = #FFF
Center.border = 0, 10, 10, 10 Center.border = 0, 10, 10, 10
Center.arc=10 Center.arc=10
@ -1338,6 +1340,9 @@ chart.selectedBorderColor = #2576EF
[style]Label.warningTipLabel = \ [style]Label.warningTipLabel = \
foreground: $Label.warningColor foreground: $Label.warningColor
[style]Label.secondaryLabel = \
foreground: $Label.secondaryColor
[style]Label.uiListLabel = \ [style]Label.uiListLabel = \
foreground: $List.wrapper.text.fontColor; \ foreground: $List.wrapper.text.fontColor; \
background: $background.normal background: $background.normal
@ -1359,6 +1364,9 @@ chart.selectedBorderColor = #2576EF
[style]List.pureList = \ [style]List.pureList = \
background: $fill.normal background: $fill.normal
[style]List.noBorderList = \
border: 0,0,0,0
[style]Tree.pureTree = \ [style]Tree.pureTree = \
background: $fill.normal background: $fill.normal

5
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java

@ -1,5 +1,6 @@
package com.fr.design.chart.series.SeriesCondition.impl; package com.fr.design.chart.series.SeriesCondition.impl;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
@ -30,7 +31,7 @@ import java.util.HashMap;
*/ */
public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPoplink> { public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPoplink> {
private static final long serialVersionUID = 2469115951510144738L; private static final long serialVersionUID = 2469115951510144738L;
private static final int EDIT_PANE_WIDTH = 248; private static final int EDIT_PANE_WIDTH = FineUIScale.scale(248);
private UITextField itemNameTextField; private UITextField itemNameTextField;
private ChartHyperEditPane hyperEditPane; private ChartHyperEditPane hyperEditPane;
private ChartComponent chartComponent; private ChartComponent chartComponent;
@ -55,7 +56,7 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
ChartCollection cc = createChartCollection(); ChartCollection cc = createChartCollection();
chartComponent = new ChartComponent(); chartComponent = new ChartComponent();
chartComponent.setPreferredSize(new Dimension((int) this.getPreferredSize().getWidth() - EDIT_PANE_WIDTH, 170));// 在单元格弹出时 需要调整保证属性表的大小. chartComponent.setPreferredSize(new Dimension((int) this.getPreferredSize().getWidth() - EDIT_PANE_WIDTH, FineUIScale.scale(170)));// 在单元格弹出时 需要调整保证属性表的大小.
chartComponent.setSupportEdit(false); chartComponent.setSupportEdit(false);
chartComponent.populate(cc); chartComponent.populate(cc);

3
designer-chart/src/main/java/com/fr/design/gui/xcombox/MarkerComboBox.java

@ -3,6 +3,7 @@
*/ */
package com.fr.design.gui.xcombox; package com.fr.design.gui.xcombox;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
@ -107,7 +108,7 @@ public class MarkerComboBox extends UIComboBox {
} }
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(36, 16); return FineUIScale.scale(new Dimension(36, 16));
} }
public Dimension getMinimumSize() { public Dimension getMinimumSize() {

95
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java

@ -4,6 +4,8 @@ package com.fr.design.mainframe.chart.gui;
* Created by hufan on 2016/10/20. * Created by hufan on 2016/10/20.
*/ */
import com.fine.theme.utils.FineLayoutBuilder;
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.base.AttrChangeConfig; import com.fr.chart.base.AttrChangeConfig;
@ -20,22 +22,16 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -44,20 +40,16 @@ import java.awt.event.MouseListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale;
import static com.fr.design.i18n.Toolkit.i18nText; import static com.fr.design.i18n.Toolkit.i18nText;
/** /**
* 图表切换设置面板 * 图表切换设置面板
*/ */
public class ChangeConfigPane extends BasicBeanPane<ChartCollection> { public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
private static final int WIDTH = 100; private static final int WIDTH = scale(100);
private static final int EDIT_AREA_WIDTH = 180;
private static final int LABEL_WIDTH = 20;
private static final int MIN_TIME = 0; private static final int MIN_TIME = 0;
private static final int MAX_TIME = Integer.MAX_VALUE; private static final int MAX_TIME = Integer.MAX_VALUE;
private static final int CONSTANT_TEN = 10;
private static final int CONSTANT_THIRTY = 30;
private static final int CONSTANT_ZERO = 0;
private static final int COL_COUNT = 4; private static final int COL_COUNT = 4;
private JPanel contentPane; private JPanel contentPane;
//配置方式按钮 //配置方式按钮
@ -84,7 +76,7 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
public ChangeConfigPane() { public ChangeConfigPane() {
init(); init();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 15, 10, 15)); this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
this.add(createScrollPane(), BorderLayout.CENTER); this.add(createScrollPane(), BorderLayout.CENTER);
} }
@ -101,20 +93,15 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
initButtonGroup(); initButtonGroup();
configPane = createConfigPane(); configPane = createConfigPane();
contentPane = createContentPane(); contentPane = createContentPane();
contentPane.setBorder(BorderFactory.createEmptyBorder(CONSTANT_TEN, CONSTANT_THIRTY, CONSTANT_TEN, CONSTANT_THIRTY));
} }
private JPanel createContentPane() { private JPanel createContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(i18nText("Fine-Design_Chart_Change_Style")), configStyleButton}, new Component[]{new UILabel(i18nText("Fine-Design_Chart_Change_Style")), configStyleButton},
new Component[]{configPane, null}, new Component[]{configPane, null},
new Component[]{createButtonContentPane(), null} new Component[]{createButtonContentPane(), null}
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
} }
private JPanel createConfigPane() { private JPanel createConfigPane() {
@ -136,39 +123,29 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
panel.add(buttonConfigPane, "button"); panel.add(buttonConfigPane, "button");
panel.add(carouselConfigPane, "carousel"); panel.add(carouselConfigPane, "carousel");
panel.setBorder(BorderFactory.createEmptyBorder(CONSTANT_ZERO, CONSTANT_TEN, CONSTANT_ZERO, CONSTANT_ZERO));
return panel; return panel;
} }
private JPanel createCarouseConfigPane() { private JPanel createCarouseConfigPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f, p};
double[] rowSize = {p, p, p};
timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0); timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0);
colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH); colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH);
switchStyleGroup = new UIButtonGroup(new String[]{i18nText("Fine-Design_Chart_Show"), i18nText("Fine-Design_Report_Hide")}); switchStyleGroup = new UIButtonGroup(new String[]{i18nText("Fine-Design_Chart_Show"), i18nText("Fine-Design_Report_Hide")});
JPanel timeIntervalPane = FineLayoutBuilder.createHorizontalLayout(5, timeInterval, new UILabel(i18nText("Fine-Design_Chart_Time_Second")));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(i18nText("Fine-Design_Chart_Arrow_Style")), switchStyleGroup, null}, new Component[]{new UILabel(i18nText("Fine-Design_Chart_Arrow_Style")), switchStyleGroup},
new Component[]{new UILabel(i18nText("Fine-Design_Chart_Time_Interval")), timeInterval, new UILabel(i18nText("Fine-Design_Chart_Time_Second"))}, new Component[]{new UILabel(i18nText("Fine-Design_Chart_Time_Interval")), timeIntervalPane},
new Component[]{new UILabel(i18nText("Fine-Design_Basic_Background")), colorSelectBox4carousel, null} new Component[]{new UILabel(i18nText("Fine-Design_Basic_Background")), colorSelectBox4carousel}
}; };
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
} }
private JPanel createTitleStylePane() { private JPanel createTitleStylePane() {
final UILabel text = new UILabel(i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); final UILabel text = new UILabel(i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT);
styleAttrPane = new ChartTextAttrPane() { styleAttrPane = new ChartTextAttrPane() {
protected JPanel getContentPane(JPanel buttonPane) { protected JPanel getContentPane(JPanel buttonPane) {
double p = TableLayout.PREFERRED; return FineLayoutBuilder.compatibleTableLayout(10, getComponents(buttonPane), new double[]{1.2, 3});
double f = TableLayout.FILL;
double[] columnSize = {f, EDIT_AREA_WIDTH};
double[] rowSize = {p, p};
return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize);
} }
protected Component[][] getComponents(JPanel buttonPane) { protected Component[][] getComponents(JPanel buttonPane) {
@ -184,54 +161,44 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
private JPanel createButtonBackgroundColorPane() { private JPanel createButtonBackgroundColorPane() {
colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH); colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH);
return TableLayout4VanChartHelper.createGapTableLayoutPane(i18nText("Fine-Design_Basic_Background"), colorSelectBox4button, EDIT_AREA_WIDTH); return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(i18nText("Fine-Design_Basic_Background")),
colorSelectBox4button);
} }
private JPanel createButtonContentPane() { private JPanel createButtonContentPane() {
JPanel buttonContentPane = new JPanel(new BorderLayout()); JPanel buttonContentPane = new JPanel(new BorderLayout(0, scale(10)));
chartTypesPane = new JPanel(); chartTypesPane = new JPanel();
chartTypesPane.setLayout(new BoxLayout(chartTypesPane, BoxLayout.Y_AXIS)); chartTypesPane.setLayout(new BorderLayout());
chartTypesPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
switchTitlePane.setLayout(new CardLayout()); switchTitlePane.setLayout(new CardLayout());
JPanel titleEditPane = TableLayout4VanChartHelper.createGapTableLayoutPane( JPanel titleEditPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
i18nText("Fine-Design_Chart_Switch_Title_Label"), new UILabel(i18nText("Fine-Design_Chart_Switch_Title_Label")),
switchTitlePane, switchTitlePane
EDIT_AREA_WIDTH
); );
titleEditPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
buttonContentPane.add(chartTypesPane, BorderLayout.NORTH); buttonContentPane.add(chartTypesPane, BorderLayout.NORTH);
buttonContentPane.add(titleEditPane, BorderLayout.CENTER); buttonContentPane.add(titleEditPane, BorderLayout.CENTER);
UIExpandablePane expandablePane = new UIExpandablePane(i18nText("Fine-Design_Chart_Button_And_Rotation_Content"), buttonContentPane) { return new UIExpandablePane(i18nText("Fine-Design_Chart_Button_And_Rotation_Content"), buttonContentPane);
protected void setcontentPanelontentPanelBorder() {
}
};
expandablePane.setBorder(BorderFactory.createEmptyBorder(20, 0, 0, 0));
return expandablePane;
} }
private void populateButtonContentPane(ChartCollection collection) { private void populateButtonContentPane(ChartCollection collection) {
int count = collection.getChartCount(); int count = collection.getChartCount();
int select = collection.getSelectedIndex(); int select = collection.getSelectedIndex();
JPanel pane = null; chartTypesPane.removeAll();
ArrayList<Component> buttons = new ArrayList<>();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
if (i % COL_COUNT == 0) {
pane = new JPanel(new FlowLayout(FlowLayout.LEFT));
chartTypesPane.add(pane);
}
ChangeChartButton button = new ChangeChartButton(i, collection); ChangeChartButton button = new ChangeChartButton(i, collection);
changeChartButtons.add(button); changeChartButtons.add(button);
button.setSelected(i == select); button.setSelected(i == select);
pane.add(button); buttons.add(button);
populateSwitchTitlePane(i, collection); populateSwitchTitlePane(i, collection);
} }
chartTypesPane.add(FineLayoutBuilder.createCommonTableLayout(COL_COUNT, 10, 10, buttons));
showSwitchTitleCard(collection.getChartName(select)); showSwitchTitleCard(collection.getChartName(select));
chartTypesPane.revalidate(); chartTypesPane.revalidate();
@ -258,22 +225,17 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
} }
private JPanel createButtonConfigPane() { private JPanel createButtonConfigPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createTitleStylePane(), null}, new Component[]{createTitleStylePane(), null},
new Component[]{createButtonBackgroundColorPane(), null}, new Component[]{createButtonBackgroundColorPane(), null},
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
} }
private void initButtonGroup() { private void initButtonGroup() {
configStyleButton = new UIButtonGroup<Integer>(new String[]{i18nText("Fine-Design_Chart_Button_Style"), configStyleButton = new UIButtonGroup<Integer>(new String[]{i18nText("Fine-Design_Chart_Button_Style"),
i18nText("Fine-Design_Chart_Carousel_Style")}); i18nText("Fine-Design_Chart_Carousel_Style")});
configStyleButton.setPreferredSize(new Dimension(WIDTH * 2, (int) configStyleButton.getPreferredSize().getHeight()));
configStyleButton.addActionListener(new ActionListener() { configStyleButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -359,8 +321,6 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
} }
private class ChangeChartButton extends UIToggleButton { private class ChangeChartButton extends UIToggleButton {
private static final int BUTTON_WIDTH = 52;
private static final int BUTTON_HEIGHT = 20;
private ChartCollection collection; private ChartCollection collection;
private int buttonIndex; private int buttonIndex;
@ -384,9 +344,6 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
}; };
} }
public Dimension getPreferredSize() {
return new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT);
}
} }
private void resetChangeChartButtons() { private void resetChangeChartButtons() {

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.chart.gui;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIConstants;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.chart.base.AttrChangeConfig; import com.fr.chart.base.AttrChangeConfig;
@ -64,11 +65,7 @@ import static com.fine.swing.ui.layout.Layouts.row;
*/ */
public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implements UIObserver { public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implements UIObserver {
private static final long serialVersionUID = -8130803225718028933L; private static final long serialVersionUID = -8130803225718028933L;
private static final int B_W = 52;
private static final int B_H = 20;
private static final int COL_COUNT = 4; private static final int COL_COUNT = 4;
private static final int P_W = 300;
private static final int P_H = 400;
private static Set<Class<? extends ChartProvider>> supportChangeConfigChartClassSet = new HashSet<Class<? extends ChartProvider>>(); private static Set<Class<? extends ChartProvider>> supportChangeConfigChartClassSet = new HashSet<Class<? extends ChartProvider>>();
@ -228,7 +225,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
} }
}); });
dialog.setSize(P_W, P_H); dialog.setSize(FineUIConstants.Dialog.POP_DIALOG_MEDIUM);
dialog.setVisible(true); dialog.setVisible(true);
} }

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java

@ -228,7 +228,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
preDataNumPane = column(10, preDataNumPane = column(10,
row(cell(label).weight(1.2), cell(preDataNum).weight(3)), row(cell(label).weight(1.2), cell(preDataNum).weight(3)),
cell(combineOther) cell(combineOther)
).getComponent(); ).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 0))).getComponent();
preDataNumPane.setVisible(false); preDataNumPane.setVisible(false);
notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate")); notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate"));

3
designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.designer.other;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIConstants;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionListener; import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
@ -26,6 +27,7 @@ import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
/** /**
* Created by hufan on 2016/12/30. * Created by hufan on 2016/12/30.
*/ */
@ -130,6 +132,7 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
} }
}); });
dialog.setPreferredSize(FineUIConstants.Dialog.POP_DIALOG_MEDIUM);
dialog.pack(); dialog.pack();
dialog.setModal(true); dialog.setModal(true);
dialog.setVisible(true); dialog.setVisible(true);

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

@ -51,8 +51,8 @@ import static com.fine.swing.ui.layout.Layouts.row;
public class VanChartPlotLegendPane extends BasicPane { public class VanChartPlotLegendPane extends BasicPane {
private static final long serialVersionUID = 1614283200308877353L; private static final long serialVersionUID = 1614283200308877353L;
private static final int WIDTH = 165; private static final int WIDTH = FineUIScale.scale(165);
private static final int HEIGHT = 100; private static final int HEIGHT = FineUIScale.scale(100);
private static final int GAP = 20; private static final int GAP = 20;
private Plot plot; private Plot plot;

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

@ -3,6 +3,7 @@ package com.fr.van.chart.designer.style.axis.component;
import com.fine.swing.ui.layout.Column; import com.fine.swing.ui.layout.Column;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -214,7 +215,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane<VanChartAxisPlot> {
} }
private class ChartAxisButton extends UIToggleButton { private class ChartAxisButton extends UIToggleButton {
private static final double DEL_WIDTH = 10; private final double DEL_WIDTH = FineUIScale.scale(10);
private static final long serialVersionUID = -3701452534814584608L; private static final long serialVersionUID = -3701452534814584608L;
private BufferedImage closeIcon = BaseUtils.readImageWithCache("com/fr/design/images/toolbarbtn/chartChangeClose.png"); private BufferedImage closeIcon = BaseUtils.readImageWithCache("com/fr/design/images/toolbarbtn/chartChangeClose.png");
private boolean isMoveOn = false; private boolean isMoveOn = false;
@ -231,7 +232,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane<VanChartAxisPlot> {
} }
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(B_W, B_H); return FineUIScale.scale(new Dimension(B_W, B_H));
} }
private void paintDeleteButton(Graphics g2d) { private void paintDeleteButton(Graphics g2d) {

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

@ -1,5 +1,6 @@
package com.fr.van.chart.drillmap.designer.data; package com.fr.van.chart.drillmap.designer.data;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane; import com.fr.design.dialog.MultiTabPane;
@ -35,6 +36,7 @@ public class VanChartMapLayerAndDataTabPane extends MultiTabPane<ChartCollection
private void initComponents() { private void initComponents() {
super.relayoutWhenListChange(); super.relayoutWhenListChange();
setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
} }
protected void tabChanged() { protected void tabChanged() {

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

@ -1,5 +1,6 @@
package com.fr.van.chart.drillmap.designer.data.comp; package com.fr.van.chart.drillmap.designer.data.comp;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
@ -50,6 +51,7 @@ public class DrillMapDataPane extends BasicBeanPane<ChartCollection> {
}; };
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
this.add(dataDefinitionType, BorderLayout.CENTER); this.add(dataDefinitionType, BorderLayout.CENTER);
} }

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

@ -1,7 +1,9 @@
package com.fr.van.chart.drillmap.designer.data.comp; package com.fr.van.chart.drillmap.designer.data.comp;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
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.layout.TableLayout;
@ -52,7 +54,6 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
@Override @Override
protected void layoutContentPane() { protected void layoutContentPane() {
leftcontentPane = createContentPane(); leftcontentPane = createContentPane();
leftcontentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(leftcontentPane); this.add(leftcontentPane);
} }
@ -67,26 +68,13 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
JPanel mapDataTreePanel = new JPanel(new BorderLayout()); JPanel mapDataTreePanel = new JPanel(new BorderLayout());
mapDataTreePanel.add(mapDataTree); mapDataTreePanel.add(mapDataTree);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Tree"), mapDataTreePanel)}, new Component[]{new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Tree"), mapDataTreePanel, true)},
new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Detail"), createLayerDetailPane())} new Component[]{new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Detail"), createLayerDetailPane())}
}; };
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
JPanel panel = new JPanel(new BorderLayout()); return FineLayoutBuilder.asBorderLayoutWrapped(contentPane);
panel.add(contentPane, BorderLayout.CENTER);
return panel;
}
private JPanel createTitlePane (String title, JPanel panel) {
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,5,0,0));
jPanel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
return jPanel;
} }
private JPanel createLayerDetailPane() { private JPanel createLayerDetailPane() {
@ -111,7 +99,7 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
detailComps[i + 1] = new Component[]{label, level, type}; detailComps[i + 1] = new Component[]{label, level, type};
} }
return TableLayoutHelper.createGapTableLayoutPane(detailComps, rowSize, columnSize, 10, 6); return TableLayoutHelper.createGapTableLayoutPane(detailComps, rowSize, columnSize, 5, 6);
} }
/** /**

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

@ -1,13 +1,12 @@
package com.fr.van.chart.drillmap.designer.data.comp; package com.fr.van.chart.drillmap.designer.data.comp;
import com.fr.design.constants.UIConstants; import com.fr.design.border.FineBorderFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper; import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JTree; import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeCellRenderer;
@ -17,6 +16,9 @@ import javax.swing.tree.TreePath;
import java.awt.Component; import java.awt.Component;
import java.util.Enumeration; import java.util.Enumeration;
import static com.fine.theme.utils.FineUIStyle.PURE_TREE;
import static com.fine.theme.utils.FineUIStyle.setStyle;
/** /**
* Created by Mitisky on 16/5/3. * Created by Mitisky on 16/5/3.
*/ */
@ -30,8 +32,9 @@ public class MapDataTree extends JTree {
this.setRootVisible(false); this.setRootVisible(false);
this.setShowsRootHandles(true); this.setShowsRootHandles(true);
this.setInvokesStopCellEditing(true); this.setInvokesStopCellEditing(true);
this.setBackground(UIConstants.NORMAL_BACKGROUND);
this.setCellRenderer(treeCellRenderer); this.setCellRenderer(treeCellRenderer);
setBorder(FineBorderFactory.createWrappedRoundBorder());
setStyle(this, PURE_TREE);
} }
private DefaultTreeModel model = new DefaultTreeModel(null); private DefaultTreeModel model = new DefaultTreeModel(null);
@ -114,10 +117,6 @@ public class MapDataTree extends JTree {
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value; DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value;
String name = getPresentName(treeNode); String name = getPresentName(treeNode);
this.setText(name); this.setText(name);
this.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0));
this.setBackgroundNonSelectionColor(UIConstants.NORMAL_BACKGROUND);
this.setForeground(UIConstants.FONT_COLOR);
this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE);
return this; return this;
} }
}; };

3
designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java

@ -9,6 +9,7 @@ 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.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.widget.CellWidgetCardPane; import com.fr.design.widget.CellWidgetCardPane;
import com.fr.design.widget.EastCellWidgetCardPane;
import com.fr.design.widget.WidgetManageCardPane; import com.fr.design.widget.WidgetManageCardPane;
import com.fr.design.widget.WidgetPane; import com.fr.design.widget.WidgetPane;
import com.fr.form.ui.*; import com.fr.form.ui.*;
@ -47,7 +48,7 @@ public class WidgetHighlightPane extends ConditionAttrSingleConditionPane<Highli
final WidgetPane widgetPane = new WidgetPane() { final WidgetPane widgetPane = new WidgetPane() {
@Override @Override
protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane) { protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane) {
return new WidgetManageCardPane(pane); return new EastCellWidgetCardPane(pane);
} }
}; };
widgetPane.populate(widget); widgetPane.populate(widget);

14
designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java

@ -53,28 +53,28 @@ public class ImageExportPane extends AbstractExportPane {
public ImageExportPane() { public ImageExportPane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips"));
FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
initGlobalSettings(); initGlobalSettings();
Component centerPane = column(LayoutConstants.VERTICAL_GAP, Component centerPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Resolution") + ":")).weight(0.4), row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Resolution"), FineUIStyle.LABEL_SECONDARY)).weight(0.4),
cell(this.globalResolutionBtnS).weight(0.4), cell(this.globalResolutionBtnS).weight(0.4),
cell(this.globalResolutionBtnM).weight(0.4), cell(this.globalResolutionBtnM).weight(0.4),
cell(this.globalResolutionBtnL).weight(0.4), cell(this.globalResolutionBtnL).weight(0.4),
flex()), flex()),
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Format") + ":")).weight(0.4), row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Format"), FineUIStyle.LABEL_SECONDARY)).weight(0.4),
cell(this.globalFormatJpg).weight(0.8), cell(this.globalFormatJpg).weight(0.8),
cell(this.globalFormatPng).weight(0.4), cell(this.globalFormatPng).weight(0.4),
flex()), flex()),
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":")).weight(0.4), row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality"), FineUIStyle.LABEL_SECONDARY)).weight(0.4),
cell(this.globalRenderQuality).weight(0.8), cell(this.globalRenderQuality).weight(0.8),
cell(this.globalRenderSpeed).weight(0.4), cell(this.globalRenderSpeed).weight(0.4),
flex()), flex()),
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting") + ":")).weight(0.4), column(LayoutConstants.VGAP_SMALL,
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting"), FineUIStyle.LABEL_SECONDARY)).weight(0.4),
cell(this.templateThumbnail).weight(0.8), cell(this.templateThumbnail).weight(0.8),
cell(this.templatePaging).weight(0.4), cell(this.templatePaging).weight(0.4),
flex()), flex()),
cell(tipLabel) cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips"), FineUIStyle.LABEL_TIP))
)
).getComponent(); ).getComponent();
this.add(wrapComponentWithTitle( this.add(wrapComponentWithTitle(

18
designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java

@ -262,16 +262,16 @@ public class PageSetupPane extends BasicPane {
marginTopUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginTopUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP, JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate") + ":")), cell(marginTopUnitFieldPane)), row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate"))), cell(marginTopUnitFieldPane)),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom") + ":")), cell(marginBottomUnitFieldPane)) row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom"))), cell(marginBottomUnitFieldPane))
).getComponent(); ).getComponent();
// peter:这个一个垂直的上下的字符panel. // peter:这个一个垂直的上下的字符panel.
marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel marginRightPane = column(LayoutConstants.VERTICAL_GAP, JPanel marginRightPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left") + ":")), cell(marginLeftUnitFieldPane)), row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left"))), cell(marginLeftUnitFieldPane)),
row( cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Right") + ":")), cell(marginRightUnitFieldPane)) row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Right"))), cell(marginRightUnitFieldPane))
).getComponent(); ).getComponent();
marginTopUnitFieldPane.getTextField().addFocusListener(fa); marginTopUnitFieldPane.getTextField().addFocusListener(fa);
@ -281,18 +281,18 @@ public class PageSetupPane extends BasicPane {
JPanel marginPane = row(24, cell(marginLeftPane), cell(marginRightPane), cell(zeroMarginWarn)).getComponent(); JPanel marginPane = row(24, cell(marginLeftPane), cell(marginRightPane), cell(zeroMarginWarn)).getComponent();
//方向-页边距 //方向-页边距
JPanel twoPane = row(10, JPanel twoPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(wrapComponentWithTitle(orientationPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Setup_Orientation"))).weight(0.25), cell(wrapComponentWithTitle(orientationPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Setup_Orientation"))).weight(0.25),
cell(wrapComponentWithTitle(marginPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Margin"))).weight(0.8) cell(wrapComponentWithTitle(marginPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Margin"))).weight(0.8)
).getComponent(); ).getComponent();
//高度 //高度
headerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); headerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
footerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); footerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel hfHeightPane = row( JPanel hfHeightPane = row(
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Header"))), cell(headerUnitFieldPane)), row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Header"))), cell(headerUnitFieldPane)),
fix(24), fix(24),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Footer"))), cell(footerUnitFieldPane)) row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Footer"))), cell(footerUnitFieldPane))
).getComponent(); ).getComponent();
Component heightPane = wrapComponentWithTitle(hfHeightPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height")); Component heightPane = wrapComponentWithTitle(hfHeightPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height"));

7
designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java

@ -21,6 +21,10 @@ import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel; import javax.swing.SpinnerNumberModel;
import java.awt.Dimension; import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.fix;
/** /**
* UnitFieldPane * UnitFieldPane
*/ */
@ -72,9 +76,8 @@ public class UnitFieldPane extends JPanel {
textField = ((JSpinner.DefaultEditor) valueSpinner.getEditor()).getTextField(); textField = ((JSpinner.DefaultEditor) valueSpinner.getEditor()).getTextField();
textField.setColumns(OperatingSystem.isWindows() ? TEXT_FIELD_COLUMNS_WINDOWS : TEXT_FIELD_COLUMNS); textField.setColumns(OperatingSystem.isWindows() ? TEXT_FIELD_COLUMNS_WINDOWS : TEXT_FIELD_COLUMNS);
InputEventBaseOnOS.addBasicEditInputMap(textField); InputEventBaseOnOS.addBasicEditInputMap(textField);
this.add(valueSpinner);
unitLable = new UnitLabel(unitType, valueSpinner.getPreferredSize().height); unitLable = new UnitLabel(unitType, valueSpinner.getPreferredSize().height);
this.add(unitLable); this.add(row(cell(valueSpinner), fix(4), cell(unitLable)).getComponent());
} }
public JFormattedTextField getTextField() { public JFormattedTextField getTextField() {

7
designer-realize/src/main/java/com/fr/design/report/mobile/MobileRadioGroupPane.java

@ -36,12 +36,9 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
addToButtonGroup(horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio); addToButtonGroup(horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(row(LayoutConstants.HORIZONTAL_GAP, this.add(row(20,
cell(new UILabel(title)), cell(new UILabel(title)),
cell(horizonRadio), row(LayoutConstants.HORIZONTAL_GAP, cell(horizonRadio), cell(verticalRadio), cell(bidirectionalRadio), cell(notFitRadio))
cell(verticalRadio),
cell(bidirectionalRadio),
cell(notFitRadio)
).getComponent()); ).getComponent());
} }

7
designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java

@ -1,6 +1,5 @@
package com.fr.design.report.mobile; package com.fr.design.report.mobile;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
@ -37,14 +36,14 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
appFitBrowserPane = new AppFitBrowserPane(); appFitBrowserPane = new AppFitBrowserPane();
appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane);
//移动端属性整体面板 //移动端属性整体面板,不同分组间距20px
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.add(column(LayoutConstants.VERTICAL_GAP, panel.add(column(LayoutConstants.VGAP_HUGER,
cell(reportMobileTemplateSettingsPane), cell(reportMobileTemplateSettingsPane),
cell(appFitBrowserPane), cell(appFitBrowserPane),
cell(mobileOthersPane = new MobileOthersPane()), cell(mobileOthersPane = new MobileOthersPane()),
cell(appFitPreviewPane) cell(appFitPreviewPane)
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent()); ).getComponent());
UIScrollPane scrollPane = new UIScrollPane(panel); UIScrollPane scrollPane = new UIScrollPane(panel);
this.add(scrollPane); this.add(scrollPane);
} }

25
designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileTemplateSettingsPane.java

@ -6,7 +6,6 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.mobile.ElementCaseMobileAttr; import com.fr.report.mobile.ElementCaseMobileAttr;
@ -40,29 +39,17 @@ public class ReportMobileTemplateSettingsPane extends BasicBeanPane<ElementCaseM
private JPanel getMobileCanvasSizeCheckPane() { private JPanel getMobileCanvasSizeCheckPane() {
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
mobileCanvasSizeCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Mobile_Canvas_Size")); mobileCanvasSizeCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Mobile_Canvas_Size"));
panel.add(column(LayoutConstants.VERTICAL_GAP, panel.add(column(LayoutConstants.VGAP_SMALL,
cell(mobileCanvasSizeCheck), cell(mobileCanvasSizeCheck),
cell(getCanvasDescPane()) column(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Match_Desc"), FineUIStyle.LABEL_TIP)),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_In_Desc"), FineUIStyle.LABEL_TIP)),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_Out_Desc"), FineUIStyle.LABEL_TIP))
).with(it -> it.setBorder(new ScaledEmptyBorder(0,20,0,0)))
).getComponent()); ).getComponent());
return panel; return panel;
} }
private JPanel getCanvasDescPane() {
UILabel desc1 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Match_Desc"));
UILabel desc2 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_In_Desc"));
UILabel desc3 = createDescLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Screen_Zoom_Out_Desc"));
JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout());
panel.add(column(LayoutConstants.VERTICAL_GAP, cell(desc1), cell(desc2), cell(desc3)).getComponent());
panel.setBorder(new ScaledEmptyBorder(0,20,0,0));
return panel;
}
private UILabel createDescLabel(String desc) {
UILabel label = new UILabel(desc);
FineUIStyle.setStyle(label, FineUIStyle.LABEL_TIP);
return label;
}
@Override @Override
public void populateBean(ElementCaseMobileAttr ob) { public void populateBean(ElementCaseMobileAttr ob) {
if (ob == null) { if (ob == null) {

11
designer-realize/src/main/java/com/fr/design/webattr/ViewWebSettingPane.java

@ -9,7 +9,7 @@ import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebView; import com.fr.report.web.WebView;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebAttr;
import javax.swing.*; import javax.swing.JPanel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -17,6 +17,7 @@ import java.util.List;
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; import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.fix;
public class ViewWebSettingPane extends WebSettingPane<WebView> { public class ViewWebSettingPane extends WebSettingPane<WebView> {
private UICheckBox sortCheckBox; private UICheckBox sortCheckBox;
@ -39,11 +40,9 @@ public class ViewWebSettingPane extends WebSettingPane<WebView> {
sortCheckBox.setSelected(true); sortCheckBox.setSelected(true);
conditionFilterBox.setSelected(true); conditionFilterBox.setSelected(true);
listFilterBox.setSelected(true); listFilterBox.setSelected(true);
return row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview"))).weight(0.15), return row(
cell(sortCheckBox).weight(0.15), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview"))).weight(0.15),
cell(conditionFilterBox).weight(0.15), row(cell(sortCheckBox), fix(12), cell(conditionFilterBox), fix(12), cell(listFilterBox), flex()).weight(0.85)
cell(listFilterBox).weight(0.15),
flex(0.4)
).getComponent(); ).getComponent();
} }

5
designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java

@ -15,7 +15,8 @@ import com.fr.report.web.WebWrite;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebAttr;
import javax.swing.*; import javax.swing.JPanel;
import javax.swing.ButtonGroup;
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;
@ -84,7 +85,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
colorButton.setEnabled(colorBox.isSelected()); colorButton.setEnabled(colorBox.isSelected());
} }
}); });
JPanel backgroundPane = row(cell(colorBox), cell(colorButton)).getComponent(); JPanel backgroundPane = row(LayoutConstants.HGAP_LARGE, cell(colorBox), cell(colorButton)).getComponent();
//勾选设置 //勾选设置
unloadCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unload_Check")); unloadCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unload_Check"));

20
designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java

@ -181,10 +181,6 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
printerComboBox = new UIComboBox(getAllPrinterNames()); printerComboBox = new UIComboBox(getAllPrinterNames());
// 份数 // 份数
copySpinner = new UIBasicSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1)); copySpinner = new UIBasicSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1));
// 页码标签
JPanel printAreaLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
printAreaLabelPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Page_Number")), BorderLayout.NORTH);
printAreaLabelPane.setBorder(new ScaledEmptyBorder(2,0,0,0));
// 继承页面纸张设置 // 继承页面纸张设置
inheritPagePaperSettingCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Inherit_Page_Paper_Setting")); inheritPagePaperSettingCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Inherit_Page_Paper_Setting"));
JPanel paperSettingPane = getPaperSettingPane(); JPanel paperSettingPane = getPaperSettingPane();
@ -209,10 +205,12 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number"))).weight(0.1), row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number"))).weight(0.1),
cell(copySpinner).weight(0.15), cell(copySpinner).weight(0.15),
flex(0.75)), flex(0.75)),
row(cell(printAreaLabelPane).weight(0.1), row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Page_Number")))
.weight(0.1).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))),
cell(getPrintAreaPane()).weight(0.7), cell(getPrintAreaPane()).weight(0.7),
flex(0.2)), flex(0.2)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paper"))).weight(0.1), row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paper")))
.weight(0.1).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))),
cell(paperSettingCheckPane).weight(0.5), cell(paperSettingCheckPane).weight(0.5),
flex(0.4)), flex(0.4)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"))).weight(0.1), row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"))).weight(0.1),
@ -283,13 +281,13 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
// 高度设置 // 高度设置
customHeightFieldPane = new UnitFieldPane(Constants.UNIT_MM); customHeightFieldPane = new UnitFieldPane(Constants.UNIT_MM);
customHeightFieldPane.setUnitValue(DEFAULT_PAPERSIZE.getHeight()); customHeightFieldPane.setUnitValue(DEFAULT_PAPERSIZE.getHeight());
customPaperSizePane = row(LayoutConstants.HORIZONTAL_GAP, customPaperSizePane = row(24,
row( row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width") + ":")), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width"))),
cell(customWidthFieldPane) cell(customWidthFieldPane)
), ),
row( row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height") + ":")), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height"))),
cell(customHeightFieldPane) cell(customHeightFieldPane)
) )
).getComponent(); ).getComponent();

12
designer-realize/src/main/java/com/fr/design/webattr/printsettings/PageMarginSettingPane.java

@ -31,21 +31,19 @@ public class PageMarginSettingPane extends JPanel {
marginTopUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginTopUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP, JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate") + ":")), cell(marginTopUnitFieldPane)), row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Top_Duplicate"))), cell(marginTopUnitFieldPane)),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom") + ":")), cell(marginBottomUnitFieldPane)) row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom"))), cell(marginBottomUnitFieldPane))
).getComponent(); ).getComponent();
// peter:这个一个垂直的上下的字符panel. // peter:这个一个垂直的上下的字符panel.
marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel marginRightPane = column(LayoutConstants.VERTICAL_GAP, JPanel marginRightPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left") + ":")), cell(marginLeftUnitFieldPane)), row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left"))), cell(marginLeftUnitFieldPane)),
row( cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Right") + ":")), cell(marginRightUnitFieldPane)) row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Right"))), cell(marginRightUnitFieldPane))
).getComponent(); ).getComponent();
JPanel marginPane = row(LayoutConstants.HORIZONTAL_GAP, JPanel marginPane = row(24, cell(marginLeftPane), cell(marginRightPane)).getComponent();
cell(marginLeftPane),
cell(marginRightPane)).getComponent();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(marginPane, BorderLayout.CENTER); this.add(marginPane, BorderLayout.CENTER);
} }

3
designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java

@ -59,7 +59,8 @@ public class PrintSettingPane extends BasicPane {
scrollPane.setPreferredSize(FineUIScale.scale(new Dimension(600, 400))); scrollPane.setPreferredSize(FineUIScale.scale(new Dimension(600, 400)));
printPane.add(nativePrintRadioButton.getText(), scrollPane); printPane.add(nativePrintRadioButton.getText(), scrollPane);
JPanel allPanel = column(LayoutConstants.VERTICAL_GAP, cell(north), cell(printPane)).getComponent(); JPanel allPanel = column(LayoutConstants.VERTICAL_GAP, cell(north), cell(printPane))
.with(it -> it.setBorder(new ScaledEmptyBorder(10 , 0, 0, 0))).getComponent();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(allPanel, BorderLayout.CENTER); this.add(allPanel, BorderLayout.CENTER);
} }

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

@ -104,7 +104,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
} }
protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane) { protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane) {
return eastRegion ? new EastCellWidgetCardPane(pane) : new CellWidgetCardPane(pane); return new EastCellWidgetCardPane(pane);
} }
protected JPanel createContentPane() { protected JPanel createContentPane() {

5
designer-realize/src/main/java/com/fr/grid/GridCorner.java

@ -3,6 +3,7 @@
*/ */
package com.fr.grid; package com.fr.grid;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerUIModeConfig; import com.fr.design.mainframe.DesignerUIModeConfig;
@ -70,14 +71,14 @@ public class GridCorner extends BaseGridComponent {
private void paintArc(Graphics2D g2d, Dimension size, float time) { private void paintArc(Graphics2D g2d, Dimension size, float time) {
g2d.setColor(UIConstants.LINE_COLOR); g2d.setColor(FlatUIUtils.getUIColor("Center.GridCornerFill", UIConstants.LINE_COLOR));
float height = 2 * time; float height = 2 * time;
float width = 2 * time; float width = 2 * time;
float hgap = 4 * time; float hgap = 4 * time;
float vgap = 3 * time; float vgap = 3 * time;
int x = (int) ((size.width - (hgap * 2 + width * 3)) / 2); int x = (int) ((size.width - (hgap * 2 + width * 3)) / 2);
int y = (int) (size.height - (vgap * 2 + height * 3)); int y = (int) (size.height - (vgap * 3 + height * 3));
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) { for (int j = 0; j < 3; j++) {
GraphHelper.fillRect(g2d, x + (i * hgap), y + (j * vgap), width, height); GraphHelper.fillRect(g2d, x + (i * hgap), y + (j * vgap), width, height);

22
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellImageQuickEditor.java

@ -1,13 +1,12 @@
package com.fr.quickeditor.cellquick; package com.fr.quickeditor.cellquick;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.ImageCellAction; import com.fr.design.actions.insert.cell.ImageCellAction;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.report.SelectImagePane; import com.fr.design.report.SelectImagePane;
@ -17,11 +16,6 @@ import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.cell.cellattr.CellImage; import com.fr.report.cell.cellattr.CellImage;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/** /**
* 单元格元素图片编辑器 * 单元格元素图片编辑器
@ -37,20 +31,10 @@ public class CellImageQuickEditor extends CellQuickEditor {
@Override @Override
public JComponent createCenterBody() { public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
UIButton editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); UIButton editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"));
editButton.addActionListener(new ActionListener() { editButton.addActionListener(e -> showEditingDialog());
@Override
public void actionPerformed(ActionEvent e) {
showEditingDialog();
}
});
editButton.setOpaque(false); editButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ return FineLayoutBuilder.asBorderLayoutWrapped(editButton);
new Component[]{EMPTY_LABEL, editButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content;
} }
private void showEditingDialog() { private void showEditingDialog() {

14
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java

@ -1,19 +1,14 @@
package com.fr.quickeditor.cellquick; package com.fr.quickeditor.cellquick;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.RichTextCellAction; import com.fr.design.actions.insert.cell.RichTextCellAction;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.quickeditor.CellQuickEditor; import com.fr.quickeditor.CellQuickEditor;
import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
/** /**
* 单元格元素富文本编辑器 * 单元格元素富文本编辑器
@ -30,14 +25,9 @@ public class CellRichTextEditor extends CellQuickEditor {
@Override @Override
public JComponent createCenterBody() { public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
richTextButton = new UIButton(); richTextButton = new UIButton();
richTextButton.setOpaque(false); richTextButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ return FineLayoutBuilder.asBorderLayoutWrapped(richTextButton);
new Component[]{EMPTY_LABEL, richTextButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content;
} }
@Override @Override

Loading…
Cancel
Save