Browse Source

代码规范

master
MoMeak 7 years ago
parent
commit
a71f01976c
  1. 4
      designer/src/com/fr/design/actions/cell/style/AlignmentAction.java
  2. 4
      designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java
  3. 4
      designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java
  4. 4
      designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java
  5. 79
      designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java

4
designer/src/com/fr/design/actions/cell/style/AlignmentAction.java

@ -21,7 +21,7 @@ import javax.swing.*;
public class AlignmentAction extends ButtonGroupAction implements StyleActionInterface { 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_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_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")}}; {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}; private static final Integer[] valueArray = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
public AlignmentAction(ElementCasePane t) { public AlignmentAction(ElementCasePane t) {
super(t, icons, valueArray); super(t, ICONS, valueArray);
} }

4
designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java

@ -21,13 +21,13 @@ import javax.swing.*;
public class ReportFontBoldAction extends AbstractStyleAction implements ToggleButtonUpdateAction { public class ReportFontBoldAction extends AbstractStyleAction implements ToggleButtonUpdateAction {
private UIToggleButton button; private UIToggleButton button;
protected Style style; 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) { public ReportFontBoldAction(ElementCasePane t) {
super(t); super(t);
this.setName(Inter.getLocText("FRFont-bold")); this.setName(Inter.getLocText("FRFont-bold"));
this.setSmallIcon(icons, true); this.setSmallIcon(ICONS, true);
} }
/** /**

4
designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java

@ -17,13 +17,13 @@ import javax.swing.*;
*/ */
public class ReportFontItalicAction extends ReportFontBoldAction { 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) { public ReportFontItalicAction(ElementCasePane t) {
super(t); super(t);
this.setName(Inter.getLocText("FRFont-italic")); this.setName(Inter.getLocText("FRFont-italic"));
this.setSmallIcon(icons, true); this.setSmallIcon(ICONS, true);
} }

4
designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java

@ -18,13 +18,13 @@ import javax.swing.*;
*/ */
public class ReportFontUnderlineAction extends ReportFontBoldAction { 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) { public ReportFontUnderlineAction(ElementCasePane t) {
super(t); super(t);
this.setName(Inter.getLocText("FRFont-Underline")); this.setName(Inter.getLocText("FRFont-Underline"));
this.setSmallIcon(icons, true); this.setSmallIcon(ICONS, true);
} }
protected void setSelectedFont (Style style) { protected void setSelectedFont (Style style) {

79
designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java

@ -210,7 +210,7 @@ public class ValueEditorPaneFactory {
new TextEditor(), new TextEditor(),
new SpinnerIntegerEditor(), new SpinnerIntegerEditor(),
new DoubleEditor(), new DoubleEditor(),
new DateEditor(true, Inter.getLocText("Date")), new DateEditor(true, Inter.getLocText("FR-Designer_Date")),
new BooleanEditor(), new BooleanEditor(),
formulaEditor formulaEditor
}; };
@ -227,7 +227,7 @@ public class ValueEditorPaneFactory {
new TextEditor(), new TextEditor(),
new IntegerEditor(), new IntegerEditor(),
new DoubleEditor(), new DoubleEditor(),
new DateEditor(true, Inter.getLocText("Date")), new DateEditor(true, Inter.getLocText("FR-Designer_Date")),
new BooleanEditor(), new BooleanEditor(),
formulaEditor, formulaEditor,
new WidgetNameEditor(Inter.getLocText("Widget")) new WidgetNameEditor(Inter.getLocText("Widget"))
@ -245,11 +245,11 @@ public class ValueEditorPaneFactory {
new TextEditor(), new TextEditor(),
new IntegerEditor(), new IntegerEditor(),
new DoubleEditor(), new DoubleEditor(),
new DateEditor(true, Inter.getLocText("Date")), new DateEditor(true, Inter.getLocText("FR-Designer_Date")),
new BooleanEditor(), new BooleanEditor(),
formulaEditor, formulaEditor,
new ParameterEditor(), new ParameterEditor(),
new ColumnRowEditor(Inter.getLocText("Cell")) new ColumnRowEditor(Inter.getLocText("FR-Designer_Cell"))
}; };
} }
@ -264,11 +264,11 @@ public class ValueEditorPaneFactory {
new TextEditor(), new TextEditor(),
new IntegerEditor(), new IntegerEditor(),
new DoubleEditor(), new DoubleEditor(),
new DateEditor(true, Inter.getLocText("Date")), new DateEditor(true, Inter.getLocText("FR-Designer_Date")),
new BooleanEditor(), new BooleanEditor(),
formulaEditor, formulaEditor,
new ParameterEditor(), new ParameterEditor(),
new ColumnRowEditor(Inter.getLocText("Cell")), new ColumnRowEditor(Inter.getLocText("FR-Designer_Cell")),
new ColumnRowGroupEditor(Inter.getLocText("FR-Designer-Cell_Group")) new ColumnRowGroupEditor(Inter.getLocText("FR-Designer-Cell_Group"))
}; };
} }
@ -280,7 +280,7 @@ public class ValueEditorPaneFactory {
*/ */
public static Editor<?>[] cellGroupEditor() { public static Editor<?>[] cellGroupEditor() {
return new Editor[]{ return new Editor[]{
new ColumnRowEditor(Inter.getLocText("Cell")), new ColumnRowEditor(Inter.getLocText("FR-Designer_Cell")),
new ColumnRowGroupEditor(Inter.getLocText("FR-Designer-Cell_Group")) new ColumnRowGroupEditor(Inter.getLocText("FR-Designer-Cell_Group"))
}; };
} }
@ -309,7 +309,7 @@ public class ValueEditorPaneFactory {
public static Editor<?>[] dateEditors(String popupName, String textEditorValue) { public static Editor<?>[] dateEditors(String popupName, String textEditorValue) {
return new Editor[]{ return new Editor[]{
new NoneEditor(textEditorValue, StringUtils.isEmpty(popupName) ? Inter.getLocText("None") : popupName), 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")) new FormulaEditor(Inter.getLocText("FR-Designer_Parameter-Formula"))
}; };
} }
@ -326,11 +326,11 @@ public class ValueEditorPaneFactory {
new TextEditor(), new TextEditor(),
new IntegerEditor(), new IntegerEditor(),
new DoubleEditor(), new DoubleEditor(),
new DateEditor(true, Inter.getLocText("Date")), new DateEditor(true, Inter.getLocText("FR-Designer_Date")),
new BooleanEditor(), new BooleanEditor(),
formulaEditor, formulaEditor,
new ParameterEditor(), new ParameterEditor(),
new ColumnRowEditor(Inter.getLocText("Cell")), new ColumnRowEditor(Inter.getLocText("FR-Designer_Cell")),
new ColumnSelectedEditor(), new ColumnSelectedEditor(),
//23328 allEditors中删除控件选项 //23328 allEditors中删除控件选项
// new WidgetNameEditor(Inter.getLocText("Widget")) // new WidgetNameEditor(Inter.getLocText("Widget"))
@ -347,7 +347,7 @@ public class ValueEditorPaneFactory {
new TextEditor(), new TextEditor(),
new IntegerEditor(), new IntegerEditor(),
new DoubleEditor(), new DoubleEditor(),
new DateEditor(true, Inter.getLocText("Date")), new DateEditor(true, Inter.getLocText("FR-Designer_Date")),
new BooleanEditor(), new BooleanEditor(),
}; };
} }
@ -363,7 +363,7 @@ public class ValueEditorPaneFactory {
new TextEditor(), new TextEditor(),
new IntegerEditor(), new IntegerEditor(),
new DoubleEditor(), new DoubleEditor(),
new DateEditor(true, Inter.getLocText("Date")), new DateEditor(true, Inter.getLocText("FR-Designer_Date")),
new BooleanEditor(), new BooleanEditor(),
formulaEditor, formulaEditor,
new ParameterEditor(), new ParameterEditor(),
@ -393,7 +393,7 @@ public class ValueEditorPaneFactory {
public static Editor<?>[] dateEditors() { public static Editor<?>[] dateEditors() {
FormulaEditor formulaEditor = new FormulaEditor(Inter.getLocText("FR-Designer_Parameter-Formula")); FormulaEditor formulaEditor = new FormulaEditor(Inter.getLocText("FR-Designer_Parameter-Formula"));
return new Editor[]{ return new Editor[]{
new DateEditor(true, Inter.getLocText("Date")), new DateEditor(true, Inter.getLocText("FR-Designer_Date")),
formulaEditor, formulaEditor,
new ParameterEditor(), new ParameterEditor(),
}; };
@ -412,7 +412,7 @@ public class ValueEditorPaneFactory {
new TextEditor(), new TextEditor(),
new IntegerEditor(), new IntegerEditor(),
new DoubleEditor(), new DoubleEditor(),
new DateEditor(true, Inter.getLocText("Date")), new DateEditor(true, Inter.getLocText("FR-Designer_Date")),
new BooleanEditor(), new BooleanEditor(),
formulaEditor formulaEditor
}; };
@ -430,7 +430,7 @@ public class ValueEditorPaneFactory {
list.add(new TextEditor()); list.add(new TextEditor());
list.add(new IntegerEditor()); list.add(new IntegerEditor());
list.add(new DoubleEditor()); 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()); list.add(new BooleanEditor());
FormulaEditor formulaEditor = new FormulaEditor(Inter.getLocText("FR-Designer_Parameter-Formula")); FormulaEditor formulaEditor = new FormulaEditor(Inter.getLocText("FR-Designer_Parameter-Formula"));
@ -447,30 +447,31 @@ public class ValueEditorPaneFactory {
* @return 值编辑器 * @return 值编辑器
*/ */
private static List<Editor> createEditors4Chart(int paraUseType) { private static List<Editor> createEditors4Chart(int paraUseType) {
if (paraUseType == ParameterTableModel.CHART_PIE_USE) { switch (paraUseType) {
return getPieEditor(); case ParameterTableModel.CHART_PIE_USE:
} else if (paraUseType == ParameterTableModel.CHART_MAP_USE) { return getPieEditor();
return getMapEditor(); case ParameterTableModel.CHART_MAP_USE:
} else if (paraUseType == ParameterTableModel.CHART_GIS_USE) { return getMapEditor();
return getGisEditor(); case ParameterTableModel.CHART_GIS_USE:
} else if (paraUseType == ParameterTableModel.CHART__XY_USE) { return getGisEditor();
return getXYEditor(); case ParameterTableModel.CHART__XY_USE:
} else if (paraUseType == ParameterTableModel.CHART_BUBBLE_USE) { return getXYEditor();
return getBubbbleEdtor(); case ParameterTableModel.CHART_BUBBLE_USE:
} else if (paraUseType == ParameterTableModel.CHART_NO_USE) { return getBubbbleEdtor();
return getChartNoUseEditor(); case ParameterTableModel.CHART_NO_USE:
} else if (paraUseType == ParameterTableModel.CHART_METER_USE) { return getChartNoUseEditor();
return getMeterEditor(); case ParameterTableModel.CHART_METER_USE:
} else if (paraUseType == ParameterTableModel.CHART_STOCK_USE) { return getMeterEditor();
return getStockEditor(); case ParameterTableModel.CHART_STOCK_USE:
} else if (paraUseType == ParameterTableModel.CHART_GANTT_USE) { return getStockEditor();
return getGanttEditor(); case ParameterTableModel.CHART_GANTT_USE:
} else if (paraUseType == ParameterTableModel.FORM_ELEMENTCASE_USE) { return getGanttEditor();
return getFormElementCaseEditor(); case ParameterTableModel.FORM_ELEMENTCASE_USE:
} else if (paraUseType == ParameterTableModel.FORM_CHART_USE) { return getFormElementCaseEditor();
return getFormChartEditor(); case ParameterTableModel.FORM_CHART_USE:
} else { return getFormChartEditor();
return getChartEditor(); default:
return getChartEditor();
} }
} }

Loading…
Cancel
Save