Browse Source

MOBILE-6262 FR9.0设计器提供手机端设计画布参考尺寸=>决策报表=>子功能1=>设定画布大小并锁定宽度

plough 7 years ago
parent
commit
9c40868727
  1. 1
      designer_base/src/com/fr/design/locale/designer.properties
  2. 3
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  3. 1
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  4. 1
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  5. 3
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  6. 1
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  7. 16
      designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java
  8. 11
      designer_form/src/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java
  9. 37
      designer_form/src/com/fr/design/mainframe/FormArea.java
  10. 2
      designer_form/src/com/fr/design/mainframe/JForm.java

1
designer_base/src/com/fr/design/locale/designer.properties

@ -2176,3 +2176,4 @@ FR-Designer_Mobile_Screen_Match_Desc=4.7 inch screen phone: fit
FR-Designer_Mobile_Screen_Zoom_In_Desc=4.7 inch or more mobile phones: zooming in FR-Designer_Mobile_Screen_Zoom_In_Desc=4.7 inch or more mobile phones: zooming in
FR-Designer_Mobile_Screen_Zoom_Out_Desc=4.7 inch mobile phone: zooming out FR-Designer_Mobile_Screen_Zoom_Out_Desc=4.7 inch mobile phone: zooming out
FR-Designer_Adaptive_Property_Auto_Match_Desc=In order to improve the end template effect of the mobile phone, when using the reserved layout function, the component scaling logic under the adaptive layout is set as "lateral adaptive" FR-Designer_Adaptive_Property_Auto_Match_Desc=In order to improve the end template effect of the mobile phone, when using the reserved layout function, the component scaling logic under the adaptive layout is set as "lateral adaptive"
FR-Designer_Template_Settings=Template Settings

3
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -2174,4 +2174,5 @@ FR-Designer_Canvas_Size_Lock_Desc=The size of the canvas is 375*560, the width i
FR-Designer_Mobile_Screen_Match_Desc=4.7 inch screen phone: fit FR-Designer_Mobile_Screen_Match_Desc=4.7 inch screen phone: fit
FR-Designer_Mobile_Screen_Zoom_In_Desc=4.7 inch or more mobile phones: zooming in FR-Designer_Mobile_Screen_Zoom_In_Desc=4.7 inch or more mobile phones: zooming in
FR-Designer_Mobile_Screen_Zoom_Out_Desc=4.7 inch mobile phone: zooming out FR-Designer_Mobile_Screen_Zoom_Out_Desc=4.7 inch mobile phone: zooming out
FR-Designer_Adaptive_Property_Auto_Match_Desc=In order to improve the end template effect of the mobile phone, when using the reserved layout function, the component scaling logic under the adaptive layout is set as "lateral adaptive" FR-Designer_Adaptive_Property_Auto_Match_Desc=In order to improve the end template effect of the mobile phone, when using the reserved layout function, the component scaling logic under the adaptive layout is set as "lateral adaptive"
FR-Designer_Template_Settings=Template Settings

1
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -2173,3 +2173,4 @@ FR-Designer_Open_Adaptive_Property_Auto_Match=
FR-Designer_Mobile_Screen_Zoom_In= FR-Designer_Mobile_Screen_Zoom_In=
FR-Designer_Mobile_Screen_Zoom_Out= FR-Designer_Mobile_Screen_Zoom_Out=
FR-Designer_Adaptive_Property_Auto_Match_Desc= FR-Designer_Adaptive_Property_Auto_Match_Desc=
FR-Designer_Template_Settings=

1
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -2175,3 +2175,4 @@ FR-Designer_Mobile_Screen_Zoom_In=
FR-Designer_Mobile_Screen_Zoom_Out= FR-Designer_Mobile_Screen_Zoom_Out=
FR-Designer_Mobile_Screen_Zoom_Out_Desc= FR-Designer_Mobile_Screen_Zoom_Out_Desc=
FR-Designer_Adaptive_Property_Auto_Match_Desc= FR-Designer_Adaptive_Property_Auto_Match_Desc=
FR-Designer_Template_Settings=

3
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2175,4 +2175,5 @@ FR-Designer_Canvas_Size_Lock_Desc=\u753B\u5E03\u5927\u5C0F375*560\uFF0C\u5BBD\u5
FR-Designer_Mobile_Screen_Match_Desc=4.7\u5BF8\u5C4F\u5E55\u624B\u673A\uFF1A\u9002\u914D FR-Designer_Mobile_Screen_Match_Desc=4.7\u5BF8\u5C4F\u5E55\u624B\u673A\uFF1A\u9002\u914D
FR-Designer_Mobile_Screen_Zoom_In_Desc=4.7\u5BF8\u4EE5\u4E0A\u624B\u673A\uFF1A\u653E\u5927 FR-Designer_Mobile_Screen_Zoom_In_Desc=4.7\u5BF8\u4EE5\u4E0A\u624B\u673A\uFF1A\u653E\u5927
FR-Designer_Mobile_Screen_Zoom_Out_Desc=4.7\u5BF8\u4EE5\u4E0B\u624B\u673A\uFF1A\u538B\u7F29 FR-Designer_Mobile_Screen_Zoom_Out_Desc=4.7\u5BF8\u4EE5\u4E0B\u624B\u673A\uFF1A\u538B\u7F29
FR-Designer_Adaptive_Property_Auto_Match_Desc=\u4E3A\u63D0\u5347\u624B\u673A\u7AEF\u6A21\u7248\u6548\u679C\uFF0C\u5728\u4F7F\u7528\u4FDD\u7559\u5E03\u5C40\u529F\u80FD\u65F6\uFF0C\u8BBE\u7F6E\u81EA\u9002\u5E94\u5E03\u5C40\u65B9\u5F0F\u4E0B\u7684\u7EC4\u4EF6\u7F29\u653E\u903B\u8F91\u4E3A"\u6A2A\u5411\u81EA\u9002\u5E94" FR-Designer_Adaptive_Property_Auto_Match_Desc=\u4E3A\u63D0\u5347\u624B\u673A\u7AEF\u6A21\u7248\u6548\u679C\uFF0C\u5728\u4F7F\u7528\u4FDD\u7559\u5E03\u5C40\u529F\u80FD\u65F6\uFF0C\u8BBE\u7F6E\u81EA\u9002\u5E94\u5E03\u5C40\u65B9\u5F0F\u4E0B\u7684\u7EC4\u4EF6\u7F29\u653E\u903B\u8F91\u4E3A"\u6A2A\u5411\u81EA\u9002\u5E94"
FR-Designer_Template_Settings=\u6A21\u7248\u8BBE\u7F6E

1
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -2175,3 +2175,4 @@ FR-Designer_Mobile_Screen_Match_Desc=4.7\u5BF8\u8367\u5E55\u624B\u6A5F\uFF1A\u90
FR-Designer_Mobile_Screen_Zoom_In_Desc=4.7\u5BF8\u4EE5\u4E0A\u624B\u6A5F\uFF1A\u653E\u5927 FR-Designer_Mobile_Screen_Zoom_In_Desc=4.7\u5BF8\u4EE5\u4E0A\u624B\u6A5F\uFF1A\u653E\u5927
FR-Designer_Mobile_Screen_Zoom_Out_Desc=4.7\u5BF8\u4EE5\u4E0B\u624B\u6A5F\uFF1A\u58D3\u7E2E FR-Designer_Mobile_Screen_Zoom_Out_Desc=4.7\u5BF8\u4EE5\u4E0B\u624B\u6A5F\uFF1A\u58D3\u7E2E
FR-Designer_Adaptive_Property_Auto_Match_Desc=\u70BA\u63D0\u5347\u624B\u6A5F\u7AEF\u6A21\u7248\u6548\u679C\uFF0C\u5728\u4F7F\u7528\u4FDD\u7559\u4F48\u5C40\u529F\u80FD\u6642\uFF0C\u8A2D\u5B9A\u81EA\u6211\u8ABF\u6574\u4F48\u5C40\u7BA1\u9053\u4E0B\u7684\u7D44\u4EF6\u7E2E\u653E\u908F\u8F2F\u70BA\u201C\u6A6B\u5411\u81EA\u6211\u8ABF\u6574\u201D FR-Designer_Adaptive_Property_Auto_Match_Desc=\u70BA\u63D0\u5347\u624B\u6A5F\u7AEF\u6A21\u7248\u6548\u679C\uFF0C\u5728\u4F7F\u7528\u4FDD\u7559\u4F48\u5C40\u529F\u80FD\u6642\uFF0C\u8A2D\u5B9A\u81EA\u6211\u8ABF\u6574\u4F48\u5C40\u7BA1\u9053\u4E0B\u7684\u7D44\u4EF6\u7E2E\u653E\u908F\u8F2F\u70BA\u201C\u6A6B\u5411\u81EA\u6211\u8ABF\u6574\u201D
FR-Designer_Template_Settings=\u6A21\u7248\u8A2D\u5B9A

16
designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java

@ -18,29 +18,21 @@ public class FormMobileAttrPane extends BasicBeanPane<FormMobileAttr>{
// 模版设置面板 // 模版设置面板
private FormMobileTemplateSettingsPane formMobileTemplateSettingsPane; private FormMobileTemplateSettingsPane formMobileTemplateSettingsPane;
static final int PADDINGHEIGHT = 10; private static final int PADDING = 10;
public FormMobileAttrPane() { public FormMobileAttrPane() {
this.initComponents(); this.initComponents();
} }
//现在只有两个panel,填不满自适应对话框,只能为工具栏Panel和h5解析方式panel分别包裹上一层Panel再计算高度,不然会自动
//拉长两个Panel的高度去填满整个对话框。
private void initComponents() { private void initComponents() {
// JPanel jPanel1 = new JPanel();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
// jPanel1.setLayout(FRGUIPaneFactory.createBorderLayout());
// jPanel1.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel mobileToolBarPaneWrapper = new JPanel(new BorderLayout()); JPanel mobileToolBarPaneWrapper = new JPanel(new BorderLayout());
mobileToolBarPaneWrapper.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); mobileToolBarPaneWrapper.setBorder(BorderFactory.createEmptyBorder(PADDING, PADDING, 0, PADDING));
this.mobileToolBarPane = new MobileToolBarPane(); this.mobileToolBarPane = new MobileToolBarPane();
mobileToolBarPaneWrapper.add(this.mobileToolBarPane, BorderLayout.NORTH); mobileToolBarPaneWrapper.add(this.mobileToolBarPane, BorderLayout.NORTH);
//设置一个JPanel包裹mobileToolBarPane这个Panel,让jPanel的高度等于mobileToolBarPane高度加10,再放入this中
// jPanel1.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + PADDINGHEIGHT));
// jPanel1.add("North", this.mobileToolBarPane);
JPanel formMobileTemplateSettingsPaneWrapper = new JPanel(new BorderLayout()); JPanel formMobileTemplateSettingsPaneWrapper = new JPanel(new BorderLayout());
formMobileTemplateSettingsPaneWrapper.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); formMobileTemplateSettingsPaneWrapper.setBorder(BorderFactory.createEmptyBorder(PADDING, PADDING, PADDING, PADDING));
this.formMobileTemplateSettingsPane = new FormMobileTemplateSettingsPane(); this.formMobileTemplateSettingsPane = new FormMobileTemplateSettingsPane();
formMobileTemplateSettingsPaneWrapper.add(this.formMobileTemplateSettingsPane, BorderLayout.NORTH); formMobileTemplateSettingsPaneWrapper.add(this.formMobileTemplateSettingsPane, BorderLayout.NORTH);
@ -54,12 +46,14 @@ public class FormMobileAttrPane extends BasicBeanPane<FormMobileAttr>{
ob = new FormMobileAttr(); ob = new FormMobileAttr();
} }
this.mobileToolBarPane.populateBean(ob); this.mobileToolBarPane.populateBean(ob);
this.formMobileTemplateSettingsPane.populateBean(ob);
} }
@Override @Override
public FormMobileAttr updateBean() { public FormMobileAttr updateBean() {
FormMobileAttr formMobileAttr = new FormMobileAttr(); FormMobileAttr formMobileAttr = new FormMobileAttr();
this.mobileToolBarPane.updateBean(formMobileAttr); this.mobileToolBarPane.updateBean(formMobileAttr);
this.formMobileTemplateSettingsPane.updateBean(formMobileAttr);
return formMobileAttr; return formMobileAttr;
} }

11
designer_form/src/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java

@ -133,6 +133,8 @@ public class FormMobileTemplateSettingsPane extends BasicBeanPane<FormMobileAttr
ob = new FormMobileAttr(); ob = new FormMobileAttr();
} }
// this.mobileOnlyCheckPane.populateBean(ob.isRefresh()); // this.mobileOnlyCheckPane.populateBean(ob.isRefresh());
mobileOnlyCheck.setSelected(ob.isMobileOnly());
adaptivePropertyAutoMatchCheck.setSelected(ob.isAdaptivePropertyAutoMatch());
} }
@Override @Override
@ -142,14 +144,15 @@ public class FormMobileTemplateSettingsPane extends BasicBeanPane<FormMobileAttr
@Override @Override
public void updateBean(FormMobileAttr mobileAttr) { public void updateBean(FormMobileAttr mobileAttr) {
// if(mobileAttr != null) { if(mobileAttr != null) {
// mobileAttr.setRefresh(this.mobileOnlyCheckPane.updateBean()); mobileAttr.setMobileOnly(mobileOnlyCheck.isSelected());
// } mobileAttr.setAdaptivePropertyAutoMatch(adaptivePropertyAutoMatchCheck.isSelected());
}
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "模版设置"; return Inter.getLocText("FR-Designer_Template_Settings");
} }
} }

37
designer_form/src/com/fr/design/mainframe/FormArea.java

@ -7,6 +7,8 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWBorderLayout; import com.fr.design.designer.creator.XWBorderLayout;
import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
@ -16,6 +18,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.scrollruler.*; import com.fr.design.scrollruler.*;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.main.mobile.FormMobileAttr;
import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WBorderLayout;
import com.fr.general.FRScreen; import com.fr.general.FRScreen;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -36,6 +39,8 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
private static final int SHOWVALMAX = 400; private static final int SHOWVALMAX = 400;
private static final int SHOWVALMIN = 10; private static final int SHOWVALMIN = 10;
private static final int RESIZE_PANE_GAP = 8; private static final int RESIZE_PANE_GAP = 8;
private static final int MOBILE_ONLY_WIDTH = 375;
private static final int MOBILE_ONLY_HEIGHT = 560;
private FormDesigner designer; private FormDesigner designer;
private int horizontalValue = 0; private int horizontalValue = 0;
private int verticalValue = 0; private int verticalValue = 0;
@ -62,10 +67,18 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
} }
public FormArea(FormDesigner designer) { public FormArea(FormDesigner designer) {
this(designer, true); this(designer, null, true);
}
public FormArea(FormDesigner designer, JForm jForm) {
this(designer, jForm, true);
} }
public FormArea(FormDesigner designer, boolean useScrollBar) { public FormArea(FormDesigner designer, boolean useScrollBar) {
this(designer, null, useScrollBar);
}
public FormArea(FormDesigner designer, JForm jForm, boolean useScrollBar) {
this.designer = designer; this.designer = designer;
this.designer.setParent(this); this.designer.setParent(this);
isValid = useScrollBar; isValid = useScrollBar;
@ -87,6 +100,28 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
} }
this.setFocusTraversalKeysEnabled(false); this.setFocusTraversalKeysEnabled(false);
this.designer.addMouseWheelListener(showValSpinnerMouseWheelListener); this.designer.addMouseWheelListener(showValSpinnerMouseWheelListener);
initMobileAttrModifiedListener(jForm);
}
private void initMobileAttrModifiedListener(JForm jForm) {
if (jForm == null) {
return;
}
jForm.addTargetModifiedListener(new TargetModifiedListener() {
@Override
public void targetModified(TargetModifiedEvent e) {
FormMobileAttr formMobileAttr = jForm.getTarget().getFormMobileAttr();
if (formMobileAttr.isMobileOnly() && Math.abs(widthPane.getValue() - MOBILE_ONLY_WIDTH) > 0.0000001) {
widthPane.setValue(MOBILE_ONLY_WIDTH);
changeWidthPaneValue(MOBILE_ONLY_WIDTH);
heightPane.setValue(MOBILE_ONLY_HEIGHT);
changeHeightPaneValue(MOBILE_ONLY_HEIGHT);
widthPane.setEnabled(false);
} else if (!formMobileAttr.isMobileOnly() && !widthPane.isEnabled()) {
widthPane.setEnabled(true);
}
}
});
} }
MouseWheelListener showValSpinnerMouseWheelListener = new MouseWheelListener() { MouseWheelListener showValSpinnerMouseWheelListener = new MouseWheelListener() {

2
designer_form/src/com/fr/design/mainframe/JForm.java

@ -236,7 +236,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
centerPane.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, new Color(85, 85, 85))); centerPane.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, new Color(85, 85, 85)));
formDesign = new FormDesigner(this.getTarget(), new TabChangeAction(BaseJForm.ELEMENTCASE_TAB, this)); formDesign = new FormDesigner(this.getTarget(), new TabChangeAction(BaseJForm.ELEMENTCASE_TAB, this));
WidgetToolBarPane.getInstance(formDesign); WidgetToolBarPane.getInstance(formDesign);
FormArea area = new FormArea(formDesign); FormArea area = new FormArea(formDesign, this);
JPanel areaWrapper = new JPanel(new BorderLayout()); JPanel areaWrapper = new JPanel(new BorderLayout());
areaWrapper.add(area, BorderLayout.CENTER); areaWrapper.add(area, BorderLayout.CENTER);
areaWrapper.setBackground(Color.white); areaWrapper.setBackground(Color.white);

Loading…
Cancel
Save