Browse Source

REPORT-60134 表单组件属性国际化-显示不全

zheng-1641779399395
方磊 3 years ago
parent
commit
b5296e5251
  1. 47
      designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java

47
designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java

@ -22,6 +22,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.backgroundpane.GradientBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.GradientBackgroundQuickPane;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.WidgetTitle; import com.fr.form.ui.WidgetTitle;
import com.fr.general.Background; import com.fr.general.Background;
@ -30,11 +31,23 @@ import com.fr.general.IOUtils;
import com.fr.general.act.TitlePacker; import com.fr.general.act.TitlePacker;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.border.LineBorder; import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Stroke;
/** /**
* @author Starryi * @author Starryi
@ -145,16 +158,16 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
double[] rowSize = supportCornerRadius ? new double[] {p, p, p, p} : new double[]{p, p, p}; double[] rowSize = supportCornerRadius ? new double[] {p, p, p, p} : new double[]{p, p, p};
double[] columnSize = {SETTING_LABEL_WIDTH, f}; double[] columnSize = {SETTING_LABEL_WIDTH, f};
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Background_Style")); UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Background_Style"));
Font font = uiLabel.getFont().deriveFont(Font.BOLD); Font font = uiLabel.getFont().deriveFont(Font.BOLD);
uiLabel.setFont(font); uiLabel.setFont(font);
uiLabel.setForeground(new Color(143, 143, 146)); uiLabel.setForeground(new Color(143, 143, 146));
JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{ JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{
{uiLabel, null}, {uiLabel, null},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Render_Style")), borderStyleCombo}, {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Render_Style")), createBorderLayoutNorthPaneWithComponent(borderStyleCombo)},
{this.borderLineAndImagePane, null}, {this.borderLineAndImagePane, null},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")), cornerSpinner}, {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")), cornerSpinner},
}, },
rowSize, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); rowSize, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
@ -180,7 +193,7 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
this.backgroundPane, this.backgroundPane,
this.backgroundOpacityPane); this.backgroundOpacityPane);
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Body_Content")); UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Body_Content"));
Font font = uiLabel.getFont().deriveFont(Font.BOLD); Font font = uiLabel.getFont().deriveFont(Font.BOLD);
uiLabel.setFont(font); uiLabel.setFont(font);
uiLabel.setForeground(new Color(143, 143, 146)); uiLabel.setForeground(new Color(143, 143, 146));
@ -297,11 +310,11 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
double[] columnSize = {SETTING_LABEL_WIDTH, f}; double[] columnSize = {SETTING_LABEL_WIDTH, f};
final JPanel bottomPane = TableLayoutHelper.createCommonTableLayoutPane( new JComponent[][]{ final JPanel bottomPane = TableLayoutHelper.createCommonTableLayoutPane( new JComponent[][]{
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Content")), titleTextPane}, {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Content")), titleTextPane},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Format")), titleFontFamilyComboBox}, {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Format")), createBorderLayoutNorthPaneWithComponent(titleFontFamilyComboBox)},
{null, createTitleFontButtonPane()}, {null, createTitleFontButtonPane()},
{titleInsetImagePane, null}, {titleInsetImagePane, null},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Text_Align")), titleAlignPane}, {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Text_Align")), titleAlignPane},
{this.createTitleBackgroundAndOpacityPane(), null}, {this.createTitleBackgroundAndOpacityPane(), null},
}, },
rowSize, columnSize, IntervalConstants.INTERVAL_L1); rowSize, columnSize, IntervalConstants.INTERVAL_L1);
@ -312,9 +325,9 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
titleVisibleCheckbox.setSelected(false); titleVisibleCheckbox.setSelected(false);
visibleComposedPane.add(titleVisibleCheckbox, BorderLayout.WEST); visibleComposedPane.add(titleVisibleCheckbox, BorderLayout.WEST);
visibleComposedPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Visible")), BorderLayout.CENTER); visibleComposedPane.add(FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Visible")), BorderLayout.CENTER);
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title")); UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title"));
Font font = uiLabel.getFont().deriveFont(Font.BOLD); Font font = uiLabel.getFont().deriveFont(Font.BOLD);
uiLabel.setFont(font); uiLabel.setFont(font);
uiLabel.setForeground(new Color(143, 143, 146)); uiLabel.setForeground(new Color(143, 143, 146));
@ -339,6 +352,12 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
return container; return container;
} }
private JPanel createBorderLayoutNorthPaneWithComponent(JComponent content) {
JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(content, BorderLayout.NORTH);
return jPanel;
}
protected JPanel createTitleFontButtonPane(){ protected JPanel createTitleFontButtonPane(){
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -511,8 +530,8 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
// 确保BackgroundSpecialPane高度变化时,Label依然保持与其顶部对齐 // 确保BackgroundSpecialPane高度变化时,Label依然保持与其顶部对齐
JPanel backgroundLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel backgroundLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
backgroundLabelPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); backgroundLabelPane.setBorder(BorderFactory.createEmptyBorder(7, 0, 0, 0));
backgroundLabelPane.add(new UILabel(name), BorderLayout.NORTH); backgroundLabelPane.add(FRWidgetFactory.createLineWrapLabel(name), BorderLayout.NORTH);
JPanel backgroundComposedPane = TableLayoutHelper.createGapTableLayoutPane( JPanel backgroundComposedPane = TableLayoutHelper.createGapTableLayoutPane(
new JComponent[][]{ new JComponent[][]{
@ -522,7 +541,7 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
JPanel opacityComposedPane = TableLayoutHelper.createGapTableLayoutPane( JPanel opacityComposedPane = TableLayoutHelper.createGapTableLayoutPane(
new JComponent[][]{ new JComponent[][]{
{new UILabel(""), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))}, {new UILabel(""), FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))},
{new UILabel(""), opacityPane} {new UILabel(""), opacityPane}
}, },
new double[]{p, p}, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); new double[]{p, p}, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1);

Loading…
Cancel
Save