Browse Source

Pull request #14897: REPORT-135499 fix:fbp回归问题:超级链接-移动端弹窗布局调整

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

* commit '047c262f72024600a6008b08a7ec86390d4bec08':
  REPORT-135499 fix:fbp回归问题:超级链接-移动端弹窗布局调整
fbp/merge
Richard.Fang-方超 3 months ago
parent
commit
2e36411b97
  1. 49
      designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java
  2. 54
      designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java
  3. 6
      designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java

49
designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java

@ -1,11 +1,13 @@
package com.fr.design.hyperlink.popup; package com.fr.design.hyperlink.popup;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -13,6 +15,11 @@ import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
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.row;
import static com.fine.swing.ui.layout.Layouts.flex;
public class MobilePopupRegularPane extends BasicPane { public class MobilePopupRegularPane extends BasicPane {
private String label; private String label;
@ -35,13 +42,15 @@ public class MobilePopupRegularPane extends BasicPane {
private void initComponent() { private void initComponent() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(this.createRadioButtonGroupPane(), BorderLayout.NORTH);
spinnerGroupPane = this.createSpinnerPane(); spinnerGroupPane = this.createSpinnerPane();
this.add(spinnerGroupPane, BorderLayout.CENTER); this.add(column(LayoutConstants.VERTICAL_GAP,
cell(this.createRadioButtonGroupPane()),
row(flex(1), cell(spinnerGroupPane).weight(3))
).getComponent());
} }
private JPanel createRadioButtonGroupPane() { private JPanel createRadioButtonGroupPane() {
radiosPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 5)); radiosPane = new JPanel(new BorderLayout());
customRadio = new UIRadioButton(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Custom")); customRadio = new UIRadioButton(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Custom"));
customRadio.addActionListener(radioActionListener); customRadio.addActionListener(radioActionListener);
@ -52,10 +61,8 @@ public class MobilePopupRegularPane extends BasicPane {
radioButtons.add(customRadio); radioButtons.add(customRadio);
radioButtons.add(autoRadio); radioButtons.add(autoRadio);
radiosPane.add(customRadio); radiosPane.add(row(30, cell(customRadio), cell(autoRadio), flex()).getComponent());
radiosPane.add(autoRadio); return row(cell(new UILabel(this.label, FineUIStyle.LABEL_SECONDARY)).weight(1), cell(radiosPane).weight(3)).getComponent();
return MobilePopupUIUtils.createLeftTileRightContentPanel(this.label, radiosPane, Color.GRAY, 20);
} }
private ActionListener radioActionListener = new ActionListener() { private ActionListener radioActionListener = new ActionListener() {
@ -66,40 +73,32 @@ public class MobilePopupRegularPane extends BasicPane {
}; };
private JPanel createSpinnerPane() { private JPanel createSpinnerPane() {
JPanel spinnerPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 15, 5)); JPanel spinnerPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 15, 0));
spinnerPane.setBorder(BorderFactory.createEmptyBorder(0, MobilePopupUIUtils.Left_Title_width, 0, 0)); spinnerPane.setBorder(new ScaledEmptyBorder(0, 0, 0, 0));
widthSpinner = new UISpinner(0, 100, 1, 95); widthSpinner = new UISpinner(0, 100, 1, 95);
widthSpinnerPane = this.createSpinnerLabelPane(widthSpinner, Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Width")); widthSpinnerPane = this.createSpinnerLabelPane(widthSpinner, Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Width"));
heightSpinner = new UISpinner(0, 100, 1, 95); heightSpinner = new UISpinner(0, 100, 1, 95);
heightSpinnerPane = this.createSpinnerLabelPane(heightSpinner, Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Height")); heightSpinnerPane = this.createSpinnerLabelPane(heightSpinner, Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Height"));
spinnerPane.add(row(cell(widthSpinnerPane), cell(heightSpinnerPane)).getComponent());
spinnerPane.add(widthSpinnerPane);
spinnerPane.add(heightSpinnerPane);
return spinnerPane; return spinnerPane;
} }
private JPanel createSpinnerLabelPane(UISpinner spinner, String labelText) { private JPanel createSpinnerLabelPane(UISpinner spinner, String labelText) {
JPanel spinnerLabelPane = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 5)); JPanel spinnerLabelPane = new JPanel(new BorderLayout());
JPanel spinnerPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 2,0));
UILabel percent = new UILabel("%"); UILabel percent = new UILabel("%");
spinnerPane.add(spinner);
spinnerPane.add(percent);
UILabel label = new UILabel(labelText); UILabel label = new UILabel(labelText);
label.setHorizontalAlignment(SwingConstants.CENTER); label.setHorizontalAlignment(SwingConstants.CENTER);
spinnerLabelPane.add(column(LayoutConstants.VGAP_SMALL,
spinnerLabelPane.add(spinnerPane); row(cell(spinner).weight(1), cell(percent)).weight(1),
spinnerLabelPane.add(label); cell(label)
).getComponent());
return spinnerLabelPane; return spinnerLabelPane;
} }
private void resetSpinnerGroupPane(boolean showHeightSpinnerPane) { private void resetSpinnerGroupPane(boolean showHeightSpinnerPane) {
spinnerGroupPane.removeAll(); spinnerGroupPane.removeAll();
spinnerGroupPane.add(widthSpinnerPane); spinnerGroupPane.add(widthSpinnerPane);
if(showHeightSpinnerPane) { if (showHeightSpinnerPane) {
spinnerGroupPane.add(heightSpinnerPane); spinnerGroupPane.add(heightSpinnerPane);
} }
spinnerGroupPane.revalidate(); spinnerGroupPane.revalidate();

54
designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java

@ -1,6 +1,8 @@
package com.fr.design.hyperlink.popup; package com.fr.design.hyperlink.popup;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -57,14 +59,11 @@ public class StyleSettingPane extends BasicBeanPane<MobilePopupHyperlink> {
JPanel typePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel typePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
popupTypeLabel = new UILabel(""); popupTypeLabel = new UILabel("");
UILabel typeLabel = new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Type")); UILabel typeLabel = new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Type"));
typePane.add(row(44, typePane.add(row(cell(typeLabel).weight(1), row(cell(popupTypeLabel), flex()).weight(6)).getComponent());
cell(typeLabel),
cell(popupTypeLabel)
).getComponent());
return typePane; return typePane;
} }
private JPanel createStylePane() { private JPanel createStylePane() {
JPanel stylePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel stylePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
stylePane.add(column(10, stylePane.add(column(10,
cell(this.createBorderSettingPane()), cell(this.createBorderSettingPane()),
@ -82,14 +81,11 @@ public class StyleSettingPane extends BasicBeanPane<MobilePopupHyperlink> {
borderColor = new NewColorSelectBox(100); borderColor = new NewColorSelectBox(100);
borderRadiusSpinner = new UISpinner(0, maxBorderRadius, 1, 20); borderRadiusSpinner = new UISpinner(0, maxBorderRadius, 1, 20);
UILabel borderLabel = new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Border")); UILabel borderLabel = new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Border"));
borderPane.add(row(44,
column(10, borderPane.add(column(LayoutConstants.VERTICAL_GAP,
cell(borderLabel).weight(0.3), row(cell(borderLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Line"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderType).weight(2), flex(3)),
flex().weight(0.7)), row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderColor).weight(2), flex(3)),
column(10, row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Radius"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderRadiusSpinner).weight(2), flex(3))
cell(MobilePopupUIUtils.createLeftTileRightContentPanel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Line"), borderType, Color.GRAY, 64)),
cell(MobilePopupUIUtils.createLeftTileRightContentPanel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), borderColor, Color.GRAY, 64)),
cell(MobilePopupUIUtils.createLeftTileRightContentPanel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Radius"), borderRadiusSpinner, Color.GRAY, 64)))
).getComponent()); ).getComponent());
return borderPane; return borderPane;
} }
@ -99,39 +95,31 @@ public class StyleSettingPane extends BasicBeanPane<MobilePopupHyperlink> {
bgPane.setLayout(new BorderLayout()); bgPane.setLayout(new BorderLayout());
bgColor = new NewColorSelectBox(100); bgColor = new NewColorSelectBox(100);
JPanel transparencyPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel transparencyPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.numberDragPane = new UINumberDragPane(0,100); this.numberDragPane = new UINumberDragPane(0, 100);
transparencyPane.add(numberDragPane, BorderLayout.CENTER); transparencyPane.add(numberDragPane, BorderLayout.CENTER);
transparencyPane.add(new UILabel(" %"), BorderLayout.EAST); transparencyPane.add(new UILabel(" %"), BorderLayout.EAST);
JLabel bgLabel = new JLabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Background")); JLabel bgLabel = new JLabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Background"));
bgPane.add(row(44,
column(10, bgPane.add(column(LayoutConstants.VERTICAL_GAP,
cell(bgLabel).weight(0.6), row(cell(bgLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(bgColor).weight(2), flex(3)),
flex().weight(0.4)), row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Opacity"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(transparencyPane).weight(3), flex(2))
column(10,
cell(MobilePopupUIUtils.createLeftTileRightContentPanel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), bgColor, Color.GRAY, 64)),
cell(MobilePopupUIUtils.createLeftTileRightContentPanel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Opacity"), transparencyPane, Color.GRAY, 64))
)
).getComponent()); ).getComponent());
return bgPane; return bgPane;
} }
private JPanel createPopupSizePane() { private JPanel createPopupSizePane() {
JPanel sizePane = new JPanel(new BorderLayout()); JPanel sizePane = new JPanel(new BorderLayout());
mobileRegularPane = new MobilePopupRegularPane(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Mobile_Rules")); mobileRegularPane = new MobilePopupRegularPane(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Mobile_Rules"));
padRegularPane = new MobilePopupRegularPane(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Pad_Rules")); padRegularPane = new MobilePopupRegularPane(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Pad_Rules"));
JLabel sizeLabel = new JLabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Size")); JLabel sizeLabel = new JLabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Size"));
sizePane.add(row(20, sizePane.add(column(LayoutConstants.VERTICAL_GAP,
column(10, row(
cell(sizeLabel).weight(0.16), column(LayoutConstants.VERTICAL_GAP, cell(sizeLabel), flex()).weight(1),
flex().weight(0.84)), cell(mobileRegularPane).weight(4), flex(2)
column(10, ),
cell(mobileRegularPane), row(flex(1), cell(padRegularPane).weight(4), flex(2))
cell(padRegularPane)
)
).getComponent()); ).getComponent());
return sizePane; return sizePane;
} }
@ -204,7 +192,7 @@ public class StyleSettingPane extends BasicBeanPane<MobilePopupHyperlink> {
private void updateBackgroundSettingBean(MobilePopupHyperlink link) { private void updateBackgroundSettingBean(MobilePopupHyperlink link) {
link.setBgColor(bgColor.getSelectObject()); link.setBgColor(bgColor.getSelectObject());
link.setBgOpacity((float)(numberDragPane.updateBean() / maxNumber)); link.setBgOpacity((float) (numberDragPane.updateBean() / maxNumber));
} }
private void populatePopupSizeBean(MobilePopupHyperlink link) { private void populatePopupSizeBean(MobilePopupHyperlink link) {

6
designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java

@ -182,9 +182,9 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background"))).weight(LEFT_WEIGHT), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background"))).weight(LEFT_WEIGHT),
cell(backgroundPane).weight(RIGHT_WEIGHT) cell(backgroundPane).weight(RIGHT_WEIGHT)
), ),
cell(displayReport), row(cell(displayReport)),
cell(useParamsTemplate), row(cell(useParamsTemplate)),
cell(fireAfterEditor), row(cell(fireAfterEditor)),
row( row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Display_Position"))).weight(LEFT_WEIGHT), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Display_Position"))).weight(LEFT_WEIGHT),
cell(hAlignmentPane).weight(RIGHT_WEIGHT) cell(hAlignmentPane).weight(RIGHT_WEIGHT)

Loading…
Cancel
Save