Browse Source

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

newui
lemon 7 months ago
parent
commit
176bc51aac
  1. 27
      designer-base/src/main/java/com/fine/theme/light/ui/RectangleButtonUI.java
  2. 10
      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. 82
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
  9. 44
      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. 68
      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. 20
      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. 9
      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;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatButtonUI;
import com.formdev.flatlaf.ui.FlatUIUtils;
import javax.swing.AbstractButton;
import javax.swing.JComponent;
import java.awt.*;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
/**
* 矩形按钮UI忽略圆角属性
@ -20,6 +24,13 @@ public class RectangleButtonUI extends FlatButtonUI {
super(shared);
}
@Override
protected void installDefaults(AbstractButton b) {
super.installDefaults(b);
selectedBackground = FineUIUtils.getUIColor( "East.TabSelectedColor", "fill.deep");
}
@Override
protected void paintBackground(Graphics g, JComponent c) {
Color background = getBackground(c);
@ -36,4 +47,18 @@ public class RectangleButtonUI extends FlatButtonUI {
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 );
}
}

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

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

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 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);
}
/**
* 创建确认&取消按钮组间距为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;
}
/**
* 创建水平布局面板
*
* @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中

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

@ -1,5 +1,7 @@
package com.fine.theme.utils;
import java.awt.Dimension;
/**
* 主题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_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 BUTTON_TAB_ACTION = "tabAction";
String LABEL_BOLD = "boldLabel";
String LABEL_SECONDARY = "secondaryLabel";
String LABEL_TIP = "tipLabel";
String LABEL_WARNING_TIP = "warningTipLabel";
String LABEL_UILIST = "uiListLabel";
@ -41,6 +42,7 @@ public interface FineUIStyle {
String TRANSPARENT_TEXT_FIELD = "transparentTextField";
String TRANSPARENT_BACKGROUND = "transparentBackground";
String PURE_LIST = "pureList";
String NO_BORDER_LIST = "noBorderList";
String PURE_TREE = "pureTree";
String PASTEL_BUTTON = "pastelButton";
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;
import com.fine.swing.ui.layout.Row;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
@ -478,17 +479,20 @@ public class PreferencePane extends BasicPane {
//gc面板
gcControlPane = createGcControlPane();
boolean supportV2 = VcsHelper.getInstance().checkV2FunctionSupport();
boolean legacyMode = VcsHelper.getInstance().isLegacyMode();
Component savePane = FineUIUtils.wrapComponentWithTitle(column(10,
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"));
Component vcsPane = FineUIUtils.wrapComponentWithTitle(column(10,
cell(remindVcsLabel),
cell(intervalPanel),
cell(saveCommitCheckBox).with(it -> it.setVisible(VcsHelper.getInstance().isLegacyMode())),
cell(autoCleanPane),
cell(gcControlPane).with(it -> it.setVisible(VcsHelper.getInstance().isLegacyMode()))
cell(saveCommitCheckBox).with(it -> it.setVisible(legacyMode)),
cell(autoCleanPane).with(it -> it.setVisible(supportV2)),
cell(gcControlPane).with(it -> it.setVisible(legacyMode))
).getComponent(), i18nText("Fine-Design_Vcs_Clean_Setting"));
JPanel containPane = column(SETTING_V_GAP,
cell(savePane),
@ -522,12 +526,15 @@ public class PreferencePane extends BasicPane {
};
private JPanel createAutoCleanPane() {
JPanel autoCleanPane = new JPanel(FRGUIPaneFactory.createLeftZeroLayout());
Row autoCleanPane = new Row();
autoCleanPane.setSpacing(2);
useVcsAutoCleanScheduleCheckBox = new UICheckBox();
autoCleanIntervalComboBox = new UIComboBox(INTERVAL);
autoCleanIntervalComboBox.setSelectedIndex(DEFAULT_INDEX);
autoCleanRetainIntervalComboBox = new UIComboBox(INTERVAL);
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(new UILabel(i18nText("Fine-Design_Vcs_Auto_Clean_Every")));
autoCleanPane.add(autoCleanIntervalComboBox);

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

@ -1,6 +1,7 @@
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.data.impl.ClassTableData;
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.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.IOUtils;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Dialog;
import java.awt.Dimension;
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.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.fix;
public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
private UITextField classNameTextField;
@ -39,7 +38,20 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
public ClassTableDataPane() {
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();
UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select"));
@ -51,60 +63,42 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
BasicDialog dlg= bPane.showWindow(
(Dialog) SwingUtilities.getWindowAncestor(ClassTableDataPane.this),
new DialogActionAdapter() {
public void doOk() {
String classPath = bPane.getClassPath();
ClassTableData tableData = new ClassTableData(classPath);
populateBean(tableData);
}
});
public void doOk() {
String classPath = bPane.getClassPath();
ClassTableData tableData = new ClassTableData(classPath);
populateBean(tableData);
}
});
dlg.setVisible(true);
}
});
JPanel tipPanel = 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,
return column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Class_Name"))).weight(0.12),
row(LayoutConstants.HGAP_LARGE,
cell(classNameTextField).weight(0.85),
cell(browserButton).weight(0.15)
).weight(0.58),
row(LayoutConstants.HGAP_LARGE, cell(classNameTextField).weight(0.85), cell(browserButton).weight(0.15)).weight(0.58),
flex(0.3)
),
row(LayoutConstants.HGAP_LARGE, flex(0.12), cell(tipPanel).weight(0.88))
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0,10, 0))).getComponent());
this.add(northPane, BorderLayout.NORTH);
this.add(initSouthPanel(), BorderLayout.CENTER);
row(LayoutConstants.HGAP_LARGE, flex(0.12), cell(getTipPanel()).weight(0.88))
).getComponent();
}
private JPanel initSouthPanel() {
JPanel jpanel = new JPanel();
jpanel.setPreferredSize(new Dimension(-1, 150));
jpanel.setLayout(new BorderLayout());
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"));
jpanel.add(editorPane, BorderLayout.CENTER);
return jpanel;
private JPanel getTipPanel() {
return column(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function_The_Class_Must_Implement_The_Interface") +
"\"com.fr.data.Tabledata\"", FineUIStyle.LABEL_TIP)),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Location_Description",
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();
}
public class AddParaAction extends UITableEditAction {
public AddParaAction() {
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
@ -122,7 +116,7 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
private class RemoveParaAction extends UITableEditAction {
public RemoveParaAction() {
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) {

44
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.fr.data.impl.EmbeddedTableData;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.date.UIDatePicker;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UITableScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.DateUtils;
import com.fr.log.FineLoggerFactory;
@ -34,6 +34,10 @@ import java.awt.event.MouseEvent;
import java.text.SimpleDateFormat;
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> {
private static final int MIN_CELL_WIDTH = 30;
@ -44,9 +48,8 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
private UILabel coordinatelabel;
private UIButton insertRowButton;
private UIButton removeRowButton;
private UIButton columnSetButton;
/**
/**
* 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
EmbeddedTableModel tableModel = new EmbeddedTableModel(new EmbeddedTableData());
dataJTable = new JTable(tableModel);
scrollPane = new UITableScrollPane(dataJTable);
this.add(scrollPane, BorderLayout.CENTER);
scrollPane = new UITableScrollPane(dataJTable);;
// 显示double,date类;渲染date类
dataJTable.setDefaultRenderer(Double.class, new DoubleRenderer());
@ -80,21 +82,10 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
editbysingleclick(dataJTable, Integer.class);
// 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.setRowSelectionAllowed(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() {
public void mousePressed(MouseEvent e) {
// kel:加上一个鼠标点击的监控,鼠标点击时,返回选中的行坐标和列坐标。
@ -114,14 +105,17 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
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');
northPane.add(columnSetButton);
columnSetButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
@ -140,7 +134,6 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
dataJTable.repaint();
}
};
BasicDialog dlg = columnSetPane.showWindow(DesignerContext.getDesignerFrame(), l);
dlg.setAlwaysOnTop(true);
dlg.setVisible(true);
@ -150,7 +143,6 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// DataSourceEditor-Insert_Row
insertRowButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Insert_Row"));
insertRowButton.setMnemonic('I');
northPane.add(insertRowButton);
insertRowButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
insertRow();
@ -160,7 +152,6 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// DataSourceEditor-Remove_Row
removeRowButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Delete_Row"));
removeRowButton.setMnemonic('R');
northPane.add(removeRowButton);
removeRowButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
removeRow();
@ -169,6 +160,13 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// 初始化时更新按钮状态
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;
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.util.ScaledEmptyBorder;
import com.fr.base.Parameter;
@ -103,7 +103,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private UIRadioButton localFileRadioButton;
private UIRadioButton urlFileRadioButton;
private UITableEditorPane<ParameterProvider> editorPane;
private UILabel tips;
private JPanel tipPanel;
private UIComboBox xmlKyePoint;// xml关键节点
private UIComboBox encodingComboBox;// xml编码
private FileTableData fileTableData;
@ -200,9 +200,11 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
testConnection.setEnabled(false);
testConnection.addActionListener(testConnectionListener);
// 提示信息
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + "txt" + "<br>"
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> ";
tips = new UILabel(tipContent);
tipPanel = column(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter_Desc"), FineUIStyle.LABEL_TIP)),
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(
LayoutConstants.VERTICAL_GAP,
row(
@ -217,7 +219,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
cell(urlText).weight(urlWidthRatio),
cell(testConnection).weight(0.75 - urlWidthRatio)
),
cell(tips)
cell(tipPanel)
).getComponent();
}
@ -497,9 +499,11 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
} else {
rightPanel.add(getTextSetPanel());
}
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + getFileSuffixToString() + "<br>"
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> ";
tips.setText(tipContent);
tipPanel = column(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter_Desc"), FineUIStyle.LABEL_TIP)),
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();
}
};

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);
//以下设置,部分面板通用
UILabel belowSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set"));
buttonPane = row(32,
cell(belowSetLabel),
cell(chooseComboBox),
flex()
).with(it -> it.setBorder(new ScaledEmptyBorder(0,10,0,0))).getComponent();
buttonPane = row(32, cell(belowSetLabel), cell(chooseComboBox), flex()).getComponent();
this.setLayout(new BorderLayout());
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.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.TemplateUtils;
@ -26,6 +27,7 @@ import static com.fine.swing.ui.layout.Layouts.cell;
*/
public class TemplateListMenuItem extends Row {
private static final String UI_CLASS_ID = "TemplateListMenuItemUI";
private static final String UNSAVED_SUFFIX = " *";
private static final int WIDTH = 200;
@ -55,10 +57,17 @@ public class TemplateListMenuItem extends Row {
* item[1] 切换模板按钮初始化
*/
private UIButton createTemplateButton(JTemplate<?, ?> template) {
String templateName = template.getTemplateName();
if (!template.isSaved() && !templateName.endsWith(UNSAVED_SUFFIX)) {
templateName += UNSAVED_SUFFIX;
}
UIButton button = new UIButton(
TemplateUtils.createLockeTemplatedName(template, template.getTemplateName()), template.getIcon());
TemplateUtils.createLockeTemplatedName(template, templateName), template.getIcon());
button.setContentAreaFilled(false);
button.setHorizontalAlignment(SwingConstants.LEFT);
if (template == HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()) {
button.setForeground(UIConstants.FLESH_BLUE);
}
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
initFormulaTextArea();
UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea);
formulaTextArea.setBorder(null);
formulaTextAreaScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
// buttonPane

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

@ -1,5 +1,6 @@
package com.fr.design.gui.controlpane;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.border.FineBorderFactory;
@ -29,7 +30,7 @@ import java.util.stream.Stream;
* Time: 15:07
*/
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 EDIT = "EDIT";
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);
}
};
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.setFont(label.getFont().deriveFont(11F));
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;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.stable.Nameable;
@ -43,7 +44,7 @@ public class UINameableListCellRenderer extends
private void initComponents() {
editButton = new UILabel() {
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);

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.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.CardLayout;
@ -164,11 +165,20 @@ public class FineTabbedPane extends Box {
private void initListeners() {
tabGroup.addChangeListener((e) -> {
cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem()));
// tab切换时触发事件
fireStateChanged();
});
tabGroup.setSelectedIndex(0);
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.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.border.Border;
import java.awt.AWTEvent;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.AWTEventListener;
@ -326,27 +319,7 @@ public abstract class UIBubbleFloatPane<T> extends BasicBeanPane<T> {
final JPanel contentPane = (JPanel) this.getContentPane();
this.setLayout(null);
contentPane.add(UIBubbleFloatPane.this);
contentPane.setBorder(new Border() {
@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;
}
});
contentPane.setBorder(null);
}
/**

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

@ -1,5 +1,6 @@
package com.fr.design.gui.icombobox;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.ChartColorMatching;
import com.fr.base.ChartPreStyleConfig;
import com.fr.base.theme.TemplateTheme;
@ -232,7 +233,7 @@ public class ColorSchemeComboBox extends UIComboBox {
@Override
public Dimension getPreferredSize() {
Dimension preferredSize = super.getPreferredSize();
preferredSize.setSize(super.getPreferredSize().getWidth(), HEIGHT);
preferredSize.setSize(super.getPreferredSize().getWidth(), FineUIScale.scale(HEIGHT));
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;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.gui.core.UITextComponent;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.StringUtils;
@ -37,6 +38,11 @@ public class UILabel extends JLabel implements UITextComponent {
super(text);
}
public UILabel(String text, String style) {
super(text);
FineUIStyle.setStyle(this, style);
}
public UILabel(String text, boolean enable) {
super(text);
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;
import com.fine.theme.utils.FineUIStyle;
import com.fr.general.NameObject;
import com.fr.stable.Nameable;
import javax.swing.ListModel;
import java.awt.Point;
import static com.fine.theme.utils.FineUIStyle.setStyle;
/**
* Created by plough on 2017/7/23.
*/
@ -14,6 +17,7 @@ public class UINameEdList extends JNameEdList {
protected UINameEdList(ListModel dataModel) {
super(dataModel);
setStyle(this, FineUIStyle.NO_BORDER_LIST);
}
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) {
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 x = insets.left;
@ -195,13 +195,13 @@ public class UIScrollPopUpMenu extends UIPopupMenu {
if ((comp instanceof UIScrollBar) && comp.isVisible()) {
UIScrollBar scrollBar = (UIScrollBar) comp;
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;
position = scrollBar.getValue();
}
}
y -= position;
y = insets.top - position;
for (Component comp : parent.getComponents()) {
if (!(comp instanceof UIScrollBar) && comp.isVisible()) {
Dimension pref = comp.getPreferredSize();
@ -209,7 +209,6 @@ public class UIScrollPopUpMenu extends UIPopupMenu {
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.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.folding.Fold;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.folding.FoldManager;
@ -318,6 +319,7 @@ private boolean fractionalFontMetricsEnabled;
* Constructor.
*/
public RSyntaxTextArea() {
initBorder();
}
@ -328,6 +330,7 @@ private boolean fractionalFontMetricsEnabled;
*/
public RSyntaxTextArea(RSyntaxDocument doc) {
super(doc);
initBorder();
}
/**
@ -337,6 +340,7 @@ private boolean fractionalFontMetricsEnabled;
*/
public RSyntaxTextArea(String text) {
super(text);
initBorder();
}
@ -350,6 +354,7 @@ private boolean fractionalFontMetricsEnabled;
*/
public RSyntaxTextArea(int rows, int cols) {
super(rows, cols);
initBorder();
}
@ -364,6 +369,7 @@ private boolean fractionalFontMetricsEnabled;
*/
public RSyntaxTextArea(String text, int rows, int cols) {
super(text, rows, cols);
initBorder();
}
@ -379,6 +385,7 @@ private boolean fractionalFontMetricsEnabled;
*/
public RSyntaxTextArea(RSyntaxDocument doc, String text,int rows,int cols) {
super(doc, text, rows, cols);
initBorder();
}
@ -390,6 +397,7 @@ private boolean fractionalFontMetricsEnabled;
*/
public RSyntaxTextArea(int 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

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

@ -974,6 +974,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public void resetButtonIcon() {
button.setBackground(new Color(0, 0, 0, 0));
button.setSelected(false);
if (iconSuffix.equals(ICON_SUFFIX_SELECTED)) {
iconSuffix = ICON_SUFFIX_NORMAL;
button.setIcon(new LazyIcon(getBtnIconId(), ICON_WIDTH));
@ -994,8 +995,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
iconSuffix = ICON_SUFFIX_SELECTED_DEPRECATED;
button.setIcon(IconUtils.readIcon(getBtnIconUrl()));
}
button.setBackground(selectedBtnBackground);
button.setOpaque(true);
button.setSelected(true);
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;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.FRContext;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
@ -54,8 +54,8 @@ public class ChartFontPane extends BasicPane {
private void initState() {
fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report());
fontSizeComboBox = new UIComboBox(FONT_SIZES);
bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"));
italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"));
bold = new UIToggleButton(new LazyIcon("bold"));
italic = new UIToggleButton(new LazyIcon("italic"));
fontColor = getColorButton();
}
@ -65,11 +65,10 @@ public class ChartFontPane extends BasicPane {
protected void initComponents() {
Component[] components = new Component[]{
fontColor, italic, bold
fontSizeComboBox, fontColor, italic, bold
};
JPanel buttonPane = new JPanel(new BorderLayout());
buttonPane.add(fontSizeComboBox, BorderLayout.CENTER);
buttonPane.add(GUICoreUtils.createFlowPane(components, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.EAST);
JPanel buttonPane = new JPanel();
buttonPane.add(GUICoreUtils.createFlowPane(components, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE));
this.setLayout(new BorderLayout());
this.add(getContentPane(buttonPane), BorderLayout.CENTER);
@ -90,7 +89,7 @@ public class ChartFontPane extends BasicPane {
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() {

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.style.FRFontPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.color.NewColorSelectPane;
import javax.swing.SwingUtilities;
@ -80,16 +79,15 @@ public class WatermarkPane extends BasicPane {
private void initComponents() {
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.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
watermarkPreviewPane = new WatermarkPreviewPane();
watermarkPreviewPane.setOpaque(false);
previewPaneWrapper.add(watermarkPreviewPane, BorderLayout.CENTER);
previewPaneWrapper.add(watermarkPreviewPane);
leftPane = column(
LayoutConstants.VGAP_SMALL,
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,
cell(leftPane).weight(0.55),
cell(wrapComponentWithTitle(getRightPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Config"))).weight(0.45)
)
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 10))
).weight(1)
).getComponent();
this.add(centerPanel, BorderLayout.CENTER);
this.add(centerPanel);
}
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) {
Component[] ecComponents = new Component[fitAttrModel.getFitTypeNames().length + 1];
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;
}
@ -139,13 +139,9 @@ public class FormFitConfigPane extends ReportFitConfigPane {
}
private JPanel createTipPane() {
JPanel jPanel = new JPanel(new BorderLayout());
UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip1"));
FineUIStyle.setStyle(label1, FineUIStyle.LABEL_TIP);
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;
return column(cell(new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip1"), FineUIStyle.LABEL_TIP)),
cell(new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip2"), FineUIStyle.LABEL_TIP))
).getComponent();
}
protected void refreshPreviewJPanel() {

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

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

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

@ -1,8 +1,11 @@
package com.fr.file;
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.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
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.i18n.Toolkit;
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.DesignerFrameFileDealerPane;
import com.fr.design.mainframe.JTemplate;
@ -86,7 +87,6 @@ import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.Window;
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.flex;
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.WARNING_MESSAGE;
@ -1788,10 +1789,6 @@ public class FILEChooserPane extends BasicPane {
UILabel newNameLabel = new UILabel(Toolkit.i18nText(
"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.getDocument().addDocumentListener(new DocumentListener() {
@ -1809,12 +1806,9 @@ public class FILEChooserPane extends BasicPane {
}
});
nameField.selectAll();
nameField.setPreferredSize(new Dimension(180, 20));
JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5));
topPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 0, 15));
topPanel.add(newNameLabel);
topPanel.add(nameField);
JPanel topPanel = FineLayoutBuilder.createHorizontalLayout(10, new double[]{1,1},
newNameLabel, nameField
);
// 增加enter以及esc快捷键的支持
nameField.addKeyListener(new KeyAdapter() {
@ -1831,54 +1825,32 @@ public class FILEChooserPane extends BasicPane {
});
// 重名提示
warnLabel = new UILabel();
warnLabel.setPreferredSize(new Dimension(300, 30));
warnLabel.setHorizontalAlignment(SwingConstants.LEFT);
warnLabel.setForeground(Color.RED);
FineUIStyle.setStyle(warnLabel, FineUIStyle.LABEL_WARNING_TIP);
warnLabel.setVisible(false);
JPanel midPanel = new JPanel(new BorderLayout());
midPanel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 15));
midPanel.add(warnLabel, BorderLayout.WEST);
// 确认按钮
confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm"));
confirmButton.setPreferredSize(new Dimension(60, 25));
confirmButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
confirmClose();
}
});
confirmButton.addActionListener(e -> confirmClose());
// 取消按钮
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));
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);
this.setSize(340, 180);
JPanel bottomPanel = FineComponentsFactory.createConfirmCancelButtonPane(confirmButton, cancelButton);
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(scale(new Dimension(360, 180)));
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Mkdir"));
this.setResizable(false);
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
@BrandPressedColor = #105DD1
@BrandHoverColorSP = #2576EF 12%
@BrandTipColor = #0a1c3877
@BrandTipColor = #0A1C3877
@marginSmall = 4
@marginLarge = 10
@ -404,6 +404,7 @@ Label.borderColor = $defaultBorderColor
Label.hyperLinkColor = #2576EF
Label.strongHintColor = #FF0000
Label.warningColor = #F1393C
Label.secondaryColor = #0A1C38A8
#---- HelpButton ----
@ -426,7 +427,7 @@ HelpButton.innerFocusWidth = $?Button.innerFocusWidth
#---- List ----
List.border = 0,0,0,0
List.border = 4,0,4,0
List.cellMargins = 1,12,1,12
List.selectionInsets = 0,4,0,4
List.selectionArc = 2
@ -1166,7 +1167,7 @@ HeaderPane.height=$Component.defaultHeight
#---- East ----
East.border = $defaultBorderColor
East.TabSelectedColor = #B3CFF9
East.TabSelectedColor = @selectionBackground
#---- South ----
South.SheetTabRadius = 6
@ -1194,6 +1195,7 @@ Center.ZoneBorderColor = #E6E9EF
Center.GridColumnRowColor=#e8e8e9
Center.GridColumnRowSelectedColor=fade(@BrandColor, 12%)
Center.GridColumnRowEditedColor=#e9ecf1
Center.GridCornerFill=fade(#0A1C38, 47%)
Center.SpaceColor = #FFF
Center.border = 0, 10, 10, 10
Center.arc=10
@ -1338,6 +1340,9 @@ chart.selectedBorderColor = #2576EF
[style]Label.warningTipLabel = \
foreground: $Label.warningColor
[style]Label.secondaryLabel = \
foreground: $Label.secondaryColor
[style]Label.uiListLabel = \
foreground: $List.wrapper.text.fontColor; \
background: $background.normal
@ -1359,6 +1364,9 @@ chart.selectedBorderColor = #2576EF
[style]List.pureList = \
background: $fill.normal
[style]List.noBorderList = \
border: 0,0,0,0
[style]Tree.pureTree = \
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;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
@ -30,7 +31,7 @@ import java.util.HashMap;
*/
public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPoplink> {
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 ChartHyperEditPane hyperEditPane;
private ChartComponent chartComponent;
@ -55,7 +56,7 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
ChartCollection cc = createChartCollection();
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.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;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
@ -107,7 +108,7 @@ public class MarkerComboBox extends UIComboBox {
}
public Dimension getPreferredSize() {
return new Dimension(36, 16);
return FineUIScale.scale(new Dimension(36, 16));
}
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.
*/
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
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.ilable.UILabel;
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.stable.StableUtils;
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.SwingConstants;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@ -44,20 +40,16 @@ import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale;
import static com.fr.design.i18n.Toolkit.i18nText;
/**
* 图表切换设置面板
*/
public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
private static final int WIDTH = 100;
private static final int EDIT_AREA_WIDTH = 180;
private static final int LABEL_WIDTH = 20;
private static final int WIDTH = scale(100);
private static final int MIN_TIME = 0;
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 JPanel contentPane;
//配置方式按钮
@ -84,7 +76,7 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
public ChangeConfigPane() {
init();
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);
}
@ -101,20 +93,15 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
initButtonGroup();
configPane = createConfigPane();
contentPane = createContentPane();
contentPane.setBorder(BorderFactory.createEmptyBorder(CONSTANT_TEN, CONSTANT_THIRTY, CONSTANT_TEN, CONSTANT_THIRTY));
}
private JPanel createContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(i18nText("Fine-Design_Chart_Change_Style")), configStyleButton},
new Component[]{configPane, null},
new Component[]{createButtonContentPane(), null}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
private JPanel createConfigPane() {
@ -136,39 +123,29 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
panel.add(buttonConfigPane, "button");
panel.add(carouselConfigPane, "carousel");
panel.setBorder(BorderFactory.createEmptyBorder(CONSTANT_ZERO, CONSTANT_TEN, CONSTANT_ZERO, CONSTANT_ZERO));
return panel;
}
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);
colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH);
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[][]{
new Component[]{new UILabel(i18nText("Fine-Design_Chart_Arrow_Style")), switchStyleGroup, null},
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_Basic_Background")), colorSelectBox4carousel, null}
new Component[]{new UILabel(i18nText("Fine-Design_Chart_Arrow_Style")), switchStyleGroup},
new Component[]{new UILabel(i18nText("Fine-Design_Chart_Time_Interval")), timeIntervalPane},
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() {
final UILabel text = new UILabel(i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT);
styleAttrPane = new ChartTextAttrPane() {
protected JPanel getContentPane(JPanel buttonPane) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, EDIT_AREA_WIDTH};
double[] rowSize = {p, p};
return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, getComponents(buttonPane), new double[]{1.2, 3});
}
protected Component[][] getComponents(JPanel buttonPane) {
@ -184,54 +161,44 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
private JPanel createButtonBackgroundColorPane() {
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() {
JPanel buttonContentPane = new JPanel(new BorderLayout());
JPanel buttonContentPane = new JPanel(new BorderLayout(0, scale(10)));
chartTypesPane = new JPanel();
chartTypesPane.setLayout(new BoxLayout(chartTypesPane, BoxLayout.Y_AXIS));
chartTypesPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
chartTypesPane.setLayout(new BorderLayout());
switchTitlePane.setLayout(new CardLayout());
JPanel titleEditPane = TableLayout4VanChartHelper.createGapTableLayoutPane(
i18nText("Fine-Design_Chart_Switch_Title_Label"),
switchTitlePane,
EDIT_AREA_WIDTH
JPanel titleEditPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(i18nText("Fine-Design_Chart_Switch_Title_Label")),
switchTitlePane
);
titleEditPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
buttonContentPane.add(chartTypesPane, BorderLayout.NORTH);
buttonContentPane.add(titleEditPane, BorderLayout.CENTER);
UIExpandablePane expandablePane = new UIExpandablePane(i18nText("Fine-Design_Chart_Button_And_Rotation_Content"), buttonContentPane) {
protected void setcontentPanelontentPanelBorder() {
}
};
expandablePane.setBorder(BorderFactory.createEmptyBorder(20, 0, 0, 0));
return expandablePane;
return new UIExpandablePane(i18nText("Fine-Design_Chart_Button_And_Rotation_Content"), buttonContentPane);
}
private void populateButtonContentPane(ChartCollection collection) {
int count = collection.getChartCount();
int select = collection.getSelectedIndex();
JPanel pane = null;
chartTypesPane.removeAll();
ArrayList<Component> buttons = new ArrayList<>();
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);
changeChartButtons.add(button);
button.setSelected(i == select);
pane.add(button);
buttons.add(button);
populateSwitchTitlePane(i, collection);
}
chartTypesPane.add(FineLayoutBuilder.createCommonTableLayout(COL_COUNT, 10, 10, buttons));
showSwitchTitleCard(collection.getChartName(select));
chartTypesPane.revalidate();
@ -258,22 +225,17 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
}
private JPanel createButtonConfigPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{createTitleStylePane(), null},
new Component[]{createButtonBackgroundColorPane(), null},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
private void initButtonGroup() {
configStyleButton = new UIButtonGroup<Integer>(new String[]{i18nText("Fine-Design_Chart_Button_Style"),
i18nText("Fine-Design_Chart_Carousel_Style")});
configStyleButton.setPreferredSize(new Dimension(WIDTH * 2, (int) configStyleButton.getPreferredSize().getHeight()));
configStyleButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -359,8 +321,6 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
}
private class ChangeChartButton extends UIToggleButton {
private static final int BUTTON_WIDTH = 52;
private static final int BUTTON_HEIGHT = 20;
private ChartCollection collection;
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() {

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.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIConstants;
import com.fine.theme.utils.FineUIStyle;
import com.fr.base.BaseUtils;
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 {
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 P_W = 300;
private static final int P_H = 400;
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);
}

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,
row(cell(label).weight(1.2), cell(preDataNum).weight(3)),
cell(combineOther)
).getComponent();
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 0))).getComponent();
preDataNumPane.setVisible(false);
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.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIConstants;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
@ -26,6 +27,7 @@ import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* 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.setModal(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 {
private static final long serialVersionUID = 1614283200308877353L;
private static final int WIDTH = 165;
private static final int HEIGHT = 100;
private static final int WIDTH = FineUIScale.scale(165);
private static final int HEIGHT = FineUIScale.scale(100);
private static final int GAP = 20;
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.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButton;
@ -214,7 +215,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane<VanChartAxisPlot> {
}
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 BufferedImage closeIcon = BaseUtils.readImageWithCache("com/fr/design/images/toolbarbtn/chartChangeClose.png");
private boolean isMoveOn = false;
@ -231,7 +232,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane<VanChartAxisPlot> {
}
public Dimension getPreferredSize() {
return new Dimension(B_W, B_H);
return FineUIScale.scale(new Dimension(B_W, B_H));
}
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;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane;
@ -35,6 +36,7 @@ public class VanChartMapLayerAndDataTabPane extends MultiTabPane<ChartCollection
private void initComponents() {
super.relayoutWhenListChange();
setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
}
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;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.beans.BasicBeanPane;
@ -50,6 +51,7 @@ public class DrillMapDataPane extends BasicBeanPane<ChartCollection> {
};
this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
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;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
@ -52,7 +54,6 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
@Override
protected void layoutContentPane() {
leftcontentPane = createContentPane();
leftcontentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(leftcontentPane);
}
@ -67,26 +68,13 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
JPanel mapDataTreePanel = new JPanel(new BorderLayout());
mapDataTreePanel.add(mapDataTree);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Tree"), mapDataTreePanel)},
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_Tree"), mapDataTreePanel, true)},
new Component[]{new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Detail"), createLayerDetailPane())}
};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel panel = new JPanel(new BorderLayout());
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;
JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
return FineLayoutBuilder.asBorderLayoutWrapped(contentPane);
}
private JPanel createLayerDetailPane() {
@ -111,7 +99,7 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
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;
import com.fr.design.constants.UIConstants;
import com.fr.design.border.FineBorderFactory;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
@ -17,6 +16,9 @@ import javax.swing.tree.TreePath;
import java.awt.Component;
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.
*/
@ -30,8 +32,9 @@ public class MapDataTree extends JTree {
this.setRootVisible(false);
this.setShowsRootHandles(true);
this.setInvokesStopCellEditing(true);
this.setBackground(UIConstants.NORMAL_BACKGROUND);
this.setCellRenderer(treeCellRenderer);
setBorder(FineBorderFactory.createWrappedRoundBorder());
setStyle(this, PURE_TREE);
}
private DefaultTreeModel model = new DefaultTreeModel(null);
@ -114,10 +117,6 @@ public class MapDataTree extends JTree {
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value;
String name = getPresentName(treeNode);
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;
}
};

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

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

@ -53,28 +53,28 @@ public class ImageExportPane extends AbstractExportPane {
public ImageExportPane() {
this.setLayout(new BorderLayout());
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips"));
FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
initGlobalSettings();
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.globalResolutionBtnM).weight(0.4),
cell(this.globalResolutionBtnL).weight(0.4),
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.globalFormatPng).weight(0.4),
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.globalRenderSpeed).weight(0.4),
flex()),
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting") + ":")).weight(0.4),
cell(this.templateThumbnail).weight(0.8),
cell(this.templatePaging).weight(0.4),
flex()),
cell(tipLabel)
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.templatePaging).weight(0.4),
flex()),
cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips"), FineUIStyle.LABEL_TIP))
)
).getComponent();
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);
marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP,
row(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_Top_Duplicate"))), cell(marginTopUnitFieldPane)),
row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom"))), cell(marginBottomUnitFieldPane))
).getComponent();
// peter:这个一个垂直的上下的字符panel.
marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel marginRightPane = column(LayoutConstants.VERTICAL_GAP,
row(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_Basic_Left"))), cell(marginLeftUnitFieldPane)),
row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Right"))), cell(marginRightUnitFieldPane))
).getComponent();
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 twoPane = row(10,
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)
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(marginPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Margin"))).weight(0.8)
).getComponent();
//高度
headerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
footerUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
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),
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();
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 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
*/
@ -72,9 +76,8 @@ public class UnitFieldPane extends JPanel {
textField = ((JSpinner.DefaultEditor) valueSpinner.getEditor()).getTextField();
textField.setColumns(OperatingSystem.isWindows() ? TEXT_FIELD_COLUMNS_WINDOWS : TEXT_FIELD_COLUMNS);
InputEventBaseOnOS.addBasicEditInputMap(textField);
this.add(valueSpinner);
unitLable = new UnitLabel(unitType, valueSpinner.getPreferredSize().height);
this.add(unitLable);
this.add(row(cell(valueSpinner), fix(4), cell(unitLable)).getComponent());
}
public JFormattedTextField getTextField() {

9
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);
this.setLayout(new BorderLayout());
this.add(row(LayoutConstants.HORIZONTAL_GAP,
cell(new UILabel(title)),
cell(horizonRadio),
cell(verticalRadio),
cell(bidirectionalRadio),
cell(notFitRadio)
this.add(row(20,
cell(new UILabel(title)),
row(LayoutConstants.HORIZONTAL_GAP, cell(horizonRadio), cell(verticalRadio), cell(bidirectionalRadio), cell(notFitRadio))
).getComponent());
}

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

@ -1,6 +1,5 @@
package com.fr.design.report.mobile;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icontainer.UIScrollPane;
@ -37,14 +36,14 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
appFitBrowserPane = new AppFitBrowserPane();
appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane);
//移动端属性整体面板
//移动端属性整体面板,不同分组间距20px
JPanel panel = new JPanel(new BorderLayout());
panel.add(column(LayoutConstants.VERTICAL_GAP,
panel.add(column(LayoutConstants.VGAP_HUGER,
cell(reportMobileTemplateSettingsPane),
cell(appFitBrowserPane),
cell(mobileOthersPane = new MobileOthersPane()),
cell(appFitPreviewPane)
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent());
).getComponent());
UIScrollPane scrollPane = new UIScrollPane(panel);
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.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.mobile.ElementCaseMobileAttr;
@ -40,29 +39,17 @@ public class ReportMobileTemplateSettingsPane extends BasicBeanPane<ElementCaseM
private JPanel getMobileCanvasSizeCheckPane() {
JPanel panel = new JPanel(new BorderLayout());
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(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());
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
public void populateBean(ElementCaseMobileAttr ob) {
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.web.attr.ReportWebAttr;
import javax.swing.*;
import javax.swing.JPanel;
import java.util.ArrayList;
import java.util.Arrays;
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.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.fix;
public class ViewWebSettingPane extends WebSettingPane<WebView> {
private UICheckBox sortCheckBox;
@ -39,11 +40,9 @@ public class ViewWebSettingPane extends WebSettingPane<WebView> {
sortCheckBox.setSelected(true);
conditionFilterBox.setSelected(true);
listFilterBox.setSelected(true);
return row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview"))).weight(0.15),
cell(sortCheckBox).weight(0.15),
cell(conditionFilterBox).weight(0.15),
cell(listFilterBox).weight(0.15),
flex(0.4)
return row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview"))).weight(0.15),
row(cell(sortCheckBox), fix(12), cell(conditionFilterBox), fix(12), cell(listFilterBox), flex()).weight(0.85)
).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.web.attr.ReportWebAttr;
import javax.swing.*;
import javax.swing.JPanel;
import javax.swing.ButtonGroup;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
@ -84,7 +85,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
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"));

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());
// 份数
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"));
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),
cell(copySpinner).weight(0.15),
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),
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),
flex(0.4)),
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.setUnitValue(DEFAULT_PAPERSIZE.getHeight());
customPaperSizePane = row(LayoutConstants.HORIZONTAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width") + ":")),
customPaperSizePane = row(24,
row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Designer_Width"))),
cell(customWidthFieldPane)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height") + ":")),
row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height"))),
cell(customHeightFieldPane)
)
).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);
marginBottomUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel marginLeftPane = column(LayoutConstants.VERTICAL_GAP,
row(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_Top_Duplicate"))), cell(marginTopUnitFieldPane)),
row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bottom"))), cell(marginBottomUnitFieldPane))
).getComponent();
// peter:这个一个垂直的上下的字符panel.
marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
marginRightUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);
JPanel marginRightPane = column(LayoutConstants.VERTICAL_GAP,
row(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_Basic_Left"))), cell(marginLeftUnitFieldPane)),
row(LayoutConstants.HGAP_LARGE, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Right"))), cell(marginRightUnitFieldPane))
).getComponent();
JPanel marginPane = row(LayoutConstants.HORIZONTAL_GAP,
cell(marginLeftPane),
cell(marginRightPane)).getComponent();
JPanel marginPane = row(24, cell(marginLeftPane), cell(marginRightPane)).getComponent();
this.setLayout(new BorderLayout());
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)));
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.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) {
return eastRegion ? new EastCellWidgetCardPane(pane) : new CellWidgetCardPane(pane);
return new EastCellWidgetCardPane(pane);
}
protected JPanel createContentPane() {

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

@ -3,6 +3,7 @@
*/
package com.fr.grid;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.GraphHelper;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerUIModeConfig;
@ -70,14 +71,14 @@ public class GridCorner extends BaseGridComponent {
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 width = 2 * time;
float hgap = 4 * time;
float vgap = 3 * time;
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 j = 0; j < 3; j++) {
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;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.Style;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.ImageCellAction;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListPane;
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.JTemplate;
import com.fr.design.report.SelectImagePane;
@ -17,11 +16,6 @@ import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.cell.cellattr.CellImage;
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
public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
UIButton editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"));
editButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
showEditingDialog();
}
});
editButton.addActionListener(e -> showEditingDialog());
editButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{EMPTY_LABEL, editButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content;
return FineLayoutBuilder.asBorderLayoutWrapped(editButton);
}
private void showEditingDialog() {

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

@ -1,19 +1,14 @@
package com.fr.quickeditor.cellquick;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.RichTextCellAction;
import com.fr.design.constants.UIConstants;
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 javax.swing.Icon;
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
public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
richTextButton = new UIButton();
richTextButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{EMPTY_LABEL, richTextButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content;
return FineLayoutBuilder.asBorderLayoutWrapped(richTextButton);
}
@Override

Loading…
Cancel
Save