Browse Source

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

* commit '5fa4f52729ca9d058fd45a634015e5039b59b839':
  补一个国际化词语
  9.0设计器报表块移动端属性面板事件监听以及与后台的数据交互的完善
master
superman 7 years ago
parent
commit
81eded6d5e
  1. 1
      designer_base/src/com/fr/design/locale/designer.properties
  2. 1
      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. 1
      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. 40
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java
  8. 89
      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

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

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

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

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

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

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

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

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

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

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

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

@ -424,6 +424,7 @@ FR-Designer-App_ReLayout=\u624B\u6A5F\u91CD\u4F48\u5C40
FR-Designer_Mobile-Attr=\u79FB\u52D5\u7AEF\u5C6C\u6027
FR-Designer_Mobile-Horizontal=\u6A6B\u5C4F
FR-Designer_Mobile-Vertical=\u8C4E\u5C4F
FR-Designer_Mobile-Height-Percent=\u6700\u5927\u9AD8\u5EA6
FR-Designer_COMMUNITY_QUESTIONS=\u554F\u984C\u6C42\u52A9
FR-Designer_COMMUNITY_SIGN=\u5E06\u8EDF\u8A8D\u8B49
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);
}
}
// for (AbstractPropertyTable propertyTable : widgetPropertyTables) {
// propertyTable.initPropertyGroups(designer);
// }
}
/**
@ -220,9 +223,14 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
MobileWidgetDefinePane extraPane = (MobileWidgetDefinePane) widgetAttrProvider.createWidgetAttrPane();
if (extraPane != null) {
mobileExtraPropertyPanes.add(extraPane);
designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(formWidgetCardPane));
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_SELECTED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_ADDED) {
int value = downPanel.getVerticalScrollBar().getValue();
if (hasSelectParaPane(getEditingFormDesigner())) {
cardLayout.show(centerPane, PARA);
mobileParaWidgetTable.refreshData();
} else {
cardLayout.show(centerPane, BODY);
mobileWidgetTable.refreshData();
//fanglei:下面的注释不要删,只是暂时屏蔽
// int value = downPanel.getVerticalScrollBar().getValue();
// if (hasSelectParaPane(getEditingFormDesigner())) {
// cardLayout.show(centerPane, PARA);
// mobileParaWidgetTable.refreshData();
// } else {
// 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);
}
}
}

89
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.designer.creator.XCreator;
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.icombobox.UIComboBox;
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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
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 UILabel maxHeightLabel;
private UISpinner maxHeightSpinner; // 最大高度Spinner
private AttributeChangeListener changeListener;
public ElementCaseDefinePane (XCreator xCreator) {
this.xCreator = xCreator;
}
@Override
protected String title4PopupWindow() {
protected void initContentPane() {}
@Override
protected JPanel createContentPane() {
return null;
}
@Override
public String getIconPath() {
return "";
}
@Override
public String title4PopupWindow() {
return "ElementCase";
}
@ -86,39 +96,68 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{
UIExpandablePane folderPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Fit"), 280, 20, panelWrapper);
this.add(folderPane, BorderLayout.NORTH);
this.bingListeners2Widgets();
this.setGlobalNames();
this.repaint();
}
public void bingListeners2Widgets() {
this.hComboBox.addActionListener(new ActionListener() {
private void bingListeners2Widgets() {
reInitAllListeners();
this.changeListener = new AttributeChangeListener() {
@Override
public void actionPerformed(ActionEvent e) {
((ElementCaseEditor)xCreator.toData()).setHorziontalAttr(MobileFitAttrState.parse(hComboBox.getSelectedIndex() + 1));
public void attributeChange() {
update();
}
};
}
/**
* 后台初始化所有事件.
*/
private void reInitAllListeners() {
initListener(this);
}
});
this.vComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
((ElementCaseEditor)xCreator.toData()).setVerticalAttr(MobileFitAttrState.parse(vComboBox.getSelectedIndex() + 1));
public void populate(FormDesigner designer) {
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());
}
});
this.heightRestrictCheckBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
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();
((ElementCaseEditor)xCreator.toData()).setHeightRestrict(isHeightRestrict);
maxHeightSpinner.setVisible(isHeightRestrict);
maxHeightLabel.setVisible(isHeightRestrict);
}
});
this.maxHeightSpinner.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
break;
case "maxHeightSpinner":
((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;
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.
*/
public abstract class MobileWidgetDefinePane extends BasicPane{
public abstract class MobileWidgetDefinePane extends AbstractAttrNoScrollPane{
//初始化panel数据再repaint
public abstract void initPropertyGroups(Object source);
/**
* 从xCreator中提取数据展示在属性面板中
*
* @param designer
*/
public abstract void populate(FormDesigner designer);
/**
* 从属性面板把数据传到后台
*/
public abstract void update();
}

Loading…
Cancel
Save