From b9999c4ee5e223cd83866894505c570a3e84b246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Sat, 21 Oct 2017 18:09:08 +0800 Subject: [PATCH] =?UTF-8?q?MOBILE-5269=E3=80=90=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E3=80=91app+9.0jar=E3=80=8B=E8=A1=A8=E5=8D=95=E3=80=8B?= =?UTF-8?q?=E7=BB=9D=E5=AF=B9=E5=B8=83=E5=B1=80=E3=80=8B=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=87=8D=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ElementCaseDefinePane.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/designer_form/src/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java index 9168b23fdb..70c3b94f63 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java @@ -3,6 +3,7 @@ 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.properties.items.Item; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.icheckbox.UICheckBox; @@ -27,11 +28,11 @@ import java.awt.*; * Created by fanglei on 2017/8/8. */ public class ElementCaseDefinePane extends MobileWidgetDefinePane{ - private static final String[] ITEMS = { - MobileFitAttrState.HORIZONTAL.description(), - MobileFitAttrState.VERTICAL.description(), - MobileFitAttrState.BIDIRECTIONAL.description(), - MobileFitAttrState.NONE.description() + private static final Item[] ITEMS = { + new Item(MobileFitAttrState.HORIZONTAL.description(), MobileFitAttrState.HORIZONTAL), + new Item(MobileFitAttrState.VERTICAL.description(), MobileFitAttrState.VERTICAL), + new Item(MobileFitAttrState.BIDIRECTIONAL.description(), MobileFitAttrState.BIDIRECTIONAL), + new Item(MobileFitAttrState.NONE.description(), MobileFitAttrState.NONE) }; private XCreator xCreator; // 当前选中控件的xCreator @@ -122,8 +123,8 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{ this.designer = designer; this.addAttributeChangeListener(changeListener); ElementCaseEditor elementCaseEditor = (ElementCaseEditor)xCreator.toData(); - this.hComboBox.setSelectedIndex(elementCaseEditor.getHorziontalAttr().getState() - 1); - this.vComboBox.setSelectedIndex(elementCaseEditor.getVerticalAttr().getState() - 1); + this.hComboBox.setSelectedItem(new Item (elementCaseEditor.getHorziontalAttr().description(), elementCaseEditor.getHorziontalAttr())); + this.vComboBox.setSelectedItem(new Item (elementCaseEditor.getVerticalAttr().description(), elementCaseEditor.getVerticalAttr())); this.heightRestrictCheckBox.setSelected(elementCaseEditor.isHeightRestrict()); this.maxHeightLabel.setVisible(elementCaseEditor.isHeightRestrict()); this.maxHeightSpinner.setVisible(elementCaseEditor.isHeightRestrict()); @@ -136,10 +137,10 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{ String globalName = this.getGlobalName(); switch (globalName) { case "hComboBox": - ((ElementCaseEditor)xCreator.toData()).setHorziontalAttr(MobileFitAttrState.parse(hComboBox.getSelectedIndex() + 1)); + ((ElementCaseEditor)xCreator.toData()).setHorziontalAttr(((MobileFitAttrState)((Item)hComboBox.getSelectedItem()).getValue())); break; case "vComboBox": - ((ElementCaseEditor)xCreator.toData()).setVerticalAttr(MobileFitAttrState.parse(vComboBox.getSelectedIndex() + 1)); + ((ElementCaseEditor)xCreator.toData()).setVerticalAttr(((MobileFitAttrState)((Item)vComboBox.getSelectedItem()).getValue())); break; case "heightRestrictCheckBox": boolean isHeightRestrict = heightRestrictCheckBox.isSelected();