Browse Source

Merge pull request #1455 in DESIGN/design from ~HADES/design:final/10.0 to final/10.0

* commit '1f4660a2b9b46328f84c29e40a10890f65eb38d8':
  MOBILE-25493 同步到final
final/10.0
Kara 5 years ago
parent
commit
c8d01fc23f
  1. 38
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStylePane.java
  2. 25
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java

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

@ -2,6 +2,7 @@ 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;
@ -19,8 +20,10 @@ import com.fr.form.ui.mobile.CollapseState;
import com.fr.form.ui.mobile.MobileChartCollapsedStyle;
import com.fr.form.ui.mobile.MobileCollapsedStyle;
import javax.swing.JPanel;
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;
@ -51,11 +54,12 @@ public class MobileCollapsedStylePane extends BasicBeanPane<MobileCollapsedStyle
}
private JPanel createSettingPane() {
JPanel settingPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
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"));
@ -72,21 +76,37 @@ public class MobileCollapsedStylePane extends BasicBeanPane<MobileCollapsedStyle
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}, {1, 1}, {1, 1}};
Component[][] components = new Component[][] {
new Component[] {showButtonLabel, showButtonCheck},
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] centerComponents = new Component[][] {
new Component[] {buttonColorLabel, buttonColorBox},
new Component[] {foldedLabel, foldedTextFiled},
new Component[] {unfoldedLabel, unfoldedTextFiled},
new Component[] {defaultStateLabel, flowLeftPane},
};
JPanel buttonPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, colSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
settingPane.add(splitLine, BorderLayout.NORTH);
settingPane.add(buttonPane, BorderLayout.CENTER);
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;
}

25
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java

@ -3,8 +3,11 @@ package com.fr.design.widget.ui.designer.mobile;
import com.fr.base.mobile.MobileFitAttrState;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.properties.items.Item;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.form.util.FormDesignerUtils;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
@ -27,8 +30,7 @@ import javax.swing.BorderFactory;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.*;
/**
* 报表块-移动端属性面板
@ -104,7 +106,7 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane {
Component[][] components = new Component[][]{
new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Horizontal"), SwingConstants.LEFT), hComboBox},
new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Vertical"), SwingConstants.LEFT), vComboBox},
new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("展开收起")), mobileCollapsedStyleEditor},
createComponents(),
new Component[] {heightRestrictCheckBox, null},
new Component[] {allowFullCheckBox, null},
new Component[] {functionalWhenUnactivatedCheckBox, null},
@ -126,6 +128,23 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane {
this.repaint();
}
private Component[] createComponents() {
return FormDesignerUtils.isAppRelayout(designer) && !isInAbsoluteLayout() ?
new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Collapse_Expand")), mobileCollapsedStyleEditor} :
new Component[0];
}
private boolean isInAbsoluteLayout() {
Container parent = xCreator.getParent();
while (parent != null) {
if (parent instanceof XWAbsoluteLayout && !(parent instanceof XWAbsoluteBodyLayout)) {
return true;
}
parent = parent.getParent();
}
return false;
}
private void bingListeners2Widgets() {
reInitAllListeners();
this.changeListener = new AttributeChangeListener() {

Loading…
Cancel
Save