Browse Source

Merge pull request #1634 in DESIGN/design from ~STARRYI/design:release/10.0 to release/10.0

* commit '649cd4590e03a19f2482dcd2ab40c187d01242f7':
  MOBILE-25666 移动端折叠展开配置面板样式不符合设计
feature/big-screen
starryi 5 years ago
parent
commit
b4263517a9
  1. 50
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStyleExpandPane.java
  2. 153
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStylePane.java
  3. 5
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileComboBoxDialogEditor.java

50
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStyleExpandPane.java

@ -6,13 +6,12 @@ import com.fr.design.gui.itextfield.UIIntNumberField;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.UITitleSplitLine;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.mobile.MobileCollapsedStyle;
import com.fr.form.ui.mobile.MobileFormCollapsedStyle;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.*;
import java.awt.*;
/**
* @author hades
@ -21,34 +20,45 @@ import java.awt.Dimension;
*/
public class MobileCollapsedStyleExpandPane extends MobileCollapsedStylePane {
private static final Dimension DEFAULT_SPINNER_SIZE = new Dimension(60, 24);
private UISpinner rowSpinner;
public MobileCollapsedStyleExpandPane() {
}
@Override
protected JPanel createLinePane() {
UITitleSplitLine splitLine = new UITitleSplitLine(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Line_Number"), 520);
splitLine.setPreferredSize(new Dimension(520, 20));
protected void createConfigPanes(JPanel settingPane) {
JPanel lineNumberConfigPane = this.createLineNumberConfigPane();
settingPane.add(lineNumberConfigPane);
super.createConfigPanes(settingPane);
}
protected JPanel createLineNumberConfigPane() {
JPanel configPane = super.createTitleConfigPane(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Line_Number"));
UILabel collapseLocationLabel = createLabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Show_Button"));
this.rowSpinner = new UISpinner(1, Integer.MAX_VALUE, 1, 1) {
@Override
protected UINumberField initNumberField(){
return new UIIntNumberField();
}
};
rowSpinner.setPreferredSize(DEFAULT_SPINNER_SIZE);
JPanel panel = new JPanel();
panel.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
panel.add(new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Start_From")));
panel.add(rowSpinner);
panel.add(new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Row_To_Fold")));
JPanel linePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
linePane.add(splitLine, BorderLayout.NORTH);
linePane.add(panel, BorderLayout.CENTER);
return linePane;
this.rowSpinner.setPreferredSize(new Dimension(62, COMPONENT_HEIGHT));
JPanel defaultCollapsedStatePanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
defaultCollapsedStatePanel.add(createLabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Start_From") + " "));
defaultCollapsedStatePanel.add(rowSpinner);
defaultCollapsedStatePanel.add(createLabel(" " + Toolkit.i18nText("Fine-Design_Mobile_Collapse_Row_To_Fold")));
double[] rowSize = {COMPONENT_HEIGHT};
double[] columnSize = {LABEL_WIDTH, COMPONENT_WIDTH};
double[] verticalGaps = {0};
JPanel navButtonSettingsPanel = TableLayoutHelper.createDiffVGapTableLayoutPane(new JComponent[][]{
{collapseLocationLabel, defaultCollapsedStatePanel},
}, rowSize, columnSize, 5, verticalGaps);
navButtonSettingsPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 15, 0));
configPane.add(navButtonSettingsPanel);
return configPane;
}
@Override

153
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStylePane.java

@ -1,8 +1,6 @@
package com.fr.design.mainframe.mobile.ui;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ibutton.ModeButtonGroup;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icheckbox.UICheckBox;
@ -10,9 +8,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
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.layout.VerticalFlowLayout;
import com.fr.design.mainframe.widget.UITitleSplitLine;
import com.fr.design.style.color.NewColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
@ -21,13 +17,7 @@ import com.fr.form.ui.mobile.MobileChartCollapsedStyle;
import com.fr.form.ui.mobile.MobileCollapsedStyle;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.*;
/**
* @author hades
@ -36,6 +26,13 @@ import java.awt.FlowLayout;
*/
public class MobileCollapsedStylePane extends BasicBeanPane<MobileCollapsedStyle> {
public final static Color THEME_COLOR = Color.decode("#2F8EF1");
public final static Font TEXT_FONT = new Font("Default", Font.PLAIN, 12);
public final static Color TEXT_FONT_COLOR = Color.decode("#333334");
public final static int LABEL_WIDTH = 96;
public final static int COMPONENT_HEIGHT = 20;
public final static int COMPONENT_WIDTH = 160;
private UICheckBox showButtonCheck;
private NewColorSelectBox buttonColorBox;
private UITextField foldedTextFiled;
@ -44,74 +41,94 @@ public class MobileCollapsedStylePane extends BasicBeanPane<MobileCollapsedStyle
public MobileCollapsedStylePane() {
TitledBorder titledBorder = GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set"), null);
VerticalFlowLayout layout = new VerticalFlowLayout(FlowLayout.LEADING, 0, 10);
layout.setAlignLeft(true);
this.setBorder(titledBorder);
this.setLayout(layout);
this.add(createLinePane());
this.add(createSettingPane());
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setBorder(BorderFactory.createEmptyBorder( 10, 5, 0, 5));
JPanel settingPane = this.createSettingPane();
this.createConfigPanes(settingPane);
this.add(settingPane);
}
private JPanel createSettingPane() {
JPanel settingPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 0);
UITitleSplitLine splitLine = new UITitleSplitLine(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Button"), 520);
splitLine.setPreferredSize(new Dimension(520, 20));
UILabel showButtonLabel = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Show_Button"));
showButtonCheck = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Show_Button_On_Right"));
showButtonCheck.setPreferredSize(new Dimension(140, 24));
UILabel buttonColorLabel = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Button_Color"));
buttonColorBox = new NewColorSelectBox(137);
UILabel foldedLabel = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Folded_Hint"));
JPanel settingPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
settingPane.setBorder(GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Set"), THEME_COLOR));
return settingPane;
}
protected UILabel createLabel(String text) {
UILabel label = new UILabel(text, SwingConstants.RIGHT);
label.setForeground(TEXT_FONT_COLOR);
label.setFont(TEXT_FONT);
return label;
}
protected void createConfigPanes(JPanel settingPane) {
JPanel collapsedButtonConfigPane = this.createCollapsedButtonConfigPane();
settingPane.add(collapsedButtonConfigPane);
}
protected JPanel createTitleConfigPane(String title) {
JPanel configPane = new JPanel();
configPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
configPane.setLayout(new BoxLayout(configPane, BoxLayout.Y_AXIS));
Dimension titleLineDim = new Dimension(610, 20);
UITitleSplitLine splitLine = new UITitleSplitLine(title, titleLineDim.width);
splitLine.setPreferredSize(titleLineDim);
configPane.add(splitLine);
return configPane;
}
private JPanel createCollapsedButtonConfigPane() {
JPanel configPane = this.createTitleConfigPane(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Button"));
UILabel showButtonLabel = this.createLabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Show_Button"));
showButtonCheck = new UICheckBox(Toolkit.i18nText(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Show_Button_On_Right")));
showButtonCheck.setForeground(TEXT_FONT_COLOR);
showButtonCheck.setFont(TEXT_FONT);
UILabel buttonColorLabel = this.createLabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Button_Color"));
buttonColorBox = new NewColorSelectBox(COMPONENT_WIDTH);
UILabel foldedLabel = this.createLabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Folded_Hint"));
foldedTextFiled = new UITextField();
UILabel unfoldedLabel = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_UnFolded_Hint"));
UILabel unfoldedLabel = this.createLabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_UnFolded_Hint"));
unfoldedTextFiled = new UITextField();
UILabel defaultStateLabel = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Default_State"));
buttonGroup = new ModeButtonGroup<>();
UILabel defaultCollapsedStateLabel = this.createLabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Default_State"));
JPanel defaultCollapsedStatePanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
UIRadioButton foldedButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Fold"));
foldedButton.setSelected(true);
foldedButton.setPreferredSize(new Dimension(COMPONENT_WIDTH / 2, COMPONENT_HEIGHT));
foldedButton.setForeground(TEXT_FONT_COLOR);
foldedButton.setFont(TEXT_FONT);
UIRadioButton unfoldedButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Unfold"));
unfoldedButton.setPreferredSize(new Dimension(COMPONENT_WIDTH / 2, COMPONENT_HEIGHT));
unfoldedButton.setForeground(TEXT_FONT_COLOR);
unfoldedButton.setFont(TEXT_FONT);
defaultCollapsedStatePanel.add(foldedButton);
defaultCollapsedStatePanel.add(unfoldedButton);
buttonGroup = new ModeButtonGroup<>();
buttonGroup.put(CollapseState.FOLDED, foldedButton);
buttonGroup.put(CollapseState.UNFOLDED, unfoldedButton);
JPanel flowLeftPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
flowLeftPane.add(foldedButton);
flowLeftPane.add(unfoldedButton);
Component[][] northComponents = new Component[][] {
new Component[] {showButtonLabel, showButtonCheck}
};
Component[][] southComponents = new Component[][] {
new Component[] {defaultStateLabel, flowLeftPane}
};
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p};
double[] colSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] centerComponents = new Component[][] {
new Component[] {buttonColorLabel, buttonColorBox},
new Component[] {foldedLabel, foldedTextFiled},
new Component[] {unfoldedLabel, unfoldedTextFiled},
};
JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(northComponents, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1);
JPanel southPane = TableLayoutHelper.createGapTableLayoutPane(southComponents, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
final JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(centerComponents, rowSize, colSize, rowCount, LayoutConstants.HGAP_LARGE, LayoutConstants.VGAP_SMALL);
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.add(northPane, BorderLayout.NORTH);
panel.add(centerPane, BorderLayout.CENTER);
panel.add(southPane, BorderLayout.SOUTH);
settingPane.add(splitLine);
settingPane.add(panel);
showButtonCheck.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
centerPane.setVisible(showButtonCheck.isSelected());
}
});
return settingPane;
}
protected JPanel createLinePane() {
return FRGUIPaneFactory.createBorderLayout_S_Pane();
double[] rowSize = {COMPONENT_HEIGHT, COMPONENT_HEIGHT, COMPONENT_HEIGHT, COMPONENT_HEIGHT, COMPONENT_HEIGHT};
double[] columnSize = {LABEL_WIDTH, COMPONENT_WIDTH};
double[] verticalGaps = {10, 10, 10, 10, 10};
JPanel contentPane = TableLayoutHelper.createDiffVGapTableLayoutPane(new JComponent[][]{
{showButtonLabel, showButtonCheck},
{buttonColorLabel, buttonColorBox},
{foldedLabel, foldedTextFiled},
{unfoldedLabel, unfoldedTextFiled},
{defaultCollapsedStateLabel, defaultCollapsedStatePanel}
}, rowSize, columnSize, 5, verticalGaps);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 15, 0));
configPane.add(contentPane);
return configPane;
}
@Override

5
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileComboBoxDialogEditor.java

@ -9,8 +9,8 @@ import com.fr.design.i18n.Toolkit;
import com.fr.form.ui.mobile.MobileCollapsedStyle;
import com.fr.general.ComparatorUtils;
import javax.swing.SwingUtilities;
import java.awt.Dimension;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -33,6 +33,7 @@ public class MobileComboBoxDialogEditor extends BasicPane {
private ActionListener listener;
public MobileComboBoxDialogEditor(MobileCollapsedStylePane stylePane) {
this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
this.stylePane = stylePane;
this.comboBox = new UIComboBox(new Object[] {NONE, CUSTOM});
this.comboBox.setPreferredSize(COMBOX_DIMENSION);

Loading…
Cancel
Save