Browse Source

Merge branch '9.0' of http://www.finedevelop.com:2015/scm/~vito/design into 9.0

# Conflicts:
#	designer/src/com/fr/quickeditor/CellQuickEditor.java
#	designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java
#	designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
#	designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java
master
vito 7 years ago
parent
commit
40a9dda033
  1. 15
      designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java
  2. 38
      designer/src/com/fr/design/dscolumn/DSColumnAdvancedEditorPane.java
  3. 84
      designer/src/com/fr/design/dscolumn/DSColumnBasicEditorPane.java
  4. 99
      designer/src/com/fr/design/dscolumn/DSColumnBasicPane.java
  5. 4
      designer/src/com/fr/design/dscolumn/DSColumnPane.java
  6. 58
      designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java
  7. 64
      designer/src/com/fr/design/dscolumn/SelectedConfirmedDataColumnPane.java
  8. 101
      designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
  9. 4
      designer/src/com/fr/design/mainframe/cell/CellEditorPane.java
  10. 4
      designer/src/com/fr/design/module/DesignerModule.java
  11. 2
      designer/src/com/fr/design/present/BarCodePane.java
  12. 4
      designer/src/com/fr/design/present/CurrencyLinePane.java
  13. 21
      designer/src/com/fr/design/widget/DataModify.java
  14. 11
      designer/src/com/fr/design/widget/Operator.java
  15. 14
      designer/src/com/fr/design/widget/ui/ButtonGroupDictPane.java
  16. 88
      designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java
  17. 2
      designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java
  18. 184
      designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java
  19. 4
      designer/src/com/fr/design/widget/ui/ListEditorDefinePane.java
  20. 148
      designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java
  21. 61
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  22. 4
      designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java
  23. 10
      designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java
  24. 2
      designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java
  25. 2
      designer/src/com/fr/design/widget/ui/WritableRepeatEditorPane.java
  26. 5
      designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java
  27. 35
      designer/src/com/fr/quickeditor/CellQuickEditor.java
  28. 20
      designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java
  29. 955
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  30. 152
      designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java
  31. 32
      designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java
  32. 36
      designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java
  33. 15
      designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java
  34. 20
      designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java
  35. 2
      designer_base/src/com/fr/design/constants/UIConstants.java
  36. 183
      designer_base/src/com/fr/design/gui/frpane/ReportletParameterViewPane.java
  37. 1
      designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java
  38. 3
      designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java
  39. 177
      designer_base/src/com/fr/design/gui/itableeditorpane/UITableEditorPane.java
  40. 44
      designer_base/src/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java
  41. BIN
      designer_base/src/com/fr/design/images/arrow/arrow_down.png
  42. BIN
      designer_base/src/com/fr/design/images/arrow/arrow_up.png
  43. BIN
      designer_base/src/com/fr/design/images/buttonicon/add.png
  44. BIN
      designer_base/src/com/fr/design/images/buttonicon/add_press.png
  45. BIN
      designer_base/src/com/fr/design/images/buttonicon/addicon.png
  46. BIN
      designer_base/src/com/fr/design/images/buttonicon/cube.png
  47. BIN
      designer_base/src/com/fr/design/images/buttonicon/editp.png
  48. BIN
      designer_base/src/com/fr/design/images/buttonicon/hiden.png
  49. BIN
      designer_base/src/com/fr/design/images/buttonicon/hidep.png
  50. BIN
      designer_base/src/com/fr/design/images/buttonicon/minus.png
  51. BIN
      designer_base/src/com/fr/design/images/buttonicon/newcpts.png
  52. BIN
      designer_base/src/com/fr/design/images/buttonicon/open.png
  53. BIN
      designer_base/src/com/fr/design/images/buttonicon/pageb24.png
  54. BIN
      designer_base/src/com/fr/design/images/buttonicon/pages.png
  55. BIN
      designer_base/src/com/fr/design/images/buttonicon/plus.png
  56. BIN
      designer_base/src/com/fr/design/images/buttonicon/redo.png
  57. BIN
      designer_base/src/com/fr/design/images/buttonicon/refresh.png
  58. BIN
      designer_base/src/com/fr/design/images/buttonicon/run24.png
  59. BIN
      designer_base/src/com/fr/design/images/buttonicon/undo.png
  60. BIN
      designer_base/src/com/fr/design/images/buttonicon/writeb24.png
  61. BIN
      designer_base/src/com/fr/design/images/buttonicon/writes.png
  62. BIN
      designer_base/src/com/fr/design/images/chart/ChartStyle.png
  63. BIN
      designer_base/src/com/fr/design/images/chart/ChartType.png
  64. BIN
      designer_base/src/com/fr/design/images/chart/InterAttr.png
  65. BIN
      designer_base/src/com/fr/design/images/control/addPopup.png
  66. BIN
      designer_base/src/com/fr/design/images/control/bar.png
  67. BIN
      designer_base/src/com/fr/design/images/control/copy.png
  68. BIN
      designer_base/src/com/fr/design/images/control/edit.png
  69. BIN
      designer_base/src/com/fr/design/images/control/remove.png
  70. BIN
      designer_base/src/com/fr/design/images/dashboard/files.png
  71. BIN
      designer_base/src/com/fr/design/images/data/bind/distanceconnect.png
  72. BIN
      designer_base/src/com/fr/design/images/data/bind/localconnect.png
  73. BIN
      designer_base/src/com/fr/design/images/data/dataDictionary.png
  74. BIN
      designer_base/src/com/fr/design/images/data/dataTable.png
  75. BIN
      designer_base/src/com/fr/design/images/data/dock/serverdatabase.png
  76. BIN
      designer_base/src/com/fr/design/images/data/multi.png
  77. BIN
      designer_base/src/com/fr/design/images/data/source/rename.png
  78. BIN
      designer_base/src/com/fr/design/images/file/fold.png
  79. BIN
      designer_base/src/com/fr/design/images/file/newfolder.png
  80. BIN
      designer_base/src/com/fr/design/images/form/toolbar/ec_frozen.png
  81. BIN
      designer_base/src/com/fr/design/images/gui/color/background.png
  82. BIN
      designer_base/src/com/fr/design/images/lookandfeel/ErrorIcon.png
  83. BIN
      designer_base/src/com/fr/design/images/lookandfeel/InformationIcon.png
  84. BIN
      designer_base/src/com/fr/design/images/lookandfeel/QuestionIcon.png
  85. BIN
      designer_base/src/com/fr/design/images/lookandfeel/TreeFolderOpenedIcon.png
  86. BIN
      designer_base/src/com/fr/design/images/lookandfeel/WarningIcon.png
  87. BIN
      designer_base/src/com/fr/design/images/m_edit/copy.png
  88. BIN
      designer_base/src/com/fr/design/images/m_edit/cut.png
  89. BIN
      designer_base/src/com/fr/design/images/m_edit/formatBrush.png
  90. BIN
      designer_base/src/com/fr/design/images/m_edit/merge.png
  91. BIN
      designer_base/src/com/fr/design/images/m_edit/unmerge.png
  92. BIN
      designer_base/src/com/fr/design/images/m_file/formExport.png
  93. BIN
      designer_base/src/com/fr/design/images/m_file/pdf.png
  94. BIN
      designer_base/src/com/fr/design/images/m_file/preview.png
  95. BIN
      designer_base/src/com/fr/design/images/m_file/saveAs.png
  96. BIN
      designer_base/src/com/fr/design/images/m_file/switch.png
  97. BIN
      designer_base/src/com/fr/design/images/m_file/text.png
  98. BIN
      designer_base/src/com/fr/design/images/m_file/view_folder.png
  99. BIN
      designer_base/src/com/fr/design/images/m_file/word.png
  100. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/bold.png
  101. Some files were not shown because too many files have changed in this diff Show More

15
designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java

@ -1,21 +1,18 @@
package com.fr.design.actions.columnrow; package com.fr.design.actions.columnrow;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.actions.cell.AbstractCellElementAction; import com.fr.design.actions.cell.AbstractCellElementAction;
import com.fr.design.dscolumn.DSColumnConditionsPane; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter; import com.fr.design.dscolumn.DSColumnConditionsPane;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.Inter;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
public class DSColumnConditionAction extends AbstractCellElementAction { public class DSColumnConditionAction extends AbstractCellElementAction {
private boolean returnValue = false;
private TemplateCellElement editCellElement;
public DSColumnConditionAction(ElementCasePane t) { public DSColumnConditionAction(ElementCasePane t) {
super(t); super(t);
this.setName(Inter.getLocText("Filter")); this.setName(Inter.getLocText("Filter"));
this.setMnemonic('E'); this.setMnemonic('E');
@ -23,14 +20,14 @@ public class DSColumnConditionAction extends AbstractCellElementAction {
} }
@Override @Override
protected BasicPane populateBasicPane(TemplateCellElement cellElement) { protected BasicPane populateBasicPane(TemplateCellElement cellElement) {
DSColumnConditionsPane dSColumnConditionsPane = new DSColumnConditionsPane(); DSColumnConditionsPane dSColumnConditionsPane = new DSColumnConditionsPane();
dSColumnConditionsPane.populate(DesignTableDataManager.getEditingTableDataSource(), cellElement); dSColumnConditionsPane.populate(DesignTableDataManager.getEditingTableDataSource(), cellElement);
return dSColumnConditionsPane; return dSColumnConditionsPane;
} }
@Override @Override
protected void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) { protected void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) {
((DSColumnConditionsPane) bp).update(cellElement); ((DSColumnConditionsPane) bp).update(cellElement);
} }
} }

38
designer/src/com/fr/design/dscolumn/DSColumnAdvancedEditorPane.java

@ -1,38 +0,0 @@
package com.fr.design.dscolumn;
import com.fr.design.mainframe.cell.CellEditorPane;
import com.fr.report.cell.TemplateCellElement;
/**
* 单元格元素 数据列 基本设置内容面板
*
* @author yaoh.wu
* @version 2017年7月25日
* @since 9.0
*/
public class DSColumnAdvancedEditorPane extends CellEditorPane {
@Override
public String getIconPath() {
return "Advanced";
}
@Override
public String title4PopupWindow() {
return "Advanced";
}
@Override
public void update() {
}
@Override
public void populate(TemplateCellElement cellElement) {
}
}

84
designer/src/com/fr/design/dscolumn/DSColumnBasicEditorPane.java

@ -1,84 +0,0 @@
package com.fr.design.dscolumn;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.cell.CellEditorPane;
import com.fr.report.cell.TemplateCellElement;
import javax.swing.*;
import java.awt.*;
/**
* 单元格元素 数据列 高级设置内容面板
*
* @author yaoh.wu
* @version 2017年7月25日
* @since 9.0
*/
public class DSColumnBasicEditorPane extends CellEditorPane {
//数据集和数据列
private SelectedDataColumnPane dataPane;
//数据分组设置
private ResultSetGroupDockingPane groupPane;
//当前编辑的单元格
private TemplateCellElement cellElement;
//条件过滤按钮面板
private JPanel conditionPane;
public DSColumnBasicEditorPane(TemplateCellElement cellElement, SelectedDataColumnPane dataPane, ResultSetGroupDockingPane groupPane, JPanel conditionPane) {
this.setLayout(new BorderLayout());
this.cellElement = cellElement;
this.dataPane = dataPane;
this.groupPane = groupPane;
this.conditionPane = conditionPane;
this.add(this.createContentPane(), BorderLayout.CENTER);
}
@Override
public String getIconPath() {
return "Basic";
}
@Override
public String title4PopupWindow() {
return "Basic";
}
@Override
public void update() {
dataPane.update(this.cellElement);
groupPane.update();
}
@Override
public void populate(TemplateCellElement cellElement) {
this.cellElement = cellElement;
dataPane.populate(null, cellElement);
groupPane.populate(cellElement);
}
/**
* 创建有内容的面板显示信息
*
* @return content JPanel
*/
private JPanel createContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
//数据集列选择
new Component[]{this.dataPane},
//数据分组设置
new Component[]{this.groupPane},
//条件过滤
new Component[]{this.conditionPane}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
}

99
designer/src/com/fr/design/dscolumn/DSColumnBasicPane.java

@ -1,25 +1,23 @@
package com.fr.design.dscolumn; package com.fr.design.dscolumn;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.design.dialog.BasicPane;
import com.fr.design.expand.ConditionParentPane; import com.fr.design.expand.ConditionParentPane;
import com.fr.design.expand.ExpandDirectionPane; import com.fr.design.expand.ExpandDirectionPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class DSColumnBasicPane extends BasicPane { public class DSColumnBasicPane extends BasicPane {
@ -30,7 +28,7 @@ public class DSColumnBasicPane extends BasicPane {
private CellElement cellElement; private CellElement cellElement;
public DSColumnBasicPane() { public DSColumnBasicPane() {
this(DSColumnPane.SETTING_ALL); this(DSColumnPane.SETTING_ALL);
} }
public DSColumnBasicPane(int setting) { public DSColumnBasicPane(int setting) {
@ -38,44 +36,44 @@ public class DSColumnBasicPane extends BasicPane {
this.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); this.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
selectDataColumnPane = new SelectedDataColumnPane(); selectDataColumnPane = new SelectedDataColumnPane();
} else { } else {
selectDataColumnPane = new SelectedConfirmedDataColumnPane(); selectDataColumnPane = new SelectedConfirmedDataColumnPane();
} }
selectDataColumnPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Select_DataColumn"), null)); selectDataColumnPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Select_DataColumn"), null));
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
conditionParentPane = new ConditionParentPane(); conditionParentPane = new ConditionParentPane();
conditionParentPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ParentCell_Setting"), null)); conditionParentPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ParentCell_Setting"), null));
} }
resultSetGroupPane = new ResultSetGroupPopUpPane(setting > DSColumnPane.SETTING_DSRELATED); resultSetGroupPane = new ResultSetGroupPopUpPane(setting > DSColumnPane.SETTING_DSRELATED);
resultSetGroupPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Data_Setting"), null)); resultSetGroupPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Data_Setting"), null));
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
expandDirectionPane = new ExpandDirectionPane(); expandDirectionPane = new ExpandDirectionPane();
expandDirectionPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ExpandD-Expand_Direction"), null)); expandDirectionPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ExpandD-Expand_Direction"), null));
} }
double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED,
TableLayout.PREFERRED, TableLayout.PREFERRED}; TableLayout.PREFERRED, TableLayout.PREFERRED};
double[] columnSize = {TableLayout.FILL}; double[] columnSize = {TableLayout.FILL};
Component[][] components = null; Component[][] components = null;
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
components = new Component[][]{ components = new Component[][]{
{selectDataColumnPane}, {selectDataColumnPane},
{conditionParentPane}, {conditionParentPane},
{resultSetGroupPane}, {resultSetGroupPane},
{expandDirectionPane} {expandDirectionPane}
}; };
} else { } else {
components = new Component[][]{ components = new Component[][]{
{selectDataColumnPane}, {selectDataColumnPane},
{resultSetGroupPane}, {resultSetGroupPane},
}; };
} }
this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER); this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER);
@ -85,7 +83,7 @@ public class DSColumnBasicPane extends BasicPane {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("Basic"); return Inter.getLocText("Basic");
} }
public void populate(TableDataSource source, TemplateCellElement cellElement) { public void populate(TableDataSource source, TemplateCellElement cellElement) {
@ -99,10 +97,10 @@ public class DSColumnBasicPane extends BasicPane {
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
if (conditionParentPane != null) { if (conditionParentPane != null) {
conditionParentPane.populate(cellExpandAttr); conditionParentPane.populate(cellExpandAttr);
} }
if (expandDirectionPane != null) { if (expandDirectionPane != null) {
expandDirectionPane.populate(cellExpandAttr); expandDirectionPane.populate(cellExpandAttr);
} }
resultSetGroupPane.populate(cellElement); resultSetGroupPane.populate(cellElement);
@ -128,27 +126,28 @@ public class DSColumnBasicPane extends BasicPane {
} }
if (conditionParentPane != null) { if (conditionParentPane != null) {
conditionParentPane.update(cellExpandAttr); conditionParentPane.update(cellExpandAttr);
} }
if (expandDirectionPane != null) { if (expandDirectionPane != null) {
expandDirectionPane.update(cellExpandAttr); expandDirectionPane.update(cellExpandAttr);
} }
resultSetGroupPane.update(); resultSetGroupPane.update();
} }
ActionListener summary_direction_ActionListener = new ActionListener() { ActionListener summary_direction_ActionListener = new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
if (expandDirectionPane != null) { if (expandDirectionPane != null) {
expandDirectionPane.setNoneRadioButtonSelected(true); expandDirectionPane.setNoneRadioButtonSelected(true);
} }
} }
}; };
ActionListener otherGroup_direction_ActionListener = new ActionListener() { ActionListener otherGroup_direction_ActionListener = new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
if (expandDirectionPane != null) { if (expandDirectionPane != null) {
expandDirectionPane.setNoneRadioButtonSelected(false); expandDirectionPane.setNoneRadioButtonSelected(false);
} }
} }
}; };
ActionListener sdcUpdate_ActionListener = new ActionListener() { ActionListener sdcUpdate_ActionListener = new ActionListener() {
@ -157,14 +156,16 @@ public class DSColumnBasicPane extends BasicPane {
selectDataColumnPane.update(cellElement); selectDataColumnPane.update(cellElement);
} }
}; };
public void putElementcase(ElementCasePane t){
if (conditionParentPane != null) { public void putElementcase(ElementCasePane t) {
conditionParentPane.putElementcase(t); if (conditionParentPane != null) {
} conditionParentPane.putElementcase(t);
} }
public void putCellElement(TemplateCellElement tplEC2) { }
if (conditionParentPane != null) {
conditionParentPane.putCellElement(tplEC2); public void putCellElement(TemplateCellElement tplCE) {
} if (conditionParentPane != null) {
} conditionParentPane.putCellElement(tplCE);
}
}
} }

4
designer/src/com/fr/design/dscolumn/DSColumnPane.java

@ -148,7 +148,7 @@ public class DSColumnPane extends BasicPane {
basicPane.putElementcase(t); basicPane.putElementcase(t);
} }
public void putCellElement(TemplateCellElement tplEC2) { public void putCellElement(TemplateCellElement tplCE) {
basicPane.putCellElement(tplEC2); basicPane.putCellElement(tplCE);
} }
} }

58
designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java

@ -1,35 +1,31 @@
package com.fr.design.dscolumn; package com.fr.design.dscolumn;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.FunctionComboBox; import com.fr.design.gui.icombobox.FunctionComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.core.group.CustomGrouper; import com.fr.report.cell.cellattr.core.group.*;
import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.cell.cellattr.core.group.FunctionGrouper;
import com.fr.report.cell.cellattr.core.group.RecordGrouper;
import com.fr.report.cell.cellattr.core.group.SummaryGrouper;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
/** /**
* 这个pane是选中数据列后在上方QuickRegion处显示的pane * 这个pane是选中数据列后在上方QuickRegion处显示的pane
* *
* @author zhou * @author zhou, yaoh.wu
* @version 2017年8月2日14点55分
* @since 8.0
*/ */
public class ResultSetGroupDockingPane extends ResultSetGroupPane { public class ResultSetGroupDockingPane extends ResultSetGroupPane {
private static final int BIND_GROUP = 0; private static final int BIND_GROUP = 0;
@ -42,7 +38,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
private CardLayout cardLayout; private CardLayout cardLayout;
private UIComboBox goBox; private UIComboBox goBox;
ItemListener l; private ItemListener listener;
public ResultSetGroupDockingPane(ElementCasePane ePane) { public ResultSetGroupDockingPane(ElementCasePane ePane) {
super(); super();
@ -58,15 +54,14 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
} }
private JPanel layoutPane() { private JPanel layoutPane() {
double vs = 4;
double vg = 6;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
UILabel dataSetLabel = new UILabel(Inter.getLocText("Data_Setting"));
dataSetLabel.setPreferredSize(new Dimension(60, 20));
Component[][] components = new Component[][] Component[][] components = new Component[][]
{ {
new Component[]{new UILabel(Inter.getLocText("Data_Setting")), goBox}, new Component[]{dataSetLabel, goBox},
new Component[]{cardPane, null} new Component[]{null, cardPane}
}; };
goBox.addItemListener(new ItemListener() { goBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent ee) { public void itemStateChanged(ItemEvent ee) {
@ -74,10 +69,13 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
int i = goBox.getSelectedIndex(); int i = goBox.getSelectedIndex();
if (i == BIND_GROUP) { if (i == BIND_GROUP) {
cardLayout.show(cardPane, "groupPane"); cardLayout.show(cardPane, "groupPane");
cardPane.setPreferredSize(new Dimension(155, 20));
} else if (i == BIND_SELECTED) { } else if (i == BIND_SELECTED) {
cardLayout.show(cardPane, "listPane"); cardLayout.show(cardPane, "listPane");
cardPane.setPreferredSize(new Dimension(0, 0));
} else if (i == BIND_SUMMARY) { } else if (i == BIND_SUMMARY) {
cardLayout.show(cardPane, "summaryPane"); cardLayout.show(cardPane, "summaryPane");
cardPane.setPreferredSize(new Dimension(155, 20));
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
cellExpandAttr.setDirection(Constants.NONE); cellExpandAttr.setDirection(Constants.NONE);
} }
@ -86,7 +84,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p, p}; double[] rowSize = {p, p};
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }
private void initCardPane() { private void initCardPane() {
@ -190,15 +188,15 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
} }
} }
public void addListener(ItemListener l) { public void addListener(ItemListener listener) {
goBox.addItemListener(l); goBox.addItemListener(listener);
groupComboBox.addItemListener(l); groupComboBox.addItemListener(listener);
functionComboBox.addItemListener(l); functionComboBox.addItemListener(listener);
this.l = l; this.listener = listener;
} }
void fireTargetChanged() { void fireTargetChanged() {
l.itemStateChanged(null); listener.itemStateChanged(null);
} }
@Override @Override

64
designer/src/com/fr/design/dscolumn/SelectedConfirmedDataColumnPane.java

@ -1,45 +1,45 @@
package com.fr.design.dscolumn; package com.fr.design.dscolumn;
import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.Iterator;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.design.data.datapane.TableDataComboBox; import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBook;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.Iterator;
public class SelectedConfirmedDataColumnPane extends SelectedDataColumnPane { public class SelectedConfirmedDataColumnPane extends SelectedDataColumnPane {
public SelectedConfirmedDataColumnPane () { public SelectedConfirmedDataColumnPane() {
super(false); super(false);
} }
protected void initTableNameComboBox() { protected void initTableNameComboBox() {
tableNameComboBox = new TableDataComboBox(new WorkBook()); tableNameComboBox = new TableDataComboBox(new WorkBook());
tableNameComboBox.addItemListener(new ItemListener() { tableNameComboBox.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
columnNameComboBox.setLoaded(false); columnNameComboBox.setLoaded(false);
} }
}); });
tableNameComboBox.setPreferredSize(new Dimension(100, 20)); tableNameComboBox.setPreferredSize(new Dimension(100, 20));
} }
public void populate(TableDataSource source, TemplateCellElement cell) { public void populate(TableDataSource source, TemplateCellElement cell) {
tableNameComboBox.refresh(source); tableNameComboBox.refresh(source);
tableNameComboBox.setEditable(false); tableNameComboBox.setEditable(false);
tableNameComboBox.setEnabled(false); tableNameComboBox.setEnabled(false);
super.populate(source, cell); super.populate(source, cell);
try { try {
Iterator it = source.getTableDataNameIterator(); Iterator it = source.getTableDataNameIterator();
String name = (String)it.next(); String name = (String) it.next();
TemplateTableDataWrapper wrapper = new TemplateTableDataWrapper(source.getTableData(name), name); TemplateTableDataWrapper wrapper = new TemplateTableDataWrapper(source.getTableData(name), name);
tableNameComboBox.setSelectedItem(wrapper); tableNameComboBox.setSelectedItem(wrapper);
tableNameComboBox.getModel().setSelectedItem(wrapper); tableNameComboBox.getModel().setSelectedItem(wrapper);
} catch (Exception e) { } catch (Exception e) {
} }
} }
} }

101
designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -17,6 +17,7 @@ import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.data.TableDataColumn; import com.fr.general.data.TableDataColumn;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
@ -39,8 +40,8 @@ import java.util.regex.Pattern;
* 数据集列动态参数设置组件 * 数据集列动态参数设置组件
* *
* @author yaoh.wu * @author yaoh.wu
* @version 2017年7月26 * @version 2017年8月3
* 9.0设计器更新修改动态参数注入按钮部分,使其显示动态参数按钮时能在右侧边栏正常显示 * 复用对话框代码保留对话框原始布局
* @since 8.0 * @since 8.0
*/ */
public class SelectedDataColumnPane extends BasicPane { public class SelectedDataColumnPane extends BasicPane {
@ -54,11 +55,20 @@ public class SelectedDataColumnPane extends BasicPane {
private UIButton paramButton; private UIButton paramButton;
public SelectedDataColumnPane() { public SelectedDataColumnPane() {
this(true); this(true, false, null, null);
} }
SelectedDataColumnPane(boolean showParameterButton) {
initComponent(showParameterButton); public SelectedDataColumnPane(boolean showParameterButton) {
this(showParameterButton, false, null, null);
}
public SelectedDataColumnPane(boolean showParameterButton, boolean verticalLayout, ElementCasePane casePane, TemplateCellElement cellElement) {
if (verticalLayout) {
initComponentVerticalLayout(casePane, cellElement);
} else {
initComponent(showParameterButton);
}
} }
/** /**
@ -72,33 +82,32 @@ public class SelectedDataColumnPane extends BasicPane {
initWithParameterButton(); initWithParameterButton();
} }
columnNameComboBox = new LazyComboBox() { columnNameComboBox = new LazyComboBox() {
@Override @Override
public Object[] load() { public Object[] load() {
List<String> l = calculateColumnNameList(); List<String> l = calculateColumnNameList();
return l.toArray(new String[l.size()]); return l.toArray(new String[l.size()]);
} }
}; };
columnNameComboBox.setEditable(true); columnNameComboBox.setEditable(true);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
UILabel label1 = new UILabel(Inter.getLocText("TableData")); UILabel dsLabel = new UILabel(Inter.getLocText("TableData") + ":");
UILabel label3 = new UILabel(Inter.getLocText("DataColumn")); UILabel dcLabel = new UILabel(Inter.getLocText("DataColumn") + ":");
if (showParameterButton) { if (showParameterButton) {
//todo 国际化 dsLabel.setPreferredSize(new Dimension(200, 25));
UILabel label2 = new UILabel("param"); dcLabel.setPreferredSize(new Dimension(200, 25));
Component[][] components = { }
{label1, tableNameComboBox}, if (showParameterButton) {
{label2, paramButton}, Component[][] comps = {{dsLabel, null, dcLabel}, {tableNameComboBox, paramButton, columnNameComboBox}};
{label3, columnNameComboBox} this.add(TableLayoutHelper.createTableLayoutPane(comps, new double[]{p, p}, new double[]{p, p, p}));
};
this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p, p}, new double[]{p, f}));
} else { } else {
double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p, p}; double[] rowSize = {p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{label1, tableNameComboBox}, new Component[]{dsLabel, tableNameComboBox},
new Component[]{label3, columnNameComboBox} new Component[]{dcLabel, columnNameComboBox}
}; };
JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
@ -107,6 +116,39 @@ public class SelectedDataColumnPane extends BasicPane {
} }
/**
* 初始化竖直布局的组件
*/
public void initComponentVerticalLayout(ElementCasePane casePane, TemplateCellElement cellElement) {
initTableNameComboBox();
initWithParameterButton(casePane, cellElement);
columnNameComboBox = new LazyComboBox() {
@Override
public Object[] load() {
List<String> l = calculateColumnNameList();
return l.toArray(new String[l.size()]);
}
};
columnNameComboBox.setEditable(true);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
UILabel dsLabel = new UILabel(Inter.getLocText("TableData"));
UILabel dpLabel = new UILabel(Inter.getLocText("FR-Designer_Dynamic_Parameter"));
UILabel dcLabel = new UILabel(Inter.getLocText("DataColumn"));
dsLabel.setPreferredSize(new Dimension(60, 20));
dpLabel.setPreferredSize(new Dimension(60, 20));
dcLabel.setPreferredSize(new Dimension(60, 20));
Component[][] components = {
{dsLabel, tableNameComboBox},
{dpLabel, paramButton},
{dcLabel, columnNameComboBox}
};
this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p, p}, new double[]{p, f}));
}
public void populate(TableDataSource source, TemplateCellElement cellElement) { public void populate(TableDataSource source, TemplateCellElement cellElement) {
if (cellElement == null) { if (cellElement == null) {
return; return;
@ -237,6 +279,27 @@ public class SelectedDataColumnPane extends BasicPane {
}); });
} }
private void initWithParameterButton(ElementCasePane casePane, TemplateCellElement cellElement) {
SelectedDataColumnPane that = this;
editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel());
paramButton = new UIButton(Inter.getLocText("TableData_Dynamic_Parameter_Setting"));
paramButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
BasicDialog paramDialog = editorPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
List<ParameterProvider> parameterList = editorPane.update();
ps = parameterList.toArray(new Parameter[parameterList.size()]);
that.update(cellElement);
casePane.fireTargetModified();
}
});
editorPane.populate(ps == null ? new Parameter[0] : ps);
paramDialog.setVisible(true);
}
});
}
private boolean isColumnName(String columnExp) { private boolean isColumnName(String columnExp) {
return StringUtils.isNotBlank(columnExp) && (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#"); return StringUtils.isNotBlank(columnExp) && (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#");

4
designer/src/com/fr/design/mainframe/cell/CellEditorPane.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe.cell; package com.fr.design.mainframe.cell;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.report.cell.TemplateCellElement;
/** /**
* 右侧单元格元素面板抽象类 * 右侧单元格元素面板抽象类
@ -24,7 +23,6 @@ public abstract class CellEditorPane extends BasicPane {
/** /**
* 更新面板数据 * 更新面板数据
* *
* @param cellElement 单元格
*/ */
public abstract void populate(TemplateCellElement cellElement); public abstract void populate();
} }

4
designer/src/com/fr/design/module/DesignerModule.java

@ -111,7 +111,7 @@ public class DesignerModule extends DesignModule {
private void registerCellEditor() { private void registerCellEditor() {
ActionFactory.registerCellEditor(String.class, CellStringQuickEditor.class); ActionFactory.registerCellEditor(String.class, CellStringQuickEditor.class);
ActionFactory.registerCellEditor(Number.class, CellStringQuickEditor.class); ActionFactory.registerCellEditor(Number.class, CellStringQuickEditor.class);
ActionFactory.registerCellEditor(Formula.class, CellStringQuickEditor.class); ActionFactory.registerCellEditor(Formula.class, CellFormulaQuickEditor.class);
ActionFactory.registerCellEditor(SubReport.class, CellSubReportEditor.class); ActionFactory.registerCellEditor(SubReport.class, CellSubReportEditor.class);
ActionFactory.registerCellEditor(RichText.class, CellRichTextEditor.class); ActionFactory.registerCellEditor(RichText.class, CellRichTextEditor.class);
ActionFactory.registerCellEditor(DSColumn.class, CellDSColumnEditor.class); ActionFactory.registerCellEditor(DSColumn.class, CellDSColumnEditor.class);
@ -385,7 +385,7 @@ public class DesignerModule extends DesignModule {
} }
public Class<?>[] actionsForInsertCellElement() { public Class<?>[] actionsForInsertCellElement() {
return (Class<?>[])ArrayUtils.addAll(new Class<?>[]{ return (Class<?>[]) ArrayUtils.addAll(new Class<?>[]{
DSColumnCellAction.class, DSColumnCellAction.class,
GeneralCellAction.class, GeneralCellAction.class,
RichTextCellAction.class, RichTextCellAction.class,

2
designer/src/com/fr/design/present/BarCodePane.java

@ -85,7 +85,7 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
RCodesizespinner = new UIBasicSpinner(new SpinnerNumberModel(2, 1, 6, 1)); RCodesizespinner = new UIBasicSpinner(new SpinnerNumberModel(2, 1, 6, 1));
RCodeVersionComboBox = new UIComboBox(); RCodeVersionComboBox = new UIComboBox();
RCodeErrorCorrectComboBox = new UIComboBox(); RCodeErrorCorrectComboBox = new UIComboBox();
typeSetLabel = new UILabel(Inter.getLocText("Type_Set") + ":", UILabel.RIGHT); typeSetLabel = new UILabel(Inter.getLocText("Type_Set"), UILabel.RIGHT);
initVersionComboBox(); initVersionComboBox();
initErrorCorrectComboBox(); initErrorCorrectComboBox();

4
designer/src/com/fr/design/present/CurrencyLinePane.java

@ -72,11 +72,11 @@ public class CurrencyLinePane extends FurtherBasicBeanPane<CurrencyLinePresent>
protected void initComponents() { protected void initComponents() {
// 整数位选择 // 整数位选择
intPartSpinner = new UIBasicSpinner(new SpinnerNumberModel(9, 1, 20, 1)); intPartSpinner = new UIBasicSpinner(new SpinnerNumberModel(9, 1, 20, 1));
intPartSpinner.setPreferredSize(new Dimension(135, 20)); intPartSpinner.setPreferredSize(new Dimension(158, 20));
// 小数位选择 // 小数位选择
deciPartSpinner = new UIBasicSpinner(new SpinnerNumberModel(2, 1, 10, 1)); deciPartSpinner = new UIBasicSpinner(new SpinnerNumberModel(2, 1, 10, 1));
deciPartSpinner.setPreferredSize(new Dimension(135, 20)); deciPartSpinner.setPreferredSize(new Dimension(158, 20));
// 预览区域 // 预览区域
textField = new UITextField(10); textField = new UITextField(10);

21
designer/src/com/fr/design/widget/DataModify.java

@ -1,21 +0,0 @@
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.*;
public interface DataModify<T> {
void populateBean(T ob);
T updateBean();
void checkValid() throws Exception;
DataCreatorUI dataUI();
JComponent toSwingComponent();
}

11
designer/src/com/fr/design/widget/Operator.java

@ -1,11 +0,0 @@
package com.fr.design.widget;
import com.fr.design.data.DataCreatorUI;
/**
* Created by richie on 15/11/16.
*/
public interface Operator {
void did(DataCreatorUI ui, String cardName);
}

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

@ -1,6 +1,7 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -28,7 +29,8 @@ public class ButtonGroupDictPane extends JPanel {
* *
*/ */
public void initComponents() { public void initComponents() {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(new FlowLayout(0));
JPanel pane = new JPanel(new FlowLayout());
adaptiveCheckbox = new UICheckBox(Inter.getLocText("Adaptive"), true); adaptiveCheckbox = new UICheckBox(Inter.getLocText("Adaptive"), true);
adaptiveCheckbox.addActionListener(new ActionListener() { adaptiveCheckbox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -36,12 +38,14 @@ public class ButtonGroupDictPane extends JPanel {
columnLabel.setVisible(!adaptiveCheckbox.isSelected()); columnLabel.setVisible(!adaptiveCheckbox.isSelected());
} }
}); });
this.add(adaptiveCheckbox);
this.columnLabel = new UILabel(Inter.getLocText("Button-Group-Display-Columns") + ":"); this.columnLabel = new UILabel(Inter.getLocText("Button-Group-Display-Columns"));
this.add(columnLabel);
columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1)); columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
this.add(columnSpinner); pane.add(adaptiveCheckbox);
pane.add(columnLabel);
pane.add(columnSpinner);
this.add(pane);
} }
public void populate(ButtonGroup buttonGroup) { public void populate(ButtonGroup buttonGroup) {

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

@ -1,48 +1,62 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.*;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.CheckBox; import com.fr.form.ui.CheckBox;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UITextField text; private UITextField text;
public CheckBoxDefinePane() { public CheckBoxDefinePane() {
this.iniComoponents(); this.iniComoponents();
} }
private void iniComoponents() { private void iniComoponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); text = new UITextField(8);
JPanel textPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel panel = new JPanel(new BorderLayout());
textPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); panel.add(text, BorderLayout.CENTER);
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, textPane); panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0));
textPane.add(new UILabel(Inter.getLocText("Text") + ":"));
text = new UITextField(8); double f = TableLayout.FILL;
textPane.add(text); double p = TableLayout.PREFERRED;
this.add(uiExpandablePane); Component[][] components = new Component[][]{
} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), panel},
};
@Override double[] rowSize = {p};
protected String title4PopupWindow() { double[] columnSize = {p, f};
return "CheckBox"; int[][] rowCount = {{1, 1}};
} JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE);
@Override UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, pane);
public void populateBean(CheckBox check) { pane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15));
text.setText(check.getText());
} this.add(uiExpandablePane);
}
@Override
public CheckBox updateBean() { @Override
CheckBox box = new CheckBox(); protected String title4PopupWindow() {
box.setText(text.getText()); return "CheckBox";
return box; }
}
@Override
public void populateBean(CheckBox check) {
text.setText(check.getText());
}
@Override
public CheckBox updateBean() {
CheckBox box = new CheckBox();
box.setText(text.getText());
return box;
}
} }

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

@ -22,7 +22,7 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false); directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false);
directWriteCheckBox.setPreferredSize(new Dimension(100, 30)); directWriteCheckBox.setPreferredSize(new Dimension(100, 30));

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

@ -1,17 +1,13 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.*;
import java.util.List;
import javax.swing.BorderFactory;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -20,68 +16,114 @@ import com.fr.form.ui.IframeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> { public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private UITextField srcTextField;
private ReportletParameterViewPane parameterViewPane; private static final int P_W = 610;
private UICheckBox horizontalCheck; private static final int P_H = 580;
private UICheckBox verticalCheck; private UITextField srcTextField;
private ReportletParameterViewPane parameterViewPane;
public IframeEditorDefinePane() { private UICheckBox horizontalCheck;
this.initComponents(); private UICheckBox verticalCheck;
} private UIButton parameterViewPaneButton;
private List<ParameterProvider> list;
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); public IframeEditorDefinePane() {
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); this.initComponents();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); }
JPanel attr = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
attr.add(horizontalCheck = new UICheckBox(Inter.getLocText("Preference-Horizontal_Scroll_Bar_Visible"))); private void initComponents() {
attr.add(verticalCheck = new UICheckBox(Inter.getLocText("Preference-Vertical_Scroll_Bar_Visible"))); this.setLayout(FRGUIPaneFactory.createBorderLayout());
contentPane.add(attr); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
double p = TableLayout.PREFERRED; JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
double f = TableLayout.FILL; contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
double[] rowSize = { p, p, p, p }; JPanel attr = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
double[] columnSize = { p, f }; attr.add(horizontalCheck = new UICheckBox(Inter.getLocText("Preference-Horizontal_Scroll_Bar_Visible")));
attr.add(verticalCheck = new UICheckBox(Inter.getLocText("Preference-Vertical_Scroll_Bar_Visible")));
java.awt.Component[][] coms = { contentPane.add(attr);
{ horizontalCheck, null }, double p = TableLayout.PREFERRED;
{ verticalCheck, null }, double f = TableLayout.FILL;
{ new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() }, double[] rowSize = {p, p, p, p};
{ new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5); parameterViewPaneButton = new UIButton(Inter.getLocText("FR-Designer_Edit"));
parameterViewPaneButton.addActionListener(parameterListener);
parameterViewPane = new ReportletParameterViewPane();
contentPane.add(panel);
java.awt.Component[][] coms = {
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane); {horizontalCheck, null},
this.add(uiExpandablePane, BorderLayout.NORTH); {verticalCheck, null},
{new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UITextField()},
} {new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, 45, LayoutConstants.VGAP_LARGE);
@Override
protected String title4PopupWindow() {
return "iframe"; contentPane.add(panel);
}
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, contentPane);
@Override this.add(uiExpandablePane, BorderLayout.NORTH);
public void populateBean(IframeEditor e) {
srcTextField.setText(e.getSrc()); }
parameterViewPane.populate(e.getParameters());
this.horizontalCheck.setSelected(e.isOverflowx()); ActionListener parameterListener = new ActionListener() {
this.verticalCheck.setSelected(e.isOverflowy()); @Override
} public void actionPerformed(ActionEvent e) {
List<ParameterProvider> paraList = parameterViewPane.update();
@Override list = new ArrayList<ParameterProvider>();
public IframeEditor updateBean() { ParameterProvider pr = null;
IframeEditor ob = new IframeEditor(); for (ParameterProvider parameterProvider : paraList) {
ob.setSrc(srcTextField.getText()); try {
List<ParameterProvider> parameterList = parameterViewPane.update(); pr = (ParameterProvider) parameterProvider.clone();
ob.setParameters(parameterList.toArray(new ParameterProvider[parameterList.size()])); } catch (CloneNotSupportedException e1) {
ob.setOverflowx(this.horizontalCheck.isSelected()); e1.printStackTrace();
ob.setOverflowy(this.verticalCheck.isSelected()); }
return ob; list.add(pr);
} }
UIDialog dialog = parameterViewPane.showUnsizedWindow(SwingUtilities.getWindowAncestor(new JPanel()), new DialogActionListener() {
@Override
public void doOk() {
}
@Override
public void doCancel() {
parameterViewPane.update(list);
}
});
dialog.setSize(P_W, P_H);
dialog.setVisible(true);
}
};
@Override
protected String title4PopupWindow() {
return "iframe";
}
@Override
public void populateBean(IframeEditor e) {
srcTextField.setText(e.getSrc());
parameterViewPane.populate(e.getParameters());
this.horizontalCheck.setSelected(e.isOverflowx());
this.verticalCheck.setSelected(e.isOverflowy());
}
@Override
public IframeEditor updateBean() {
IframeEditor ob = new IframeEditor();
ob.setSrc(srcTextField.getText());
List<ParameterProvider> parameterList = parameterViewPane.update();
ob.setParameters(parameterList.toArray(new ParameterProvider[parameterList.size()]));
ob.setOverflowx(this.horizontalCheck.isSelected());
ob.setOverflowy(this.verticalCheck.isSelected());
return ob;
}
} }

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

@ -25,8 +25,8 @@ public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor
@Override @Override
protected JPanel setThirdContentPane() { protected JPanel setThirdContentPane() {
JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0();
JPanel centerPane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); JPanel centerPane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0();
centerPane.add(needHeadCheckBox = new UICheckBox(Inter.getLocText("List-Need_Head"))); centerPane.add(needHeadCheckBox = new UICheckBox(Inter.getLocText("List-Need_Head")));
contenter.add(centerPane); contenter.add(centerPane);
return contenter; return contenter;

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

@ -1,92 +1,82 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.*;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.*;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.DictionaryComboBox; import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants; import com.fr.design.gui.icombobox.DictionaryConstants;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.MultiFileEditor; import com.fr.form.ui.MultiFileEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor> { import javax.swing.*;
private DictionaryComboBox acceptType; import java.awt.*;
private UICheckBox singleFileCheckBox;
private UINumberField fileSizeField;
public MultiFileEditorPane() {
this.initComponents();
}
@Override
protected String title4PopupWindow() {
return "file";
}
@Override
protected JPanel setFirstContentPane() {
acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays);
acceptType.setPreferredSize(new Dimension(200, 18));
singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD"));
fileSizeField = new UINumberField();
fileSizeField.setPreferredSize(new Dimension(80, 18));
JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
singleFilePane.add(singleFileCheckBox);
JPanel allowTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
allowTypePane.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
allowTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
allowTypePane.add(new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":"));
allowTypePane.add(acceptType);
JPanel fileSizePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
fileSizePane.add(new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":"));
fileSizePane.add(fileSizeField);
fileSizePane.add(new UILabel(" KB"));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{singleFileCheckBox, null },
new Component[]{new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":"), acceptType},
new Component[]{new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":"), fileSizeField},
};
double[] rowSize = {p, p,p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5);
return panel;
}
@Override
protected void populateSubFieldEditorBean(MultiFileEditor e) {
// 这里存在兼容问题 getAccept可能没在待选项目中
acceptType.setSelectedItem(e.getAccept());
singleFileCheckBox.setSelected(e.isSingleFile());
fileSizeField.setValue(e.getMaxSize());
}
@Override public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor> {
protected MultiFileEditor updateSubFieldEditorBean() { private DictionaryComboBox acceptType;
MultiFileEditor ob = new MultiFileEditor(); private UICheckBox singleFileCheckBox;
ob.setAccept((String) acceptType.getSelectedItem()); private UISpinner fileSizeField;
ob.setSingleFile(singleFileCheckBox.isSelected());
ob.setMaxSize(fileSizeField.getValue()); public MultiFileEditorPane() {
return ob; this.initComponents();
} }
@Override
protected String title4PopupWindow() {
return "file";
}
@Override
protected JPanel setFirstContentPane() {
JPanel contenter = new JPanel(new BorderLayout());
singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD"));
acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays);
// acceptType.setPreferredSize(new Dimension(100, 20));
fileSizeField = new UISpinner(0, Integer.MAX_VALUE, 1, -1);
fileSizeField.setPreferredSize(new Dimension(140, 20));
JPanel fileSizePane = new JPanel(new BorderLayout());
UILabel fileTypeLabel = new UILabel(Inter.getLocText("Utils-File_type"));
UILabel fileSizeLabel = new UILabel(Inter.getLocText("FR-Designer_Size_Limit"));
fileSizePane.add(fileSizeField, BorderLayout.CENTER);
fileSizePane.add(new UILabel(" KB"), BorderLayout.EAST);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{singleFileCheckBox, null},
new Component[]{fileTypeLabel, acceptType},
new Component[]{fileSizeLabel, fileSizePane},
};
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 22, 10);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 00));
contenter.add(panel, BorderLayout.CENTER);
return contenter;
}
@Override
protected void populateSubFieldEditorBean(MultiFileEditor e) {
// 这里存在兼容问题 getAccept可能没在待选项目中
acceptType.setSelectedItem(e.getAccept());
singleFileCheckBox.setSelected(e.isSingleFile());
fileSizeField.setValue(e.getMaxSize());
}
@Override
protected MultiFileEditor updateSubFieldEditorBean() {
MultiFileEditor ob = new MultiFileEditor();
ob.setAccept((String) acceptType.getSelectedItem());
ob.setSingleFile(singleFileCheckBox.isSelected());
ob.setMaxSize(fileSizeField.getValue());
return ob;
}
} }

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

@ -3,11 +3,15 @@ package com.fr.design.widget.ui;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JFormattedTextField; import javax.swing.JFormattedTextField;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -26,7 +30,7 @@ import com.fr.general.Inter;
public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> { public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> {
/** /**
* * FieldEditorDefinePane
*/ */
private static final long serialVersionUID = 8011242951911686805L; private static final long serialVersionUID = 8011242951911686805L;
private UICheckBox allowDecimalsCheckBox; private UICheckBox allowDecimalsCheckBox;
@ -37,7 +41,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
private SpinnerNumberModel maxValueModel; private SpinnerNumberModel maxValueModel;
private UIBasicSpinner minValueSpinner; private UIBasicSpinner minValueSpinner;
private SpinnerNumberModel minValueModel; private SpinnerNumberModel minValueModel;
private com.fr.design.editor.editor.IntegerEditor decimalLength; private UIBasicSpinner decimalLength;
private JPanel limitNumberPane; private JPanel limitNumberPane;
private WaterMarkDictPane waterMarkDictPane; private WaterMarkDictPane waterMarkDictPane;
@ -78,7 +82,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}; };
private ActionListener actionListener3 = new ActionListener() { public ActionListener actionListener3 = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) { if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setVisible(true); maxValueSpinner.setVisible(true);
@ -142,7 +146,8 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}; };
public NumberEditorDefinePane() { public NumberEditorDefinePane() {
super(); // super();
this.initComponents();
} }
@ -166,46 +171,60 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
public JPanel setValidatePane() { public JPanel setValidatePane() {
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals")); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Decimals"));
this.decimalLength = new com.fr.design.editor.editor.IntegerEditor(); this.decimalLength = new UIBasicSpinner(new SpinnerNumberModel(16, 0, Integer.MAX_VALUE, 1));
this.decimalLength.setColumns(4); this.decimalLength.setPreferredSize(new Dimension(155, 20));
this.allowDecimalsCheckBox.addActionListener(actionListener1); this.allowDecimalsCheckBox.addActionListener(actionListener1);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative")); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Negative"));
this.allowNegativeCheckBox.addActionListener(actionListener2); this.allowNegativeCheckBox.addActionListener(actionListener2);
this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Max_Value"), false);
this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
maxValueSpinner.setPreferredSize(new Dimension(120, 20)); maxValueSpinner.setPreferredSize(new Dimension(155, 20));
setNotAllowsInvalid(this.maxValueSpinner); setNotAllowsInvalid(this.maxValueSpinner);
this.maxValueSpinner.setVisible(false); this.maxValueSpinner.setVisible(false);
this.setMaxValueCheckBox.addActionListener(actionListener3); this.setMaxValueCheckBox.addActionListener(actionListener3);
this.maxValueSpinner.addChangeListener(changeListener1); this.maxValueSpinner.addChangeListener(changeListener1);
this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("Need_Min_Value"), false); this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Min_Value"), false);
this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
minValueSpinner.setPreferredSize(new Dimension(120, 20)); minValueSpinner.setPreferredSize(new Dimension(155, 20));
setNotAllowsInvalid(this.minValueSpinner); setNotAllowsInvalid(this.minValueSpinner);
this.minValueSpinner.setVisible(false); this.minValueSpinner.setVisible(false);
this.setMinValueCheckBox.addActionListener(actionListener4); this.setMinValueCheckBox.addActionListener(actionListener4);
this.minValueSpinner.addChangeListener(changeListener2); this.minValueSpinner.addChangeListener(changeListener2);
UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"}));
numberLabel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel decimalPane = new JPanel(new BorderLayout());
decimalPane.add(decimalLength, BorderLayout.CENTER);
decimalPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel maxValueSpinnerPane = new JPanel(new BorderLayout());
maxValueSpinnerPane.add(maxValueSpinner, BorderLayout.CENTER);
maxValueSpinnerPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel minValueSpinnerPane = new JPanel(new BorderLayout());
minValueSpinnerPane.add(minValueSpinner, BorderLayout.CENTER);
minValueSpinnerPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{allowDecimalsCheckBox, null }, new Component[]{allowDecimalsCheckBox, null},
new Component[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"})), decimalLength }, new Component[]{numberLabel, decimalPane},
new Component[]{allowNegativeCheckBox, null}, new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinner}, new Component[]{setMaxValueCheckBox, maxValueSpinnerPane},
new Component[]{setMinValueCheckBox, minValueSpinner}, new Component[]{setMinValueCheckBox, minValueSpinnerPane},
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p,f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 1); JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
return panel; pane.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 0));
return pane;
} }
@ -250,7 +269,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
NumberEditor ob = new NumberEditor(); NumberEditor ob = new NumberEditor();
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); ob.setAllowDecimals(allowDecimalsCheckBox.isSelected());
if (allowDecimalsCheckBox.isSelected()) { if (allowDecimalsCheckBox.isSelected()) {
ob.setMaxDecimalLength(this.decimalLength.getValue()); ob.setMaxDecimalLength((Integer) this.decimalLength.getValue());
} }
ob.setAllowNegative(allowNegativeCheckBox.isSelected()); ob.setAllowNegative(allowNegativeCheckBox.isSelected());

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

@ -28,9 +28,9 @@ public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> {
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel centerPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
buttonGroupDictPane = new ButtonGroupDictPane(); buttonGroupDictPane = new ButtonGroupDictPane();
buttonGroupDictPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); buttonGroupDictPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
centerPane.add(buttonGroupDictPane); centerPane.add(buttonGroupDictPane);
return centerPane; return centerPane;
} }

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

@ -5,6 +5,9 @@ import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane; import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.FRLeftFlowLayout;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -46,13 +49,14 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
return this.setSecondContentPane(); return this.setSecondContentPane();
} }
protected JPanel setSecondContentPane() { protected JPanel setSecondContentPane() {
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0();
contentPane.add(contenter,BorderLayout.NORTH); contentPane.add(contenter,BorderLayout.NORTH);
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false); removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false);
contenter.add(removeRepeatCheckBox); contenter.add(removeRepeatCheckBox);

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

@ -39,7 +39,7 @@ public class WaterMarkDictPane extends JPanel {
int[][] rowCount = {{1, 1}}; int[][] rowCount = {{1, 1}};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
// JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM); // JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
} }

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

@ -15,7 +15,7 @@ public abstract class WritableRepeatEditorPane<E extends WriteAbleRepeatEditor>
@Override @Override
protected JPanel setSecondContentPane() { protected JPanel setSecondContentPane() {
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel otherContentPane = this.setThirdContentPane(); JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) { if (otherContentPane != null) {

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

@ -20,9 +20,8 @@ public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEdi
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createYBoxEmptyBorderPane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); JPanel contenter=FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0();
JPanel contenter=FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false); removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false);
contentPane.add(contenter); contentPane.add(contenter);
contenter.add(removeRepeatCheckBox); contenter.add(removeRepeatCheckBox);

35
designer/src/com/fr/quickeditor/CellQuickEditor.java

@ -2,7 +2,6 @@ package com.fr.quickeditor;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
@ -27,13 +26,13 @@ import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
* @author zhou * @author zhou, yaoh.wu
* @since 2012-7-23下午5:16:53 * @version 2017年8月7日16点54分
* @since 1.0
*/ */
public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> { public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
protected UITextField columnRowTextField; protected UITextField columnRowTextField;
private UIButton cellElementEditButton;
protected TemplateCellElement cellElement; protected TemplateCellElement cellElement;
protected UIComboBox comboBox; protected UIComboBox comboBox;
private UpdateAction[] cellInsertActions; private UpdateAction[] cellInsertActions;
@ -44,18 +43,38 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p, p, p}; double[] rowSize = {p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(" " + Inter.getLocText("Cell")), columnRowTextField = initColumnRowTextField()}, new Component[]{initTopContent(), null},
new Component[]{new UILabel(Inter.getLocText("HF-Insert_Content") + " "), initCellElementEditComboBox()},
new Component[]{createCenterBody(), null} new Component[]{createCenterBody(), null}
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); this.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
} }
private JPanel initTopContent() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p};
UILabel cellLabel = new UILabel(Inter.getLocText("Cell"));
cellLabel.setPreferredSize(new Dimension(60, 20));
UILabel insertContentLabel = new UILabel(Inter.getLocText("HF-Insert_Content"));
insertContentLabel.setPreferredSize(new Dimension(60, 20));
UIComboBox cellElementEditButton = initCellElementEditComboBox();
Component[][] components = new Component[][]{
new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()},
new Component[]{insertContentLabel, cellElementEditButton},
};
JPanel topContent = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
topContent.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
return topContent;
}
/** /**
* 初始化添加按钮 * 初始化添加按钮
* *

20
designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java

@ -1,6 +1,5 @@
package com.fr.quickeditor.cellquick; package com.fr.quickeditor.cellquick;
import com.fr.base.BaseUtils;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.BiasCellAction; import com.fr.design.actions.insert.cell.BiasCellAction;
import com.fr.design.cell.editor.BiasTextPainterCellEditor.BiasTextPainterPane; import com.fr.design.cell.editor.BiasTextPainterCellEditor.BiasTextPainterPane;
@ -8,34 +7,35 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.quickeditor.CellQuickEditor; import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.cell.painter.BiasTextPainter; import com.fr.report.cell.painter.BiasTextPainter;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
/** /**
* 单元格元素斜线编辑器 * 单元格元素斜线编辑器
* TODO 9.0 大体没有改动
*/ */
public class CellBiasTextPainterEditor extends CellQuickEditor { public class CellBiasTextPainterEditor extends CellQuickEditor {
@Override @Override
public JComponent createCenterBody() { public JComponent createCenterBody() {
UIButton editbutton = new UIButton(Inter.getLocText("Edit"), BaseUtils.readIcon("/com/fr/design/images/m_insert/bias.png")); JPanel content = new JPanel(new BorderLayout());
editbutton.addActionListener(new ActionListener() { content.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
UIButton editButton = new UIButton(Inter.getLocText("Edit"), IOUtils.readIcon("/com/fr/design/images/m_insert/bias.png"));
editButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
showEditingDialog(); showEditingDialog();
} }
}); });
editbutton.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); editButton.setOpaque(false);
editbutton.setMargin(null); content.add(editButton, BorderLayout.CENTER);
editbutton.setOpaque(false); return content;
return editbutton;
} }
@Override @Override
@ -63,8 +63,6 @@ public class CellBiasTextPainterEditor extends CellQuickEditor {
@Override @Override
protected void refreshDetails() { protected void refreshDetails() {
// TODO Auto-generated method stub
} }
} }

955
designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

File diff suppressed because it is too large Load Diff

152
designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java

@ -0,0 +1,152 @@
package com.fr.quickeditor.cellquick;
import com.fr.base.Formula;
import com.fr.base.Style;
import com.fr.base.TextFormat;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.grid.selection.CellSelection;
import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.ReportHelper;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.stable.ColumnRow;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
/**
* 公式快速编辑面板同文本数字编辑拆分
*
* @author yaoh.wu
* @version 2017年8月7日10点44分
* @since 9.0
*/
public class CellFormulaQuickEditor extends CellQuickEditor {
//文本域
private UITextField stringTextField;
//编辑状态
private boolean isEditing = false;
//编辑的是公式,要保留公式里的这些属性,不然在公式和字符串转化时,就会丢失这些属性设置。
private boolean reserveInResult = false;
private boolean reserveOnWriteOrAnaly = true;
private DocumentListener documentListener = new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
changeReportPaneCell(stringTextField.getText().trim());
}
@Override
public void removeUpdate(DocumentEvent e) {
changeReportPaneCell(stringTextField.getText().trim());
}
@Override
public void changedUpdate(DocumentEvent e) {
changeReportPaneCell(stringTextField.getText().trim());
}
};
private CellFormulaQuickEditor() {
super();
}
/**
* 详细信息面板
*/
@Override
public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
content.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
stringTextField = new UITextField();
stringTextField.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
if (tc != null) {
tc.getGrid().dispatchEvent(e);
}
}
});
content.add(stringTextField, BorderLayout.CENTER);
return content;
}
private void changeReportPaneCell(String tmpText) {
isEditing = true;
//refresh一下,如果单元格内有新添加的控件,此时并不知道
CellSelection cs1 = (CellSelection) tc.getSelection();
ColumnRow columnRow = ColumnRow.valueOf(cs1.getColumn(), cs1.getRow());
columnRowTextField.setText(columnRow.toString());
cellElement = tc.getEditingElementCase().getTemplateCellElement(cs1.getColumn(), cs1.getRow());
if (cellElement == null) {
CellSelection cs = (CellSelection) tc.getSelection();
cellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
tc.getEditingElementCase().addCellElement(cellElement, false);
}
if (tmpText != null && (tmpText.length() > 0 && tmpText.charAt(0) == '=')) {
Formula textFormula = new Formula(tmpText);
textFormula.setReserveInResult(reserveInResult);
textFormula.setReserveOnWriteOrAnaly(reserveOnWriteOrAnaly);
cellElement.setValue(textFormula);
} else {
Style style = cellElement.getStyle();
if (style != null && style.getFormat() != null && style.getFormat() == TextFormat.getInstance()) {
cellElement.setValue(tmpText);
} else {
cellElement.setValue(ReportHelper.convertGeneralStringAccordingToExcel(tmpText));
}
}
fireTargetModified();
stringTextField.requestFocus();
isEditing = false;
}
/**
* 刷新详细内容
*/
@Override
protected void refreshDetails() {
String str;
if (cellElement == null) {
str = StringUtils.EMPTY;
} else {
Object value = cellElement.getValue();
if (value == null) {
str = StringUtils.EMPTY;
} else if (value instanceof Formula) {
Formula formula = (Formula) value;
str = formula.getContent();
reserveInResult = formula.isReserveInResult();
reserveOnWriteOrAnaly = formula.isReserveOnWriteOrAnaly();
} else {
str = value.toString();
}
}
showText(str);
stringTextField.setEditable(tc.isSelectedOneCell());
}
/**
* 显示文本
*
* @param str 文本
*/
public void showText(String str) {
// 正在编辑时不处理
if (isEditing) {
return;
}
stringTextField.getDocument().removeDocumentListener(documentListener);
stringTextField.setText(str);
stringTextField.getDocument().addDocumentListener(documentListener);
}
}

32
designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java

@ -1,6 +1,5 @@
package com.fr.quickeditor.cellquick; package com.fr.quickeditor.cellquick;
import com.fr.base.BaseUtils;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.ImageCellAction; import com.fr.design.actions.insert.cell.ImageCellAction;
@ -9,27 +8,23 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.report.SelectImagePane; import com.fr.design.report.SelectImagePane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.quickeditor.CellQuickEditor; import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.cell.cellattr.CellImage; import com.fr.report.cell.cellattr.CellImage;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
/** /**
* 单元格元素图片编辑器 * 单元格元素图片编辑器
* TODO 9.0大体上没有改动 *
* @author yaoh.wu
* @version 2017年8月7日10点53分
*/ */
public class CellImageQuickEditor extends CellQuickEditor { public class CellImageQuickEditor extends CellQuickEditor {
private static CellImageQuickEditor THIS;
public static final CellImageQuickEditor getInstance() {
if (THIS == null) {
THIS = new CellImageQuickEditor();
}
return THIS;
}
private CellImageQuickEditor() { private CellImageQuickEditor() {
super(); super();
@ -37,27 +32,27 @@ public class CellImageQuickEditor extends CellQuickEditor {
@Override @Override
public JComponent createCenterBody() { public JComponent createCenterBody() {
UIButton editbutton = new UIButton(Inter.getLocText("Edit"), BaseUtils.readIcon("/com/fr/design/images/m_insert/image.png")); JPanel content = new JPanel(new BorderLayout());
editbutton.addActionListener(new ActionListener() { content.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
UIButton editButton = new UIButton(Inter.getLocText("Edit"), IOUtils.readIcon("/com/fr/design/images/m_insert/image.png"));
editButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
showEditingDialog(); showEditingDialog();
} }
}); });
editbutton.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); editButton.setOpaque(false);
editbutton.setMargin(null); content.add(editButton, BorderLayout.CENTER);
editbutton.setOpaque(false); return content;
return editbutton;
} }
@SuppressWarnings("Duplicates")
private void showEditingDialog() { private void showEditingDialog() {
final SelectImagePane imageEditorPane = new SelectImagePane(); final SelectImagePane imageEditorPane = new SelectImagePane();
imageEditorPane.populate(cellElement); imageEditorPane.populate(cellElement);
final Object oldValue = cellElement.getValue(); final Object oldValue = cellElement.getValue();
final Style oldStyle = cellElement.getStyle(); final Style oldStyle = cellElement.getStyle();
imageEditorPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { imageEditorPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
CellImage cellImage = imageEditorPane.update(); CellImage cellImage = imageEditorPane.update();
@ -67,7 +62,6 @@ public class CellImageQuickEditor extends CellQuickEditor {
fireTargetModified(); fireTargetModified();
} }
} }
}).setVisible(true); }).setVisible(true);
} }

36
designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java

@ -7,38 +7,30 @@ import com.fr.general.Inter;
import com.fr.quickeditor.CellQuickEditor; import com.fr.quickeditor.CellQuickEditor;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
/** /**
* 单元格元素富文本编辑器 * 单元格元素富文本编辑器
* TODO 9.0 大体上没有改动 *
* @author yaoh.wu
* @version 2017年8月7日10点53分
*/ */
public class CellRichTextEditor extends CellQuickEditor { public class CellRichTextEditor extends CellQuickEditor {
private UIButton subReportButton; private UIButton richTextButton;
private static CellRichTextEditor THIS;
public static final CellRichTextEditor getInstance() {
if (THIS == null) {
THIS = new CellRichTextEditor();
}
return THIS;
}
private CellRichTextEditor() { private CellRichTextEditor() {
super(); super();
} }
/** @SuppressWarnings("Duplicates")
* 创建界面上中间的部分 @Override
*
* @return 界面元素
* @date 2014-12-7-下午9:41:52
*/
public JComponent createCenterBody() { public JComponent createCenterBody() {
subReportButton = new UIButton(); JPanel content = new JPanel(new BorderLayout());
subReportButton.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); content.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
subReportButton.setMargin(null); richTextButton = new UIButton();
subReportButton.setOpaque(false); richTextButton.setOpaque(false);
return subReportButton; content.add(richTextButton, BorderLayout.CENTER);
return content;
} }
@Override @Override
@ -50,7 +42,7 @@ public class CellRichTextEditor extends CellQuickEditor {
protected void refreshDetails() { protected void refreshDetails() {
RichTextCellAction subReportCellAction = new RichTextCellAction(tc); RichTextCellAction subReportCellAction = new RichTextCellAction(tc);
subReportCellAction.setName(Inter.getLocText("FR-Designer_RichTextEditor")); subReportCellAction.setName(Inter.getLocText("FR-Designer_RichTextEditor"));
subReportButton.setAction(subReportCellAction); richTextButton.setAction(subReportCellAction);
} }
} }

15
designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java

@ -16,6 +16,7 @@ import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -23,6 +24,7 @@ import java.awt.event.KeyEvent;
* *
*/ */
public class CellStringQuickEditor extends CellQuickEditor { public class CellStringQuickEditor extends CellQuickEditor {
private Object selectedItem; private Object selectedItem;
//instance //instance
private static CellStringQuickEditor THIS; private static CellStringQuickEditor THIS;
@ -32,12 +34,6 @@ public class CellStringQuickEditor extends CellQuickEditor {
//编辑状态 //编辑状态
private boolean isEditing = false; private boolean isEditing = false;
public static CellStringQuickEditor getInstance() {
if (THIS == null) {
THIS = new CellStringQuickEditor();
}
return THIS;
}
//august:如果是原来编辑的是公式,要保留公式里的这些属性,不然在公式和字符串转化时,就会丢失这些属性设置。 //august:如果是原来编辑的是公式,要保留公式里的这些属性,不然在公式和字符串转化时,就会丢失这些属性设置。
private boolean reserveInResult = false; private boolean reserveInResult = false;
@ -67,10 +63,12 @@ public class CellStringQuickEditor extends CellQuickEditor {
/** /**
* 详细信息面板 * 详细信息面板
* todo 文本框可自适应大小公式编辑也是在这边如果是公式那么要加一个公式编辑器的触发按钮 * todo 文本框可自适应大小公式编辑新写一个
*/ */
@Override @Override
public JComponent createCenterBody() { public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
content.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
stringTextField = new UITextField(); stringTextField = new UITextField();
stringTextField.addKeyListener(new KeyAdapter() { stringTextField.addKeyListener(new KeyAdapter() {
@Override @Override
@ -80,7 +78,8 @@ public class CellStringQuickEditor extends CellQuickEditor {
} }
} }
}); });
return stringTextField; content.add(stringTextField, BorderLayout.CENTER);
return content;
} }

20
designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java

@ -7,33 +7,31 @@ import com.fr.general.Inter;
import com.fr.quickeditor.CellQuickEditor; import com.fr.quickeditor.CellQuickEditor;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
/** /**
* 单元格元素子报表编辑器 * 单元格元素子报表编辑器
* TODO 9.0大体上没有改动 *
* @author yaoh.wu
* @version 2017年8月7日10点53分
*/ */
public class CellSubReportEditor extends CellQuickEditor { public class CellSubReportEditor extends CellQuickEditor {
private UIButton subReportButton; private UIButton subReportButton;
private static CellSubReportEditor THIS;
public static final CellSubReportEditor getInstance() {
if (THIS == null) {
THIS = new CellSubReportEditor();
}
return THIS;
}
private CellSubReportEditor() { private CellSubReportEditor() {
super(); super();
} }
@SuppressWarnings("Duplicates")
@Override @Override
public JComponent createCenterBody() { public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
content.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
subReportButton = new UIButton(); subReportButton = new UIButton();
subReportButton.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
subReportButton.setMargin(null);
subReportButton.setOpaque(false); subReportButton.setOpaque(false);
return subReportButton; content.add(subReportButton, BorderLayout.CENTER);
return content;
} }
@Override @Override

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

@ -154,7 +154,7 @@ public interface UIConstants {
public static final Color BARNOMAL = new Color(232, 232, 233); public static final Color BARNOMAL = new Color(232, 232, 233);
public static final Color COMPONENT_BACKGROUND_COLOR = new Color(237,237,238); public static final Color COMPONENT_BACKGROUND_COLOR = new Color(237,237,238);
public static final int ARC = 0; public static final int ARC = 0;
public static final int BUTTON_GROUP_ARC = 6; public static final int BUTTON_GROUP_ARC = 0;
public static final int LARGEARC = 6; public static final int LARGEARC = 6;
public static final Stroke BS = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 2f, new float[]{3, 1}, 0); public static final Stroke BS = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 2f, new float[]{3, 1}, 0);
public static final Icon PREVIEW_DOWN = BaseUtils.readIcon("com/fr/design/images/buttonicon/prevew_down_icon.png"); public static final Icon PREVIEW_DOWN = BaseUtils.readIcon("com/fr/design/images/buttonicon/prevew_down_icon.png");

183
designer_base/src/com/fr/design/gui/frpane/ReportletParameterViewPane.java

@ -23,115 +23,124 @@ import java.util.List;
/** /**
* Defin hyperlink. * Defin hyperlink.
* in fact,this is a TablEditorPane * in fact,this is a TablEditorPane
*
* @editor zhou * @editor zhou
* @since 2012-3-23下午3:48:10 * @since 2012-3-23下午3:48:10
*/ */
public class ReportletParameterViewPane extends BasicPane { public class ReportletParameterViewPane extends BasicPane {
private UITableEditorPane<ParameterProvider> editorPane; private UITableEditorPane<ParameterProvider> editorPane;
public ReportletParameterViewPane() { public ReportletParameterViewPane() {
this(null, ParameterTableModel.NO_CHART_USE); this(null, ParameterTableModel.NO_CHART_USE);
} }
// kunsnat: 控制是否用Chart的热点链接actions // kunsnat: 控制是否用Chart的热点链接actions
public ReportletParameterViewPane(int useParaType) { public ReportletParameterViewPane(int useParaType) {
this(null, useParaType); this(null, useParaType);
} }
public ReportletParameterViewPane(UITableEditAction[] actions, int useParaType) { public ReportletParameterViewPane(UITableEditAction[] actions, int useParaType) {
this(actions, useParaType, ValueEditorPaneFactory.createVallueEditorPaneWithUseType(useParaType), this(actions, useParaType, ValueEditorPaneFactory.createVallueEditorPaneWithUseType(useParaType),
ValueEditorPaneFactory.createVallueEditorPaneWithUseType(useParaType)); ValueEditorPaneFactory.createVallueEditorPaneWithUseType(useParaType));
} }
public ReportletParameterViewPane(int useParaType, ValueEditorPane valueEditorPane, ValueEditorPane valueRenderPane) { public ReportletParameterViewPane(int useParaType, ValueEditorPane valueEditorPane, ValueEditorPane valueRenderPane) {
this(null, useParaType, valueEditorPane, valueRenderPane); this(null, useParaType, valueEditorPane, valueRenderPane);
} }
public ReportletParameterViewPane(UITableEditAction[] actions, int useParaType, ValueEditorPane valueEditorPane, ValueEditorPane valueRenderPane) { public ReportletParameterViewPane(UITableEditAction[] actions, int useParaType, ValueEditorPane valueEditorPane, ValueEditorPane valueRenderPane) {
this.initComponent(actions, useParaType, valueEditorPane, valueRenderPane); this.initComponent(actions, useParaType, valueEditorPane, valueRenderPane);
} }
/** /**
* 初始化组件 * 初始化组件
* @param actions Chart的热点链接actions *
* @param useParaType 类型 * @param actions Chart的热点链接actions
* @param useParaType 类型
*/ */
public void initComponent(final UITableEditAction[] actions, int useParaType, ValueEditorPane valueEditorPane, ValueEditorPane valueRenderPane) { public void initComponent(final UITableEditAction[] actions, int useParaType, ValueEditorPane valueEditorPane, ValueEditorPane valueRenderPane) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
if (useParaType != ParameterTableModel.NO_CHART_USE) { if (useParaType != ParameterTableModel.NO_CHART_USE) {
ParameterTableModel model = new ParameterTableModel(valueEditorPane, valueRenderPane, this) { ParameterTableModel model = new ParameterTableModel(valueEditorPane, valueRenderPane, this) {
@Override @Override
public UITableEditAction[] createAction() { public UITableEditAction[] createAction() {
UITableEditAction[] tableEditActions = new UITableEditAction[] { new AddChartParameterAction(), new DeleteAction(this.component), UITableEditAction[] tableEditActions = new UITableEditAction[]{new AddChartParameterAction(), new DeleteAction(this.component),
new MoveUpAction(), new MoveDownAction() }; new MoveUpAction(), new MoveDownAction()};
return (UITableEditAction[]) ArrayUtils.addAll(tableEditActions, actions); return (UITableEditAction[]) ArrayUtils.addAll(tableEditActions, actions);
} }
}; };
editorPane = new UITableEditorPane<ParameterProvider>(model); editorPane = new UITableEditorPane<ParameterProvider>(model);
} else { } else {
editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel() { editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel() {
@Override @Override
public UITableEditAction[] createAction() { public UITableEditAction[] createAction() {
return (UITableEditAction[]) ArrayUtils.addAll(super.createAction(), actions); return (UITableEditAction[]) ArrayUtils.addAll(super.createAction(), actions);
} }
}); });
} }
this.add(editorPane, BorderLayout.CENTER); this.add(editorPane, BorderLayout.CENTER);
} }
/** /**
* 增加事件监听 * 增加事件监听
* @param l 加的东东 *
* @param l 加的东东
*/ */
public void addTableEditorListener(TableModelListener l) { public void addTableEditorListener(TableModelListener l) {
editorPane.addTableListener(l); editorPane.addTableListener(l);
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("Parameters"); return Inter.getLocText("Parameters");
} }
public void populate(ParameterProvider[] parameters) { public void populate(ParameterProvider[] parameters) {
if (parameters == null) { if (parameters == null) {
return; return;
} }
editorPane.populate(parameters); editorPane.populate(parameters);
} }
public void populate(KV[] kv) { public void populate(KV[] kv) {
if (kv == null) { if (kv == null) {
return; return;
} }
Parameter[] parameters = new Parameter[kv.length]; Parameter[] parameters = new Parameter[kv.length];
for (int i = 0; i < kv.length; i++) { for (int i = 0; i < kv.length; i++) {
parameters[i] = new Parameter(kv[i].getKey(), kv[i].getValue()); parameters[i] = new Parameter(kv[i].getKey(), kv[i].getValue());
} }
this.populate(parameters); this.populate(parameters);
} }
public List<ParameterProvider> update() { public List<ParameterProvider> update() {
return editorPane.update(); return editorPane.update();
} }
public void update(List list) {
editorPane.update(list);
}
/** /**
* 更新 * 更新
* @return 数组 *
* @return 数组
*/ */
public KV[] updateKV() { public KV[] updateKV() {
List<ParameterProvider> list = this.update(); List<ParameterProvider> list = this.update();
int length = list.size(); int length = list.size();
KV[] kv = new KV[length]; KV[] kv = new KV[length];
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
kv[i] = new KV(); kv[i] = new KV();
kv[i].setKey(list.get(i).getName()); kv[i].setKey(list.get(i).getName());
kv[i].setValue( list.get(i).getValue()); kv[i].setValue(list.get(i).getValue());
} }
return kv; return kv;
} }
} }

1
designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java

@ -52,6 +52,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
private void initComponents(boolean isEditor) { private void initComponents(boolean isEditor) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel buildWayPanel= FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); JPanel buildWayPanel= FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
buildWayPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
UILabel buildWayLabel = new UILabel(Inter.getLocText("FR-Designer_Build-Way") + " :"); UILabel buildWayLabel = new UILabel(Inter.getLocText("FR-Designer_Build-Way") + " :");
buildWayPanel.add(buildWayLabel); buildWayPanel.add(buildWayLabel);
buildBox = new UIComboBox(buildWay); buildBox = new UIComboBox(buildWay);

3
designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java

@ -153,14 +153,13 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
} }
protected void initButton(UIToggleButton labelButton) { protected void initButton(UIToggleButton labelButton) {
labelButton.setRoundBorder(true);
labelButton.setBorderPainted(false); labelButton.setBorderPainted(false);
labelButtonList.add(labelButton); labelButtonList.add(labelButton);
this.add(labelButton); this.add(labelButton);
} }
protected Border getGroupBorder() { protected Border getGroupBorder() {
return BorderFactory.createEmptyBorder(1, 1, 1, 1); return BorderFactory.createEmptyBorder(0, 0, 0, 0);
} }
protected LayoutManager getGridLayout(int number) { protected LayoutManager getGridLayout(int number) {

177
designer_base/src/com/fr/design/gui/itableeditorpane/UITableEditorPane.java

@ -1,12 +1,12 @@
package com.fr.design.gui.itableeditorpane; package com.fr.design.gui.itableeditorpane;
import com.fr.design.constants.UIConstants;
import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
@ -21,51 +21,51 @@ import java.util.List;
* @since 2012-3-28下午3:06:30 * @since 2012-3-28下午3:06:30
*/ */
public class UITableEditorPane<T> extends BasicPane { public class UITableEditorPane<T> extends BasicPane {
/** /**
* *
*/ */
private static final long serialVersionUID = 6855793816972735815L; private static final long serialVersionUID = 6855793816972735815L;
private JTable editTable; private JTable editTable;
// 放置action 的按钮. // 放置action 的按钮.
private UITableModelAdapter<T> tableModel; private UITableModelAdapter<T> tableModel;
private String leftLabelName; private String leftLabelName;
private JPanel buttonPane; private JPanel buttonPane;
public UITableEditorPane(UITableModelAdapter<T> model) { public UITableEditorPane(UITableModelAdapter<T> model) {
this.tableModel = model; this.tableModel = model;
this.initComponent(model.createAction()); this.initComponent(model.createAction());
} }
public UITableEditorPane(UITableModelAdapter<T> model, String s) { public UITableEditorPane(UITableModelAdapter<T> model, String s) {
leftLabelName = s; leftLabelName = s;
this.tableModel = model; this.tableModel = model;
this.initComponent(model.createAction()); this.initComponent(model.createAction());
} }
private void initComponent(UITableEditAction[] action) { private void initComponent(UITableEditAction[] action) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel pane = new JPanel(new BorderLayout(4, 4)); JPanel pane = new JPanel(new BorderLayout(4, 4));
this.add(pane, BorderLayout.CENTER); this.add(pane, BorderLayout.CENTER);
UILabel l = new UILabel(leftLabelName); UILabel l = new UILabel(leftLabelName);
editTable = tableModel.createTable(); editTable = tableModel.createTable();
UIScrollPane scrollPane = new UIScrollPane(editTable); UIScrollPane scrollPane = new UIScrollPane(editTable);
scrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); scrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
pane.add(scrollPane, BorderLayout.CENTER); pane.add(scrollPane, BorderLayout.CENTER);
initbuttonPane(action); initbuttonPane(action);
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
controlPane.add(buttonPane, BorderLayout.EAST); controlPane.add(buttonPane, BorderLayout.EAST);
controlPane.add(l, BorderLayout.WEST); controlPane.add(l, BorderLayout.WEST);
pane.add(controlPane, BorderLayout.NORTH); pane.add(controlPane, BorderLayout.NORTH);
} }
public UITableModelAdapter<T> getTableModel(){ public UITableModelAdapter<T> getTableModel() {
return tableModel; return tableModel;
} }
private void initbuttonPane(UITableEditAction[] action){ private void initbuttonPane(UITableEditAction[] action) {
buttonPane = new JPanel(); buttonPane = new JPanel();
if (action != null) { if (action != null) {
@ -87,54 +87,61 @@ public class UITableEditorPane<T> extends BasicPane {
/** /**
* 增加事件监听 * 增加事件监听
* @param l 加的东东 *
* @param l 加的东东
*/ */
public void addTableListener(TableModelListener l) { public void addTableListener(TableModelListener l) {
tableModel.addTableModelListener(l); tableModel.addTableModelListener(l);
} }
/** /**
* 移除事件监听 * 移除事件监听
* @param l 去的东东 *
* @param l 去的东东
*/ */
public void removeTableListener(TableModelListener l) { public void removeTableListener(TableModelListener l) {
tableModel.removeTableModelListener(l); tableModel.removeTableModelListener(l);
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("TableData_Dynamic_Parameter_Setting"); return Inter.getLocText("TableData_Dynamic_Parameter_Setting");
} }
public void populate(T[] objs) { public void populate(T[] objs) {
tableModel.clear(); tableModel.clear();
if(objs==null){ if (objs == null) {
return; return;
} }
for (T obj : objs) { for (T obj : objs) {
tableModel.addRow(obj); tableModel.addRow(obj);
} }
this.tableModel.fireTableDataChanged(); this.tableModel.fireTableDataChanged();
if (objs.length > 0) { if (objs.length > 0) {
this.editTable.getSelectionModel().setSelectionInterval(0, 0); this.editTable.getSelectionModel().setSelectionInterval(0, 0);
} }
} }
// TODO:august这个最好还是返回数组 // TODO:august这个最好还是返回数组
public List<T> update() { public List<T> update() {
tableModel.stopCellEditing(); tableModel.stopCellEditing();
return tableModel.getList(); return tableModel.getList();
} }
public int getSelectedRow() { public void update(List list) {
return this.editTable.getSelectedRow(); tableModel.stopCellEditing();
} tableModel.setList(list);
}
public int getSelectedColumn() {
return this.editTable.getSelectedColumn(); public int getSelectedRow() {
} return this.editTable.getSelectedRow();
}
public JPanel getbuttonPane(){
public int getSelectedColumn() {
return this.editTable.getSelectedColumn();
}
public JPanel getbuttonPane() {
return buttonPane; return buttonPane;
} }

44
designer_base/src/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java

@ -9,7 +9,6 @@ import javax.swing.JPanel;
import com.fr.data.impl.TreeAttr; import com.fr.data.impl.TreeAttr;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -18,10 +17,10 @@ public class TreeRootPane extends BasicPane {
// 是否支持多选(checkBoxTree) // 是否支持多选(checkBoxTree)
//private JCheckBox multipleSelection; //private JCheckBox multipleSelection;
private UIComboBox checkTypeComboBox; private UICheckBox checkTypeCheckBox;
// richer:加载的方式,支持异步加载和完全加载 // richer:加载的方式,支持异步加载和完全加载
private UIComboBox loadTypeComboBox; private UICheckBox loadTypeCheckBox;
private UICheckBox layerTypeCheckBox; private UICheckBox layerTypeCheckBox;
@ -30,31 +29,26 @@ public class TreeRootPane extends BasicPane {
public TreeRootPane() { public TreeRootPane() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
JPanel checkTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel checkTypePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
checkTypePane.add(new UILabel(Inter.getLocText("Tree-Mutiple_Selection_Or_Not") + ":")); checkTypeCheckBox = new UICheckBox(Inter.getLocText("Tree-Mutiple_Selection_Or_Not"));
checkTypeComboBox = new UIComboBox(new String[] {Inter.getLocText("Yes"), Inter.getLocText("No")}); checkTypePane.add(checkTypeCheckBox);
checkTypePane.add(checkTypeComboBox);
this.add(checkTypePane); this.add(checkTypePane);
JPanel loadTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel loadTypePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
loadTypePane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
loadTypePane.add(new UILabel(Inter.getLocText("Widget-Load_Type") + ":")); loadTypeCheckBox = new UICheckBox(Inter.getLocText("Widget-Load_By_Async"));
loadTypeComboBox = new UIComboBox(new String[]{Inter.getLocText("Widget-Load_By_Async"), Inter.getLocText("Widget-Load_By_Complete")}); loadTypePane.add(loadTypeCheckBox);
loadTypePane.add(loadTypeComboBox);
this.add(loadTypePane); this.add(loadTypePane);
JPanel leafSelectPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel leafSelectPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
leafSelectPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
leafSelectPane.add(layerTypeCheckBox = new UICheckBox(Inter.getLocText("Tree-Select_Leaf_Only"))); leafSelectPane.add(layerTypeCheckBox = new UICheckBox(Inter.getLocText("Tree-Select_Leaf_Only")));
UILabel tips = new UILabel(Inter.getLocText("Tree-Select_Leaf_Only_Tips"));
tips.setForeground(new Color(147, 178, 233));
leafSelectPane.add(tips);
this.add(leafSelectPane); this.add(leafSelectPane);
JPanel returnFullPathPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel returnFullPathPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
returnFullPathPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
returnFullPathPane.add(returnFullPathCheckBox = new UICheckBox(Inter.getLocText("Tree-Return_Full_Path"))); returnFullPathPane.add(returnFullPathCheckBox = new UICheckBox(Inter.getLocText("Tree-Return_Full_Path")));
this.add(returnFullPathPane); this.add(returnFullPathPane);
} }
@ -65,16 +59,16 @@ public class TreeRootPane extends BasicPane {
} }
public void populate(TreeAttr treeAttr) { public void populate(TreeAttr treeAttr) {
checkTypeComboBox.setSelectedIndex(treeAttr.isMultipleSelection() ? 0 : 1); checkTypeCheckBox.setSelected(treeAttr.isMultipleSelection());
loadTypeComboBox.setSelectedIndex(treeAttr.isAjax() ? 0 : 1); loadTypeCheckBox.setSelected(treeAttr.isAjax());
layerTypeCheckBox.setSelected(treeAttr.isSelectLeafOnly()); layerTypeCheckBox.setSelected(treeAttr.isSelectLeafOnly());
returnFullPathCheckBox.setSelected(treeAttr.isReturnFullPath()); returnFullPathCheckBox.setSelected(treeAttr.isReturnFullPath());
} }
public TreeAttr update() { public TreeAttr update() {
TreeAttr treeAttr = new TreeAttr(); TreeAttr treeAttr = new TreeAttr();
treeAttr.setMultipleSelection(checkTypeComboBox.getSelectedIndex() == 0); treeAttr.setMultipleSelection(checkTypeCheckBox.isSelected());
treeAttr.setAjax(loadTypeComboBox.getSelectedIndex() == 0); treeAttr.setAjax(loadTypeCheckBox.isSelected());
treeAttr.setSelectLeafOnly(layerTypeCheckBox.isSelected()); treeAttr.setSelectLeafOnly(layerTypeCheckBox.isSelected());
treeAttr.setReturnFullPath(returnFullPathCheckBox.isSelected()); treeAttr.setReturnFullPath(returnFullPathCheckBox.isSelected());

BIN
designer_base/src/com/fr/design/images/arrow/arrow_down.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

After

Width:  |  Height:  |  Size: 278 B

BIN
designer_base/src/com/fr/design/images/arrow/arrow_up.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

After

Width:  |  Height:  |  Size: 311 B

BIN
designer_base/src/com/fr/design/images/buttonicon/add.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 453 B

After

Width:  |  Height:  |  Size: 160 B

BIN
designer_base/src/com/fr/design/images/buttonicon/add_press.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 306 B

BIN
designer_base/src/com/fr/design/images/buttonicon/addicon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

After

Width:  |  Height:  |  Size: 232 B

BIN
designer_base/src/com/fr/design/images/buttonicon/cube.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 688 B

After

Width:  |  Height:  |  Size: 500 B

BIN
designer_base/src/com/fr/design/images/buttonicon/editp.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

After

Width:  |  Height:  |  Size: 802 B

BIN
designer_base/src/com/fr/design/images/buttonicon/hiden.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
designer_base/src/com/fr/design/images/buttonicon/hidep.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
designer_base/src/com/fr/design/images/buttonicon/minus.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

After

Width:  |  Height:  |  Size: 148 B

BIN
designer_base/src/com/fr/design/images/buttonicon/newcpts.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 218 B

BIN
designer_base/src/com/fr/design/images/buttonicon/open.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 356 B

BIN
designer_base/src/com/fr/design/images/buttonicon/pageb24.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

After

Width:  |  Height:  |  Size: 736 B

BIN
designer_base/src/com/fr/design/images/buttonicon/pages.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 B

After

Width:  |  Height:  |  Size: 482 B

BIN
designer_base/src/com/fr/design/images/buttonicon/plus.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

After

Width:  |  Height:  |  Size: 172 B

BIN
designer_base/src/com/fr/design/images/buttonicon/redo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 424 B

After

Width:  |  Height:  |  Size: 421 B

BIN
designer_base/src/com/fr/design/images/buttonicon/refresh.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 533 B

After

Width:  |  Height:  |  Size: 530 B

BIN
designer_base/src/com/fr/design/images/buttonicon/run24.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 389 B

BIN
designer_base/src/com/fr/design/images/buttonicon/undo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 453 B

After

Width:  |  Height:  |  Size: 450 B

BIN
designer_base/src/com/fr/design/images/buttonicon/writeb24.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 975 B

After

Width:  |  Height:  |  Size: 972 B

BIN
designer_base/src/com/fr/design/images/buttonicon/writes.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 479 B

After

Width:  |  Height:  |  Size: 541 B

BIN
designer_base/src/com/fr/design/images/chart/ChartStyle.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 309 B

BIN
designer_base/src/com/fr/design/images/chart/ChartType.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 B

After

Width:  |  Height:  |  Size: 151 B

BIN
designer_base/src/com/fr/design/images/chart/InterAttr.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 641 B

After

Width:  |  Height:  |  Size: 555 B

BIN
designer_base/src/com/fr/design/images/control/addPopup.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 B

After

Width:  |  Height:  |  Size: 257 B

BIN
designer_base/src/com/fr/design/images/control/bar.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 99 B

BIN
designer_base/src/com/fr/design/images/control/copy.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 214 B

BIN
designer_base/src/com/fr/design/images/control/edit.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 399 B

BIN
designer_base/src/com/fr/design/images/control/remove.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 B

After

Width:  |  Height:  |  Size: 511 B

BIN
designer_base/src/com/fr/design/images/dashboard/files.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 238 B

BIN
designer_base/src/com/fr/design/images/data/bind/distanceconnect.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 728 B

After

Width:  |  Height:  |  Size: 650 B

BIN
designer_base/src/com/fr/design/images/data/bind/localconnect.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 303 B

BIN
designer_base/src/com/fr/design/images/data/dataDictionary.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

After

Width:  |  Height:  |  Size: 167 B

BIN
designer_base/src/com/fr/design/images/data/dataTable.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 B

After

Width:  |  Height:  |  Size: 254 B

BIN
designer_base/src/com/fr/design/images/data/dock/serverdatabase.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 B

After

Width:  |  Height:  |  Size: 428 B

BIN
designer_base/src/com/fr/design/images/data/multi.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 B

After

Width:  |  Height:  |  Size: 194 B

BIN
designer_base/src/com/fr/design/images/data/source/rename.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 433 B

BIN
designer_base/src/com/fr/design/images/file/fold.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 238 B

BIN
designer_base/src/com/fr/design/images/file/newfolder.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 293 B

BIN
designer_base/src/com/fr/design/images/form/toolbar/ec_frozen.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 184 B

BIN
designer_base/src/com/fr/design/images/gui/color/background.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 413 B

BIN
designer_base/src/com/fr/design/images/lookandfeel/ErrorIcon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 763 B

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
designer_base/src/com/fr/design/images/lookandfeel/InformationIcon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

After

Width:  |  Height:  |  Size: 721 B

BIN
designer_base/src/com/fr/design/images/lookandfeel/QuestionIcon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 601 B

After

Width:  |  Height:  |  Size: 831 B

BIN
designer_base/src/com/fr/design/images/lookandfeel/TreeFolderOpenedIcon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 356 B

BIN
designer_base/src/com/fr/design/images/lookandfeel/WarningIcon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 B

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
designer_base/src/com/fr/design/images/m_edit/copy.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 214 B

BIN
designer_base/src/com/fr/design/images/m_edit/cut.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 B

After

Width:  |  Height:  |  Size: 503 B

BIN
designer_base/src/com/fr/design/images/m_edit/formatBrush.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 431 B

After

Width:  |  Height:  |  Size: 428 B

BIN
designer_base/src/com/fr/design/images/m_edit/merge.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 277 B

BIN
designer_base/src/com/fr/design/images/m_edit/unmerge.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

After

Width:  |  Height:  |  Size: 166 B

BIN
designer_base/src/com/fr/design/images/m_file/formExport.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

After

Width:  |  Height:  |  Size: 198 B

BIN
designer_base/src/com/fr/design/images/m_file/pdf.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 383 B

BIN
designer_base/src/com/fr/design/images/m_file/preview.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 389 B

BIN
designer_base/src/com/fr/design/images/m_file/saveAs.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 186 B

BIN
designer_base/src/com/fr/design/images/m_file/switch.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 540 B

BIN
designer_base/src/com/fr/design/images/m_file/text.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 285 B

BIN
designer_base/src/com/fr/design/images/m_file/view_folder.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 208 B

BIN
designer_base/src/com/fr/design/images/m_file/word.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

After

Width:  |  Height:  |  Size: 474 B

BIN
designer_base/src/com/fr/design/images/m_format/cellstyle/bold.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 284 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save