Browse Source

Pull request #2693: MOBILE-29820 & MOBILE-29857 移动端tab样式页面缺少滚动条 & 设计器上圆点指示器选中填充色设置后没有生效

Merge in DESIGN/design from ~HANS/design:final/10.0 to final/10.0

* commit 'a80b9cbbb7b714f41a28d8205adeb3219220f748':
  MOBILE-29857【RN】设计器上圆点指示器选中填充色设置后没有生效
  MOBILE-29820 移动端tab样式页面缺少滚动条 添加滚动条 最外层直接使用JPanel,没有布局约束导致布局异常,需要调整
  MOBILE-29820 移动端tab样式页面缺少滚动条 对齐属性面板 新增scroll属性和滚动条
final/10.0
Kara 4 years ago
parent
commit
91e4a93d69
  1. 38
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java
  2. 27
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java

38
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java

@ -4,6 +4,8 @@ import com.fr.base.iofile.attr.FormTabPaddingAttrMark;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.dialog.AttrScrollPane;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.FormDesignerUtils;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
@ -15,7 +17,6 @@ import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleTemplateStyleEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleTemplateStyleEditor;
import com.fr.design.mainframe.widget.accessibles.MobileTemplateStylePane; import com.fr.design.mainframe.widget.accessibles.MobileTemplateStylePane;
import com.fr.design.widget.ui.designer.mobile.component.MobileAdvanceInnerPane;
import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane; import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane;
import com.fr.design.widget.ui.designer.mobile.component.MobileComponentMarginPane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentMarginPane;
import com.fr.design.widget.ui.designer.mobile.component.MobileComponentLayoutIntervalPane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentLayoutIntervalPane;
@ -23,7 +24,9 @@ import com.fr.design.widget.ui.designer.mobile.component.MobileTabCommonSettingP
import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.general.cardtag.mobile.MobileTemplateStyle; import com.fr.general.cardtag.mobile.MobileTemplateStyle;
import java.awt.Dimension;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.BorderFactory;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
@ -36,9 +39,22 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
private MobileComponentLayoutIntervalPane intervalPane; private MobileComponentLayoutIntervalPane intervalPane;
private MobileBookMarkUsePane mobileBookMarkUsePane; private MobileBookMarkUsePane mobileBookMarkUsePane;
private MobileTabCommonSettingPane mobileTabCommonSettingPane; private MobileTabCommonSettingPane mobileTabCommonSettingPane;
private JPanel contentJPanel;
private BasicScrollPane scrollPane;
private JPanel holder;
private Dimension dimension;
public TabMobileWidgetDefinePane(XCreator xCreator) { public TabMobileWidgetDefinePane(XCreator xCreator) {
this.xCreator = xCreator; this.xCreator = xCreator;
contentJPanel = FRGUIPaneFactory.createCenterFlowZeroGapBorderPane();
scrollPane = new AttrScrollPane() {
@Override
protected JPanel createContentPane() {
return contentJPanel;
}
};
scrollPane.setBorder(null);
} }
private void bindListeners2Widgets() { private void bindListeners2Widgets() {
@ -61,11 +77,23 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
@Override @Override
public void initPropertyGroups(Object source) { public void initPropertyGroups(Object source) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Tab_Style_Template")); UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Tab_Style_Template"));
templateStyleEditor = new AccessibleTemplateStyleEditor(new MobileTemplateStylePane((WCardTagLayout) xCreator.toData())); templateStyleEditor = new AccessibleTemplateStyleEditor(new MobileTemplateStylePane((WCardTagLayout) xCreator.toData()));
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{label, templateStyleEditor}, {new UILabel()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_LARGE); JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{label, templateStyleEditor}, {new UILabel()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_LARGE);
JPanel holder = FRGUIPaneFactory.createBorderLayout_S_Pane(); holder = new JPanel(new BorderLayout()) {
@Override
public Dimension getPreferredSize() {
if (dimension == null) {
return super.getPreferredSize();
} else {
Dimension defaultDimension = super.getPreferredSize();
defaultDimension.width = dimension.width;
return defaultDimension;
}
}
};
holder.add(jPanel, BorderLayout.NORTH); holder.add(jPanel, BorderLayout.NORTH);
JPanel innerAdvancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel innerAdvancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
if (!shouldHidePadding(designer)) { if (!shouldHidePadding(designer)) {
@ -89,13 +117,17 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
//高级 //高级
holder.add(advancePane, BorderLayout.CENTER); holder.add(advancePane, BorderLayout.CENTER);
this.add(holder, BorderLayout.NORTH); contentJPanel.add(holder, BorderLayout.CENTER);
this.add(scrollPane, BorderLayout.CENTER);
} }
@Override @Override
public void populate(FormDesigner designer) { public void populate(FormDesigner designer) {
WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData(); WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData();
MobileTemplateStyle mobileTemplateStyle = wCardTagLayout.getMobileTemplateStyle(); MobileTemplateStyle mobileTemplateStyle = wCardTagLayout.getMobileTemplateStyle();
if (dimension == null) {
dimension = holder.getPreferredSize();
}
templateStyleEditor.setValue(mobileTemplateStyle); templateStyleEditor.setValue(mobileTemplateStyle);
// 数据 populate 完成后,再设置监听 // 数据 populate 完成后,再设置监听
this.bindListeners2Widgets(); this.bindListeners2Widgets();

27
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java

@ -35,6 +35,7 @@ public class MobileTabCommonSettingPane extends BasicPane {
private ModeButtonGroup<Integer> buttonGroup; private ModeButtonGroup<Integer> buttonGroup;
private NewColorSelectBox initDotColorBox; private NewColorSelectBox initDotColorBox;
private NewColorSelectBox selectDotColorBox; private NewColorSelectBox selectDotColorBox;
private boolean isPopulate;
public MobileTabCommonSettingPane(boolean isTopComponent) { public MobileTabCommonSettingPane(boolean isTopComponent) {
initComponent(isTopComponent); initComponent(isTopComponent);
@ -89,23 +90,27 @@ public class MobileTabCommonSettingPane extends BasicPane {
initDotColorBox = new NewColorSelectBox(0){ initDotColorBox = new NewColorSelectBox(0){
@Override @Override
protected void iniListener() { protected void iniListener() {
} this.addSelectChangeListener(new ChangeListener() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void stateChanged(ChangeEvent e) {
super.mouseClicked(e); if (!isPopulate) {
this.attributeChange(); attributeChange();
}
}
});
} }
}; };
selectDotColorBox = new NewColorSelectBox(0){ selectDotColorBox = new NewColorSelectBox(0){
@Override @Override
protected void iniListener() { protected void iniListener() {
} this.addSelectChangeListener(new ChangeListener() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void stateChanged(ChangeEvent e) {
super.mouseClicked(e); if (!isPopulate) {
this.attributeChange(); attributeChange();
}
}
});
} }
}; };
JPanel initDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initColorLabel, initDotColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); JPanel initDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initColorLabel, initDotColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM);
@ -189,7 +194,9 @@ public class MobileTabCommonSettingPane extends BasicPane {
color = defaultColor; color = defaultColor;
} }
if (color != colorBox.getSelectObject()) { if (color != colorBox.getSelectObject()) {
isPopulate = true;
colorBox.setSelectObject(color); colorBox.setSelectObject(color);
isPopulate = false;
} }
} }

Loading…
Cancel
Save