Browse Source

Merge pull request #1380 in BA/design from ~FANGLEI/design:release/9.0 to release/9.0

* commit '7c1de5637606448642b6a74b31b01414a9a210a5':
  MOBILE-5269【移动端】app+9.0jar》表单》绝对布局》显示重布局
master
superman 7 years ago
parent
commit
25b79bb06c
  1. 19
      designer_form/src/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java

19
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();

Loading…
Cancel
Save