Browse Source

REPORT-3293 9.0设计器控件设置重画

master
kerry 7 years ago
parent
commit
63b72565d5
  1. 146
      designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java
  2. 16
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  3. 88
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  4. 6
      designer/src/com/fr/design/widget/WidgetDefinePaneFactory.java
  5. 43
      designer/src/com/fr/design/widget/WidgetPane.java
  6. 6
      designer/src/com/fr/design/widget/ui/ButtonDefinePane.java
  7. 10
      designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java
  8. 4
      designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java
  9. 2
      designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java
  10. 36
      designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java
  11. 14
      designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java
  12. 139
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  13. 32
      designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java
  14. 23
      designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java
  15. 4
      designer/src/com/fr/design/widget/ui/NoneWidgetDefinePane.java
  16. 44
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  17. 4
      designer/src/com/fr/design/widget/ui/RadioDefinePane.java
  18. 11
      designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java
  19. 22
      designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java
  20. 4
      designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java
  21. 4
      designer/src/com/fr/design/widget/ui/UserEditorDefinePane.java
  22. 6
      designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java
  23. 4
      designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java
  24. 3
      designer/src/com/fr/design/widget/ui/btn/ButtonDetailPaneFactory.java
  25. 12
      designer/src/com/fr/design/widget/ui/btn/DefineAppendColumnRowPane.java
  26. 4
      designer/src/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java
  27. 30
      designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java

146
designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java

@ -0,0 +1,146 @@
package com.fr.design.mainframe;
import com.fr.base.FRContext;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.CellWriteAttrPane;
import com.fr.design.widget.WidgetPane;
import com.fr.form.ui.NoneWidget;
import com.fr.form.ui.Widget;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
import java.awt.*;
/**
* Created by ibm on 2017/7/20.
*/
public class CellWidgetPropertyPane extends BasicPane {
private static CellWidgetPropertyPane singleton;
private TemplateCellElement cellElement;
private WidgetPane cellEditorDefPane;
public static CellWidgetPropertyPane getInstance(){
if (singleton == null) {
singleton = new CellWidgetPropertyPane();
}
return singleton;
}
public CellWidgetPropertyPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
// this.addAttributeChangeListener(listener);
// cellEditorDefPane = new WidgetPane(elementCasePane);
}
public void clear (){
singleton = null;
}
public WidgetPane getCellEditorDefPane() {
return cellEditorDefPane;
}
public void setCellEditorDefPane(WidgetPane cellEditorDefPane) {
this.cellEditorDefPane = cellEditorDefPane;
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer-Widget_Settings");
}
public void populate(TemplateCellElement cellElement) {
if (cellElement == null) {// 利用默认的CellElement.
cellElement = new DefaultTemplateCellElement(0, 0, null);
}
Widget cellWidget = cellElement.getWidget();
if(cellWidget == null){
return;
}
// 这里进行克隆的原因是为了保留原始的Widget以便和新的Widget做比较来判断是否发生了改变
if (cellWidget != null) {
try {
cellWidget = (Widget) cellWidget.clone();
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
cellEditorDefPane.populate(cellWidget);
}
public void populate(ElementCasePane ePane) {
cellEditorDefPane = new WidgetPane(ePane);
this.add(cellEditorDefPane, BorderLayout.CENTER);
CellSelection cs = (CellSelection) ePane.getSelection();
final TemplateElementCase tplEC = ePane.getEditingElementCase();
TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
tplEC.addCellElement(editCellElement);
}
this.cellElement = editCellElement;
this.populate(editCellElement);
}
public void update() {
if (cellElement == null) {// 利用默认的CellElement.
return;
}
Widget cellWidget = this.cellEditorDefPane.update();
// p:最后把这个cellEditorDef设置到CellGUIAttr.
if (cellWidget instanceof NoneWidget) {
cellElement.setWidget(null);
} else {
if (cellElement.getWidget() != null) {
cellWidget = upDateWidgetAuthority(cellElement, cellWidget);
}
cellElement.setWidget(cellWidget);
}
}
private Widget upDateWidgetAuthority(TemplateCellElement cellElement, Widget newWidget) {
try {
Widget oldWidget = (Widget) cellElement.getWidget().clone();
if (newWidget.getClass() == oldWidget.getClass()) {
newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone());
}
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
return newWidget;
}
@Override
/**
*检测是否有效
*/
public void checkValid() throws Exception {
this.cellEditorDefPane.checkValid();
}
}

16
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -6,7 +6,6 @@ import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.present.ConditionAttributesGroupPane; import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.page.ReportSettingsProvider; import com.fr.page.ReportSettingsProvider;
@ -22,25 +21,13 @@ import com.fr.design.actions.edit.merge.UnmergeCellAction;
import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.actions.utils.DeprecatedActionManager;
import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.fun.MenuHandler;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.mainframe.cell.QuickEditorRegion; import com.fr.design.mainframe.cell.QuickEditorRegion;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.core.SheetUtils;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.worksheet.WorkSheet; import com.fr.report.worksheet.WorkSheet;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener; import com.fr.design.selection.SelectionListener;
import com.fr.general.Inter;
import com.fr.grid.selection.FloatSelection;
import com.fr.page.ReportSettingsProvider;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import javax.swing.*; import javax.swing.*;
@ -69,7 +56,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
return; return;
} }
CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
QuickEditorRegion.getInstance().populate(getCurrentEditor()); QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
@ -94,6 +81,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance()); EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane); EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance());
} }
EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane); EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane);
EastRegionContainerPane.getInstance().removeParameterPane(); EastRegionContainerPane.getInstance().removeParameterPane();

88
designer/src/com/fr/design/widget/CellWidgetCardPane.java

@ -2,8 +2,9 @@ package com.fr.design.widget;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
@ -15,6 +16,7 @@ import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.util.ArrayList;
/* /*
* carl :单独弄出来 * carl :单独弄出来
@ -23,7 +25,10 @@ public class CellWidgetCardPane extends BasicPane {
//当前的编辑器属性定义面板 //当前的编辑器属性定义面板
private DataModify<? extends Widget> currentEditorDefinePane; private DataModify<? extends Widget> currentEditorDefinePane;
//属性配置切换面板 //属性配置切换面板
private JTabbedPane tabbedPane; private ArrayList<JPanel> paneList;
private JPanel center;
private UIHeadGroup tabsHeaderIconPane;
private CardLayout tabbedPane;
private BasicWidgetPropertySettingPane widgetPropertyPane; private BasicWidgetPropertySettingPane widgetPropertyPane;
//通用属性容器 //通用属性容器
@ -43,54 +48,87 @@ public class CellWidgetCardPane extends BasicPane {
private JPanel eventTabPane; private JPanel eventTabPane;
private WidgetEventPane eventPane; private WidgetEventPane eventPane;
private ElementCasePane pane;
public CellWidgetCardPane(ElementCasePane pane) { public CellWidgetCardPane(ElementCasePane pane) {
this.initComponents(pane); this.pane = pane;
// this.initComponents(pane);
}
public BasicWidgetPropertySettingPane initBasicWidgetPropertyPane(){
return new BasicWidgetPropertySettingPane();
} }
private void initComponents(ElementCasePane pane) { private void initComponents(ElementCasePane pane) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
tabbedPane = new UITabbedPane(); //k
this.add(tabbedPane, BorderLayout.CENTER); tabbedPane = new CardLayout();
center = new JPanel(tabbedPane);
this.add(center, BorderLayout.CENTER);
attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
initPaneList();
eventPane = new WidgetEventPane(pane); eventPane = new WidgetEventPane(pane);
eventTabPane.add(eventPane, BorderLayout.CENTER); eventTabPane.add(eventPane, BorderLayout.CENTER);
tabbedPane.add(Inter.getLocText("FR-Designer_Attribute"), attriTabPane); //k
tabbedPane.add(Inter.getLocText("FR-Designer_Form_Editing_Listeners"), eventTabPane); center.add(attriTabPane, Inter.getLocText("FR-Designer_Attribute"));
center.add(eventTabPane, Inter.getLocText("FR-Designer_Form_Editing_Listeners"));
final String [] tabTitles = new String[]{Inter.getLocText("FR-Designer_Attribute"), Inter.getLocText("FR-Designer_Form_Editing_Listeners")};
tabsHeaderIconPane = new UIHeadGroup(tabTitles) {
@Override
public void tabChanged(int index) {
tabbedPane.show(center, tabTitles[index]);
}
};
tabsHeaderIconPane.setNeedLeftRightOutLine(false);
this.add(tabsHeaderIconPane, BorderLayout.NORTH);
//数据字典
dictTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); dictTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
dictCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); dictCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
dictTabPane.add(dictCardPane, BorderLayout.CENTER); dictTabPane.add(dictCardPane, BorderLayout.CENTER);
dictCardLayout = new CardLayout(); dictCardLayout = new CardLayout();
dictCardPane.setLayout(dictCardLayout); dictCardPane.setLayout(dictCardLayout);
//构建树
treeTabPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); treeTabPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
widgetPropertyPane = new BasicWidgetPropertySettingPane(); widgetPropertyPane = new BasicWidgetPropertySettingPane();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8)); UIExpandablePane uiExpandablePane = new UIExpandablePane("基本", 280, 20, widgetPropertyPane);
JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Form_Basic_Properties"));
northPane.add(basic); attriTabPane.add(uiExpandablePane, BorderLayout.NORTH);
basic.add(widgetPropertyPane);
attriTabPane.add(northPane, BorderLayout.NORTH);
attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
attriTabPane.add(attriCardPane, BorderLayout.CENTER); attriTabPane.add(attriCardPane, BorderLayout.CENTER);
attriCardLayout = (CardLayout) attriCardPane.getLayout(); attriCardLayout = (CardLayout) attriCardPane.getLayout();
this.setPreferredSize(new Dimension(600, 450)); this.setPreferredSize(new Dimension(600, 450));
} }
private void initPaneList(){
paneList = new ArrayList<JPanel>();
paneList.add(attriTabPane);
paneList.add(eventPane);
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "Widget"; return "Widget";
} }
public void populate(Widget cellWidget) { public void populate(Widget cellWidget) {
initComponents(pane);
// super.populate(cellWidget);
currentEditorDefinePane = null; currentEditorDefinePane = null;
if (cellWidget instanceof NoneWidget) { if (cellWidget instanceof NoneWidget) {
this.tabbedPane.setEnabled(false); // this.tabbedPane.setEnabled(false);
} else { } else {
this.tabbedPane.setEnabled(true); // this.tabbedPane.setEnabled(true);
} }
WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() { WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() {
@ -117,7 +155,7 @@ public class CellWidgetCardPane extends BasicPane {
currentEditorDefinePane = definePane; currentEditorDefinePane = definePane;
eventPane.populate(cellWidget); eventPane.populate(cellWidget);
widgetPropertyPane.populate(cellWidget); widgetPropertyPane.populate(cellWidget);
tabbedPane.setSelectedIndex(0); tabsHeaderIconPane.setSelectedIndex(0);
} }
private void showDictPane(DataCreatorUI ui, String cardName) { private void showDictPane(DataCreatorUI ui, String cardName) {
@ -142,6 +180,7 @@ public class CellWidgetCardPane extends BasicPane {
return null; return null;
} }
widgetPropertyPane.update(widget); widgetPropertyPane.update(widget);
// super.update(widget);
Listener[] listener = eventPane == null ? new Listener[0] : eventPane.updateListeners(); Listener[] listener = eventPane == null ? new Listener[0] : eventPane.updateListeners();
widget.clearListeners(); widget.clearListeners();
@ -164,21 +203,26 @@ public class CellWidgetCardPane extends BasicPane {
private void addDictAttriPane() { private void addDictAttriPane() {
tabbedPane.add(this.dictTabPane, 1); center.add(this.dictTabPane, Inter.getLocText("FR-Designer_DS_Dictionary"));
tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_DS_Dictionary")); reInitHeaderPane(this.dictTabPane);
} }
private void addTreeAttriPane() { private void addTreeAttriPane() {
tabbedPane.add(this.treeTabPane, 1); center.add(this.dictTabPane, Inter.getLocText("FR-Designer_Create_Tree"));
tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_Create_Tree")); reInitHeaderPane(this.treeTabPane);
} }
private void removeDictAttriPane() { private void removeDictAttriPane() {
tabbedPane.remove(this.dictTabPane); center.remove(this.dictTabPane);
} }
private void removeTreeAttriPane() { private void removeTreeAttriPane() {
tabbedPane.remove(this.treeTabPane); center.remove(this.treeTabPane);
}
private void reInitHeaderPane(JPanel jPanel){
paneList.add(jPanel);
// tabsHeaderIconPane = new
} }
} }

6
designer/src/com/fr/design/widget/WidgetDefinePaneFactory.java

@ -4,8 +4,6 @@ import com.fr.base.FRContext;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.core.WidgetConstants; import com.fr.design.gui.core.WidgetConstants;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.widget.ui.*; import com.fr.design.widget.ui.*;
import com.fr.form.ui.*; import com.fr.form.ui.*;
import com.fr.report.web.button.form.TreeNodeToggleButton; import com.fr.report.web.button.form.TreeNodeToggleButton;
@ -77,10 +75,10 @@ public class WidgetDefinePaneFactory {
} }
public static class RN { public static class RN {
private DataModify<? extends Widget> definePane; private DataModify<Widget> definePane;
private String cardName; private String cardName;
public RN(DataModify<? extends Widget> definePane, String cardName) { public RN(DataModify<Widget> definePane, String cardName) {
this.definePane = definePane; this.definePane = definePane;
this.cardName = cardName; this.cardName = cardName;
} }

43
designer/src/com/fr/design/widget/WidgetPane.java

@ -1,14 +1,17 @@
package com.fr.design.widget; package com.fr.design.widget;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.WidgetDesignHandler; import com.fr.design.fun.WidgetDesignHandler;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.CellWidgetPropertyPane;
import com.fr.design.widget.btn.ButtonConstants; import com.fr.design.widget.btn.ButtonConstants;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.*; import com.fr.form.ui.*;
@ -25,11 +28,11 @@ import java.util.Vector;
/** /**
* CellEditorDef Pane. * CellEditorDef Pane.
*/ */
public class WidgetPane extends BasicPane implements ItemListener { public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener {
private EditorTypeComboBox editorTypeComboBox; private EditorTypeComboBox editorTypeComboBox;
private CellWidgetCardPane cellEditorCardPane; private CellWidgetCardPane cellEditorCardPane;
private boolean shouldFireSelectedEvent; private boolean shouldFireSelectedEvent = true;
protected JPanel northPane; protected JPanel northPane;
public WidgetPane() { public WidgetPane() {
@ -45,7 +48,7 @@ public class WidgetPane extends BasicPane implements ItemListener {
protected void initComponents(ElementCasePane pane) { protected void initComponents(ElementCasePane pane) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
@ -58,8 +61,23 @@ public class WidgetPane extends BasicPane implements ItemListener {
cellEditorCardPane = new CellWidgetCardPane(pane); cellEditorCardPane = new CellWidgetCardPane(pane);
this.add(cellEditorCardPane, BorderLayout.CENTER); this.add(cellEditorCardPane, BorderLayout.CENTER);
this.addAttributeChangeListener(listener);
} }
protected JPanel createContentPane(){
return new JPanel();
}
AttributeChangeListener listener = new AttributeChangeListener() {
@Override
public void attributeChange() {
CellWidgetPropertyPane.getInstance().update();
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
};
/** /**
* 状态改变 * 状态改变
* *
@ -84,13 +102,13 @@ public class WidgetPane extends BasicPane implements ItemListener {
} }
@Override @Override
protected String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Widget"); return Inter.getLocText("FR-Designer_Widget");
} }
public void populate(Widget widget) { public void populate(Widget widget) {
if (widget == null) { if (widget == null) {
widget = new TextEditor(); return;
} }
if (widget instanceof NameWidget) { if (widget instanceof NameWidget) {
@ -106,11 +124,16 @@ public class WidgetPane extends BasicPane implements ItemListener {
if (ArrayUtils.contains(ButtonConstants.CLASSES4BUTTON, clazz)) { if (ArrayUtils.contains(ButtonConstants.CLASSES4BUTTON, clazz)) {
clazz = Button.class; clazz = Button.class;
} }
cellEditorCardPane.populate(widget);
shouldFireSelectedEvent = false; shouldFireSelectedEvent = false;
editorTypeComboBox.setSelectedItemByWidgetClass(clazz); editorTypeComboBox.setSelectedItemByWidgetClass(clazz);
shouldFireSelectedEvent = true; shouldFireSelectedEvent = true;
cellEditorCardPane.populate(widget); removeAttributeChangeListener();
initAllListeners();
this.addAttributeChangeListener(listener);
} }
public Widget update() { public Widget update() {
@ -118,7 +141,7 @@ public class WidgetPane extends BasicPane implements ItemListener {
} }
protected void populateWidgetConfig(Widget widget) { protected void populateWidgetConfig(Widget widget) {
cellEditorCardPane.populate(widget); this.populate(widget);
} }
@ -244,4 +267,8 @@ public class WidgetPane extends BasicPane implements ItemListener {
&& ComparatorUtils.equals(((Item) o).name, name); && ComparatorUtils.equals(((Item) o).name, name);
} }
} }
public String getIconPath(){
return "";
}
} }

6
designer/src/com/fr/design/widget/ui/ButtonDefinePane.java

@ -1,14 +1,10 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.widget.ui.btn.ButtonDetailPaneFactory;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.design.widget.DataModify;
import com.fr.design.widget.btn.ButtonDetailPane; import com.fr.design.widget.btn.ButtonDetailPane;
import com.fr.design.widget.ui.btn.ButtonDetailPaneFactory;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;

10
designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java

@ -1,17 +1,14 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.*; import javax.swing.*;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.CheckBox; import com.fr.form.ui.CheckBox;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.design.widget.DataModify;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UITextField text; private UITextField text;
@ -25,12 +22,11 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
JPanel textPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel textPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
textPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); textPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced")); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, textPane);
advancedPane.add(textPane);
textPane.add(new UILabel(Inter.getLocText("Text") + ":")); textPane.add(new UILabel(Inter.getLocText("Text") + ":"));
text = new UITextField(8); text = new UITextField(8);
textPane.add(text); textPane.add(text);
this.add(advancedPane); this.add(uiExpandablePane);
} }
@Override @Override

4
designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java

@ -41,8 +41,6 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
advancedPane.add(attrPane);
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
checkBoxDictPane = new CheckBoxDictPane(); checkBoxDictPane = new CheckBoxDictPane();
@ -61,7 +59,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
centerPane.add(buttonGroupDictPane); centerPane.add(buttonGroupDictPane);
attrPane.add(centerPane, BorderLayout.CENTER); attrPane.add(centerPane, BorderLayout.CENTER);
return advancedPane; return attrPane;
} }
@Override @Override

2
designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java

@ -1 +1 @@
package com.fr.design.widget.ui; import com.fr.base.GraphHelper; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> { private UICheckBox customDataCheckBox; private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; public CustomWritableRepeatEditorPane() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize( new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); } package com.fr.design.widget.ui; import com.fr.base.GraphHelper; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> { private UICheckBox customDataCheckBox; private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; public CustomWritableRepeatEditorPane() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize( new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); } getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); JPanel otherContentPane = this.setForthContentPane(); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); if (otherContentPane != null) { getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); contentPane.add(otherContentPane,BorderLayout.CENTER); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); } getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); return contentPane; getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); } return otherContentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); }

36
designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java

@ -3,12 +3,14 @@ package com.fr.design.widget.ui;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.data.core.FormatField; import com.fr.data.core.FormatField;
import com.fr.design.constants.LayoutConstants;
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;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.DateEditor; import com.fr.form.ui.DateEditor;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
@ -19,8 +21,6 @@ import com.fr.stable.StringUtils;
import com.fr.stable.UtilEvalError; import com.fr.stable.UtilEvalError;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -50,16 +50,10 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override @Override
protected JPanel setSecondContentPane() { protected JPanel setSecondContentPane() {
JPanel otherContentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
otherContentPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST); returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST);
returnTypeComboBox = new UIComboBox(new String[] { Inter.getLocText("String"), Inter.getLocText("Date") }); returnTypeComboBox = new UIComboBox(new String[] { Inter.getLocText("String"), Inter.getLocText("Date") });
returnTypeComboBox.setPreferredSize(new Dimension(70, 20)); returnTypeComboBox.setPreferredSize(new Dimension(70, 20));
returnTypePane.add(returnTypeComboBox, BorderLayout.CENTER);
JPanel firstPanel = GUICoreUtils.createFlowPane(new JComponent[]{returnTypePane}, FlowLayout.LEFT, 5);
firstPanel.setPreferredSize(new Dimension(141,30));
otherContentPane.add(firstPanel);
// sample pane // sample pane
sampleLabel = new UILabel(""); sampleLabel = new UILabel("");
@ -79,9 +73,27 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
}); });
JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),dateFormatComboBox,sampleLabel}, FlowLayout.LEFT, 5); JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),dateFormatComboBox,sampleLabel}, FlowLayout.LEFT, 5);
secondPanel.setPreferredSize(new Dimension(220,30)); secondPanel.setPreferredSize(new Dimension(220,30));
otherContentPane.add(secondPanel);
otherContentPane.add(initStartEndDatePane(), BorderLayout.SOUTH); startDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
return otherContentPane; endDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox },
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), dateFormatComboBox},
new Component[]{null, sampleLabel},
new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv},
new Component[]{new UILabel(Inter.getLocText("FS_End_Date") + ":"), endDv},
};
double[] rowSize = {p, p,p,p,p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1);
return panel;
} }
private String[] getDateFormateArray() { private String[] getDateFormateArray() {

14
designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java

@ -25,16 +25,22 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false); directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false);
directWriteCheckBox.setPreferredSize(new Dimension(100, 30)); directWriteCheckBox.setPreferredSize(new Dimension(100, 30));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{directWriteCheckBox}, FlowLayout.LEFT, 5));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
advancedPane.add(contentPane);
contentPane.add(waterMarkDictPane); contentPane.add(waterMarkDictPane);
JPanel otherContentPane = this.setSecondContentPane(); JPanel otherContentPane = this.setSecondContentPane();
if (otherContentPane != null) { if (otherContentPane != null) {
contentPane.add(otherContentPane); contentPane.add(otherContentPane);
} }
return advancedPane; return contentPane;
}
public JPanel setValidatePane(){
JPanel otherContentPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{directWriteCheckBox}, FlowLayout.LEFT, 5));
return otherContentPane;
} }
protected abstract JPanel setSecondContentPane(); protected abstract JPanel setSecondContentPane();

139
designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java

@ -7,6 +7,8 @@ import java.awt.event.ItemListener;
import javax.swing.*; import javax.swing.*;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
@ -15,18 +17,18 @@ import javax.swing.event.DocumentListener;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.FieldEditor; import com.fr.form.ui.FieldEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> {
private static final int ALLOW_BLANK_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("FR-Designer_Allow_Null") + 30; private static final int ALLOW_BLANK_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("FR-Designer_Allow_Null") + 30;
private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30; private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30;
private UICheckBox allowBlankCheckBox; protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
private UITextField errorMsgTextField; protected UITextField errorMsgTextField;
private UITextField regErrorMsgTextField; protected JPanel validatePane;
private JPanel validatePane;
public FieldEditorDefinePane() { public FieldEditorDefinePane() {
this.initComponents(); this.initComponents();
@ -34,47 +36,19 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
initRegErrorMsgTextField();
//JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane();
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT));
allowBlankCheckBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected());
}
});
initErrorMsgPane(); initErrorMsgPane();
JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane);
this.add(uiExpandablePane, BorderLayout.NORTH);
}
this.addValidatePane();
} }
protected void initRegErrorMsgTextField() {
regErrorMsgTextField = new UITextField(16);
regErrorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
public void insertUpdate(DocumentEvent e) {
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
public void removeUpdate(DocumentEvent e) {
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
});
}
protected void initErrorMsgPane() { protected void initErrorMsgPane() {
// 错误信息 // 错误信息
JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); errorMsgTextField = new UITextField(10);
errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"));
errorMsgTextField = new UITextField(16);
errorMsgPane.add(errorMsgTextField);
// richer:主要为了方便查看比较长的错误信息 // richer:主要为了方便查看比较长的错误信息
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {
@ -91,20 +65,13 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
errorMsgTextField.setToolTipText(errorMsgTextField.getText()); errorMsgTextField.setToolTipText(errorMsgTextField.getText());
} }
}); });
this.addAllowBlankPane(allowBlankCheckBox);
JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) {
//contentPane.add(firstPanel);
this.add(contentPane, BorderLayout.NORTH);
} else {
//this.add(firstPanel, BorderLayout.CENTER);
}
} }
@Override @Override
public void populateBean(T ob) { public void populateBean(T ob) {
this.allowBlankCheckBox.setSelected(ob.isAllowBlank()); this.allowBlankCheckBox.setSelected(ob.isAllowBlank());
errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected()); // errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected());
this.errorMsgTextField.setText(ob.getErrorMessage()); this.errorMsgTextField.setText(ob.getErrorMessage());
populateSubFieldEditorBean(ob); populateSubFieldEditorBean(ob);
@ -126,30 +93,72 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected abstract JPanel setFirstContentPane(); protected abstract JPanel setFirstContentPane();
@Override @Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
} }
public void addAllowBlankPane(UICheckBox allowBlankCheckBox) { protected void addValidatePane() {
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Validate")); validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
validatePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); final UILabel uiLabel = new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":");
validatePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); errorMsgTextField = new UITextField(10);
northPane.add(validatePane); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
this.add(northPane, BorderLayout.CENTER); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
JPanel firstPane = GUICoreUtils.createFlowPane(new JComponent[]{allowBlankCheckBox}, FlowLayout.LEFT, 5); allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT));
validatePane.add(firstPane); allowBlankCheckBox.addItemListener(new ItemListener() {
JPanel secondPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), errorMsgTextField}, FlowLayout.LEFT, 24);
secondPane.setPreferredSize(new Dimension(400, 23));
validatePane.add(secondPane);
}
public JPanel getValidatePane() { @Override
return validatePane; public void itemStateChanged(ItemEvent e) {
boolean isSelected = allowBlankCheckBox.isSelected();
uiLabel.setVisible(!isSelected);
errorMsgTextField.setVisible(!isSelected);
if(isSelected){
uiLabel.setPreferredSize(new Dimension(0, 0));
errorMsgTextField.setPreferredSize(new Dimension(0, 0));
}else{
uiLabel.setPreferredSize(new Dimension(66, 20));
errorMsgTextField.setPreferredSize(new Dimension(150, 20));
}
}
});
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{allowBlankCheckBox, null },
new Component[]{uiLabel, errorMsgTextField},
};
double[] rowSize = {p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1);
validatePane.add(panel, BorderLayout.NORTH);
JPanel contentPane = this.setValidatePane();
if (contentPane != null) {
validatePane.add(contentPane, BorderLayout.CENTER);
}
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Validate"), 280, 20, validatePane);
this.add(uiExpandablePane, BorderLayout.CENTER);
// JPanel firstPane = GUICoreUtils.createFlowPane(new JComponent[]{allowBlankCheckBox}, FlowLayout.LEFT, 5);
// validatePane.add(firstPane);
// JPanel secondPane = new JPanel(FRGUIPaneFactory.createLabelFlowLayout());
// secondPane.add(new UILabel("错误提示" + ":"));
// secondPane.add(errorMsgTextField);
// JPanel secondPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), errorMsgTextField}, FlowLayout.LEFT, 24);
// secondPane.setPreferredSize(new Dimension(400, 23));
// validatePane.add(secondPane);
} }
public UITextField getRegErrorMsgTextField() { public JPanel setValidatePane(){
return regErrorMsgTextField; return null;
} }
} }

32
designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java

@ -5,23 +5,20 @@ import java.util.List;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
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.present.dict.DictionaryPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.IframeEditor; import com.fr.form.ui.IframeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.design.widget.DataModify;
public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> { public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private UITextField srcTextField; private UITextField srcTextField;
@ -35,7 +32,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
JPanel attr = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel attr = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
@ -44,22 +41,23 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
contentPane.add(attr); contentPane.add(attr);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] rowSize = { p, TableLayout.PREFERRED }; double[] rowSize = { p, p, p, p };
double[] columnSize = { p, f }; double[] columnSize = { p, f };
java.awt.Component[][] coms = { java.awt.Component[][] coms = {
{ horizontalCheck, null },
{ verticalCheck, null },
{ new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() }, { new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() },
{ new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; { new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } };
parameterViewPane.setPreferredSize(new Dimension(400, 256)); int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}};
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5);
centerPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
centerPane.add(GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField(16), FlowLayout.LEFT));
centerPane.add(GUICoreUtils.createFlowPane( new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane(), FlowLayout.LEFT)); contentPane.add(panel);
parameterViewPane.setPreferredSize(new Dimension(540, 235));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane);
advancedPane.add(contentPane); this.add(uiExpandablePane, BorderLayout.NORTH);
contentPane.add(centerPane);
this.add(advancedPane, BorderLayout.CENTER);
} }

23
designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java

@ -2,6 +2,7 @@ package com.fr.design.widget.ui;
import java.awt.*; import java.awt.*;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.*; import javax.swing.*;
@ -11,7 +12,8 @@ import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants; import com.fr.design.gui.icombobox.DictionaryConstants;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.MultiFileEditor; import com.fr.form.ui.MultiFileEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -38,27 +40,36 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
fileSizeField = new UINumberField(); fileSizeField = new UINumberField();
fileSizeField.setPreferredSize(new Dimension(80, 18)); fileSizeField.setPreferredSize(new Dimension(80, 18));
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
singleFilePane.add(singleFileCheckBox); singleFilePane.add(singleFileCheckBox);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{singleFilePane}, FlowLayout.LEFT,0));
JPanel allowTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel allowTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
allowTypePane.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); allowTypePane.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
allowTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
allowTypePane.add(new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":")); allowTypePane.add(new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":"));
allowTypePane.add(acceptType); allowTypePane.add(acceptType);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{allowTypePane}, FlowLayout.LEFT,5));
JPanel fileSizePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel fileSizePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
fileSizePane.add(new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":")); fileSizePane.add(new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":"));
fileSizePane.add(fileSizeField); fileSizePane.add(fileSizeField);
fileSizePane.add(new UILabel(" KB")); fileSizePane.add(new UILabel(" KB"));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{fileSizePane}, FlowLayout.LEFT,11));
return centerPane; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{singleFileCheckBox, null },
new Component[]{new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":"), acceptType},
new Component[]{new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":"), fileSizeField},
};
double[] rowSize = {p, p,p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5);
return panel;
} }
@Override @Override

4
designer/src/com/fr/design/widget/ui/NoneWidgetDefinePane.java

@ -1,10 +1,6 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.NoneWidget; import com.fr.form.ui.NoneWidget;
import com.fr.design.widget.DataModify;
/** /**
* *

44
designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java

@ -19,9 +19,10 @@ import javax.swing.text.DefaultFormatter;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.NumberEditor; import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.design.utils.gui.GUICoreUtils;
public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> { public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> {
/** /**
@ -141,7 +142,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}; };
public NumberEditorDefinePane() { public NumberEditorDefinePane() {
this.initComponents(); super();
} }
@ -156,23 +157,21 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
content.setLayout(FRGUIPaneFactory.createBorderLayout()); content.setLayout(FRGUIPaneFactory.createBorderLayout());
// richer:数字的允许直接编辑没有意义 // richer:数字的允许直接编辑没有意义
waterMarkDictPane = new WaterMarkDictPane();
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
content.add(northPane, BorderLayout.NORTH);
waterMarkDictPane = new WaterMarkDictPane(); return waterMarkDictPane;
northPane.add(waterMarkDictPane); }
content.add(northPane, BorderLayout.NORTH);
public JPanel setValidatePane() {
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals")); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
this.decimalLength = new com.fr.design.editor.editor.IntegerEditor(); this.decimalLength = new com.fr.design.editor.editor.IntegerEditor();
this.decimalLength.setColumns(4); this.decimalLength.setColumns(4);
limitNumberPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"}) + ":"), this.decimalLength},
FlowLayout.LEFT, 4);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowDecimalsCheckBox, limitNumberPane}, FlowLayout.LEFT, 4));
this.allowDecimalsCheckBox.addActionListener(actionListener1); this.allowDecimalsCheckBox.addActionListener(actionListener1);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative")); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative"));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowNegativeCheckBox}, FlowLayout.LEFT, 4));
this.allowNegativeCheckBox.addActionListener(actionListener2); this.allowNegativeCheckBox.addActionListener(actionListener2);
this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false);
@ -180,7 +179,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
maxValueSpinner.setPreferredSize(new Dimension(120, 20)); maxValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.maxValueSpinner); setNotAllowsInvalid(this.maxValueSpinner);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMaxValueCheckBox, this.maxValueSpinner}, FlowLayout.LEFT, 4));
this.maxValueSpinner.setVisible(false); this.maxValueSpinner.setVisible(false);
this.setMaxValueCheckBox.addActionListener(actionListener3); this.setMaxValueCheckBox.addActionListener(actionListener3);
this.maxValueSpinner.addChangeListener(changeListener1); this.maxValueSpinner.addChangeListener(changeListener1);
@ -189,15 +187,29 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
minValueSpinner.setPreferredSize(new Dimension(120, 20)); minValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.minValueSpinner); setNotAllowsInvalid(this.minValueSpinner);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMinValueCheckBox, this.minValueSpinner}, FlowLayout.LEFT, 4));
this.minValueSpinner.setVisible(false); this.minValueSpinner.setVisible(false);
this.setMinValueCheckBox.addActionListener(actionListener4); this.setMinValueCheckBox.addActionListener(actionListener4);
this.minValueSpinner.addChangeListener(changeListener2); this.minValueSpinner.addChangeListener(changeListener2);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getRegErrorMsgTextField()}, FlowLayout.LEFT, 24));
return content;
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{allowDecimalsCheckBox, null },
new Component[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"})), decimalLength },
new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinner},
new Component[]{setMinValueCheckBox, minValueSpinner},
};
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 1);
return panel;
} }
@Override @Override
protected void populateSubFieldEditorBean(NumberEditor e) { protected void populateSubFieldEditorBean(NumberEditor e) {
allowDecimalsCheckBox.setSelected(e.isAllowDecimals()); allowDecimalsCheckBox.setSelected(e.isAllowDecimals());
@ -229,7 +241,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
minValueSpinner.setVisible(true); minValueSpinner.setVisible(true);
minValueSpinner.setValue(new Double(e.getMinValue())); minValueSpinner.setValue(new Double(e.getMinValue()));
} }
this.getRegErrorMsgTextField().setText(e.getRegErrorMessage());
this.waterMarkDictPane.populate(e); this.waterMarkDictPane.populate(e);
} }
@ -257,7 +268,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.waterMarkDictPane.update(ob); this.waterMarkDictPane.update(ob);
ob.setRegErrorMessage(this.getRegErrorMsgTextField().getText());
return ob; return ob;
} }

4
designer/src/com/fr/design/widget/ui/RadioDefinePane.java

@ -1,12 +1,8 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.widget.DataModify;
import com.fr.form.ui.Radio; import com.fr.form.ui.Radio;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;

11
designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java

@ -1,16 +1,13 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.BorderLayout;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.RadioGroup; import com.fr.form.ui.RadioGroup;
import com.fr.general.Inter;
public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> { public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> {
private DictionaryPane dictPane; private DictionaryPane dictPane;
@ -30,16 +27,12 @@ public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> {
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
buttonGroupDictPane = new ButtonGroupDictPane(); buttonGroupDictPane = new ButtonGroupDictPane();
buttonGroupDictPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); buttonGroupDictPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
centerPane.add(buttonGroupDictPane); centerPane.add(buttonGroupDictPane);
advancedPane.add(centerPane); return centerPane;
attrPane.add(advancedPane, BorderLayout.CENTER);
return attrPane;
} }
@Override @Override

22
designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java

@ -1,16 +1,12 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.RegExp; import com.fr.form.ui.reg.RegExp;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
@ -26,7 +22,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
regPane = createRegPane(); regPane = createRegPane();
final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() { final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() {
@ -46,9 +41,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
} }
}; };
regPane.addPhoneRegListener(pl); regPane.addPhoneRegListener(pl);
getValidatePane().add(GUICoreUtils.createFlowPane(regPane, FlowLayout.LEFT));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getRegErrorMsgTextField()}, FlowLayout.LEFT, 24));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
waterMarkDictPane.addInputKeyListener(new KeyAdapter() { waterMarkDictPane.addInputKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) { public void keyTyped(KeyEvent e) {
@ -61,15 +53,19 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
regPane.getRegComboBox().addActionListener(new ActionListener() { regPane.getRegComboBox().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem(); RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem();
getRegErrorMsgTextField().setEnabled(regExp.errorMessageEditable());
} }
}); });
advancedPane.add(waterMarkDictPane);
attrPane.add(advancedPane, BorderLayout.NORTH); return waterMarkDictPane;
return attrPane; }
public JPanel setValidatePane(){
return regPane;
} }
protected RegPane createRegPane() { protected RegPane createRegPane() {
return new RegPane(); return new RegPane();
} }
@ -82,14 +78,12 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override @Override
protected void populateSubFieldEditorBean(TextEditor e) { protected void populateSubFieldEditorBean(TextEditor e) {
this.regPane.populate(e.getRegex()); this.regPane.populate(e.getRegex());
getRegErrorMsgTextField().setText(e.getRegErrorMessage());
waterMarkDictPane.populate(e); waterMarkDictPane.populate(e);
} }
@Override @Override
protected TextEditor updateSubFieldEditorBean() { protected TextEditor updateSubFieldEditorBean() {
TextEditor ob = newTextEditorInstance(); TextEditor ob = newTextEditorInstance();
ob.setRegErrorMessage(this.getRegErrorMsgTextField().getText());
ob.setRegex(this.regPane.update()); ob.setRegex(this.regPane.update());
waterMarkDictPane.update(ob); waterMarkDictPane.update(ob);

4
designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java

@ -50,9 +50,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
} }
protected JPanel setSecondContentPane() { protected JPanel setSecondContentPane() {
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
advancedPane.add(contentPane);
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
contentPane.add(contenter,BorderLayout.NORTH); contentPane.add(contenter,BorderLayout.NORTH);
@ -62,7 +60,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
if (otherContentPane != null) { if (otherContentPane != null) {
contentPane.add(otherContentPane,BorderLayout.CENTER); contentPane.add(otherContentPane,BorderLayout.CENTER);
} }
return advancedPane; return contentPane;
} }
protected JPanel setThirdContentPane() { protected JPanel setThirdContentPane() {

4
designer/src/com/fr/design/widget/ui/UserEditorDefinePane.java

@ -1,12 +1,8 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.widget.DataModify;
import com.fr.form.ui.NameWidget; import com.fr.form.ui.NameWidget;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;

6
designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java

@ -3,7 +3,8 @@ package com.fr.design.widget.ui;
import java.awt.event.KeyListener; import java.awt.event.KeyListener;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.*;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -16,8 +17,9 @@ public class WaterMarkDictPane extends JPanel{
public WaterMarkDictPane() { public WaterMarkDictPane() {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
this.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
this.add(new UILabel(Inter.getLocText("WaterMark") + ":")); this.add(new UILabel(Inter.getLocText("WaterMark") + ":"));
waterMarkTextField = new UITextField(16); waterMarkTextField = new UITextField(13);
this.add(waterMarkTextField); this.add(waterMarkTextField);
} }

4
designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java

@ -20,9 +20,7 @@ public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEdi
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
advancedPane.add(contentPane);
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
JPanel contenter=FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); JPanel contenter=FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false); removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false);
@ -31,7 +29,7 @@ public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEdi
JPanel otherContentPane = this.setThirdContentPane(); JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) if (otherContentPane != null)
contentPane.add(otherContentPane,BorderLayout.CENTER); contentPane.add(otherContentPane,BorderLayout.CENTER);
return advancedPane; return contentPane;
} }
protected abstract JPanel setThirdContentPane(); protected abstract JPanel setThirdContentPane();
@Override @Override

3
designer/src/com/fr/design/widget/ui/btn/ButtonDetailPaneFactory.java

@ -3,6 +3,7 @@ package com.fr.design.widget.ui.btn;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.design.widget.btn.ButtonDetailPane; import com.fr.design.widget.btn.ButtonDetailPane;
import com.fr.design.widget.ui.designer.btn.DefaultButtonDetailPane;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
@ -27,7 +28,7 @@ public class ButtonDetailPaneFactory {
static { static {
detailMap.put(Button.class.getName(), DefaultButtonDetailPane.class); detailMap.put(Button.class.getName(), DefaultButtonDetailPane.class);
detailMap.put(FreeButton.class.getName(), FreeButtonDetailPane.class); detailMap.put(FreeButton.class.getName(), com.fr.design.widget.ui.designer.btn.FreeButtonDetailPane.class);
if (StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class) != null) { if (StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class) != null) {
detailMap.put(StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class).getName(), DesignModuleFactory.getButtonDetailPaneClass()); detailMap.put(StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class).getName(), DesignModuleFactory.getButtonDetailPaneClass());
} }

12
designer/src/com/fr/design/widget/ui/btn/DefineAppendColumnRowPane.java

@ -28,18 +28,20 @@ public class DefineAppendColumnRowPane extends BasicPane {
} }
private void initComponents() { private void initComponents() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double rowSize[] = { p, p }; double rowSize[] = { p, p ,p};
double columnSize[] = { p, p, p }; double columnSize[] = { p, f};
crEditor = new ColumnRowEditor(); crEditor = new ColumnRowEditor();
jNumberEditor = new com.fr.design.editor.editor.IntegerEditor(); jNumberEditor = new com.fr.design.editor.editor.IntegerEditor();
rowCountLable = new UILabel(Inter.getLocText("Edit-Row_Count") + ":"); rowCountLable = new UILabel(Inter.getLocText("Edit-Row_Count") + ":");
JPanel lpane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel lpane = FRGUIPaneFactory.createBorderLayout_S_Pane();
lpane.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 0)); lpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
lpane.add(new UILabel(Inter.getLocText("Append_Delete_Row_Message"))); lpane.add(new UILabel(Inter.getLocText("Append_Delete_Row_Message")));
Component[][] components = { { new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"}) + ":"), crEditor, lpane }, { rowCountLable, jNumberEditor } }; Component[][] components = { { new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"}) + ":"), crEditor }, { rowCountLable, jNumberEditor } ,{lpane,null}};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));

4
designer/src/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java

@ -7,11 +7,11 @@ import com.fr.form.ui.FreeButton;
import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane; import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane;
public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton> { public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton> {
private ButtonSytleDefinedPane stylePane; private com.fr.design.widget.ui.designer.btn.ButtonSytleDefinedPane stylePane;
@Override @Override
protected Component createCenterPane() { protected Component createCenterPane() {
return stylePane = new ButtonSytleDefinedPane(); return stylePane = new com.fr.design.widget.ui.designer.btn.ButtonSytleDefinedPane();
} }
@Override @Override

30
designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui.btn; package com.fr.design.widget.ui.btn;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -27,16 +28,33 @@ public class TreeNodeToogleButtonDefinePane<T extends TreeNodeToggleButton> exte
protected void initComponents() { protected void initComponents() {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double rowSize[] = {p}; double rowSize[] = {p};
double columnSize[] = {p, 184}; double columnSize[] = {p, f};
Component[][] n_components = { Component[][] n_components = {
{new UILabel(Inter.getLocText(new String[]{"Form-Button", "Type"}) + ":"), createButtonTypeComboBox()} {new UILabel(Inter.getLocText("FR-Designer_Button-Type") + ":"), createButtonTypeComboBox()},
}; };
JPanel northPane = TableLayoutHelper.createTableLayoutPane(n_components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 0, 8);
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); UIExpandablePane advancedPane = new UIExpandablePane("高级", 280, 20, panel);
advancedPane.add(northPane); this.add(advancedPane);
add(advancedPane, BorderLayout.CENTER);
// setLayout(FRGUIPaneFactory.createBorderLayout());
// double p = TableLayout.PREFERRED;
// double rowSize[] = {p};
// double columnSize[] = {p, 184};
// Component[][] n_components = {
// {new UILabel(Inter.getLocText(new String[]{"Form-Button", "Type"}) + ":"), createButtonTypeComboBox()}
// };
// JPanel northPane = TableLayoutHelper.createTableLayoutPane(n_components, rowSize, columnSize);
// JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
//// advancedPane.add(northPane);
// add(northPane);
} }
@Override @Override

Loading…
Cancel
Save