Browse Source

'conflict'

master
MoMeak 7 years ago
parent
commit
880077452f
  1. 9
      designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java
  2. 7
      designer/src/com/fr/grid/selection/CellSelection.java
  3. 5
      designer/src/com/fr/grid/selection/FloatSelection.java
  4. 2
      designer/src/com/fr/grid/selection/Selection.java
  5. 94
      designer/src/com/fr/poly/PolyBlockProperTable.java
  6. 2
      designer/src/com/fr/poly/creator/ECBlockEditor.java
  7. 3
      designer_base/src/com/fr/design/constants/UIConstants.java
  8. 2
      designer_base/src/com/fr/design/data/datapane/TableDataTree.java
  9. 263
      designer_base/src/com/fr/design/gui/frpane/RegPane.java
  10. 2
      designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java
  11. 2
      designer_base/src/com/fr/design/gui/ibutton/UIRadioButton.java
  12. 2
      designer_base/src/com/fr/design/locale/designer.properties
  13. 2
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  14. 4
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  15. 4
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  16. 2
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  17. 4
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  18. 50
      designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java
  19. 6
      designer_base/src/com/fr/design/mainframe/widget/editors/DataBindingEditor.java
  20. 52
      designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java
  21. 6
      designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java
  22. 5
      designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
  23. 41
      designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicPropertyPane.java
  24. 14
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  25. 48
      designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java
  26. 14
      designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java
  27. 86
      designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java
  28. 18
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java
  29. 27
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java
  30. 39
      designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java
  31. 81
      designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java
  32. 57
      designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java
  33. 70
      designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java
  34. 47
      designer_form/src/com/fr/design/widget/ui/designer/DictEditorDefinePane.java
  35. 34
      designer_form/src/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java
  36. 56
      designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java
  37. 31
      designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java
  38. 60
      designer_form/src/com/fr/design/widget/ui/designer/ListEditorDefinePane.java
  39. 8
      designer_form/src/com/fr/design/widget/ui/designer/MultiFileEditorPane.java
  40. 15
      designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java
  41. 10
      designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  42. 65
      designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java
  43. 99
      designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java
  44. 26
      designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java
  45. 19
      designer_form/src/com/fr/design/widget/ui/designer/component/BackgroundCompPane.java
  46. 115
      designer_form/src/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java
  47. 43
      designer_form/src/com/fr/design/widget/ui/designer/component/MouseActionBackground.java
  48. 27
      designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java
  49. 24
      designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java
  50. 58
      designer_form/src/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java
  51. 10
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  52. 85
      designer_form/src/com/fr/design/widget/ui/designer/layout/WCardLayoutDefinePane.java
  53. 38
      designer_form/src/com/fr/design/widget/ui/designer/layout/WTabFitLayoutDefinePane.java
  54. 56
      designer_form/src/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java

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

@ -12,6 +12,7 @@ import com.fr.form.ui.Widget;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.privilege.finegrain.WidgetPrivilegeControl; import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;
@ -85,8 +86,7 @@ public class CellWidgetPropertyPane extends BasicPane {
} }
public void populate(ElementCasePane ePane) { public void reInit(ElementCasePane ePane){
cellEditorDefPane = new WidgetPane(ePane); cellEditorDefPane = new WidgetPane(ePane);
this.removeAll(); this.removeAll();
this.add(cellEditorDefPane, BorderLayout.CENTER); this.add(cellEditorDefPane, BorderLayout.CENTER);
@ -102,6 +102,11 @@ public class CellWidgetPropertyPane extends BasicPane {
this.populate(editCellElement); this.populate(editCellElement);
} }
public void populate(ElementCasePane ePane) {
Selection editingSelection = ePane.getSelection();
editingSelection.populateWidgetPropertyPane(ePane);
}
public void update() { public void update() {
if (cellElement == null) {// 利用默认的CellElement. if (cellElement == null) {// 利用默认的CellElement.
return; return;

7
designer/src/com/fr/grid/selection/CellSelection.java

@ -18,12 +18,14 @@ import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.imenu.UIMenu; import com.fr.design.gui.imenu.UIMenu;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.mainframe.CellWidgetPropertyPane;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.ElementCasePane.Clear; import com.fr.design.mainframe.ElementCasePane.Clear;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.RowColumnPane; import com.fr.design.report.RowColumnPane;
import com.fr.design.selection.QuickEditor; import com.fr.design.selection.QuickEditor;
import com.fr.form.ui.CellWidget;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.GridUtils; import com.fr.grid.GridUtils;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
@ -687,4 +689,9 @@ public class CellSelection extends Selection {
public void populatePropertyPane(ElementCasePane ePane) { public void populatePropertyPane(ElementCasePane ePane) {
CellElementPropertyPane.getInstance().reInit(ePane); CellElementPropertyPane.getInstance().reInit(ePane);
} }
public void populateWidgetPropertyPane(ElementCasePane ePane){
CellWidgetPropertyPane.getInstance().reInit(ePane);
}
} }

5
designer/src/com/fr/grid/selection/FloatSelection.java

@ -234,4 +234,9 @@ public class FloatSelection extends Selection {
public void populatePropertyPane(ElementCasePane ePane) { public void populatePropertyPane(ElementCasePane ePane) {
CellElementPropertyPane.getInstance().removeAll(); CellElementPropertyPane.getInstance().removeAll();
} }
public void populateWidgetPropertyPane(ElementCasePane ePane){
return;
}
} }

2
designer/src/com/fr/grid/selection/Selection.java

@ -90,6 +90,8 @@ public abstract class Selection implements FCloneable, Serializable , Selectable
public abstract void populatePropertyPane(ElementCasePane ePane); public abstract void populatePropertyPane(ElementCasePane ePane);
public abstract void populateWidgetPropertyPane(ElementCasePane ePane);
@Override @Override
public Selection clone() throws CloneNotSupportedException { public Selection clone() throws CloneNotSupportedException {

94
designer/src/com/fr/poly/PolyBlockProperTable.java

@ -1,17 +1,66 @@
package com.fr.poly; package com.fr.poly;
import java.util.ArrayList; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import javax.swing.table.TableModel; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itable.AbstractPropertyTable; import com.fr.design.mainframe.widget.BasicPropertyPane;
import com.fr.design.gui.itable.PropertyGroup; import com.fr.design.widget.WidgetBoundsPaneFactory;
import com.fr.general.Inter;
import com.fr.poly.group.PolyBoundsGroup; import com.fr.poly.group.PolyBoundsGroup;
import com.fr.poly.group.PolyNameGroup;
import com.fr.report.poly.TemplateBlock; import com.fr.report.poly.TemplateBlock;
public class PolyBlockProperTable extends AbstractPropertyTable { import javax.swing.*;
import java.awt.*;
public class PolyBlockProperTable extends JPanel {
private PolyDesigner designer; private PolyDesigner designer;
private UISpinner x;
private UISpinner y;
private UISpinner width;
private UISpinner height;
private BasicPropertyPane blockPropertyPane;
private boolean isPopulating = false;
private static final int MAX_SPINNER_VALUE = 10000;
public PolyBlockProperTable() {
initPropertyPane();
initListener(this);
}
private void initPropertyPane() {
this.setLayout(new BorderLayout());
blockPropertyPane = new BasicPropertyPane();
UIExpandablePane basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 280, 24, blockPropertyPane);
this.add(basicPane, BorderLayout.NORTH);
x = new UISpinner(0, MAX_SPINNER_VALUE, 1);
y = new UISpinner(0, MAX_SPINNER_VALUE, 1);
width = new UISpinner(0, MAX_SPINNER_VALUE, 1);
height = new UISpinner(0, MAX_SPINNER_VALUE, 1);
UIExpandablePane boundsPane = WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height);
this.add(boundsPane, BorderLayout.CENTER);
}
private void initListener(Container parentComponent) {
for (int i = 0; i < parentComponent.getComponentCount(); i++) {
Component tmpComp = parentComponent.getComponent(i);
if (tmpComp instanceof Container) {
initListener((Container) tmpComp);
}
if (tmpComp instanceof UIObserver) {
((UIObserver) tmpComp).registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
update();
}
});
}
}
}
/** /**
* 初始化属性表 * 初始化属性表
@ -20,16 +69,16 @@ public class PolyBlockProperTable extends AbstractPropertyTable {
* *
*/ */
public void initPropertyGroups(Object source) { public void initPropertyGroups(Object source) {
groups = new ArrayList<PropertyGroup>();
if (source instanceof TemplateBlock) { if (source instanceof TemplateBlock) {
TemplateBlock block = (TemplateBlock) source; TemplateBlock block = (TemplateBlock) source;
PolyNameGroup namegroup = new PolyNameGroup(block); blockPropertyPane.getWidgetNameField().setText(block.getBlockName());
groups.add(new PropertyGroup(namegroup)); final PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget());
PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget());
groups.add(new PropertyGroup(boundsgroup)); x.setValue((int)boundsgroup.getValue(0, 1));
y.setValue((int)boundsgroup.getValue(1, 1));
width.setValue((int)boundsgroup.getValue(2, 1));
height.setValue((int)boundsgroup.getValue(3, 1));
} }
TableModel model = new BeanTableModel();
setModel(model);
this.repaint(); this.repaint();
} }
@ -42,8 +91,23 @@ public class PolyBlockProperTable extends AbstractPropertyTable {
} }
public void populate(PolyDesigner designer) { public void populate(PolyDesigner designer) {
isPopulating = true;
this.designer = designer; this.designer = designer;
initPropertyGroups(this.designer.getEditingTarget()); initPropertyGroups(this.designer.getEditingTarget());
isPopulating = false;
} }
public void update() {
TemplateBlock block = this.designer.getEditingTarget();
if (isPopulating || block == null) {
return;
}
block.setBlockName(blockPropertyPane.getWidgetNameField().getText());
PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget());
boundsgroup.setValue(x.getValue(), 0, 1);
boundsgroup.setValue(y.getValue(), 1, 1);
boundsgroup.setValue(width.getValue(), 2, 1);
boundsgroup.setValue(height.getValue(), 3, 1);
firePropertyEdit();
}
} }

2
designer/src/com/fr/poly/creator/ECBlockEditor.java

@ -143,6 +143,7 @@ public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
} }
QuickEditorRegion.getInstance().populate(editComponent.getCurrentEditor()); QuickEditorRegion.getInstance().populate(editComponent.getCurrentEditor());
CellElementPropertyPane.getInstance().populate(editComponent); CellElementPropertyPane.getInstance().populate(editComponent);
CellWidgetPropertyPane.getInstance().populate(editComponent);
Selection Selection = ((JWorkBook) (HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())).getEditingElementCasePane().getSelection(); Selection Selection = ((JWorkBook) (HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())).getEditingElementCasePane().getSelection();
if (Selection instanceof FloatSelection) { if (Selection instanceof FloatSelection) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
@ -155,6 +156,7 @@ public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance()); EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance());
} }
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());

3
designer_base/src/com/fr/design/constants/UIConstants.java

@ -86,7 +86,8 @@ public interface UIConstants {
public static final Color AUTHORITY_SHEET_DARK = new Color(86, 120, 143); public static final Color AUTHORITY_SHEET_DARK = new Color(86, 120, 143);
public static final Color AUTHORITY_SHEET_LIGHT = new Color(156, 204, 238); public static final Color AUTHORITY_SHEET_LIGHT = new Color(156, 204, 238);
public static final Color AUTHORITY_SHEET_UNSELECTED = new Color(146, 192, 225); public static final Color AUTHORITY_SHEET_UNSELECTED = new Color(146, 192, 225);
public static final Color ATTRIBUTE_PRESS = new Color(0xD8F2FD); public static final Color ATTRIBUTE_PRESS = new Color(0x419BF9);
public static final Color NORMAL_BLUE = new Color(0x419BF9);
public static final Color ATTRIBUTE_NORMAL = new Color(0xDADADD); public static final Color ATTRIBUTE_NORMAL = new Color(0xDADADD);
public static final Color ATTRIBUTE_HOVER = new Color(0xC9C9CD); public static final Color ATTRIBUTE_HOVER = new Color(0xC9C9CD);
public static final Color CHECKBOX_HOVER_SELECTED = new Color(0x3394f0); public static final Color CHECKBOX_HOVER_SELECTED = new Color(0x3394f0);

2
designer_base/src/com/fr/design/data/datapane/TableDataTree.java

@ -74,7 +74,7 @@ public class TableDataTree extends UserObjectRefreshJTree<TableDataSourceOP> {
dim.height += 2; dim.height += 2;
this.setSize(dim); this.setSize(dim);
this.setPreferredSize(dim); this.setPreferredSize(dim);
this.setBackgroundNonSelectionColor(UIConstants.NORMAL_BACKGROUND); this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND);
this.setForeground(UIConstants.FONT_COLOR); this.setForeground(UIConstants.FONT_COLOR);
this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE);
return this; return this;

263
designer_base/src/com/fr/design/gui/frpane/RegPane.java

@ -16,6 +16,8 @@ import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
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;
@ -53,9 +55,10 @@ public class RegPane extends BasicPane {
private RegPhonePane regPhonePane; private RegPhonePane regPhonePane;
private DefaultRegPane defaultRegPane; private DefaultRegPane defaultRegPane;
private CustomRegRexPane customRegRexPane; private CustomRegRexPane customRegRexPane;
protected RegErrorMsgPane regErrorMsgPane;
public UIComboBox getRegComboBox() { public UIComboBox getRegComboBox(){
return regComboBox; return regComboBox;
} }
@ -68,25 +71,20 @@ public class RegPane extends BasicPane {
this.initComponents(); this.initComponents();
} }
private void initComponents() { private void initComponents(){
this.setLayout(new BorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel contentPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
this.add(contentPane, BorderLayout.NORTH);
contentPane.add(new UILabel(Inter.getLocText("FR-Designer_Input_Rule")));
regComboBox = new UIComboBox(regType); regComboBox = new UIComboBox(regType);
regComboBox.setPreferredSize(new Dimension(140, 20));
regComboBox.setRenderer(listCellRender); regComboBox.setRenderer(listCellRender);
UILabel uiLabel = new UILabel();
double f = TableLayout.FILL; uiLabel.setPreferredSize(new Dimension(20, 20));
double p = TableLayout.PREFERRED; contentPane.add(uiLabel);
contentPane.add(regComboBox);
Component[][] components = new Component[][]{ regErrorMsgPane = new RegErrorMsgPane();
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Input_Rule") + " "), regComboBox},
};
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE);
panel.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0));
this.add(panel, BorderLayout.NORTH);
final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
detailedCardLayout = new CardLayout(); detailedCardLayout = new CardLayout();
cardPane.setLayout(detailedCardLayout); cardPane.setLayout(detailedCardLayout);
@ -94,26 +92,35 @@ public class RegPane extends BasicPane {
cardPane.add((regLengthPane = new RegLengthPane()), "Length"); cardPane.add((regLengthPane = new RegLengthPane()), "Length");
cardPane.add((regPhonePane = new RegPhonePane()), "Phone"); cardPane.add((regPhonePane = new RegPhonePane()), "Phone");
cardPane.add((customRegRexPane = new CustomRegRexPane()), "Custom"); cardPane.add((customRegRexPane = new CustomRegRexPane()), "Custom");
cardPane.setBorder(BorderFactory.createEmptyBorder(8, 12, 0, 0));
this.add(cardPane, BorderLayout.CENTER); this.add(cardPane, BorderLayout.CENTER);
regComboBox.addActionListener(new ActionListener() { this.add(regErrorMsgPane, BorderLayout.SOUTH);
regComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
RegExp regExp = (RegExp) regComboBox.getSelectedItem(); RegExp regExp = (RegExp)regComboBox.getSelectedItem();
if (regExp instanceof PhoneReg) { if(regExp instanceof PhoneReg) {
cardPane.setPreferredSize(new Dimension(220, 30));
Object selectItem = regPhonePane.dataTypeComboBox.getSelectedItem(); Object selectItem = regPhonePane.dataTypeComboBox.getSelectedItem();
String regString = selectItem == null ? StringUtils.EMPTY : selectItem.toString(); String regString = selectItem == null ? StringUtils.EMPTY : selectItem.toString();
firePhoneRegAction(regString); firePhoneRegAction(regString);
detailedCardLayout.show(cardPane, "Phone"); detailedCardLayout.show(cardPane, "Phone");
} else { } else {
if (regExp instanceof LengthReg) { if (regExp instanceof LengthReg){
cardPane.setPreferredSize(new Dimension(220, 60));
detailedCardLayout.show(cardPane, "Length"); detailedCardLayout.show(cardPane, "Length");
} else if (regExp instanceof CustomReg) { } else if (regExp instanceof CustomReg){
cardPane.setPreferredSize(new Dimension(220, 30));
detailedCardLayout.show(cardPane, "Custom"); detailedCardLayout.show(cardPane, "Custom");
} else { } else {
cardPane.setPreferredSize(new Dimension(0,0 ));
detailedCardLayout.show(cardPane, "Default"); detailedCardLayout.show(cardPane, "Default");
} }
fireRegChangeAction(); fireRegChangeAction();
} }
if(regExp instanceof NoneReg){
regErrorMsgPane.setVisible(false);
return;
}
regErrorMsgPane.setVisible(true);
} }
}); });
} }
@ -146,19 +153,21 @@ public class RegPane extends BasicPane {
} else { } else {
defaultRegPane.populate(regex); defaultRegPane.populate(regex);
} }
regErrorMsgPane.populate(regex);
} }
public RegExp update() { public RegExp update(){
RegExp regExp = (RegExp) regComboBox.getSelectedItem(); RegExp regExp = (RegExp)regComboBox.getSelectedItem();
regErrorMsgPane.update();
if (regExp instanceof LengthReg) { if (regExp instanceof LengthReg){
return regLengthPane.update(); return regLengthPane.update();
} else if (regExp instanceof PhoneReg) { } else if(regExp instanceof PhoneReg) {
return regPhonePane.update(); return regPhonePane.update();
} else if (regExp instanceof NoneReg || regExp instanceof MailReg || regExp instanceof IDCardReg } else if(regExp instanceof NoneReg || regExp instanceof MailReg || regExp instanceof IDCardReg
|| regExp instanceof PostCardReg || regExp instanceof PhoneReg || regExp instanceof MobileReg) { || regExp instanceof PostCardReg || regExp instanceof PhoneReg || regExp instanceof MobileReg) {
return regExp; return regExp;
} else if (regExp instanceof CustomReg) { }
else if (regExp instanceof CustomReg){
if (customRegRexPane.isEmpty()) { if (customRegRexPane.isEmpty()) {
return new NoneReg(); return new NoneReg();
} }
@ -177,7 +186,7 @@ public class RegPane extends BasicPane {
private static class DefaultRegPane extends DisplayPane { private static class DefaultRegPane extends DisplayPane {
public RegExp regRex; public RegExp regRex;
public DefaultRegPane() { public DefaultRegPane(){
} }
@ -203,7 +212,10 @@ public class RegPane extends BasicPane {
* 添加电话规则监听器 * 添加电话规则监听器
* *
* @param listener 监听器 * @param listener 监听器
*
*
* @date 2014-12-3-下午7:30:55 * @date 2014-12-3-下午7:30:55
*
*/ */
public void addPhoneRegListener(PhoneRegListener listener) { public void addPhoneRegListener(PhoneRegListener listener) {
this.listenerList.add(PhoneRegListener.class, listener); this.listenerList.add(PhoneRegListener.class, listener);
@ -213,7 +225,10 @@ public class RegPane extends BasicPane {
* 移除电话规则监听器 * 移除电话规则监听器
* *
* @param listener 监听器 * @param listener 监听器
*
*
* @date 2014-12-3-下午7:30:55 * @date 2014-12-3-下午7:30:55
*
*/ */
public void removePhoneRegListener(PhoneRegListener listener) { public void removePhoneRegListener(PhoneRegListener listener) {
this.listenerList.remove(PhoneRegListener.class, listener); this.listenerList.remove(PhoneRegListener.class, listener);
@ -223,7 +238,10 @@ public class RegPane extends BasicPane {
* 添加正则监听器 * 添加正则监听器
* *
* @param listener 监听器 * @param listener 监听器
*
*
* @date 2014-12-3-下午7:29:48 * @date 2014-12-3-下午7:29:48
*
*/ */
public void addRegChangeListener(RegChangeListener listener) { public void addRegChangeListener(RegChangeListener listener) {
this.listenerList.add(RegChangeListener.class, listener); this.listenerList.add(RegChangeListener.class, listener);
@ -233,7 +251,10 @@ public class RegPane extends BasicPane {
* 移除正则监听器 * 移除正则监听器
* *
* @param listener 监听器 * @param listener 监听器
*
*
* @date 2014-12-3-下午7:29:48 * @date 2014-12-3-下午7:29:48
*
*/ */
public void removeRegChangeListener(RegChangeListener listener) { public void removeRegChangeListener(RegChangeListener listener) {
this.listenerList.remove(RegChangeListener.class, listener); this.listenerList.remove(RegChangeListener.class, listener);
@ -241,45 +262,41 @@ public class RegPane extends BasicPane {
public class PhoneRegEvent extends EventObject { public class PhoneRegEvent extends EventObject {
private String phoneRegString; private String phoneRegString;
public PhoneRegEvent(Object source, String phoneRegString) { public PhoneRegEvent(Object source, String phoneRegString) {
super(source); super(source);
this.setPhoneRegString(phoneRegString); this.setPhoneRegString(phoneRegString);
} }
public void setPhoneRegString(String phoneRegString) { public void setPhoneRegString(String phoneRegString) {
this.phoneRegString = phoneRegString; this.phoneRegString = phoneRegString;
} }
public String getPhoneRegString() { public String getPhoneRegString() {
return phoneRegString; return phoneRegString;
} }
} }
public class RegChangeEvent extends EventObject { public class RegChangeEvent extends EventObject {
private String regString; private String regString;
public RegChangeEvent(Object source, String regString) { public RegChangeEvent(Object source, String regString) {
super(source); super(source);
this.setRegString(regString); this.setRegString(regString);
} }
public void setRegString(String regString) { public void setRegString(String regString) {
this.regString = regString; this.regString = regString;
} }
public String getRegString() { public String getRegString() {
return regString; return regString;
} }
} }
public interface PhoneRegListener extends EventListener { public interface PhoneRegListener extends EventListener{
/** /**
* 电话规则变化监听 * 电话规则变化监听
* *
* @param e 变化事件 * @param e 变化事件
*
*
* @date 2014-12-3-下午7:29:01 * @date 2014-12-3-下午7:29:01
*
*/ */
void phoneRegChangeAction(PhoneRegEvent e); void phoneRegChangeAction(PhoneRegEvent e);
@ -290,29 +307,28 @@ public class RegPane extends BasicPane {
/** /**
* 正则表达规则变化监听 * 正则表达规则变化监听
* *
*
* @date 2014-12-3-下午7:29:01 * @date 2014-12-3-下午7:29:01
*
*/ */
void regChangeAction(); void regChangeAction();
} }
protected void firePhoneRegAction(String phoneReg) { protected void firePhoneRegAction(String phoneReg) {
Object[] listeners = listenerList.getListenerList(); Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) { for (int i = listeners.length-2; i>=0; i-=2) {
if (listeners[i] == PhoneRegListener.class) { if (listeners[i]==PhoneRegListener.class) {
((PhoneRegListener) listeners[i + 1]).phoneRegChangeAction(new PhoneRegEvent(this, phoneReg)); ((PhoneRegListener)listeners[i+1]).phoneRegChangeAction(new PhoneRegEvent(this , phoneReg));
} }
} }
} }
protected void fireRegChangeAction() { protected void fireRegChangeAction() {
Object[] listeners = listenerList.getListenerList(); Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) { for (int i = listeners.length-2; i>=0; i-=2) {
if (listeners[i] == RegChangeListener.class) { if (listeners[i]==RegChangeListener.class) {
((RegChangeListener) listeners[i + 1]).regChangeAction(); ((RegChangeListener)listeners[i+1]).regChangeAction();
} }
} }
} }
private class RegPhonePane extends DisplayPane { private class RegPhonePane extends DisplayPane {
private static final String EMB_REG1 = "025-85679591"; private static final String EMB_REG1 = "025-85679591";
private static final String EMB_REG2 = "02585679591"; private static final String EMB_REG2 = "02585679591";
@ -322,19 +338,20 @@ public class RegPane extends BasicPane {
private UIComboBox dataTypeComboBox; private UIComboBox dataTypeComboBox;
private final String[] dataType = {EMB_REG1, EMB_REG2, EMB_REG3, Inter.getLocText("FR-Designer_Custom")}; private final String[] dataType = {EMB_REG1, EMB_REG2, EMB_REG3, Inter.getLocText("FR-Designer_Custom")};
DefaultComboBoxModel DefaultComboBoxModel = new DefaultComboBoxModel(dataType); DefaultComboBoxModel DefaultComboBoxModel= new DefaultComboBoxModel(dataType);
public RegPhonePane() { public RegPhonePane() {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
this.add(new UILabel(Inter.getLocText("FR-Designer_Data_Type") + ":")); this.setLayout(FRGUIPaneFactory.createBorderLayout());
dataTypeComboBox = new UIComboBox(DefaultComboBoxModel); dataTypeComboBox = new UIComboBox(DefaultComboBoxModel);
JTextField editFiled = (JTextField) (dataTypeComboBox.getEditor().getEditorComponent()); JTextField editFiled = (JTextField)(dataTypeComboBox.getEditor().getEditorComponent());
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Data_Type")), dataTypeComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(panel);
editFiled.setDocument(new LimitedDocument(LIMIT_LENGTH, REG_PATTERN)); editFiled.setDocument(new LimitedDocument(LIMIT_LENGTH, REG_PATTERN));
dataTypeComboBox.addItemListener(new ItemListener() { dataTypeComboBox.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) { if(e.getStateChange() == ItemEvent.SELECTED) {
if (ComparatorUtils.equals(e.getItem(), dataType[3])) { if(ComparatorUtils.equals(e.getItem(), dataType[3])) {
dataTypeComboBox.setSelectedItem(null); dataTypeComboBox.setSelectedItem(null);
dataTypeComboBox.setEditable(true); dataTypeComboBox.setEditable(true);
firePhoneRegAction(EMB_REG1); firePhoneRegAction(EMB_REG1);
@ -347,9 +364,7 @@ public class RegPane extends BasicPane {
}); });
dataTypeComboBox.setSelectedIndex(0); dataTypeComboBox.setSelectedIndex(0);
firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString()); firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString());
this.add(dataTypeComboBox);
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "PHONE"; return "PHONE";
@ -357,17 +372,17 @@ public class RegPane extends BasicPane {
@Override @Override
public void populate(RegExp regRex) { public void populate(RegExp regRex) {
if (!(regRex instanceof PhoneReg)) { if(!(regRex instanceof PhoneReg)) {
return; return ;
} }
String regstr = ((PhoneReg) regRex).getRegString(); String regstr = ((PhoneReg)regRex).getRegString();
if (checkEmbedded(regstr)) { if (checkEmbedded(regstr)){
DefaultComboBoxModel.addElement(regstr); DefaultComboBoxModel.addElement(regstr);
} }
dataTypeComboBox.setSelectedItem(((PhoneReg) regRex).getRegString()); dataTypeComboBox.setSelectedItem(((PhoneReg)regRex).getRegString());
} }
private boolean checkEmbedded(String regstr) { private boolean checkEmbedded(String regstr){
return !ComparatorUtils.equals(EMB_REG1, regstr) && return !ComparatorUtils.equals(EMB_REG1, regstr) &&
!ComparatorUtils.equals(EMB_REG2, regstr) && !ComparatorUtils.equals(EMB_REG2, regstr) &&
!ComparatorUtils.equals(EMB_REG3, regstr); !ComparatorUtils.equals(EMB_REG3, regstr);
@ -376,7 +391,7 @@ public class RegPane extends BasicPane {
@Override @Override
public RegExp update() { public RegExp update() {
PhoneReg regRex = new PhoneReg(); PhoneReg regRex = new PhoneReg();
regRex.setRegString((String) (dataTypeComboBox.getSelectedItem())); regRex.setRegString((String)(dataTypeComboBox.getSelectedItem()));
return regRex; return regRex;
} }
} }
@ -385,22 +400,25 @@ public class RegPane extends BasicPane {
private UISpinner minLenSpinner; private UISpinner minLenSpinner;
private UISpinner maxLenSpinner; private UISpinner maxLenSpinner;
public RegLengthPane() { public RegLengthPane(){
this.setLayout(new BorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
this.setPreferredSize(new Dimension(210, 56));
minLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); minLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length")), minLenSpinner}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length") + ":"), minLenSpinner },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length")), maxLenSpinner}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length") + ":"), maxLenSpinner},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 1}, {1, 1}}; int[][] rowCount = {{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
this.add(panel);
this.add(panel, BorderLayout.CENTER);
} }
@Override @Override
@ -410,20 +428,20 @@ public class RegPane extends BasicPane {
@Override @Override
public void populate(RegExp regRex) { public void populate(RegExp regRex) {
if (!(regRex instanceof LengthReg)) { if (!(regRex instanceof LengthReg)){
return; return;
} }
int minLength = ((LengthReg) regRex).getMinLen(); int minLength = ((LengthReg)regRex).getMinLen();
int maxLength = ((LengthReg) regRex).getMaxLen(); int maxLength = ((LengthReg)regRex).getMaxLen();
minLenSpinner.setValue(minLength); minLenSpinner.setValue(minLength);
maxLenSpinner.setValue(maxLength); maxLenSpinner.setValue(maxLength);
} }
@Override @Override
public RegExp update() { public RegExp update() {
int startLength = ((Number) minLenSpinner.getValue()).intValue(); int startLength = ((Number)minLenSpinner.getValue()).intValue();
int endLength = ((Number) maxLenSpinner.getValue()).intValue(); int endLength = ((Number)maxLenSpinner.getValue()).intValue();
LengthReg regRex = new LengthReg(); LengthReg regRex = new LengthReg();
regRex.setMinLen(startLength); regRex.setMinLen(startLength);
regRex.setMaxLen(endLength); regRex.setMaxLen(endLength);
@ -432,22 +450,14 @@ public class RegPane extends BasicPane {
} }
} }
private static class CustomRegRexPane extends DisplayPane { private static class CustomRegRexPane extends DisplayPane{
private UITextField regTextField; private UITextField regTextField;
public CustomRegRexPane() { public CustomRegRexPane(){
this.setLayout(new BorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
regTextField = new UITextField(12); this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
regTextField = new UITextField();
double f = TableLayout.FILL; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions")), regTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions")), regTextField},
};
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 2, 1);
this.add(panel); this.add(panel);
} }
@ -458,7 +468,7 @@ public class RegPane extends BasicPane {
@Override @Override
public void populate(RegExp regRex) { public void populate(RegExp regRex) {
if (!(regRex instanceof CustomReg)) { if (!(regRex instanceof CustomReg)){
return; return;
} }
regTextField.setText(regRex.toRegText()); regTextField.setText(regRex.toRegText());
@ -474,26 +484,77 @@ public class RegPane extends BasicPane {
} }
} }
ListCellRenderer listCellRender = new UIComboBoxRenderer() { private static class RegErrorMsgPane extends DisplayPane{
private UITextField regErrorMsgField;
public RegErrorMsgPane(){
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5,0,0,0));
initRegErrorMsgField();
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), regErrorMsgField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(panel);
}
private void initRegErrorMsgField(){
regErrorMsgField = new UITextField();
regErrorMsgField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
regErrorMsgField.setToolTipText(regErrorMsgField.getText());
}
public void insertUpdate(DocumentEvent e) {
regErrorMsgField.setToolTipText(regErrorMsgField.getText());
}
public void removeUpdate(DocumentEvent e) {
regErrorMsgField.setToolTipText(regErrorMsgField.getText());
}
});
}
@Override
protected String title4PopupWindow() {
return "CUSTOM";
}
@Override
public void populate(RegExp regRex) {
if (!(regRex instanceof CustomReg)){
return;
}
regErrorMsgField.setText(regRex.toRegText());
}
@Override
public RegExp update() {
return new CustomReg(regErrorMsgField.getText());
}
public boolean isEmpty() {
return StringUtils.isEmpty(regErrorMsgField.getText());
}
}
ListCellRenderer listCellRender = new UIComboBoxRenderer(){
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) { int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof NoneReg) { if (value instanceof NoneReg){
this.setText(Inter.getLocText("FR-Designer_None")); this.setText(Inter.getLocText("FR-Designer_None"));
} else if (value instanceof LengthReg) { } else if (value instanceof LengthReg){
this.setText(Inter.getLocText("FR-Designer_Length")); this.setText(Inter.getLocText("FR-Designer_Length"));
} else if (value instanceof MailReg) { } else if (value instanceof MailReg){
this.setText(Inter.getLocText("FR-Designer_Email")); this.setText(Inter.getLocText("FR-Designer_Email"));
} else if (value instanceof PhoneReg) { } else if (value instanceof PhoneReg){
this.setText(Inter.getLocText("FR-Designer_Phone")); this.setText(Inter.getLocText("FR-Designer_Phone"));
} else if (value instanceof MobileReg) { } else if (value instanceof MobileReg) {
this.setText(Inter.getLocText("FR-Designer_MobilePhone")); this.setText(Inter.getLocText("FR-Designer_MobilePhone"));
} else if (value instanceof IDCardReg) { } else if (value instanceof IDCardReg){
this.setText(Inter.getLocText("FR-Designer_IDCard")); this.setText(Inter.getLocText("FR-Designer_IDCard"));
} else if (value instanceof PostCardReg) { } else if (value instanceof PostCardReg){
this.setText(Inter.getLocText("FR-Designer_PostCode")); this.setText(Inter.getLocText("FR-Designer_PostCode"));
} else if (value instanceof CustomReg) { } else if (value instanceof CustomReg){
this.setText(Inter.getLocText("FR-Designer_Custom")); this.setText(Inter.getLocText("FR-Designer_Custom"));
} }
return this; return this;

2
designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java

@ -30,7 +30,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
private int addY = -1; private int addY = -1;
private int rollover = -1; private int rollover = -1;
private Color tabBorderColor = new Color(143, 160, 183); private Color tabBorderColor = new Color(143, 160, 183);
private Color[] tabSelectedColor = {new Color(255, 199, 59), new Color(187, 142, 33), new Color(214, 191, 137)}; private Color[] tabSelectedColor = {UIConstants.NORMAL_BLUE, new Color(187, 142, 33), new Color(214, 191, 137)};
/** /**
* 创建UI对象 * 创建UI对象

2
designer_base/src/com/fr/design/gui/ibutton/UIRadioButton.java

@ -43,6 +43,4 @@ public class UIRadioButton extends JRadioButton {
public UIRadioButton(String text, Icon icon, boolean selected) { public UIRadioButton(String text, Icon icon, boolean selected) {
super(text, icon, selected); super(text, icon, selected);
} }
} }

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

@ -2117,3 +2117,5 @@ FR-Designer_Widget_Return_Leaf=return leaf
FR-Designer_Widget_Return_Path=return path FR-Designer_Widget_Return_Path=return path
FR-Designer_Widget_Display_Position=Display Position FR-Designer_Widget_Display_Position=Display Position
FR-Designer_Size_Limit=Size_Limit FR-Designer_Size_Limit=Size_Limit
FR-Designer_Widget_Name=Widget Name
FR-Designer_Coords_And_Size=Coords & Size

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

@ -2113,3 +2113,5 @@ FR-Designer_Widget_Return_Leaf=return leaf
FR-Designer_Widget_Return_Path=return path FR-Designer_Widget_Return_Path=return path
FR-Designer_Widget_Display_Position=Display Position FR-Designer_Widget_Display_Position=Display Position
FR-Designer_Size_Limit=Size_Limit FR-Designer_Size_Limit=Size_Limit
FR-Designer_Widget_Name=Widget Name
FR-Designer_Coords_And_Size=Coords & Size

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

@ -2115,4 +2115,6 @@ FR-Designer_Widget_Error_Tip=
FR-Designer_Widget_Return_Leaf= FR-Designer_Widget_Return_Leaf=
FR-Designer_Widget_Return_Path= FR-Designer_Widget_Return_Path=
FR-Designer_Widget_Display_Position= FR-Designer_Widget_Display_Position=
FR-Designer_Size_Limit=\ FR-Designer_Size_Limit=
FR-Designer_Widget_Name=
FR-Designer_Coords_And_Size=

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

@ -2115,4 +2115,6 @@ FR-Designer_Widget_Error_Tip=
FR-Designer_Widget_Return_Leaf= FR-Designer_Widget_Return_Leaf=
FR-Designer_Widget_Return_Path= FR-Designer_Widget_Return_Path=
FR-Designer_Widget_Display_Position= FR-Designer_Widget_Display_Position=
FR-Designer_Size_Limit=\ FR-Designer_Size_Limit=
FR-Designer_Widget_Name=
FR-Designer_Coords_And_Size=

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

@ -2124,3 +2124,5 @@ FR-Designer_Widget_Return_Leaf=\u7ED3\u679C\u8FD4\u56DE\u53F6\u5B50\u8282\u70B9
FR-Designer_Widget_Return_Path=\u7ED3\u679C\u8FD4\u56DE\u5B8C\u6574\u5C42\u6B21\u8DEF\u5F84 FR-Designer_Widget_Return_Path=\u7ED3\u679C\u8FD4\u56DE\u5B8C\u6574\u5C42\u6B21\u8DEF\u5F84
FR-Designer_Widget_Display_Position=\u663E\u793A\u4F4D\u7F6E FR-Designer_Widget_Display_Position=\u663E\u793A\u4F4D\u7F6E
FR-Designer_Size_Limit=\u5927\u5C0F\u9650\u5236 FR-Designer_Size_Limit=\u5927\u5C0F\u9650\u5236
FR-Designer_Widget_Name=\u63A7\u4EF6\u540D\u79F0
FR-Designer_Coords_And_Size=\u5750\u6807\u00B7\u5C3A\u5BF8

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

@ -2115,4 +2115,6 @@ FR-Designer_Widget_Error_Tip=
FR-Designer_Widget_Return_Leaf= FR-Designer_Widget_Return_Leaf=
FR-Designer_Widget_Return_Path= FR-Designer_Widget_Return_Path=
FR-Designer_Widget_Display_Position= FR-Designer_Widget_Display_Position=
FR-Designer_Size_Limit=\ FR-Designer_Size_Limit=
FR-Designer_Widget_Name=
FR-Designer_Coords_And_Size=

50
designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java

@ -0,0 +1,50 @@
package com.fr.design.mainframe.widget;
import com.fr.design.dialog.BasicPane;
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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by plough on 2017/8/7.
*/
public class BasicPropertyPane extends BasicPane {
protected UITextField widgetName;
public BasicPropertyPane(){
initContentPane();
}
protected void initContentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
widgetName = new UITextField();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Name")), widgetName},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15));
this.add(panel, BorderLayout.NORTH);
}
public UITextField getWidgetNameField() {
return widgetName;
}
@Override
public String title4PopupWindow() {
return "basicProperty";
}
}

6
designer_base/src/com/fr/design/mainframe/widget/editors/DataBindingEditor.java

@ -27,6 +27,8 @@ import com.fr.general.Inter;
* @since 2012-3-29下午5:26:28 * @since 2012-3-29下午5:26:28
*/ */
public class DataBindingEditor extends Editor<DataBinding> { public class DataBindingEditor extends Editor<DataBinding> {
private final static int HORI_GAP = 1;
private final static int VER_GAP = 7;
private TableDataComboBox tableDataComboBox; private TableDataComboBox tableDataComboBox;
private LazyComboBox columnNameComboBox; private LazyComboBox columnNameComboBox;
@ -61,7 +63,7 @@ public class DataBindingEditor extends Editor<DataBinding> {
private void initCompontents() { private void initCompontents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout(HORI_GAP, VER_GAP));
tableDataComboBox = new TableDataComboBox(getTableDataSource()); tableDataComboBox = new TableDataComboBox(getTableDataSource());
tableDataComboBox.setPreferredSize(new Dimension(55, 20)); tableDataComboBox.setPreferredSize(new Dimension(55, 20));
tableDataComboBox.addItemListener(tableDataComboBoxListener); tableDataComboBox.addItemListener(tableDataComboBoxListener);
@ -86,7 +88,7 @@ public class DataBindingEditor extends Editor<DataBinding> {
} }
}); });
columnNameComboBox.setEditable(true); columnNameComboBox.setEditable(true);
this.add(tableDataComboBox, BorderLayout.WEST); this.add(tableDataComboBox, BorderLayout.NORTH);
this.add(columnNameComboBox, BorderLayout.CENTER); this.add(columnNameComboBox, BorderLayout.CENTER);
columnNameComboBox.addItemListener(columnNameComboboxListener); columnNameComboBox.addItemListener(columnNameComboboxListener);
} }

52
designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java

@ -0,0 +1,52 @@
package com.fr.design.widget;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by plough on 2017/8/7.
*/
public class WidgetBoundsPaneFactory {
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)},
};
double[] rowSize = {p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15));
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 280, 24, panel);
}
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Position")), x, y},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer_X_Coordinate"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Y_Coordinate"), SwingConstants.CENTER)},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)},
};
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15));
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 230, 24, panel);
}
}

6
designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java

@ -29,6 +29,8 @@ public class XWTitleLayout extends DedicateLayoutContainer {
*/ */
private static final long serialVersionUID = 5274572473978467325L; private static final long serialVersionUID = 5274572473978467325L;
private static final int INDEX = 0;
public XWTitleLayout() { public XWTitleLayout() {
super(new WTitleLayout("titlePane"), new Dimension()); super(new WTitleLayout("titlePane"), new Dimension());
} }
@ -59,6 +61,10 @@ public class XWTitleLayout extends DedicateLayoutContainer {
return new FRTitleLayoutAdapter(this); return new FRTitleLayoutAdapter(this);
} }
public XCreator getEditingChildCreator(){
return getXCreator(INDEX);
}
/** /**
* 返回容器对应的wlayout * 返回容器对应的wlayout
* *

5
designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java

@ -11,6 +11,7 @@ import javax.swing.plaf.basic.*;
import javax.swing.plaf.metal.*; import javax.swing.plaf.metal.*;
import javax.swing.tree.*; import javax.swing.tree.*;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.*; import com.fr.design.designer.beans.*;
import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
@ -221,7 +222,7 @@ class TreePopup extends JPopupMenu implements ComboPopup{
JTree tree = this.comboBox.getTree(); JTree tree = this.comboBox.getTree();
if(tree != null){ if(tree != null){
scrollPane = new UIScrollPane(tree); scrollPane = new UIScrollPane(tree);
scrollPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); scrollPane.setBorder(null);
add(scrollPane, BorderLayout.CENTER); add(scrollPane, BorderLayout.CENTER);
} }
} }
@ -230,6 +231,8 @@ class TreePopup extends JPopupMenu implements ComboPopup{
updatePopup(); updatePopup();
show(comboBox, 0, comboBox.getHeight()); show(comboBox, 0, comboBox.getHeight());
comboBox.getTree().requestFocus(); comboBox.getTree().requestFocus();
comboBox.getTree().setBackground(UIConstants.TREE_BACKGROUND);
comboBox.getTree().setOpaque(true);
} }
public void hide(){ public void hide(){

41
designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicPropertyPane.java

@ -1,49 +1,12 @@
package com.fr.design.mainframe.widget.ui; package com.fr.design.mainframe.widget.ui;
import com.fr.design.dialog.BasicPane; import com.fr.design.mainframe.widget.BasicPropertyPane;
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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/** /**
* Created by ibm on 2017/8/4. * Created by ibm on 2017/8/4.
*/ */
public class FormBasicPropertyPane extends BasicPane { public class FormBasicPropertyPane extends BasicPropertyPane {
private UITextField widgetName;
public FormBasicPropertyPane(){
initContentPane();
}
protected void initContentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
widgetName = new UITextField();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Form-Widget_Name") + ":"), widgetName},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
this.add(panel, BorderLayout.NORTH);
}
@Override
public String title4PopupWindow() {
return "basicProperty";
}
public void populate(Widget widget) { public void populate(Widget widget) {
widgetName.setText(widget.getWidgetName()); widgetName.setText(widget.getWidgetName());

14
designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -14,6 +14,7 @@ import com.fr.design.widget.ui.designer.component.WidgetAbsoluteBoundPane;
import com.fr.design.widget.ui.designer.component.WidgetBoundPane; import com.fr.design.widget.ui.designer.component.WidgetBoundPane;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.container.WScaleLayout;
import com.fr.form.ui.container.WTitleLayout;
import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.form.ui.widget.CRBoundsWidget;
import javax.swing.*; import javax.swing.*;
@ -129,12 +130,13 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
private void initDefinePane() { private void initDefinePane() {
currentEditorDefinePane = null; currentEditorDefinePane = null;
XCreator creator = xCreator; XCreator creator = xCreator;
if (xCreator instanceof XWScaleLayout) {
if (xCreator.acceptType(XWScaleLayout.class)) { if (xCreator.acceptType(XWScaleLayout.class)) {
if (xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator()) { if (xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator()) {
creator = (XCreator) xCreator.getComponent(0); creator = (XCreator) xCreator.getComponent(0);
} }
} }
if(xCreator.acceptType(XWTitleLayout.class)){
creator = (XCreator) xCreator.getComponent(0);
} }
FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, creator.toData(), new Operator() { FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, creator.toData(), new Operator() {
@Override @Override
@ -166,7 +168,10 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
if (cellWidget instanceof WScaleLayout) { if (cellWidget instanceof WScaleLayout) {
Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget(); Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget();
currentEditorDefinePane.populateBean(((CRBoundsWidget) crBoundsWidget).getWidget()); currentEditorDefinePane.populateBean(((CRBoundsWidget) crBoundsWidget).getWidget());
} else { } else if(cellWidget instanceof WTitleLayout){
CRBoundsWidget crBoundsWidget = ((WTitleLayout) cellWidget).getBodyBoundsWidget();
currentEditorDefinePane.populateBean(crBoundsWidget.getWidget());
}else{
currentEditorDefinePane.populateBean(cellWidget); currentEditorDefinePane.populateBean(cellWidget);
} }
widgetPropertyPane.populate(cellWidget); widgetPropertyPane.populate(cellWidget);
@ -188,6 +193,11 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
xCreator1.resetData(widget); xCreator1.resetData(widget);
xCreator.removeAll(); xCreator.removeAll();
xCreator.add(xCreator1); xCreator.add(xCreator1);
}else if(xCreator instanceof XWTitleLayout){
XCreator xCreator1 = ((XWTitleLayout) xCreator).getXCreator(0);
xCreator1.resetData(widget);
xCreator.removeAll();
xCreator.add(xCreator1);
} else { } else {
xCreator.resetData(widget); xCreator.resetData(widget);
} }

48
designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java

@ -1,27 +1,22 @@
package com.fr.design.parameter; package com.fr.design.parameter;
import com.fr.base.BaseUtils;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.items.FRLayoutTypeItems;
import com.fr.design.designer.properties.items.Item;
import com.fr.design.designer.properties.items.ItemProvider;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
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.utils.gui.GUICoreUtils; import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WParameterLayout;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -33,8 +28,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
private XWParameterLayout root; private XWParameterLayout root;
private UISpinner designerWidth; private UISpinner designerWidth;
private UICheckBox displayReport; private UICheckBox displayReport;
private UITextField background; private AccessibleBackgroundEditor background;
private UITextField displayPosition; private UIButtonGroup hAlignmentPane;
public RootDesignDefinePane(XCreator xCreator) { public RootDesignDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -50,13 +45,12 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane); UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane);
this.add(advanceExpandablePane, BorderLayout.NORTH); this.add(advanceExpandablePane, BorderLayout.NORTH);
JPanel layoutPane = createBoundsPane(); JPanel layoutPane = createBoundsPane();
// layoutPane.setLayout(FRGUIPaneFactory.createBorderLayout());
// layoutPane.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel("设计宽度"), designerWidth}, FlowLayout.LEFT, 4));
UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("Size"), 280, 20, layoutPane); UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("Size"), 280, 20, layoutPane);
this.add(layoutExpandablePane, BorderLayout.CENTER); this.add(layoutExpandablePane, BorderLayout.CENTER);
} }
public JPanel createBoundsPane(){ public JPanel createBoundsPane() {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p}; double[] rowSize = {p};
@ -66,26 +60,32 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
new Component[]{new UILabel(Inter.getLocText("Form-Desin_Width")), designerWidth}, new Component[]{new UILabel(Inter.getLocText("Form-Desin_Width")), designerWidth},
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5,5,5)); panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel; return panel;
} }
public JPanel createAdvancePane(){ public JPanel createAdvancePane() {
displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery")); displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery"));
background = new UITextField(); background = new AccessibleBackgroundEditor();
displayPosition = new UITextField(); Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"),};
Integer[] hAlignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment);
hAlignmentPane.setAllToolTips(new String[]{Inter.getLocText("FR-Designer-StyleAlignment_Left")
, Inter.getLocText("FR-Designer-StyleAlignment_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Right")});
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p,p, p}; double[] rowSize = {p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background},
new Component[]{displayReport, null }, new Component[]{displayReport, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), displayPosition} new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane}
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5,5,5)); panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel; return panel;
} }
@ -96,8 +96,10 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
@Override @Override
public void populateBean(WParameterLayout ob) { public void populateBean(WParameterLayout ob) {
background.setValue(ob.getBackground());
displayReport.setSelected(ob.isDelayDisplayContent()); displayReport.setSelected(ob.isDelayDisplayContent());
designerWidth.setValue(ob.getDesignWidth()); designerWidth.setValue(ob.getDesignWidth());
hAlignmentPane.setSelectedIndex(ob.getPosition());
} }
@ -106,6 +108,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
WParameterLayout wParameterLayout = (WParameterLayout) creator.toData(); WParameterLayout wParameterLayout = (WParameterLayout) creator.toData();
wParameterLayout.setDesignWidth((int) designerWidth.getValue()); wParameterLayout.setDesignWidth((int) designerWidth.getValue());
wParameterLayout.setDelayDisplayContent(displayReport.isSelected()); wParameterLayout.setDelayDisplayContent(displayReport.isSelected());
wParameterLayout.setBackground(wParameterLayout.getBackground());
wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex());
return wParameterLayout; return wParameterLayout;
} }

14
designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java

@ -44,25 +44,25 @@ public class FormWidgetDefinePaneFactoryBase {
defineMap.put(TextEditor.class, new Appearance(TextFieldEditorDefinePane.class, WidgetConstants.TEXT + "")); defineMap.put(TextEditor.class, new Appearance(TextFieldEditorDefinePane.class, WidgetConstants.TEXT + ""));
defineMap.put(NameWidget.class, new Appearance(UserEditorDefinePane.class, "UserDefine")); defineMap.put(NameWidget.class, new Appearance(UserEditorDefinePane.class, "UserDefine"));
defineMap.put(ComboCheckBox.class, new Appearance(ComboCheckBoxDefinePane.class, WidgetConstants.COMBOCHECKBOX + "")); defineMap.put(ComboCheckBox.class, new Appearance(ComboCheckBoxDefinePane.class, WidgetConstants.COMBOCHECKBOX + ""));
defineMap.put(ListEditor.class, new Appearance(ListEditorDefinePane.class, WidgetConstants.LIST + ""));
defineMap.put(ComboBox.class, new Appearance(ComboBoxDefinePane.class, WidgetConstants.COMBOBOX + "")); defineMap.put(ComboBox.class, new Appearance(ComboBoxDefinePane.class, WidgetConstants.COMBOBOX + ""));
defineMap.put(RadioGroup.class, new Appearance(RadioGroupDefinePane.class, WidgetConstants.RADIOGROUP + "")); defineMap.put(RadioGroup.class, new Appearance(RadioGroupDefinePane.class, WidgetConstants.RADIOGROUP + ""));
defineMap.put(CheckBoxGroup.class, new Appearance(CheckBoxGroupDefinePane.class, WidgetConstants.CHECKBOXGROUP + "")); defineMap.put(CheckBoxGroup.class, new Appearance(CheckBoxGroupDefinePane.class, WidgetConstants.CHECKBOXGROUP + ""));
defineMap.put(NoneWidget.class, new Appearance(NoneWidgetDefinePane.class, WidgetConstants.NONE + "")); defineMap.put(NoneWidget.class, new Appearance(NoneWidgetDefinePane.class, WidgetConstants.NONE + ""));
defineMap.put(Button.class, new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + "")); defineMap.put(Button.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(FreeButton.class, new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + "")); defineMap.put(FreeButton.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(WFitLayout.class, new Appearance(FRFitLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"))); defineMap.put(WFitLayout.class, new Appearance(FRFitLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout")));
defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, Inter.getLocText("WLayout-Card-ToolTips"))); defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, Inter.getLocText("WLayout-Card-ToolTips")));
if (StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class) != null) { // if (StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class) != null) {
defineMap.put(StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class), new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + "")); // defineMap.put(StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class), new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + ""));
} // }
defineMap.put(WAbsoluteLayout.class, new Appearance(FRAbsoluteLayoutDefinePane.class, Inter.getLocText("FR-Designer_AbsoluteLayout"))); defineMap.put(WAbsoluteLayout.class, new Appearance(FRAbsoluteLayoutDefinePane.class, Inter.getLocText("FR-Designer_AbsoluteLayout")));
defineMap.put(ElementCaseEditor.class, new Appearance(ElementEditorDefinePane.class, Inter.getLocText("FR-Designer_AbsoluteLayout")));
defineMap.put(WAbsoluteBodyLayout.class, new Appearance(FRAbsoluteBodyLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"))); defineMap.put(WAbsoluteBodyLayout.class, new Appearance(FRAbsoluteBodyLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout")));
defineMap.put(WParameterLayout.class, new Appearance(RootDesignDefinePane.class, Inter.getLocText("FR-Designer_Para-Body"))); defineMap.put(WParameterLayout.class, new Appearance(RootDesignDefinePane.class, Inter.getLocText("FR-Designer_Para-Body")));
defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, "tab")); defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, "tab"));
defineMap.put(WTitleLayout.class, new Appearance(WTitleLayoutDefinePane.class, "tab")); defineMap.put(WCardLayout.class, new Appearance(WCardLayoutDefinePane.class, "tablayout"));
defineMap.put(Label.class, new Appearance(LabelDefinePane.class, "label")); defineMap.put(Label.class, new Appearance(LabelDefinePane.class, "label"));
defineMap.put(WTabFitLayout.class, new Appearance(WTabFitLayoutDefinePane.class, "label")); defineMap.put(WTabFitLayout.class, new Appearance(WTabFitLayoutDefinePane.class, "label"));
defineMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetOptionsMap()); defineMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetOptionsMap());

86
designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java

@ -1,19 +1,26 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;
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.widget.btn.ButtonDetailPane; import com.fr.design.layout.TableLayout;
import com.fr.design.widget.ui.designer.btn.ButtonDetailPaneFactory; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleIconEditor;
import com.fr.design.widget.btn.ButtonConstants;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.FreeButton; import com.fr.general.Inter;
import com.fr.stable.StableUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
public class ButtonDefinePane extends AbstractDataModify<Button> { public abstract class ButtonDefinePane<T extends Button> extends AbstractDataModify<T> {
private ButtonDetailPane detailPane; private UITextField hotkeysTextField;
private UITextField buttonNameTextField;
private AccessibleIconEditor iconPane;
public ButtonDefinePane(XCreator creator){ public ButtonDefinePane(XCreator creator){
super(creator); super(creator);
@ -21,8 +28,31 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
} }
private void initComponent() { private void initComponent() {
setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double rowSize[] = {p, p, p, p, p, p, p};
double columnSize[] = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
iconPane = new AccessibleIconEditor();
hotkeysTextField = new UITextField();
buttonNameTextField = new UITextField();
Component[] backgroundCompPane = createBackgroundComp();
Component[] frFont = createFontPane();
UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background"));
backgroundLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] n_components = {
{new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField},
backgroundCompPane,
frFont,
{new UILabel(Inter.getLocText("FR-Designer_Icon" + ":")), iconPane},
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField}
};
hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, rowCount, 10, 8);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
UIExpandablePane advancedPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, panel);
this.add(advancedPane);
} }
@Override @Override
@ -30,31 +60,33 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
return "Button"; return "Button";
} }
private void resetDetailPane(Button btn, Class cls) { public Component[] createBackgroundComp(){
if (detailPane != null) { return new Component[]{null, null};
remove(detailPane);
}
detailPane = ButtonDetailPaneFactory.createButtonDetailPane(cls, btn);
add(detailPane, BorderLayout.CENTER);
detailPane.addTypeChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
resetDetailPane(null, (Class) e.getSource());
} }
});
this.updateUI(); public Component[] createFontPane(){
return new Component[]{null, null};
} }
@Override @Override
public void populateBean(Button btn) { public void populateBean(T btn) {
resetDetailPane(btn, btn instanceof FreeButton && !((FreeButton) btn).isCustomStyle() ? Button.class : null); hotkeysTextField.setText(btn.getHotkeys());
buttonNameTextField.setText(btn.getLabelName());
iconPane.setValue(btn.getIconName());
populateSubButtonPane(btn);
} }
@Override public abstract void populateSubButtonPane(T e);
public Button updateBean() {
public abstract T updateSubButtonPane();
// resetDetailPane(btn, btn instanceof FreeButton && !((FreeButton) btn).isCustomStyle() ? Button.class : null); @Override
return new Button(); public T updateBean() {
T btn = updateSubButtonPane();
btn.setHotkeys(hotkeysTextField.getText());
btn.setLabelName(buttonNameTextField.getText());
btn.setIconName((String)iconPane.getValue());
return btn;
} }
} }

18
designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java

@ -3,7 +3,9 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
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.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
@ -15,7 +17,8 @@ import java.awt.*;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UITextField text; private UITextField text;
private UITextField fontSizePane; private UISpinner fontSizePane;
private FormWidgetValuePane formWidgetValuePane;
public CheckBoxDefinePane(XCreator xCreator) { public CheckBoxDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -23,9 +26,10 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
} }
private void iniComoponents() { private void iniComoponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
text = new UITextField(); text = new UITextField();
fontSizePane = new UITextField(); fontSizePane = new UISpinner(0, 20, 1, 0);
FormWidgetValuePane formWidgetValuePane = new FormWidgetValuePane(); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -50,13 +54,17 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
@Override @Override
public void populateBean(CheckBox check) { public void populateBean(CheckBox check) {
// text.setText(check.getText()); text.setText(check.getText());
fontSizePane.setValue(check.getFontSize());
formWidgetValuePane.populate(check);
} }
@Override @Override
public CheckBox updateBean() { public CheckBox updateBean() {
CheckBox box = new CheckBox(); CheckBox box = (CheckBox)creator.toData();
box.setText(text.getText()); box.setText(text.getText());
box.setFontSize((int)fontSizePane.getValue());
formWidgetValuePane.update(box);
return box; return box;
} }
} }

27
designer_form/src/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java

@ -2,9 +2,9 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
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.present.dict.DictionaryPane;
@ -17,7 +17,7 @@ import java.awt.*;
public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> { public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> {
private DictionaryPane dictPane; private DictionaryPane dictPane;
private UIHeadGroup returnType;
private UICheckBox checkbox; private UICheckBox checkbox;
public CheckBoxGroupDefinePane(XCreator xCreator) { public CheckBoxGroupDefinePane(XCreator xCreator) {
@ -40,11 +40,26 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
public JPanel createOtherPane(){ public JPanel createOtherPane(){
checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"})); checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"}));
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")};
returnType = new UIHeadGroup(tabTitles) {
@Override
public void tabChanged(int index) {
CheckBoxGroup combo = (CheckBoxGroup) creator.toData();
//todo
if (index == 1) {
combo.setReturnString(true);
} else {
combo.setReturnString(false);
}
}
};
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{checkbox, null }, new Component[]{checkbox, null },
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), new UITextField()}, new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), returnType},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
@ -56,6 +71,11 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override @Override
protected void populateSubButtonGroupBean(CheckBoxGroup ob) { protected void populateSubButtonGroupBean(CheckBoxGroup ob) {
if (ob.isReturnString()) {
returnType.setSelectedIndex(1);
} else {
returnType.setSelectedIndex(0);
}
this.dictPane.populateBean(ob.getDictionary()); this.dictPane.populateBean(ob.getDictionary());
checkbox.setSelected(ob.isChooseAll()); checkbox.setSelected(ob.isChooseAll());
} }
@ -65,7 +85,6 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override @Override
protected CheckBoxGroup updateSubButtonGroupBean() { protected CheckBoxGroup updateSubButtonGroupBean() {
CheckBoxGroup ob = (CheckBoxGroup) creator.toData(); CheckBoxGroup ob = (CheckBoxGroup) creator.toData();
ob.setDictionary(this.dictPane.updateBean()); ob.setDictionary(this.dictPane.updateBean());
ob.setChooseAll(checkbox.isSelected()); ob.setChooseAll(checkbox.isSelected());
return ob; return ob;

39
designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java

@ -2,36 +2,45 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.form.ui.ComboBox; import com.fr.form.ui.ComboBox;
import com.fr.general.Inter;
import javax.swing.*; import java.awt.*;
public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox> {
protected DictionaryPane dictPane;
public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
private UICheckBox removeRepeatCheckBox;
private UITextField waterMarkField;
public ComboBoxDefinePane(XCreator xCreator) { public ComboBoxDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
dictPane = new DictionaryPane();
} }
protected JPanel setForthContentPane () { public UICheckBox createRepeatCheckBox(){
return null; removeRepeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget_No_Repeat"));
return removeRepeatCheckBox;
}
public Component[] createWaterMarkPane() {
waterMarkField = new UITextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkField};
} }
protected void populateSubCustomWritableRepeatEditorBean(ComboBox e) { protected void populateSubDictionaryEditorBean(ComboBox ob){
removeRepeatCheckBox.setSelected(e.isRemoveRepeat()); removeRepeatCheckBox.setSelected(ob.isRemoveRepeat());
this.dictPane.populateBean(e.getDictionary()); formWidgetValuePane.populate(ob);
} }
protected ComboBox updateSubCustomWritableRepeatEditorBean() { protected ComboBox updateSubDictionaryEditorBean(){
ComboBox combo = new ComboBox(); ComboBox combo = (ComboBox) creator.toData();
combo.setDictionary(this.dictPane.updateBean());
combo.setRemoveRepeat(removeRepeatCheckBox.isSelected()); combo.setRemoveRepeat(removeRepeatCheckBox.isSelected());
formWidgetValuePane.update(combo);
return combo; return combo;
} }
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return "ComboBox"; return "ComboBox";
@ -39,6 +48,6 @@ public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox>
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return dictPane; return null;
} }
} }

81
designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java

@ -2,63 +2,61 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
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.form.ui.ComboCheckBox; import com.fr.form.ui.ComboCheckBox;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<ComboCheckBox> { public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private CheckBoxDictPane checkBoxDictPane;
private DictionaryPane dictPane;
private UICheckBox supportTagCheckBox; private UICheckBox supportTagCheckBox;
private UIHeadGroup returnType;
private UITextField waterMarkDictPane;
private UICheckBox removeRepeatCheckBox;
public ComboCheckBoxDefinePane(XCreator xCreator) { public ComboCheckBoxDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
dictPane = new DictionaryPane(); }
checkBoxDictPane = new CheckBoxDictPane();
supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true);
public UICheckBox createRepeatCheckBox(){
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget_No_Repeat"));
return removeRepeatCheckBox;
} }
@Override public Component[] createWaterMarkPane() {
protected JPanel setForthContentPane() { waterMarkDictPane = new UITextField();
JPanel attrPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane};
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); }
JPanel contenter = FRGUIPaneFactory.createBorderLayout_L_Pane();
contenter.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
attrPane.add(contenter);
//是否以标签形式显示
JPanel tagPane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
tagPane.add(supportTagCheckBox);
contenter.add(tagPane, BorderLayout.NORTH);
contenter.add(checkBoxDictPane, BorderLayout.WEST); public JPanel createOtherPane(){
return attrPane; supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true);
}
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")};
returnType = new UIHeadGroup(tabTitles) {
@Override @Override
protected void populateSubCustomWritableRepeatEditorBean(ComboCheckBox e) { public void tabChanged(int index) {
this.dictPane.populateBean(e.getDictionary()); ComboCheckBox combo = (ComboCheckBox) creator.toData();
this.checkBoxDictPane.populate(e); //todo
this.supportTagCheckBox.setSelected(e.isSupportTag()); if (index == 1) {
this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat()); combo.setReturnString(true);
} else {
combo.setReturnString(false);
} }
}
};
public JPanel createOtherPane(){
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UICheckBox(Inter.getLocText("Form-SupportTag")), null }, new Component[]{supportTagCheckBox, null },
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), new UITextField()}, new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), returnType},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
@ -68,19 +66,30 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
return panel; return panel;
} }
@Override protected void populateSubDictionaryEditorBean(ComboCheckBox ob){
protected ComboCheckBox updateSubCustomWritableRepeatEditorBean() { if (ob.isReturnString()) {
ComboCheckBox combo = new ComboCheckBox(); returnType.setSelectedIndex(1);
} else {
returnType.setSelectedIndex(0);
}
waterMarkDictPane.setText(ob.getWaterMark());
formWidgetValuePane.populate(ob);
this.supportTagCheckBox.setSelected(ob.isSupportTag());
this.removeRepeatCheckBox.setSelected(ob.isRemoveRepeat());
}
protected ComboCheckBox updateSubDictionaryEditorBean(){
ComboCheckBox combo = (ComboCheckBox) creator.toData();
formWidgetValuePane.update(combo);
combo.setWaterMark(waterMarkDictPane.getText());
combo.setSupportTag(this.supportTagCheckBox.isSelected()); combo.setSupportTag(this.supportTagCheckBox.isSelected());
combo.setDictionary(this.dictPane.updateBean());
checkBoxDictPane.update(combo);
combo.setRemoveRepeat(removeRepeatCheckBox.isSelected()); combo.setRemoveRepeat(removeRepeatCheckBox.isSelected());
return combo; return combo;
} }
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return dictPane; return null;
} }
@Override @Override

57
designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java

@ -1 +1,56 @@
package com.fr.design.widget.ui.designer; import com.fr.base.GraphHelper; import com.fr.design.designer.creator.XCreator; 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(XCreator xCreator) { super(xCreator); } // @Override // protected JPanel setThirdContentPane() { // JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); // contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); // JPanel otherContentPane = this.setForthContentPane(); // if (otherContentPane != null) { // contentPane.add(otherContentPane,BorderLayout.CENTER); // } // return contentPane; // } public JPanel setValidatePane(){ 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 = super.setValidatePane(); otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{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(); } package com.fr.design.widget.ui.designer;
import com.fr.base.GraphHelper;
import com.fr.design.designer.creator.XCreator;
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(XCreator xCreator) {
super(xCreator);
}
public JPanel setValidatePane(){
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 = super.setValidatePane();
otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 5));
return otherContentPane;
}
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();
}

70
designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java

@ -7,12 +7,15 @@ import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
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.gui.ibutton.UIHeadGroup;
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.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.DateEditor; import com.fr.form.ui.DateEditor;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -34,6 +37,10 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private UIComboBox dateFormatComboBox; private UIComboBox dateFormatComboBox;
private ValueEditorPane startDv; private ValueEditorPane startDv;
private ValueEditorPane endDv; private ValueEditorPane endDv;
private WaterMarkDictPane waterMarkDictPane;
private FormWidgetValuePane formWidgetValuePane;
private UISpinner fontSizePane;
private UIHeadGroup formatHeader;
public DateEditorDefinePane(XCreator xCreator) { public DateEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -48,53 +55,64 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
fontSizePane = new UISpinner(0, 20, 1, 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));
// sample pane // sample pane
sampleLabel = new UILabel(""); sampleLabel = new UILabel("");
sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4)); sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4));
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER); sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont()); sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
JPanel previewPane = FRGUIPaneFactory.createTitledBorderPane("示例");
previewPane.add(sampleLabel);
// content pane // content pane
String[] arr = getDateFormateArray(); String[] arr = getDateFormateArray();
dateFormatComboBox = new UIComboBox(arr); dateFormatComboBox = new UIComboBox(arr);
dateFormatComboBox.setPreferredSize(new Dimension(150,20)); dateFormatComboBox.setPreferredSize(new Dimension(150, 20));
dateFormatComboBox.addActionListener(new ActionListener(){ dateFormatComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){ public void actionPerformed(ActionEvent e) {
refreshPreviewLabel(); refreshPreviewLabel();
} }
}); });
JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),dateFormatComboBox,sampleLabel}, FlowLayout.LEFT, 5);
secondPanel.setPreferredSize(new Dimension(220,30));
startDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null); startDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
endDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null); endDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
initFormatHeader();
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox }, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), dateFormatComboBox}, new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), dateFormatComboBox},
new Component[]{null, sampleLabel}, new Component[]{null, previewPane},
new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv}, new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv},
new Component[]{new UILabel(Inter.getLocText("FS_End_Date") + ":"), endDv}, new Component[]{new UILabel(Inter.getLocText("FS_End_Date") + ":"), endDv},
}; new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark") + ":"), waterMarkDictPane},
double[] rowSize = {p, p,p,p,p}; new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane},
double[] columnSize = {p,f}; new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox}
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1);
};
double[] rowSize = {p, p, p, p, p, p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel; return panel;
} }
protected JPanel setSecondContentPane(){ protected void initFormatHeader() {
return null; String [] tabTitles = getDateFormateArray();
formatHeader = new UIHeadGroup(tabTitles){
protected void tabChanged(int newSelectedIndex) {
} }
};
}
private String[] getDateFormateArray() { private String[] getDateFormateArray() {
return FormatField.getInstance().getDateFormatArray(); return FormatField.getInstance().getDateFormatArray();
} }
@ -137,10 +155,10 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override @Override
protected void populateSubDirectWriteEditorBean(DateEditor e) { protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText(); String formatText = e.getFormatText();
// dateFormatComboBox.setSelectedItem(formatText); dateFormatComboBox.setSelectedItem(formatText);
//
// returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 1 : 0);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 1 : 0);
formWidgetValuePane.populate(e);
populateStartEnd(e); populateStartEnd(e);
} }
@ -150,7 +168,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
ob.setFormatText(this.getSimpleDateFormat().toPattern()); ob.setFormatText(this.getSimpleDateFormat().toPattern());
ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 1); ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 1);
formWidgetValuePane.update(ob);
updateStartEnd(ob); updateStartEnd(ob);
return ob; return ob;
@ -158,6 +176,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
/** /**
* 初始起止日期 * 初始起止日期
*
* @param dateWidgetEditor 日期控件 * @param dateWidgetEditor 日期控件
*/ */
public void populateStartEnd(DateEditor dateWidgetEditor) { public void populateStartEnd(DateEditor dateWidgetEditor) {
@ -179,6 +198,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
/** /**
* 更新日期控件的起止日期 * 更新日期控件的起止日期
*
* @param dateWidgetEditor 日期控件 * @param dateWidgetEditor 日期控件
*/ */
public void updateStartEnd(DateEditor dateWidgetEditor) { public void updateStartEnd(DateEditor dateWidgetEditor) {
@ -199,8 +219,8 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
dateWidgetEditor.setStartText(null); dateWidgetEditor.setStartText(null);
} else { } else {
try { try {
dateWidgetEditor.setStartText(startObject == null ? "" : DateUtils.getDate2Str("MM/dd/yyyy", (Date)startObject)); dateWidgetEditor.setStartText(startObject == null ? "" : DateUtils.getDate2Str("MM/dd/yyyy", (Date) startObject));
} catch(ClassCastException e) { } catch (ClassCastException e) {
//wei : TODO 说明应用的公式不能转化成日期格式,应该做些处理。 //wei : TODO 说明应用的公式不能转化成日期格式,应该做些处理。
} }
} }
@ -217,8 +237,8 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
dateWidgetEditor.setEndText(null); dateWidgetEditor.setEndText(null);
} else { } else {
try { try {
dateWidgetEditor.setEndText(endObject == null ? "" : DateUtils.getDate2Str("MM/dd/yyyy", (Date)endObject)); dateWidgetEditor.setEndText(endObject == null ? "" : DateUtils.getDate2Str("MM/dd/yyyy", (Date) endObject));
} catch(ClassCastException e) { } catch (ClassCastException e) {
} }
} }

47
designer_form/src/com/fr/design/widget/ui/designer/DictEditorDefinePane.java

@ -0,0 +1,47 @@
package com.fr.design.widget.ui.designer;
import com.fr.data.Dictionary;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.form.ui.DictContainedCustomWriteAbleEditor;
import com.fr.general.Inter;
import java.awt.*;
/**
* Created by ibm on 2017/8/6.
*/
public abstract class DictEditorDefinePane<T extends DictContainedCustomWriteAbleEditor> extends CustomWritableRepeatEditorPane<T> {
private AccessibleDictionaryEditor dictionaryEditor;
public DictEditorDefinePane(XCreator xCreator) {
super(xCreator);
}
protected Component[] createDictPane(){
dictionaryEditor = new AccessibleDictionaryEditor();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictionaryEditor};
}
@Override
protected void populateSubCustomWritableRepeatEditorBean(T e) {
populateSubDictionaryEditorBean(e);
dictionaryEditor.setValue(e.getDictionary());
}
@Override
protected T updateSubCustomWritableRepeatEditorBean() {
T e = updateSubDictionaryEditorBean();
e.setDictionary((Dictionary) dictionaryEditor.getValue());
return e;
}
protected abstract void populateSubDictionaryEditorBean(T e);
protected abstract T updateSubDictionaryEditorBean();
}

34
designer_form/src/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java

@ -3,7 +3,6 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.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;
@ -18,8 +17,7 @@ import java.awt.*;
//richer:需要提供能否直接编辑的控件设置面板——下拉框、复选框、时间、日期、下拉树 //richer:需要提供能否直接编辑的控件设置面板——下拉框、复选框、时间、日期、下拉树
public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> extends FieldEditorDefinePane<T> { public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> extends FieldEditorDefinePane<T> {
public UICheckBox directWriteCheckBox; public UICheckBox directWriteCheckBox;
protected WaterMarkDictPane waterMarkDictPane; protected FormWidgetValuePane formWidgetValuePane;
protected UICheckBox removeRepeatCheckBox;
public DirectWriteEditorDefinePane(XCreator xCreator) { public DirectWriteEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -29,17 +27,17 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
waterMarkDictPane = new WaterMarkDictPane(); Component[] removeRepeatPane = new Component[]{createRepeatCheckBox(), null};
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget_No_Repeat")); Component[] dicPane = createDictPane();
FormWidgetValuePane formWidgetValuePane = new FormWidgetValuePane(); Component[] waterMarkComponent = createWaterMarkPane();
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), new UITextField()}, dicPane,
new Component[]{removeRepeatCheckBox, null}, removeRepeatPane,
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}, waterMarkComponent,
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
}; };
double[] rowSize = {p, p, p, p, p, p,p}; double[] rowSize = {p, p, p, p, p, p,p};
@ -56,6 +54,18 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
return advancePane; return advancePane;
} }
public UICheckBox createRepeatCheckBox(){
return null;
}
public Component[] createWaterMarkPane() {
return new Component[]{null, null};
}
protected Component[] createDictPane(){
return new Component[]{null, null};
}
public JPanel createOtherPane(){ public JPanel createOtherPane(){
return null; return null;
} }
@ -73,8 +83,6 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
@Override @Override
protected void populateSubFieldEditorBean(T e) { protected void populateSubFieldEditorBean(T e) {
this.directWriteCheckBox.setSelected(e.isDirectEdit()); this.directWriteCheckBox.setSelected(e.isDirectEdit());
this.waterMarkDictPane.populate(e);
removeRepeatCheckBox.setSelected(e.isChartRelated());
populateSubDirectWriteEditorBean(e); populateSubDirectWriteEditorBean(e);
} }
@ -83,9 +91,7 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
@Override @Override
protected T updateSubFieldEditorBean() { protected T updateSubFieldEditorBean() {
T e = updateSubDirectWriteEditorBean(); T e = updateSubDirectWriteEditorBean();
e.setDirectEdit(directWriteCheckBox.isSelected()); e.setDirectEdit(directWriteCheckBox.isSelected());
this.waterMarkDictPane.update(e);
return e; return e;
} }

56
designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java

@ -0,0 +1,56 @@
package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.style.FRFontPane;
import com.fr.design.widget.ui.designer.component.BackgroundCompPane;
import com.fr.design.widget.ui.designer.component.MouseActionBackground;
import com.fr.form.ui.FreeButton;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by ibm on 2017/8/6.
*/
public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
private BackgroundCompPane backgroundCompPane;
private FRFontPane frFontPane;
public FreeButtonDefinePane(XCreator xcreator) {
super(xcreator);
}
public Component[] createBackgroundComp() {
backgroundCompPane = new BackgroundCompPane();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background") + ":"), backgroundCompPane};
}
public Component[] createFontPane() {
UILabel fontLabel = new UILabel(Inter.getLocText("FR-Designer_Font"));
fontLabel.setVerticalAlignment(SwingConstants.TOP);
frFontPane = new FRFontPane();
return new Component[]{fontLabel, frFontPane};
}
public void populateSubButtonPane(FreeButton e) {
MouseActionBackground mouseActionBackground = new MouseActionBackground(e.getInitialBackground(), e.getOverBackground(), e.getClickBackground());
backgroundCompPane.populate(mouseActionBackground);
FRFont frFont = e.getFont();
if (frFont != null) {
frFontPane.populateBean(e.getFont());
}
}
public FreeButton updateSubButtonPane() {
FreeButton freeButton = (FreeButton) creator.toData();
MouseActionBackground mouseActionBackground = backgroundCompPane.update();
freeButton.setInitialBackground(mouseActionBackground.getInitialBackground());
freeButton.setOverBackground(mouseActionBackground.getOverBackground());
freeButton.setClickBackground(mouseActionBackground.getClickBackground());
frFontPane.update(freeButton.getFont());
return freeButton;
}
}

31
designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java

@ -1,16 +1,19 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.base.BaseUtils;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.style.FRFontPane;
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.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.Label; import com.fr.form.ui.Label;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -23,6 +26,8 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
private FormWidgetValuePane formWidgetValuePane; private FormWidgetValuePane formWidgetValuePane;
private UICheckBox isPageSetupVertically; private UICheckBox isPageSetupVertically;
private UICheckBox isStyleAlignmentWrapText; private UICheckBox isStyleAlignmentWrapText;
private UIButtonGroup hAlignmentPane;
private FRFontPane frFontPane;
public LabelDefinePane(XCreator xCreator) { public LabelDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -37,23 +42,33 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
} }
public JPanel createAdvancePane() { public JPanel createAdvancePane() {
formWidgetValuePane = new FormWidgetValuePane(); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
isPageSetupVertically = new UICheckBox(Inter.getLocText("FR-Designer_PageSetup-Vertically")); isPageSetupVertically = new UICheckBox(Inter.getLocText("FR-Designer_PageSetup-Vertically"));
isStyleAlignmentWrapText = new UICheckBox(Inter.getLocText("FR-Designer_StyleAlignment-Wrap_Text")); isStyleAlignmentWrapText = new UICheckBox(Inter.getLocText("FR-Designer_StyleAlignment-Wrap_Text"));
Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"),};
Integer[] hAlignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment);
hAlignmentPane.setAllToolTips(new String[]{Inter.getLocText("FR-Designer-StyleAlignment_Left")
, Inter.getLocText("FR-Designer-StyleAlignment_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Right")});
frFontPane = new FRFontPane();
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
UILabel fontLabel = new UILabel(Inter.getLocText("FR-Designer_Font-Size"));
fontLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{isStyleAlignmentWrapText, null}, new Component[]{isStyleAlignmentWrapText, null},
new Component[]{isPageSetupVertically, null}, new Component[]{isPageSetupVertically, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Display_Position")), new UITextField()}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Display_Position")), hAlignmentPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), new UITextField()}, new Component[]{fontLabel, frFontPane},
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel; return panel;
} }
@ -64,16 +79,22 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
@Override @Override
public void populateBean(Label ob) { public void populateBean(Label ob) {
formWidgetValuePane.populate(ob);
isStyleAlignmentWrapText.setSelected(ob.isAutoLine()); isStyleAlignmentWrapText.setSelected(ob.isAutoLine());
isPageSetupVertically.setSelected(ob.isVerticalCenter()); isPageSetupVertically.setSelected(ob.isVerticalCenter());
hAlignmentPane.setSelectedIndex(ob.getTextalign());
frFontPane.populateBean(ob.getFont());
} }
@Override @Override
public Label updateBean() { public Label updateBean() {
Label layout = (Label) creator.toData(); Label layout = (Label) creator.toData();
formWidgetValuePane.update(layout);
layout.setAutoLine(isStyleAlignmentWrapText.isSelected()); layout.setAutoLine(isStyleAlignmentWrapText.isSelected());
layout.setVerticalCenter(isPageSetupVertically.isSelected()); layout.setVerticalCenter(isPageSetupVertically.isSelected());
layout.setTextalign(hAlignmentPane.getSelectedIndex());
layout.setFont(frFontPane.update(layout.getFont()));
return layout; return layout;
} }
} }

60
designer_form/src/com/fr/design/widget/ui/designer/ListEditorDefinePane.java

@ -1,60 +0,0 @@
package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.ListEditor;
import com.fr.general.Inter;
import javax.swing.*;
public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor> {
private UICheckBox needHeadCheckBox;
private DictionaryPane dictPane;
public ListEditorDefinePane() {
this.initComponents();
}
@Override
protected void initComponents() {
super.initComponents();
dictPane = new DictionaryPane();
}
@Override
protected JPanel setThirdContentPane() {
JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel centerPane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
centerPane.add(needHeadCheckBox = new UICheckBox(Inter.getLocText("List-Need_Head")));
contenter.add(centerPane);
return contenter;
}
@Override
public String title4PopupWindow() {
return "List";
}
@Override
protected void populateSubWriteUnableRepeatBean(ListEditor e) {
needHeadCheckBox.setSelected(e.isNeedHead());
this.dictPane.populateBean(e.getDictionary());
}
@Override
protected ListEditor updateSubWriteUnableRepeatBean() {
ListEditor ob = new ListEditor();
ob.setNeedHead(needHeadCheckBox.isSelected());
ob.setDictionary(this.dictPane.updateBean());
return ob;
}
@Override
public DataCreatorUI dataUI() {
return dictPane;
}
}

8
designer_form/src/com/fr/design/widget/ui/designer/MultiFileEditorPane.java

@ -5,8 +5,8 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.DictionaryComboBox; 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.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
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;
@ -20,7 +20,7 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
private DictionaryComboBox acceptType; private DictionaryComboBox acceptType;
private UICheckBox singleFileCheckBox; private UICheckBox singleFileCheckBox;
private UINumberField fileSizeField; private UINumberField fileSizeField;
private UITextField fontSizeField; private UISpinner fontSizeField;
public MultiFileEditorPane(XCreator xCreator) { public MultiFileEditorPane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -37,7 +37,7 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays); acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays);
singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD")); singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD"));
fileSizeField = new UINumberField(); fileSizeField = new UINumberField();
fontSizeField = new UITextField(); fontSizeField = new UISpinner(0, 20, 1, 0);
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));
@ -77,6 +77,7 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
acceptType.setSelectedItem(e.getAccept()); acceptType.setSelectedItem(e.getAccept());
singleFileCheckBox.setSelected(e.isSingleFile()); singleFileCheckBox.setSelected(e.isSingleFile());
fileSizeField.setValue(e.getMaxSize()); fileSizeField.setValue(e.getMaxSize());
fontSizeField.setValue(e.getFontSize());
} }
@Override @Override
@ -85,6 +86,7 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
ob.setAccept((String) acceptType.getSelectedItem()); ob.setAccept((String) acceptType.getSelectedItem());
ob.setSingleFile(singleFileCheckBox.isSelected()); ob.setSingleFile(singleFileCheckBox.isSelected());
ob.setMaxSize(fileSizeField.getValue()); ob.setMaxSize(fileSizeField.getValue());
ob.setFontSize((int)fontSizeField.getValue());
return ob; return ob;
} }

15
designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java

@ -4,7 +4,6 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.itextfield.UITextField;
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.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
@ -23,7 +22,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
public NumberEditorDefinePane(XCreator xCreator){ public NumberEditorDefinePane(XCreator xCreator){
super(xCreator); super(xCreator);
} }
private FormWidgetValuePane formWidgetValuePane;
/** /**
* *
*/ */
@ -154,13 +153,13 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
// richer:数字的允许直接编辑没有意义 // richer:数字的允许直接编辑没有意义
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
FormWidgetValuePane formWidgetValuePane = new FormWidgetValuePane(); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel("控件值"), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel("水印"), waterMarkDictPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane},
new Component[]{new UILabel("字体大小"), new UITextField()} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p,f}; double[] columnSize = {p,f};
@ -217,7 +216,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 3); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 3);
return panel; return panel;
} }
@ -252,6 +250,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
minValueSpinner.setEnabled(true); minValueSpinner.setEnabled(true);
minValueSpinner.setValue(new Double(e.getMinValue())); minValueSpinner.setValue(new Double(e.getMinValue()));
} }
formWidgetValuePane.populate(e);
// this.regErrorMsgTextField.setText(e.getRegErrorMessage()); // this.regErrorMsgTextField.setText(e.getRegErrorMessage());
this.waterMarkDictPane.populate(e); this.waterMarkDictPane.populate(e);
} }
@ -260,6 +259,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
protected NumberEditor updateSubFieldEditorBean() { protected NumberEditor updateSubFieldEditorBean() {
NumberEditor ob = new NumberEditor(); NumberEditor ob = new NumberEditor();
formWidgetValuePane.update(ob);
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); ob.setAllowDecimals(allowDecimalsCheckBox.isSelected());
if (allowDecimalsCheckBox.isSelected()) { if (allowDecimalsCheckBox.isSelected()) {
ob.setMaxDecimalLength(this.decimalLength.getValue()); ob.setMaxDecimalLength(this.decimalLength.getValue());
@ -280,7 +280,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.waterMarkDictPane.update(ob); this.waterMarkDictPane.update(ob);
// ob.setRegErrorMessage(this.regErrorMsgTextField.getText());
return ob; return ob;
} }

10
designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java

@ -8,13 +8,10 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
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.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -34,7 +31,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
// fontSizePane = new UISpinner(0,20,1);
regPane = createRegPane(); regPane = createRegPane();
final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() { final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() {
@ -72,7 +68,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
// }); // });
formWidgetValuePane = new FormWidgetValuePane(); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -106,18 +102,16 @@ 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());
// regErrorMsgTextField.setText(e.getRegErrorMessage());
waterMarkDictPane.setText(e.getWaterMark()); waterMarkDictPane.setText(e.getWaterMark());
formWidgetValuePane.populate(e);
} }
@Override @Override
protected TextEditor updateSubFieldEditorBean() { protected TextEditor updateSubFieldEditorBean() {
TextEditor ob = newTextEditorInstance(); TextEditor ob = newTextEditorInstance();
// ob.setRegErrorMessage(this.regErrorMsgTextField.getText());
ob.setRegex(this.regPane.update()); ob.setRegex(this.regPane.update());
ob.setWaterMark(waterMarkDictPane.getText()); ob.setWaterMark(waterMarkDictPane.getText());
formWidgetValuePane.update(ob); formWidgetValuePane.update(ob);
// ob.setFontSize((int)fontSizePane.getValue());
return ob; return ob;
} }

65
designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java

@ -2,75 +2,46 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.TreeComboBoxEditor;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*; import java.awt.*;
public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> { public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane {
protected TreeSettingPane treeSettingPane;
protected TreeRootPane treeRootPane; protected UITextField waterMarkDictPane;
public TreeComboBoxEditorDefinePane(XCreator xCreator) { public TreeComboBoxEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
} }
public Component[] createWaterMarkPane(){
@Override waterMarkDictPane = new UITextField();
protected JPanel setForthContentPane() { return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane};
JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane();
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
treeRootPane = new TreeRootPane();
content.add(treeRootPane, BorderLayout.NORTH);
treeSettingPane = new TreeSettingPane(true);
return content;
}
public JPanel createOtherPane(){
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UICheckBox(Inter.getLocText("Tree-Mutiple_Selection_Or_Not"))},
new Component[]{new UICheckBox(Inter.getLocText("Widget-Load_By_Async"))},
new Component[]{new UICheckBox(Inter.getLocText("FR-Designer_Widget_Return_Leaf"))},
new Component[]{new UICheckBox(Inter.getLocText("FR-Designer_Widget_Return_Path"))}
};
double[] rowSize = {p, p,p,p};
double[] columnSize = {p};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
return panel;
} }
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return "treecombobox"; return "treecombobox";
} }
@Override protected void populateSubDictionaryEditorBean(TreeEditor ob){
protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) { super.populateSubDictionaryEditorBean(ob);
// treeSettingPane.populate(e); formWidgetValuePane.populate(ob);
// treeRootPane.populate(e.getTreeAttr()); waterMarkDictPane.setText(ob.getWaterMark());
} }
@Override protected TreeEditor updateSubDictionaryEditorBean(){
protected TreeComboBoxEditor updateSubCustomWritableRepeatEditorBean() { TreeEditor editor = super.updateSubDictionaryEditorBean();
TreeComboBoxEditor editor = (TreeComboBoxEditor)creator.toData(); formWidgetValuePane.update(editor);
editor.setTreeAttr(treeRootPane.update()); editor.setWaterMark(waterMarkDictPane.getText());
return editor; return editor;
} }
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return treeSettingPane; return treeSettingPane;

99
designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java

@ -4,13 +4,11 @@ import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane; import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
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.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -21,74 +19,37 @@ import java.awt.*;
/* /*
* richer:tree editor * richer:tree editor
*/ */
public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> { public class TreeEditorDefinePane extends DictEditorDefinePane<TreeEditor> {
protected TreeSettingPane treeSettingPane; protected TreeSettingPane treeSettingPane;
protected TreeRootPane treeRootPane; protected TreeRootPane treeRootPane;
private FormWidgetValuePane formWidgetValuePane; private UICheckBox mutiSelect;
private UICheckBox loadAsync;
private UICheckBox returnLeaf;
private UICheckBox returnPath;
private UICheckBox removeRepeatCheckBox; public TreeEditorDefinePane(XCreator xCreator) {
public TreeEditorDefinePane(XCreator xCreator){
super(xCreator); super(xCreator);
}
@Override
protected void populateSubFieldEditorBean(TreeEditor e) {
this.treeSettingPane.populate(e);
treeRootPane.populate(e.getTreeAttr());
if (this.removeRepeatCheckBox != null) {
this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat());
}
}
@Override
protected TreeEditor updateSubFieldEditorBean() {
TreeEditor editor = treeSettingPane.updateTreeEditor();
editor.setTreeAttr(treeRootPane.update());
if (this.removeRepeatCheckBox != null) {
editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected());
}
return editor;
}
@Override
protected JPanel setFirstContentPane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
treeRootPane = new TreeRootPane(); treeRootPane = new TreeRootPane();
treeSettingPane = new TreeSettingPane(true); treeSettingPane = new TreeSettingPane(true);
formWidgetValuePane = new FormWidgetValuePane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), new UITextField()},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
};
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, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
jPanel.add(panel, BorderLayout.NORTH);
JPanel otherContentPane = this.createOtherPane();
jPanel.add(otherContentPane,BorderLayout.CENTER);
return jPanel;
} }
public JPanel createOtherPane(){ public JPanel createOtherPane() {
mutiSelect = new UICheckBox(Inter.getLocText("Tree-Mutiple_Selection_Or_Not"));
loadAsync = new UICheckBox(Inter.getLocText("Widget-Load_By_Async"));
returnLeaf = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Return_Leaf"));
returnPath = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Return_Path"));
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UICheckBox(Inter.getLocText("Tree-Mutiple_Selection_Or_Not"))}, new Component[]{mutiSelect},
new Component[]{new UICheckBox(Inter.getLocText("Widget-Load_By_Async"))}, new Component[]{loadAsync},
new Component[]{new UICheckBox(Inter.getLocText("FR-Designer_Widget_Return_Leaf"))}, new Component[]{returnLeaf},
new Component[]{new UICheckBox(Inter.getLocText("FR-Designer_Widget_Return_Path"))} new Component[]{returnPath}
}; };
double[] rowSize = {p, p,p,p}; double[] rowSize = {p, p, p, p};
double[] columnSize = {p}; double[] columnSize = {p};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel; return panel;
} }
@ -97,6 +58,28 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
return "tree"; return "tree";
} }
protected void populateSubDictionaryEditorBean(TreeEditor e){
formWidgetValuePane.populate(e);
treeSettingPane.populate(e);
treeRootPane.populate(e.getTreeAttr());
mutiSelect.setSelected(e.isMultipleSelection());
loadAsync.setSelected(e.isAjax());
returnLeaf.setSelected(e.isSelectLeafOnly());
returnPath.setSelected(e.isReturnFullPath());
}
protected TreeEditor updateSubDictionaryEditorBean(){
TreeEditor editor = (TreeEditor)creator.toData();
formWidgetValuePane.update(editor);
editor.setTreeAttr(treeRootPane.update());
editor.setMultipleSelection(mutiSelect.isSelected());
editor.setAjax(loadAsync.isSelected());
editor.setSelectLeafOnly(returnLeaf.isSelected());
editor.setReturnFullPath(returnPath.isSelected());
return editor;
}
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return treeSettingPane; return treeSettingPane;

26
designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java

@ -1,34 +1,28 @@
package com.fr.design.widget.ui.designer.btn; package com.fr.design.widget.ui.designer.btn;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.*;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
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.widget.ui.designer.AbstractDataModify; import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.widget.ui.designer.ButtonGroupDictPane; import com.fr.design.widget.ui.designer.ButtonGroupDictPane;
import com.fr.design.widget.ui.designer.FieldEditorDefinePane; import com.fr.design.widget.ui.designer.FieldEditorDefinePane;
import com.fr.design.widget.ui.designer.WaterMarkDictPane;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.ButtonGroup; import com.fr.form.ui.ButtonGroup;
import com.fr.general.Inter; import com.fr.general.Inter;
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.ItemEvent;
import java.awt.event.ItemListener;
/** /**
* Created by ibm on 2017/8/5. * Created by ibm on 2017/8/5.
*/ */
public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends FieldEditorDefinePane<T> { public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends FieldEditorDefinePane<T> {
protected AccessibleDictionaryEditor dictionaryEditor;
private ButtonGroupDictPane buttonGroupDictPane; private ButtonGroupDictPane buttonGroupDictPane;
private FormWidgetValuePane formWidgetValuePane;
public ButtonGroupDefinePane(XCreator xCreator) { public ButtonGroupDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -38,12 +32,13 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
dictionaryEditor = new AccessibleDictionaryEditor();
buttonGroupDictPane = new ButtonGroupDictPane(); buttonGroupDictPane = new ButtonGroupDictPane();
FormWidgetValuePane formWidgetValuePane = new FormWidgetValuePane(); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), new UITextField()}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), new UITextField()},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont")), fontSizePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont")), fontSizePane},
new Component[]{buttonGroupDictPane, null} new Component[]{buttonGroupDictPane, null}
@ -52,17 +47,17 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1}}; int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
advancePane.add(panel, BorderLayout.NORTH); advancePane.add(panel, BorderLayout.NORTH);
JPanel otherPane = createOtherPane(); JPanel otherPane = createOtherPane();
if(otherPane != null){ if (otherPane != null) {
advancePane.add(otherPane, BorderLayout.CENTER); advancePane.add(otherPane, BorderLayout.CENTER);
} }
return advancePane; return advancePane;
} }
public JPanel createOtherPane(){ public JPanel createOtherPane() {
return null; return null;
} }
@ -70,6 +65,7 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
@Override @Override
protected void populateSubFieldEditorBean(T e) { protected void populateSubFieldEditorBean(T e) {
this.buttonGroupDictPane.populate(e); this.buttonGroupDictPane.populate(e);
formWidgetValuePane.populate(e);
populateSubButtonGroupBean(e); populateSubButtonGroupBean(e);
} }
@ -81,11 +77,11 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
protected T updateSubFieldEditorBean() { protected T updateSubFieldEditorBean() {
T e = updateSubButtonGroupBean(); T e = updateSubButtonGroupBean();
this.buttonGroupDictPane.update(e); this.buttonGroupDictPane.update(e);
formWidgetValuePane.update(e);
return e; return e;
} }
@Override @Override
public void checkValid() throws Exception { public void checkValid() throws Exception {

19
designer_form/src/com/fr/design/widget/ui/designer/component/BackgroundCompPane.java

@ -7,8 +7,6 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor;
import com.fr.form.ui.*;
import com.fr.form.ui.Button;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -34,7 +32,7 @@ public class BackgroundCompPane extends BasicPane {
initalBackgroundEditor = new AccessibleBackgroundEditor(); initalBackgroundEditor = new AccessibleBackgroundEditor();
overBackgroundEditor = new AccessibleBackgroundEditor(); overBackgroundEditor = new AccessibleBackgroundEditor();
clickBackgroundEditor = new AccessibleBackgroundEditor(); clickBackgroundEditor = new AccessibleBackgroundEditor();
String [] titles = new String[]{"默认", "自定义"}; String [] titles = new String[]{Inter.getLocText("FR-Designer_DEFAULT"), Inter.getLocText("FR-Designer_Custom")};
double f = TableLayout.FILL; double f = TableLayout.FILL;
final double p = TableLayout.PREFERRED; final double p = TableLayout.PREFERRED;
@ -64,19 +62,18 @@ public class BackgroundCompPane extends BasicPane {
} }
public void update(FreeButton btn) { public MouseActionBackground update() {
btn.setInitialBackground((Background) initalBackgroundEditor.getValue()); MouseActionBackground mouseActionBackground = new MouseActionBackground((Background) initalBackgroundEditor.getValue(), (Background) overBackgroundEditor.getValue(), (Background) clickBackgroundEditor.getValue());
btn.setOverBackground((Background) overBackgroundEditor.getValue()); return mouseActionBackground;
btn.setClickBackground((Background) clickBackgroundEditor.getValue());
} }
protected String title4PopupWindow() { protected String title4PopupWindow() {
return ""; return "";
} }
public void populate(FreeButton btn) { public void populate(MouseActionBackground background) {
initalBackgroundEditor.setValue(btn.getInitialBackground()); initalBackgroundEditor.setValue(background.getInitialBackground());
overBackgroundEditor.setValue(btn.getOverBackground()); overBackgroundEditor.setValue(background.getOverBackground());
clickBackgroundEditor.setValue(btn.getClickBackground()); clickBackgroundEditor.setValue(background.getClickBackground());
} }
} }

115
designer_form/src/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java

@ -1,9 +1,16 @@
package com.fr.design.widget.ui.designer.component; package com.fr.design.widget.ui.designer.component;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.editor.editor.*;
import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.widget.ui.designer.custom.*; import com.fr.design.mainframe.widget.editors.DataBindingEditor;
import com.fr.form.ui.TextEditor; import com.fr.design.mainframe.widget.editors.DataTableEditor;
import com.fr.design.mainframe.widget.editors.ServerDataBindingEditor;
import com.fr.design.mainframe.widget.editors.ServerDataTableEditor;
import com.fr.form.ui.DataControl;
import com.fr.form.ui.WidgetValue;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -13,44 +20,114 @@ import java.awt.*;
*/ */
public class FormWidgetValuePane extends JPanel { public class FormWidgetValuePane extends JPanel {
private UIHeadGroup widgetValueHead; private UIHeadGroup widgetValueHead;
private Editor[] editor;
public FormWidgetValuePane() {
WidgetValuePane StringPane = new WidgetValueString(); public FormWidgetValuePane(Object o, boolean onlyServer) {
WidgetValuePane FormulaPane = new WidgetValueFormula(); DataControl widget = (DataControl) o;
WidgetValuePane FieldPane = new WidgetValueField(); editor = createWidgetValueEditor(widget, onlyServer);
this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL)); this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL));
final CardLayout cardLayout = new CardLayout(); final CardLayout cardLayout = new CardLayout();
final JPanel customPane = new JPanel(cardLayout); final JPanel customPane = new JPanel(cardLayout);
customPane.add(StringPane.createWidgetValuePane(), StringPane.markTitle()); final String [] tabTitles = new String[editor.length];
customPane.add(FormulaPane.createWidgetValuePane(), FormulaPane.markTitle()); for(int i = 0; i < editor.length; i++){
customPane.add(FieldPane.createWidgetValuePane(), FieldPane.markTitle()); customPane.add(editor[i], editor[i].getName());
tabTitles[i] = editor[i].getName();
final String[] tabTitles = new String[]{StringPane.markTitle(), FormulaPane.markTitle(), FieldPane.markTitle()}; }
widgetValueHead = new UIHeadGroup(tabTitles) { widgetValueHead = new UIHeadGroup(tabTitles) {
@Override @Override
public void tabChanged(int index) { public void tabChanged(int index) {
//todo //todo
if (index == 2) { attributeChange(index, customPane, cardLayout, tabTitles);
}
};
this.add(widgetValueHead, BorderLayout.NORTH);
this.add(customPane, BorderLayout.CENTER);
}
public void attributeChange(int index, JPanel customPane, CardLayout cardLayout, String[] tabTitles){
if (ComparatorUtils.equals(tabTitles[index], Inter.getLocText("FieldBinding"))) {
customPane.setPreferredSize(new Dimension(100, 50)); customPane.setPreferredSize(new Dimension(100, 50));
} else { } else {
customPane.setPreferredSize(new Dimension(100, 20)); customPane.setPreferredSize(new Dimension(100, 20));
} }
cardLayout.show(customPane, tabTitles[index]); cardLayout.show(customPane, tabTitles[index]);
} }
};
this.add(widgetValueHead, BorderLayout.NORTH);
this.add(customPane, BorderLayout.CENTER);
/**
* 根据类型创建
* @param type 类型
* @param onlyServer 是否是服务器
* @return 编辑器
*/
public static Editor createWidgetValueEditorByType(int type, boolean onlyServer) {
switch (type) {
case DataControl.TYPE_NUMBER:
return new DoubleEditor();
case DataControl.TYPE_FORMULA:
return new FormulaEditor(Inter.getLocText("Parameter-Formula"));
case DataControl.TYPE_DATABINDING:
return onlyServer ? new ServerDataBindingEditor() : new DataBindingEditor();
case DataControl.TYPE_STRING:
return new com.fr.design.editor.editor.TextEditor();
case DataControl.TYPE_BOOLEAN:
return new BooleanEditor(false);
case DataControl.TYPE_DATE:
return new DateEditor(true, Inter.getLocText("Date"));
case DataControl.TYPE_TABLEDATA:
return onlyServer ? new ServerDataTableEditor() : new DataTableEditor();
default:
return null;
}
} }
public void update(TextEditor ob) {
//todo
/**
* 用DataControl构建
* @param data 数据
* @param onlyServer 是否是服务器
* @return 编辑器
*/
public static Editor[] createWidgetValueEditor(DataControl data, boolean onlyServer) {
int types[] = data.getValueType();
Editor[] editor = new Editor[types.length ];
for (int i = 0; i < types.length; i++) {
editor[i] = createWidgetValueEditorByType(types[i], onlyServer);
}
return editor;
} }
public void populate(TextEditor ob) { public void update(DataControl ob) {
//todo int index = widgetValueHead.getSelectedIndex();
Editor e = editor[index];
Object value = e.getValue();
ob.setWidgetValue(new WidgetValue(value));
}
public void populate(DataControl ob) {
WidgetValue widgetValue = ob.getWidgetValue();
for (int i = 0; i < editor.length; i++) {
if (editor[i].accept(widgetValue)) {
setCardValue(i, widgetValue);
break;
}
}
}
private void setCardValue(int i, Object object){
widgetValueHead.setSelectedIndex(i);
editor[i].setValue(object);
// kunsnat: bug7861 所有的Editor值都要跟随改变, 因为populate的editor 从""
// 一定是最后的Editor哦.
for (int j = 0; j < editor.length; j++) {
if (i == j) {
continue;
}
this.editor[j].setValue(null);
}
} }
} }

43
designer_form/src/com/fr/design/widget/ui/designer/component/MouseActionBackground.java

@ -0,0 +1,43 @@
package com.fr.design.widget.ui.designer.component;
import com.fr.general.Background;
/**
* Created by ibm on 2017/8/7.
*/
public class MouseActionBackground {
private Background initialBackground;
private Background overBackground;
private Background clickBackground;
public MouseActionBackground(Background initialBackground, Background overBackground, Background clickBackground){
this.initialBackground = initialBackground;
this.overBackground = overBackground;
this.clickBackground = clickBackground;
}
public Background getInitialBackground() {
return initialBackground;
}
public void setInitialBackground(Background initialBackground) {
this.initialBackground = initialBackground;
}
public Background getOverBackground() {
return overBackground;
}
public void setOverBackground(Background overBackground) {
this.overBackground = overBackground;
}
public Background getClickBackground() {
return clickBackground;
}
public void setClickBackground(Background clickBackground) {
this.clickBackground = clickBackground;
}
}

27
designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java

@ -3,15 +3,10 @@ package com.fr.design.widget.ui.designer.component;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout; import com.fr.design.widget.WidgetBoundsPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*; import java.awt.*;
/** /**
@ -26,32 +21,14 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane {
super(source); super(source);
XLayoutContainer xLayoutContainer = getParent(source); XLayoutContainer xLayoutContainer = getParent(source);
this.parent = (XWAbsoluteLayout) xLayoutContainer; this.parent = (XWAbsoluteLayout) xLayoutContainer;
} }
public void initBoundPane() { public void initBoundPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
x = new UISpinner(0, 1200, 1); x = new UISpinner(0, 1200, 1);
y = new UISpinner(0, 1200, 1); y = new UISpinner(0, 1200, 1);
width = new UISpinner(0, 1200, 1); width = new UISpinner(0, 1200, 1);
height = new UISpinner(0, 1200, 1); height = new UISpinner(0, 1200, 1);
this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height));
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Position")), x, y},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer_X_Coordinate"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Y_Coordinate"), SwingConstants.CENTER)},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)},
};
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("Form-Component_Bounds"), 280, 20, panel);
this.add(uiExpandablePane);
} }

24
designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

@ -2,15 +2,10 @@ package com.fr.design.widget.ui.designer.component;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.*;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.widget.WidgetBoundsPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*; import java.awt.*;
/** /**
@ -36,25 +31,10 @@ public class WidgetBoundPane extends BasicPane {
return container; return container;
} }
public void initBoundPane() { public void initBoundPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
width = new UISpinner(0, 1200, 1); width = new UISpinner(0, 1200, 1);
height = new UISpinner(0, 1200, 1); height = new UISpinner(0, 1200, 1);
Component[][] components = new Component[][]{ this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height));
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)},
};
double[] rowSize = {p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
UIExpandablePane uiExpandablePane = new UIExpandablePane("尺寸", 280, 20, panel);
this.add(uiExpandablePane);
} }

58
designer_form/src/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java

@ -0,0 +1,58 @@
package com.fr.design.widget.ui.designer.layout;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleElementCaseToolBarEditor;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.web.FormToolBarManager;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by ibm on 2017/8/7.
*/
public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseEditor> {
private PaddingBoundPane paddingBoundPane;
private AccessibleElementCaseToolBarEditor elementCaseToolBarEditor;
public ElementEditorDefinePane(XCreator xCreator){
super(xCreator);
}
protected JPanel createCenterPane(){
paddingBoundPane = new PaddingBoundPane();
elementCaseToolBarEditor = new AccessibleElementCaseToolBarEditor();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{paddingBoundPane, null},
new Component[]{new UILabel("报表块工具栏"), elementCaseToolBarEditor}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel;
}
protected ElementCaseEditor updateSubBean(){
ElementCaseEditor elementCaseEditor = (ElementCaseEditor)creator.toData();
paddingBoundPane.update(elementCaseEditor);
elementCaseEditor.setToolBars((FormToolBarManager[])elementCaseToolBarEditor.getValue());
return elementCaseEditor;
}
protected void populateSubBean(ElementCaseEditor ob){
paddingBoundPane.populate(ob);
elementCaseToolBarEditor.setValue(ob.getToolBars());
}
}

10
designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -12,15 +12,16 @@ import com.fr.design.foldablepane.UIExpandablePane;
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.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
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.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelectionUtils; import com.fr.design.mainframe.FormSelectionUtils;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane; import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
@ -42,7 +43,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
private UIComboBox adaptComboBox; private UIComboBox adaptComboBox;
private UISpinner componentIntervel; private UISpinner componentIntervel;
private PaddingBoundPane paddingBound; private PaddingBoundPane paddingBound;
private UITextField background; private AccessibleWLayoutBorderStyleEditor background;
public FRFitLayoutDefinePane(XCreator xCreator) { public FRFitLayoutDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -63,7 +64,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
public JPanel createAdvancePane() { public JPanel createAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
background = new UITextField(); background = new AccessibleWLayoutBorderStyleEditor();
paddingBound = new PaddingBoundPane(); paddingBound = new PaddingBoundPane();
JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
jp2.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); jp2.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
@ -111,11 +112,11 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
@Override @Override
public void populateBean(WFitLayout ob) { public void populateBean(WFitLayout ob) {
background.setText("test");
paddingBound.populate(ob); paddingBound.populate(ob);
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue()); layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue());
adaptComboBox.setSelectedIndex(ob.getCompState()); adaptComboBox.setSelectedIndex(ob.getCompState());
componentIntervel.setValue(ob.getCompInterval()); componentIntervel.setValue(ob.getCompInterval());
background.setValue(ob.getBackground());
} }
@ -123,6 +124,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
public WFitLayout updateBean() { public WFitLayout updateBean() {
WFitLayout layout = (WFitLayout) creator.toData(); WFitLayout layout = (WFitLayout) creator.toData();
paddingBound.update(layout); paddingBound.update(layout);
layout.setBorderStyle((LayoutBorderStyle) background.getValue());
Item item = (Item) layoutComboBox.getSelectedItem(); Item item = (Item) layoutComboBox.getSelectedItem();
Object value = item.getValue(); Object value = item.getValue();
int state = 0; int state = 0;

85
designer_form/src/com/fr/design/widget/ui/designer/layout/WCardLayoutDefinePane.java

@ -0,0 +1,85 @@
package com.fr.design.widget.ui.designer.layout;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleCardTagWLayoutBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WCardLayout;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by ibm on 2017/8/7.
*/
public class WCardLayoutDefinePane extends AbstractDataModify<WCardLayout> {
private AccessibleCardTagWLayoutBorderStyleEditor accessibleCardTagWLayoutBorderStyleEditor;
private UICheckBox setCarousel;
private UISpinner carouselInterval;
private JPanel IntervalPane;
public WCardLayoutDefinePane(XCreator xCreator) {
super(xCreator);
initComponent();
}
public void initComponent() {
carouselInterval = new UISpinner(0, 20, 1, 0);
accessibleCardTagWLayoutBorderStyleEditor = new AccessibleCardTagWLayoutBorderStyleEditor();
accessibleCardTagWLayoutBorderStyleEditor.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
JPanel accessibleCardlayout = FRGUIPaneFactory.createBorderLayout_S_Pane();
accessibleCardlayout.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
accessibleCardlayout.add(accessibleCardTagWLayoutBorderStyleEditor, BorderLayout.CENTER);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, accessibleCardlayout);
final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
setCarousel = new UICheckBox(Inter.getLocText("FR-Designer_setCarousel"));
IntervalPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_carouselInterval")), carouselInterval}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
IntervalPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
jPanel.add(setCarousel, BorderLayout.NORTH);
jPanel.add(IntervalPane, BorderLayout.CENTER);
setCarousel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
IntervalPane.setVisible(setCarousel.isSelected());
}
});
UIExpandablePane setCarouselPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Tab_carousel"), 280, 20, jPanel);
this.add(advanceExpandablePane, BorderLayout.NORTH);
this.add(setCarouselPane, BorderLayout.CENTER);
}
@Override
public String title4PopupWindow() {
return "tabFitLayout";
}
@Override
public void populateBean(WCardLayout ob) {
accessibleCardTagWLayoutBorderStyleEditor.setValue(ob.getBorderStyle());
setCarousel.setSelected(ob.isCarousel());
IntervalPane.setVisible(ob.isCarousel());
carouselInterval.setValue(ob.getCarouselInterval());
}
@Override
public WCardLayout updateBean() {
WCardLayout layout = (WCardLayout) creator.toData();
layout.setBorderStyle((LayoutBorderStyle) accessibleCardTagWLayoutBorderStyleEditor.getValue());
layout.setCarousel(setCarousel.isSelected());
layout.setCarouselInterval((int)carouselInterval.getValue());
return layout;
}
}

38
designer_form/src/com/fr/design/widget/ui/designer/layout/WTabFitLayoutDefinePane.java

@ -1,12 +1,19 @@
package com.fr.design.widget.ui.designer.layout; package com.fr.design.widget.ui.designer.layout;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.design.widget.ui.designer.component.BackgroundCompPane;
import com.fr.design.widget.ui.designer.component.MouseActionBackground;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane; import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*; import java.awt.*;
/** /**
@ -14,6 +21,8 @@ import java.awt.*;
*/ */
public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> { public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
private PaddingBoundPane paddingBoundPane; private PaddingBoundPane paddingBoundPane;
private BackgroundCompPane borderStyle;
private UISpinner componentInterval;
public WTabFitLayoutDefinePane(XCreator xCreator) { public WTabFitLayoutDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -21,10 +30,22 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
} }
public void initComponent() { public void initComponent() {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
paddingBoundPane = new PaddingBoundPane(); paddingBoundPane = new PaddingBoundPane();
borderStyle = new BackgroundCompPane();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Style")), borderStyle}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
advancePane.add(jPanel, BorderLayout.NORTH);
advancePane.add(paddingBoundPane, BorderLayout.CENTER);
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, paddingBoundPane); UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane);
this.add(advanceExpandablePane, BorderLayout.CENTER); this.add(advanceExpandablePane, BorderLayout.NORTH);
initLayoutComponent();
}
public void initLayoutComponent(){
componentInterval = new UISpinner(0, 100, 1, 0);
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Interval")), componentInterval}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(jPanel, BorderLayout.CENTER);
} }
@Override @Override
@ -34,13 +55,22 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
@Override @Override
public void populateBean(WTabFitLayout ob) { public void populateBean(WTabFitLayout ob) {
MouseActionBackground mouseActionBackground = new MouseActionBackground(ob.getInitialBackground(), ob.getOverBackground(), ob.getClickBackground());
borderStyle.populate(mouseActionBackground);
paddingBoundPane.populate(ob);
componentInterval.setValue(ob.getCompInterval());
} }
@Override @Override
public WTabFitLayout updateBean() { public WTabFitLayout updateBean() {
WTabFitLayout layout = (WTabFitLayout) creator.toData(); WTabFitLayout layout = (WTabFitLayout) creator.toData();
MouseActionBackground mouseActionBackground = borderStyle.update();
layout.setInitialBackground(mouseActionBackground.getInitialBackground());
layout.setOverBackground(mouseActionBackground.getOverBackground());
layout.setClickBackground(mouseActionBackground.getClickBackground());
paddingBoundPane.update(layout);
layout.setCompInterval((int)componentInterval.getValue());
return layout; return layout;
} }
} }

56
designer_form/src/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java

@ -3,9 +3,14 @@ package com.fr.design.widget.ui.designer.layout;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane; import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
import com.fr.form.ui.*;
import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.container.WTitleLayout;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -15,9 +20,9 @@ import java.awt.*;
/** /**
* Created by ibm on 2017/8/3. * Created by ibm on 2017/8/3.
*/ */
public class WTitleLayoutDefinePane extends AbstractDataModify<WTitleLayout> { public abstract class WTitleLayoutDefinePane<T extends AbstractBorderStyleWidget> extends AbstractDataModify<T> {
private PaddingBoundPane paddingBoundPane; private AccessibleWLayoutBorderStyleEditor borderStyleEditor;
private UICheckBox displayECToolBar;
public WTitleLayoutDefinePane(XCreator xCreator) { public WTitleLayoutDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
initComponent(); initComponent();
@ -26,30 +31,55 @@ public class WTitleLayoutDefinePane extends AbstractDataModify<WTitleLayout> {
public void initComponent() { public void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
borderStyleEditor = new AccessibleWLayoutBorderStyleEditor();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Style")), borderStyleEditor}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
advancePane.add(panel, BorderLayout.NORTH);
JPanel centerPane = createCenterPane();
if(centerPane!=null){
advancePane.add(centerPane, BorderLayout.CENTER);
}
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane); UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane);
paddingBoundPane = new PaddingBoundPane();
displayECToolBar = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Display_Report_Tool"));
advancePane.add(paddingBoundPane, BorderLayout.NORTH);
advancePane.add(displayECToolBar, BorderLayout.CENTER);
this.add(advanceExpandablePane); this.add(advanceExpandablePane);
} }
protected JPanel createCenterPane(){
return null;
}
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return "titleLayout"; return "titleLayout";
} }
@Override @Override
public void populateBean(WTitleLayout ob) { public void populateBean(T ob) {
paddingBoundPane.populate(ob); populateSubBean(ob);
// displayECToolBar.setSelected(ob.ds); borderStyleEditor.setValue(ob.getBorderStyle());
} }
@Override @Override
public WTitleLayout updateBean() { public T updateBean() {
WTitleLayout layout = (WTitleLayout)creator.toData(); T e = updateSubBean();
return layout; e.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue());
return e;
} }
protected abstract T updateSubBean();
protected abstract void populateSubBean(T ob);
} }

Loading…
Cancel
Save