Browse Source

MOBILE-6262 FR9.0设计器提供手机端设计画布参考尺寸=>决策报表=>1 “移动端属性”窗口界面修改

plough 7 years ago
parent
commit
d0b778e4e6
  1. 2
      designer_base/src/com/fr/design/designer/IntervalConstants.java
  2. 7
      designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java
  3. 9
      designer_base/src/com/fr/design/locale/designer.properties
  4. 11
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  5. 6
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  6. 8
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  7. 11
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  8. 9
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  9. 24
      designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java
  10. 155
      designer_form/src/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java

2
designer_base/src/com/fr/design/designer/IntervalConstants.java

@ -27,4 +27,6 @@ public class IntervalConstants {
public static final int INTERVAL_W3 = 49; public static final int INTERVAL_W3 = 49;
public static final int INTERVAL_W4 = 22;
} }

7
designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java

@ -1,6 +1,8 @@
package com.fr.design.dialog.mobile; package com.fr.design.dialog.mobile;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.event.ChangeListener;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -10,6 +12,7 @@ import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -43,6 +46,10 @@ public class MobileRadioCheckPane extends BasicBeanPane<Boolean> {
this.add(fitOpsPane); this.add(fitOpsPane);
} }
public void registerChangeLister(UIObserverListener listener) {
checkBoxes.get(0).registerChangeListener(listener);
}
public int getCurrentState() { public int getCurrentState() {
return checkBoxes.get(0).isSelected() ? 0 : 1; return checkBoxes.get(0).isSelected() ? 0 : 1;
} }

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

@ -2167,3 +2167,12 @@ FR-Designer_Tab_Template_Four=Template Four
FR-Designer_Tab_Template_Five=Template Five FR-Designer_Tab_Template_Five=Template Five
FR-Designer_Tab_Template_Six=Template Six FR-Designer_Tab_Template_Six=Template Six
FR-Designer_Tab_Display_Position=Display Position FR-Designer_Tab_Display_Position=Display Position
FR-Designer_Set_Mobile_Only_Template=Set as mobile only template
FR-Designer_Set_Mobile_Canvas_Size=Set as mobile canvas size
FR-Designer_Adaptive_Property_Auto_Match=Adaptive property auto match
FR-Designer_Open_Adaptive_Property_Auto_Match=Open adpative property auto match
FR-Designer_Canvas_Size_Lock_Desc=The size of the canvas is 375*560, the width is locked, the height is customizable
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_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"

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

@ -2165,4 +2165,13 @@ FR-Designer_Tab_Template_Three=Template Three
FR-Designer_Tab_Template_Four=Template Four FR-Designer_Tab_Template_Four=Template Four
FR-Designer_Tab_Template_Five=Template Five FR-Designer_Tab_Template_Five=Template Five
FR-Designer_Tab_Template_Six=Template Six FR-Designer_Tab_Template_Six=Template Six
FR-Designer_Tab_Display_Position=Display Position FR-Designer_Tab_Display_Position=Display Position
FR-Designer_Set_Mobile_Only_Template=Set as mobile only template
FR-Designer_Set_Mobile_Canvas_Size=Set as mobile canvas size
FR-Designer_Adaptive_Property_Auto_Match=Adaptive property auto match
FR-Designer_Open_Adaptive_Property_Auto_Match=Open adpative property auto match
FR-Designer_Canvas_Size_Lock_Desc=The size of the canvas is 375*560, the width is locked, the height is customizable
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_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"

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

@ -2167,3 +2167,9 @@ FR-Designer_Tab_Template_Four=
FR-Designer_Tab_Template_Five= FR-Designer_Tab_Template_Five=
FR-Designer_Tab_Template_Six= FR-Designer_Tab_Template_Six=
FR-Designer_Tab_Display_Position= FR-Designer_Tab_Display_Position=
FR-Designer_Set_Mobile_Only_Template=
FR-Designer_Set_Mobile_Canvas_Size=
FR-Designer_Open_Adaptive_Property_Auto_Match=
FR-Designer_Mobile_Screen_Zoom_In=
FR-Designer_Mobile_Screen_Zoom_Out=
FR-Designer_Adaptive_Property_Auto_Match_Desc=

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

@ -2167,3 +2167,11 @@ FR-Designer_Tab_Template_Four=
FR-Designer_Tab_Template_Five= FR-Designer_Tab_Template_Five=
FR-Designer_Tab_Template_Six= FR-Designer_Tab_Template_Six=
FR-Designer_Tab_Display_Position= FR-Designer_Tab_Display_Position=
FR-Designer_Set_Mobile_Only_Template=
FR-Designer_Set_Mobile_Canvas_Size=
FR-Designer_Adaptive_Property_Auto_Match=
FR-Designer_Open_Adaptive_Property_Auto_Match=
FR-Designer_Mobile_Screen_Zoom_In=
FR-Designer_Mobile_Screen_Zoom_Out=
FR-Designer_Mobile_Screen_Zoom_Out_Desc=
FR-Designer_Adaptive_Property_Auto_Match_Desc=

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

@ -2166,4 +2166,13 @@ FR-Designer_Tab_Template_Three=\u6A21\u677F\u4E09
FR-Designer_Tab_Template_Four=\u6A21\u677F\u56DB FR-Designer_Tab_Template_Four=\u6A21\u677F\u56DB
FR-Designer_Tab_Template_Five=\u6A21\u677F\u4E94 FR-Designer_Tab_Template_Five=\u6A21\u677F\u4E94
FR-Designer_Tab_Template_Six=\u6A21\u677F\u516D FR-Designer_Tab_Template_Six=\u6A21\u677F\u516D
FR-Designer_Tab_Display_Position=\u663E\u793A\u4F4D\u7F6E FR-Designer_Tab_Display_Position=\u663E\u793A\u4F4D\u7F6E
FR-Designer_Set_Mobile_Only_Template=\u8BBE\u7F6E\u4E3A\u624B\u673A\u7AEF\u4E13\u5C5E\u6A21\u7248
FR-Designer_Set_Mobile_Canvas_Size=\u8BBE\u7F6E\u4E3A\u624B\u673A\u6A21\u7248\u753B\u5E03\u5927\u5C0F
FR-Designer_Adaptive_Property_Auto_Match=\u81EA\u9002\u5E94\u5C5E\u6027\u81EA\u52A8\u5339\u914D
FR-Designer_Open_Adaptive_Property_Auto_Match=\u5F00\u542F\u81EA\u9002\u5E94\u5C5E\u6027\u81EA\u52A8\u5339\u914D
FR-Designer_Canvas_Size_Lock_Desc=\u753B\u5E03\u5927\u5C0F375*560\uFF0C\u5BBD\u5EA6\u9501\u5B9A\uFF0C\u9AD8\u5EA6\u53EF\u81EA\u5B9A\u4E49
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_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"

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

@ -2166,3 +2166,12 @@ FR-Designer_Tab_Template_Four=\u6A21\u677F\u56DB
FR-Designer_Tab_Template_Five=\u6A21\u677F\u4E94 FR-Designer_Tab_Template_Five=\u6A21\u677F\u4E94
FR-Designer_Tab_Template_Six=\u6A21\u677F\u516D FR-Designer_Tab_Template_Six=\u6A21\u677F\u516D
FR-Designer_Tab_Display_Position=\u986F\u793A\u4F4D\u7F6E FR-Designer_Tab_Display_Position=\u986F\u793A\u4F4D\u7F6E
FR-Designer_Set_Mobile_Only_Template=\u8A2D\u5B9A\u70BA\u624B\u6A5F\u7AEF\u5C08\u5C6C\u6A21\u7248
FR-Designer_Set_Mobile_Canvas_Size=\u8A2D\u5B9A\u70BA\u624B\u6A5F\u6A21\u7248\u756B\u5E03\u5927\u5C0F
FR-Designer_Adaptive_Property_Auto_Match=\u81EA\u6211\u8ABF\u6574\u5185\u5BB9\u81EA\u52D5\u5339\u914D
FR-Designer_Open_Adaptive_Property_Auto_Match=\u958B\u555F\u81EA\u6211\u8ABF\u6574\u5185\u5BB9\u81EA\u52D5\u5339\u914D
FR-Designer_Canvas_Size_Lock_Desc=\u756B\u5E03\u5927\u5C0F375*560\uFF0C\u5BEC\u5EA6\u9396\u5B9A\uFF0C\u9AD8\u5EA6\u53EF\u81EA\u5B9A\u7FA9
FR-Designer_Mobile_Screen_Match_Desc=4.7\u5BF8\u8367\u5E55\u624B\u6A5F\uFF1A\u9069\u914D
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_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

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

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

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

@ -0,0 +1,155 @@
package com.fr.design.form.mobile;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.mobile.MobileRadioCheckPane;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.main.mobile.FormMobileAttr;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by plough on 2018/1/4.
*/
public class FormMobileTemplateSettingsPane extends BasicBeanPane<FormMobileAttr> {
private UICheckBox mobileOnlyCheck; // 设置为手机端专属模版
private UICheckBox mobileCanvasSizeCheck; // 设置为手机模版画布大小
private UICheckBox adaptivePropertyAutoMatchCheck; // 自适应属性自动匹配
public FormMobileTemplateSettingsPane() {
this.initComponents();
}
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow());
JPanel contentPane = new JPanel(FRGUIPaneFactory.createBorderLayout());
contentPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, IntervalConstants.INTERVAL_L2, 0));
JPanel mobileSettingsPane = new JPanel(FRGUIPaneFactory.createBorderLayout());
mobileSettingsPane.setVisible(false);
mobileSettingsPane.add(getMobileCanvasSizeCheckPane(), BorderLayout.NORTH);
mobileSettingsPane.add(getAdaptivePropertyAutoMatchCheckPane(), BorderLayout.CENTER);
mobileOnlyCheck = new UICheckBox(Inter.getLocText("FR-Designer_Set_Mobile_Only_Template"));
mobileOnlyCheck.registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
mobileSettingsPane.setVisible(mobileOnlyCheck.isSelected());
}
});
contentPane.add(mobileOnlyCheck, BorderLayout.NORTH);
contentPane.add(mobileSettingsPane, BorderLayout.CENTER);
borderPane.add(contentPane);
this.add(borderPane);
}
private JPanel getMobileCanvasSizeCheckPane() {
JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout());
mobileCanvasSizeCheck = new UICheckBox(Inter.getLocText("FR-Designer_Set_Mobile_Canvas_Size"));
// 默认勾选,不可取消
mobileCanvasSizeCheck.setSelected(true);
mobileCanvasSizeCheck.setEnabled(false);
panel.add(mobileCanvasSizeCheck, BorderLayout.NORTH);
panel.add(getCanvasDescPane(), BorderLayout.CENTER);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L6, 0));
return panel;
}
private JPanel getAdaptivePropertyAutoMatchCheckPane() {
JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout());
String selectedDesc = Inter.getLocText("FR-Designer_Adaptive_Property_Auto_Match");
String unselectedDesc = Inter.getLocText("FR-Designer_Open_Adaptive_Property_Auto_Match");
adaptivePropertyAutoMatchCheck = new UICheckBox();
adaptivePropertyAutoMatchCheck.registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
adaptivePropertyAutoMatchCheck.setText(adaptivePropertyAutoMatchCheck.isSelected() ? selectedDesc : unselectedDesc);
}
});
adaptivePropertyAutoMatchCheck.setSelected(true);
panel.add(adaptivePropertyAutoMatchCheck, BorderLayout.NORTH);
panel.add(getAdaptivePropertyAutoMatchDescPane(), BorderLayout.CENTER);
return panel;
}
private JPanel getCanvasDescPane() {
UILabel desc1 = createDescLabel(Inter.getLocText("FR-Designer_Canvas_Size_Lock_Desc"));
UILabel desc2 = createDescLabel(Inter.getLocText("FR-Designer_Mobile_Screen_Match_Desc"));
UILabel desc3 = createDescLabel(Inter.getLocText("FR-Designer_Mobile_Screen_Zoom_In_Desc"));
UILabel desc4 = createDescLabel(Inter.getLocText("FR-Designer_Mobile_Screen_Zoom_Out_Desc"));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{desc1, null},
new Component[]{desc2, null},
new Component[]{desc3, null},
new Component[]{desc4, null}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_W4, IntervalConstants.INTERVAL_L1, 0));
return panel;
}
private JPanel getAdaptivePropertyAutoMatchDescPane() {
UILabel desc1 = createDescLabel(Inter.getLocText("FR-Designer_Adaptive_Property_Auto_Match_Desc"));
JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout());
panel.add(desc1, BorderLayout.CENTER);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_W4, IntervalConstants.INTERVAL_L1, 0));
return panel;
}
private UILabel createDescLabel(String desc) {
UILabel label = new UILabel(desc);
label.setForeground(Color.gray);
return label;
}
@Override
public void populateBean(FormMobileAttr ob) {
if (ob == null) {
ob = new FormMobileAttr();
}
// this.mobileOnlyCheckPane.populateBean(ob.isRefresh());
}
@Override
public FormMobileAttr updateBean() {
return null;
}
@Override
public void updateBean(FormMobileAttr mobileAttr) {
// if(mobileAttr != null) {
// mobileAttr.setRefresh(this.mobileOnlyCheckPane.updateBean());
// }
}
@Override
protected String title4PopupWindow() {
return "模版设置";
}
}
Loading…
Cancel
Save