Browse Source

修改代码质量

master
mengao 7 years ago
parent
commit
cc03fe5bc6
  1. 10
      designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java
  2. 10
      designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java
  3. 3
      designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java
  4. 2
      designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java
  5. 6
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java
  6. 4
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java
  7. 10
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java
  8. 22
      designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java

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

@ -252,7 +252,7 @@ public class ValueEditorPaneFactory {
new DateEditor(true, Inter.getLocText("FR-Designer_Date")), new DateEditor(true, Inter.getLocText("FR-Designer_Date")),
new BooleanEditor(), new BooleanEditor(),
formulaEditor, formulaEditor,
new WidgetNameEditor(Inter.getLocText("Widget")) new WidgetNameEditor(Inter.getLocText("FR-Designer_Widget"))
}; };
} }
@ -316,7 +316,7 @@ public class ValueEditorPaneFactory {
*/ */
public static Editor<?>[] URLEditors(String popupName, String textEditorValue) { public static Editor<?>[] URLEditors(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("FR-Designer_None") : popupName),
new TextEditor() new TextEditor()
}; };
} }
@ -330,7 +330,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("FR-Designer_None") : popupName),
new DateEditor(true, Inter.getLocText("FR-Designer_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"))
}; };
@ -493,12 +493,12 @@ public class ValueEditorPaneFactory {
JPanel paneLeft = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel paneLeft = FRGUIPaneFactory.createBorderLayout_S_Pane();
pane.add(paneLeft); pane.add(paneLeft);
paneLeft.add(new UILabel(" " + Inter.getLocText("Actual_Value") + ":"), BorderLayout.NORTH); paneLeft.add(new UILabel(" " + Inter.getLocText("FR-Designer_Actual_Value") + ":"), BorderLayout.NORTH);
paneLeft.add(keyColumnPane, BorderLayout.CENTER); paneLeft.add(keyColumnPane, BorderLayout.CENTER);
JPanel paneRight = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel paneRight = FRGUIPaneFactory.createBorderLayout_S_Pane();
pane.add(paneRight); pane.add(paneRight);
paneRight.add(new UILabel(" " + Inter.getLocText("Display_Value") + ":"), BorderLayout.NORTH); paneRight.add(new UILabel(" " + Inter.getLocText("FR-Designer_Display_Value") + ":"), BorderLayout.NORTH);
paneRight.add(valueDictPane, BorderLayout.CENTER); paneRight.add(valueDictPane, BorderLayout.CENTER);

10
designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java

@ -86,13 +86,13 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHype
Component[][] components; Component[][] components;
if (!this.needRenamePane) { if (!this.needRenamePane) {
components = new Component[][]{ components = new Component[][]{
{new UILabel(" " + Inter.getLocText("Reportlet") + ":"), reportletNamePane}, {new UILabel(" " + Inter.getLocText("FR-Hyperlink_Reportlet") + ":"), reportletNamePane},
}; };
} else { } else {
itemNameTextField = new UITextField(); itemNameTextField = new UITextField();
components = new Component[][]{ components = new Component[][]{
{new UILabel(" " + Inter.getLocText("Name") + ":"), itemNameTextField}, {new UILabel(" " + Inter.getLocText("FR-Designer-Hyperlink_Name") + ":"), itemNameTextField},
{new UILabel(" " + Inter.getLocText("Reportlet") + ":"), reportletNamePane}, {new UILabel(" " + Inter.getLocText("FR-Hyperlink_Reportlet") + ":"), reportletNamePane},
}; };
} }
JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
@ -134,7 +134,7 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHype
} }
public String getReportletName() { public String getReportletName() {
return StringUtils.isBlank(this.reportPathTextField.getText()) ? "" : this.reportPathTextField.getText().substring(1); return StringUtils.isBlank(this.reportPathTextField.getText()) ? StringUtils.EMPTY : this.reportPathTextField.getText().substring(1);
} }
/** /**
@ -155,7 +155,7 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHype
} }
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
//do nothing
} }
} }

3
designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java

@ -16,6 +16,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> { public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
private final int BORDER_WIDTH = 4;
private WebHyperNorthPane northPane; private WebHyperNorthPane northPane;
private UICheckBox useCJKCheckBox; private UICheckBox useCJKCheckBox;
@ -34,7 +35,7 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); this.setBorder(BorderFactory.createEmptyBorder(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH));
northPane = new WebHyperNorthPane(needRenamePane()); northPane = new WebHyperNorthPane(needRenamePane());
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);

2
designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java

@ -29,7 +29,7 @@ public class ParameterJavaScriptPane extends AbstractHyperLinkPane<ParameterJava
this.add(parameterViewPane, BorderLayout.CENTER); this.add(parameterViewPane, BorderLayout.CENTER);
if (needRenamePane()) { if (needRenamePane()) {
itemNameTextField = new UITextField(); itemNameTextField = new UITextField();
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH); this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Designer-Hyperlink_Name") + ":"), BorderLayout.NORTH);
} }
} }

6
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java

@ -42,19 +42,19 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
if (needRenamePane()) { if (needRenamePane()) {
itemNameTextField = new UITextField(); itemNameTextField = new UITextField();
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH); this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Designer_Name") + ":"), BorderLayout.NORTH);
} }
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
centerPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText(new String[]{"Related", "Cell"}))); centerPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText(new String[]{"Related", "FR-Designer_Cell"})));
colRowPane = new ColumnRowVerticalPane(); colRowPane = new ColumnRowVerticalPane();
centerPane.add(colRowPane, BorderLayout.NORTH); centerPane.add(colRowPane, BorderLayout.NORTH);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters"))); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Parameter")));
parameterViewPane.setPreferredSize(new Dimension(500, 200)); parameterViewPane.setPreferredSize(new Dimension(500, 200));
this.add(parameterViewPane, BorderLayout.SOUTH); this.add(parameterViewPane, BorderLayout.SOUTH);
} }

4
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java

@ -50,7 +50,7 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
if (needRenamePane()) { if (needRenamePane()) {
itemNameTextField = new UITextField(); itemNameTextField = new UITextField();
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH); this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Designer-Hyperlink_Name") + ":"), BorderLayout.NORTH);
} }
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
@ -70,7 +70,7 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
centerPane.add(pane, BorderLayout.NORTH); centerPane.add(pane, BorderLayout.NORTH);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters"))); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Parameter")));
parameterViewPane.setPreferredSize(new Dimension(500, 200)); parameterViewPane.setPreferredSize(new Dimension(500, 200));
this.add(parameterViewPane, BorderLayout.SOUTH); this.add(parameterViewPane, BorderLayout.SOUTH);
} }

10
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java

@ -17,7 +17,7 @@ import java.awt.*;
import java.util.HashMap; import java.util.HashMap;
public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvider> { public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvider> {
private final int BORDER_WIDTH = 4;
private FormHyperlinkNorthPane northPane; private FormHyperlinkNorthPane northPane;
@ -33,7 +33,7 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); this.setBorder(BorderFactory.createEmptyBorder(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH));
northPane = new FormHyperlinkNorthPane(needRenamePane()); northPane = new FormHyperlinkNorthPane(needRenamePane());
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
@ -48,10 +48,8 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
} }
protected int getHyperlinkType() { protected int getHyperlinkType() {
if (northPane.getEditingEditor() != null) { if (northPane.getEditingEditor() != null && northPane.getEditingEditor().acceptType(ElementCaseEditorProvider.class)) {
if (northPane.getEditingEditor().acceptType(ElementCaseEditorProvider.class)) { return FormHyperlinkProvider.ELEMENTCASE;
return FormHyperlinkProvider.ELEMENTCASE;
}
} }
return FormHyperlinkProvider.CHART; return FormHyperlinkProvider.CHART;
} }

22
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java

@ -30,23 +30,23 @@ public class ChartDesignerInteractivePane extends ChartInteractivePane {
} }
protected List<ChartUIMenuNameableCreator> refreshList(HashMap map) { protected List<ChartUIMenuNameableCreator> refreshList(HashMap map) {
List<ChartUIMenuNameableCreator> list = new ArrayList<ChartUIMenuNameableCreator>(); List<ChartUIMenuNameableCreator> list = new ArrayList<ChartUIMenuNameableCreator>();
java.util.HashMap<String, Formula> hyperLinkEditorMap = plot.getHyperLinkEditorMap(); java.util.HashMap<String, Formula> hyperLinkEditorMap = plot.getHyperLinkEditorMap();
list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Hyperlink-Web_link"), list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Hyperlink-Web_link"),
new WebHyperlink(), getUseMap(map, WebHyperlink.class))); new WebHyperlink(), getUseMap(map, WebHyperlink.class)));
list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap,"JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, "FR-Designer_JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class)));
list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("RelatedChart"),null,null)); list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("FR-Engine_Interactive-chart"), null, null));
return list; return list;
} }
protected void populateAutoRefresh(Chart chart){ protected void populateAutoRefresh(Chart chart) {
super.populateAutoRefresh(chart); super.populateAutoRefresh(chart);
if(chart.getFilterDefinition() != null){ if (chart.getFilterDefinition() != null) {
TopDefinition definition = (TopDefinition)chart.getFilterDefinition(); TopDefinition definition = (TopDefinition) chart.getFilterDefinition();
isAutoRefresh.setEnabled(definition.isSupportAutoRefresh()); isAutoRefresh.setEnabled(definition.isSupportAutoRefresh());
if(!isAutoRefresh.isEnabled()){ if (!isAutoRefresh.isEnabled()) {
isAutoRefresh.setSelected(false); isAutoRefresh.setSelected(false);
} }
autoRefreshTime.setEnabled(definition.isSupportAutoRefresh()); autoRefreshTime.setEnabled(definition.isSupportAutoRefresh());

Loading…
Cancel
Save