diff --git a/designer/src/com/fr/design/actions/CellSelectionAction.java b/designer/src/com/fr/design/actions/CellSelectionAction.java index 8ca67feaf..16bf089c5 100644 --- a/designer/src/com/fr/design/actions/CellSelectionAction.java +++ b/designer/src/com/fr/design/actions/CellSelectionAction.java @@ -5,30 +5,33 @@ import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.Selection; public abstract class CellSelectionAction extends ElementCaseAction { - protected CellSelectionAction(ElementCasePane t) { - super(t); - } - - @Override - public boolean executeActionReturnUndoRecordNeeded() { - ElementCasePane ePane = this.getEditingComponent(); - Selection s = ePane.getSelection(); - - // TODO ALEX_SEP instanceof i hate it - if (s instanceof CellSelection) { - return executeActionReturnUndoRecordNeededWithCellSelection((CellSelection)s); - } - - return false; - } - - protected abstract boolean executeActionReturnUndoRecordNeededWithCellSelection(CellSelection cs); - - @Override - public void update() { - super.update(); - if (this.isEnabled()) { - this.setEnabled(this.getEditingComponent().getSelection() instanceof CellSelection); - } - } + protected CellSelectionAction() { + } + + protected CellSelectionAction(ElementCasePane t) { + super(t); + } + + @Override + public boolean executeActionReturnUndoRecordNeeded() { + ElementCasePane ePane = this.getEditingComponent(); + Selection s = ePane.getSelection(); + + // TODO ALEX_SEP instanceof i hate it + if (s instanceof CellSelection) { + return executeActionReturnUndoRecordNeededWithCellSelection((CellSelection) s); + } + + return false; + } + + protected abstract boolean executeActionReturnUndoRecordNeededWithCellSelection(CellSelection cs); + + @Override + public void update() { + super.update(); + if (this.isEnabled()) { + this.setEnabled(this.getEditingComponent().getSelection() instanceof CellSelection); + } + } } \ No newline at end of file diff --git a/designer/src/com/fr/design/actions/ElementCaseAction.java b/designer/src/com/fr/design/actions/ElementCaseAction.java index bfc0c8b4e..09b784830 100644 --- a/designer/src/com/fr/design/actions/ElementCaseAction.java +++ b/designer/src/com/fr/design/actions/ElementCaseAction.java @@ -3,17 +3,15 @@ package com.fr.design.actions; //ElementCaseAction应该有GridSelectionChangeListener,就从悬浮元素和单元格来讲,就必须有了,用来判断这些ElementCaseAction是否可以编辑,当然还可以做些其他事情 // -import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; -import com.fr.grid.selection.CellSelection; -import com.fr.grid.selection.Selection; -import com.fr.design.selection.SelectionEvent; -import com.fr.design.selection.SelectionListener; public abstract class ElementCaseAction extends SelectionListenerAction { - protected ElementCaseAction(ElementCasePane t) { - super(t); - t.addSelectionChangeListener(createSelectionListener()); - } + protected ElementCaseAction() { + } + + protected ElementCaseAction(ElementCasePane t) { + super(t); + t.addSelectionChangeListener(createSelectionListener()); + } } \ No newline at end of file diff --git a/designer/src/com/fr/design/actions/SelectionListenerAction.java b/designer/src/com/fr/design/actions/SelectionListenerAction.java index 48cd2d4f9..d150460ec 100644 --- a/designer/src/com/fr/design/actions/SelectionListenerAction.java +++ b/designer/src/com/fr/design/actions/SelectionListenerAction.java @@ -12,11 +12,14 @@ import com.fr.grid.selection.Selection; */ public abstract class SelectionListenerAction extends TemplateComponentAction { + protected SelectionListenerAction() { + } + protected SelectionListenerAction(ElementCasePane elementCasePane) { super(elementCasePane); } - protected SelectionListener createSelectionListener () { + protected SelectionListener createSelectionListener() { return new SelectionListener() { @Override diff --git a/designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java b/designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java index 0036b2806..8143409cf 100644 --- a/designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java +++ b/designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java @@ -1,36 +1,33 @@ package com.fr.design.actions.columnrow; import com.fr.base.BaseUtils; -import com.fr.design.data.DesignTableDataManager; 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.general.Inter; +import com.fr.design.dscolumn.DSColumnConditionsPane; import com.fr.design.mainframe.ElementCasePane; +import com.fr.general.Inter; import com.fr.report.cell.TemplateCellElement; public class DSColumnConditionAction extends AbstractCellElementAction { - private boolean returnValue = false; - private TemplateCellElement editCellElement; - public DSColumnConditionAction(ElementCasePane t) { - super(t); - + super(t); + this.setName(Inter.getLocText("Filter")); this.setMnemonic('E'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/expand/cellAttr.gif")); } @Override - protected BasicPane populateBasicPane(TemplateCellElement cellElement) { + protected BasicPane populateBasicPane(TemplateCellElement cellElement) { DSColumnConditionsPane dSColumnConditionsPane = new DSColumnConditionsPane(); dSColumnConditionsPane.populate(DesignTableDataManager.getEditingTableDataSource(), cellElement); return dSColumnConditionsPane; } @Override - protected void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) { + protected void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) { ((DSColumnConditionsPane) bp).update(cellElement); } } \ No newline at end of file diff --git a/designer/src/com/fr/design/actions/insert/cell/AbstractCellAction.java b/designer/src/com/fr/design/actions/insert/cell/AbstractCellAction.java index a8c9ab80f..1127acf53 100644 --- a/designer/src/com/fr/design/actions/insert/cell/AbstractCellAction.java +++ b/designer/src/com/fr/design/actions/insert/cell/AbstractCellAction.java @@ -13,12 +13,15 @@ import com.fr.report.elementcase.TemplateElementCase; * Cell. */ public abstract class AbstractCellAction extends CellSelectionAction { - protected AbstractCellAction(ElementCasePane t) { - super(t); - } - + protected AbstractCellAction() { + } + + protected AbstractCellAction(ElementCasePane t) { + super(t); + } + public abstract Class getCellValueClass(); - + /* * TODO ALEX_SEP 这里的返回boolean量表示模板是否改变,导致很多很多的方法的boolean返回值都是这个意思 * @@ -26,8 +29,8 @@ public abstract class AbstractCellAction extends CellSelectionAction { */ @Override protected boolean executeActionReturnUndoRecordNeededWithCellSelection( - CellSelection cs) { - ElementCasePane ePane = this.getEditingComponent(); + CellSelection cs) { + ElementCasePane ePane = this.getEditingComponent(); //got simple cell element from column and row. TemplateElementCase report = ePane.getEditingElementCase(); @@ -35,17 +38,18 @@ public abstract class AbstractCellAction extends CellSelectionAction { if (report != null && this instanceof DSColumnCellAction) { SheetUtils.calculateDefaultParent(report); } - + return ePane.getGrid().startCellEditingAt_DEC( - cs.getColumn(), - cs.getRow(), - this.getCellValueClass(), false + cs.getColumn(), + cs.getRow(), + this.getCellValueClass(), false ); } - @Override - public void update() { - super.update(); - ElementCasePane ePane = this.getEditingComponent(); - this.setEnabled(ePane.isSelectedOneCell()); - } + + @Override + public void update() { + super.update(); + ElementCasePane ePane = this.getEditingComponent(); + this.setEnabled(ePane.isSelectedOneCell()); + } } \ No newline at end of file diff --git a/designer/src/com/fr/design/actions/insert/cell/BiasCellAction.java b/designer/src/com/fr/design/actions/insert/cell/BiasCellAction.java index e3821f299..9fc616288 100644 --- a/designer/src/com/fr/design/actions/insert/cell/BiasCellAction.java +++ b/designer/src/com/fr/design/actions/insert/cell/BiasCellAction.java @@ -3,8 +3,6 @@ */ package com.fr.design.actions.insert.cell; -import javax.swing.KeyStroke; - import com.fr.base.BaseUtils; import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.mainframe.ElementCasePane; @@ -12,12 +10,23 @@ import com.fr.design.menu.MenuKeySet; import com.fr.general.Inter; import com.fr.report.cell.painter.BiasTextPainter; +import javax.swing.KeyStroke; + /** * Bias */ public class BiasCellAction extends AbstractCellAction implements WorkBookSupportable { - public BiasCellAction(ElementCasePane t) { - super(t); + + public BiasCellAction() { + initAction(); + } + + public BiasCellAction(ElementCasePane t) { + super(t); + initAction(); + } + + private void initAction() { this.setMenuKeySet(INSERT_SLOPE_LINE); this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); diff --git a/designer/src/com/fr/design/actions/insert/cell/ChartCellAction.java b/designer/src/com/fr/design/actions/insert/cell/ChartCellAction.java index 8f12d287b..83d8f238e 100644 --- a/designer/src/com/fr/design/actions/insert/cell/ChartCellAction.java +++ b/designer/src/com/fr/design/actions/insert/cell/ChartCellAction.java @@ -16,11 +16,19 @@ import javax.swing.*; * . */ public class ChartCellAction extends AbstractCellAction implements WorkBookSupportable { + public ChartCellAction(){ + initAction(); + } + public ChartCellAction(ElementCasePane t) { super(t); - this.setMenuKeySet(INSERT_CHART); - this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); - this.setMnemonic(getMenuKeySet().getMnemonic()); + initAction(); + } + + private void initAction() { + this.setMenuKeySet(INSERT_CHART); + this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); + this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/chart.png")); } diff --git a/designer/src/com/fr/design/actions/insert/cell/DSColumnCellAction.java b/designer/src/com/fr/design/actions/insert/cell/DSColumnCellAction.java index 90d0ccb8b..7afd7b4ef 100644 --- a/designer/src/com/fr/design/actions/insert/cell/DSColumnCellAction.java +++ b/designer/src/com/fr/design/actions/insert/cell/DSColumnCellAction.java @@ -8,13 +8,21 @@ import com.fr.general.IOUtils; import com.fr.report.cell.cellattr.core.group.DSColumn; public class DSColumnCellAction extends AbstractCellAction implements WorkBookSupportable { - public DSColumnCellAction(ElementCasePane t) { - super(t); + public DSColumnCellAction() { + initAction(); + } + + public DSColumnCellAction(ElementCasePane t) { + super(t); + initAction(); + this.setSearchText(new DSColumnPane()); + } + + private void initAction() { this.setMenuKeySet(KeySetUtils.INSERT_DATA_COLUMN); - this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_insert/bindColumn.png")); - this.setSearchText(new DSColumnPane()); } @Override diff --git a/designer/src/com/fr/design/actions/insert/cell/FormulaCellAction.java b/designer/src/com/fr/design/actions/insert/cell/FormulaCellAction.java index 92757d88e..499b9119d 100644 --- a/designer/src/com/fr/design/actions/insert/cell/FormulaCellAction.java +++ b/designer/src/com/fr/design/actions/insert/cell/FormulaCellAction.java @@ -13,10 +13,18 @@ import com.fr.general.Inter; import javax.swing.*; public class FormulaCellAction extends AbstractCellAction implements WorkBookSupportable { - public FormulaCellAction(ElementCasePane t) { - super(t); + public FormulaCellAction() { + initAction(); + } + + public FormulaCellAction(ElementCasePane t) { + super(t); + initAction(); + } + + private void initAction() { this.setMenuKeySet(INSERT_FORMULA); - this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); } @@ -39,7 +47,7 @@ public class FormulaCellAction extends AbstractCellAction implements WorkBookSup }; @Override - public Class getCellValueClass() { + public Class getCellValueClass() { return Formula.class; } } \ No newline at end of file diff --git a/designer/src/com/fr/design/actions/insert/cell/GeneralCellAction.java b/designer/src/com/fr/design/actions/insert/cell/GeneralCellAction.java index 714692467..40aef3198 100644 --- a/designer/src/com/fr/design/actions/insert/cell/GeneralCellAction.java +++ b/designer/src/com/fr/design/actions/insert/cell/GeneralCellAction.java @@ -15,10 +15,18 @@ import javax.swing.*; * */ public class GeneralCellAction extends AbstractCellAction implements WorkBookSupportable { - public GeneralCellAction(ElementCasePane t) { - super(t); + public GeneralCellAction() { + initAction(); + } + + public GeneralCellAction(ElementCasePane t) { + super(t); + initAction(); + } + + private void initAction() { this.setMenuKeySet(INSERT_TEXT); - this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/text.png")); } @@ -41,7 +49,7 @@ public class GeneralCellAction extends AbstractCellAction implements WorkBookSup }; @Override - public Class getCellValueClass() { + public Class getCellValueClass() { return String.class; } } \ No newline at end of file diff --git a/designer/src/com/fr/design/actions/insert/cell/ImageCellAction.java b/designer/src/com/fr/design/actions/insert/cell/ImageCellAction.java index 594cb771b..e3761909a 100644 --- a/designer/src/com/fr/design/actions/insert/cell/ImageCellAction.java +++ b/designer/src/com/fr/design/actions/insert/cell/ImageCellAction.java @@ -16,10 +16,18 @@ import java.awt.*; * Image */ public class ImageCellAction extends AbstractCellAction implements WorkBookSupportable { - public ImageCellAction(ElementCasePane t) { - super(t); + public ImageCellAction() { + initAction(); + } + + public ImageCellAction(ElementCasePane t) { + super(t); + initAction(); + } + + private void initAction() { this.setMenuKeySet(INSERT_IMAGE); - this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/image.png")); } @@ -42,7 +50,7 @@ public class ImageCellAction extends AbstractCellAction implements WorkBookSuppo }; @Override - public Class getCellValueClass() { + public Class getCellValueClass() { return Image.class; } } \ No newline at end of file diff --git a/designer/src/com/fr/design/actions/insert/cell/RichTextCellAction.java b/designer/src/com/fr/design/actions/insert/cell/RichTextCellAction.java index c8017099f..c9df15162 100644 --- a/designer/src/com/fr/design/actions/insert/cell/RichTextCellAction.java +++ b/designer/src/com/fr/design/actions/insert/cell/RichTextCellAction.java @@ -1,7 +1,5 @@ package com.fr.design.actions.insert.cell; -import javax.swing.KeyStroke; - import com.fr.base.BaseUtils; import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.mainframe.ElementCasePane; @@ -10,53 +8,64 @@ import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.report.cell.cellattr.core.RichText; +import javax.swing.KeyStroke; + public class RichTextCellAction extends AbstractCellAction implements WorkBookSupportable { - public RichTextCellAction(ElementCasePane t) { - super(t); + public RichTextCellAction() { + initAction(); + } + + public RichTextCellAction(ElementCasePane t) { + super(t); + initAction(); + } + + private void initAction() { this.setMenuKeySet(INSERT_RICHTEXT); - this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon( "/com/fr/design/images/m_insert/richtext.png")); - } - - @Override - public Class getCellValueClass() { - return RichText.class; - } - - /** - * equals 比较 - * @param object - * @return true false - */ - @Override - public boolean equals(Object object) { - if (this == object){ - return true; - } - if (!(object instanceof RichTextCellAction)){ - return false; - } - - return ComparatorUtils.equals(this.getEditingComponent(),((RichTextCellAction)object).getEditingComponent()); - } + } + + @Override + public Class getCellValueClass() { + return RichText.class; + } + + /** + * equals 比较 + * + * @param object + * @return true false + */ + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } + if (!(object instanceof RichTextCellAction)) { + return false; + } + + return ComparatorUtils.equals(this.getEditingComponent(), ((RichTextCellAction) object).getEditingComponent()); + } private static final MenuKeySet INSERT_RICHTEXT = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'R'; - } - - @Override - public String getMenuName() { - return Inter.getLocText("FR-Designer_RichText"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } + @Override + public char getMnemonic() { + return 'R'; + } + + @Override + public String getMenuName() { + return Inter.getLocText("FR-Designer_RichText"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } }; } \ No newline at end of file diff --git a/designer/src/com/fr/design/actions/insert/cell/SubReportCellAction.java b/designer/src/com/fr/design/actions/insert/cell/SubReportCellAction.java index 79dc6c642..a055bcd0d 100644 --- a/designer/src/com/fr/design/actions/insert/cell/SubReportCellAction.java +++ b/designer/src/com/fr/design/actions/insert/cell/SubReportCellAction.java @@ -1,7 +1,5 @@ package com.fr.design.actions.insert.cell; -import javax.swing.KeyStroke; - import com.fr.base.BaseUtils; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.menu.MenuKeySet; @@ -9,54 +7,65 @@ import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.report.cell.cellattr.core.SubReport; +import javax.swing.KeyStroke; + public class SubReportCellAction extends AbstractCellAction { - public SubReportCellAction(ElementCasePane t) { - super(t); + public SubReportCellAction() { + initAction(); + } + + public SubReportCellAction(ElementCasePane t) { + super(t); + initAction(); + } + + private void initAction() { this.setMenuKeySet(INSERT_SUB_REPORT); - this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon( "/com/fr/design/images/m_insert/subReport.png")); - } - - public static final MenuKeySet INSERT_SUB_REPORT = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'S'; - } - - @Override - public String getMenuName() { - return Inter.getLocText("M_Insert-Sub_Report"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; - - /** - * equals 比较 - * @param object - * @return true false - */ - @Override - public boolean equals(Object object) { - if (this == object){ - return true; - } - if (!(object instanceof SubReportCellAction)){ - return false; - } - - return ComparatorUtils.equals(this.getEditingComponent(),((SubReportCellAction)object).getEditingComponent()); - } - - @Override - public Class getCellValueClass() { - return SubReport.class; - } + } + + public static final MenuKeySet INSERT_SUB_REPORT = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'S'; + } + + @Override + public String getMenuName() { + return Inter.getLocText("M_Insert-Sub_Report"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; + + /** + * equals 比较 + * + * @param object + * @return true false + */ + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } + if (!(object instanceof SubReportCellAction)) { + return false; + } + + return ComparatorUtils.equals(this.getEditingComponent(), ((SubReportCellAction) object).getEditingComponent()); + } + + @Override + public Class getCellValueClass() { + return SubReport.class; + } } \ No newline at end of file diff --git a/designer/src/com/fr/design/dscolumn/DSColumnAdvancedEditorPane.java b/designer/src/com/fr/design/dscolumn/DSColumnAdvancedEditorPane.java deleted file mode 100644 index 57af1a340..000000000 --- a/designer/src/com/fr/design/dscolumn/DSColumnAdvancedEditorPane.java +++ /dev/null @@ -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) { - - } - -} diff --git a/designer/src/com/fr/design/dscolumn/DSColumnBasicEditorPane.java b/designer/src/com/fr/design/dscolumn/DSColumnBasicEditorPane.java deleted file mode 100644 index ef0c5e0b5..000000000 --- a/designer/src/com/fr/design/dscolumn/DSColumnBasicEditorPane.java +++ /dev/null @@ -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); - } -} diff --git a/designer/src/com/fr/design/dscolumn/DSColumnBasicPane.java b/designer/src/com/fr/design/dscolumn/DSColumnBasicPane.java index 9ba61e547..603356a88 100644 --- a/designer/src/com/fr/design/dscolumn/DSColumnBasicPane.java +++ b/designer/src/com/fr/design/dscolumn/DSColumnBasicPane.java @@ -1,25 +1,23 @@ 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.design.dialog.BasicPane; import com.fr.design.expand.ConditionParentPane; import com.fr.design.expand.ExpandDirectionPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; 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.utils.gui.GUICoreUtils; +import com.fr.general.Inter; import com.fr.report.cell.CellElement; import com.fr.report.cell.TemplateCellElement; 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 { @@ -30,54 +28,54 @@ public class DSColumnBasicPane extends BasicPane { private CellElement cellElement; public DSColumnBasicPane() { - this(DSColumnPane.SETTING_ALL); + this(DSColumnPane.SETTING_ALL); } - + public DSColumnBasicPane(int setting) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); if (setting > DSColumnPane.SETTING_DSRELATED) { - selectDataColumnPane = new SelectedDataColumnPane(); + selectDataColumnPane = new SelectedDataColumnPane(); } else { - selectDataColumnPane = new SelectedConfirmedDataColumnPane(); + selectDataColumnPane = new SelectedConfirmedDataColumnPane(); } - + selectDataColumnPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Select_DataColumn"), null)); if (setting > DSColumnPane.SETTING_DSRELATED) { - conditionParentPane = new ConditionParentPane(); - conditionParentPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ParentCell_Setting"), null)); + conditionParentPane = new ConditionParentPane(); + conditionParentPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ParentCell_Setting"), null)); } - + resultSetGroupPane = new ResultSetGroupPopUpPane(setting > DSColumnPane.SETTING_DSRELATED); resultSetGroupPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Data_Setting"), null)); if (setting > DSColumnPane.SETTING_DSRELATED) { - expandDirectionPane = new ExpandDirectionPane(); - expandDirectionPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ExpandD-Expand_Direction"), null)); + expandDirectionPane = new ExpandDirectionPane(); + expandDirectionPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ExpandD-Expand_Direction"), null)); } - + double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, - TableLayout.PREFERRED, TableLayout.PREFERRED}; + TableLayout.PREFERRED, TableLayout.PREFERRED}; double[] columnSize = {TableLayout.FILL}; - + Component[][] components = null; - + if (setting > DSColumnPane.SETTING_DSRELATED) { - components = new Component[][]{ - {selectDataColumnPane}, - {conditionParentPane}, - {resultSetGroupPane}, - {expandDirectionPane} - }; + components = new Component[][]{ + {selectDataColumnPane}, + {conditionParentPane}, + {resultSetGroupPane}, + {expandDirectionPane} + }; } else { - components = new Component[][]{ - {selectDataColumnPane}, - {resultSetGroupPane}, - }; + components = new Component[][]{ + {selectDataColumnPane}, + {resultSetGroupPane}, + }; } - + this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER); this.resultSetGroupPane.addListeners(summary_direction_ActionListener, otherGroup_direction_ActionListener, sdcUpdate_ActionListener); @@ -85,24 +83,24 @@ public class DSColumnBasicPane extends BasicPane { @Override protected String title4PopupWindow() { - return Inter.getLocText("Basic"); + return Inter.getLocText("Basic"); } - + public void populate(TableDataSource source, TemplateCellElement cellElement) { if (cellElement == null) { return; } this.cellElement = cellElement; - + selectDataColumnPane.populate(source, cellElement); CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); if (conditionParentPane != null) { - conditionParentPane.populate(cellExpandAttr); + conditionParentPane.populate(cellExpandAttr); } if (expandDirectionPane != null) { - expandDirectionPane.populate(cellExpandAttr); + expandDirectionPane.populate(cellExpandAttr); } resultSetGroupPane.populate(cellElement); @@ -128,27 +126,28 @@ public class DSColumnBasicPane extends BasicPane { } if (conditionParentPane != null) { - conditionParentPane.update(cellExpandAttr); + conditionParentPane.update(cellExpandAttr); } if (expandDirectionPane != null) { - expandDirectionPane.update(cellExpandAttr); + expandDirectionPane.update(cellExpandAttr); } resultSetGroupPane.update(); } + ActionListener summary_direction_ActionListener = new ActionListener() { public void actionPerformed(ActionEvent evt) { - if (expandDirectionPane != null) { - expandDirectionPane.setNoneRadioButtonSelected(true); - } + if (expandDirectionPane != null) { + expandDirectionPane.setNoneRadioButtonSelected(true); + } } }; ActionListener otherGroup_direction_ActionListener = new ActionListener() { public void actionPerformed(ActionEvent evt) { - if (expandDirectionPane != null) { - expandDirectionPane.setNoneRadioButtonSelected(false); - } + if (expandDirectionPane != null) { + expandDirectionPane.setNoneRadioButtonSelected(false); + } } }; ActionListener sdcUpdate_ActionListener = new ActionListener() { @@ -157,14 +156,16 @@ public class DSColumnBasicPane extends BasicPane { selectDataColumnPane.update(cellElement); } }; - public void putElementcase(ElementCasePane t){ - if (conditionParentPane != null) { - conditionParentPane.putElementcase(t); - } - } - public void putCellElement(TemplateCellElement tplEC2) { - if (conditionParentPane != null) { - conditionParentPane.putCellElement(tplEC2); - } - } + + public void putElementcase(ElementCasePane t) { + if (conditionParentPane != null) { + conditionParentPane.putElementcase(t); + } + } + + public void putCellElement(TemplateCellElement tplCE) { + if (conditionParentPane != null) { + conditionParentPane.putCellElement(tplCE); + } + } } \ No newline at end of file diff --git a/designer/src/com/fr/design/dscolumn/DSColumnPane.java b/designer/src/com/fr/design/dscolumn/DSColumnPane.java index 74bc68165..68b49b1af 100644 --- a/designer/src/com/fr/design/dscolumn/DSColumnPane.java +++ b/designer/src/com/fr/design/dscolumn/DSColumnPane.java @@ -148,7 +148,7 @@ public class DSColumnPane extends BasicPane { basicPane.putElementcase(t); } - public void putCellElement(TemplateCellElement tplEC2) { - basicPane.putCellElement(tplEC2); + public void putCellElement(TemplateCellElement tplCE) { + basicPane.putCellElement(tplCE); } } \ No newline at end of file diff --git a/designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java b/designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java index b7cc3b5ae..ed4c24cba 100644 --- a/designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java +++ b/designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java @@ -1,35 +1,31 @@ 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.icombobox.UIComboBox; 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.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.Inter; 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.cellattr.CellExpandAttr; -import com.fr.report.cell.cellattr.core.group.CustomGrouper; -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.report.cell.cellattr.core.group.*; 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 * - * @author zhou + * @author zhou, yaoh.wu + * @version 2017年8月2日14点55分 + * @since 8.0 */ public class ResultSetGroupDockingPane extends ResultSetGroupPane { private static final int BIND_GROUP = 0; @@ -42,7 +38,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { private CardLayout cardLayout; private UIComboBox goBox; - ItemListener l; + private ItemListener listener; public ResultSetGroupDockingPane(ElementCasePane ePane) { super(); @@ -58,15 +54,14 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { } private JPanel layoutPane() { - double vs = 4; - double vg = 6; double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - + UILabel dataSetLabel = new UILabel(Inter.getLocText("Data_Setting")); + dataSetLabel.setPreferredSize(new Dimension(60, 20)); Component[][] components = new Component[][] { - new Component[]{new UILabel(Inter.getLocText("Data_Setting")), goBox}, - new Component[]{cardPane, null} + new Component[]{dataSetLabel, goBox}, + new Component[]{null, cardPane} }; goBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent ee) { @@ -74,10 +69,13 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { int i = goBox.getSelectedIndex(); if (i == BIND_GROUP) { cardLayout.show(cardPane, "groupPane"); + cardPane.setPreferredSize(new Dimension(155, 20)); } else if (i == BIND_SELECTED) { cardLayout.show(cardPane, "listPane"); + cardPane.setPreferredSize(new Dimension(0, 0)); } else if (i == BIND_SUMMARY) { cardLayout.show(cardPane, "summaryPane"); + cardPane.setPreferredSize(new Dimension(155, 20)); CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); cellExpandAttr.setDirection(Constants.NONE); } @@ -86,7 +84,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { double[] columnSize = {p, f}; double[] rowSize = {p, p}; - return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } private void initCardPane() { @@ -190,15 +188,15 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { } } - public void addListener(ItemListener l) { - goBox.addItemListener(l); - groupComboBox.addItemListener(l); - functionComboBox.addItemListener(l); - this.l = l; + public void addListener(ItemListener listener) { + goBox.addItemListener(listener); + groupComboBox.addItemListener(listener); + functionComboBox.addItemListener(listener); + this.listener = listener; } void fireTargetChanged() { - l.itemStateChanged(null); + listener.itemStateChanged(null); } @Override diff --git a/designer/src/com/fr/design/dscolumn/SelectedConfirmedDataColumnPane.java b/designer/src/com/fr/design/dscolumn/SelectedConfirmedDataColumnPane.java index 282367d27..e71f539eb 100644 --- a/designer/src/com/fr/design/dscolumn/SelectedConfirmedDataColumnPane.java +++ b/designer/src/com/fr/design/dscolumn/SelectedConfirmedDataColumnPane.java @@ -1,45 +1,45 @@ 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.design.data.datapane.TableDataComboBox; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.main.impl.WorkBook; 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 SelectedConfirmedDataColumnPane () { - super(false); - } - - protected void initTableNameComboBox() { - tableNameComboBox = new TableDataComboBox(new WorkBook()); - tableNameComboBox.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - columnNameComboBox.setLoaded(false); - } - }); - tableNameComboBox.setPreferredSize(new Dimension(100, 20)); - } - - public void populate(TableDataSource source, TemplateCellElement cell) { - tableNameComboBox.refresh(source); - tableNameComboBox.setEditable(false); - tableNameComboBox.setEnabled(false); - super.populate(source, cell); - try { - Iterator it = source.getTableDataNameIterator(); - String name = (String)it.next(); - TemplateTableDataWrapper wrapper = new TemplateTableDataWrapper(source.getTableData(name), name); - tableNameComboBox.setSelectedItem(wrapper); - tableNameComboBox.getModel().setSelectedItem(wrapper); - } catch (Exception e) { - } - } + public SelectedConfirmedDataColumnPane() { + super(false); + } + + protected void initTableNameComboBox() { + tableNameComboBox = new TableDataComboBox(new WorkBook()); + tableNameComboBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + columnNameComboBox.setLoaded(false); + } + }); + tableNameComboBox.setPreferredSize(new Dimension(100, 20)); + } + + public void populate(TableDataSource source, TemplateCellElement cell) { + tableNameComboBox.refresh(source); + tableNameComboBox.setEditable(false); + tableNameComboBox.setEnabled(false); + super.populate(source, cell); + try { + Iterator it = source.getTableDataNameIterator(); + String name = (String) it.next(); + TemplateTableDataWrapper wrapper = new TemplateTableDataWrapper(source.getTableData(name), name); + tableNameComboBox.setSelectedItem(wrapper); + tableNameComboBox.getModel().setSelectedItem(wrapper); + } catch (Exception e) { + } + } } \ No newline at end of file diff --git a/designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java b/designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java index dd583e1ef..f76d5fa85 100644 --- a/designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java +++ b/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.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.ElementCasePane; import com.fr.general.Inter; import com.fr.general.data.TableDataColumn; import com.fr.report.cell.CellElement; @@ -39,8 +40,8 @@ import java.util.regex.Pattern; * 数据集列动态参数设置组件 * * @author yaoh.wu - * @version 2017年7月26日 - * 9.0设计器更新,修改动态参数注入按钮部分,使其显示动态参数按钮时能在右侧边栏正常显示 + * @version 2017年8月3日 + * 复用对话框代码,保留对话框原始布局 * @since 8.0 */ public class SelectedDataColumnPane extends BasicPane { @@ -54,11 +55,20 @@ public class SelectedDataColumnPane extends BasicPane { private UIButton paramButton; 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(); } columnNameComboBox = new LazyComboBox() { + @Override public Object[] load() { List l = calculateColumnNameList(); return l.toArray(new String[l.size()]); } + }; columnNameComboBox.setEditable(true); - double f = TableLayout.FILL; double p = TableLayout.PREFERRED; - UILabel label1 = new UILabel(Inter.getLocText("TableData")); - UILabel label3 = new UILabel(Inter.getLocText("DataColumn")); + UILabel dsLabel = new UILabel(Inter.getLocText("TableData") + ":"); + UILabel dcLabel = new UILabel(Inter.getLocText("DataColumn") + ":"); if (showParameterButton) { - //todo 国际化 - UILabel label2 = new UILabel("param"); - Component[][] components = { - {label1, tableNameComboBox}, - {label2, paramButton}, - {label3, columnNameComboBox} - }; - this.setLayout(new BorderLayout()); - this.add(TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p, p}, new double[]{p, f})); + dsLabel.setPreferredSize(new Dimension(200, 25)); + dcLabel.setPreferredSize(new Dimension(200, 25)); + } + if (showParameterButton) { + Component[][] comps = {{dsLabel, null, dcLabel}, {tableNameComboBox, paramButton, columnNameComboBox}}; + this.add(TableLayoutHelper.createTableLayoutPane(comps, new double[]{p, p}, new double[]{p, p, p})); } else { + double f = TableLayout.FILL; double[] columnSize = {p, f}; double[] rowSize = {p, p}; Component[][] components = new Component[][]{ - new Component[]{label1, tableNameComboBox}, - new Component[]{label3, columnNameComboBox} + new Component[]{dsLabel, tableNameComboBox}, + new Component[]{dcLabel, columnNameComboBox} }; JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); 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 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) { if (cellElement == null) { return; @@ -237,6 +279,27 @@ public class SelectedDataColumnPane extends BasicPane { }); } + private void initWithParameterButton(final ElementCasePane casePane, final TemplateCellElement cellElement) { + final SelectedDataColumnPane that = this; + editorPane = new UITableEditorPane(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 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) { return StringUtils.isNotBlank(columnExp) && (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#"); diff --git a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java index df2cbca53..5637a68ca 100644 --- a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java +++ b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -69,9 +69,6 @@ public class CellWidgetPropertyPane extends BasicPane { Widget cellWidget = cellElement.getWidget(); - if(cellWidget == null){ - return; - } // 这里进行克隆的原因是为了保留原始的Widget以便和新的Widget做比较来判断是否发生了改变 if (cellWidget != null) { diff --git a/designer/src/com/fr/design/mainframe/cell/CellEditorPane.java b/designer/src/com/fr/design/mainframe/cell/CellEditorPane.java index b0f09af43..48b6d8a17 100644 --- a/designer/src/com/fr/design/mainframe/cell/CellEditorPane.java +++ b/designer/src/com/fr/design/mainframe/cell/CellEditorPane.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe.cell; 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(); } diff --git a/designer/src/com/fr/design/module/DesignerModule.java b/designer/src/com/fr/design/module/DesignerModule.java index 12ada2f02..6cdbea4e5 100644 --- a/designer/src/com/fr/design/module/DesignerModule.java +++ b/designer/src/com/fr/design/module/DesignerModule.java @@ -111,7 +111,7 @@ public class DesignerModule extends DesignModule { private void registerCellEditor() { ActionFactory.registerCellEditor(String.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(RichText.class, CellRichTextEditor.class); ActionFactory.registerCellEditor(DSColumn.class, CellDSColumnEditor.class); @@ -169,7 +169,7 @@ public class DesignerModule extends DesignModule { } @Override - /** + /* * 针对不同的对象,在读取Object对象的xml的时候需要使用不同的对象生成器 * @return 返回对象生成器 */ @@ -212,7 +212,7 @@ public class DesignerModule extends DesignModule { } }); } - + private static abstract class AbstractWorkBookApp implements App { @Override @@ -234,15 +234,15 @@ public class DesignerModule extends DesignModule { public void process() { } - + @Override public void undo() { - + } } @Override - /** + /* * 返回设计器能打开的模板类型的一个数组列表 * @return 可以打开的模板类型的数组 */ @@ -385,7 +385,7 @@ public class DesignerModule extends DesignModule { } public Class[] actionsForInsertCellElement() { - return (Class[])ArrayUtils.addAll(new Class[]{ + return (Class[]) ArrayUtils.addAll(new Class[]{ DSColumnCellAction.class, GeneralCellAction.class, RichTextCellAction.class, diff --git a/designer/src/com/fr/design/present/BarCodePane.java b/designer/src/com/fr/design/present/BarCodePane.java index db894b203..583982bcb 100644 --- a/designer/src/com/fr/design/present/BarCodePane.java +++ b/designer/src/com/fr/design/present/BarCodePane.java @@ -1,376 +1,376 @@ -package com.fr.design.present; - -import com.fr.design.beans.FurtherBasicBeanPane; -import com.fr.design.border.UIRoundedBorder; -import com.fr.design.constants.UIConstants; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.icombobox.UIComboBoxRenderer; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UIBasicSpinner; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.Inter; -import com.fr.report.cell.cellattr.BarcodeAttr; -import com.fr.report.cell.cellattr.BarcodePresent; -import com.fr.report.cell.painter.barcode.BarcodeImpl; -import com.fr.report.cell.painter.barcode.core.BarCodeUtils; -import com.fr.stable.pinyin.ChineseHelper; - -import javax.swing.*; -import javax.swing.border.TitledBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.*; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.awt.font.FontRenderContext; -import java.awt.font.LineBreakMeasurer; -import java.awt.font.TextAttribute; -import java.awt.font.TextLayout; -import java.awt.geom.AffineTransform; -import java.text.AttributedCharacterIterator; -import java.text.AttributedString; -import java.util.HashMap; -import java.util.Map; - -/** - * @author zhou - * @since 2012-6-4下午6:49:59 - */ -public class BarCodePane extends FurtherBasicBeanPane { - private final int NUM16 = 16; - private BarCodePreviewPane barCodePreviewPane; - private UIComboBox typeComboBox; - private UIBasicSpinner barWidthSpinner; - private UIBasicSpinner barHeightSpinner; - private UIBasicSpinner RCodesizespinner; - private UICheckBox drawingTextCheckBox; - private UIComboBox RCodeVersionComboBox; - private UIComboBox RCodeErrorCorrectComboBox; - private UILabel typeSetLabel; - - private String testText = "12345"; - - public BarCodePane() { - this.initComponents(); - addlistener(); - } - - public static void main(String[] args) { - JFrame jf = new JFrame("test"); - jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - JPanel content = (JPanel) jf.getContentPane(); - content.setLayout(new BorderLayout()); - content.add(new BarCodePane(), BorderLayout.CENTER); - GUICoreUtils.centerWindow(jf); - jf.setSize(270, 400); - jf.setVisible(true); - } - - private void initComponents() { - barCodePreviewPane = new BarCodePreviewPane(); - this.barWidthSpinner = new UIBasicSpinner(new SpinnerNumberModel(10.0, 1, 100, 1.0)); - this.barHeightSpinner = new UIBasicSpinner(new SpinnerNumberModel(30, 1, 100, 1)); - this.barWidthSpinner.setPreferredSize(new Dimension(60, 20)); - this.barHeightSpinner.setPreferredSize(new Dimension(60, 20)); - JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - TitledBorder titledBorder = new TitledBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5), Inter.getLocText("StyleFormat-Sample"), 4, 2, this.getFont(), UIConstants.LINE_COLOR); - borderPane.setBorder(titledBorder); - borderPane.add(barCodePreviewPane, BorderLayout.CENTER); - setTypeComboBox(); - setSome(); - RCodesizespinner = new UIBasicSpinner(new SpinnerNumberModel(2, 1, 6, 1)); - RCodeVersionComboBox = new UIComboBox(); - RCodeErrorCorrectComboBox = new UIComboBox(); - typeSetLabel = new UILabel(Inter.getLocText("Type_Set") + ":", UILabel.RIGHT); - initVersionComboBox(); - initErrorCorrectComboBox(); - - drawingTextCheckBox = new UICheckBox(Inter.getLocText("BarCodeD-Drawing_Text")); - drawingTextCheckBox.setSelected(true); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p, p, p, p, p, p, p}; - barCodePreviewPane.setPreferredSize(new Dimension(0, 125)); - final JPanel centerPane = new JPanel(new CardLayout()); - - Component[][] components = new Component[][]{ - new Component[]{typeSetLabel, typeComboBox}, - new Component[]{borderPane, null}, - new Component[]{centerPane, null} - }; - JPanel barCode = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - centerPane.add(getNormalPane(), "normal"); - centerPane.add(getSpecialPane(), "special"); - typeComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - CardLayout cardLayout = (CardLayout) centerPane.getLayout(); - cardLayout.show(centerPane, typeComboBox.getSelectedIndex() == NUM16 ? "special" : "normal"); - setTestText(BarCodeUtils.getTestTextByBarCode(typeComboBox.getSelectedIndex())); - repaintPreviewBarCode(); - } - }); - this.setLayout(new BorderLayout()); - this.add(barCode, BorderLayout.CENTER); - } - - private void setTypeComboBox() { - typeComboBox = new UIComboBox(BarCodeUtils.getAllSupportedBarCodeTypeArray()); - typeComboBox.setRenderer(new UIComboBoxRenderer() { - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - - if (value instanceof Integer) { - this.setText(" " + BarCodeUtils.getBarCodeTypeName(((Integer) value).intValue())); - } - return this; - } - }); - } - - private void setSome() { - JFormattedTextField heightTextField = ((JSpinner.DefaultEditor) barHeightSpinner.getEditor()).getTextField(); - heightTextField.setColumns(2); - - JFormattedTextField widthTextField = ((JSpinner.DefaultEditor) barWidthSpinner.getEditor()).getTextField(); - widthTextField.setColumns(2); - } - - private JPanel getNormalPane() { - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p, p, p, p, p, p}; - double[] columnSize1 = {p, f, f}; - JPanel barWidthContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 2, 0)); - barWidthContainer.add(barWidthSpinner); - JPanel barHeightContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 2, 0)); - barHeightContainer.add(barHeightSpinner); - UILabel uiLabel = new UILabel(Inter.getLocText("Tree-Width") + ":", UILabel.RIGHT); - uiLabel.setPreferredSize(typeSetLabel.getPreferredSize()); - Component[][] components_normal = new Component[][]{ - new Component[]{new UILabel("条形码大小", UILabel.LEFT), barWidthContainer, barHeightContainer}, - new Component[]{null, new UILabel(Inter.getLocText("Tree-Width"), UILabel.CENTER), new UILabel(Inter.getLocText("Height"), UILabel.CENTER)}, - new Component[]{drawingTextCheckBox, null, null} - }; - - - JPanel normalPane = TableLayoutHelper.createTableLayoutPane(components_normal, rowSize, columnSize1); - return normalPane; - } - - - private JPanel getSpecialPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize1 = {p, p}; - double[] rowSize = {p, p, p, p, p, p, p, p}; - UILabel uiLabel = new UILabel(Inter.getLocText("RCodeVersion") + ":", UILabel.RIGHT); - uiLabel.setPreferredSize(typeSetLabel.getPreferredSize()); - Component[][] components_special = new Component[][]{ - new Component[]{uiLabel, RCodeVersionComboBox}, - new Component[]{new UILabel(Inter.getLocText("RCodeErrorCorrect") + ":", UILabel.RIGHT), RCodeErrorCorrectComboBox}, - new Component[]{new UILabel(Inter.getLocText("RCodeDrawPix") + ":", UILabel.RIGHT), RCodesizespinner} - }; - - JPanel specialPane = TableLayoutHelper.createTableLayoutPane(components_special, rowSize, columnSize1); - return specialPane; - } - - private void addlistener() { - RCodesizespinner.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - repaintPreviewBarCode(); - } - }); - RCodeVersionComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - repaintPreviewBarCode(); - } - }); - RCodeErrorCorrectComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - repaintPreviewBarCode(); - } - }); - this.barWidthSpinner.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - repaintPreviewBarCode(); - } - }); - this.barHeightSpinner.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - repaintPreviewBarCode(); - } - }); - drawingTextCheckBox.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - repaintPreviewBarCode(); - } - }); - repaintPreviewBarCode(); - } - - @Override - /** - * - */ - public String title4PopupWindow() { - return Inter.getLocText("Highlight-Barcode"); - } - - private void initVersionComboBox() { - String[] array = {Inter.getLocText(new String[]{"Auto", "Choose"}), "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"}; - initcombobox(this.RCodeVersionComboBox, array, 0); - } - - private void initErrorCorrectComboBox() { - String[] array = {"L" + Inter.getLocText("Level") + "7%", "M" + Inter.getLocText("Level") + "15%", "Q" + Inter.getLocText("Level") + "25%", "H" + Inter.getLocText("Level") + "30%"}; - initcombobox(this.RCodeErrorCorrectComboBox, array, 1); - } - - private void initcombobox(UIComboBox combobox, String[] array, int index) { - combobox.removeAllItems(); - for (int i = 0; i < array.length; i++) { - combobox.addItem(array[i]); - } - combobox.setSelectedIndex(index); - } - - private void repaintPreviewBarCode() { - try { - // carl:不支持中文转条形码 - if (ChineseHelper.containChinese(getTestText()) && this.typeComboBox.getSelectedIndex() != NUM16) { - throw new Exception("Illegal Character."); - } - this.barCodePreviewPane.setObject(BarCodeUtils.getBarcodeImpl(this.updateBean().getBarcode(), getTestText())); - } catch (Exception exp) { - this.barCodePreviewPane.setObject(Inter.getLocText("Error") + ": " + exp.getMessage()); - } - } - - /** - * - */ - public void reset() { - populateBean(new BarcodePresent()); - } - - @Override - public void populateBean(BarcodePresent ob) { - BarcodeAttr barcodeAttr = ob.getBarcode(); - if (barcodeAttr == null) { - barcodeAttr = new BarcodeAttr(); - } - this.setTestText(BarCodeUtils.getTestTextByBarCode(barcodeAttr.getType())); - this.typeComboBox.setSelectedIndex(barcodeAttr.getType()); - this.barWidthSpinner.setValue(new Double(barcodeAttr.getBarWidth())); - this.barHeightSpinner.setValue(new Integer(barcodeAttr.getBarHeight())); - this.drawingTextCheckBox.setSelected(barcodeAttr.isDrawingText()); - this.RCodesizespinner.setValue(new Integer(barcodeAttr.getRcodeDrawPix())); - this.repaintPreviewBarCode(); - } - - @Override - public BarcodePresent updateBean() { - BarcodeAttr barcodeAttr = new BarcodeAttr(); - if ((typeComboBox.getSelectedIndex() == NUM16)) { - barcodeAttr.setRCodeVersion(this.RCodeVersionComboBox.getSelectedIndex()); - barcodeAttr.setRCodeErrorCorrect(this.RCodeErrorCorrectComboBox.getSelectedIndex()); - barcodeAttr.setRcodeDrawPix(((Integer) this.RCodesizespinner.getValue()).intValue()); - } - barcodeAttr.setType(this.typeComboBox.getSelectedIndex()); - barcodeAttr.setBarWidth(((Double) this.barWidthSpinner.getValue()).doubleValue() / 10); - barcodeAttr.setBarHeight(((Integer) this.barHeightSpinner.getValue()).intValue()); - barcodeAttr.setDrawingText(this.drawingTextCheckBox.isSelected()); - return new BarcodePresent(barcodeAttr); - } - - public void setTestText(String testText) { - this.testText = testText; - } - - public String getTestText() { - return testText; - } - - private static class BarCodePreviewPane extends JPanel { - private Object obj; - - public BarCodePreviewPane() { -// setBackground(Color.WHITE); - } - - /** - * BarcodeImpl or Error String. - */ - public void setObject(Object obj) { - this.obj = obj; - GUICoreUtils.repaint(this); - } - - @Override - public void paintComponent(Graphics g) { - super.paintComponent(g); - if (obj == null) { - return; - } - if (obj instanceof BarcodeImpl) { - BarcodeImpl barcodeImpl = (BarcodeImpl) obj; - Dimension size = this.getSize(); - barcodeImpl.draw((Graphics2D) g, (int) (size.getWidth() - barcodeImpl.getWidth()) / 2, (int) (size.getHeight() - barcodeImpl.getHeight()) / 2); - } else { - // 在中央画出字符. - Graphics2D graphics2D = (Graphics2D) g; - graphics2D.setPaint(Color.RED); - Map map = new HashMap(); - map.put(TextAttribute.SIZE, new Float(14.0)); - AttributedString vanGogh = new AttributedString(obj.toString(), map); - AttributedCharacterIterator paragraph = vanGogh.getIterator(); - int paragraphStart = paragraph.getBeginIndex(); - int paragraphEnd = paragraph.getEndIndex(); - // Create a new LineBreakMeasurer from the paragraph. - AffineTransform tx = null; - LineBreakMeasurer lineMeasurer = new LineBreakMeasurer(paragraph, new FontRenderContext(tx, false, false)); - // Set formatting width to width of Component. - Dimension size = getSize(); - float formatWidth = size.width; - float drawPosY = 0; - lineMeasurer.setPosition(paragraphStart); - // Get lines from lineMeasurer until the entire - // paragraph has been displayed. - while (lineMeasurer.getPosition() < paragraphEnd) { - // Retrieve next layout. - TextLayout layout = lineMeasurer.nextLayout(formatWidth); - // Move y-coordinate by the ascent of the layout. - drawPosY += layout.getAscent(); - // Compute pen x position. If the paragraph is - // right-to-left, we want to align the TextLayouts - // to the right edge of the panel. - float drawPosX; - if (layout.isLeftToRight()) { - drawPosX = 0; - } else { - drawPosX = formatWidth - layout.getAdvance(); - } - // Draw the TextLayout at (drawPosX, drawPosY). - layout.draw(graphics2D, drawPosX, drawPosY); - // Move y-coordinate in preparation for next layout. - drawPosY += layout.getDescent() + layout.getLeading(); - } - } - } - } - - @Override - /** - * - */ - public boolean accept(Object ob) { - return ob instanceof BarcodePresent; - } +package com.fr.design.present; + +import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.border.UIRoundedBorder; +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.icombobox.UIComboBoxRenderer; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UIBasicSpinner; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.Inter; +import com.fr.report.cell.cellattr.BarcodeAttr; +import com.fr.report.cell.cellattr.BarcodePresent; +import com.fr.report.cell.painter.barcode.BarcodeImpl; +import com.fr.report.cell.painter.barcode.core.BarCodeUtils; +import com.fr.stable.pinyin.ChineseHelper; + +import javax.swing.*; +import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.font.FontRenderContext; +import java.awt.font.LineBreakMeasurer; +import java.awt.font.TextAttribute; +import java.awt.font.TextLayout; +import java.awt.geom.AffineTransform; +import java.text.AttributedCharacterIterator; +import java.text.AttributedString; +import java.util.HashMap; +import java.util.Map; + +/** + * @author zhou + * @since 2012-6-4下午6:49:59 + */ +public class BarCodePane extends FurtherBasicBeanPane { + private final int NUM16 = 16; + private BarCodePreviewPane barCodePreviewPane; + private UIComboBox typeComboBox; + private UIBasicSpinner barWidthSpinner; + private UIBasicSpinner barHeightSpinner; + private UIBasicSpinner RCodesizespinner; + private UICheckBox drawingTextCheckBox; + private UIComboBox RCodeVersionComboBox; + private UIComboBox RCodeErrorCorrectComboBox; + private UILabel typeSetLabel; + + private String testText = "12345"; + + public BarCodePane() { + this.initComponents(); + addlistener(); + } + + public static void main(String[] args) { + JFrame jf = new JFrame("test"); + jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + JPanel content = (JPanel) jf.getContentPane(); + content.setLayout(new BorderLayout()); + content.add(new BarCodePane(), BorderLayout.CENTER); + GUICoreUtils.centerWindow(jf); + jf.setSize(270, 400); + jf.setVisible(true); + } + + private void initComponents() { + barCodePreviewPane = new BarCodePreviewPane(); + this.barWidthSpinner = new UIBasicSpinner(new SpinnerNumberModel(10.0, 1, 100, 1.0)); + this.barHeightSpinner = new UIBasicSpinner(new SpinnerNumberModel(30, 1, 100, 1)); + this.barWidthSpinner.setPreferredSize(new Dimension(60, 20)); + this.barHeightSpinner.setPreferredSize(new Dimension(60, 20)); + JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + TitledBorder titledBorder = new TitledBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5), Inter.getLocText("StyleFormat-Sample"), 4, 2, this.getFont(), UIConstants.LINE_COLOR); + borderPane.setBorder(titledBorder); + borderPane.add(barCodePreviewPane, BorderLayout.CENTER); + setTypeComboBox(); + setSome(); + RCodesizespinner = new UIBasicSpinner(new SpinnerNumberModel(2, 1, 6, 1)); + RCodeVersionComboBox = new UIComboBox(); + RCodeErrorCorrectComboBox = new UIComboBox(); + typeSetLabel = new UILabel(Inter.getLocText("Type_Set"), UILabel.RIGHT); + initVersionComboBox(); + initErrorCorrectComboBox(); + + drawingTextCheckBox = new UICheckBox(Inter.getLocText("BarCodeD-Drawing_Text")); + drawingTextCheckBox.setSelected(true); + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p, f}; + double[] rowSize = {p, p, p, p, p, p, p, p}; + barCodePreviewPane.setPreferredSize(new Dimension(0, 125)); + final JPanel centerPane = new JPanel(new CardLayout()); + + Component[][] components = new Component[][]{ + new Component[]{typeSetLabel, typeComboBox}, + new Component[]{borderPane, null}, + new Component[]{centerPane, null} + }; + JPanel barCode = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + centerPane.add(getNormalPane(), "normal"); + centerPane.add(getSpecialPane(), "special"); + typeComboBox.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + CardLayout cardLayout = (CardLayout) centerPane.getLayout(); + cardLayout.show(centerPane, typeComboBox.getSelectedIndex() == NUM16 ? "special" : "normal"); + setTestText(BarCodeUtils.getTestTextByBarCode(typeComboBox.getSelectedIndex())); + repaintPreviewBarCode(); + } + }); + this.setLayout(new BorderLayout()); + this.add(barCode, BorderLayout.CENTER); + } + + private void setTypeComboBox() { + typeComboBox = new UIComboBox(BarCodeUtils.getAllSupportedBarCodeTypeArray()); + typeComboBox.setRenderer(new UIComboBoxRenderer() { + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + + if (value instanceof Integer) { + this.setText(" " + BarCodeUtils.getBarCodeTypeName(((Integer) value).intValue())); + } + return this; + } + }); + } + + private void setSome() { + JFormattedTextField heightTextField = ((JSpinner.DefaultEditor) barHeightSpinner.getEditor()).getTextField(); + heightTextField.setColumns(2); + + JFormattedTextField widthTextField = ((JSpinner.DefaultEditor) barWidthSpinner.getEditor()).getTextField(); + widthTextField.setColumns(2); + } + + private JPanel getNormalPane() { + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p, p, p, p, p, p, p}; + double[] columnSize1 = {p, f, f}; + JPanel barWidthContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 2, 0)); + barWidthContainer.add(barWidthSpinner); + JPanel barHeightContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 2, 0)); + barHeightContainer.add(barHeightSpinner); + UILabel uiLabel = new UILabel(Inter.getLocText("Tree-Width") + ":", UILabel.RIGHT); + uiLabel.setPreferredSize(typeSetLabel.getPreferredSize()); + Component[][] components_normal = new Component[][]{ + new Component[]{new UILabel("条形码大小", UILabel.LEFT), barWidthContainer, barHeightContainer}, + new Component[]{null, new UILabel(Inter.getLocText("Tree-Width"), UILabel.CENTER), new UILabel(Inter.getLocText("Height"), UILabel.CENTER)}, + new Component[]{drawingTextCheckBox, null, null} + }; + + + JPanel normalPane = TableLayoutHelper.createTableLayoutPane(components_normal, rowSize, columnSize1); + return normalPane; + } + + + private JPanel getSpecialPane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize1 = {p, p}; + double[] rowSize = {p, p, p, p, p, p, p, p}; + UILabel uiLabel = new UILabel(Inter.getLocText("RCodeVersion") + ":", UILabel.RIGHT); + uiLabel.setPreferredSize(typeSetLabel.getPreferredSize()); + Component[][] components_special = new Component[][]{ + new Component[]{uiLabel, RCodeVersionComboBox}, + new Component[]{new UILabel(Inter.getLocText("RCodeErrorCorrect") + ":", UILabel.RIGHT), RCodeErrorCorrectComboBox}, + new Component[]{new UILabel(Inter.getLocText("RCodeDrawPix") + ":", UILabel.RIGHT), RCodesizespinner} + }; + + JPanel specialPane = TableLayoutHelper.createTableLayoutPane(components_special, rowSize, columnSize1); + return specialPane; + } + + private void addlistener() { + RCodesizespinner.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + repaintPreviewBarCode(); + } + }); + RCodeVersionComboBox.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + repaintPreviewBarCode(); + } + }); + RCodeErrorCorrectComboBox.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + repaintPreviewBarCode(); + } + }); + this.barWidthSpinner.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + repaintPreviewBarCode(); + } + }); + this.barHeightSpinner.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + repaintPreviewBarCode(); + } + }); + drawingTextCheckBox.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + repaintPreviewBarCode(); + } + }); + repaintPreviewBarCode(); + } + + @Override + /** + * + */ + public String title4PopupWindow() { + return Inter.getLocText("Highlight-Barcode"); + } + + private void initVersionComboBox() { + String[] array = {Inter.getLocText(new String[]{"Auto", "Choose"}), "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"}; + initcombobox(this.RCodeVersionComboBox, array, 0); + } + + private void initErrorCorrectComboBox() { + String[] array = {"L" + Inter.getLocText("Level") + "7%", "M" + Inter.getLocText("Level") + "15%", "Q" + Inter.getLocText("Level") + "25%", "H" + Inter.getLocText("Level") + "30%"}; + initcombobox(this.RCodeErrorCorrectComboBox, array, 1); + } + + private void initcombobox(UIComboBox combobox, String[] array, int index) { + combobox.removeAllItems(); + for (int i = 0; i < array.length; i++) { + combobox.addItem(array[i]); + } + combobox.setSelectedIndex(index); + } + + private void repaintPreviewBarCode() { + try { + // carl:不支持中文转条形码 + if (ChineseHelper.containChinese(getTestText()) && this.typeComboBox.getSelectedIndex() != NUM16) { + throw new Exception("Illegal Character."); + } + this.barCodePreviewPane.setObject(BarCodeUtils.getBarcodeImpl(this.updateBean().getBarcode(), getTestText())); + } catch (Exception exp) { + this.barCodePreviewPane.setObject(Inter.getLocText("Error") + ": " + exp.getMessage()); + } + } + + /** + * + */ + public void reset() { + populateBean(new BarcodePresent()); + } + + @Override + public void populateBean(BarcodePresent ob) { + BarcodeAttr barcodeAttr = ob.getBarcode(); + if (barcodeAttr == null) { + barcodeAttr = new BarcodeAttr(); + } + this.setTestText(BarCodeUtils.getTestTextByBarCode(barcodeAttr.getType())); + this.typeComboBox.setSelectedIndex(barcodeAttr.getType()); + this.barWidthSpinner.setValue(new Double(barcodeAttr.getBarWidth())); + this.barHeightSpinner.setValue(new Integer(barcodeAttr.getBarHeight())); + this.drawingTextCheckBox.setSelected(barcodeAttr.isDrawingText()); + this.RCodesizespinner.setValue(new Integer(barcodeAttr.getRcodeDrawPix())); + this.repaintPreviewBarCode(); + } + + @Override + public BarcodePresent updateBean() { + BarcodeAttr barcodeAttr = new BarcodeAttr(); + if ((typeComboBox.getSelectedIndex() == NUM16)) { + barcodeAttr.setRCodeVersion(this.RCodeVersionComboBox.getSelectedIndex()); + barcodeAttr.setRCodeErrorCorrect(this.RCodeErrorCorrectComboBox.getSelectedIndex()); + barcodeAttr.setRcodeDrawPix(((Integer) this.RCodesizespinner.getValue()).intValue()); + } + barcodeAttr.setType(this.typeComboBox.getSelectedIndex()); + barcodeAttr.setBarWidth(((Double) this.barWidthSpinner.getValue()).doubleValue() / 10); + barcodeAttr.setBarHeight(((Integer) this.barHeightSpinner.getValue()).intValue()); + barcodeAttr.setDrawingText(this.drawingTextCheckBox.isSelected()); + return new BarcodePresent(barcodeAttr); + } + + public void setTestText(String testText) { + this.testText = testText; + } + + public String getTestText() { + return testText; + } + + private static class BarCodePreviewPane extends JPanel { + private Object obj; + + public BarCodePreviewPane() { +// setBackground(Color.WHITE); + } + + /** + * BarcodeImpl or Error String. + */ + public void setObject(Object obj) { + this.obj = obj; + GUICoreUtils.repaint(this); + } + + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); + if (obj == null) { + return; + } + if (obj instanceof BarcodeImpl) { + BarcodeImpl barcodeImpl = (BarcodeImpl) obj; + Dimension size = this.getSize(); + barcodeImpl.draw((Graphics2D) g, (int) (size.getWidth() - barcodeImpl.getWidth()) / 2, (int) (size.getHeight() - barcodeImpl.getHeight()) / 2); + } else { + // 在中央画出字符. + Graphics2D graphics2D = (Graphics2D) g; + graphics2D.setPaint(Color.RED); + Map map = new HashMap(); + map.put(TextAttribute.SIZE, new Float(14.0)); + AttributedString vanGogh = new AttributedString(obj.toString(), map); + AttributedCharacterIterator paragraph = vanGogh.getIterator(); + int paragraphStart = paragraph.getBeginIndex(); + int paragraphEnd = paragraph.getEndIndex(); + // Create a new LineBreakMeasurer from the paragraph. + AffineTransform tx = null; + LineBreakMeasurer lineMeasurer = new LineBreakMeasurer(paragraph, new FontRenderContext(tx, false, false)); + // Set formatting width to width of Component. + Dimension size = getSize(); + float formatWidth = size.width; + float drawPosY = 0; + lineMeasurer.setPosition(paragraphStart); + // Get lines from lineMeasurer until the entire + // paragraph has been displayed. + while (lineMeasurer.getPosition() < paragraphEnd) { + // Retrieve next layout. + TextLayout layout = lineMeasurer.nextLayout(formatWidth); + // Move y-coordinate by the ascent of the layout. + drawPosY += layout.getAscent(); + // Compute pen x position. If the paragraph is + // right-to-left, we want to align the TextLayouts + // to the right edge of the panel. + float drawPosX; + if (layout.isLeftToRight()) { + drawPosX = 0; + } else { + drawPosX = formatWidth - layout.getAdvance(); + } + // Draw the TextLayout at (drawPosX, drawPosY). + layout.draw(graphics2D, drawPosX, drawPosY); + // Move y-coordinate in preparation for next layout. + drawPosY += layout.getDescent() + layout.getLeading(); + } + } + } + } + + @Override + /** + * + */ + public boolean accept(Object ob) { + return ob instanceof BarcodePresent; + } } \ No newline at end of file diff --git a/designer/src/com/fr/design/present/CurrencyLinePane.java b/designer/src/com/fr/design/present/CurrencyLinePane.java index b6e0ff853..7922f2186 100644 --- a/designer/src/com/fr/design/present/CurrencyLinePane.java +++ b/designer/src/com/fr/design/present/CurrencyLinePane.java @@ -1,231 +1,231 @@ -package com.fr.design.present; - -import com.fr.design.beans.FurtherBasicBeanPane; -import com.fr.design.border.UIRoundedBorder; -import com.fr.design.constants.UIConstants; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UIBasicSpinner; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.Inter; -import com.fr.report.cell.cellattr.CurrencyLineAttr; -import com.fr.report.cell.cellattr.CurrencyLinePresent; -import com.fr.report.cell.painter.barcode.BarcodeException; -import com.fr.report.core.CurrencyLineImpl; - -import javax.swing.*; -import javax.swing.border.TitledBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import java.awt.*; - -/** - * @author zhou - * @since 2012-6-4下午7:34:52 - */ -public class CurrencyLinePane extends FurtherBasicBeanPane { - private static final int VS_NUM = 4; - private static final int VG_NUM = 6; - private UIBasicSpinner intPartSpinner; - private UIBasicSpinner deciPartSpinner; - private UITextField textField; - private CurrencyLinePreviewPane CurrencyLinePreviewPane; - private int intPart = 9; - private int deciPart = 3; - - private static final int POSITION = 8; - ChangeListener listener2 = new ChangeListener() { - - @Override - public void stateChanged(ChangeEvent e) { - CurrencyLinePreviewPane.setObject(textField.getText(), update()); - } - - }; - - DocumentListener listener = new DocumentListener() { - @Override - public void insertUpdate(DocumentEvent e) { - CurrencyLinePreviewPane.setObject(textField.getText(), update()); - } - - @Override - public void removeUpdate(DocumentEvent e) { - CurrencyLinePreviewPane.setObject(textField.getText(), update()); - } - - @Override - public void changedUpdate(DocumentEvent e) { - CurrencyLinePreviewPane.setObject(textField.getText(), update()); - } - }; - - public CurrencyLinePane() { - this.initComponents(); - } - - protected void initComponents() { - // 整数位选择 - intPartSpinner = new UIBasicSpinner(new SpinnerNumberModel(9, 1, 20, 1)); - intPartSpinner.setPreferredSize(new Dimension(135, 20)); - - // 小数位选择 - deciPartSpinner = new UIBasicSpinner(new SpinnerNumberModel(2, 1, 10, 1)); - deciPartSpinner.setPreferredSize(new Dimension(135, 20)); - // 预览区域 - textField = new UITextField(10); - - CurrencyLinePreviewPane = new CurrencyLinePreviewPane(); - CurrencyLinePreviewPane.setPreferredSize(new Dimension(0, 145)); - JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - TitledBorder titledBorder = new TitledBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5), Inter.getLocText("StyleFormat-Sample"), 4, 2, this.getFont(), UIConstants.LINE_COLOR); - borderPane.setBorder(titledBorder); - borderPane.add(CurrencyLinePreviewPane, BorderLayout.CENTER); - - textField.requestFocus(); - - double vs = VS_NUM; - double vg = VG_NUM; - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p, p, p}; - - - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Data"), UILabel.LEFT), textField}, - new Component[]{borderPane, null}, - new Component[]{new UILabel(Inter.getLocText("IntPart"), UILabel.LEFT), groupPane(intPartSpinner)}, - new Component[]{new UILabel(Inter.getLocText("DeciPart"), UILabel.LEFT), groupPane(deciPartSpinner)} - - }; - - JPanel linePane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - this.setLayout(new BorderLayout()); - this.add(linePane, BorderLayout.CENTER); - - - textField.getDocument().addDocumentListener(listener); - intPartSpinner.addChangeListener(listener2); - deciPartSpinner.addChangeListener(listener2); - textField.setText("123456.78"); - } - - @Override - /** - * 窗口名 - * @return 同上 - */ - public String title4PopupWindow() { - return Inter.getLocText("Currency_Line"); - } - - /** - * - */ - public CurrencyLineAttr update() { - CurrencyLineAttr currencylineAttr = new CurrencyLineAttr(); - currencylineAttr.setintPart(((Integer) this.intPartSpinner.getValue()).intValue()); - currencylineAttr.setdeciPart(((Integer) this.deciPartSpinner.getValue()).intValue()); - return currencylineAttr; - } - - /** - * - */ - public void setintPart(int intpart) { - this.intPart = intpart; - } - - /** - * - */ - public void setdeciPart(int decipart) { - this.deciPart = decipart; - } - - private class CurrencyLinePreviewPane extends JPanel { - private String text; - CurrencyLineAttr currencyLineAttr; - - public CurrencyLinePreviewPane() { -// setBackground(Color.WHITE); - } - - public void setObject(String text, CurrencyLineAttr currencyLineAttr) { - this.text = text; - this.currencyLineAttr = currencyLineAttr; - GUICoreUtils.repaint(this); - } - - @Override - public void paintComponent(Graphics g) { - super.paintComponent(g); - if (text == null) { - return; - } - Dimension size = this.getSize(); - try { - CurrencyLineImpl currencyLineImpl = new CurrencyLineImpl(text, currencyLineAttr); - currencyLineImpl.draw((Graphics2D) g, (int) (size.getWidth()), (int) (size.getHeight())); - } catch (BarcodeException e) { - Color oldColor = g.getColor(); - g.setColor(Color.red); - g.drawString(e.getMessage(), (int) (size.getWidth() / POSITION), (int) (size.getHeight() / POSITION)); - g.setColor(oldColor); - } - } - - } - - protected static JPanel groupPane(JComponent comp) { - JPanel jp = new JPanel(); - jp.setBorder(null); - jp.setLayout(new FlowLayout(FlowLayout.LEFT)); - jp.add(comp); - return jp; - } - - @Override - /** - * 是否为该类型 - * @param ob 对象 - * @return 同上 - * - */ - public boolean accept(Object ob) { - return ob instanceof CurrencyLinePresent; - } - - /** - * 重置 - */ - public void reset() { - this.intPartSpinner.setValue(9); - this.deciPartSpinner.setValue(3); - } - - @Override - public void populateBean(CurrencyLinePresent ob) { - CurrencyLineAttr currencyLine = ob.getCurrencyLineAttr(); - if (currencyLine == null) { - currencyLine = new CurrencyLineAttr(); - } - this.intPartSpinner.setValue(new Integer(currencyLine.getintPart())); - this.deciPartSpinner.setValue(new Integer(currencyLine.getdeciPart())); - } - - @Override - public CurrencyLinePresent updateBean() { - CurrencyLineAttr currencylineAttr = new CurrencyLineAttr(); - currencylineAttr.setintPart(((Integer) this.intPartSpinner.getValue()).intValue()); - currencylineAttr.setdeciPart(((Integer) this.deciPartSpinner.getValue()).intValue()); - return new CurrencyLinePresent(currencylineAttr); - } - +package com.fr.design.present; + +import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.border.UIRoundedBorder; +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UIBasicSpinner; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.Inter; +import com.fr.report.cell.cellattr.CurrencyLineAttr; +import com.fr.report.cell.cellattr.CurrencyLinePresent; +import com.fr.report.cell.painter.barcode.BarcodeException; +import com.fr.report.core.CurrencyLineImpl; + +import javax.swing.*; +import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import java.awt.*; + +/** + * @author zhou + * @since 2012-6-4下午7:34:52 + */ +public class CurrencyLinePane extends FurtherBasicBeanPane { + private static final int VS_NUM = 4; + private static final int VG_NUM = 6; + private UIBasicSpinner intPartSpinner; + private UIBasicSpinner deciPartSpinner; + private UITextField textField; + private CurrencyLinePreviewPane CurrencyLinePreviewPane; + private int intPart = 9; + private int deciPart = 3; + + private static final int POSITION = 8; + ChangeListener listener2 = new ChangeListener() { + + @Override + public void stateChanged(ChangeEvent e) { + CurrencyLinePreviewPane.setObject(textField.getText(), update()); + } + + }; + + DocumentListener listener = new DocumentListener() { + @Override + public void insertUpdate(DocumentEvent e) { + CurrencyLinePreviewPane.setObject(textField.getText(), update()); + } + + @Override + public void removeUpdate(DocumentEvent e) { + CurrencyLinePreviewPane.setObject(textField.getText(), update()); + } + + @Override + public void changedUpdate(DocumentEvent e) { + CurrencyLinePreviewPane.setObject(textField.getText(), update()); + } + }; + + public CurrencyLinePane() { + this.initComponents(); + } + + protected void initComponents() { + // 整数位选择 + intPartSpinner = new UIBasicSpinner(new SpinnerNumberModel(9, 1, 20, 1)); + intPartSpinner.setPreferredSize(new Dimension(158, 20)); + + // 小数位选择 + deciPartSpinner = new UIBasicSpinner(new SpinnerNumberModel(2, 1, 10, 1)); + deciPartSpinner.setPreferredSize(new Dimension(158, 20)); + // 预览区域 + textField = new UITextField(10); + + CurrencyLinePreviewPane = new CurrencyLinePreviewPane(); + CurrencyLinePreviewPane.setPreferredSize(new Dimension(0, 145)); + JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + TitledBorder titledBorder = new TitledBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5), Inter.getLocText("StyleFormat-Sample"), 4, 2, this.getFont(), UIConstants.LINE_COLOR); + borderPane.setBorder(titledBorder); + borderPane.add(CurrencyLinePreviewPane, BorderLayout.CENTER); + + textField.requestFocus(); + + double vs = VS_NUM; + double vg = VG_NUM; + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p, f}; + double[] rowSize = {p, p, p, p}; + + + Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("Data"), UILabel.LEFT), textField}, + new Component[]{borderPane, null}, + new Component[]{new UILabel(Inter.getLocText("IntPart"), UILabel.LEFT), groupPane(intPartSpinner)}, + new Component[]{new UILabel(Inter.getLocText("DeciPart"), UILabel.LEFT), groupPane(deciPartSpinner)} + + }; + + JPanel linePane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + this.setLayout(new BorderLayout()); + this.add(linePane, BorderLayout.CENTER); + + + textField.getDocument().addDocumentListener(listener); + intPartSpinner.addChangeListener(listener2); + deciPartSpinner.addChangeListener(listener2); + textField.setText("123456.78"); + } + + @Override + /** + * 窗口名 + * @return 同上 + */ + public String title4PopupWindow() { + return Inter.getLocText("Currency_Line"); + } + + /** + * + */ + public CurrencyLineAttr update() { + CurrencyLineAttr currencylineAttr = new CurrencyLineAttr(); + currencylineAttr.setintPart(((Integer) this.intPartSpinner.getValue()).intValue()); + currencylineAttr.setdeciPart(((Integer) this.deciPartSpinner.getValue()).intValue()); + return currencylineAttr; + } + + /** + * + */ + public void setintPart(int intpart) { + this.intPart = intpart; + } + + /** + * + */ + public void setdeciPart(int decipart) { + this.deciPart = decipart; + } + + private class CurrencyLinePreviewPane extends JPanel { + private String text; + CurrencyLineAttr currencyLineAttr; + + public CurrencyLinePreviewPane() { +// setBackground(Color.WHITE); + } + + public void setObject(String text, CurrencyLineAttr currencyLineAttr) { + this.text = text; + this.currencyLineAttr = currencyLineAttr; + GUICoreUtils.repaint(this); + } + + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); + if (text == null) { + return; + } + Dimension size = this.getSize(); + try { + CurrencyLineImpl currencyLineImpl = new CurrencyLineImpl(text, currencyLineAttr); + currencyLineImpl.draw((Graphics2D) g, (int) (size.getWidth()), (int) (size.getHeight())); + } catch (BarcodeException e) { + Color oldColor = g.getColor(); + g.setColor(Color.red); + g.drawString(e.getMessage(), (int) (size.getWidth() / POSITION), (int) (size.getHeight() / POSITION)); + g.setColor(oldColor); + } + } + + } + + protected static JPanel groupPane(JComponent comp) { + JPanel jp = new JPanel(); + jp.setBorder(null); + jp.setLayout(new FlowLayout(FlowLayout.LEFT)); + jp.add(comp); + return jp; + } + + @Override + /** + * 是否为该类型 + * @param ob 对象 + * @return 同上 + * + */ + public boolean accept(Object ob) { + return ob instanceof CurrencyLinePresent; + } + + /** + * 重置 + */ + public void reset() { + this.intPartSpinner.setValue(9); + this.deciPartSpinner.setValue(3); + } + + @Override + public void populateBean(CurrencyLinePresent ob) { + CurrencyLineAttr currencyLine = ob.getCurrencyLineAttr(); + if (currencyLine == null) { + currencyLine = new CurrencyLineAttr(); + } + this.intPartSpinner.setValue(new Integer(currencyLine.getintPart())); + this.deciPartSpinner.setValue(new Integer(currencyLine.getdeciPart())); + } + + @Override + public CurrencyLinePresent updateBean() { + CurrencyLineAttr currencylineAttr = new CurrencyLineAttr(); + currencylineAttr.setintPart(((Integer) this.intPartSpinner.getValue()).intValue()); + currencylineAttr.setdeciPart(((Integer) this.deciPartSpinner.getValue()).intValue()); + return new CurrencyLinePresent(currencylineAttr); + } + } \ No newline at end of file diff --git a/designer/src/com/fr/design/widget/WidgetPane.java b/designer/src/com/fr/design/widget/WidgetPane.java index f26b1a19a..c4ce0f563 100644 --- a/designer/src/com/fr/design/widget/WidgetPane.java +++ b/designer/src/com/fr/design/widget/WidgetPane.java @@ -120,6 +120,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener public void populate(Widget widget) { if (widget == null) { + editorTypeComboBox.setSelectedIndex(-1); return; } diff --git a/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java b/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java index b53e003e6..fcb3f2dcc 100644 --- a/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java @@ -20,7 +20,6 @@ public class ButtonDefinePane extends AbstractDataModify