Browse Source

REPORT-19466 【匹配移动端】组件级控制选中等

research/10.0
Bruce.Deng 5 years ago
parent
commit
27de4a0d29
  1. 15
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java
  2. 8
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java

15
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java

@ -48,6 +48,7 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
private AttributeChangeListener changeListener; private AttributeChangeListener changeListener;
private UILabel tipLabel; private UILabel tipLabel;
private UICheckBox allowFullCheckBox;//允许全屏 private UICheckBox allowFullCheckBox;//允许全屏
private UICheckBox functionalWhenUnactivatedCheckBox;//组件未激活时可使用组件内功能
public ChartEditorDefinePane(XCreator xCreator) { public ChartEditorDefinePane(XCreator xCreator) {
this.xCreator = xCreator; this.xCreator = xCreator;
@ -88,6 +89,8 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
panel.add(unavailableTipLabel, BorderLayout.NORTH); panel.add(unavailableTipLabel, BorderLayout.NORTH);
allowFullCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Full_Screen")); allowFullCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Full_Screen"));
panel.add(allowFullCheckBox); panel.add(allowFullCheckBox);
functionalWhenUnactivatedCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Functional_When_Unactivated"));
panel.add(functionalWhenUnactivatedCheckBox);
return panel; return panel;
} }
@ -98,19 +101,21 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
tipLabel.setForeground(Color.gray); tipLabel.setForeground(Color.gray);
updateTipLabel(); updateTipLabel();
allowFullCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Full_Screen")); allowFullCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Full_Screen"));
functionalWhenUnactivatedCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Functional_When_Unactivated"));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Zoom_In_Logic"), SwingConstants.LEFT), new UILabel(ChartMobileFitAttrState.PROPORTION.description())}, new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Zoom_In_Logic"), SwingConstants.LEFT), new UILabel(ChartMobileFitAttrState.PROPORTION.description())},
new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Zoom_Out_Logic"), SwingConstants.LEFT), zoomOutComboBox}, new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Zoom_Out_Logic"), SwingConstants.LEFT), zoomOutComboBox},
new Component[] {tipLabel, null}, new Component[] {tipLabel, null},
new Component[] {allowFullCheckBox} new Component[] {allowFullCheckBox},
new Component[] {functionalWhenUnactivatedCheckBox}
}; };
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 30, LayoutConstants.VGAP_LARGE); final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 30, LayoutConstants.VGAP_LARGE);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
final JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); final JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -154,6 +159,8 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
BaseChartEditor chartEditor = (BaseChartEditor)xCreator.toData(); BaseChartEditor chartEditor = (BaseChartEditor)xCreator.toData();
boolean allowFullScreen = chartEditor.getMobileAttr().isAllowFullScreen(); boolean allowFullScreen = chartEditor.getMobileAttr().isAllowFullScreen();
this.allowFullCheckBox.setSelected(allowFullScreen); this.allowFullCheckBox.setSelected(allowFullScreen);
boolean isFunctionalWhenUnactivated = chartEditor.getMobileAttr().isFunctionalWhenUnactivated();
this.functionalWhenUnactivatedCheckBox.setSelected(isFunctionalWhenUnactivated);
this.bindListeners2Widgets(); this.bindListeners2Widgets();
this.addAttributeChangeListener(changeListener); this.addAttributeChangeListener(changeListener);
@ -188,8 +195,10 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
mobileAttr.setZoomInAttr(ChartMobileFitAttrState.PROPORTION); mobileAttr.setZoomInAttr(ChartMobileFitAttrState.PROPORTION);
mobileAttr.setZoomOutAttr((ChartMobileFitAttrState) ((Item) zoomOutComboBox.getSelectedItem()).getValue()); mobileAttr.setZoomOutAttr((ChartMobileFitAttrState) ((Item) zoomOutComboBox.getSelectedItem()).getValue());
mobileAttr.setAllowFullScreen(allowFullCheckBox.isSelected()); mobileAttr.setAllowFullScreen(allowFullCheckBox.isSelected());
mobileAttr.setFunctionalWhenUnactivated(functionalWhenUnactivatedCheckBox.isSelected());
}else { }else {
mobileAttr.setAllowFullScreen(allowFullCheckBox.isSelected()); mobileAttr.setAllowFullScreen(allowFullCheckBox.isSelected());
mobileAttr.setFunctionalWhenUnactivated(functionalWhenUnactivatedCheckBox.isSelected());
} }
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来 DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来
} }

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

@ -50,6 +50,7 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{
private UISpinner maxHeightSpinner; // 最大高度Spinner private UISpinner maxHeightSpinner; // 最大高度Spinner
private AttributeChangeListener changeListener; private AttributeChangeListener changeListener;
private UICheckBox allowFullCheckBox; private UICheckBox allowFullCheckBox;
private UICheckBox functionalWhenUnactivatedCheckBox;
public ElementCaseDefinePane (XCreator xCreator) { public ElementCaseDefinePane (XCreator xCreator) {
this.xCreator = xCreator; this.xCreator = xCreator;
@ -87,11 +88,14 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{
allowFullCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Full_Screen")); allowFullCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Full_Screen"));
functionalWhenUnactivatedCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Functional_When_Unactivated"));
Component[][] components = new Component[][]{ 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_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("Fine-Design_Report_Mobile_Vertical"), SwingConstants.LEFT), vComboBox},
new Component[] {heightRestrictCheckBox, null}, new Component[] {heightRestrictCheckBox, null},
new Component[] {allowFullCheckBox}, new Component[] {allowFullCheckBox},
new Component[] {functionalWhenUnactivatedCheckBox},
new Component[] {maxHeightLabel, maxHeightSpinner} new Component[] {maxHeightLabel, maxHeightSpinner}
}; };
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -139,6 +143,7 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{
this.maxHeightSpinner.setVisible(elementCaseEditor.isHeightRestrict()); this.maxHeightSpinner.setVisible(elementCaseEditor.isHeightRestrict());
this.maxHeightSpinner.setValue(elementCaseEditor.getHeightPercent()); this.maxHeightSpinner.setValue(elementCaseEditor.getHeightPercent());
this.allowFullCheckBox.setSelected(elementCaseEditor.isAllowFullScreen()); this.allowFullCheckBox.setSelected(elementCaseEditor.isAllowFullScreen());
this.functionalWhenUnactivatedCheckBox.setSelected(elementCaseEditor.isFunctionalWhenUnactivated());
} }
@Override @Override
@ -163,6 +168,8 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{
break; break;
case "allowFullCheckBox": case "allowFullCheckBox":
((ElementCaseEditor)xCreator.toData()).setAllowFullScreen(allowFullCheckBox.isSelected()); ((ElementCaseEditor)xCreator.toData()).setAllowFullScreen(allowFullCheckBox.isSelected());
case "functionalWhenUnactivatedCheckBox":
((ElementCaseEditor)xCreator.toData()).setAllowFullScreen(functionalWhenUnactivatedCheckBox.isSelected());
} }
} }
@ -172,6 +179,7 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{
this.heightRestrictCheckBox.setGlobalName("heightRestrictCheckBox"); this.heightRestrictCheckBox.setGlobalName("heightRestrictCheckBox");
this.maxHeightSpinner.setGlobalName("maxHeightSpinner"); this.maxHeightSpinner.setGlobalName("maxHeightSpinner");
this.allowFullCheckBox.setGlobalName("allowFullCheckBox"); this.allowFullCheckBox.setGlobalName("allowFullCheckBox");
this.functionalWhenUnactivatedCheckBox.setGlobalName("functionalWhenUnactivatedCheckBox");
} }
} }

Loading…
Cancel
Save