Browse Source

代码质量

bugfix/10.0
zheng 6 years ago
parent
commit
efa104c722
  1. 4
      designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperLinkPane.java
  2. 28
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java
  3. 26
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java
  4. 31
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java

4
designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperLinkPane.java

@ -48,10 +48,6 @@ public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
public void reset() { public void reset() {
} }
protected boolean needAnimatePane() {
return false;
}
protected JPanel createAnimateTypeUIButtonGroup() { protected JPanel createAnimateTypeUIButtonGroup() {
animateTypeUIButtonGroup = new UIButtonGroup<LinkAnimateType>( animateTypeUIButtonGroup = new UIButtonGroup<LinkAnimateType>(
new String[]{LinkAnimateType.RELOAD.toLocaleString(), LinkAnimateType.INCREMENT.toLocaleString()}, new String[]{LinkAnimateType.RELOAD.toLocaleString(), LinkAnimateType.INCREMENT.toLocaleString()},

28
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java

@ -53,9 +53,7 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
colRowPane = new ColumnRowVerticalPane(); colRowPane = new ColumnRowVerticalPane();
centerPane.add(colRowPane, BorderLayout.NORTH); centerPane.add(colRowPane, BorderLayout.NORTH);
if (needAnimatePane()) { addPaneInCenter(centerPane);
centerPane.add(createAnimateTypeUIButtonGroup(), BorderLayout.CENTER);
}
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"))); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
@ -63,6 +61,10 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
this.add(parameterViewPane, BorderLayout.SOUTH); this.add(parameterViewPane, BorderLayout.SOUTH);
} }
protected void addPaneInCenter(JPanel centerPane) {
}
@Override @Override
public void populateBean(ChartHyperRelateCellLink ob) { public void populateBean(ChartHyperRelateCellLink ob) {
if (ob == null) { if (ob == null) {
@ -78,8 +80,6 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
colRowPane.populate(ColumnRow.valueOf("A1")); colRowPane.populate(ColumnRow.valueOf("A1"));
} }
populateAnimateType(ob.getAnimateType());
List parameterList = this.parameterViewPane.update(); List parameterList = this.parameterViewPane.update();
parameterList.clear(); parameterList.clear();
@ -94,7 +94,6 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
if (itemNameTextField != null) { if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText()); chartLink.setItemName(this.itemNameTextField.getText());
} }
chartLink.setAnimateType(updateAnimateType());
return chartLink; return chartLink;
} }
@ -147,8 +146,21 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
super(hyperLinkEditorMap, needRenamePane); super(hyperLinkEditorMap, needRenamePane);
} }
protected boolean needAnimatePane() { @Override
return true; protected void addPaneInCenter(JPanel centerPane) {
centerPane.add(createAnimateTypeUIButtonGroup(), BorderLayout.CENTER);
}
@Override
public void populateBean(ChartHyperRelateCellLink ob) {
super.populateBean(ob);
populateAnimateType(ob.getAnimateType());
}
@Override
public void updateBean(ChartHyperRelateCellLink chartLink) {
super.updateBean(chartLink);
chartLink.setAnimateType(updateAnimateType());
} }
} }

26
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java

@ -71,9 +71,7 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
centerPane.setBorder(border); centerPane.setBorder(border);
centerPane.add(pane, BorderLayout.NORTH); centerPane.add(pane, BorderLayout.NORTH);
if (needAnimatePane()) { addPaneInCenter(centerPane);
centerPane.add(createAnimateTypeUIButtonGroup(), BorderLayout.CENTER);
}
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"))); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
@ -81,6 +79,9 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
this.add(parameterViewPane, BorderLayout.SOUTH); this.add(parameterViewPane, BorderLayout.SOUTH);
} }
protected void addPaneInCenter(JPanel centerPane) {
}
private String[] getFloatNames() { private String[] getFloatNames() {
DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter();
if (adapter != null) { if (adapter != null) {
@ -110,8 +111,6 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
floatNameBox.setSelectedItem(ob.getRelateCCName()); floatNameBox.setSelectedItem(ob.getRelateCCName());
} }
populateAnimateType(ob.getAnimateType());
List parameterList = this.parameterViewPane.update(); List parameterList = this.parameterViewPane.update();
parameterList.clear(); parameterList.clear();
@ -126,7 +125,6 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
if (itemNameTextField != null) { if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText()); chartLink.setItemName(this.itemNameTextField.getText());
} }
chartLink.setAnimateType(updateAnimateType());
return chartLink; return chartLink;
} }
@ -177,8 +175,20 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
} }
@Override @Override
protected boolean needAnimatePane() { protected void addPaneInCenter(JPanel centerPane) {
return true; centerPane.add(createAnimateTypeUIButtonGroup(), BorderLayout.CENTER);
}
@Override
public void populateBean(ChartHyperRelateFloatLink ob) {
super.populateBean(ob);
populateAnimateType(ob.getAnimateType());
}
@Override
public void updateBean(ChartHyperRelateFloatLink chartLink) {
super.updateBean(chartLink);
chartLink.setAnimateType(updateAnimateType());
} }
} }
} }

31
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java

@ -37,11 +37,7 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
northPane = new FormHyperlinkNorthPane(needRenamePane()); northPane = new FormHyperlinkNorthPane(needRenamePane());
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.add(northPane, BorderLayout.NORTH); panel.add(northPane, BorderLayout.NORTH);
if (needAnimatePane()) { addPaneInNorth(panel);
JPanel animatePane = createAnimateTypeUIButtonGroup();
animatePane.setBorder(BorderFactory.createEmptyBorder(0, 8, 10, 10));
panel.add(animatePane, BorderLayout.CENTER);
}
this.add(panel, BorderLayout.NORTH); this.add(panel, BorderLayout.NORTH);
@ -50,6 +46,9 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"), null)); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"), null));
} }
protected void addPaneInNorth(JPanel northPane) {
}
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Form_Link"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Form_Link");
@ -71,7 +70,6 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
ParameterProvider[] parameters = formHyperlink.getParameters(); ParameterProvider[] parameters = formHyperlink.getParameters();
parameterViewPane.populate(parameters); parameterViewPane.populate(parameters);
populateAnimateType(formHyperlink.getAnimateType());
} }
@Override @Override
@ -79,9 +77,6 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
formHyperlink.setType(getHyperlinkType()); formHyperlink.setType(getHyperlinkType());
updateBean(formHyperlink); updateBean(formHyperlink);
formHyperlink.setAnimateType(updateAnimateType());
return formHyperlink; return formHyperlink;
} }
@ -127,8 +122,22 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
} }
@Override @Override
protected boolean needAnimatePane() { protected void addPaneInNorth(JPanel northPane) {
return true; JPanel animatePane = createAnimateTypeUIButtonGroup();
animatePane.setBorder(BorderFactory.createEmptyBorder(0, 8, 10, 10));
northPane.add(animatePane, BorderLayout.CENTER);
}
@Override
public void populateBean(FormHyperlinkProvider formHyperlink) {
super.populateBean(formHyperlink);
populateAnimateType(formHyperlink.getAnimateType());
}
@Override
public void updateBean(FormHyperlinkProvider formHyperlink) {
super.updateBean(formHyperlink);
formHyperlink.setAnimateType(updateAnimateType());
} }
} }
} }

Loading…
Cancel
Save