Browse Source

Merging in latest from upstream (ST/design:refs/heads/9.0release)

* commit '36b726c6abe929c30dda491e9427b99999e2eff6':
  还是修改国际化文件
  补一个国际化词语
  9.0设计器报表块移动端属性面板事件监听以及与后台的数据交互的完善
master
MoMeak 7 years ago
parent
commit
b03e1fe4de
  1. 2
      designer_base/src/com/fr/design/locale/designer.properties
  2. 2
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  3. 2
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  4. 2
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  5. 2
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  6. 2
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  7. 40
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java
  8. 101
      designer_form/src/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java
  9. 17
      designer_form/src/com/fr/design/widget/ui/designer/mobile/MobileWidgetDefinePane.java

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

@ -2124,3 +2124,5 @@ FR-Designer_Barcode_Size=Barcode_Size
FS-Designer_DS_Filter_Odd_Tip=Odd_Tip FS-Designer_DS_Filter_Odd_Tip=Odd_Tip
FS-Designer_DS_Filter_Even_Tip=Even_Tip FS-Designer_DS_Filter_Even_Tip=Even_Tip
FS-Designer_DS_Filter_Specify_Tip=Specify_Tip FS-Designer_DS_Filter_Specify_Tip=Specify_Tip
FR-Designer_Mobile-Height-Percent=Max Percent
FR-Designer_Mobile-Height-Limit=Height Limit

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

@ -424,6 +424,8 @@ FR-Designer-App_ReLayout=AppRelayout
FR-Designer_Mobile-Attr=Mobile Attr FR-Designer_Mobile-Attr=Mobile Attr
FR-Designer_Mobile-Vertical=Vertical Screen FR-Designer_Mobile-Vertical=Vertical Screen
FR-Designer_Mobile-Horizontal=Horizontal Screen FR-Designer_Mobile-Horizontal=Horizontal Screen
FR-Designer_Mobile-Height-Percent=Max Percent
FR-Designer_Mobile-Height-Limit=Height Limit
FR-Designer_COMMUNITY=community FR-Designer_COMMUNITY=community
FR-Designer_COMMUNITY_BBS=bbs FR-Designer_COMMUNITY_BBS=bbs
FR-Designer_COMMUNITY_VIDEO=video FR-Designer_COMMUNITY_VIDEO=video

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

@ -2123,3 +2123,5 @@ FR-Designer_Barcode_Size=
FS-Designer_DS_Filter_Odd_Tip= FS-Designer_DS_Filter_Odd_Tip=
FS-Designer_DS_Filter_Even_Tip= FS-Designer_DS_Filter_Even_Tip=
FS-Designer_DS_Filter_Specify_Tip= FS-Designer_DS_Filter_Specify_Tip=
FR-Designer_Mobile-Height-Percent=
FR-Designer_Mobile-Height-Limit=

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

@ -2123,3 +2123,5 @@ FR-Designer_Barcode_Size=
FS-Designer_DS_Filter_Odd_Tip= FS-Designer_DS_Filter_Odd_Tip=
FS-Designer_DS_Filter_Even_Tip= FS-Designer_DS_Filter_Even_Tip=
FS-Designer_DS_Filter_Specify_Tip= FS-Designer_DS_Filter_Specify_Tip=
FR-Designer_Mobile-Height-Percent=
FR-Designer_Mobile-Height-Limit=

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

@ -426,6 +426,8 @@ FR-Designer-App_ReLayout=\u624B\u673A\u91CD\u5E03\u5C40
FR-Designer_Mobile-Attr=\u79FB\u52A8\u7AEF\u5C5E\u6027 FR-Designer_Mobile-Attr=\u79FB\u52A8\u7AEF\u5C5E\u6027
FR-Designer_Mobile-Vertical=\u7AD6\u5C4F FR-Designer_Mobile-Vertical=\u7AD6\u5C4F
FR-Designer_Mobile-Horizontal=\u6A2A\u5C4F FR-Designer_Mobile-Horizontal=\u6A2A\u5C4F
FR-Designer_Mobile-Height-Limit=\u624B\u673A\u663E\u793A\u9650\u5236\u9AD8\u5EA6
FR-Designer_Mobile-Height-Percent=\u6700\u5927\u9AD8\u5EA6
FR-Designer_COMMUNITY=\u793E\u533A FR-Designer_COMMUNITY=\u793E\u533A
FR-Designer_COMMUNITY_BBS=\u5E06\u8F6F\u8BBA\u575B FR-Designer_COMMUNITY_BBS=\u5E06\u8F6F\u8BBA\u575B
FR-Designer_COMMUNITY_VIDEO=\u5165\u95E8\u89C6\u9891 FR-Designer_COMMUNITY_VIDEO=\u5165\u95E8\u89C6\u9891

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

@ -424,6 +424,8 @@ FR-Designer-App_ReLayout=\u624B\u6A5F\u91CD\u4F48\u5C40
FR-Designer_Mobile-Attr=\u79FB\u52D5\u7AEF\u5C6C\u6027 FR-Designer_Mobile-Attr=\u79FB\u52D5\u7AEF\u5C6C\u6027
FR-Designer_Mobile-Horizontal=\u6A6B\u5C4F FR-Designer_Mobile-Horizontal=\u6A6B\u5C4F
FR-Designer_Mobile-Vertical=\u8C4E\u5C4F FR-Designer_Mobile-Vertical=\u8C4E\u5C4F
FR-Designer_Mobile-Height-Limit=\u624B\u6A5F\u986F\u793A\u9650\u5236\u9AD8\u5EA6
FR-Designer_Mobile-Height-Percent=\u6700\u5927\u9AD8\u5EA6
FR-Designer_COMMUNITY_QUESTIONS=\u554F\u984C\u6C42\u52A9 FR-Designer_COMMUNITY_QUESTIONS=\u554F\u984C\u6C42\u52A9
FR-Designer_COMMUNITY_SIGN=\u5E06\u8EDF\u8A8D\u8B49 FR-Designer_COMMUNITY_SIGN=\u5E06\u8EDF\u8A8D\u8B49
FR-Designer_COMMUNITY_BUG=BUG\u53CD\u994B FR-Designer_COMMUNITY_BUG=BUG\u53CD\u994B

40
designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

@ -122,6 +122,9 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
extraPane.initPropertyGroups(designer); extraPane.initPropertyGroups(designer);
} }
} }
// for (AbstractPropertyTable propertyTable : widgetPropertyTables) {
// propertyTable.initPropertyGroups(designer);
// }
} }
/** /**
@ -220,9 +223,14 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
MobileWidgetDefinePane extraPane = (MobileWidgetDefinePane) widgetAttrProvider.createWidgetAttrPane(); MobileWidgetDefinePane extraPane = (MobileWidgetDefinePane) widgetAttrProvider.createWidgetAttrPane();
if (extraPane != null) { if (extraPane != null) {
mobileExtraPropertyPanes.add(extraPane); mobileExtraPropertyPanes.add(extraPane);
designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(formWidgetCardPane));
wsp.add(extraPane); wsp.add(extraPane);
} }
// AbstractPropertyTable propertyTable = widgetAttrProvider.createWidgetAttrTable();
// widgetPropertyTables.add(propertyTable);
// designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(formWidgetCardPane));
//
// UIScrollPane uiScrollPane = new UIScrollPane(getExtraBodyTable(propertyTable));
// wsp.add(uiScrollPane);
} }
} }
} }
@ -379,19 +387,25 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED || evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED || evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_ADDED) { || evt.getCreatorEventID() == DesignerEvent.CREATOR_ADDED) {
int value = downPanel.getVerticalScrollBar().getValue(); //fanglei:下面的注释不要删,只是暂时屏蔽
if (hasSelectParaPane(getEditingFormDesigner())) { // int value = downPanel.getVerticalScrollBar().getValue();
cardLayout.show(centerPane, PARA); // if (hasSelectParaPane(getEditingFormDesigner())) {
mobileParaWidgetTable.refreshData(); // cardLayout.show(centerPane, PARA);
} else { // mobileParaWidgetTable.refreshData();
cardLayout.show(centerPane, BODY); // } else {
mobileWidgetTable.refreshData(); // cardLayout.show(centerPane, BODY);
// mobileWidgetTable.refreshData();
// }
// //出现滚动条
// downPanel.doLayout();
// //控件列表选中某组件,触发表单中选中控件,选中事件又触发列表刷新,滚动条回到0
// //此处设置滚动条值为刷新前
// downPanel.getVerticalScrollBar().setValue(value);
if (mobileExtraPropertyPanes != null) {
for (MobileWidgetDefinePane extraPane : mobileExtraPropertyPanes) {
extraPane.populate(designer);
}
} }
//出现滚动条
downPanel.doLayout();
//控件列表选中某组件,触发表单中选中控件,选中事件又触发列表刷新,滚动条回到0
//此处设置滚动条值为刷新前
downPanel.getVerticalScrollBar().setValue(value);
} }
} }
} }

101
designer_form/src/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java

@ -4,6 +4,7 @@ import com.fr.base.mobile.MobileFitAttrState;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -11,19 +12,14 @@ import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.ElementCaseEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
/** /**
* 报表块-移动端属性面板 * 报表块-移动端属性面板
@ -45,13 +41,27 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{
private UICheckBox heightRestrictCheckBox; // 手机显示限制高度复选框 private UICheckBox heightRestrictCheckBox; // 手机显示限制高度复选框
private UILabel maxHeightLabel; private UILabel maxHeightLabel;
private UISpinner maxHeightSpinner; // 最大高度Spinner private UISpinner maxHeightSpinner; // 最大高度Spinner
private AttributeChangeListener changeListener;
public ElementCaseDefinePane (XCreator xCreator) { public ElementCaseDefinePane (XCreator xCreator) {
this.xCreator = xCreator; this.xCreator = xCreator;
} }
@Override @Override
protected String title4PopupWindow() { protected void initContentPane() {}
@Override
protected JPanel createContentPane() {
return null;
}
@Override
public String getIconPath() {
return "";
}
@Override
public String title4PopupWindow() {
return "ElementCase"; return "ElementCase";
} }
@ -62,8 +72,8 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
this.hComboBox = new UIComboBox(ITEMS); this.hComboBox = new UIComboBox(ITEMS);
this.vComboBox = new UIComboBox(ITEMS); this.vComboBox = new UIComboBox(ITEMS);
this.heightRestrictCheckBox = new UICheckBox(Inter.getLocText("Form-EC_heightrestrict")); this.heightRestrictCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Mobile-Height-Limit"));
this.maxHeightLabel = new UILabel(Inter.getLocText("Form-EC_heightpercent"), SwingConstants.LEFT); this.maxHeightLabel = new UILabel(Inter.getLocText("FR-Designer_Mobile-Height-Percent"), SwingConstants.LEFT);
this.maxHeightSpinner = new UISpinner(0, 1, 0.01, 0.75); this.maxHeightSpinner = new UISpinner(0, 1, 0.01, 0.75);
maxHeightSpinner.setVisible(false); maxHeightSpinner.setVisible(false);
maxHeightLabel.setVisible(false); maxHeightLabel.setVisible(false);
@ -86,39 +96,68 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{
UIExpandablePane folderPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Fit"), 280, 20, panelWrapper); UIExpandablePane folderPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Fit"), 280, 20, panelWrapper);
this.add(folderPane, BorderLayout.NORTH); this.add(folderPane, BorderLayout.NORTH);
this.bingListeners2Widgets(); this.bingListeners2Widgets();
this.setGlobalNames();
this.repaint(); this.repaint();
} }
public void bingListeners2Widgets() { private void bingListeners2Widgets() {
this.hComboBox.addActionListener(new ActionListener() { reInitAllListeners();
this.changeListener = new AttributeChangeListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void attributeChange() {
((ElementCaseEditor)xCreator.toData()).setHorziontalAttr(MobileFitAttrState.parse(hComboBox.getSelectedIndex() + 1)); update();
} }
}); };
}
this.vComboBox.addActionListener(new ActionListener() { /**
@Override * 后台初始化所有事件.
public void actionPerformed(ActionEvent e) { */
((ElementCaseEditor)xCreator.toData()).setVerticalAttr(MobileFitAttrState.parse(vComboBox.getSelectedIndex() + 1)); private void reInitAllListeners() {
} initListener(this);
}); }
this.heightRestrictCheckBox.addItemListener(new ItemListener() { @Override
@Override public void populate(FormDesigner designer) {
public void itemStateChanged(ItemEvent e) { 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.heightRestrictCheckBox.setSelected(elementCaseEditor.isHeightRestrict());
this.maxHeightLabel.setVisible(elementCaseEditor.isHeightRestrict());
this.maxHeightSpinner.setVisible(elementCaseEditor.isHeightRestrict());
this.maxHeightSpinner.setValue(elementCaseEditor.getHeightPercent());
}
@Override
public void update() {
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来
String globalName = this.getGlobalName();
switch (globalName) {
case "hComboBox":
((ElementCaseEditor)xCreator.toData()).setHorziontalAttr(MobileFitAttrState.parse(hComboBox.getSelectedIndex() + 1));
break;
case "vComboBox":
((ElementCaseEditor)xCreator.toData()).setVerticalAttr(MobileFitAttrState.parse(vComboBox.getSelectedIndex() + 1));
break;
case "heightRestrictCheckBox":
boolean isHeightRestrict = heightRestrictCheckBox.isSelected(); boolean isHeightRestrict = heightRestrictCheckBox.isSelected();
((ElementCaseEditor)xCreator.toData()).setHeightRestrict(isHeightRestrict); ((ElementCaseEditor)xCreator.toData()).setHeightRestrict(isHeightRestrict);
maxHeightSpinner.setVisible(isHeightRestrict); maxHeightSpinner.setVisible(isHeightRestrict);
maxHeightLabel.setVisible(isHeightRestrict); maxHeightLabel.setVisible(isHeightRestrict);
} break;
}); case "maxHeightSpinner":
this.maxHeightSpinner.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
((ElementCaseEditor)xCreator.toData()).setHeightPercent(maxHeightSpinner.getValue()); ((ElementCaseEditor)xCreator.toData()).setHeightPercent(maxHeightSpinner.getValue());
} break;
}); }
} }
private void setGlobalNames() {
this.hComboBox.setGlobalName("hComboBox");
this.vComboBox.setGlobalName("vComboBox");
this.heightRestrictCheckBox.setGlobalName("heightRestrictCheckBox");
this.maxHeightSpinner.setGlobalName("maxHeightSpinner");
}
} }

17
designer_form/src/com/fr/design/widget/ui/designer/mobile/MobileWidgetDefinePane.java

@ -1,13 +1,26 @@
package com.fr.design.widget.ui.designer.mobile; package com.fr.design.widget.ui.designer.mobile;
import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.mainframe.FormDesigner;
/** /**
* 所有移动端需要拓展的属性面板均继承此类 * 所有移动端需要拓展的属性面板均继承此类
* *
* Created by fanglei on 2017/8/8. * Created by fanglei on 2017/8/8.
*/ */
public abstract class MobileWidgetDefinePane extends BasicPane{ public abstract class MobileWidgetDefinePane extends AbstractAttrNoScrollPane{
//初始化panel数据再repaint //初始化panel数据再repaint
public abstract void initPropertyGroups(Object source); public abstract void initPropertyGroups(Object source);
/**
* 从xCreator中提取数据展示在属性面板中
*
* @param designer
*/
public abstract void populate(FormDesigner designer);
/**
* 从属性面板把数据传到后台
*/
public abstract void update();
} }

Loading…
Cancel
Save