Browse Source

修改代码质量

master
mengao 7 years ago
parent
commit
f580d8f3dc
  1. 2
      designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java
  2. 2
      designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java
  3. 6
      designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java
  4. 5
      designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java
  5. 2
      designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java
  6. 108
      designer_base/src/com/fr/design/module/DesignModule.java
  7. 4
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java

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

@ -65,7 +65,7 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHype
reportPathTextField = new UITextField(20); reportPathTextField = new UITextField(20);
reportletNamePane.add(reportPathTextField, BorderLayout.CENTER); reportletNamePane.add(reportPathTextField, BorderLayout.CENTER);
browserButton = new UIButton(Inter.getLocText("Select")); browserButton = new UIButton(Inter.getLocText("FR-Designer_Select"));
browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, 20)); browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, 20));
reportletNamePane.add(browserButton, BorderLayout.EAST); reportletNamePane.add(browserButton, BorderLayout.EAST);
browserButton.addActionListener(new ActionListener() { browserButton.addActionListener(new ActionListener() {

2
designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java

@ -128,7 +128,7 @@ public class ReportletHyperlinkPane extends AbstractHyperLinkPane<ReportletHyper
} }
} }
public static class CHART_NO_RENAME extends ReportletHyperlinkPane { public static class chartNoRename extends ReportletHyperlinkPane {
protected int getChartParaType() { protected int getChartParaType() {
return ParameterTableModel.CHART_NORMAL_USE; return ParameterTableModel.CHART_NORMAL_USE;
} }

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

@ -16,7 +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 final int borderWidth = 4;
private WebHyperNorthPane northPane; private WebHyperNorthPane northPane;
private UICheckBox useCJKCheckBox; private UICheckBox useCJKCheckBox;
@ -35,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(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH)); this.setBorder(BorderFactory.createEmptyBorder(borderWidth, borderWidth, borderWidth, borderWidth));
northPane = new WebHyperNorthPane(needRenamePane()); northPane = new WebHyperNorthPane(needRenamePane());
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
@ -92,7 +92,7 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
webHyperlink.setExtendParameters(this.extendParametersCheckBox.isSelected()); webHyperlink.setExtendParameters(this.extendParametersCheckBox.isSelected());
} }
public static class CHART_NO_RENAME extends WebHyperlinkPane { public static class chartNoRename extends WebHyperlinkPane {
protected boolean needRenamePane() { protected boolean needRenamePane() {
return false; return false;
} }

5
designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java

@ -25,6 +25,7 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> { public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
private final int bottomBorder = 12;
private UITextField itemNameTextField; private UITextField itemNameTextField;
private JSContentPane jsPane; private JSContentPane jsPane;
private UITableEditorPane<String> importedJsPane; private UITableEditorPane<String> importedJsPane;
@ -94,7 +95,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
parameterPane, BorderLayout.EAST parameterPane, BorderLayout.EAST
); );
topPane.setPreferredSize(new Dimension(300, 150)); topPane.setPreferredSize(new Dimension(300, 150));
topPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 12, 0)); topPane.setBorder(BorderFactory.createEmptyBorder(0, 0, bottomBorder, 0));
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(topPane, BorderLayout.NORTH); this.add(topPane, BorderLayout.NORTH);
@ -208,7 +209,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
} }
} }
public static class CHART_NO_RENAME extends JavaScriptImplPane { public static class chartNoRename extends JavaScriptImplPane {
protected int getChartParaType() { protected int getChartParaType() {
return ParameterTableModel.CHART_NORMAL_USE; return ParameterTableModel.CHART_NORMAL_USE;
} }

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

@ -70,7 +70,7 @@ public class ParameterJavaScriptPane extends AbstractHyperLinkPane<ParameterJava
} }
} }
public static class CHART_NO_RENAME extends ParameterJavaScriptPane { public static class chartNoRename extends ParameterJavaScriptPane {
protected int getChartParaType() { protected int getChartParaType() {
return ParameterTableModel.CHART_NORMAL_USE; return ParameterTableModel.CHART_NORMAL_USE;
} }

108
designer_base/src/com/fr/design/module/DesignModule.java

@ -14,7 +14,11 @@ import com.fr.design.mainframe.App;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.ModuleContext; import com.fr.general.ModuleContext;
import com.fr.js.*; import com.fr.js.EmailJavaScript;
import com.fr.js.JavaScriptImpl;
import com.fr.js.ParameterJavaScript;
import com.fr.js.ReportletHyperlink;
import com.fr.js.WebHyperlink;
import com.fr.module.TopModule; import com.fr.module.TopModule;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraDesignClassManagerProvider; import com.fr.stable.plugin.ExtraDesignClassManagerProvider;
@ -32,65 +36,67 @@ import java.util.Set;
* 所有设计器模块的父类 * 所有设计器模块的父类
*/ */
public abstract class DesignModule extends TopModule { public abstract class DesignModule extends TopModule {
public static final String LOCALE_FILE_PATH = "com/fr/design/locale/designer"; public static final String LOCALE_FILE_PATH = "com/fr/design/locale/designer";
public void start() {
super.start(); public void start() {
App<?>[] apps = apps4TemplateOpener(); super.start();
for (App<?> app : apps) { App<?>[] apps = apps4TemplateOpener();
DesignerFrame.registApp(app); for (App<?> app : apps) {
} DesignerFrame.registApp(app);
}
ModuleContext.registerStartedModule(DesignModule.class.getName(), this); ModuleContext.registerStartedModule(DesignModule.class.getName(), this);
StableFactory.registerMarkedClass(ExtraDesignClassManagerProvider.XML_TAG, ExtraDesignClassManager.class); StableFactory.registerMarkedClass(ExtraDesignClassManagerProvider.XML_TAG, ExtraDesignClassManager.class);
ActionFactory.registerCellInsertActionClass(actionsForInsertCellElement()); ActionFactory.registerCellInsertActionClass(actionsForInsertCellElement());
ActionFactory.registerFloatInsertActionClass(actionsForInsertFloatElement()); ActionFactory.registerFloatInsertActionClass(actionsForInsertFloatElement());
DesignModuleFactory.registerCreators4Hyperlink(hyperlinkTypes()); DesignModuleFactory.registerCreators4Hyperlink(hyperlinkTypes());
} }
public boolean isStarted() { public boolean isStarted() {
return ModuleContext.isModuleStarted(DesignModule.class.getName()); return ModuleContext.isModuleStarted(DesignModule.class.getName());
} }
/** /**
* 返回设计器能打开的模板类型的一个数组列表 * 返回设计器能打开的模板类型的一个数组列表
* *
* @return 可以打开的模板类型的数组 * @return 可以打开的模板类型的数组
*/ */
public abstract App<?>[] apps4TemplateOpener(); public abstract App<?>[] apps4TemplateOpener();
/** /**
* 国际化文件路径 * 国际化文件路径
* @return 国际化文件路径 *
*/ * @return 国际化文件路径
public String[] getLocaleFile() { */
return new String[]{LOCALE_FILE_PATH}; public String[] getLocaleFile() {
} return new String[]{LOCALE_FILE_PATH};
}
public Class<?>[] actionsForInsertCellElement() { public Class<?>[] actionsForInsertCellElement() {
List<Class<?>> classes = new ArrayList<>(); List<Class<?>> classes = new ArrayList<>();
Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING);
for (ElementUIProvider provider : providers) { for (ElementUIProvider provider : providers) {
classes.add(provider.actionForInsertCellElement()); classes.add(provider.actionForInsertCellElement());
} }
return classes.toArray(new Class<?>[classes.size()]); return classes.toArray(new Class<?>[classes.size()]);
} }
public Class<?>[] actionsForInsertFloatElement() { public Class<?>[] actionsForInsertFloatElement() {
List<Class<?>> classes = new ArrayList<>(); List<Class<?>> classes = new ArrayList<>();
Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING);
for (ElementUIProvider provider : providers) { for (ElementUIProvider provider : providers) {
classes.add(provider.actionForInsertFloatElement()); classes.add(provider.actionForInsertFloatElement());
} }
return classes.toArray(new Class<?>[classes.size()]); return classes.toArray(new Class<?>[classes.size()]);
} }
public NameableCreator[] hyperlinkTypes() { public NameableCreator[] hyperlinkTypes() {
return new NameableCreator[]{ return new NameableCreator[]{
new NameObjectCreator(Inter.getLocText("FR-Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.CHART_NO_RENAME.class), new NameObjectCreator(Inter.getLocText("FR-Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.chartNoRename.class),
new NameObjectCreator(Inter.getLocText("FR-Designer_Email"), EmailJavaScript.class, EmailPane.class), new NameObjectCreator(Inter.getLocText("FR-Designer_Email"), EmailJavaScript.class, EmailPane.class),
new NameObjectCreator(Inter.getLocText("Hyperlink-Web_link"), WebHyperlink.class, WebHyperlinkPane.CHART_NO_RENAME.class), new NameObjectCreator(Inter.getLocText("Hyperlink-Web_link"), WebHyperlink.class, WebHyperlinkPane.chartNoRename.class),
new NameObjectCreator(Inter.getLocText("JavaScript-Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.CHART_NO_RENAME.class), new NameObjectCreator(Inter.getLocText("JavaScript-Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.chartNoRename.class),
new NameObjectCreator("JavaScript", JavaScriptImpl.class, JavaScriptImplPane.CHART_NO_RENAME.class) new NameObjectCreator("FR-Designer_JavaScript", JavaScriptImpl.class, JavaScriptImplPane.chartNoRename.class)
}; };
} }
} }

4
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 final int borderWidth = 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(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH)); this.setBorder(BorderFactory.createEmptyBorder(borderWidth, borderWidth, borderWidth, borderWidth));
northPane = new FormHyperlinkNorthPane(needRenamePane()); northPane = new FormHyperlinkNorthPane(needRenamePane());
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);

Loading…
Cancel
Save