if (marker instanceof ValueMarker) { ValueMarker vm = (ValueMarker) marker; double value = vm.getValue(); Range range = axis.getRange(); if (!range.contains(value)) { return; } final Composite savedComposite = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, marker.getAlpha())); PlotOrientation orientation = plot.getOrientation(); double v = axis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge()); Line2D line = null; if (orientation == PlotOrientation.HORIZONTAL) { line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY()); } else if (orientation == PlotOrientation.VERTICAL) { line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v); } g2.setPaint(marker.getPaint()); g2.setStroke(marker.getStroke()); g2.draw(line); String label = marker.getLabel(); RectangleAnchor anchor = marker.getLabelAnchor(); if (label != null) { Font labelFont = marker.getLabelFont(); g2.setFont(labelFont); g2.setPaint(marker.getLabelPaint()); Point2D coordinates = calculateRangeMarkerTextAnchorPoint( g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), LengthAdjustmentType.EXPAND, anchor); TextUtilities.drawAlignedString(label, g2, (float) coordinates.getX(), (float) coordinates.getY(), marker.getLabelTextAnchor()); } g2.setComposite(savedComposite); } else if (marker instanceof IntervalMarker) { IntervalMarker im = (IntervalMarker) marker; double start = im.getStartValue(); double end = im.getEndValue(); Range range = axis.getRange(); if (!(range.intersects(start, end))) { return; } final Composite savedComposite = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, marker.getAlpha())); double start2d = axis.valueToJava2D(start, dataArea, plot.getRangeAxisEdge()); double end2d = axis.valueToJava2D(end, dataArea, plot.getRangeAxisEdge()); double low = Math.min(start2d, end2d); double high = Math.max(start2d, end2d); PlotOrientation orientation = plot.getOrientation(); Rectangle2D rect = null; if (orientation == PlotOrientation.HORIZONTAL) { // clip left and right bounds to data area low = Math.max(low, dataArea.getMinX()); high = Math.min(high, dataArea.getMaxX()); rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight()); } else if (orientation == PlotOrientation.VERTICAL) { // clip top and bottom bounds to data area low = Math.max(low, dataArea.getMinY()); high = Math.min(high, dataArea.getMaxY()); rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low); } Paint p = marker.getPaint(); if (p instanceof GradientPaint) { GradientPaint gp = (GradientPaint) p; GradientPaintTransformer t = im.getGradientPaintTransformer(); if (t != null) { gp = t.transform(gp, rect); } g2.setPaint(gp); } else { g2.setPaint(p); } g2.fill(rect); // now draw the outlines, if visible... if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) { if (orientation == PlotOrientation.VERTICAL) { Line2D line = new Line2D.Double(); double x0 = dataArea.getMinX(); double x1 = dataArea.getMaxX(); g2.setPaint(im.getOutlinePaint()); g2.setStroke(im.getOutlineStroke()); if (range.contains(start)) { line.setLine(x0, start2d, x1, start2d); g2.draw(line); } if (range.contains(end)) { line.setLine(x0, end2d, x1, end2d); g2.draw(line); } } else { // PlotOrientation.HORIZONTAL Line2D line = new Line2D.Double(); double y0 = dataArea.getMinY(); double y1 = dataArea.getMaxY(); g2.setPaint(im.getOutlinePaint()); g2.setStroke(im.getOutlineStroke()); if (range.contains(start)) { line.setLine(start2d, y0, start2d, y1); g2.draw(line); } if (range.contains(end)) { line.setLine(end2d, y0, end2d, y1); g2.draw(line); } } } String label = marker.getLabel(); RectangleAnchor anchor = marker.getLabelAnchor(); if (label != null) { Font labelFont = marker.getLabelFont(); g2.setFont(labelFont); g2.setPaint(marker.getLabelPaint()); Point2D coordinates = calculateRangeMarkerTextAnchorPoint( g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(), anchor); TextUtilities.drawAlignedString(label, g2, (float) coordinates.getX(), (float) coordinates.getY(), marker.getLabelTextAnchor()); } g2.setComposite(savedComposite); }
if (marker instanceof ValueMarker) { ValueMarker vm = (ValueMarker) marker; double value = vm.getValue(); Range range = rangeAxis.getRange(); if (!range.contains(value)) { return; } double v = rangeAxis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge()); PlotOrientation orientation = plot.getOrientation(); Line2D line = null; if (orientation == PlotOrientation.HORIZONTAL) { line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY()); } else if (orientation == PlotOrientation.VERTICAL) { line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v); } final Composite originalComposite = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, marker.getAlpha())); g2.setPaint(marker.getPaint()); g2.setStroke(marker.getStroke()); g2.draw(line); String label = marker.getLabel(); RectangleAnchor anchor = marker.getLabelAnchor(); if (label != null) { Font labelFont = marker.getLabelFont(); g2.setFont(labelFont); g2.setPaint(marker.getLabelPaint()); Point2D coordinates = calculateRangeMarkerTextAnchorPoint( g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), LengthAdjustmentType.EXPAND, anchor); TextUtilities.drawAlignedString(label, g2, (float) coordinates.getX(), (float) coordinates.getY(), marker.getLabelTextAnchor()); } g2.setComposite(originalComposite); } else if (marker instanceof IntervalMarker) { IntervalMarker im = (IntervalMarker) marker; double start = im.getStartValue(); double end = im.getEndValue(); Range range = rangeAxis.getRange(); if (!(range.intersects(start, end))) { return; } double start2d = rangeAxis.valueToJava2D(start, dataArea, plot.getRangeAxisEdge()); double end2d = rangeAxis.valueToJava2D(end, dataArea, plot.getRangeAxisEdge()); double low = Math.min(start2d, end2d); double high = Math.max(start2d, end2d); PlotOrientation orientation = plot.getOrientation(); Rectangle2D rect = null; if (orientation == PlotOrientation.HORIZONTAL) { // clip left and right bounds to data area low = Math.max(low, dataArea.getMinX()); high = Math.min(high, dataArea.getMaxX()); rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight()); } else if (orientation == PlotOrientation.VERTICAL) { // clip top and bottom bounds to data area low = Math.max(low, dataArea.getMinY()); high = Math.min(high, dataArea.getMaxY()); rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low); } final Composite originalComposite = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, marker.getAlpha())); Paint p = marker.getPaint(); if (p instanceof GradientPaint) { GradientPaint gp = (GradientPaint) p; GradientPaintTransformer t = im.getGradientPaintTransformer(); if (t != null) { gp = t.transform(gp, rect); } g2.setPaint(gp); } else { g2.setPaint(p); } g2.fill(rect); // now draw the outlines, if visible... if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) { if (orientation == PlotOrientation.VERTICAL) { Line2D line = new Line2D.Double(); double x0 = dataArea.getMinX(); double x1 = dataArea.getMaxX(); g2.setPaint(im.getOutlinePaint()); g2.setStroke(im.getOutlineStroke()); if (range.contains(start)) { line.setLine(x0, start2d, x1, start2d); g2.draw(line); } if (range.contains(end)) { line.setLine(x0, end2d, x1, end2d); g2.draw(line); } } else { // PlotOrientation.HORIZONTAL Line2D line = new Line2D.Double(); double y0 = dataArea.getMinY(); double y1 = dataArea.getMaxY(); g2.setPaint(im.getOutlinePaint()); g2.setStroke(im.getOutlineStroke()); if (range.contains(start)) { line.setLine(start2d, y0, start2d, y1); g2.draw(line); } if (range.contains(end)) { line.setLine(end2d, y0, end2d, y1); g2.draw(line); } } } String label = marker.getLabel(); RectangleAnchor anchor = marker.getLabelAnchor(); if (label != null) { Font labelFont = marker.getLabelFont(); g2.setFont(labelFont); g2.setPaint(marker.getLabelPaint()); Point2D coordinates = calculateRangeMarkerTextAnchorPoint( g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(), anchor); TextUtilities.drawAlignedString(label, g2, (float) coordinates.getX(), (float) coordinates.getY(), marker.getLabelTextAnchor()); } g2.setComposite(originalComposite); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java
Method name: void drawRangeMarker(Graphics2D, XYPlot, ValueAxis, Marker, Rectangle2D) Method name: void drawRangeMarker(Graphics2D, CategoryPlot, ValueAxis, Marker, Rectangle2D)
Number of AST nodes: 92 Number of AST nodes:92
1
if (marker instanceof ValueMarker) {
1
if (marker instanceof ValueMarker) {
2
            ValueMarker vm = (ValueMarker) marker;
2
            ValueMarker vm = (ValueMarker) marker;
3
            double value = vm.getValue();
3
            double value = vm.getValue();
4
            Range range = axis.getRange();
4
            Range range = rangeAxis.getRange();
5
            if (!range.contains(value)) {
5
            if (!range.contains(value)) {
6
                return;
6
                return;
7
            }
7
            }
8
            final Composite savedComposite = g2.getComposite();
8
            
9
            g2.setComposite(AlphaComposite.getInstance(
10
                    AlphaComposite.SRC_OVER, marker.getAlpha()));
11
            PlotOrientation orientation = plot.getOrientation();
12
            double v = axis.valueToJava2D(value, dataArea,
13
                    plot.getRangeAxisEdge()
9
double v = rangeAxis.valueToJava2D(value, dataArea,
10
                    plot.getRangeAxisEdge());
14
);
11
            PlotOrientation orientation = plot.getOrientation();
15
            Line2D line = null;
12
            Line2D line = null;
16
            if (orientation == PlotOrientation.HORIZONTAL) {
13
            if (orientation == PlotOrientation.HORIZONTAL) {
17
                line = new Line2D.Double(v, dataArea.getMinY(), v,
14
                line = new Line2D.Double(v, dataArea.getMinY(), v,
18
                        dataArea.getMaxY());
15
                        dataArea.getMaxY());
19
            }
16
            }
20
            else if (orientation == PlotOrientation.VERTICAL) {
17
            else if (orientation == PlotOrientation.VERTICAL) {
21
                line = new Line2D.Double(dataArea.getMinX(), v,
18
                line = new Line2D.Double(dataArea.getMinX(), v,
22
                        dataArea.getMaxX(), v);
19
                        dataArea.getMaxX(), v);
23
            }
20
            }
21
            final Composite originalComposite = g2.getComposite();
22
            g2.setComposite(AlphaComposite.getInstance(
23
                    AlphaComposite.SRC_OVER, marker.getAlpha()));
24
            g2.setPaint(marker.getPaint());
24
            g2.setPaint(marker.getPaint());
25
            g2.setStroke(marker.getStroke());
25
            g2.setStroke(marker.getStroke());
26
            g2.draw(line);
26
            g2.draw(line);
27
            String label = marker.getLabel();
27
            String label = marker.getLabel();
28
            RectangleAnchor anchor = marker.getLabelAnchor();
28
            RectangleAnchor anchor = marker.getLabelAnchor();
29
            if (label != null) {
29
            if (label != null) {
30
                Font labelFont = marker.getLabelFont();
30
                Font labelFont = marker.getLabelFont();
31
                g2.setFont(labelFont);
31
                g2.setFont(labelFont);
32
                g2.setPaint(marker.getLabelPaint());
32
                g2.setPaint(marker.getLabelPaint());
33
                Point2D coordinates = calculateRangeMarkerTextAnchorPoint(
33
                Point2D coordinates = calculateRangeMarkerTextAnchorPoint(
34
                        g2, orientation, dataArea, line.getBounds2D(),
34
                        g2, orientation, dataArea, line.getBounds2D(),
35
                        marker.getLabelOffset(),
35
                        marker.getLabelOffset(),
36
 LengthAdjustmentType.EXPAND,
36
                        LengthAdjustmentType.EXPAND,
37
                        anchor);
37
 anchor);
38
                TextUtilities.drawAlignedString(label, g2,
38
                TextUtilities.drawAlignedString(label, g2,
39
                        (float) coordinates.getX(), (float) coordinates.getY(),
39
                        (float) coordinates.getX(), (float) coordinates.getY(),
40
                        marker.getLabelTextAnchor());
40
                        marker.getLabelTextAnchor());
41
            }
41
            }
42
            g2.setComposite(savedComposite);
42
            g2.setComposite(originalComposite);
43
        }
43
        }
44
        else if (marker instanceof IntervalMarker) {
44
        else if (marker instanceof IntervalMarker) {
45
            IntervalMarker im = (IntervalMarker) marker;
45
            IntervalMarker im = (IntervalMarker) marker;
46
            double start = im.getStartValue();
46
            double start = im.getStartValue();
47
            double end = im.getEndValue();
47
            double end = im.getEndValue();
48
            Range range = axis.getRange();
48
            Range range = rangeAxis.getRange();
49
            if (!(range.intersects(start, end))) {
49
            if (!(range.intersects(start, end))) {
50
                return;
50
                return;
51
            }
51
            }
52
            final Composite savedComposite = g2.getComposite();
53
            g2.setComposite(AlphaComposite.getInstance(
54
                    AlphaComposite.SRC_OVER, marker.getAlpha()));
55
            double start2d = axis.valueToJava2D(start, dataArea,
52
            double start2d = rangeAxis.valueToJava2D(start, dataArea,
56
                    plot.getRangeAxisEdge());
53
                    plot.getRangeAxisEdge());
57
            double end2d = axis.valueToJava2D(end, dataArea,
54
            double end2d = rangeAxis.valueToJava2D(end, dataArea,
58
                    plot.getRangeAxisEdge());
55
                    plot.getRangeAxisEdge());
59
            double low = Math.min(start2d, end2d);
56
            double low = Math.min(start2d, end2d);
60
            double high = Math.max(start2d, end2d);
57
            double high = Math.max(start2d, end2d);
61
            PlotOrientation orientation = plot.getOrientation();
58
            PlotOrientation orientation = plot.getOrientation();
62
            Rectangle2D rect = null;
59
            Rectangle2D rect = null;
63
            if (orientation == PlotOrientation.HORIZONTAL) {
60
            if (orientation == PlotOrientation.HORIZONTAL) {
64
                // clip left and right bounds to data area
61
                // clip left and right bounds to data area
65
                low = Math.max(low, dataArea.getMinX());
62
                low = Math.max(low, dataArea.getMinX());
66
                high = Math.min(high, dataArea.getMaxX());
63
                high = Math.min(high, dataArea.getMaxX());
67
                rect = new Rectangle2D.Double(low,
64
                rect = new Rectangle2D.Double(low,
68
                        dataArea.getMinY(), high - low,
65
                        dataArea.getMinY(), high - low,
69
                        dataArea.getHeight());
66
                        dataArea.getHeight());
70
            }
67
            }
71
            else if (orientation == PlotOrientation.VERTICAL) {
68
            else if (orientation == PlotOrientation.VERTICAL) {
72
                // clip top and bottom bounds to data area
69
                // clip top and bottom bounds to data area
73
                low = Math.max(low, dataArea.getMinY());
70
                low = Math.max(low, dataArea.getMinY());
74
                high = Math.min(high, dataArea.getMaxY());
71
                high = Math.min(high, dataArea.getMaxY());
75
                rect = new Rectangle2D.Double(dataArea.getMinX(),
72
                rect = new Rectangle2D.Double(dataArea.getMinX(),
76
                        low, dataArea.getWidth(),
73
                        low, dataArea.getWidth(),
77
                        high - low);
74
                        high - low);
78
            }
75
            }
76
            final Composite originalComposite = g2.getComposite();
77
            g2.setComposite(AlphaComposite.getInstance(
78
                    AlphaComposite.SRC_OVER, marker.getAlpha()));
79
            Paint p = marker.getPaint();
79
            Paint p = marker.getPaint();
80
            if (p instanceof GradientPaint) {
80
            if (p instanceof GradientPaint) {
81
                GradientPaint gp = (GradientPaint) p;
81
                GradientPaint gp = (GradientPaint) p;
82
                GradientPaintTransformer t = im.getGradientPaintTransformer();
82
                GradientPaintTransformer t = im.getGradientPaintTransformer();
83
                if (t != null) {
83
                if (t != null) {
84
                    gp = t.transform(gp, rect);
84
                    gp = t.transform(gp, rect);
85
                }
85
                }
86
                g2.setPaint(gp);
86
                g2.setPaint(gp);
87
            }
87
            }
88
            else {
88
            else {
89
                g2.setPaint(p);
89
                g2.setPaint(p);
90
            }
90
            }
91
            g2.fill(rect);
91
            g2.fill(rect);
92
            // now draw the outlines, if visible...
92
            // now draw the outlines, if visible...
93
            if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) {
93
            if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) {
94
                if (orientation == PlotOrientation.VERTICAL) {
94
                if (orientation == PlotOrientation.VERTICAL) {
95
                    Line2D line = new Line2D.Double();
95
                    Line2D line = new Line2D.Double();
96
                    double x0 = dataArea.getMinX();
96
                    double x0 = dataArea.getMinX();
97
                    double x1 = dataArea.getMaxX();
97
                    double x1 = dataArea.getMaxX();
98
                    g2.setPaint(im.getOutlinePaint());
98
                    g2.setPaint(im.getOutlinePaint());
99
                    g2.setStroke(im.getOutlineStroke());
99
                    g2.setStroke(im.getOutlineStroke());
100
                    if (range.contains(start)) {
100
                    if (range.contains(start)) {
101
                        line.setLine(x0, start2d, x1, start2d);
101
                        line.setLine(x0, start2d, x1, start2d);
102
                        g2.draw(line);
102
                        g2.draw(line);
103
                    }
103
                    }
104
                    if (range.contains(end)) {
104
                    if (range.contains(end)) {
105
                        line.setLine(x0, end2d, x1, end2d);
105
                        line.setLine(x0, end2d, x1, end2d);
106
                        g2.draw(line);
106
                        g2.draw(line);
107
                    }
107
                    }
108
                }
108
                }
109
                else { // PlotOrientation.HORIZONTAL
109
                else { // PlotOrientation.HORIZONTAL
110
                    Line2D line = new Line2D.Double();
110
                    Line2D line = new Line2D.Double();
111
                    double y0 = dataArea.getMinY();
111
                    double y0 = dataArea.getMinY();
112
                    double y1 = dataArea.getMaxY();
112
                    double y1 = dataArea.getMaxY();
113
                    g2.setPaint(im.getOutlinePaint());
113
                    g2.setPaint(im.getOutlinePaint());
114
                    g2.setStroke(im.getOutlineStroke());
114
                    g2.setStroke(im.getOutlineStroke());
115
                    if (range.contains(start)) {
115
                    if (range.contains(start)) {
116
                        line.setLine(start2d, y0, start2d, y1);
116
                        line.setLine(start2d, y0, start2d, y1);
117
                        g2.draw(line);
117
                        g2.draw(line);
118
                    }
118
                    }
119
                    if (range.contains(end)) {
119
                    if (range.contains(end)) {
120
                        line.setLine(end2d, y0, end2d, y1);
120
                        line.setLine(end2d, y0, end2d, y1);
121
                        g2.draw(line);
121
                        g2.draw(line);
122
                    }
122
                    }
123
                }
123
                }
124
            }
124
            }
125
            String label = marker.getLabel();
125
            String label = marker.getLabel();
126
            RectangleAnchor anchor = marker.getLabelAnchor();
126
            RectangleAnchor anchor = marker.getLabelAnchor();
127
            if (label != null) {
127
            if (label != null) {
128
                Font labelFont = marker.getLabelFont();
128
                Font labelFont = marker.getLabelFont();
129
                g2.setFont(labelFont);
129
                g2.setFont(labelFont);
130
                g2.setPaint(marker.getLabelPaint());
130
                g2.setPaint(marker.getLabelPaint());
131
                Point2D coordinates = calculateRangeMarkerTextAnchorPoint(
131
                Point2D coordinates = calculateRangeMarkerTextAnchorPoint(
132
                        g2, orientation, dataArea, rect,
132
                        g2, orientation, dataArea, rect,
133
                        marker.getLabelOffset(), marker.getLabelOffsetType(),
133
                        marker.getLabelOffset(), marker.getLabelOffsetType(),
134
                        anchor);
134
                        anchor);
135
                TextUtilities.drawAlignedString(label, g2,
135
                TextUtilities.drawAlignedString(label, g2,
136
                        (float) coordinates.getX(), (float) coordinates.getY(),
136
                        (float) coordinates.getX(), (float) coordinates.getY(),
137
                        marker.getLabelTextAnchor());
137
                        marker.getLabelTextAnchor());
138
            }
138
            }
139
            g2.setComposite(savedComposite);
139
            g2.setComposite(originalComposite);
140
        }
140
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)12.335636
Clones locationClones are in different classes having the same super class
Number of node comparisons1270
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements92
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)111.23805
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (marker instanceof ValueMarker)
    1
    if (marker instanceof ValueMarker)
    2
    ValueMarker vm = (ValueMarker)marker;
    2
    ValueMarker vm = (ValueMarker)marker;
    3
    double value = vm.getValue();
    3
    double value = vm.getValue();
    4
    Range range = axis.getRange();
    4
    Range range = axis.getRange();
    4
    Range range = rangeAxis.getRange();
    Differences
    Expression1Expression2Difference
    axisrangeAxisVARIABLE_NAME_MISMATCH
    4
    Range range = rangeAxis.getRange();
    5
    if (!range.contains(value))
    5
    if (!range.contains(value))
    6
    return;
    6
    return;
    7
    final Composite savedComposite = g2.getComposite();
    7
    final Composite savedComposite = g2.getComposite();
    14
    final Composite originalComposite = g2.getComposite();
    Differences
    Expression1Expression2Difference
    savedCompositeoriginalCompositeVARIABLE_NAME_MISMATCH
    14
    final Composite originalComposite = g2.getComposite();
    8
    g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, marker.getAlpha()));
    15
    g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, marker.getAlpha()));
    9
    PlotOrientation orientation = plot.getOrientation();
    9
    PlotOrientation orientation = plot.getOrientation();
    8
    PlotOrientation orientation = plot.getOrientation();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.chart.plot.PlotOrientation getOrientation()
    8
    PlotOrientation orientation = plot.getOrientation();
    10
    double v = axis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge());
    10
    double v = axis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge());
    7
    double v = rangeAxis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge());
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    axisrangeAxisVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.ui.RectangleEdge getRangeAxisEdge()
    7
    double v = rangeAxis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge());
    11
    Line2D line = null;
    9
    Line2D line = null;
    12
    if (orientation == PlotOrientation.HORIZONTAL)
    10
    if (orientation == PlotOrientation.HORIZONTAL)
    13
    line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY());
    11
    line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY());
    14
    else if (orientation == PlotOrientation.VERTICAL)
    12
    else if (orientation == PlotOrientation.VERTICAL)
    15
    line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v);
    13
    line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v);
    16
    g2.setPaint(marker.getPaint());
    16
    g2.setPaint(marker.getPaint());
    17
    g2.setStroke(marker.getStroke());
    17
    g2.setStroke(marker.getStroke());
    18
    g2.draw(line);
    18
    g2.draw(line);
    19
    String label = marker.getLabel();
    19
    String label = marker.getLabel();
    20
    RectangleAnchor anchor = marker.getLabelAnchor();
    20
    RectangleAnchor anchor = marker.getLabelAnchor();
    21
    if (label != null)
    21
    if (label != null)
    22
    Font labelFont = marker.getLabelFont();
    22
    Font labelFont = marker.getLabelFont();
    23
    g2.setFont(labelFont);
    23
    g2.setFont(labelFont);
    24
    g2.setPaint(marker.getLabelPaint());
    24
    g2.setPaint(marker.getLabelPaint());
    25
    Point2D coordinates = calculateRangeMarkerTextAnchorPoint(g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), LengthAdjustmentType.EXPAND, anchor);
    25
    Point2D coordinates = calculateRangeMarkerTextAnchorPoint(g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), LengthAdjustmentType.EXPAND, anchor);
    26
    TextUtilities.drawAlignedString(label, g2, (float)coordinates.getX(), (float)coordinates.getY(), marker.getLabelTextAnchor());
    26
    TextUtilities.drawAlignedString(label, g2, (float)coordinates.getX(), (float)coordinates.getY(), marker.getLabelTextAnchor());
    27
    g2.setComposite(savedComposite);
    27
    g2.setComposite(savedComposite);
    27
    g2.setComposite(originalComposite);
    Differences
    Expression1Expression2Difference
    savedCompositeoriginalCompositeVARIABLE_NAME_MISMATCH
    27
    g2.setComposite(originalComposite);
    28
    else if (marker instanceof IntervalMarker)
    28
    else if (marker instanceof IntervalMarker)
    29
    IntervalMarker im = (IntervalMarker)marker;
    29
    IntervalMarker im = (IntervalMarker)marker;
    30
    double start = im.getStartValue();
    30
    double start = im.getStartValue();
    31
    double end = im.getEndValue();
    31
    double end = im.getEndValue();
    32
    Range range = axis.getRange();
    32
    Range range = axis.getRange();
    32
    Range range = rangeAxis.getRange();
    Differences
    Expression1Expression2Difference
    axisrangeAxisVARIABLE_NAME_MISMATCH
    32
    Range range = rangeAxis.getRange();
    33
    if (!(range.intersects(start, end)))
    33
    if (!(range.intersects(start, end)))
    34
    return;
    34
    return;
    35
    final Composite savedComposite = g2.getComposite();
    35
    final Composite savedComposite = g2.getComposite();
    49
    final Composite originalComposite = g2.getComposite();
    Differences
    Expression1Expression2Difference
    savedCompositeoriginalCompositeVARIABLE_NAME_MISMATCH
    49
    final Composite originalComposite = g2.getComposite();
    36
    g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, marker.getAlpha()));
    50
    g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, marker.getAlpha()));
    37
    double start2d = axis.valueToJava2D(start, dataArea, plot.getRangeAxisEdge());
    37
    double start2d = axis.valueToJava2D(start, dataArea, plot.getRangeAxisEdge());
    35
    double start2d = rangeAxis.valueToJava2D(start, dataArea, plot.getRangeAxisEdge());
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    axisrangeAxisVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.ui.RectangleEdge getRangeAxisEdge()
    35
    double start2d = rangeAxis.valueToJava2D(start, dataArea, plot.getRangeAxisEdge());
    38
    double end2d = axis.valueToJava2D(end, dataArea, plot.getRangeAxisEdge());
    38
    double end2d = axis.valueToJava2D(end, dataArea, plot.getRangeAxisEdge());
    36
    double end2d = rangeAxis.valueToJava2D(end, dataArea, plot.getRangeAxisEdge());
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    axisrangeAxisVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.ui.RectangleEdge getRangeAxisEdge()
    36
    double end2d = rangeAxis.valueToJava2D(end, dataArea, plot.getRangeAxisEdge());
    39
    double low = Math.min(start2d, end2d);
    37
    double low = Math.min(start2d, end2d);
    40
    double high = Math.max(start2d, end2d);
    38
    double high = Math.max(start2d, end2d);
    41
    PlotOrientation orientation = plot.getOrientation();
    41
    PlotOrientation orientation = plot.getOrientation();
    39
    PlotOrientation orientation = plot.getOrientation();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.chart.plot.PlotOrientation getOrientation()
    39
    PlotOrientation orientation = plot.getOrientation();
    42
    Rectangle2D rect = null;
    40
    Rectangle2D rect = null;
    43
    if (orientation == PlotOrientation.HORIZONTAL)
    41
    if (orientation == PlotOrientation.HORIZONTAL)
    44
    low = Math.max(low, dataArea.getMinX());
    42
    low = Math.max(low, dataArea.getMinX());
    45
    high = Math.min(high, dataArea.getMaxX());
    43
    high = Math.min(high, dataArea.getMaxX());
    46
    rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight());
    44
    rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight());
    47
    else if (orientation == PlotOrientation.VERTICAL)
    45
    else if (orientation == PlotOrientation.VERTICAL)
    48
    low = Math.max(low, dataArea.getMinY());
    46
    low = Math.max(low, dataArea.getMinY());
    49
    high = Math.min(high, dataArea.getMaxY());
    47
    high = Math.min(high, dataArea.getMaxY());
    50
    rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low);
    48
    rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low);
    51
    Paint p = marker.getPaint();
    51
    Paint p = marker.getPaint();
    52
    if (p instanceof GradientPaint)
    52
    if (p instanceof GradientPaint)
    53
    GradientPaint gp = (GradientPaint)p;
    53
    GradientPaint gp = (GradientPaint)p;
    54
    GradientPaintTransformer t = im.getGradientPaintTransformer();
    54
    GradientPaintTransformer t = im.getGradientPaintTransformer();
    55
    if (t != null)
    55
    if (t != null)
    56
    gp = t.transform(gp, rect);
    56
    gp = t.transform(gp, rect);
    57
    g2.setPaint(gp);
    57
    g2.setPaint(gp);
    else
    else
    58
    g2.setPaint(p);
    58
    g2.setPaint(p);
    59
    g2.fill(rect);
    59
    g2.fill(rect);
    60
    if (im.getOutlinePaint() != null && im.getOutlineStroke() != null)
    60
    if (im.getOutlinePaint() != null && im.getOutlineStroke() != null)
    61
    if (orientation == PlotOrientation.VERTICAL)
    61
    if (orientation == PlotOrientation.VERTICAL)
    62
    Line2D line = new Line2D.Double();
    62
    Line2D line = new Line2D.Double();
    63
    double x0 = dataArea.getMinX();
    63
    double x0 = dataArea.getMinX();
    64
    double x1 = dataArea.getMaxX();
    64
    double x1 = dataArea.getMaxX();
    65
    g2.setPaint(im.getOutlinePaint());
    65
    g2.setPaint(im.getOutlinePaint());
    66
    g2.setStroke(im.getOutlineStroke());
    66
    g2.setStroke(im.getOutlineStroke());
    67
    if (range.contains(start))
    67
    if (range.contains(start))
    68
    line.setLine(x0, start2d, x1, start2d);
    68
    line.setLine(x0, start2d, x1, start2d);
    69
    g2.draw(line);
    69
    g2.draw(line);
    70
    if (range.contains(end))
    70
    if (range.contains(end))
    71
    line.setLine(x0, end2d, x1, end2d);
    71
    line.setLine(x0, end2d, x1, end2d);
    72
    g2.draw(line);
    72
    g2.draw(line);
    else
    else
    73
    Line2D line = new Line2D.Double();
    73
    Line2D line = new Line2D.Double();
    74
    double y0 = dataArea.getMinY();
    74
    double y0 = dataArea.getMinY();
    75
    double y1 = dataArea.getMaxY();
    75
    double y1 = dataArea.getMaxY();
    76
    g2.setPaint(im.getOutlinePaint());
    76
    g2.setPaint(im.getOutlinePaint());
    77
    g2.setStroke(im.getOutlineStroke());
    77
    g2.setStroke(im.getOutlineStroke());
    78
    if (range.contains(start))
    78
    if (range.contains(start))
    79
    line.setLine(start2d, y0, start2d, y1);
    79
    line.setLine(start2d, y0, start2d, y1);
    80
    g2.draw(line);
    80
    g2.draw(line);
    81
    if (range.contains(end))
    81
    if (range.contains(end))
    82
    line.setLine(end2d, y0, end2d, y1);
    82
    line.setLine(end2d, y0, end2d, y1);
    83
    g2.draw(line);
    83
    g2.draw(line);
    84
    String label = marker.getLabel();
    84
    String label = marker.getLabel();
    85
    RectangleAnchor anchor = marker.getLabelAnchor();
    85
    RectangleAnchor anchor = marker.getLabelAnchor();
    86
    if (label != null)
    86
    if (label != null)
    87
    Font labelFont = marker.getLabelFont();
    87
    Font labelFont = marker.getLabelFont();
    88
    g2.setFont(labelFont);
    88
    g2.setFont(labelFont);
    89
    g2.setPaint(marker.getLabelPaint());
    89
    g2.setPaint(marker.getLabelPaint());
    90
    Point2D coordinates = calculateRangeMarkerTextAnchorPoint(g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(), anchor);
    90
    Point2D coordinates = calculateRangeMarkerTextAnchorPoint(g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(), anchor);
    91
    TextUtilities.drawAlignedString(label, g2, (float)coordinates.getX(), (float)coordinates.getY(), marker.getLabelTextAnchor());
    91
    TextUtilities.drawAlignedString(label, g2, (float)coordinates.getX(), (float)coordinates.getY(), marker.getLabelTextAnchor());
    92
    g2.setComposite(savedComposite);
    92
    g2.setComposite(savedComposite);
    92
    g2.setComposite(originalComposite);
    Differences
    Expression1Expression2Difference
    savedCompositeoriginalCompositeVARIABLE_NAME_MISMATCH
    92
    g2.setComposite(originalComposite);
    Precondition Violations (5)
    Row Violation
    1Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.chart.plot.PlotOrientation getOrientation()
    2Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.ui.RectangleEdge getRangeAxisEdge()
    3Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.ui.RectangleEdge getRangeAxisEdge()
    4Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.ui.RectangleEdge getRangeAxisEdge()
    5Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.chart.plot.PlotOrientation getOrientation()