public class CombinedCategoryPlot extends CombinedDomainCategoryPlot { /** * Creates a new instance with the specified axes. * * @param domainAxis the x-axis. * @param rangeAxis the y-axis. */ public CombinedCategoryPlot (CategoryAxis domainAxis, ValueAxis rangeAxis) { super(domainAxis); super.setGap(10.0); super.setRangeAxis(rangeAxis); } /** * Adds a new subplot with weight <code>1</code>. * * @param subplot the subplot. */ public void add(CategoryPlot subplot) { this.add(subplot, 1); } /** * Adds a new subplot with the specified weight. * * @param subplot the subplot. * @param weight the weight for the subplot. */ public void add(CategoryPlot subplot, int weight) { super.add(subplot, weight); ValueAxis l_range = super.getRangeAxis(); subplot.setRangeAxis(0, l_range, false); super.setRangeAxis(l_range); if (null == l_range) { return; } l_range.configure(); } /** * Returns the bounds of the data values that will be plotted against * the specified axis. * * @param axis the axis. */ public Range getDataRange(ValueAxis axis) { Range l_result = null; Iterator l_itr = getSubplots().iterator(); while (l_itr.hasNext()) { CategoryPlot l_subplot = (CategoryPlot) l_itr.next(); l_result = Range.combine(l_result, l_subplot.getDataRange(axis)); } return l_result; } /** * Sets the range axis that is shared by all the subplots. * * @param axis the axis. */ public void setRangeAxis(ValueAxis axis) { Iterator l_itr = getSubplots().iterator(); while (l_itr.hasNext()) { CategoryPlot l_subplot = (CategoryPlot) l_itr.next(); l_subplot.setRangeAxis(0, axis, false); } super.setRangeAxis(axis); if (null == axis) { return; } axis.configure()
public class CombinedXYPlot extends CombinedDomainXYPlot { /** * Creates a new instance with the specified axes. * * @param domainAxis the x-axis. * @param rangeAxis the y-axis. */ public CombinedXYPlot(ValueAxis domainAxis, ValueAxis rangeAxis) { super(domainAxis); super.setGap(10.0); super.setRangeAxis(rangeAxis); } /** * Adds a new subplot with weight <code>1</code>. * * @param subplot the subplot. */ public void add(XYPlot subplot) { this.add(subplot, 1); } /** * Adds a new subplot with the specified weight. * * @param subplot the subplot. * @param weight the weight for the subplot. */ public void add(XYPlot subplot, int weight) { super.add(subplot, weight); ValueAxis l_range = super.getRangeAxis(); subplot.setRangeAxis(0, l_range, false); super.setRangeAxis(l_range); if (null == l_range) { return; } l_range.configure(); } /** * Returns the bounds of the data values that will be plotted against * the specified axis. * * @param axis the axis. */ public Range getDataRange(ValueAxis axis) { Range l_result = null; Iterator l_itr = getSubplots().iterator(); while (l_itr.hasNext()) { XYPlot l_subplot = (XYPlot) l_itr.next(); l_result = Range.combine(l_result, l_subplot.getDataRange(axis)); } return l_result; } /** * Sets the range axis that is shared by all the subplots. * * @param axis the axis. */ public void setRangeAxis(ValueAxis axis) { Iterator l_itr = getSubplots().iterator(); while (l_itr.hasNext()) { XYPlot l_subplot = (XYPlot) l_itr.next(); l_subplot.setRangeAxis(0, axis, false); } super.setRangeAxis(axis); if (null == axis) { return; } axis.configure()
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/experimental/org/jfree/experimental/chart/plot/CombinedCategoryPlot.java File path: /jfreechart-1.0.10/experimental/org/jfree/experimental/chart/plot/CombinedXYPlot.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class CombinedCategoryPlot extends CombinedDomainCategoryPlot {
1
public class CombinedXYPlot extends CombinedDomainXYPlot {
2
    /**
2
    /**
3
     * Creates a new instance with the specified axes.
3
     * Creates a new instance with the specified axes.
4
     *
4
     *
5
     * @param domainAxis  the x-axis.
5
     * @param domainAxis  the x-axis.
6
     * @param rangeAxis  the y-axis.
6
     * @param rangeAxis  the y-axis.
7
     */
7
     */
8
    public CombinedCategoryPlot (CategoryAxis domainAxis, ValueAxis rangeAxis) {
8
    public CombinedXYPlot(ValueAxis domainAxis, ValueAxis rangeAxis) {
9
        super(domainAxis);
9
        super(domainAxis);
10
        super.setGap(10.0);
10
        super.setGap(10.0);
11
        super.setRangeAxis(rangeAxis);
11
        super.setRangeAxis(rangeAxis);
12
    }
12
    }
13
    /**
13
    /**
14
     * Adds a new subplot with weight <code>1</code>.
14
     * Adds a new subplot with weight <code>1</code>.
15
     *
15
     *
16
     * @param subplot  the subplot.
16
     * @param subplot  the subplot.
17
     */
17
     */
18
    public void add(CategoryPlot subplot) {
18
    public void add(XYPlot subplot) {
19
        this.add(subplot, 1);
19
        this.add(subplot, 1);
20
    }
20
    }
21
    /**
21
    /**
22
     * Adds a new subplot with the specified weight.
22
     * Adds a new subplot with the specified weight.
23
     *
23
     *
24
     * @param subplot  the subplot.
24
     * @param subplot  the subplot.
25
     * @param weight  the weight for the subplot.
25
     * @param weight  the weight for the subplot.
26
     */
26
     */
27
    public void add(CategoryPlot subplot, int weight) {
27
    public void add(XYPlot subplot, int weight) {
28
        super.add(subplot, weight);
28
        super.add(subplot, weight);
29
        ValueAxis l_range = super.getRangeAxis();
29
        ValueAxis l_range = super.getRangeAxis();
30
        subplot.setRangeAxis(0, l_range, false);
30
        subplot.setRangeAxis(0, l_range, false);
31
        super.setRangeAxis(l_range);
31
        super.setRangeAxis(l_range);
32
        if (null == l_range) {
32
        if (null == l_range) {
33
            return;
33
            return;
34
        }
34
        }
35
        l_range.configure();
35
        l_range.configure();
36
    }
36
    }
37
    /**
37
    /**
38
     * Returns the bounds of the data values that will be plotted against
38
     * Returns the bounds of the data values that will be plotted against
39
     * the specified axis.
39
     * the specified axis.
40
     *
40
     *
41
     * @param axis  the axis.
41
     * @param axis  the axis.
42
     */
42
     */
43
    public Range getDataRange(ValueAxis axis) {
43
    public Range getDataRange(ValueAxis axis) {
44
        Range l_result = null;
44
        Range l_result = null;
45
        Iterator l_itr = getSubplots().iterator();
45
        Iterator l_itr = getSubplots().iterator();
46
        while (l_itr.hasNext()) {
46
        while (l_itr.hasNext()) {
47
            CategoryPlot l_subplot = (CategoryPlot) l_itr.next();
47
            XYPlot l_subplot = (XYPlot) l_itr.next();
48
            l_result = Range.combine(l_result, l_subplot.getDataRange(axis));
48
            l_result = Range.combine(l_result, l_subplot.getDataRange(axis));
49
        }
49
        }
50
        return l_result;
50
        return l_result;
51
    }
51
    }
52
    /**
52
    /**
53
     * Sets the range axis that is shared by all the subplots.
53
     * Sets the range axis that is shared by all the subplots.
54
     *
54
     *
55
     * @param axis  the axis.
55
     * @param axis  the axis.
56
     */
56
     */
57
    public void setRangeAxis(ValueAxis axis) {
57
    public void setRangeAxis(ValueAxis axis) {
58
        Iterator l_itr = getSubplots().iterator();
58
        Iterator l_itr = getSubplots().iterator();
59
        while (l_itr.hasNext()) {
59
        while (l_itr.hasNext()) {
60
            CategoryPlot l_subplot = (CategoryPlot) l_itr.next();
60
            XYPlot l_subplot = (XYPlot) l_itr.next();
61
            l_subplot.setRangeAxis(0, axis, false);
61
            l_subplot.setRangeAxis(0, axis, false);
62
        }
62
        }
63
        super.setRangeAxis(axis);
63
        super.setRangeAxis(axis);
64
        if (null == axis) {
64
        if (null == axis) {
65
            return;
65
            return;
66
        }
66
        }
67
        axis.configure()
67
        axis.configure()
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0