From a71f01976c475a4a39323f76ce24ec4448f87fc9 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 11 Oct 2017 09:49:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/cell/style/AlignmentAction.java | 4 +- .../cell/style/ReportFontBoldAction.java | 4 +- .../cell/style/ReportFontItalicAction.java | 4 +- .../cell/style/ReportFontUnderlineAction.java | 4 +- .../design/editor/ValueEditorPaneFactory.java | 79 ++++++++++--------- 5 files changed, 48 insertions(+), 47 deletions(-) diff --git a/designer/src/com/fr/design/actions/cell/style/AlignmentAction.java b/designer/src/com/fr/design/actions/cell/style/AlignmentAction.java index b7857fb7ee..acc9b6302b 100644 --- a/designer/src/com/fr/design/actions/cell/style/AlignmentAction.java +++ b/designer/src/com/fr/design/actions/cell/style/AlignmentAction.java @@ -21,7 +21,7 @@ import javax.swing.*; public class AlignmentAction extends ButtonGroupAction implements StyleActionInterface { - private static final Icon[][] icons = new Icon[][]{ + private static final Icon[][] ICONS = new Icon[][]{ {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal_white.png")}, {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal_white.png")}, {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal_white.png")}}; @@ -30,7 +30,7 @@ public class AlignmentAction extends ButtonGroupAction implements StyleActionInt private static final Integer[] valueArray = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT}; public AlignmentAction(ElementCasePane t) { - super(t, icons, valueArray); + super(t, ICONS, valueArray); } diff --git a/designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java b/designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java index 0c1af52b0c..7b62ffb513 100644 --- a/designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java +++ b/designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java @@ -21,13 +21,13 @@ import javax.swing.*; public class ReportFontBoldAction extends AbstractStyleAction implements ToggleButtonUpdateAction { private UIToggleButton button; protected Style style; - private final static Icon[] icons = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold_white.png")}; + private final static Icon[] ICONS = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold_white.png")}; public ReportFontBoldAction(ElementCasePane t) { super(t); this.setName(Inter.getLocText("FRFont-bold")); - this.setSmallIcon(icons, true); + this.setSmallIcon(ICONS, true); } /** diff --git a/designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java b/designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java index 9f9f218859..66e2d97cf0 100644 --- a/designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java +++ b/designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java @@ -17,13 +17,13 @@ import javax.swing.*; */ public class ReportFontItalicAction extends ReportFontBoldAction { - private final static Icon[] icons = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic_white.png")}; + private final static Icon[] ICONS = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic_white.png")}; public ReportFontItalicAction(ElementCasePane t) { super(t); this.setName(Inter.getLocText("FRFont-italic")); - this.setSmallIcon(icons, true); + this.setSmallIcon(ICONS, true); } diff --git a/designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java b/designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java index dc4fbe7880..b44d696ce5 100644 --- a/designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java +++ b/designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java @@ -18,13 +18,13 @@ import javax.swing.*; */ public class ReportFontUnderlineAction extends ReportFontBoldAction { - private final static Icon[] icons = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline_white.png")}; + private final static Icon[] ICONS = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline_white.png")}; public ReportFontUnderlineAction(ElementCasePane t) { super(t); this.setName(Inter.getLocText("FRFont-Underline")); - this.setSmallIcon(icons, true); + this.setSmallIcon(ICONS, true); } protected void setSelectedFont (Style style) { diff --git a/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java b/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java index ebf712cc85..4000176bbd 100644 --- a/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java +++ b/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java @@ -210,7 +210,7 @@ public class ValueEditorPaneFactory { new TextEditor(), new SpinnerIntegerEditor(), new DoubleEditor(), - new DateEditor(true, Inter.getLocText("Date")), + new DateEditor(true, Inter.getLocText("FR-Designer_Date")), new BooleanEditor(), formulaEditor }; @@ -227,7 +227,7 @@ public class ValueEditorPaneFactory { new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, Inter.getLocText("Date")), + new DateEditor(true, Inter.getLocText("FR-Designer_Date")), new BooleanEditor(), formulaEditor, new WidgetNameEditor(Inter.getLocText("Widget")) @@ -245,11 +245,11 @@ public class ValueEditorPaneFactory { new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, Inter.getLocText("Date")), + new DateEditor(true, Inter.getLocText("FR-Designer_Date")), new BooleanEditor(), formulaEditor, new ParameterEditor(), - new ColumnRowEditor(Inter.getLocText("Cell")) + new ColumnRowEditor(Inter.getLocText("FR-Designer_Cell")) }; } @@ -264,11 +264,11 @@ public class ValueEditorPaneFactory { new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, Inter.getLocText("Date")), + new DateEditor(true, Inter.getLocText("FR-Designer_Date")), new BooleanEditor(), formulaEditor, new ParameterEditor(), - new ColumnRowEditor(Inter.getLocText("Cell")), + new ColumnRowEditor(Inter.getLocText("FR-Designer_Cell")), new ColumnRowGroupEditor(Inter.getLocText("FR-Designer-Cell_Group")) }; } @@ -280,7 +280,7 @@ public class ValueEditorPaneFactory { */ public static Editor[] cellGroupEditor() { return new Editor[]{ - new ColumnRowEditor(Inter.getLocText("Cell")), + new ColumnRowEditor(Inter.getLocText("FR-Designer_Cell")), new ColumnRowGroupEditor(Inter.getLocText("FR-Designer-Cell_Group")) }; } @@ -309,7 +309,7 @@ public class ValueEditorPaneFactory { public static Editor[] dateEditors(String popupName, String textEditorValue) { return new Editor[]{ new NoneEditor(textEditorValue, StringUtils.isEmpty(popupName) ? Inter.getLocText("None") : popupName), - new DateEditor(true, Inter.getLocText("Date")), + new DateEditor(true, Inter.getLocText("FR-Designer_Date")), new FormulaEditor(Inter.getLocText("FR-Designer_Parameter-Formula")) }; } @@ -326,11 +326,11 @@ public class ValueEditorPaneFactory { new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, Inter.getLocText("Date")), + new DateEditor(true, Inter.getLocText("FR-Designer_Date")), new BooleanEditor(), formulaEditor, new ParameterEditor(), - new ColumnRowEditor(Inter.getLocText("Cell")), + new ColumnRowEditor(Inter.getLocText("FR-Designer_Cell")), new ColumnSelectedEditor(), //23328 allEditors中删除控件选项 // new WidgetNameEditor(Inter.getLocText("Widget")) @@ -347,7 +347,7 @@ public class ValueEditorPaneFactory { new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, Inter.getLocText("Date")), + new DateEditor(true, Inter.getLocText("FR-Designer_Date")), new BooleanEditor(), }; } @@ -363,7 +363,7 @@ public class ValueEditorPaneFactory { new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, Inter.getLocText("Date")), + new DateEditor(true, Inter.getLocText("FR-Designer_Date")), new BooleanEditor(), formulaEditor, new ParameterEditor(), @@ -393,7 +393,7 @@ public class ValueEditorPaneFactory { public static Editor[] dateEditors() { FormulaEditor formulaEditor = new FormulaEditor(Inter.getLocText("FR-Designer_Parameter-Formula")); return new Editor[]{ - new DateEditor(true, Inter.getLocText("Date")), + new DateEditor(true, Inter.getLocText("FR-Designer_Date")), formulaEditor, new ParameterEditor(), }; @@ -412,7 +412,7 @@ public class ValueEditorPaneFactory { new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, Inter.getLocText("Date")), + new DateEditor(true, Inter.getLocText("FR-Designer_Date")), new BooleanEditor(), formulaEditor }; @@ -430,7 +430,7 @@ public class ValueEditorPaneFactory { list.add(new TextEditor()); list.add(new IntegerEditor()); list.add(new DoubleEditor()); - list.add(new DateEditor(true, Inter.getLocText("Date"))); + list.add(new DateEditor(true, Inter.getLocText("FR-Designer_Date"))); list.add(new BooleanEditor()); FormulaEditor formulaEditor = new FormulaEditor(Inter.getLocText("FR-Designer_Parameter-Formula")); @@ -447,30 +447,31 @@ public class ValueEditorPaneFactory { * @return 值编辑器 */ private static List createEditors4Chart(int paraUseType) { - if (paraUseType == ParameterTableModel.CHART_PIE_USE) { - return getPieEditor(); - } else if (paraUseType == ParameterTableModel.CHART_MAP_USE) { - return getMapEditor(); - } else if (paraUseType == ParameterTableModel.CHART_GIS_USE) { - return getGisEditor(); - } else if (paraUseType == ParameterTableModel.CHART__XY_USE) { - return getXYEditor(); - } else if (paraUseType == ParameterTableModel.CHART_BUBBLE_USE) { - return getBubbbleEdtor(); - } else if (paraUseType == ParameterTableModel.CHART_NO_USE) { - return getChartNoUseEditor(); - } else if (paraUseType == ParameterTableModel.CHART_METER_USE) { - return getMeterEditor(); - } else if (paraUseType == ParameterTableModel.CHART_STOCK_USE) { - return getStockEditor(); - } else if (paraUseType == ParameterTableModel.CHART_GANTT_USE) { - return getGanttEditor(); - } else if (paraUseType == ParameterTableModel.FORM_ELEMENTCASE_USE) { - return getFormElementCaseEditor(); - } else if (paraUseType == ParameterTableModel.FORM_CHART_USE) { - return getFormChartEditor(); - } else { - return getChartEditor(); + switch (paraUseType) { + case ParameterTableModel.CHART_PIE_USE: + return getPieEditor(); + case ParameterTableModel.CHART_MAP_USE: + return getMapEditor(); + case ParameterTableModel.CHART_GIS_USE: + return getGisEditor(); + case ParameterTableModel.CHART__XY_USE: + return getXYEditor(); + case ParameterTableModel.CHART_BUBBLE_USE: + return getBubbbleEdtor(); + case ParameterTableModel.CHART_NO_USE: + return getChartNoUseEditor(); + case ParameterTableModel.CHART_METER_USE: + return getMeterEditor(); + case ParameterTableModel.CHART_STOCK_USE: + return getStockEditor(); + case ParameterTableModel.CHART_GANTT_USE: + return getGanttEditor(); + case ParameterTableModel.FORM_ELEMENTCASE_USE: + return getFormElementCaseEditor(); + case ParameterTableModel.FORM_CHART_USE: + return getFormChartEditor(); + default: + return getChartEditor(); } }