Browse Source

Pull request #14750: REPORT-132799 & REPORT-131838 & REPORT-132389 & REPORT-132382 & REPORT-132380 & REPORT-132375 & REPORT-132357 & REPORT-132231 & REPORT-132227【newUI】fix:国际化布局调整及Tab统一修复/fbp回归问题修复

Merge in DESIGN/design from ~RICHARD.FANG/design:fbp/release to fbp/release

* commit '3bdd7d1858fb06f6166d3fc68ea2ee9f2a3aaba2':
  REPORT-132799 & REPORT-131838 & REPORT-132389 & REPORT-132382 & REPORT-132380 & REPORT-132375 & REPORT-132357 & REPORT-132231 & REPORT-132227【newUI】fix:国际化布局调整及Tab统一修复/fbp回归问题修复
  REPORT-132799 & REPORT-131838 & REPORT-132389 & REPORT-132382 & REPORT-132380 & REPORT-132375 & REPORT-132357 & REPORT-132231 & REPORT-132227【newUI】fix:国际化布局调整及Tab统一修复/fbp回归问题修复
fbp/merge
Richard.Fang-方超 4 months ago
parent
commit
f4cdd8d55e
  1. 11
      designer-base/src/main/java/com/fine/theme/light/ui/FineToggleButtonUI.java
  2. 1
      designer-base/src/main/java/com/fine/theme/utils/FineClientProperties.java
  3. 18
      designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java
  4. 2
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  5. 3
      designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java
  6. 3
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java
  7. 48
      designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java
  8. 53
      designer-base/src/main/java/com/fr/design/gui/ibutton/FitUIButtonGroup.java
  9. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java
  10. 16
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java
  11. 3
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java
  12. 3
      designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java
  13. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  14. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  15. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  16. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  17. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  18. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java
  19. 15
      designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java
  20. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHeatValueColorPane.java
  21. 10
      designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java
  22. 5
      designer-realize/src/main/java/com/fr/design/actions/report/ReportPrintSettingAction.java
  23. 2
      designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java
  24. 3
      designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java
  25. 20
      designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java
  26. 5
      designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java
  27. 40
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java
  28. 5
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java

11
designer-base/src/main/java/com/fine/theme/light/ui/FineToggleButtonUI.java

@ -22,6 +22,7 @@ import java.awt.Shape;
import java.awt.Rectangle;
import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE_GROUP;
import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE_GROUP_FIT;
import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE;
import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE_TAB;
import static com.fine.theme.utils.FineClientProperties.BUTTON_GROUP_POSITION;
@ -96,12 +97,20 @@ public class FineToggleButtonUI extends FlatToggleButtonUI {
}
static boolean isGroupButton(Component c) {
if (!(c instanceof UIButton)) {
return false;
}
String buttonType = getButtonTypeStr((UIButton) c);
return BUTTON_TYPE_GROUP.equals(buttonType) || BUTTON_TYPE_GROUP_FIT.equals(buttonType);
}
static boolean isGroupButtonNotFit(Component c) {
return c instanceof UIButton && BUTTON_TYPE_GROUP.equals(getButtonTypeStr((UIButton) c));
}
@Override
public void paint(Graphics g, JComponent c) {
if (isGroupButton(c) || isTabButton(c)) {
if (isGroupButtonNotFit(c) || isTabButton(c)) {
((AbstractButton)c).setMargin(FineUIUtils.getUIInsets("ToggleButton.compact.margin", "ToggleButton.margin"));
}
super.paint(g, c);

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

@ -13,6 +13,7 @@ public interface FineClientProperties extends FlatClientProperties {
//--------------------------- ButtonGroup -----------------------
String BUTTON_TYPE_GROUP = "group";
String BUTTON_TYPE_GROUP_FIT = "groupFit";
String BUTTON_BORDER = "buttonBorder";
String BUTTON_BORDER_LEFT_ROUND_RECT = "leftRoundRect";

18
designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java

@ -6,7 +6,7 @@ import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.mainframe.theme.edit.ui.LabelUtils;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.stable.os.OperatingSystem;
import com.fr.value.AtomicClearableLazyValue;
@ -15,6 +15,7 @@ import javax.swing.JLabel;
import javax.swing.JLayer;
import javax.swing.ScrollPaneConstants;
import javax.swing.UIManager;
import javax.swing.JTextArea;
import java.awt.Color;
import java.awt.Component;
import java.awt.Composite;
@ -450,16 +451,11 @@ public class FineUIUtils {
}
/**
* 创建一个支持自动换行的 UILabel并应用指定样式
*
* @param text 要显示的文本内容
* @param style 样式字符串
* @return 支持自动换行的 UILabel
* 创建一个支持自动换行的提示文本
* @param text 显示的文本内容
* @return 自动换行提示文本
*/
public static UILabel createLineWrapLabel(String text, String style) {
UILabel label = new UILabel(text);
FineUIStyle.setStyle(label, style);
UIComponentUtils.setLineWrap(label);
return label;
public static JTextArea createAutoWrapTipLabel(String text) {
return LabelUtils.createAutoWrapLabel(text, FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption"));
}
}

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

@ -48,7 +48,6 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig;
import com.fr.io.attr.ImageExportAttr;
@ -347,6 +346,7 @@ public class PreferencePane extends BasicPane {
.addTab(i18nText("Fine-Design_Basic_General"), generalScrollPane)
.addTab(i18nText("Fine-Design_Basic_Advanced"), adviceScrollPane)
.addTab(i18nText("Fine-Design_Vcs_Title"), vcsParentPane)
.withAdaptiveFit()
.build();
contentPane.add(tabbedPane, BorderLayout.CENTER);

3
designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java

@ -53,7 +53,8 @@ public class AdvancePane extends BasicPane {
flex(2)
),
row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow"), SwingConstants.LEFT)).weight(1),
cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow"), SwingConstants.LEFT))
.with(it -> it.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow"))).weight(1),
cell(DBCP_TEST_ON_BORROW).weight(1.5),
flex(2)
),

3
designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java

@ -15,6 +15,7 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.theme.edit.ui.LabelUtils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
@ -83,7 +84,7 @@ public class DBCPAttrPane extends BasicPane {
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Evictionruns_millis"))).weight(1), cell(DBCP_TIMEBETWEENEVICTIONRUNSMILLS).weight(1)),
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Num_Test_Per_Evction_Run"))).weight(1), cell(DBCP_NUMTESTSPEREVICTIONRUN).weight(1)),
row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Mix_Evictable_Idle_Time_Millis"))).weight(1), cell(DBCP_MINEVICTABLEIDLETIMEMILLIS).weight(1)),
cell(FineUIUtils.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Dbcp_Warning"), FineUIStyle.LABEL_WARNING_TIP))
cell(LabelUtils.createAutoWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Dbcp_Warning"), FineUIUtils.getUIColor("Label.warningColor", "Label.warningColor")))
).getComponent();
defaultPane.add(northFlowPane);
this.add(defaultPane);

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

@ -4,9 +4,14 @@ import com.fine.swing.ui.layout.Box;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.ibutton.FitUIButtonGroup;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.utils.ColorUtils;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
@ -42,15 +47,15 @@ public class FineTabbedPane extends Box {
private final UIButtonGroup<String> tabGroup;
private final Map<String, JComponent> tabComponents;
private final int[] tabLayout;
private final boolean useFitTab ;
private FineTabbedPane(Map<String, JComponent> tabComponents, float headRatio, int[] tabLayout) {
private FineTabbedPane(Map<String, JComponent> tabComponents, float headRatio, int[] tabLayout, boolean useFitTab) {
this.headRatio = headRatio;
this.tabComponents = tabComponents;
this.tabLayout = tabLayout;
this.useFitTab = useFitTab;
String[] titleArray = tabComponents.keySet().toArray(new String[0]);
this.tabGroup = new UIButtonGroup<>(titleArray, titleArray, tabLayout);
this.tabGroup = useFitTab ? new FitUIButtonGroup<>(titleArray, titleArray, tabLayout) : new UIButtonGroup<>(titleArray, titleArray, tabLayout);
initLayout();
initListeners();
}
@ -71,6 +76,7 @@ public class FineTabbedPane extends Box {
private int[] tabLayout;
private float headRatio = 0.5f;
private final Map<String, JComponent> tabComponents = new LinkedHashMap<>();
private boolean useFitTab = false;
/**
* 设置头部居中比例0-1之间
@ -94,6 +100,16 @@ public class FineTabbedPane extends Box {
return this;
}
/**
* 设置使用自适应文本Tab
*
* @return TabPaneBuilder
*/
public TabPaneBuilder withAdaptiveFit() {
this.useFitTab = true;
return this;
}
/**
* 添加tab标签
*
@ -122,7 +138,7 @@ public class FineTabbedPane extends Box {
} else if (Arrays.stream(tabLayout).sum() != tabComponents.size()) {
throw new IllegalArgumentException("illegal tab layout argument!");
}
return new FineTabbedPane(tabComponents, headRatio, tabLayout);
return new FineTabbedPane(tabComponents, headRatio, tabLayout, useFitTab);
}
}
@ -131,11 +147,10 @@ public class FineTabbedPane extends Box {
setMatchParentSize(true);
float flexRatio = (1 - headRatio) / 2;
int headHeight = FlatUIUtils.getUIInt("Component.defaultHeight",24) * tabLayout.length / 2;
Component component = useFitTab ? row(flex(), cell(tabGroup), flex()).getComponent() : row(flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio)).getComponent();
add(
column(
row(
flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio)
),
cell(component),
flex()
),
column(
@ -170,6 +185,23 @@ public class FineTabbedPane extends Box {
});
tabGroup.setSelectedIndex(0);
cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem()));
if (!useFitTab) {
initTabListeners();
}
}
private void initTabListeners() {
List<UIToggleButton> tabs = tabGroup.getLabelButtonList();
for (UIToggleButton tab : tabs) {
tab.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
if (tab.getPreferredSize().width > tab.getWidth()) {
tab.setToolTipText(tab.getText());
}
}
});
}
}
private void fireStateChanged() {

53
designer-base/src/main/java/com/fr/design/gui/ibutton/FitUIButtonGroup.java

@ -0,0 +1,53 @@
package com.fr.design.gui.ibutton;
import com.fine.swing.ui.layout.Row;
import java.util.List;
import static com.fine.theme.utils.FineClientProperties.BUTTON_GROUP_POSITION;
import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE_GROUP_FIT;
import static com.formdev.flatlaf.FlatClientProperties.BUTTON_TYPE;
/**
* 自适应文案宽度的ButtonGroup
*
* @author Levy.Xie
* @since 11.0
* Created on 2024/08/28
*/
public class FitUIButtonGroup<T> extends UIButtonGroup<T> {
public FitUIButtonGroup(String[] textArray) {
super(textArray);
}
public FitUIButtonGroup(String[] textArray, T[] objects) {
super(textArray, objects);
}
public FitUIButtonGroup(String[] textArray, T[] objects, int[] customCols) {
super(textArray, objects, customCols);
}
@Override
protected void initLayout(int[] cols, boolean inToolbar) {
Row row = new Row();
List<UIToggleButton> buttonList = getLabelButtonList();
for (int i = 0; i < buttonList.size(); i++) {
row.add(buttonList.get(i));
if (i != buttonList.size() - 1 && !inToolbar) {
row.add(createDivider());
}
}
add(row);
}
@Override
protected void initButton(UIToggleButton labelButton, int index) {
labelButton.setBorderPainted(false);
labelButton.putClientProperty(BUTTON_TYPE, BUTTON_TYPE_GROUP_FIT);
labelButton.putClientProperty(BUTTON_GROUP_POSITION, getGroupButtonPosition(index));
labelButtonList.add(labelButton);
}
}

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java

@ -227,7 +227,7 @@ public class UIButtonGroup<T> extends Column implements GlobalNameObserver, UIOb
}
}
protected List<UIToggleButton> getLabelButtonList() {
public List<UIToggleButton> getLabelButtonList() {
return labelButtonList;
}

16
designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java

@ -5,6 +5,8 @@ import com.fine.swing.ui.layout.Row;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.third.guava.collect.Streams;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;
import javax.swing.Icon;
@ -72,6 +74,20 @@ public class UIHeadGroup extends Row {
add(buttonGroup());
setSelectedIndex(0);
setBorder(new ScaledEmptyBorder(2, 2, 2, 2));
initButtonListeners();
}
private void initButtonListeners() {
for (AbstractButton tab : btns) {
tab.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
if (tab.getPreferredSize().width > tab.getWidth()) {
tab.setToolTipText(tab.getText());
}
}
});
}
}
private Layouts.Cell<?>[] buttonGroup() {

3
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java

@ -10,7 +10,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.vcs.VcsRecycleSettingHelper;
import com.fr.workspace.server.vcs.VcsConfig;
@ -63,7 +62,7 @@ public class RecycleSettingPane extends BasicPane {
FineTabbedPane tabbedPane = FineTabbedPane.builder()
.addTab(Toolkit.i18nText("Fine-Design_Vcs_Recycle_Content"), recycleScrollPane)
.addTab(Toolkit.i18nText("Fine-Design_Basic_Carton_General_Settings"), settingScrollPane)
.withHeadRatio(0.3f).build();
.withAdaptiveFit().build();
this.add(tabbedPane, BorderLayout.CENTER);
}

3
designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java

@ -24,7 +24,6 @@ import com.fr.general.Background;
import com.fr.log.FineLoggerFactory;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
public class BackgroundPane extends BasicPane {
@ -47,7 +46,7 @@ public class BackgroundPane extends BasicPane {
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
initTabPane();
tabbedPane = tabbedPaneBuilder.withHeadRatio(0.65f).build();
tabbedPane = tabbedPaneBuilder.withAdaptiveFit().build();
add(cell(tabbedPane).weight(1).getComponent());
}

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -35,4 +35,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=340*400
com.fr.design.mainframe.EastRegionContainerPane.standard=480*400
com.fr.design.ds.column.cellEditor.pane=900*600
com.fr.design.actions.reportWebAttr.dialog=800*630
com.fr.design.actions.printingSetting.dialog=800*600

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

@ -34,4 +34,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=340*400
com.fr.design.mainframe.EastRegionContainerPane.standard=480*400
com.fr.design.ds.column.cellEditor.pane=900*600
com.fr.design.actions.reportWebAttr.dialog=700*630
com.fr.design.actions.printingSetting.dialog=700*600

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

@ -34,4 +34,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=340*400
com.fr.design.mainframe.EastRegionContainerPane.standard=340*400
com.fr.design.ds.column.cellEditor.pane=900*600
com.fr.design.actions.reportWebAttr.dialog=700*630
com.fr.design.actions.printingSetting.dialog=700*600

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -34,4 +34,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=286*400
com.fr.design.mainframe.EastRegionContainerPane.standard=286*400
com.fr.design.ds.column.cellEditor.pane=700*600
com.fr.design.actions.reportWebAttr.dialog=660*600
com.fr.design.actions.printingSetting.dialog=660*600

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -33,4 +33,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=286*400
com.fr.design.mainframe.EastRegionContainerPane.standard=286*400
com.fr.design.ds.column.cellEditor.pane=700*600
com.fr.design.actions.reportWebAttr.dialog=700*630
com.fr.design.actions.printingSetting.dialog=700*600

4
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe.chart.gui.style.series;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseFormula;
import com.fr.chart.base.AreaColor;
import com.fr.chart.base.ChartBaseUtils;
@ -45,13 +44,12 @@ import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.theme.utils.FineUIScale.scale;
public class UIColorPickerPane extends BasicPane implements UIObserver {
private static final int MARGIN_TOP = scale(7);
private static final int MARGIN_LEFT = scale(5);
private static final int COLORGROUP_MARGIN_LEFT = scale(20);
private static final int COLORGROUP_MARGIN_LEFT = scale(15);
private static final int OFF_HEIGHT = scale(6);
private static final int COLOR_REC_HEIGHT = scale(40);
private static final int COLOR_REC_WIDTH = scale(30);

15
designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java

@ -3,17 +3,13 @@ package com.fr.design.module;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.ChartColorMatching;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.FitUIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
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.style.background.gradient.FixedGradientBarNoTheme;
import com.fr.design.style.color.ColorAdjustPane;
import com.fr.design.style.background.gradient.FixedGradientBar;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.util.ArrayList;
import java.util.Collections;
@ -21,7 +17,6 @@ import java.util.List;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -43,7 +38,7 @@ public class ChartPreFillStylePane extends BasicBeanPane<ChartColorMatching> {
private JPanel changeColorSetPane;
private CardLayout cardLayout;
private UIButtonGroup groupButton;
private FitUIButtonGroup groupButton;
private ColorAdjustPane colorAdjustPane;
private FixedGradientBar colorGradient;
@ -59,7 +54,7 @@ public class ChartPreFillStylePane extends BasicBeanPane<ChartColorMatching> {
}
private void initComponents() {
groupButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"), Toolkit.i18nText("Fine-Design_Chart_Gradient_Color")});
groupButton = new FitUIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"), Toolkit.i18nText("Fine-Design_Chart_Gradient_Color")});
groupButton.setSelectedIndex(0);
changeColorSetPane = new JPanel(cardLayout = new CardLayout());
changeColorSetPane.add(colorGradient = new FixedGradientBarNoTheme(4, 150), "gradient");
@ -76,8 +71,8 @@ public class ChartPreFillStylePane extends BasicBeanPane<ChartColorMatching> {
10,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color_Match"))),
row(
cell(groupButton).weight(0.1),
flex(0.2)
cell(groupButton),
flex()
),
row(
cell(changeColorSetPane).with(it -> it.setPreferredSize(FineUIScale.scale(new Dimension(COLOR_ADJUST_PANE_WIDTH, COLOR_ADJUST_PANE_HEIGHT)))),

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHeatValueColorPane.java

@ -51,7 +51,7 @@ public class VanChartHeatValueColorPane extends VanChartValueColorPane {
@Override
protected MapColorPickerPaneWithFormula createSectionIntervalConfigPane(AbstractAttrNoScrollPane parent) {
return new SectionIntervalConfigPaneWithOutNum(parent) {
private final int WIDTH = FineUIScale.scale(227);
private final int WIDTH = FineUIScale.scale(218);
@Override
protected int getBoundX() {

10
designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java

@ -9,7 +9,6 @@ import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithForm
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.Component;
import java.awt.Dimension;
/**
* Created by Mitisky on 16/10/20.
@ -44,21 +43,12 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF
@Override
protected Component[][] createComponents() {
numLabel = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage"));
setRegionVisible(false);
return new Component[][]{
new Component[]{new BoldFontTextLabel(getNameOfSubRange()), getDesignTypeButtonGroup()},
new Component[]{numLabel, getRegionNumPane()},
};
}
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
return new Dimension((int) dim.getWidth(), (int) dim.getHeight() - (numLabel.isVisible() ? 0 : 30));
}
@Override
public void populateBean(MapHotAreaColor hotAreaColor) {
super.populateBean(hotAreaColor);

5
designer-realize/src/main/java/com/fr/design/actions/report/ReportPrintSettingAction.java

@ -5,6 +5,7 @@ import com.fr.base.print.PrintSettingsAttrMark;
import com.fr.design.actions.JWorkBookAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.MenuKeySet;
@ -44,14 +45,14 @@ public class ReportPrintSettingAction extends JWorkBookAction {
final ReportPrintSettingPane reportPrintSettingPane = new ReportPrintSettingPane();
reportPrintSettingPane.populate(printSettings);
BasicDialog dialog = reportPrintSettingPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
BasicDialog dialog = reportPrintSettingPane.showWindowWithCustomSize(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
PrintSettingsAttrMark newPrintSettings = reportPrintSettingPane.updateBean();
wbTpl.addAttrMark(newPrintSettings);
jwb.fireTargetModified();
}
});
}, DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.actions.printingSetting.dialog"));
dialog.setVisible(true);
}

2
designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java

@ -213,7 +213,7 @@ public class HFAttributesEditDialog extends BasicPane {
this.revalidate();
add(column(
cell(centerPane),
cell(tabbedPaneBuilder.withHeadRatio(0.13f).build()).weight(1)
cell(tabbedPaneBuilder.withAdaptiveFit().build()).weight(1)
).getComponent());
if (isInsert) {
this.moveLeftButton.setEnabled(false);

3
designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java

@ -1,5 +1,6 @@
package com.fr.design.report.freeze;
import com.fine.theme.utils.FineUIScale;
import java.awt.Dimension;
import javax.swing.JComponent;
import com.fr.design.gui.ilable.UILabel;
@ -26,7 +27,7 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane<FT> {
protected boolean isEnalbed;
protected void initComponent() {
Dimension size = new Dimension(50, 21);
Dimension size = FineUIScale.createScaleDimension(50, 21);
if (start instanceof UISpinner) {
start.setPreferredSize(size);
((UISpinner) start).addChangeListener(new ChangeListener() {

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

@ -1,7 +1,6 @@
package com.fr.design.webattr;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.ConfigManager;
import com.fr.config.Configuration;
import com.fr.design.constants.LayoutConstants;
@ -104,25 +103,22 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
pageFixedRowCountTextField.addKeyListener(rowCountKeyListener);
pageFixedRowCountTextField.addInputMethodListener(rowCountInputMethodListener);
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Tip"));
FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
JPanel northPanel = column(LayoutConstants.VERTICAL_GAP,
//报表显示位置:居中展示-左展示
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location"))).weight(0.15),
row(cell(centerRadioButton), fix(12), cell(leftRadioButton), flex()).weight(0.85)
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location"))).weight(0.2),
row(cell(centerRadioButton), fix(12), cell(leftRadioButton), flex()).weight(0.8)
),
//页面:以图片方式显示-iframe嵌入时自动缩放-重方式输出格子
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page"))).weight(0.15),
row(cell(isShowAsImageBox), fix(12), cell(isAutoScaleBox), fix(12), cell(isTDHeavyBox),flex()).weight(0.85)
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page"))).weight(0.2),
row(cell(isShowAsImageBox), fix(12), cell(isAutoScaleBox), fix(12), cell(isTDHeavyBox),flex()).weight(0.8)
),
//分页设置:按行分页-每页显示行数
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paging_Settings"))).weight(0.15),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paging_Settings"))).weight(0.2),
row(cell(isPageFixedRowBox), fix(20), cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Rows_Per_Page"))),
fix(10), cell(pageFixedRowCountTextField),flex()).weight(0.85)
fix(10), cell(pageFixedRowCountTextField),flex()).weight(0.8)
),
//提示
cell(tipLabel),
cell(FineUIUtils.createAutoWrapTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Tip"))),
//使用工具栏-编辑
row(LayoutConstants.HORIZONTAL_GAP, cell(isUseToolBarCheckBox), cell(editToolBarButton))
).getComponent();

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

@ -2,7 +2,6 @@ package com.fr.design.webattr;
import com.fr.design.gui.frpane.FineTabbedPane;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.report.VerifierListPane;
@ -13,8 +12,6 @@ import com.fr.report.worksheet.WorkSheet;
import com.fr.report.write.ReportWriteAttr;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
@ -56,7 +53,7 @@ public class ReportWriteAttrPane extends LoadingBasicPane {
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Submit"), submiterListPane)
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify"), verifierListPane)
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Writer_ShortCuts_Setting"), writeShortCutsPane)
.withHeadRatio(0.5f)
.withAdaptiveFit()
.build();
container.setPreferredSize(this.getPreferredSize());
container.add(tabbedPane, BorderLayout.CENTER);

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

@ -14,7 +14,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.report.UnitFieldPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
@ -44,6 +43,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;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
@ -199,29 +199,29 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
JPanel scaleCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(fitPaperSizeCheck, scalePane, true);
// 整体布局
centerPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer"))).weight(0.1),
cell(printerComboBox).weight(0.35),
flex(0.55)),
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(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer"))).weight(0.15),
cell(printerComboBox).weight(0.5),
flex(0.35)),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number"))).weight(0.15),
cell(copySpinner).weight(0.2),
flex(0.65)),
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))),
.weight(0.15).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))),
cell(getPrintAreaPane()).weight(0.7),
flex(0.2)),
flex(0.15)),
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))),
.weight(0.15).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),
cell(layoutSettingCheckPane).weight(0.2),
flex(0.7)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Margin"))).weight(0.1),
flex(0.35)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"))).weight(0.15),
cell(layoutSettingCheckPane).weight(0.5),
flex(0.35)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Margin"))).weight(0.15),
cell(pageMarginCheckPane).weight(0.5),
flex(0.4)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_EnlargeOrReduce"))).weight(0.1),
flex(0.35)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_EnlargeOrReduce"))).weight(0.15),
cell(scaleCheckPane).weight(0.3),
flex(0.6))
flex(0.55))
).getComponent();
}
@ -353,8 +353,8 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
return column(LayoutConstants.VERTICAL_GAP,
cell(allPageRadioButton),
cell(currentPageRadioButton),
row(cell(customPageRadioButton).weight(0.1), cell(specifiedAreaField).weight(0.3), cell(areaFieldTip).weight(0.1)),
row(cell(doublePrintRadioButton).weight(0.1),cell(doublePrintComboBox).weight(0.3), flex(0.1))
row(cell(customPageRadioButton).weight(0.11), cell(specifiedAreaField).weight(0.29), fix(4), cell(areaFieldTip).weight(0.1)),
row(cell(doublePrintRadioButton).weight(0.11),cell(doublePrintComboBox).weight(0.29), fix(4), flex(0.1))
).getComponent();
}

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

@ -11,6 +11,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.ScrollPaneConstants;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension;
@ -55,8 +56,8 @@ public class PrintSettingPane extends BasicPane {
printPane.setLayout(printCard);
printPane.add(noClientPrintRadioButton.getText(), noClientPrintSettingPane);
UIScrollPane scrollPane = new UIScrollPane(nativePrintSettingPane);
scrollPane.setPreferredSize(FineUIScale.scale(new Dimension(600, 400)));
UIScrollPane scrollPane = new UIScrollPane(nativePrintSettingPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setPreferredSize(new Dimension(super.getPreferredSize().width, FineUIScale.scale(400)));
printPane.add(nativePrintRadioButton.getText(), scrollPane);
JPanel allPanel = column(LayoutConstants.VERTICAL_GAP, cell(north), cell(printPane))

Loading…
Cancel
Save