Browse Source

Merge pull request #1049 in BA/design from ~KERRY/design:9.0 to 9.0

* commit '13960a358ac178975e78a104bc52fd1b88289837':
  代码调整
  代码调整
  REPORT-3293 9.0设计器控件设置重画
  代码修改
  REPORT-3293 9.0设计器控件设置重画
master
superman 7 years ago
parent
commit
eb8aad78ae
  1. 3
      designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java
  2. 1
      designer/src/com/fr/design/widget/WidgetPane.java
  3. 1
      designer/src/com/fr/design/widget/ui/ButtonDefinePane.java
  4. 12
      designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java
  5. 213
      designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java
  6. 7
      designer/src/com/fr/design/widget/ui/btn/AppendRowButtonDefinePane.java
  7. 9
      designer/src/com/fr/design/widget/ui/btn/DefineAppendColumnRowPane.java
  8. 25
      designer/src/com/fr/design/widget/ui/btn/DefineDeleteColumnRowPane.java
  9. 7
      designer/src/com/fr/design/widget/ui/btn/DeleteRowButtonDefinePane.java
  10. 20
      designer/src/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java
  11. 2
      designer/src/com/fr/quickeditor/ChartQuickEditor.java
  12. 0
      designer_base/src/com/fr/design/designer/properties/Decoder.java
  13. 18
      designer_base/src/com/fr/design/designer/properties/Encoder.java
  14. 16
      designer_base/src/com/fr/design/gui/frpane/RegPane.java
  15. 13
      designer_base/src/com/fr/design/gui/itextfield/UITextField.java
  16. 6
      designer_base/src/com/fr/design/gui/style/FRFontPane.java
  17. 3
      designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java
  18. 8
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleBackgroundEditor.java
  19. 80
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java
  20. 80
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleEditor.java
  21. 8
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleIconEditor.java
  22. 388
      designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java
  23. 98
      designer_base/src/com/fr/design/mainframe/widget/accessibles/RendererField.java
  24. 44
      designer_base/src/com/fr/design/mainframe/widget/accessibles/UneditableAccessibleEditor.java
  25. 2
      designer_base/src/com/fr/design/mainframe/widget/editors/DataBindingEditor.java
  26. 0
      designer_base/src/com/fr/design/mainframe/widget/editors/ITextComponent.java
  27. 0
      designer_base/src/com/fr/design/mainframe/widget/editors/TextField.java
  28. 186
      designer_base/src/com/fr/design/mainframe/widget/renderer/GenericCellRenderer.java
  29. 13
      designer_base/src/com/fr/design/mainframe/widget/renderer/IconCellRenderer.java
  30. 0
      designer_base/src/com/fr/design/mainframe/widget/wrappers/BackgroundWrapper.java
  31. 0
      designer_base/src/com/fr/design/mainframe/widget/wrappers/DictionaryWrapper.java
  32. 0
      designer_base/src/com/fr/design/mainframe/widget/wrappers/IconWrapper.java
  33. 3
      designer_base/src/com/fr/design/widget/DataModify.java
  34. 19
      designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java
  35. 2
      designer_base/src/com/fr/design/widget/btn/ButtonDetailPane.java
  36. 40
      designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java
  37. 28
      designer_base/src/com/fr/design/widget/component/BackgroundCompPane.java
  38. 48
      designer_base/src/com/fr/design/widget/component/ButtonBackgroundPane.java
  39. 81
      designer_base/src/com/fr/design/widget/component/DateValuePane.java
  40. 12
      designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleWLayoutBorderStyleEditor.java
  41. 1
      designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java
  42. 16
      designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java
  43. 2
      designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java
  44. 10
      designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java
  45. 16
      designer_form/src/com/fr/design/widget/ui/designer/ButtonGroupDictPane.java
  46. 6
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java
  47. 3
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java
  48. 2
      designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java
  49. 3
      designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java
  50. 3
      designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java
  51. 197
      designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java
  52. 5
      designer_form/src/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java
  53. 12
      designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java
  54. 15
      designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java
  55. 6
      designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java
  56. 7
      designer_form/src/com/fr/design/widget/ui/designer/MultiFileEditorPane.java
  57. 20
      designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java
  58. 13
      designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  59. 2
      designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java
  60. 64
      designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonDetailPaneFactory.java
  61. 2
      designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java
  62. 143
      designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonSytleDefinedPane.java
  63. 30
      designer_form/src/com/fr/design/widget/ui/designer/btn/DefaultButtonDetailPane.java
  64. 56
      designer_form/src/com/fr/design/widget/ui/designer/btn/DefaultButtonStylePane.java
  65. 40
      designer_form/src/com/fr/design/widget/ui/designer/btn/FreeButtonDetailPane.java
  66. 4
      designer_form/src/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java
  67. 43
      designer_form/src/com/fr/design/widget/ui/designer/component/MouseActionBackground.java
  68. 2
      designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java
  69. 50
      designer_form/src/com/fr/design/widget/ui/designer/component/TabFitLayoutBackgroundPane.java
  70. 40
      designer_form/src/com/fr/design/widget/ui/designer/custom/WidgetValueField.java
  71. 33
      designer_form/src/com/fr/design/widget/ui/designer/custom/WidgetValueFormula.java
  72. 17
      designer_form/src/com/fr/design/widget/ui/designer/custom/WidgetValuePane.java
  73. 33
      designer_form/src/com/fr/design/widget/ui/designer/custom/WidgetValueString.java
  74. 7
      designer_form/src/com/fr/design/widget/ui/designer/layout/ChartEditorDefinePane.java
  75. 4
      designer_form/src/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java
  76. 4
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  77. 8
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteLayoutDefinePane.java
  78. 11
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  79. 15
      designer_form/src/com/fr/design/widget/ui/designer/layout/WTabFitLayoutDefinePane.java
  80. 2
      designer_form/src/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java

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

@ -69,9 +69,6 @@ public class CellWidgetPropertyPane extends BasicPane {
Widget cellWidget = cellElement.getWidget(); Widget cellWidget = cellElement.getWidget();
if(cellWidget == null){
return;
}
// 这里进行克隆的原因是为了保留原始的Widget以便和新的Widget做比较来判断是否发生了改变 // 这里进行克隆的原因是为了保留原始的Widget以便和新的Widget做比较来判断是否发生了改变
if (cellWidget != null) { if (cellWidget != null) {

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

@ -120,6 +120,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
public void populate(Widget widget) { public void populate(Widget widget) {
if (widget == null) { if (widget == null) {
editorTypeComboBox.setSelectedIndex(-1);
return; return;
} }

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

@ -20,7 +20,6 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
private void initComponent() { private void initComponent() {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
} }
@Override @Override

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

@ -6,15 +6,17 @@ import java.awt.FlowLayout;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.CheckBoxGroup; import com.fr.form.ui.CheckBoxGroup;
import com.fr.general.Inter; import com.fr.general.Inter;
public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup> { public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup> {
private DictionaryPane dictPane; private AccessibleDictionaryEditor dictPane;
CheckBoxDictPane checkBoxDictPane; CheckBoxDictPane checkBoxDictPane;
@ -29,7 +31,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
protected void initComponents() { protected void initComponents() {
super.initComponents(); super.initComponents();
dictPane = new DictionaryPane(); dictPane = new AccessibleDictionaryEditor();
} }
@Override @Override
@ -64,7 +66,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override @Override
protected void populateSubFieldEditorBean(CheckBoxGroup ob) { protected void populateSubFieldEditorBean(CheckBoxGroup ob) {
this.dictPane.populateBean(ob.getDictionary()); this.dictPane.setValue(ob.getDictionary());
checkBoxDictPane.populate(ob); checkBoxDictPane.populate(ob);
checkbox.setSelected(ob.isChooseAll()); checkbox.setSelected(ob.isChooseAll());
this.buttonGroupDictPane.populate(ob); this.buttonGroupDictPane.populate(ob);
@ -74,7 +76,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
protected CheckBoxGroup updateSubFieldEditorBean() { protected CheckBoxGroup updateSubFieldEditorBean() {
CheckBoxGroup ob = new CheckBoxGroup(); CheckBoxGroup ob = new CheckBoxGroup();
ob.setDictionary(this.dictPane.updateBean()); ob.setDictionary((Dictionary) this.dictPane.getValue());
checkBoxDictPane.update(ob); checkBoxDictPane.update(ob);
ob.setChooseAll(checkbox.isSelected()); ob.setChooseAll(checkbox.isSelected());
this.buttonGroupDictPane.update(ob); this.buttonGroupDictPane.update(ob);
@ -83,6 +85,6 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return dictPane; return null;
} }
} }

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

@ -3,21 +3,19 @@ package com.fr.design.widget.ui;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.data.core.FormatField; import com.fr.data.core.FormatField;
import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.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.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
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.CellWidgetPropertyPane;
import com.fr.design.widget.component.DateValuePane;
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;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.UtilEvalError; import com.fr.stable.UtilEvalError;
import javax.swing.*; import javax.swing.*;
@ -28,19 +26,18 @@ import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> { public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> {
private UIComboBox returnTypeComboBox; private UIHeadGroup returnTypeComboBox;
private UILabel sampleLabel;// preview
// content private DateValuePane startDv;
private UIComboBox dateFormatComboBox; private DateValuePane endDv;
private ValueEditorPane startDv;
private ValueEditorPane endDv; private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel;
private UIHeadGroup fomatHeadGroup;
public DateEditorDefinePane() {
this.initComponets();
}
private void initComponets() {
super.initComponents(); public DateEditorDefinePane() {
} }
@Override @Override
@ -50,71 +47,98 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override @Override
protected JPanel setSecondContentPane() { protected JPanel setSecondContentPane() {
JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); returnTypeComboBox = new UIHeadGroup(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}){
returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST); protected void tabChanged(int newSelectedIndex) {
returnTypeComboBox = new UIComboBox(new String[] { Inter.getLocText("String"), Inter.getLocText("Date") }); //todo
returnTypeComboBox.setPreferredSize(new Dimension(70, 20)); }
};
// sample pane
sampleLabel = new UILabel("");
sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4));
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
// content pane
String[] arr = getDateFormateArray();
dateFormatComboBox = new UIComboBox(arr);
dateFormatComboBox.setPreferredSize(new Dimension(150,20));
dateFormatComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
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); JPanel formatHead = createFormatHead();
endDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
startDv = new DateValuePane();
endDv = new DateValuePane();
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-Engine_Format") + ":"), formatHead},
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), dateFormatComboBox},
new Component[]{null, sampleLabel},
new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv}, new Component[]{new UILabel(Inter.getLocText("FS_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[]{waterMarkDictPane, null},
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox }
}; };
double[] rowSize = {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, 1},{1, 1},{1, 1},{1, 1},{1, 1}}; int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel; return panel;
} }
private String[] getDateFormateArray() { private JPanel createFormatPane(UIComboBox formatComboBox, UILabel sampleLabel){
return FormatField.getInstance().getDateFormatArray(); JPanel previewPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Base_StyleFormat_Sample"));
previewPane.add(sampleLabel);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(previewPane, BorderLayout.NORTH);
jPanel.add(formatComboBox, BorderLayout.CENTER);
return jPanel;
} }
protected JPanel initStartEndDatePane() { private UILabel createSamplePane(){
JPanel rangePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); UILabel sampleLabel = new UILabel("");
rangePane.add(new UILabel(Inter.getLocText("FS_Start_Date") + ":")); sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
startDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null); sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
rangePane.add(startDv); return sampleLabel;
rangePane.add(new UILabel(Inter.getLocText("FS_End_Date") + ":"));
endDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
rangePane.add(endDv);
return rangePane;
} }
private JPanel createFormatHead(){
String[] dateArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.DATE);
String[] timeArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.TIME);
final UIComboBox dateFormatComboBox = new UIComboBox(dateArray);
final UIComboBox timeFormatComboBox = new UIComboBox(timeArray);
dateFormatComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
refreshPreviewLabel();
}
});
timeFormatComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
refreshPreviewLabel();
}
});
final UILabel dateSampleLabel = createSamplePane();
final UILabel timeSampleLabel = createSamplePane();
JPanel fomatHeadPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final CardLayout cardLayout = new CardLayout();
final JPanel customPane = new JPanel(cardLayout);
JPanel dateFormatPane = createFormatPane(dateFormatComboBox, dateSampleLabel);
JPanel timeFormatPane = createFormatPane(timeFormatComboBox, timeSampleLabel);
customPane.add(dateFormatPane, Inter.getLocText("StyleFormat-Date"));
customPane.add(timeFormatPane, Inter.getLocText("StyleFormat-Time"));
final String[] tabTitles = new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")};
fomatHeadGroup = new UIHeadGroup(new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")}){
protected void tabChanged(int newSelectedIndex) {
cardLayout.show(customPane, tabTitles[newSelectedIndex]);
if(newSelectedIndex == 0){
currentFormatComboBox = dateFormatComboBox;
currentSamplelabel = dateSampleLabel;
}else{
currentFormatComboBox = timeFormatComboBox;
currentSamplelabel = timeSampleLabel;
}
refreshPreviewLabel();
CellWidgetPropertyPane.getInstance().update();
}
};
fomatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH);
fomatHeadPane.add(customPane, BorderLayout.CENTER);
return fomatHeadPane;
}
private void refreshPreviewLabel() { private void refreshPreviewLabel() {
String text = (String) dateFormatComboBox.getSelectedItem(); String text = (String) currentFormatComboBox.getSelectedItem();
if (text != null && text.length() > 0) { if (text != null && text.length() > 0) {
try { try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(text); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(text);
@ -124,66 +148,57 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
sample += " " + Inter.getLocText("DateFormat-Custom_Warning"); sample += " " + Inter.getLocText("DateFormat-Custom_Warning");
c = Color.red; c = Color.red;
} }
this.sampleLabel.setText(sample); currentSamplelabel.setText(sample);
this.sampleLabel.setForeground(c); currentSamplelabel.setForeground(c);
} catch (Exception exp) { } catch (Exception exp) {
this.sampleLabel.setForeground(Color.red); currentSamplelabel.setForeground(Color.red);
this.sampleLabel.setText(exp.getMessage()); currentSamplelabel.setText(exp.getMessage());
} }
} else { } else {
this.sampleLabel.setText(new Date().toString()); currentSamplelabel.setText(new Date().toString());
} }
} }
private int getDateType(DateEditor e){
String[] timeArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.TIME);
if(e == null){
return 0;
}
String formatText = e.getFormatText();
if(ArrayUtils.contains(timeArray, formatText)){
return 1;
}
return 0;
}
@Override @Override
protected void populateSubDirectWriteEditorBean(DateEditor e) { protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText(); String formatText = e.getFormatText();
dateFormatComboBox.setSelectedItem(formatText); fomatHeadGroup.setSelectedIndex(getDateType(e));
currentFormatComboBox.setSelectedItem(formatText);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 1 : 0); returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 0 : 1);
startDv.populate(e.getStartDate());
populateStartEnd(e); endDv.populate(e.getEndDate());
} }
@Override @Override
protected DateEditor updateSubDirectWriteEditorBean() { protected DateEditor updateSubDirectWriteEditorBean() {
DateEditor ob = new DateEditor(); DateEditor ob = new DateEditor();
ob.setFormatText(this.getSimpleDateFormat().toPattern()); ob.setFormatText(this.getSimpleDateFormat().toPattern());
ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 1); ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 0);
ob.setStartDate(startDv.update());
updateStartEnd(ob); ob.setEndDate(endDv.update());
return ob; return ob;
} }
/**
* 初始起止日期
* @param dateWidgetEditor 日期控件
*/
public void populateStartEnd(DateEditor dateWidgetEditor) {
Formula startFM = dateWidgetEditor.getStartDateFM();
Formula endFM = dateWidgetEditor.getEndDateFM();
if (startFM != null) {
startDv.populate(startFM);
} else {
String startStr = dateWidgetEditor.getStartText();
startDv.populate(StringUtils.isEmpty(startStr) ? null : DateUtils.string2Date(startStr, true));
}
if (endFM != null) {
endDv.populate(endFM);
} else {
String endStr = dateWidgetEditor.getEndText();
endDv.populate(StringUtils.isEmpty(endStr) ? null : DateUtils.string2Date(endStr, true));
}
}
/** /**
* 更新日期控件的起止日期 * 更新日期控件的起止日期
* @param dateWidgetEditor 日期控件 * @param dateWidgetEditor 日期控件
*/ */
public void updateStartEnd(DateEditor dateWidgetEditor) { public void updateStartEnd(DateEditor dateWidgetEditor) {
Object startObject = startDv.update(); Object startObject = "";
Object endObject = endDv.update(); Object endObject = endDv.update();
// wei : 对公式的处理 // wei : 对公式的处理
Calculator cal = null; Calculator cal = null;
@ -226,12 +241,12 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
} }
private SimpleDateFormat getSimpleDateFormat() { private SimpleDateFormat getSimpleDateFormat() {
String text = (String) dateFormatComboBox.getSelectedItem(); String text = (String) currentFormatComboBox.getSelectedItem();
SimpleDateFormat simpleDateFormat; SimpleDateFormat simpleDateFormat;
if (text != null && text.length() > 0) { if (text != null && text.length() > 0) {
try { try {
simpleDateFormat = new SimpleDateFormat(text); simpleDateFormat = new SimpleDateFormat(text);
this.sampleLabel.setText(simpleDateFormat.format(new Date())); this.currentSamplelabel.setText(simpleDateFormat.format(new Date()));
} catch (Exception exp) { } catch (Exception exp) {
simpleDateFormat = new SimpleDateFormat(""); simpleDateFormat = new SimpleDateFormat("");
} }

7
designer/src/com/fr/design/widget/ui/btn/AppendRowButtonDefinePane.java

@ -38,11 +38,10 @@ public class AppendRowButtonDefinePane<T extends AppendRowButton> extends Button
} }
@Override @Override
public void populate(com.fr.form.ui.Button btn) { public void populate(AppendRowButton btn) {
super.populate(btn); super.populate(btn);
if (btn instanceof AppendRowButton) { defineColumnRowPane.populate(btn);
defineColumnRowPane.populate((AppendRowButton) btn);
}
} }
@Override @Override

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

@ -6,6 +6,7 @@ import javax.swing.BorderFactory;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.fr.design.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;
@ -20,7 +21,7 @@ import com.fr.report.web.button.write.AppendRowButton;
*/ */
public class DefineAppendColumnRowPane extends BasicPane { public class DefineAppendColumnRowPane extends BasicPane {
private ColumnRowEditor crEditor; private ColumnRowEditor crEditor;
private com.fr.design.editor.editor.IntegerEditor jNumberEditor; private UISpinner jNumberEditor;
private UILabel rowCountLable; private UILabel rowCountLable;
public DefineAppendColumnRowPane() { public DefineAppendColumnRowPane() {
@ -35,7 +36,7 @@ public class DefineAppendColumnRowPane extends BasicPane {
double columnSize[] = { p, f}; double columnSize[] = { p, f};
crEditor = new ColumnRowEditor(); crEditor = new ColumnRowEditor();
jNumberEditor = new com.fr.design.editor.editor.IntegerEditor(); jNumberEditor = new UISpinner(0, 100 , 1, 0);
rowCountLable = new UILabel(Inter.getLocText("Edit-Row_Count") + ":"); rowCountLable = new UILabel(Inter.getLocText("Edit-Row_Count") + ":");
JPanel lpane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel lpane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -56,11 +57,11 @@ public class DefineAppendColumnRowPane extends BasicPane {
public void populate(AppendRowButton btn) { public void populate(AppendRowButton btn) {
crEditor.setValue(btn.getFixCell()); crEditor.setValue(btn.getFixCell());
jNumberEditor.setValue(new Integer(btn.getCount())); jNumberEditor.setValue(btn.getCount());
} }
public void update(AppendRowButton btn) { public void update(AppendRowButton btn) {
btn.setFixCell(crEditor.getValue()); btn.setFixCell(crEditor.getValue());
btn.setCount(jNumberEditor.getValue().intValue()); btn.setCount((int)jNumberEditor.getValue());
} }
} }

25
designer/src/com/fr/design/widget/ui/btn/DefineDeleteColumnRowPane.java

@ -1,14 +1,19 @@
package com.fr.design.widget.ui.btn; package com.fr.design.widget.ui.btn;
import javax.swing.BorderFactory; import javax.swing.*;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.editor.ColumnRowEditor; import com.fr.design.editor.editor.ColumnRowEditor;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.report.web.button.write.DeleteRowButton; import com.fr.report.web.button.write.DeleteRowButton;
import java.awt.*;
/** /**
* Created by IntelliJ IDEA. Author : Richer Version: 6.5.6 Date : 11-11-16 Time * Created by IntelliJ IDEA. Author : Richer Version: 6.5.6 Date : 11-11-16 Time
* : 上午10:56 * : 上午10:56
@ -23,12 +28,20 @@ public class DefineDeleteColumnRowPane extends BasicPane {
} }
private void initComponents() { private void initComponents() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double rowSize[] = { p, p};
double columnSize[] = { p, f};
crEditor = new ColumnRowEditor(); crEditor = new ColumnRowEditor();
setLayout(FRGUIPaneFactory.createL_FlowLayout()); Component[][] components = {
setBorder(BorderFactory.createEmptyBorder(0, BORDER_LEFT, 0, 0)); { new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"}) + ":"), crEditor },
add(new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"}) + ":")); {new UILabel(Inter.getLocText("Append_Delete_Row_Message")),null}};
add(crEditor); JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
add(new UILabel(Inter.getLocText("Append_Delete_Row_Message")));
setLayout(FRGUIPaneFactory.createBorderLayout());
add(contentPane);
} }
@Override @Override

7
designer/src/com/fr/design/widget/ui/btn/DeleteRowButtonDefinePane.java

@ -36,11 +36,10 @@ public class DeleteRowButtonDefinePane<T extends DeleteRowButton> extends Button
} }
@Override @Override
public void populate(com.fr.form.ui.Button btn) { public void populate(DeleteRowButton btn) {
super.populate(btn); super.populate(btn);
if (btn instanceof DeleteRowButton) { ddcp.populate(btn);
ddcp.populate((DeleteRowButton) btn);
}
} }
@Override @Override

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

@ -2,16 +2,20 @@ package com.fr.design.widget.ui.btn;
import java.awt.Component; import java.awt.Component;
import com.fr.form.ui.Button; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.ButtonBackgroundPane;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane; import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane;
import com.fr.general.Inter;
public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton> { public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton> {
private ButtonSytleDefinedPane stylePane; private ButtonBackgroundPane backgroundCompPane;
@Override @Override
protected Component createCenterPane() { protected Component createCenterPane() {
return stylePane = new ButtonSytleDefinedPane(); backgroundCompPane = new ButtonBackgroundPane();
return TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background") + ":"), backgroundCompPane}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
} }
@Override @Override
@ -19,18 +23,16 @@ public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton
return new FreeButton(); return new FreeButton();
} }
@Override public void populate(FreeButton button) {
public void populate(Button button) {
super.populate(button); super.populate(button);
if(button instanceof FreeButton) { backgroundCompPane.populate(button);
stylePane.populate((FreeButton) button);
}
} }
@Override @Override
public FreeButton update() { public FreeButton update() {
FreeButton button = super.update(); FreeButton button = super.update();
return stylePane.update(button); backgroundCompPane.update(button);
return button;
} }
@Override @Override

2
designer/src/com/fr/quickeditor/ChartQuickEditor.java

@ -1,7 +1,7 @@
package com.fr.quickeditor; package com.fr.quickeditor;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection; //import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.chart.BaseChartPropertyPane; import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;

0
designer_form/src/com/fr/design/designer/properties/Decoder.java → designer_base/src/com/fr/design/designer/properties/Decoder.java

18
designer_form/src/com/fr/design/designer/properties/Encoder.java → designer_base/src/com/fr/design/designer/properties/Encoder.java

@ -1,10 +1,10 @@
package com.fr.design.designer.properties; package com.fr.design.designer.properties;
/** /**
* 将控件属性 转化成字符串 * 将控件属性 转化成字符串
* @since 6.5.2 * @since 6.5.2
*/ */
public interface Encoder<T> { public interface Encoder<T> {
String encode(T v); String encode(T v);
} }

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

@ -73,17 +73,13 @@ public class RegPane extends BasicPane {
private void initComponents(){ private void initComponents(){
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel contentPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
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();
uiLabel.setPreferredSize(new Dimension(20, 20)); JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Input_Rule")), regComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
contentPane.add(uiLabel); this.add(contentPane, BorderLayout.NORTH);
contentPane.add(regComboBox);
regErrorMsgPane = new RegErrorMsgPane(); regErrorMsgPane = new RegErrorMsgPane();
final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
detailedCardLayout = new CardLayout(); detailedCardLayout = new CardLayout();
@ -489,7 +485,7 @@ public class RegPane extends BasicPane {
public RegErrorMsgPane(){ public RegErrorMsgPane(){
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5,0,0,0)); this.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
initRegErrorMsgField(); initRegErrorMsgField();
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), regErrorMsgField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); 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); this.add(panel);

13
designer_base/src/com/fr/design/gui/itextfield/UITextField.java

@ -13,6 +13,8 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.text.Document; import javax.swing.text.Document;
import java.awt.*; import java.awt.*;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
/** /**
* @author Jerry * @author Jerry
@ -59,19 +61,14 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
protected void initListener() { protected void initListener() {
if (shouldResponseChangeListener()) { if (shouldResponseChangeListener()) {
getDocument().addDocumentListener(new DocumentListener() { addFocusListener(new FocusListener() {
@Override @Override
public void insertUpdate(DocumentEvent e) { public void focusGained(FocusEvent e) {
attributeChange(); attributeChange();
} }
@Override @Override
public void removeUpdate(DocumentEvent e) { public void focusLost(FocusEvent e) {
attributeChange();
}
@Override
public void changedUpdate(DocumentEvent e) {
attributeChange(); attributeChange();
} }
}); });

6
designer_base/src/com/fr/design/gui/style/FRFontPane.java

@ -300,7 +300,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
private JPanel createLeftPane() { private JPanel createLeftPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f}; double[] columnSize = {p};
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{fontSizeStyleComboBox}, new Component[]{fontSizeStyleComboBox},
@ -325,8 +325,8 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
private JPanel createPane() { private JPanel createPane() {
JPanel createPane = new JPanel(new BorderLayout(3, 5)); JPanel createPane = new JPanel(new BorderLayout(3, 5));
createPane.add(fontNameComboBox, BorderLayout.NORTH); createPane.add(fontNameComboBox, BorderLayout.NORTH);
createPane.add(createLeftPane(), BorderLayout.CENTER); JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{createLeftPane(), createRightPane()}}, TableLayoutHelper.FILL_LASTCOLUMN, 5, 7);
createPane.add(createRightPane(), BorderLayout.EAST); createPane.add(jPanel, BorderLayout.CENTER);
return createPane; return createPane;
} }

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

@ -23,6 +23,7 @@ public class BasicPropertyPane extends BasicPane {
protected void initContentPane() { protected void initContentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
widgetName = new UITextField(); widgetName = new UITextField();
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -34,7 +35,7 @@ public class BasicPropertyPane extends BasicPane {
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Name")), widgetName}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Name")), widgetName},
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
this.add(panel, BorderLayout.NORTH); this.add(panel, BorderLayout.NORTH);
} }

8
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleBackgroundEditor.java → designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleBackgroundEditor.java

@ -3,9 +3,9 @@
*/ */
package com.fr.design.mainframe.widget.accessibles; package com.fr.design.mainframe.widget.accessibles;
import java.awt.Dimension; import java.awt.*;
import javax.swing.SwingUtilities; import javax.swing.*;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.design.mainframe.widget.wrappers.BackgroundWrapper; import com.fr.design.mainframe.widget.wrappers.BackgroundWrapper;
@ -25,6 +25,10 @@ public class AccessibleBackgroundEditor extends UneditableAccessibleEditor {
super(new BackgroundWrapper()); super(new BackgroundWrapper());
} }
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override @Override
protected void showEditorPane() { protected void showEditorPane() {
if (backgroundPane == null) { if (backgroundPane == null) {

80
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java → designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java

@ -1,38 +1,44 @@
package com.fr.design.mainframe.widget.accessibles; package com.fr.design.mainframe.widget.accessibles;
import javax.swing.SwingUtilities; import javax.swing.*;
import com.fr.data.Dictionary; import com.fr.data.Dictionary;
import com.fr.design.mainframe.widget.wrappers.DictionaryWrapper; import com.fr.design.mainframe.widget.wrappers.DictionaryWrapper;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
public class AccessibleDictionaryEditor extends UneditableAccessibleEditor { import java.awt.*;
private DictionaryPane dictPane; public class AccessibleDictionaryEditor extends UneditableAccessibleEditor {
public AccessibleDictionaryEditor() { private DictionaryPane dictPane;
super(new DictionaryWrapper());
} public AccessibleDictionaryEditor() {
super(new DictionaryWrapper());
@Override }
protected void showEditorPane() {
if (dictPane == null) { protected void setBorderVisible(){
dictPane = new DictionaryPane(); this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
} }
BasicDialog dlg = dictPane.showWindow(SwingUtilities.getWindowAncestor(this)); @Override
dlg.addDialogActionListener(new DialogActionAdapter() { protected void showEditorPane() {
if (dictPane == null) {
@Override dictPane = new DictionaryPane();
public void doOk() { }
Dictionary dict = dictPane.updateBean();
setValue(dict); BasicDialog dlg = dictPane.showWindow(SwingUtilities.getWindowAncestor(this));
fireStateChanged(); dlg.addDialogActionListener(new DialogActionAdapter() {
}
}); @Override
dictPane.populateBean((Dictionary) getValue()); public void doOk() {
dlg.setVisible(true); Dictionary dict = dictPane.updateBean();
} setValue(dict);
fireStateChanged();
}
});
dictPane.populateBean((Dictionary) getValue());
dlg.setVisible(true);
}
} }

80
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleEditor.java → designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleEditor.java

@ -1,41 +1,41 @@
package com.fr.design.mainframe.widget.accessibles; package com.fr.design.mainframe.widget.accessibles;
import java.awt.Component; import java.awt.Component;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import com.fr.design.Exception.ValidationException; import com.fr.design.Exception.ValidationException;
/** /**
* 属性编辑器 * 属性编辑器
* @since 6.5.2 * @since 6.5.2
*/ */
public interface AccessibleEditor { public interface AccessibleEditor {
/** /**
* 判断输入的值是否符合要求 * 判断输入的值是否符合要求
* @throws ValidationException * @throws ValidationException
*/ */
public void validateValue() throws ValidationException; public void validateValue() throws ValidationException;
/** /**
* 获取编辑器里面的值 * 获取编辑器里面的值
*/ */
public Object getValue(); public Object getValue();
/** /**
* 给编辑器设置值 * 给编辑器设置值
* @param v * @param v
*/ */
public void setValue(Object v); public void setValue(Object v);
/** /**
* 自定义编辑器 * 自定义编辑器
* @return * @return
*/ */
public Component getEditor(); public Component getEditor();
public void addChangeListener(ChangeListener l); public void addChangeListener(ChangeListener l);
public void removeChangeListener(ChangeListener l); public void removeChangeListener(ChangeListener l);
} }

8
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleIconEditor.java → designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleIconEditor.java

@ -11,6 +11,9 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.form.ui.WidgetManager; import com.fr.form.ui.WidgetManager;
import javax.swing.*;
import java.awt.*;
public class AccessibleIconEditor extends UneditableAccessibleEditor { public class AccessibleIconEditor extends UneditableAccessibleEditor {
private CustomIconPane customIconPane; private CustomIconPane customIconPane;
@ -24,6 +27,11 @@ public class AccessibleIconEditor extends UneditableAccessibleEditor {
return new RendererField(new IconCellRenderer()); return new RendererField(new IconCellRenderer());
} }
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override @Override
protected void showEditorPane() { protected void showEditorPane() {
if (customIconPane == null) { if (customIconPane == null) {

388
designer_form/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java → designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java

@ -1,193 +1,197 @@
package com.fr.design.mainframe.widget.accessibles; package com.fr.design.mainframe.widget.accessibles;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Insets; import java.awt.Insets;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.Exception.ValidationException; import com.fr.design.Exception.ValidationException;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.editors.TextField; import com.fr.design.mainframe.widget.editors.TextField;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.designer.properties.Decoder; import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder; import com.fr.design.designer.properties.Encoder;
/** /**
* @since 6.5.3 * @since 6.5.3
*/ */
public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor { public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor {
private ArrayList<ChangeListener> listeners; private ArrayList<ChangeListener> listeners;
private boolean showButton; private boolean showButton;
protected Encoder encoder; protected Encoder encoder;
private Decoder decoder; private Decoder decoder;
private UIButton btPopup; private UIButton btPopup;
protected ITextComponent txtValue; protected ITextComponent txtValue;
public BaseAccessibleEditor(Encoder enc, Decoder dec, boolean showBtn) { public BaseAccessibleEditor(Encoder enc, Decoder dec, boolean showBtn) {
listeners = new ArrayList<ChangeListener>(); listeners = new ArrayList<ChangeListener>();
this.showButton = showBtn; this.showButton = showBtn;
this.encoder = enc; this.encoder = enc;
this.decoder = dec; this.decoder = dec;
initComponents(); initComponents();
txtValue.setEditable(dec != null); txtValue.setEditable(dec != null);
((JComponent) txtValue).setBorder(null); setBorderVisible();
} }
@Override protected void setBorderVisible(){
public void requestFocus() { ((JComponent) txtValue).setBorder(null);
super.requestFocus(); }
if (decoder != null) {
((JComponent) txtValue).requestFocus(); @Override
} else if (showButton) { public void requestFocus() {
btPopup.requestFocus(); super.requestFocus();
} if (decoder != null) {
} ((JComponent) txtValue).requestFocus();
} else if (showButton) {
protected ITextComponent createTextField() { btPopup.requestFocus();
return new TextField(); }
} }
private void initComponents() { protected ITextComponent createTextField() {
setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1)); return new TextField();
txtValue = createTextField(); }
setLayout(FRGUIPaneFactory.createBorderLayout());
private void initComponents() {
txtValue.addActionListener(new ActionListener() { setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1));
txtValue = createTextField();
@Override setLayout(FRGUIPaneFactory.createBorderLayout());
public void actionPerformed(ActionEvent evt) {
txtValueActionPerformed(evt); txtValue.addActionListener(new ActionListener() {
}
}); @Override
add((JComponent) txtValue, BorderLayout.CENTER); public void actionPerformed(ActionEvent evt) {
setOpaque(false); txtValueActionPerformed(evt);
}
if (showButton) { });
btPopup = new UIButton(); add((JComponent) txtValue, BorderLayout.CENTER);
initPopupButton(); setOpaque(false);
btPopup.addActionListener(new ActionListener() {
if (showButton) {
@Override btPopup = new UIButton();
public void actionPerformed(ActionEvent evt) { initPopupButton();
showEditorPane(); btPopup.addActionListener(new ActionListener() {
}
}); @Override
add(btPopup, BorderLayout.EAST); public void actionPerformed(ActionEvent evt) {
} showEditorPane();
} }
});
@Override add(btPopup, BorderLayout.EAST);
protected String title4PopupWindow() { }
return "Base"; }
}
@Override
// 显示编辑器细节 protected String title4PopupWindow() {
protected void showEditorPane() { return "Base";
} }
protected void initPopupButton() { // 显示编辑器细节
if (!isComboButton()) { protected void showEditorPane() {
btPopup.setText("..."); }
btPopup.setPreferredSize(new Dimension(20, 20));
} else { protected void initPopupButton() {
btPopup.setRolloverEnabled(true); if (!isComboButton()) {
btPopup.setFocusPainted(false); btPopup.setText("...");
btPopup.setPreferredSize(new Dimension(15, 19)); btPopup.setPreferredSize(new Dimension(20, 20));
btPopup.setBorderPainted(false); } else {
btPopup.setContentAreaFilled(false); btPopup.setRolloverEnabled(true);
btPopup.setMargin(new Insets(0, 0, 0, 0)); btPopup.setFocusPainted(false);
btPopup.setIcon(BaseUtils.readIcon("/com/fr/design/images/form/designer/drop_up.png")); btPopup.setPreferredSize(new Dimension(15, 19));
btPopup.setPressedIcon(BaseUtils.readIcon("/com/fr/design/images/form/designer/drop_down.png")); btPopup.setBorderPainted(false);
btPopup.setRolloverIcon(BaseUtils.readIcon("/com/fr/design/images/form/designer/drop_over.png")); btPopup.setContentAreaFilled(false);
} btPopup.setMargin(new Insets(0, 0, 0, 0));
} btPopup.setIcon(BaseUtils.readIcon("/com/fr/design/images/form/designer/drop_up.png"));
btPopup.setPressedIcon(BaseUtils.readIcon("/com/fr/design/images/form/designer/drop_down.png"));
// 有的编辑器是使用下拉框来直接选择的,这时候就把按钮显示成下拉框 btPopup.setRolloverIcon(BaseUtils.readIcon("/com/fr/design/images/form/designer/drop_over.png"));
protected boolean isComboButton() { }
return false; }
}
// 有的编辑器是使用下拉框来直接选择的,这时候就把按钮显示成下拉框
private void txtValueActionPerformed(ActionEvent evt) { protected boolean isComboButton() {
try { return false;
validateValue(); }
fireStateChanged();
} catch (ValidationException e) { private void txtValueActionPerformed(ActionEvent evt) {
showMessage(e.getMessage(), this); try {
txtValue.selectAll(); validateValue();
((JComponent) txtValue).requestFocus(); fireStateChanged();
} } catch (ValidationException e) {
} showMessage(e.getMessage(), this);
txtValue.selectAll();
@Override ((JComponent) txtValue).requestFocus();
public Component getEditor() { }
return this; }
}
@Override
@Override public Component getEditor() {
public Object getValue() { return this;
return decoder.decode(txtValue.getText()); }
}
@Override
@Override public Object getValue() {
public void setValue(Object v) { return decoder.decode(txtValue.getText());
if(encoder != null) { }
txtValue.setText(encoder.encode(v));
} @Override
txtValue.setValue(v); public void setValue(Object v) {
} if(encoder != null) {
txtValue.setText(encoder.encode(v));
@Override }
public void addChangeListener(ChangeListener l) { txtValue.setValue(v);
if (!listeners.contains(l)) { }
listeners.add(l);
} @Override
} public void addChangeListener(ChangeListener l) {
if (!listeners.contains(l)) {
@Override listeners.add(l);
public void removeChangeListener(ChangeListener l) { }
if (listeners.contains(l)) { }
listeners.remove(l);
} @Override
} public void removeChangeListener(ChangeListener l) {
if (listeners.contains(l)) {
protected void fireStateChanged() { listeners.remove(l);
ChangeEvent e = new ChangeEvent(this); }
for (ChangeListener l : listeners) { }
l.stateChanged(e);
} protected void fireStateChanged() {
} ChangeEvent e = new ChangeEvent(this);
for (ChangeListener l : listeners) {
public Encoder getEncoder() { l.stateChanged(e);
return encoder; }
} }
public void setEncoder(Encoder encoder) { public Encoder getEncoder() {
this.encoder = encoder; return encoder;
} }
@Override public void setEncoder(Encoder encoder) {
public void validateValue() throws ValidationException { this.encoder = encoder;
if (decoder != null) { }
decoder.validate(txtValue.getText());
} @Override
} public void validateValue() throws ValidationException {
if (decoder != null) {
public static void showMessage(String message, Component editorComponent) { decoder.validate(txtValue.getText());
JOptionPane.showMessageDialog(editorComponent, message, "Validation Error", JOptionPane.ERROR_MESSAGE); }
} }
public static void showMessage(String message, Component editorComponent) {
JOptionPane.showMessageDialog(editorComponent, message, "Validation Error", JOptionPane.ERROR_MESSAGE);
}
} }

98
designer_form/src/com/fr/design/mainframe/widget/accessibles/RendererField.java → designer_base/src/com/fr/design/mainframe/widget/accessibles/RendererField.java

@ -1,50 +1,50 @@
package com.fr.design.mainframe.widget.accessibles; package com.fr.design.mainframe.widget.accessibles;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import javax.swing.JComponent; import javax.swing.*;
import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.renderer.GenericCellRenderer; import com.fr.design.mainframe.widget.renderer.GenericCellRenderer;
public class RendererField extends JComponent implements ITextComponent{ public class RendererField extends JComponent implements ITextComponent{
private GenericCellRenderer renderer; private GenericCellRenderer renderer;
public RendererField(GenericCellRenderer renderer) { public RendererField(GenericCellRenderer renderer) {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.renderer = renderer; this.renderer = renderer;
add(renderer, BorderLayout.CENTER); add(renderer, BorderLayout.CENTER);
} }
@Override @Override
public void addActionListener(ActionListener l) { public void addActionListener(ActionListener l) {
} }
@Override @Override
public String getText() { public String getText() {
return null; return null;
} }
@Override @Override
public void selectAll() { public void selectAll() {
} }
@Override @Override
public void setEditable(boolean editable) { public void setEditable(boolean editable) {
this.setEnabled(editable); this.setEnabled(editable);
} }
@Override @Override
public void setText(String text) { public void setText(String text) {
} }
@Override @Override
public void setValue(Object v) { public void setValue(Object v) {
renderer.setValue(v); renderer.setValue(v);
this.repaint(); this.repaint();
} }
} }

44
designer_form/src/com/fr/design/mainframe/widget/accessibles/UneditableAccessibleEditor.java → designer_base/src/com/fr/design/mainframe/widget/accessibles/UneditableAccessibleEditor.java

@ -1,23 +1,23 @@
package com.fr.design.mainframe.widget.accessibles; package com.fr.design.mainframe.widget.accessibles;
import com.fr.design.designer.properties.Encoder; import com.fr.design.designer.properties.Encoder;
public abstract class UneditableAccessibleEditor extends BaseAccessibleEditor { public abstract class UneditableAccessibleEditor extends BaseAccessibleEditor {
protected Object value; protected Object value;
public UneditableAccessibleEditor(Encoder enc) { public UneditableAccessibleEditor(Encoder enc) {
super(enc, null, true); super(enc, null, true);
} }
@Override @Override
public Object getValue() { public Object getValue() {
return value; return value;
} }
@Override @Override
public void setValue(Object v) { public void setValue(Object v) {
this.value = v; this.value = v;
super.setValue(v); super.setValue(v);
} }
} }

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

@ -58,7 +58,7 @@ public class DataBindingEditor extends Editor<DataBinding> {
public DataBindingEditor() { public DataBindingEditor() {
this.initCompontents(); this.initCompontents();
this.setName(Inter.getLocText("FieldBinding")); this.setName(Inter.getLocText("FR-Designer_Widget_Field"));
} }

0
designer_form/src/com/fr/design/mainframe/widget/editors/ITextComponent.java → designer_base/src/com/fr/design/mainframe/widget/editors/ITextComponent.java

0
designer_form/src/com/fr/design/mainframe/widget/editors/TextField.java → designer_base/src/com/fr/design/mainframe/widget/editors/TextField.java

186
designer_form/src/com/fr/design/mainframe/widget/renderer/GenericCellRenderer.java → designer_base/src/com/fr/design/mainframe/widget/renderer/GenericCellRenderer.java

@ -1,94 +1,94 @@
package com.fr.design.mainframe.widget.renderer; package com.fr.design.mainframe.widget.renderer;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import javax.swing.table.TableCellRenderer; import javax.swing.table.TableCellRenderer;
public abstract class GenericCellRenderer extends JComponent implements TableCellRenderer { public abstract class GenericCellRenderer extends JComponent implements TableCellRenderer {
private static final Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1); private static final Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1); protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
@Override @Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component component = getRendererComponent(); Component component = getRendererComponent();
Color fg = null; Color fg = null;
Color bg = null; Color bg = null;
JTable.DropLocation dropLocation = table.getDropLocation(); JTable.DropLocation dropLocation = table.getDropLocation();
if ((dropLocation != null) && !dropLocation.isInsertRow() if ((dropLocation != null) && !dropLocation.isInsertRow()
&& !dropLocation.isInsertColumn() && !dropLocation.isInsertColumn()
&& (dropLocation.getRow() == row) && (dropLocation.getRow() == row)
&& (dropLocation.getColumn() == column)) { && (dropLocation.getColumn() == column)) {
fg = UIManager.getColor("Table.dropCellForeground"); fg = UIManager.getColor("Table.dropCellForeground");
bg = UIManager.getColor("Table.dropCellBackground"); bg = UIManager.getColor("Table.dropCellBackground");
isSelected = true; isSelected = true;
} }
if (isSelected) { if (isSelected) {
component.setForeground((fg == null) ? table.getSelectionForeground() : fg); component.setForeground((fg == null) ? table.getSelectionForeground() : fg);
component.setBackground((bg == null) ? table.getSelectionBackground() : bg); component.setBackground((bg == null) ? table.getSelectionBackground() : bg);
} else { } else {
component.setForeground(table.getForeground()); component.setForeground(table.getForeground());
component.setBackground(table.getBackground()); component.setBackground(table.getBackground());
} }
component.setFont(table.getFont()); component.setFont(table.getFont());
if (hasFocus) { if (hasFocus) {
Border border = null; Border border = null;
if (isSelected) { if (isSelected) {
border = UIManager.getBorder("Table.focusSelectedCellHighlightBorder"); border = UIManager.getBorder("Table.focusSelectedCellHighlightBorder");
} }
if (border == null) { if (border == null) {
border = UIManager.getBorder("Table.focusCellHighlightBorder"); border = UIManager.getBorder("Table.focusCellHighlightBorder");
} }
((JComponent) component).setBorder(border); ((JComponent) component).setBorder(border);
if (!isSelected && table.isCellEditable(row, column)) { if (!isSelected && table.isCellEditable(row, column)) {
Color col; Color col;
col = UIManager.getColor("Table.focusCellForeground"); col = UIManager.getColor("Table.focusCellForeground");
if (col != null) { if (col != null) {
component.setForeground(col); component.setForeground(col);
} }
col = UIManager.getColor("Table.focusCellBackground"); col = UIManager.getColor("Table.focusCellBackground");
if (col != null) { if (col != null) {
component.setBackground(col); component.setBackground(col);
} }
} }
} }
((JComponent) component).setBorder(getNoFocusBorder()); ((JComponent) component).setBorder(getNoFocusBorder());
setValue(value); setValue(value);
return component; return component;
} }
private static Border getNoFocusBorder() { private static Border getNoFocusBorder() {
if (System.getSecurityManager() != null) { if (System.getSecurityManager() != null) {
return SAFE_NO_FOCUS_BORDER; return SAFE_NO_FOCUS_BORDER;
} else { } else {
return noFocusBorder; return noFocusBorder;
} }
} }
public Component getRendererComponent() { public Component getRendererComponent() {
return this; return this;
} }
public abstract void setValue(Object value); public abstract void setValue(Object value);
} }

13
designer_form/src/com/fr/design/mainframe/widget/renderer/IconCellRenderer.java → designer_base/src/com/fr/design/mainframe/widget/renderer/IconCellRenderer.java

@ -1,17 +1,22 @@
package com.fr.design.mainframe.widget.renderer; package com.fr.design.mainframe.widget.renderer;
import java.awt.Graphics; import java.awt.*;
import java.awt.Graphics2D;
import java.awt.Image;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Icon; import com.fr.base.Icon;
import com.fr.base.IconManager; import com.fr.base.IconManager;
import com.fr.form.ui.WidgetManager; import com.fr.form.ui.WidgetManager;
import javax.swing.*;
public class IconCellRenderer extends GenericCellRenderer { public class IconCellRenderer extends GenericCellRenderer {
private Image img; private Image img;
public IconCellRenderer(){
// this.setBorder(BorderFactory.createLineBorder());
}
@Override @Override
public void setValue(Object v) { public void setValue(Object v) {
try { try {
@ -34,7 +39,7 @@ public class IconCellRenderer extends GenericCellRenderer {
int height = getHeight(); int height = getHeight();
g.setColor(getBackground()); g.setColor(getBackground());
g.fillRect(0, 0, width, height); g.fillRect(0, 0, width, height);
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
if (img != null) { if (img != null) {
g2d.drawImage(img, 4, g2d.drawImage(img, 4,

0
designer_form/src/com/fr/design/mainframe/widget/wrappers/BackgroundWrapper.java → designer_base/src/com/fr/design/mainframe/widget/wrappers/BackgroundWrapper.java

0
designer_form/src/com/fr/design/mainframe/widget/wrappers/DictionaryWrapper.java → designer_base/src/com/fr/design/mainframe/widget/wrappers/DictionaryWrapper.java

0
designer_form/src/com/fr/design/mainframe/widget/wrappers/IconWrapper.java → designer_base/src/com/fr/design/mainframe/widget/wrappers/IconWrapper.java

3
designer_base/src/com/fr/design/widget/DataModify.java

@ -1,9 +1,6 @@
package com.fr.design.widget; package com.fr.design.widget;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.Widget;
import javax.swing.*; import javax.swing.*;

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

@ -3,6 +3,7 @@ package com.fr.design.widget;
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.ispinner.UISpinner;
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.general.Inter; import com.fr.general.Inter;
@ -16,6 +17,7 @@ import java.awt.*;
public class WidgetBoundsPaneFactory { public class WidgetBoundsPaneFactory {
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) { public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) {
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -25,10 +27,10 @@ public class WidgetBoundsPaneFactory {
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f, f}; double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}}; int[][] rowCount = {{1, 1, 1}, {1, 1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5); final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 10);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel);
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 280, 24, panel); return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 280, 24, boundsPane);
} }
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) { public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) {
@ -44,9 +46,10 @@ public class WidgetBoundsPaneFactory {
double[] rowSize = {p, p, p, p}; double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f, f}; double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}}; 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); final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 10);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15)); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 230, 24, panel); boundsPane.add(panel);
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 230, 24, boundsPane);
} }
} }

2
designer_base/src/com/fr/design/widget/btn/ButtonDetailPane.java

@ -28,7 +28,7 @@ public abstract class ButtonDetailPane<T extends Button> extends BasicPane {
return Inter.getLocText("Button"); return Inter.getLocText("Button");
} }
public void populate(Button button) { public void populate(T button) {
} }

40
designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java

@ -4,12 +4,13 @@ import java.awt.*;
import javax.swing.*; import javax.swing.*;
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.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.IconDefinePane; import com.fr.design.mainframe.widget.accessibles.AccessibleIconEditor;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -24,48 +25,49 @@ import com.fr.stable.StableUtils;
public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends ButtonDetailPane<T> { public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends ButtonDetailPane<T> {
private UITextField hotkeysTextField; private UITextField hotkeysTextField;
private UITextField buttonNameTextField; private UITextField buttonNameTextField;
private IconDefinePane iconPane; private AccessibleIconEditor iconPane;
public ButtonWithHotkeysDetailPane() { public ButtonWithHotkeysDetailPane() {
initComponents(); initComponents();
} }
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout(7, 7));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
advancedPane.setPreferredSize(new Dimension(600, 341)); double f = TableLayout.FILL;
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
this.add(advancedPane);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double rowSize[] = {p, p, p, p}; double rowSize[] = {p, p, p, p};
double columnSize[] = {p, p}; double columnSize[] = {p, f};
JPanel labelPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel labelPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
iconPane = new IconDefinePane(); iconPane = new AccessibleIconEditor();
labelPane.add(iconPane); labelPane.add(iconPane);
Component[][] n_components = { Component[][] n_components = {
{new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField = new UITextField(16)},
{new UILabel(Inter.getLocText("FR-Designer_Button-Icon") + ":"), labelPane},
{new UILabel(Inter.getLocText("FR-Designer_Button-Type") + ":"), createButtonTypeComboBox()}, {new UILabel(Inter.getLocText("FR-Designer_Button-Type") + ":"), createButtonTypeComboBox()},
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField = new UITextField(16)} {new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField = new UITextField()},
{new UILabel(Inter.getLocText("FR-Designer_Button-Icon") + ":"), iconPane},
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField = new UITextField()},
}; };
hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ",")); hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 0, 8); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 16, 8);
advancedPane.add(panel,BorderLayout.NORTH); advancePane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
advancePane.add(panel, BorderLayout.NORTH);
Component comp = createCenterPane(); Component comp = createCenterPane();
if(comp != null ) { if(comp != null ) {
advancedPane.add(comp,BorderLayout.CENTER); advancePane.add(comp,BorderLayout.CENTER);
} }
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane);
this.add(uiExpandablePane);
} }
protected abstract Component createCenterPane(); protected abstract Component createCenterPane();
@Override @Override
public void populate(Button button) { public void populate(T button) {
if (button == null) { if (button == null) {
return; return;
} }
iconPane.populate(button.getIconName()); iconPane.setValue(button.getIconName());
buttonNameTextField.setText(button.getText()); buttonNameTextField.setText(button.getText());
hotkeysTextField.setText(button.getHotkeys()); hotkeysTextField.setText(button.getHotkeys());
} }
@ -73,7 +75,7 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
@Override @Override
public T update() { public T update() {
T button = createButton(); T button = createButton();
button.setIconName(iconPane.update()); button.setIconName((String)iconPane.getValue());
button.setText(buttonNameTextField.getText()); button.setText(buttonNameTextField.getText());
button.setHotkeys(hotkeysTextField.getText()); button.setHotkeys(hotkeysTextField.getText());
return button; return button;

28
designer_form/src/com/fr/design/widget/ui/designer/component/BackgroundCompPane.java → designer_base/src/com/fr/design/widget/component/BackgroundCompPane.java

@ -1,4 +1,4 @@
package com.fr.design.widget.ui.designer.component; package com.fr.design.widget.component;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ibutton.UIHeadGroup;
@ -7,6 +7,7 @@ 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.Widget;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -16,11 +17,11 @@ import java.awt.*;
/** /**
* Created by ibm on 2017/8/6. * Created by ibm on 2017/8/6.
*/ */
public class BackgroundCompPane extends BasicPane { public abstract class BackgroundCompPane<T extends Widget> extends BasicPane {
private UIHeadGroup backgroundHead; protected UIHeadGroup backgroundHead;
private AccessibleBackgroundEditor initalBackgroundEditor; protected AccessibleBackgroundEditor initalBackgroundEditor;
private AccessibleBackgroundEditor overBackgroundEditor; protected AccessibleBackgroundEditor overBackgroundEditor;
private AccessibleBackgroundEditor clickBackgroundEditor; protected AccessibleBackgroundEditor clickBackgroundEditor;
public BackgroundCompPane() { public BackgroundCompPane() {
@ -62,18 +63,9 @@ public class BackgroundCompPane extends BasicPane {
} }
public MouseActionBackground update() {
MouseActionBackground mouseActionBackground = new MouseActionBackground((Background) initalBackgroundEditor.getValue(), (Background) overBackgroundEditor.getValue(), (Background) clickBackgroundEditor.getValue());
return mouseActionBackground;
}
protected String title4PopupWindow() { public abstract void update(T e);
return "";
} public abstract void populate(T e);
public void populate(MouseActionBackground background) {
initalBackgroundEditor.setValue(background.getInitialBackground());
overBackgroundEditor.setValue(background.getOverBackground());
clickBackgroundEditor.setValue(background.getClickBackground());
}
} }

48
designer_base/src/com/fr/design/widget/component/ButtonBackgroundPane.java

@ -0,0 +1,48 @@
package com.fr.design.widget.component;
import com.fr.form.ui.FreeButton;
import com.fr.general.Background;
/**
* Created by ibm on 2017/8/8.
*/
public class ButtonBackgroundPane extends BackgroundCompPane<FreeButton> {
public ButtonBackgroundPane(){
}
public void update(FreeButton freeButton){
int selectIndex = backgroundHead.getSelectedIndex();
if(selectIndex == 0){
freeButton.setCustomStyle(false);
freeButton.setInitialBackground(null);
freeButton.setOverBackground(null);
freeButton.setClickBackground(null);
}else{
freeButton.setCustomStyle(true);
freeButton.setInitialBackground((Background) initalBackgroundEditor.getValue());
freeButton.setOverBackground((Background) overBackgroundEditor.getValue());
freeButton.setClickBackground((Background)clickBackgroundEditor.getValue());
}
}
public void populate(FreeButton freeButton){
if(!freeButton.isCustomStyle()){
backgroundHead.setSelectedIndex(0);
initalBackgroundEditor.setValue(null);
overBackgroundEditor.setValue(null);
clickBackgroundEditor.setValue(null);
}else{
backgroundHead.setSelectedIndex(1);
initalBackgroundEditor.setValue(freeButton.getInitialBackground());
overBackgroundEditor.setValue(freeButton.getOverBackground());
clickBackgroundEditor.setValue(freeButton.getClickBackground());
}
}
protected String title4PopupWindow() {
return "buttonBackground";
}
}

81
designer_base/src/com/fr/design/widget/component/DateValuePane.java

@ -0,0 +1,81 @@
package com.fr.design.widget.component;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.editor.editor.*;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by ibm on 2017/8/8.
*/
public class DateValuePane extends JPanel {
private UIHeadGroup widgetValueHead;
private Editor[] editor;
public DateValuePane() {
editor = new Editor[]{
new NoneEditor(null, Inter.getLocText("None")),
new DateEditor(true, Inter.getLocText("Date")),
new FormulaEditor(Inter.getLocText("Parameter-Formula"))
};
this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL));
final CardLayout cardLayout = new CardLayout();
final JPanel customPane = new JPanel(cardLayout);
final String[] tabTitles = new String[editor.length];
for (int i = 0; i < editor.length; i++) {
customPane.add(editor[i], editor[i].getName());
tabTitles[i] = editor[i].getName();
}
widgetValueHead = new UIHeadGroup(tabTitles) {
@Override
public void tabChanged(int index) {
if (ComparatorUtils.equals(tabTitles[index], Inter.getLocText("None"))) {
customPane.setVisible(false);
} else {
customPane.setVisible(true);
}
cardLayout.show(customPane, tabTitles[index]);
}
};
this.add(widgetValueHead, BorderLayout.NORTH);
this.add(customPane, BorderLayout.CENTER);
}
public Object update() {
int index = widgetValueHead.getSelectedIndex();
Editor e = editor[index];
Object value = e.getValue();
return value;
}
public void populate(Object ob) {
for (int i = 0; i < editor.length; i++) {
if (editor[i].accept(ob)) {
setCardValue(i, ob);
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);
}
}
}

12
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleWLayoutBorderStyleEditor.java

@ -3,9 +3,6 @@
*/ */
package com.fr.design.mainframe.widget.accessibles; package com.fr.design.mainframe.widget.accessibles;
import java.awt.Dimension;
import javax.swing.SwingUtilities;
import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer;
@ -15,6 +12,9 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.xpane.LayoutBorderPane; import com.fr.design.gui.xpane.LayoutBorderPane;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
import javax.swing.*;
import java.awt.*;
public class AccessibleWLayoutBorderStyleEditor extends UneditableAccessibleEditor { public class AccessibleWLayoutBorderStyleEditor extends UneditableAccessibleEditor {
private LayoutBorderPane borderPane; private LayoutBorderPane borderPane;
@ -26,7 +26,11 @@ public class AccessibleWLayoutBorderStyleEditor extends UneditableAccessibleEdit
protected ITextComponent createTextField() { protected ITextComponent createTextField() {
return new RendererField(new LayoutBorderStyleRenderer()); return new RendererField(new LayoutBorderStyleRenderer());
} }
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override @Override
protected void showEditorPane() { protected void showEditorPane() {
if (borderPane == null) { if (borderPane == null) {

1
designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java

@ -21,6 +21,7 @@ public class FormBasicWidgetPropertyPane extends FormBasicPropertyPane {
protected void initOtherPane() { protected void initOtherPane() {
JPanel pane2 = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); JPanel pane2 = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
pane2.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true); enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true);
pane2.add(enableCheckBox); pane2.add(enableCheckBox);
visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true); visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true);

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

@ -59,12 +59,15 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
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, 10);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
return panel; panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
jPanel.add(panel);
return jPanel;
} }
public JPanel createAdvancePane() { public JPanel createAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery")); displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery"));
background = new AccessibleBackgroundEditor(); background = new AccessibleBackgroundEditor();
Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
@ -84,9 +87,10 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
new Component[]{displayReport, null}, new Component[]{displayReport, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane} 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, 10);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
return panel; jPanel.add(panel);
return jPanel;
} }
@Override @Override

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

@ -7,6 +7,7 @@ import com.fr.design.gui.core.WidgetConstants;
import com.fr.design.parameter.RootDesignDefinePane; import com.fr.design.parameter.RootDesignDefinePane;
import com.fr.design.widget.ui.designer.*; import com.fr.design.widget.ui.designer.*;
import com.fr.design.widget.ui.designer.layout.*; import com.fr.design.widget.ui.designer.layout.*;
import com.fr.form.parameter.FormSubmitButton;
import com.fr.form.ui.*; import com.fr.form.ui.*;
import com.fr.form.ui.container.*; import com.fr.form.ui.container.*;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
@ -51,6 +52,7 @@ public class FormWidgetDefinePaneFactoryBase {
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(FreeButtonDefinePane.class, WidgetConstants.BUTTON + "")); defineMap.put(Button.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(FreeButton.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + "")); defineMap.put(FreeButton.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(FormSubmitButton.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) {

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

@ -45,13 +45,15 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
{new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField}, {new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField},
backgroundCompPane, backgroundCompPane,
frFont, frFont,
{new UILabel(Inter.getLocText("FR-Designer_Icon" + ":")), iconPane}, {new UILabel(Inter.getLocText("FR-Designer_Icon") + ":"), iconPane},
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField} {new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField}
}; };
hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ",")); hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, rowCount, 10, 8); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, rowCount, 10, 10);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
UIExpandablePane advancedPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, panel); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
boundsPane.add(panel);
UIExpandablePane advancedPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, boundsPane);
this.add(advancedPane); this.add(advancedPane);
} }

16
designer_form/src/com/fr/design/widget/ui/designer/ButtonGroupDictPane.java

@ -5,10 +5,12 @@ 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.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
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 java.awt.*;
public class ButtonGroupDictPane extends JPanel { public class ButtonGroupDictPane extends JPanel {
@ -24,14 +26,18 @@ public class ButtonGroupDictPane extends JPanel {
* *
*/ */
public void initComponents() { public void initComponents() {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
adaptiveCheckbox = new UICheckBox(Inter.getLocText("Adaptive"), true);
this.add(adaptiveCheckbox);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
adaptiveCheckbox = new UICheckBox(Inter.getLocText("Adaptive"), true);
adaptiveCheckbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.columnLabel = new UILabel(Inter.getLocText("Button-Group-Display-Columns") + ":"); this.columnLabel = new UILabel(Inter.getLocText("Button-Group-Display-Columns") + ":");
this.add(columnLabel);
columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1)); columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
this.add(columnSpinner);
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{adaptiveCheckbox, columnLabel, columnSpinner}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(jPanel);
} }
public void populate(ButtonGroup buttonGroup) { public void populate(ButtonGroup buttonGroup) {

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

@ -41,8 +41,10 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 3},{1, 1}}; int[][] rowCount = {{1, 1},{1, 3},{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)); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, panel); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel);
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, boundsPane);
this.add(uiExpandablePane); this.add(uiExpandablePane);
} }

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

@ -40,6 +40,7 @@ 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"}));
checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")}; final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")};
returnType = new UIHeadGroup(tabTitles) { returnType = new UIHeadGroup(tabTitles) {
@Override @Override
@ -65,7 +66,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
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, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(0,5,5,5)); panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
return panel; return panel;
} }

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

@ -8,6 +8,7 @@ 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 com.fr.general.Inter;
import javax.swing.*;
import java.awt.*; import java.awt.*;
public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> { public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
@ -20,6 +21,7 @@ public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
public UICheckBox createRepeatCheckBox(){ public UICheckBox createRepeatCheckBox(){
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget_No_Repeat")); removeRepeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget_No_Repeat"));
removeRepeatCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
return removeRepeatCheckBox; return removeRepeatCheckBox;
} }

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

@ -26,6 +26,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
public UICheckBox createRepeatCheckBox(){ public UICheckBox createRepeatCheckBox(){
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget_No_Repeat")); removeRepeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget_No_Repeat"));
removeRepeatCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
return removeRepeatCheckBox; return removeRepeatCheckBox;
} }
@ -62,7 +63,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
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, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(0,5,5,5)); panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
return panel; return panel;
} }

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

@ -29,10 +29,11 @@ public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRe
public JPanel setValidatePane(){ public JPanel setValidatePane(){
this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false);
this.customDataCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.customDataCheckBox.setPreferredSize( this.customDataCheckBox.setPreferredSize(
new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT));
JPanel otherContentPane = super.setValidatePane(); JPanel otherContentPane = super.setValidatePane();
otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 5)); otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 0));
return otherContentPane; return otherContentPane;
} }

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

@ -3,10 +3,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.data.core.FormatField; import com.fr.data.core.FormatField;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.ibutton.UIHeadGroup; 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;
@ -14,14 +11,13 @@ 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.widget.component.DateValuePane;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; 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;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.UtilEvalError; import com.fr.stable.UtilEvalError;
import javax.swing.*; import javax.swing.*;
@ -32,15 +28,15 @@ import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> { public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> {
private UIComboBox returnTypeComboBox; private UIHeadGroup returnTypeComboBox;
private UILabel sampleLabel;// preview private DateValuePane startDv;
private UIComboBox dateFormatComboBox; private DateValuePane endDv;
private ValueEditorPane startDv;
private ValueEditorPane endDv;
private WaterMarkDictPane waterMarkDictPane; private WaterMarkDictPane waterMarkDictPane;
private FormWidgetValuePane formWidgetValuePane; private FormWidgetValuePane formWidgetValuePane;
private UISpinner fontSizePane; private UISpinner fontSizePane;
private UIHeadGroup formatHeader; private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel;
private UIHeadGroup fomatHeadGroup;
public DateEditorDefinePane(XCreator xCreator) { public DateEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -59,35 +55,20 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
fontSizePane = new UISpinner(0, 20, 1, 0); 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 UIHeadGroup(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}){
returnTypeComboBox.setPreferredSize(new Dimension(70, 20)); protected void tabChanged(int newSelectedIndex) {
// sample pane //todo
sampleLabel = new UILabel("");
sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4));
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
JPanel previewPane = FRGUIPaneFactory.createTitledBorderPane("示例");
previewPane.add(sampleLabel);
// content pane
String[] arr = getDateFormateArray();
dateFormatComboBox = new UIComboBox(arr);
dateFormatComboBox.setPreferredSize(new Dimension(150, 20));
dateFormatComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
refreshPreviewLabel();
} }
};
JPanel formatHead = createFormatHead();
}); startDv = new DateValuePane();
startDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null); endDv = new DateValuePane();
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("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-Engine_Format") + ":"), dateFormatComboBox}, new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), formatHead},
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}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark") + ":"), waterMarkDictPane},
@ -95,43 +76,80 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox} new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox}
}; };
double[] rowSize = {p, p, p, p, p, p, p, p, p, p}; double[] rowSize = {p, p, 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}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 3}, {1, 3}, {1, 1}, {1, 1}, {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, 10);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
return panel; boundsPane.add(panel);
return boundsPane;
} }
protected void initFormatHeader() {
String [] tabTitles = getDateFormateArray();
formatHeader = new UIHeadGroup(tabTitles){
protected void tabChanged(int newSelectedIndex) {
} private JPanel createFormatPane(UIComboBox formatComboBox, UILabel sampleLabel){
}; JPanel previewPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Base_StyleFormat_Sample"));
previewPane.add(sampleLabel);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(previewPane, BorderLayout.NORTH);
jPanel.add(formatComboBox, BorderLayout.CENTER);
return jPanel;
} }
private String[] getDateFormateArray() { private UILabel createSamplePane(){
return FormatField.getInstance().getDateFormatArray(); UILabel sampleLabel = new UILabel("");
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
return sampleLabel;
} }
protected JPanel initStartEndDatePane() { private JPanel createFormatHead(){
JPanel rangePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); String[] dateArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.DATE);
rangePane.add(new UILabel(Inter.getLocText("FS_Start_Date") + ":")); String[] timeArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.TIME);
startDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null); final UIComboBox dateFormatComboBox = new UIComboBox(dateArray);
rangePane.add(startDv); final UIComboBox timeFormatComboBox = new UIComboBox(timeArray);
rangePane.add(new UILabel(Inter.getLocText("FS_End_Date") + ":")); dateFormatComboBox.addActionListener(new ActionListener(){
endDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null); public void actionPerformed(ActionEvent e){
rangePane.add(endDv); refreshPreviewLabel();
}
return rangePane; });
timeFormatComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
refreshPreviewLabel();
}
});
final UILabel dateSampleLabel = createSamplePane();
final UILabel timeSampleLabel = createSamplePane();
JPanel fomatHeadPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final CardLayout cardLayout = new CardLayout();
final JPanel customPane = new JPanel(cardLayout);
JPanel dateFormatPane = createFormatPane(dateFormatComboBox, dateSampleLabel);
JPanel timeFormatPane = createFormatPane(timeFormatComboBox, timeSampleLabel);
customPane.add(dateFormatPane, Inter.getLocText("StyleFormat-Date"));
customPane.add(timeFormatPane, Inter.getLocText("StyleFormat-Time"));
final String[] tabTitles = new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")};
fomatHeadGroup = new UIHeadGroup(new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")}){
protected void tabChanged(int newSelectedIndex) {
cardLayout.show(customPane, tabTitles[newSelectedIndex]);
if(newSelectedIndex == 0){
currentFormatComboBox = dateFormatComboBox;
currentSamplelabel = dateSampleLabel;
}else{
currentFormatComboBox = timeFormatComboBox;
currentSamplelabel = timeSampleLabel;
}
refreshPreviewLabel();
}
};
fomatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH);
fomatHeadPane.add(customPane, BorderLayout.CENTER);
return fomatHeadPane;
} }
private void refreshPreviewLabel() { private void refreshPreviewLabel() {
String text = (String) dateFormatComboBox.getSelectedItem(); String text = (String) currentFormatComboBox.getSelectedItem();
if (text != null && text.length() > 0) { if (text != null && text.length() > 0) {
try { try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(text); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(text);
@ -141,25 +159,28 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
sample += " " + Inter.getLocText("DateFormat-Custom_Warning"); sample += " " + Inter.getLocText("DateFormat-Custom_Warning");
c = Color.red; c = Color.red;
} }
this.sampleLabel.setText(sample); currentSamplelabel.setText(sample);
this.sampleLabel.setForeground(c); currentSamplelabel.setForeground(c);
} catch (Exception exp) { } catch (Exception exp) {
this.sampleLabel.setForeground(Color.red); currentSamplelabel.setForeground(Color.red);
this.sampleLabel.setText(exp.getMessage()); currentSamplelabel.setText(exp.getMessage());
} }
} else { } else {
this.sampleLabel.setText(new Date().toString()); currentSamplelabel.setText(new Date().toString());
} }
} }
@Override @Override
protected void populateSubDirectWriteEditorBean(DateEditor e) { protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText(); String formatText = e.getFormatText();
dateFormatComboBox.setSelectedItem(formatText); fomatHeadGroup.setSelectedIndex(getDateType(e));
currentFormatComboBox.setSelectedItem(formatText);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 1 : 0); returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 0 : 1);
formWidgetValuePane.populate(e); formWidgetValuePane.populate(e);
populateStartEnd(e); startDv.populate(e.getStartDate());
endDv.populate(e.getEndDate());
} }
@Override @Override
@ -167,34 +188,14 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
DateEditor ob = new DateEditor(); DateEditor ob = new DateEditor();
ob.setFormatText(this.getSimpleDateFormat().toPattern()); ob.setFormatText(this.getSimpleDateFormat().toPattern());
ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 1); ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 0);
formWidgetValuePane.update(ob); formWidgetValuePane.update(ob);
updateStartEnd(ob); ob.setStartDate(startDv.update());
ob.setEndDate(endDv.update());
return ob; return ob;
} }
/**
* 初始起止日期
*
* @param dateWidgetEditor 日期控件
*/
public void populateStartEnd(DateEditor dateWidgetEditor) {
Formula startFM = dateWidgetEditor.getStartDateFM();
Formula endFM = dateWidgetEditor.getEndDateFM();
if (startFM != null) {
startDv.populate(startFM);
} else {
String startStr = dateWidgetEditor.getStartText();
startDv.populate(StringUtils.isEmpty(startStr) ? null : DateUtils.string2Date(startStr, true));
}
if (endFM != null) {
endDv.populate(endFM);
} else {
String endStr = dateWidgetEditor.getEndText();
endDv.populate(StringUtils.isEmpty(endStr) ? null : DateUtils.string2Date(endStr, true));
}
}
/** /**
* 更新日期控件的起止日期 * 更新日期控件的起止日期
@ -245,12 +246,12 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
} }
private SimpleDateFormat getSimpleDateFormat() { private SimpleDateFormat getSimpleDateFormat() {
String text = (String) dateFormatComboBox.getSelectedItem(); String text = (String) currentFormatComboBox.getSelectedItem();
SimpleDateFormat simpleDateFormat; SimpleDateFormat simpleDateFormat;
if (text != null && text.length() > 0) { if (text != null && text.length() > 0) {
try { try {
simpleDateFormat = new SimpleDateFormat(text); simpleDateFormat = new SimpleDateFormat(text);
this.sampleLabel.setText(simpleDateFormat.format(new Date())); this.currentSamplelabel.setText(simpleDateFormat.format(new Date()));
} catch (Exception exp) { } catch (Exception exp) {
simpleDateFormat = new SimpleDateFormat(""); simpleDateFormat = new SimpleDateFormat("");
} }
@ -262,4 +263,16 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
} }
private int getDateType(DateEditor e){
String[] timeArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.TIME);
if(e == null){
return 0;
}
String formatText = e.getFormatText();
if(ArrayUtils.contains(timeArray, formatText)){
return 1;
}
return 0;
}
} }

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

@ -44,7 +44,7 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
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}};
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(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH); advancePane.add(panel, BorderLayout.NORTH);
JPanel otherPane = createOtherPane(); JPanel otherPane = createOtherPane();
if(otherPane != null){ if(otherPane != null){
@ -72,9 +72,10 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
public JPanel setValidatePane(){ public JPanel setValidatePane(){
directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false); directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false);
directWriteCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel otherContentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); JPanel otherContentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
otherContentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); otherContentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
JPanel jPanel = GUICoreUtils.createFlowPane(new JComponent[]{directWriteCheckBox}, FlowLayout.LEFT, 5); JPanel jPanel = GUICoreUtils.createFlowPane(new JComponent[]{directWriteCheckBox}, FlowLayout.LEFT, 0);
jPanel.setPreferredSize(new Dimension(220, 30)); jPanel.setPreferredSize(new Dimension(220, 30));
otherContentPane.add(jPanel); otherContentPane.add(jPanel);
return otherContentPane; return otherContentPane;

12
designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java

@ -39,13 +39,13 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5)); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT)); // allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT));
fontSizePane = new UISpinner(0, 20, 1, 0); fontSizePane = new UISpinner(0, 20, 1, 0);
errorMsgTextField = new UITextField(); errorMsgTextField = new UITextField();
JPanel contentPane = this.setFirstContentPane(); JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) { if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane("高级", 280, 20, contentPane); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane);
this.add(uiExpandablePane, BorderLayout.NORTH); this.add(uiExpandablePane, BorderLayout.NORTH);
} }
this.addValidatePane(); this.addValidatePane();
@ -84,6 +84,8 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void addValidatePane() { protected void addValidatePane() {
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
validatePane.setLayout(new BorderLayout(0, 5));
final UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")); final UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip"));
allowBlankCheckBox.addItemListener(new ItemListener() { allowBlankCheckBox.addItemListener(new ItemListener() {
@ -112,8 +114,8 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
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, 7, 2); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 5, 5);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
validatePane.add(panel, BorderLayout.NORTH); validatePane.add(panel, BorderLayout.NORTH);
JPanel contentPane = this.setValidatePane(); JPanel contentPane = this.setValidatePane();
if (contentPane != null) { if (contentPane != null) {

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

@ -3,8 +3,7 @@ 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.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.style.FRFontPane; import com.fr.design.gui.style.FRFontPane;
import com.fr.design.widget.ui.designer.component.BackgroundCompPane; import com.fr.design.widget.component.ButtonBackgroundPane;
import com.fr.design.widget.ui.designer.component.MouseActionBackground;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -16,7 +15,7 @@ import java.awt.*;
* Created by ibm on 2017/8/6. * Created by ibm on 2017/8/6.
*/ */
public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> { public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
private BackgroundCompPane backgroundCompPane; private ButtonBackgroundPane backgroundCompPane;
private FRFontPane frFontPane; private FRFontPane frFontPane;
public FreeButtonDefinePane(XCreator xcreator) { public FreeButtonDefinePane(XCreator xcreator) {
@ -24,7 +23,7 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
} }
public Component[] createBackgroundComp() { public Component[] createBackgroundComp() {
backgroundCompPane = new BackgroundCompPane(); backgroundCompPane = new ButtonBackgroundPane();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background") + ":"), backgroundCompPane}; return new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background") + ":"), backgroundCompPane};
} }
@ -36,8 +35,7 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
} }
public void populateSubButtonPane(FreeButton e) { public void populateSubButtonPane(FreeButton e) {
MouseActionBackground mouseActionBackground = new MouseActionBackground(e.getInitialBackground(), e.getOverBackground(), e.getClickBackground()); backgroundCompPane.populate(e);
backgroundCompPane.populate(mouseActionBackground);
FRFont frFont = e.getFont(); FRFont frFont = e.getFont();
if (frFont != null) { if (frFont != null) {
frFontPane.populateBean(e.getFont()); frFontPane.populateBean(e.getFont());
@ -46,10 +44,7 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
public FreeButton updateSubButtonPane() { public FreeButton updateSubButtonPane() {
FreeButton freeButton = (FreeButton) creator.toData(); FreeButton freeButton = (FreeButton) creator.toData();
MouseActionBackground mouseActionBackground = backgroundCompPane.update(); backgroundCompPane.update(freeButton);
freeButton.setInitialBackground(mouseActionBackground.getInitialBackground());
freeButton.setOverBackground(mouseActionBackground.getOverBackground());
freeButton.setClickBackground(mouseActionBackground.getClickBackground());
frFontPane.update(freeButton.getFont()); frFontPane.update(freeButton.getFont());
return freeButton; return freeButton;
} }

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

@ -68,8 +68,10 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
new Component[]{fontLabel, frFontPane}, 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)); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
return panel; panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel);
return boundsPane;
} }
@Override @Override

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

@ -36,6 +36,7 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
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"));
singleFileCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
fileSizeField = new UINumberField(); fileSizeField = new UINumberField();
fontSizeField = new UISpinner(0, 20, 1, 0); fontSizeField = new UISpinner(0, 20, 1, 0);
@ -66,9 +67,11 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1},{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)); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel);
return panel; return boundsPane;
} }
@Override @Override

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

@ -4,11 +4,13 @@ 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.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.NumberEditor; import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.third.fr.pdf.layout.border.Border;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -165,28 +167,31 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1}}; int[][] rowCount = {{1, 3},{1, 1},{1, 1}};
JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
advancePane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
advancePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
return advancePane; boundsPane.add(advancePane);
return boundsPane;
} }
public JPanel setValidatePane() { public JPanel setValidatePane() {
// super.addValidatePane(); // super.addValidatePane();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals")); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
this.decimalLength = new com.fr.design.editor.editor.IntegerEditor(); this.decimalLength = new com.fr.design.editor.editor.IntegerEditor();
this.decimalLength.setColumns(4); this.decimalLength.setColumns(4);
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.allowDecimalsCheckBox.addActionListener(actionListener1); this.allowDecimalsCheckBox.addActionListener(actionListener1);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative")); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative"));
this.allowNegativeCheckBox.addActionListener(actionListener2); this.allowNegativeCheckBox.addActionListener(actionListener2);
allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false);
setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
maxValueSpinner.setPreferredSize(new Dimension(120, 20)); maxValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.maxValueSpinner); setNotAllowsInvalid(this.maxValueSpinner);
this.setMaxValueCheckBox.addActionListener(actionListener3); this.setMaxValueCheckBox.addActionListener(actionListener3);
@ -196,9 +201,9 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
minValueSpinner.setPreferredSize(new Dimension(120, 20)); minValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.minValueSpinner); setNotAllowsInvalid(this.minValueSpinner);
minValueSpinner.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMinValueCheckBox.addActionListener(actionListener4); this.setMinValueCheckBox.addActionListener(actionListener4);
this.minValueSpinner.addChangeListener(changeListener2); setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -214,6 +219,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 3); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 3);
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
return panel; return panel;
} }

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

@ -4,6 +4,7 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.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.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
@ -24,10 +25,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
super(xCreator); super(xCreator);
} }
public TextFieldEditorDefinePane() {
super();
}
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
@ -79,9 +76,11 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1}}; int[][] rowCount = {{1, 3},{1, 1},{1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
return panel; panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel);
return boundsPane;
} }
public JPanel setValidatePane(){ public JPanel setValidatePane(){

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

@ -49,7 +49,7 @@ public class TreeEditorDefinePane extends DictEditorDefinePane<TreeEditor> {
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(0, 0, 10, 0));
return panel; return panel;
} }

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

@ -1,64 +0,0 @@
package com.fr.design.widget.ui.designer.btn;
import com.fr.base.FRContext;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.widget.btn.ButtonDetailPane;
import com.fr.form.ui.Button;
import com.fr.form.ui.FreeButton;
import com.fr.form.ui.Widget;
import com.fr.stable.bridge.BridgeMark;
import com.fr.stable.bridge.StableFactory;
import java.util.HashMap;
import java.util.Map;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-15
* Time : 下午6:29
*/
public class ButtonDetailPaneFactory {
private static Map<String, Class> detailMap = new HashMap<String, Class>();
static {
detailMap.put(Button.class.getName(), DefaultButtonDetailPane.class);
detailMap.put(FreeButton.class.getName(), FreeButtonDetailPane.class);
if (StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class) != null) {
detailMap.put(StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class).getName(), DesignModuleFactory.getButtonDetailPaneClass());
}
}
public static ButtonDetailPane<Button> createButtonDetailPane(Button button) {
Class cls = detailMap.get(button.getClass().getName());
ButtonDetailPane<Button> detailPane = null;
if (cls != null) {
try {
detailPane = (ButtonDetailPane) cls.newInstance();
detailPane.populate(button);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
return detailPane;
}
public static ButtonDetailPane<Button> createButtonDetailPane(Class cls, Button button) {
if (cls == null) {
return createButtonDetailPane(button);
}
Class aa = detailMap.get(cls.getName());
ButtonDetailPane<Button> detailPane = null;
if (aa != null) {
try {
detailPane = (ButtonDetailPane) aa.newInstance();
detailPane.populate(button == null ? detailPane.createButton() : button);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
return detailPane;
}
}

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

@ -47,7 +47,7 @@ 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(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH); advancePane.add(panel, BorderLayout.NORTH);
JPanel otherPane = createOtherPane(); JPanel otherPane = createOtherPane();
if (otherPane != null) { if (otherPane != null) {

143
designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonSytleDefinedPane.java

@ -1,143 +0,0 @@
package com.fr.design.widget.ui.designer.btn;
import com.fr.base.background.ColorBackground;
import com.fr.base.background.ImageBackground;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundButtonPane;
import com.fr.form.ui.FreeButton;
import com.fr.general.Background;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class ButtonSytleDefinedPane extends BasicPane {
// private UIComboBox buttonStyleComboBox;
// private JPanel card;
// private CardLayout cardLayout;
private BackgroundPane initBackgroundPane;
private BackgroundPane overBackgroundPane;
private BackgroundPane clickBackgroundPane;
private Background initBackground;
private Background overBackground;
private Background clickBackground;
public ButtonSytleDefinedPane() {
this.initComponents();
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel buttonStylePane = new JPanel();
buttonStylePane.setLayout(new BorderLayout());
initBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Initial") + ":", Inter.getLocText("FR-Designer_Initial_Background_Tips"));
overBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Over") + ":", Inter.getLocText("FR-Designer_Mouse_Move_Tips"));
clickBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Click") + ":", Inter.getLocText("FR-Designer_Mouse_Click_Tips"));
JPanel table = FRGUIPaneFactory.createYBoxEmptyBorderPane();
table.setBorder(new TitledBorder(Inter.getLocText(new String[]{"Custom", "Form-Button", "Style"})));
table.add(initBackgroundPane);
table.add(overBackgroundPane);
table.add(clickBackgroundPane);
buttonStylePane.add(table, BorderLayout.WEST);
this.add(buttonStylePane, BorderLayout.CENTER);
}
public void populate(FreeButton button) {
if (button == null) {
return;
}
initBackgroundPane.populate(button.getInitialBackground());
overBackgroundPane.populate(button.getOverBackground());
clickBackgroundPane.populate(button.getClickBackground());
}
public FreeButton update(FreeButton button) {
button.setCustomStyle(true);
button.setInitialBackground(initBackgroundPane.update());
button.setOverBackground(overBackgroundPane.update());
button.setClickBackground(clickBackgroundPane.update());
return button;
}
@Override
protected String title4PopupWindow() {
return null;
}
class BackgroundPane extends JPanel {
private UIButton editButton;
private BackgroundButtonPane choosePane;
private Background background;
private UILabel ImagePreviewPane;
BackgroundPane(String text, String ToolTips) {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 150));
UILabel label = new UILabel(text);
label.setToolTipText(ToolTips);
label.setPreferredSize(new Dimension(100, 20));
this.add(label);
ImagePreviewPane = new UILabel();
ImagePreviewPane.setPreferredSize(new Dimension(100, 20));
this.add(ImagePreviewPane);
editButton = new UIButton(Inter.getLocText("FR-Designer_Edit"));
editButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
choosePane = new BackgroundButtonPane();
BasicDialog dlg = choosePane.showWindow(SwingUtilities
.getWindowAncestor(ButtonSytleDefinedPane.this));
dlg.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
populate(choosePane.update());
}
});
if(BackgroundPane.this.background == null){
BackgroundPane.this.background = new ColorBackground();
}
choosePane.populate((Background) BackgroundPane.this.background);
dlg.setVisible(true);
}
});
this.add(editButton);
}
public void populate(Background background) {
this.background = background;
if (background instanceof ImageBackground && ((ImageBackground) background).getImage() != null) {
ImagePreviewPane.setIcon(new ImageIcon(((ImageBackground) background).getImage()));
} else if(background instanceof ColorBackground && ((ColorBackground) background).getColor() != null){
ImagePreviewPane.setIcon(null);
ImagePreviewPane.setOpaque(true);
ImagePreviewPane.setBackground(((ColorBackground) background).getColor());
}else{
ImagePreviewPane.setIcon(null);
ImagePreviewPane.setOpaque(false);
ImagePreviewPane.setBackground(null);
}
}
public Background update() {
return background;
}
}
}

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

@ -1,30 +0,0 @@
package com.fr.design.widget.ui.designer.btn;
import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane;
import com.fr.form.ui.Button;
import com.fr.form.ui.FreeButton;
import java.awt.*;
/**
* Created by IntelliJ IDEA. Author : Richer Version: 6.5.6 Date : 11-11-15 Time
* : 下午6:24
*/
public class DefaultButtonDetailPane extends ButtonWithHotkeysDetailPane<Button> {
@Override
protected Component createCenterPane() {
return null;
}
@Override
public FreeButton createButton() {
return new FreeButton();
}
@Override
public Class classType() {
return Button.class;
}
}

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

@ -1,56 +0,0 @@
package com.fr.design.widget.ui.designer.btn;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icombobox.UIComboBox;
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.TableLayoutHelper;
import com.fr.design.widget.IconDefinePane;
import com.fr.form.ui.Button;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
public class DefaultButtonStylePane extends BasicPane {
private UITextField buttonNameTextField;
private IconDefinePane iconPane;
private UIComboBox buttonStyleComboBox;
public DefaultButtonStylePane() {
this.initComponents();
}
protected void initComponents() {
this.setLayout(new BorderLayout());
JPanel labelPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
iconPane = new IconDefinePane();
labelPane.add(iconPane);
Component[][] n_components = {
{ new UILabel(Inter.getLocText("Text") + ":"), buttonNameTextField = new UITextField(20) },
{ new UILabel(Inter.getLocText("Icon") + ":"), labelPane } };
JPanel panel = TableLayoutHelper.createTableLayoutPane(n_components, new double[]{-2, -2}, new double[]{-2, -2});
this.add(panel,BorderLayout.CENTER);
}
public void populate(Button button) {
buttonNameTextField.setText(button.getText());
iconPane.populate(button.getIconName());
}
public Button update(Button button) {
button.setText(buttonNameTextField.getText());
button.setIconName(iconPane.update());
return button;
}
@Override
protected String title4PopupWindow() {
return "default";
}
}

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

@ -1,40 +0,0 @@
package com.fr.design.widget.ui.designer.btn;
import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane;
import com.fr.form.ui.Button;
import com.fr.form.ui.FreeButton;
import java.awt.*;
public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton> {
private ButtonSytleDefinedPane stylePane;
@Override
protected Component createCenterPane() {
return stylePane = new ButtonSytleDefinedPane();
}
@Override
public FreeButton createButton() {
return new FreeButton();
}
@Override
public void populate(Button button) {
super.populate(button);
if(button instanceof FreeButton) {
stylePane.populate((FreeButton) button);
}
}
@Override
public FreeButton update() {
FreeButton button = super.update();
return stylePane.update(button);
}
@Override
public Class classType() {
return FreeButton.class;
}
}

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

@ -47,8 +47,8 @@ public class FormWidgetValuePane extends JPanel {
} }
public void attributeChange(int index, JPanel customPane, CardLayout cardLayout, String[] tabTitles){ public void attributeChange(int index, JPanel customPane, CardLayout cardLayout, String[] tabTitles){
if (ComparatorUtils.equals(tabTitles[index], Inter.getLocText("FieldBinding"))) { if (ComparatorUtils.equals(tabTitles[index], Inter.getLocText("FR-Designer_Widget_Field"))) {
customPane.setPreferredSize(new Dimension(100, 50)); customPane.setPreferredSize(new Dimension(100, 47));
} else { } else {
customPane.setPreferredSize(new Dimension(100, 20)); customPane.setPreferredSize(new Dimension(100, 20));
} }

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

@ -1,43 +0,0 @@
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;
}
}

2
designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java

@ -45,7 +45,7 @@ public class PaddingBoundPane extends BasicPane {
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer_Left"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Right"), SwingConstants.CENTER)}, new Component[]{null, new UILabel(Inter.getLocText("FR-Designer_Left"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Right"), SwingConstants.CENTER)},
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
this.add(panel); this.add(panel);
} }

50
designer_form/src/com/fr/design/widget/ui/designer/component/TabFitLayoutBackgroundPane.java

@ -0,0 +1,50 @@
package com.fr.design.widget.ui.designer.component;
import com.fr.design.widget.component.BackgroundCompPane;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.Background;
/**
* Created by ibm on 2017/8/8.
*/
public class TabFitLayoutBackgroundPane extends BackgroundCompPane<WTabFitLayout> {
public TabFitLayoutBackgroundPane(){
}
public void update(WTabFitLayout wTabFitLayout){
int selectIndex = backgroundHead.getSelectedIndex();
if(selectIndex == 0){
wTabFitLayout.setCustomStyle(false);
wTabFitLayout.setInitialBackground(null);
wTabFitLayout.setOverBackground(null);
wTabFitLayout.setClickBackground(null);
}else{
wTabFitLayout.setCustomStyle(true);
wTabFitLayout.setInitialBackground((Background) initalBackgroundEditor.getValue());
wTabFitLayout.setOverBackground((Background) overBackgroundEditor.getValue());
wTabFitLayout.setClickBackground((Background)clickBackgroundEditor.getValue());
}
}
public void populate(WTabFitLayout wTabFitLayout){
if(!wTabFitLayout.isCustomStyle()){
backgroundHead.setSelectedIndex(0);
initalBackgroundEditor.setValue(null);
overBackgroundEditor.setValue(null);
clickBackgroundEditor.setValue(null);
}else{
backgroundHead.setSelectedIndex(1);
initalBackgroundEditor.setValue(wTabFitLayout.getInitialBackground());
overBackgroundEditor.setValue(wTabFitLayout.getOverBackground());
clickBackgroundEditor.setValue(wTabFitLayout.getClickBackground());
}
}
protected String title4PopupWindow() {
return "tabFitBackground";
}
}

40
designer_form/src/com/fr/design/widget/ui/designer/custom/WidgetValueField.java

@ -1,40 +0,0 @@
package com.fr.design.widget.ui.designer.custom;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by ibm on 2017/8/1.
*/
public class WidgetValueField implements WidgetValuePane{
private UITextField dataSource;
private UITextField field;
public WidgetValueField(){
dataSource = new UITextField();
field = new UITextField();
}
public JComponent createWidgetValuePane(){
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout(1,7));
jPanel.add(dataSource, BorderLayout.NORTH);
jPanel.add(field, BorderLayout.CENTER);
return jPanel;
}
public String markTitle(){
return Inter.getLocText("FR-Designer_Widget_Field");
}
public void update(){
//todo
}
public void populate(){
//todo
}
}

33
designer_form/src/com/fr/design/widget/ui/designer/custom/WidgetValueFormula.java

@ -1,33 +0,0 @@
package com.fr.design.widget.ui.designer.custom;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.general.Inter;
import javax.swing.*;
/**
* Created by ibm on 2017/8/1.
*/
public class WidgetValueFormula implements WidgetValuePane{
private UITextField uiTextField;
public WidgetValueFormula(){
uiTextField = new UITextField();
}
public JComponent createWidgetValuePane(){
return uiTextField;
}
public String markTitle(){
return Inter.getLocText("FR-Designer_Widget_Formula");
}
public void update(){
}
public void populate(){
}
}

17
designer_form/src/com/fr/design/widget/ui/designer/custom/WidgetValuePane.java

@ -1,17 +0,0 @@
package com.fr.design.widget.ui.designer.custom;
import javax.swing.*;
/**
* Created by ibm on 2017/8/1.
*/
public interface WidgetValuePane{
JComponent createWidgetValuePane();
String markTitle();
void update();
void populate();
}

33
designer_form/src/com/fr/design/widget/ui/designer/custom/WidgetValueString.java

@ -1,33 +0,0 @@
package com.fr.design.widget.ui.designer.custom;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.general.Inter;
import javax.swing.*;
/**
* Created by ibm on 2017/8/1.
*/
public class WidgetValueString implements WidgetValuePane{
private UITextField uiTextField;
public WidgetValueString(){
uiTextField = new UITextField();
}
public JComponent createWidgetValuePane(){
return uiTextField;
}
public String markTitle(){
return Inter.getLocText("FR-Designer_Widget_String");
}
public void update(){
}
public void populate(){
}
}

7
designer_form/src/com/fr/design/widget/ui/designer/layout/ChartEditorDefinePane.java

@ -0,0 +1,7 @@
//package com.fr.design.widget.ui.designer.layout;
//
///**
// * Created by ibm on 2017/8/7.
// */
//public class ChartEditorDefinePane extends {
//}

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

@ -38,8 +38,8 @@ public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseE
new Component[]{paddingBoundPane, null}, new Component[]{paddingBoundPane, null},
new Component[]{new UILabel("报表块工具栏"), elementCaseToolBarEditor} new Component[]{new UILabel("报表块工具栏"), elementCaseToolBarEditor}
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
return panel; return panel;
} }

4
designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java

@ -50,8 +50,8 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Attr_Layout_Type")), layoutCombox}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Attr_Layout_Type")), layoutCombox},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Scaling_Mode")), comboBox}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Scaling_Mode")), comboBox},
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return panel; return panel;
} }

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

@ -32,7 +32,6 @@ public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayo
public FRAbsoluteLayoutDefinePane(XCreator xCreator) { public FRAbsoluteLayoutDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
this.xwAbsoluteLayout = (XWAbsoluteLayout) xCreator; this.xwAbsoluteLayout = (XWAbsoluteLayout) xCreator;
wAbsoluteLayout = xwAbsoluteLayout.toData(); wAbsoluteLayout = xwAbsoluteLayout.toData();
initComponent(); initComponent();
@ -45,7 +44,10 @@ public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayo
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(boundPane, BorderLayout.NORTH); this.add(boundPane, BorderLayout.NORTH);
initUIComboBox(); initUIComboBox();
UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer-Widget_Area_Scaling"), 280, 20, createThirdPane()); JPanel thirdPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
thirdPane.add(createThirdPane(), BorderLayout.CENTER);
thirdPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer-Widget_Area_Scaling"), 280, 20,thirdPane );
this.add(layoutExpandablePane, BorderLayout.CENTER); this.add(layoutExpandablePane, BorderLayout.CENTER);
} }
@ -60,7 +62,7 @@ public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayo
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Scaling_Mode")), comboBox}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Scaling_Mode")), comboBox},
}; };
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(10, 0, 0, 0));
return panel; return panel;
} }

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

@ -67,7 +67,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
background = new AccessibleWLayoutBorderStyleEditor(); 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(10, 0, 5, 0));
jPanel.add(paddingBound, BorderLayout.CENTER); jPanel.add(paddingBound, BorderLayout.CENTER);
jPanel.add(jp2, BorderLayout.NORTH); jPanel.add(jp2, BorderLayout.NORTH);
return jPanel; return jPanel;
@ -88,8 +88,8 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Scale")), adaptComboBox}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Scale")), adaptComboBox},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Interval")), componentIntervel} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Interval")), componentIntervel}
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
jPanel.add(panel, BorderLayout.CENTER); jPanel.add(panel, BorderLayout.CENTER);
return jPanel; return jPanel;
@ -124,7 +124,10 @@ 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()); LayoutBorderStyle borderStyle = (LayoutBorderStyle) background.getValue();
if(borderStyle != null){
layout.setBorderStyle(borderStyle);
}
Item item = (Item) layoutComboBox.getSelectedItem(); Item item = (Item) layoutComboBox.getSelectedItem();
Object value = item.getValue(); Object value = item.getValue();
int state = 0; int state = 0;

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

@ -7,9 +7,8 @@ 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.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.design.widget.ui.designer.component.TabFitLayoutBackgroundPane;
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;
@ -21,7 +20,7 @@ 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 TabFitLayoutBackgroundPane borderStyle;
private UISpinner componentInterval; private UISpinner componentInterval;
public WTabFitLayoutDefinePane(XCreator xCreator) { public WTabFitLayoutDefinePane(XCreator xCreator) {
@ -32,7 +31,7 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
public void initComponent() { public void initComponent() {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
paddingBoundPane = new PaddingBoundPane(); paddingBoundPane = new PaddingBoundPane();
borderStyle = new BackgroundCompPane(); borderStyle = new TabFitLayoutBackgroundPane();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Style")), borderStyle}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); 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(jPanel, BorderLayout.NORTH);
advancePane.add(paddingBoundPane, BorderLayout.CENTER); advancePane.add(paddingBoundPane, BorderLayout.CENTER);
@ -55,8 +54,7 @@ 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(ob);
borderStyle.populate(mouseActionBackground);
paddingBoundPane.populate(ob); paddingBoundPane.populate(ob);
componentInterval.setValue(ob.getCompInterval()); componentInterval.setValue(ob.getCompInterval());
} }
@ -65,10 +63,7 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
@Override @Override
public WTabFitLayout updateBean() { public WTabFitLayout updateBean() {
WTabFitLayout layout = (WTabFitLayout) creator.toData(); WTabFitLayout layout = (WTabFitLayout) creator.toData();
MouseActionBackground mouseActionBackground = borderStyle.update(); borderStyle.update(layout);
layout.setInitialBackground(mouseActionBackground.getInitialBackground());
layout.setOverBackground(mouseActionBackground.getOverBackground());
layout.setClickBackground(mouseActionBackground.getClickBackground());
paddingBoundPane.update(layout); paddingBoundPane.update(layout);
layout.setCompInterval((int)componentInterval.getValue()); layout.setCompInterval((int)componentInterval.getValue());
return layout; return layout;

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

@ -42,7 +42,7 @@ public abstract class WTitleLayoutDefinePane<T extends AbstractBorderStyleWidget
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Style")), borderStyleEditor} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Style")), borderStyleEditor}
}; };
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(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH); advancePane.add(panel, BorderLayout.NORTH);
JPanel centerPane = createCenterPane(); JPanel centerPane = createCenterPane();
if(centerPane!=null){ if(centerPane!=null){

Loading…
Cancel
Save