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. 209
      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. 0
      designer_base/src/com/fr/design/designer/properties/Encoder.java
  14. 14
      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. 8
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java
  20. 0
      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. 4
      designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java
  23. 4
      designer_base/src/com/fr/design/mainframe/widget/accessibles/RendererField.java
  24. 0
      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. 0
      designer_base/src/com/fr/design/mainframe/widget/renderer/GenericCellRenderer.java
  29. 11
      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. 10
      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();
if(cellWidget == null){
return;
}
// 这里进行克隆的原因是为了保留原始的Widget以便和新的Widget做比较来判断是否发生了改变
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) {
if (widget == null) {
editorTypeComboBox.setSelectedIndex(-1);
return;
}

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

@ -20,7 +20,6 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
private void initComponent() {
setLayout(FRGUIPaneFactory.createBorderLayout());
setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
}
@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.JPanel;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.CheckBoxGroup;
import com.fr.general.Inter;
public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup> {
private DictionaryPane dictPane;
private AccessibleDictionaryEditor dictPane;
CheckBoxDictPane checkBoxDictPane;
@ -29,7 +31,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
protected void initComponents() {
super.initComponents();
dictPane = new DictionaryPane();
dictPane = new AccessibleDictionaryEditor();
}
@Override
@ -64,7 +66,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override
protected void populateSubFieldEditorBean(CheckBoxGroup ob) {
this.dictPane.populateBean(ob.getDictionary());
this.dictPane.setValue(ob.getDictionary());
checkBoxDictPane.populate(ob);
checkbox.setSelected(ob.isChooseAll());
this.buttonGroupDictPane.populate(ob);
@ -74,7 +76,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
protected CheckBoxGroup updateSubFieldEditorBean() {
CheckBoxGroup ob = new CheckBoxGroup();
ob.setDictionary(this.dictPane.updateBean());
ob.setDictionary((Dictionary) this.dictPane.getValue());
checkBoxDictPane.update(ob);
ob.setChooseAll(checkbox.isSelected());
this.buttonGroupDictPane.update(ob);
@ -83,6 +85,6 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override
public DataCreatorUI dataUI() {
return dictPane;
return null;
}
}

209
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.Formula;
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.ilable.UILabel;
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.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.general.DateUtils;
import com.fr.general.Inter;
import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.UtilEvalError;
import javax.swing.*;
@ -28,19 +26,18 @@ import java.text.SimpleDateFormat;
import java.util.Date;
public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> {
private UIComboBox returnTypeComboBox;
private UILabel sampleLabel;// preview
// content
private UIComboBox dateFormatComboBox;
private ValueEditorPane startDv;
private ValueEditorPane endDv;
private UIHeadGroup returnTypeComboBox;
private DateValuePane startDv;
private DateValuePane endDv;
private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel;
private UIHeadGroup fomatHeadGroup;
public DateEditorDefinePane() {
this.initComponets();
}
private void initComponets() {
super.initComponents();
public DateEditorDefinePane() {
}
@Override
@ -50,71 +47,98 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override
protected JPanel setSecondContentPane() {
JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
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.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();
returnTypeComboBox = new UIHeadGroup(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}){
protected void tabChanged(int newSelectedIndex) {
//todo
}
};
});
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);
endDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
JPanel formatHead = createFormatHead();
startDv = new DateValuePane();
endDv = new DateValuePane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox },
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), dateFormatComboBox},
new Component[]{null, sampleLabel},
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), formatHead},
new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv},
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};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1);
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel;
}
private String[] getDateFormateArray() {
return FormatField.getInstance().getDateFormatArray();
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;
}
protected JPanel initStartEndDatePane() {
JPanel rangePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
rangePane.add(new UILabel(Inter.getLocText("FS_Start_Date") + ":"));
startDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
rangePane.add(startDv);
rangePane.add(new UILabel(Inter.getLocText("FS_End_Date") + ":"));
endDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
rangePane.add(endDv);
return rangePane;
private UILabel createSamplePane(){
UILabel sampleLabel = new UILabel("");
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
return sampleLabel;
}
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() {
String text = (String) dateFormatComboBox.getSelectedItem();
String text = (String) currentFormatComboBox.getSelectedItem();
if (text != null && text.length() > 0) {
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(text);
@ -124,66 +148,57 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
sample += " " + Inter.getLocText("DateFormat-Custom_Warning");
c = Color.red;
}
this.sampleLabel.setText(sample);
this.sampleLabel.setForeground(c);
currentSamplelabel.setText(sample);
currentSamplelabel.setForeground(c);
} catch (Exception exp) {
this.sampleLabel.setForeground(Color.red);
this.sampleLabel.setText(exp.getMessage());
currentSamplelabel.setForeground(Color.red);
currentSamplelabel.setText(exp.getMessage());
}
} 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
protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText();
dateFormatComboBox.setSelectedItem(formatText);
fomatHeadGroup.setSelectedIndex(getDateType(e));
currentFormatComboBox.setSelectedItem(formatText);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 1 : 0);
populateStartEnd(e);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 0 : 1);
startDv.populate(e.getStartDate());
endDv.populate(e.getEndDate());
}
@Override
protected DateEditor updateSubDirectWriteEditorBean() {
DateEditor ob = new DateEditor();
ob.setFormatText(this.getSimpleDateFormat().toPattern());
ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 1);
updateStartEnd(ob);
ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 0);
ob.setStartDate(startDv.update());
ob.setEndDate(endDv.update());
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 日期控件
*/
public void updateStartEnd(DateEditor dateWidgetEditor) {
Object startObject = startDv.update();
Object startObject = "";
Object endObject = endDv.update();
// wei : 对公式的处理
Calculator cal = null;
@ -226,12 +241,12 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
}
private SimpleDateFormat getSimpleDateFormat() {
String text = (String) dateFormatComboBox.getSelectedItem();
String text = (String) currentFormatComboBox.getSelectedItem();
SimpleDateFormat simpleDateFormat;
if (text != null && text.length() > 0) {
try {
simpleDateFormat = new SimpleDateFormat(text);
this.sampleLabel.setText(simpleDateFormat.format(new Date()));
this.currentSamplelabel.setText(simpleDateFormat.format(new Date()));
} catch (Exception exp) {
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
public void populate(com.fr.form.ui.Button btn) {
public void populate(AppendRowButton btn) {
super.populate(btn);
if (btn instanceof AppendRowButton) {
defineColumnRowPane.populate((AppendRowButton) btn);
}
defineColumnRowPane.populate(btn);
}
@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 javax.swing.JPanel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -20,7 +21,7 @@ import com.fr.report.web.button.write.AppendRowButton;
*/
public class DefineAppendColumnRowPane extends BasicPane {
private ColumnRowEditor crEditor;
private com.fr.design.editor.editor.IntegerEditor jNumberEditor;
private UISpinner jNumberEditor;
private UILabel rowCountLable;
public DefineAppendColumnRowPane() {
@ -35,7 +36,7 @@ public class DefineAppendColumnRowPane extends BasicPane {
double columnSize[] = { p, f};
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") + ":");
JPanel lpane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -56,11 +57,11 @@ public class DefineAppendColumnRowPane extends BasicPane {
public void populate(AppendRowButton btn) {
crEditor.setValue(btn.getFixCell());
jNumberEditor.setValue(new Integer(btn.getCount()));
jNumberEditor.setValue(btn.getCount());
}
public void update(AppendRowButton btn) {
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;
import javax.swing.BorderFactory;
import javax.swing.*;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
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.report.web.button.write.DeleteRowButton;
import java.awt.*;
/**
* Created by IntelliJ IDEA. Author : Richer Version: 6.5.6 Date : 11-11-16 Time
* : 上午10:56
@ -23,12 +28,20 @@ public class DefineDeleteColumnRowPane extends BasicPane {
}
private void initComponents() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double rowSize[] = { p, p};
double columnSize[] = { p, f};
crEditor = new ColumnRowEditor();
setLayout(FRGUIPaneFactory.createL_FlowLayout());
setBorder(BorderFactory.createEmptyBorder(0, BORDER_LEFT, 0, 0));
add(new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"}) + ":"));
add(crEditor);
add(new UILabel(Inter.getLocText("Append_Delete_Row_Message")));
Component[][] components = {
{ new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"}) + ":"), crEditor },
{new UILabel(Inter.getLocText("Append_Delete_Row_Message")),null}};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
setLayout(FRGUIPaneFactory.createBorderLayout());
add(contentPane);
}
@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
public void populate(com.fr.form.ui.Button btn) {
public void populate(DeleteRowButton btn) {
super.populate(btn);
if (btn instanceof DeleteRowButton) {
ddcp.populate((DeleteRowButton) btn);
}
ddcp.populate(btn);
}
@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 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.design.widget.btn.ButtonWithHotkeysDetailPane;
import com.fr.general.Inter;
public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton> {
private ButtonSytleDefinedPane stylePane;
private ButtonBackgroundPane backgroundCompPane;
@Override
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
@ -19,18 +23,16 @@ public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton
return new FreeButton();
}
@Override
public void populate(Button button) {
public void populate(FreeButton button) {
super.populate(button);
if(button instanceof FreeButton) {
stylePane.populate((FreeButton) button);
}
backgroundCompPane.populate(button);
}
@Override
public FreeButton update() {
FreeButton button = super.update();
return stylePane.update(button);
backgroundCompPane.update(button);
return button;
}
@Override

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

@ -1,7 +1,7 @@
package com.fr.quickeditor;
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.gui.chart.BaseChartPropertyPane;
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

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

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

@ -73,17 +73,13 @@ public class RegPane extends BasicPane {
private void initComponents(){
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel contentPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
this.add(contentPane, BorderLayout.NORTH);
contentPane.add(new UILabel(Inter.getLocText("FR-Designer_Input_Rule")));
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
regComboBox = new UIComboBox(regType);
regComboBox.setPreferredSize(new Dimension(140, 20));
regComboBox.setRenderer(listCellRender);
UILabel uiLabel = new UILabel();
uiLabel.setPreferredSize(new Dimension(20, 20));
contentPane.add(uiLabel);
contentPane.add(regComboBox);
JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Input_Rule")), regComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(contentPane, BorderLayout.NORTH);
regErrorMsgPane = new RegErrorMsgPane();
final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
detailedCardLayout = new CardLayout();

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.text.Document;
import java.awt.*;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
/**
* @author Jerry
@ -59,19 +61,14 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
protected void initListener() {
if (shouldResponseChangeListener()) {
getDocument().addDocumentListener(new DocumentListener() {
addFocusListener(new FocusListener() {
@Override
public void insertUpdate(DocumentEvent e) {
public void focusGained(FocusEvent e) {
attributeChange();
}
@Override
public void removeUpdate(DocumentEvent e) {
attributeChange();
}
@Override
public void changedUpdate(DocumentEvent e) {
public void focusLost(FocusEvent e) {
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() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] columnSize = {p};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{fontSizeStyleComboBox},
@ -325,8 +325,8 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
private JPanel createPane() {
JPanel createPane = new JPanel(new BorderLayout(3, 5));
createPane.add(fontNameComboBox, BorderLayout.NORTH);
createPane.add(createLeftPane(), BorderLayout.CENTER);
createPane.add(createRightPane(), BorderLayout.EAST);
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{createLeftPane(), createRightPane()}}, TableLayoutHelper.FILL_LASTCOLUMN, 5, 7);
createPane.add(jPanel, BorderLayout.CENTER);
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() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
widgetName = new UITextField();
double f = TableLayout.FILL;
@ -34,7 +35,7 @@ public class BasicPropertyPane extends BasicPane {
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Name")), widgetName},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15));
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
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;
import java.awt.Dimension;
import java.awt.*;
import javax.swing.SwingUtilities;
import javax.swing.*;
import com.fr.general.Background;
import com.fr.design.mainframe.widget.wrappers.BackgroundWrapper;
@ -25,6 +25,10 @@ public class AccessibleBackgroundEditor extends UneditableAccessibleEditor {
super(new BackgroundWrapper());
}
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override
protected void showEditorPane() {
if (backgroundPane == null) {

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

@ -1,6 +1,6 @@
package com.fr.design.mainframe.widget.accessibles;
import javax.swing.SwingUtilities;
import javax.swing.*;
import com.fr.data.Dictionary;
import com.fr.design.mainframe.widget.wrappers.DictionaryWrapper;
@ -8,6 +8,8 @@ import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import java.awt.*;
public class AccessibleDictionaryEditor extends UneditableAccessibleEditor {
private DictionaryPane dictPane;
@ -16,6 +18,10 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor {
super(new DictionaryWrapper());
}
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override
protected void showEditorPane() {
if (dictPane == null) {

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

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.form.ui.WidgetManager;
import javax.swing.*;
import java.awt.*;
public class AccessibleIconEditor extends UneditableAccessibleEditor {
private CustomIconPane customIconPane;
@ -24,6 +27,11 @@ public class AccessibleIconEditor extends UneditableAccessibleEditor {
return new RendererField(new IconCellRenderer());
}
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override
protected void showEditorPane() {
if (customIconPane == null) {

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

@ -45,6 +45,10 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor
this.decoder = dec;
initComponents();
txtValue.setEditable(dec != null);
setBorderVisible();
}
protected void setBorderVisible(){
((JComponent) txtValue).setBorder(null);
}

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

@ -1,9 +1,9 @@
package com.fr.design.mainframe.widget.accessibles;
import java.awt.BorderLayout;
import java.awt.*;
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.renderer.GenericCellRenderer;

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

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

@ -58,7 +58,7 @@ public class DataBindingEditor extends Editor<DataBinding> {
public DataBindingEditor() {
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

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

11
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;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.*;
import com.fr.base.FRContext;
import com.fr.base.Icon;
import com.fr.base.IconManager;
import com.fr.form.ui.WidgetManager;
import javax.swing.*;
public class IconCellRenderer extends GenericCellRenderer {
private Image img;
public IconCellRenderer(){
// this.setBorder(BorderFactory.createLineBorder());
}
@Override
public void setValue(Object v) {
try {

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;
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.*;

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.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
@ -16,6 +17,7 @@ import java.awt.*;
public class WidgetBoundsPaneFactory {
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) {
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
@ -25,10 +27,10 @@ public class WidgetBoundsPaneFactory {
double[] rowSize = {p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15));
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 280, 24, panel);
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 10);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(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) {
@ -44,9 +46,10 @@ public class WidgetBoundsPaneFactory {
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15));
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 230, 24, panel);
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 10);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
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");
}
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 com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
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.general.Inter;
import com.fr.stable.StableUtils;
@ -24,48 +25,49 @@ import com.fr.stable.StableUtils;
public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends ButtonDetailPane<T> {
private UITextField hotkeysTextField;
private UITextField buttonNameTextField;
private IconDefinePane iconPane;
private AccessibleIconEditor iconPane;
public ButtonWithHotkeysDetailPane() {
initComponents();
}
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
advancedPane.setPreferredSize(new Dimension(600, 341));
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
this.add(advancedPane);
this.setLayout(new BorderLayout(7, 7));
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double rowSize[] = {p, p, p, p};
double columnSize[] = {p, p};
double columnSize[] = {p, f};
JPanel labelPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
iconPane = new IconDefinePane();
iconPane = new AccessibleIconEditor();
labelPane.add(iconPane);
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-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, ","));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 0, 8);
advancedPane.add(panel,BorderLayout.NORTH);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 16, 8);
advancePane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
advancePane.add(panel, BorderLayout.NORTH);
Component comp = createCenterPane();
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();
@Override
public void populate(Button button) {
public void populate(T button) {
if (button == null) {
return;
}
iconPane.populate(button.getIconName());
iconPane.setValue(button.getIconName());
buttonNameTextField.setText(button.getText());
hotkeysTextField.setText(button.getHotkeys());
}
@ -73,7 +75,7 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
@Override
public T update() {
T button = createButton();
button.setIconName(iconPane.update());
button.setIconName((String)iconPane.getValue());
button.setText(buttonNameTextField.getText());
button.setHotkeys(hotkeysTextField.getText());
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.gui.ibutton.UIHeadGroup;
@ -7,6 +7,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor;
import com.fr.form.ui.Widget;
import com.fr.general.Background;
import com.fr.general.Inter;
@ -16,11 +17,11 @@ import java.awt.*;
/**
* Created by ibm on 2017/8/6.
*/
public class BackgroundCompPane extends BasicPane {
private UIHeadGroup backgroundHead;
private AccessibleBackgroundEditor initalBackgroundEditor;
private AccessibleBackgroundEditor overBackgroundEditor;
private AccessibleBackgroundEditor clickBackgroundEditor;
public abstract class BackgroundCompPane<T extends Widget> extends BasicPane {
protected UIHeadGroup backgroundHead;
protected AccessibleBackgroundEditor initalBackgroundEditor;
protected AccessibleBackgroundEditor overBackgroundEditor;
protected AccessibleBackgroundEditor clickBackgroundEditor;
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() {
return "";
}
public abstract void update(T e);
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);
}
}
}

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

@ -3,9 +3,6 @@
*/
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.renderer.LayoutBorderStyleRenderer;
@ -15,6 +12,9 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.xpane.LayoutBorderPane;
import com.fr.form.ui.LayoutBorderStyle;
import javax.swing.*;
import java.awt.*;
public class AccessibleWLayoutBorderStyleEditor extends UneditableAccessibleEditor {
private LayoutBorderPane borderPane;
@ -27,6 +27,10 @@ public class AccessibleWLayoutBorderStyleEditor extends UneditableAccessibleEdit
return new RendererField(new LayoutBorderStyleRenderer());
}
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override
protected void showEditorPane() {
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() {
JPanel pane2 = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
pane2.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true);
pane2.add(enableCheckBox);
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[][]{
new Component[]{new UILabel(Inter.getLocText("Form-Desin_Width")), designerWidth},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel;
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
jPanel.add(panel);
return jPanel;
}
public JPanel createAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery"));
background = new AccessibleBackgroundEditor();
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[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel;
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
jPanel.add(panel);
return jPanel;
}
@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.widget.ui.designer.*;
import com.fr.design.widget.ui.designer.layout.*;
import com.fr.form.parameter.FormSubmitButton;
import com.fr.form.ui.*;
import com.fr.form.ui.container.*;
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(Button.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(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, Inter.getLocText("WLayout-Card-ToolTips")));
// 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},
backgroundCompPane,
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}
};
hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, rowCount, 10, 8);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
UIExpandablePane advancedPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, panel);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, rowCount, 10, 10);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
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);
}

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.ispinner.UIBasicSpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.ButtonGroup;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
public class ButtonGroupDictPane extends JPanel {
@ -24,14 +26,18 @@ public class ButtonGroupDictPane extends JPanel {
*
*/
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.add(columnLabel);
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) {

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};
int[][] rowCount = {{1, 1},{1, 3},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, panel);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
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);
}

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(){
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")};
returnType = new UIHeadGroup(tabTitles) {
@Override
@ -65,7 +66,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1}};
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;
}

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.general.Inter;
import javax.swing.*;
import java.awt.*;
public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
@ -20,6 +21,7 @@ public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
public UICheckBox createRepeatCheckBox(){
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget_No_Repeat"));
removeRepeatCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
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(){
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget_No_Repeat"));
removeRepeatCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
return removeRepeatCheckBox;
}
@ -62,7 +63,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1}};
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;
}

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(){
this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false);
this.customDataCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.customDataCheckBox.setPreferredSize(
new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT));
JPanel otherContentPane = super.setValidatePane();
otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 5));
otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 0));
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.Formula;
import com.fr.data.core.FormatField;
import com.fr.design.constants.LayoutConstants;
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.icombobox.UIComboBox;
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.TableLayout;
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.form.ui.DateEditor;
import com.fr.general.DateUtils;
import com.fr.general.Inter;
import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.UtilEvalError;
import javax.swing.*;
@ -32,15 +28,15 @@ import java.text.SimpleDateFormat;
import java.util.Date;
public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> {
private UIComboBox returnTypeComboBox;
private UILabel sampleLabel;// preview
private UIComboBox dateFormatComboBox;
private ValueEditorPane startDv;
private ValueEditorPane endDv;
private UIHeadGroup returnTypeComboBox;
private DateValuePane startDv;
private DateValuePane endDv;
private WaterMarkDictPane waterMarkDictPane;
private FormWidgetValuePane formWidgetValuePane;
private UISpinner fontSizePane;
private UIHeadGroup formatHeader;
private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel;
private UIHeadGroup fomatHeadGroup;
public DateEditorDefinePane(XCreator xCreator) {
super(xCreator);
@ -59,35 +55,20 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
fontSizePane = new UISpinner(0, 20, 1, 0);
JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
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.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());
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();
returnTypeComboBox = new UIHeadGroup(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}){
protected void tabChanged(int newSelectedIndex) {
//todo
}
};
JPanel formatHead = createFormatHead();
});
startDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
endDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
initFormatHeader();
startDv = new DateValuePane();
endDv = new DateValuePane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), dateFormatComboBox},
new Component[]{null, previewPane},
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), formatHead},
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("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}
};
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};
int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel;
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, 10);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
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() {
return FormatField.getInstance().getDateFormatArray();
private UILabel createSamplePane(){
UILabel sampleLabel = new UILabel("");
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
return sampleLabel;
}
protected JPanel initStartEndDatePane() {
JPanel rangePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
rangePane.add(new UILabel(Inter.getLocText("FS_Start_Date") + ":"));
startDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
rangePane.add(startDv);
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();
}
};
fomatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH);
fomatHeadPane.add(customPane, BorderLayout.CENTER);
return fomatHeadPane;
}
private void refreshPreviewLabel() {
String text = (String) dateFormatComboBox.getSelectedItem();
String text = (String) currentFormatComboBox.getSelectedItem();
if (text != null && text.length() > 0) {
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(text);
@ -141,25 +159,28 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
sample += " " + Inter.getLocText("DateFormat-Custom_Warning");
c = Color.red;
}
this.sampleLabel.setText(sample);
this.sampleLabel.setForeground(c);
currentSamplelabel.setText(sample);
currentSamplelabel.setForeground(c);
} catch (Exception exp) {
this.sampleLabel.setForeground(Color.red);
this.sampleLabel.setText(exp.getMessage());
currentSamplelabel.setForeground(Color.red);
currentSamplelabel.setText(exp.getMessage());
}
} else {
this.sampleLabel.setText(new Date().toString());
currentSamplelabel.setText(new Date().toString());
}
}
@Override
protected void populateSubDirectWriteEditorBean(DateEditor e) {
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);
populateStartEnd(e);
startDv.populate(e.getStartDate());
endDv.populate(e.getEndDate());
}
@Override
@ -167,34 +188,14 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
DateEditor ob = new DateEditor();
ob.setFormatText(this.getSimpleDateFormat().toPattern());
ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 1);
ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 0);
formWidgetValuePane.update(ob);
updateStartEnd(ob);
ob.setStartDate(startDv.update());
ob.setEndDate(endDv.update());
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() {
String text = (String) dateFormatComboBox.getSelectedItem();
String text = (String) currentFormatComboBox.getSelectedItem();
SimpleDateFormat simpleDateFormat;
if (text != null && text.length() > 0) {
try {
simpleDateFormat = new SimpleDateFormat(text);
this.sampleLabel.setText(simpleDateFormat.format(new Date()));
this.currentSamplelabel.setText(simpleDateFormat.format(new Date()));
} catch (Exception exp) {
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};
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1,1},{1,1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH);
JPanel otherPane = createOtherPane();
if(otherPane != null){
@ -72,9 +72,10 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
public JPanel setValidatePane(){
directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false);
directWriteCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel otherContentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
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));
otherContentPane.add(jPanel);
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() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
// allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT));
fontSizePane = new UISpinner(0, 20, 1, 0);
errorMsgTextField = new UITextField();
JPanel contentPane = this.setFirstContentPane();
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.addValidatePane();
@ -84,6 +84,8 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void addValidatePane() {
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
validatePane.setLayout(new BorderLayout(0, 5));
final UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip"));
allowBlankCheckBox.addItemListener(new ItemListener() {
@ -112,8 +114,8 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
double[] rowSize = {p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 2);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 5, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
validatePane.add(panel, BorderLayout.NORTH);
JPanel contentPane = this.setValidatePane();
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.gui.ilable.UILabel;
import com.fr.design.gui.style.FRFontPane;
import com.fr.design.widget.ui.designer.component.BackgroundCompPane;
import com.fr.design.widget.ui.designer.component.MouseActionBackground;
import com.fr.design.widget.component.ButtonBackgroundPane;
import com.fr.form.ui.FreeButton;
import com.fr.general.FRFont;
import com.fr.general.Inter;
@ -16,7 +15,7 @@ import java.awt.*;
* Created by ibm on 2017/8/6.
*/
public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
private BackgroundCompPane backgroundCompPane;
private ButtonBackgroundPane backgroundCompPane;
private FRFontPane frFontPane;
public FreeButtonDefinePane(XCreator xcreator) {
@ -24,7 +23,7 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
}
public Component[] createBackgroundComp() {
backgroundCompPane = new BackgroundCompPane();
backgroundCompPane = new ButtonBackgroundPane();
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) {
MouseActionBackground mouseActionBackground = new MouseActionBackground(e.getInitialBackground(), e.getOverBackground(), e.getClickBackground());
backgroundCompPane.populate(mouseActionBackground);
backgroundCompPane.populate(e);
FRFont frFont = e.getFont();
if (frFont != null) {
frFontPane.populateBean(e.getFont());
@ -46,10 +44,7 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
public FreeButton updateSubButtonPane() {
FreeButton freeButton = (FreeButton) creator.toData();
MouseActionBackground mouseActionBackground = backgroundCompPane.update();
freeButton.setInitialBackground(mouseActionBackground.getInitialBackground());
freeButton.setOverBackground(mouseActionBackground.getOverBackground());
freeButton.setClickBackground(mouseActionBackground.getClickBackground());
backgroundCompPane.update(freeButton);
frFontPane.update(freeButton.getFont());
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},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel;
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel);
return boundsPane;
}
@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() {
acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays);
singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD"));
singleFileCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
fileSizeField = new UINumberField();
fontSizeField = new UISpinner(0, 20, 1, 0);
@ -66,9 +67,11 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel);
return panel;
return boundsPane;
}
@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.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter;
import com.fr.third.fr.pdf.layout.border.Border;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
@ -165,28 +167,31 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
double[] columnSize = {p,f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1}};
JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
advancePane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
return advancePane;
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
advancePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(advancePane);
return boundsPane;
}
public JPanel setValidatePane() {
// super.addValidatePane();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
this.decimalLength = new com.fr.design.editor.editor.IntegerEditor();
this.decimalLength.setColumns(4);
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.allowDecimalsCheckBox.addActionListener(actionListener1);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative"));
this.allowNegativeCheckBox.addActionListener(actionListener2);
allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
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));
maxValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.maxValueSpinner);
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));
minValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.minValueSpinner);
minValueSpinner.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMinValueCheckBox.addActionListener(actionListener4);
this.minValueSpinner.addChangeListener(changeListener2);
setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
double f = TableLayout.FILL;
@ -214,6 +219,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 3);
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
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.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
@ -24,10 +25,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
super(xCreator);
}
public TextFieldEditorDefinePane() {
super();
}
@Override
protected JPanel setFirstContentPane() {
@ -79,9 +76,11 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
return panel;
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel);
return boundsPane;
}
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[] columnSize = {p};
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;
}

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};
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1}};
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);
JPanel otherPane = createOtherPane();
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){
if (ComparatorUtils.equals(tabTitles[index], Inter.getLocText("FieldBinding"))) {
customPane.setPreferredSize(new Dimension(100, 50));
if (ComparatorUtils.equals(tabTitles[index], Inter.getLocText("FR-Designer_Widget_Field"))) {
customPane.setPreferredSize(new Dimension(100, 47));
} else {
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)},
};
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);
}

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[]{new UILabel("报表块工具栏"), elementCaseToolBarEditor}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
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-Widget_Scaling_Mode")), comboBox},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
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) {
super(xCreator);
this.xwAbsoluteLayout = (XWAbsoluteLayout) xCreator;
wAbsoluteLayout = xwAbsoluteLayout.toData();
initComponent();
@ -45,7 +44,10 @@ public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayo
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(boundPane, BorderLayout.NORTH);
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);
}
@ -60,7 +62,7 @@ public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayo
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Scaling_Mode")), comboBox},
};
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;
}

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();
paddingBound = new PaddingBoundPane();
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(jp2, BorderLayout.NORTH);
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_Interval")), componentIntervel}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
jPanel.add(panel, BorderLayout.CENTER);
return jPanel;
@ -124,7 +124,10 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
public WFitLayout updateBean() {
WFitLayout layout = (WFitLayout) creator.toData();
paddingBound.update(layout);
layout.setBorderStyle((LayoutBorderStyle) background.getValue());
LayoutBorderStyle borderStyle = (LayoutBorderStyle) background.getValue();
if(borderStyle != null){
layout.setBorderStyle(borderStyle);
}
Item item = (Item) layoutComboBox.getSelectedItem();
Object value = item.getValue();
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.TableLayoutHelper;
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.TabFitLayoutBackgroundPane;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.Inter;
@ -21,7 +20,7 @@ import java.awt.*;
*/
public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
private PaddingBoundPane paddingBoundPane;
private BackgroundCompPane borderStyle;
private TabFitLayoutBackgroundPane borderStyle;
private UISpinner componentInterval;
public WTabFitLayoutDefinePane(XCreator xCreator) {
@ -32,7 +31,7 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
public void initComponent() {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
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);
advancePane.add(jPanel, BorderLayout.NORTH);
advancePane.add(paddingBoundPane, BorderLayout.CENTER);
@ -55,8 +54,7 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
@Override
public void populateBean(WTabFitLayout ob) {
MouseActionBackground mouseActionBackground = new MouseActionBackground(ob.getInitialBackground(), ob.getOverBackground(), ob.getClickBackground());
borderStyle.populate(mouseActionBackground);
borderStyle.populate(ob);
paddingBoundPane.populate(ob);
componentInterval.setValue(ob.getCompInterval());
}
@ -65,10 +63,7 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
@Override
public WTabFitLayout updateBean() {
WTabFitLayout layout = (WTabFitLayout) creator.toData();
MouseActionBackground mouseActionBackground = borderStyle.update();
layout.setInitialBackground(mouseActionBackground.getInitialBackground());
layout.setOverBackground(mouseActionBackground.getOverBackground());
layout.setClickBackground(mouseActionBackground.getClickBackground());
borderStyle.update(layout);
paddingBoundPane.update(layout);
layout.setCompInterval((int)componentInterval.getValue());
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}
};
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);
JPanel centerPane = createCenterPane();
if(centerPane!=null){

Loading…
Cancel
Save