Browse Source

代码质量

master
zheng 7 years ago
parent
commit
10b104909c
  1. 13
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneWithFormula.java
  2. 11
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MapColorPickerPaneWithFormula.java
  3. 10
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MapSeriesPane.java
  4. 4
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MapSeriesPane4ChartDesigner.java
  5. 8
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MeterSeriesPane.java
  6. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MeterSeriesPane4ChartDesigner.java
  7. 23
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java
  8. 14
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane4Map.java
  9. 3
      designer_chart/src/com/fr/extended/chart/AbstractExtendedChartUIProvider.java
  10. 13
      designer_chart/src/com/fr/plugin/chart/designer/style/HeatMapRangeLegendPane.java
  11. 9
      designer_chart/src/com/fr/plugin/chart/designer/style/VanChartRangeLegendPane.java
  12. 7
      designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java
  13. 7
      designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPane.java
  14. 11
      designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPaneWithOutNum.java
  15. 16
      designer_chart/src/com/fr/plugin/chart/range/component/SectionLegendPane.java

13
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneWithFormula.java

@ -1,9 +1,10 @@
package com.fr.design.mainframe.chart.gui.style.series;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import javax.swing.*;
import java.awt.*;
import javax.swing.JComponent;
import java.awt.Color;
import java.util.ArrayList;
/**
@ -13,12 +14,12 @@ import java.util.ArrayList;
*/
public class ColorPickerPaneWithFormula extends UIColorPickerPane{
public ColorPickerPaneWithFormula(){
super();
public ColorPickerPaneWithFormula(AbstractAttrNoScrollPane container) {
super(container);
}
public ColorPickerPaneWithFormula(String meterString){
super(meterString);
public ColorPickerPaneWithFormula(AbstractAttrNoScrollPane container, String meterString) {
super(container, meterString);
}
protected ArrayList getTextFieldList(){

11
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MapColorPickerPaneWithFormula.java

@ -1,9 +1,10 @@
package com.fr.design.mainframe.chart.gui.style.series;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import javax.swing.*;
import java.awt.*;
import javax.swing.JComponent;
import java.awt.Color;
import java.util.ArrayList;
/**
@ -13,7 +14,11 @@ import java.util.ArrayList;
*/
public class MapColorPickerPaneWithFormula extends UIColorPickerPane4Map {
protected ArrayList getTextFieldList(){
public MapColorPickerPaneWithFormula(AbstractAttrNoScrollPane container) {
super(container);
}
protected ArrayList getTextFieldList() {
return new ArrayList<TinyFormulaPane>();
}

10
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MapSeriesPane.java

@ -17,11 +17,13 @@ import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.*;
import java.util.ArrayList;
/**
* 图表属性表, 图表样式- 地图系列.
@ -40,7 +42,7 @@ public class MapSeriesPane extends AbstractPlotSeriesPane{
}
protected UIColorPickerPane4Map createColorPickerPane(){
return new MapColorPickerPaneWithFormula();
return new MapColorPickerPaneWithFormula(parentPane);
}
@Override

4
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MapSeriesPane4ChartDesigner.java

@ -16,6 +16,6 @@ public class MapSeriesPane4ChartDesigner extends MapSeriesPane {
protected UIColorPickerPane4Map createColorPickerPane(){
return new UIColorPickerPane4Map();
}
return new UIColorPickerPane4Map(parentPane);
}
}

8
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MeterSeriesPane.java

@ -16,8 +16,10 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.SwingUtilities;
import java.awt.Component;
import java.util.List;
/**
@ -54,7 +56,7 @@ public class MeterSeriesPane extends AbstractPlotSeriesPane {
}
protected UIColorPickerPane createColorPickerPane(){
return new ColorPickerPaneWithFormula("meterString"){
return new ColorPickerPaneWithFormula(parentPane, "meterString") {
protected double getEditAreaWidth () {
return 120;
}

2
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MeterSeriesPane4ChartDesigner.java

@ -15,6 +15,6 @@ public class MeterSeriesPane4ChartDesigner extends MeterSeriesPane {
}
protected UIColorPickerPane createColorPickerPane(){
return new UIColorPickerPane("meterString");
return new UIColorPickerPane(parentPane, "meterString");
}
}

23
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java

@ -15,7 +15,6 @@ import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ipoppane.PopupHider;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.style.color.ColorControlWindow;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
@ -71,8 +70,10 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
private ChangeListener changeListener;
private boolean moveOnColorOrTextPane;
private AbstractAttrNoScrollPane container;
public UIColorPickerPane() {
public UIColorPickerPane(AbstractAttrNoScrollPane container) {
this.container = container;
fillStyleCombox = this.getColorSelectBox();
fillStyleCombox.setSelectObject(Color.BLUE);
fillStyleCombox.addSelectChangeListener(new ChangeListener() {
@ -159,7 +160,8 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
};
}
public UIColorPickerPane(String meterString){
public UIColorPickerPane(AbstractAttrNoScrollPane container, String meterString) {
this.container = container;
fillStyleCombox = this.getColorSelectBox();
fillStyleCombox.setSelectObject(Color.BLUE);
@ -678,17 +680,8 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
}
private void initContainerLister(){
Container container = UIColorPickerPane.this;
while (!(container instanceof ChartStylePane)) {
if (container.getParent() == null) {
break;
}
container = container.getParent();
}
if (container instanceof AbstractAttrNoScrollPane) {
((AbstractAttrNoScrollPane) container).initAllListeners();
}
}
this.container.initAllListeners();
}
public void updateBean(MapHotAreaColor hotAreaColor) {
hotAreaColor.setMainColor(fillStyleCombox.getSelectObject());
@ -776,7 +769,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
UIColorPickerPane pp = new UIColorPickerPane();
UIColorPickerPane pp = new UIColorPickerPane(null);
content.add(pp, BorderLayout.CENTER);
GUICoreUtils.centerWindow(jf);
jf.setSize(400, 400);

14
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane4Map.java

@ -1,12 +1,16 @@
package com.fr.design.mainframe.chart.gui.style.series;
import com.fr.chart.base.ChartConstants;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.style.color.ColorCell;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.style.color.ColorSelectPane;
import javax.swing.*;
import java.awt.*;
import javax.swing.Box;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.Color;
import java.awt.GridLayout;
/**
* Created by IntelliJ IDEA.
@ -15,7 +19,11 @@ import java.awt.*;
*/
public class UIColorPickerPane4Map extends UIColorPickerPane {
protected ColorSelectBox getColorSelectBox(){
public UIColorPickerPane4Map(AbstractAttrNoScrollPane container) {
super(container);
}
protected ColorSelectBox getColorSelectBox() {
return new ColorSelectBox4Map(100);
}

3
designer_chart/src/com/fr/extended/chart/AbstractExtendedChartUIProvider.java

@ -13,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.stable.StringUtils;
import com.fr.stable.fun.impl.AbstractProvider;
/**
@ -85,7 +86,7 @@ public abstract class AbstractExtendedChartUIProvider extends AbstractProvider i
}
public String getPlotTypeTitle4PopupWindow(){
return null;
return StringUtils.EMPTY;
}
@Override

13
designer_chart/src/com/fr/plugin/chart/designer/style/HeatMapRangeLegendPane.java

@ -1,16 +1,17 @@
package com.fr.plugin.chart.designer.style;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula;
import com.fr.general.Inter;
import com.fr.plugin.chart.type.LegendType;
import com.fr.plugin.chart.range.component.GradualIntervalConfigPane;
import com.fr.plugin.chart.range.component.GradualLegendPane;
import com.fr.plugin.chart.range.component.SectionIntervalConfigPaneWithOutNum;
import com.fr.plugin.chart.range.component.SectionLegendPane;
import com.fr.plugin.chart.type.LegendType;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.Component;
/**
* Created by Mitisky on 16/10/20.
@ -55,10 +56,10 @@ public class HeatMapRangeLegendPane extends VanChartRangeLegendPane {
@Override
protected SectionLegendPane createSectionLegendPane() {
return new SectionLegendPane(){
return new SectionLegendPane(this.parent) {
@Override
protected MapColorPickerPaneWithFormula createSectionIntervalConfigPane() {
return new SectionIntervalConfigPaneWithOutNum();
protected MapColorPickerPaneWithFormula createSectionIntervalConfigPane(AbstractAttrNoScrollPane parent) {
return new SectionIntervalConfigPaneWithOutNum(parent);
}
};
}

9
designer_chart/src/com/fr/plugin/chart/designer/style/VanChartRangeLegendPane.java

@ -12,8 +12,11 @@ import com.fr.plugin.chart.range.component.GradualLegendPane;
import com.fr.plugin.chart.range.component.SectionLegendPane;
import com.fr.plugin.chart.type.LegendType;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -76,7 +79,7 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane {
}
protected SectionLegendPane createSectionLegendPane() {
return new SectionLegendPane();
return new SectionLegendPane(this.parent);
}
private JPanel createTableLayoutPaneWithTitle(String title, Component component) {

7
designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java

@ -19,10 +19,11 @@ import com.fr.plugin.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.stable.Constants;
import javax.swing.*;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Component;
/**
* Created by Mitisky on 15/11/27.
@ -180,7 +181,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane {
}
private JPanel createGaugeBandsPane() {
colorPickerPane = new ColorPickerPaneWithFormula("meterString");
colorPickerPane = new ColorPickerPaneWithFormula(parentPane, "meterString");
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Range"), colorPickerPane);
}

7
designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPane.java

@ -1,11 +1,12 @@
package com.fr.plugin.chart.range.component;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula;
import com.fr.general.Inter;
import java.awt.*;
import java.awt.Component;
/**
* Created by IntelliJ IDEA.
@ -14,6 +15,10 @@ import java.awt.*;
*/
public class SectionIntervalConfigPane extends MapColorPickerPaneWithFormula {
public SectionIntervalConfigPane(AbstractAttrNoScrollPane container) {
super(container);
}
protected double[] getRowSIze () {
double p = TableLayout.PREFERRED;
return new double[]{p, p, p, p};

11
designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPaneWithOutNum.java

@ -1,14 +1,16 @@
package com.fr.plugin.chart.range.component;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula;
import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.Component;
import java.awt.Dimension;
/**
* Created by Mitisky on 16/10/20.
@ -16,8 +18,9 @@ import java.awt.*;
*/
public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithFormula{
private BoldFontTextLabel numLabel;
public SectionIntervalConfigPaneWithOutNum() {
super();
public SectionIntervalConfigPaneWithOutNum(AbstractAttrNoScrollPane container) {
super(container);
getDesignTypeButtonGroup().addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {

16
designer_chart/src/com/fr/plugin/chart/range/component/SectionLegendPane.java

@ -1,5 +1,6 @@
package com.fr.plugin.chart.range.component;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula;
@ -7,21 +8,24 @@ import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.range.SectionLegend;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
public class SectionLegendPane extends JPanel{
private static final long serialVersionUID = 1614283200308877353L;
private MapColorPickerPaneWithFormula intervalConfigPane;
private LegendLabelFormatPane labelFormPane;
private AbstractAttrNoScrollPane parent;
public SectionLegendPane(){
public SectionLegendPane(AbstractAttrNoScrollPane parent) {
this.parent = parent;
initComponents();
}
private void initComponents() {
intervalConfigPane = createSectionIntervalConfigPane();
intervalConfigPane = createSectionIntervalConfigPane(this.parent);
JPanel intervalConfigPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Section_Config"), intervalConfigPane);
labelFormPane = new LegendLabelFormatPane(){
@Override
@ -46,8 +50,8 @@ public class SectionLegendPane extends JPanel{
this.add(panel, BorderLayout.CENTER);
}
protected MapColorPickerPaneWithFormula createSectionIntervalConfigPane() {
return new SectionIntervalConfigPane();
protected MapColorPickerPaneWithFormula createSectionIntervalConfigPane(AbstractAttrNoScrollPane parent) {
return new SectionIntervalConfigPane(parent);
}
public void populate(SectionLegend sectionLegend){

Loading…
Cancel
Save