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 {
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);
}

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 {
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);
}
/**

4
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);
}

4
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) {

79
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<Editor> 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();
}
}

Loading…
Cancel
Save