Browse Source

REPORT-135996 fix: 视觉二次验收问题修复

fbp/release
Levy.Xie-解安森 2 months ago
parent
commit
7f61b231e5
  1. 30
      designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java
  2. 16
      designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java
  3. 19
      designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java

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

@ -1,12 +1,22 @@
package com.fine.theme.utils; package com.fine.theme.utils;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.core.FormatField;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import java.awt.Color;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex; import static com.fine.swing.ui.layout.Layouts.flex;
@ -62,4 +72,24 @@ public class FineComponentsFactory {
flex(), cell(confirmButton), cell(cancelButton)).getComponent(); flex(), cell(confirmButton), cell(cancelButton)).getComponent();
} }
/**
* 创建示例文本圆角边框&浅灰背景
*
* @return 示例文本Label
*/
public static UILabel createSampleLabel() {
Color labelColor = FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption");
Border interBorder = new UIRoundedBorder(labelColor, 0, 4);
Border border = BorderFactory.createTitledBorder(interBorder, Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample"),
TitledBorder.ABOVE_TOP, 0, null, labelColor);
UILabel sampleLabel = new UILabel(FormatField.getInstance().getFormatValue());
sampleLabel.setHorizontalAlignment(UILabel.CENTER);
sampleLabel.setBorder(BorderFactory.createCompoundBorder(border, new ScaledEmptyBorder(2, 0, 8, 0)));
FineUIStyle.setStyle(sampleLabel, FineUIStyle.LABEL_TIP);
return sampleLabel;
}
} }

16
designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java

@ -1,9 +1,9 @@
package com.fr.design.gui.style; package com.fr.design.gui.style;
import com.fine.theme.utils.FineComponentsFactory;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.CoreDecimalFormat; import com.fr.base.CoreDecimalFormat;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.TextFormat; import com.fr.base.TextFormat;
@ -12,8 +12,6 @@ import com.fr.data.core.FormatField.FormatContents;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.GlobalNameObserver;
import com.fr.design.gui.icombobox.TextFontComboBox; import com.fr.design.gui.icombobox.TextFontComboBox;
@ -28,13 +26,10 @@ import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.math.RoundingMode; import java.math.RoundingMode;
import javax.swing.BorderFactory;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.text.Format; import java.text.Format;
@ -161,14 +156,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
} }
private void initSampleLabel() { private void initSampleLabel() {
Color labelColor = FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption"); sampleLabel = FineComponentsFactory.createSampleLabel();
Border interBorder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4);
String title = Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample");
Border border = BorderFactory.createTitledBorder(interBorder, title, TitledBorder.LEFT, 0, null, labelColor);
sampleLabel = new UILabel(FormatField.getInstance().getFormatValue());
sampleLabel.setHorizontalAlignment(UILabel.CENTER);
sampleLabel.setBorder(border);
FineUIStyle.setStyle(sampleLabel, FineUIStyle.LABEL_TIP);
} }

19
designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java

@ -1,15 +1,13 @@
package com.fr.design.gui.style; package com.fr.design.gui.style;
import com.fine.theme.utils.FineComponentsFactory;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.CoreDecimalFormat; import com.fr.base.CoreDecimalFormat;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.TextFormat; import com.fr.base.TextFormat;
import com.fr.data.core.FormatField; import com.fr.data.core.FormatField;
import com.fr.data.core.FormatField.FormatContents; import com.fr.data.core.FormatField.FormatContents;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
@ -22,17 +20,11 @@ import com.fr.design.i18n.Toolkit;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.math.RoundingMode; import java.math.RoundingMode;
@ -112,14 +104,7 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
} }
private void initPreviewLabel4GeneralFormat() { private void initPreviewLabel4GeneralFormat() {
Color labelColor = FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption"); previewLabel = FineComponentsFactory.createSampleLabel();
Border interBorder = new UIRoundedBorder(UIConstants.LINE_COLOR, 0, 4);
String title = Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample");
Border border = BorderFactory.createTitledBorder(interBorder, title, TitledBorder.ABOVE_TOP, 0, null, labelColor);
previewLabel = new UILabel(FormatField.getInstance().getFormatValue());
previewLabel.setHorizontalAlignment(UILabel.CENTER);
previewLabel.setBorder(border);
FineUIStyle.setStyle(previewLabel, FineUIStyle.LABEL_TIP);
} }
protected void initLayout() { protected void initLayout() {

Loading…
Cancel
Save