@Test public void testCloning() throws CloneNotSupportedException { CombinedRangeXYPlot plot1 = createPlot(); CombinedRangeXYPlot plot2 = (CombinedRangeXYPlot) plot1.clone(); assertNotSame(plot1, plot2); assertSame(plot1.getClass(), plot2.getClass()); assertEquals(plot1, plot2); }
@Override public Object clone() throws CloneNotSupportedException { CombinedRangeXYPlot result = (CombinedRangeXYPlot) super.clone(); result.subplots = (List<XYPlot>) ObjectUtilities.deepClone(this.subplots); for (XYPlot subplot : result.subplots) { subplot.setParent(result); } ValueAxis rangeAxis = result.getRangeAxis(); if (rangeAxis != null) { rangeAxis.configure(); } return result; }
CombinedRangeXYPlot extends XYPlot implements PlotChangeListener { @Override public Object clone() throws CloneNotSupportedException { CombinedRangeXYPlot result = (CombinedRangeXYPlot) super.clone(); result.subplots = (List<XYPlot>) ObjectUtilities.deepClone(this.subplots); for (XYPlot subplot : result.subplots) { subplot.setParent(result); } ValueAxis rangeAxis = result.getRangeAxis(); if (rangeAxis != null) { rangeAxis.configure(); } return result; } }
CombinedRangeXYPlot extends XYPlot implements PlotChangeListener { @Override public Object clone() throws CloneNotSupportedException { CombinedRangeXYPlot result = (CombinedRangeXYPlot) super.clone(); result.subplots = (List<XYPlot>) ObjectUtilities.deepClone(this.subplots); for (XYPlot subplot : result.subplots) { subplot.setParent(result); } ValueAxis rangeAxis = result.getRangeAxis(); if (rangeAxis != null) { rangeAxis.configure(); } return result; } CombinedRangeXYPlot();  CombinedRangeXYPlot(ValueAxis rangeAxis); }
CombinedRangeXYPlot extends XYPlot implements PlotChangeListener { @Override public Object clone() throws CloneNotSupportedException { CombinedRangeXYPlot result = (CombinedRangeXYPlot) super.clone(); result.subplots = (List<XYPlot>) ObjectUtilities.deepClone(this.subplots); for (XYPlot subplot : result.subplots) { subplot.setParent(result); } ValueAxis rangeAxis = result.getRangeAxis(); if (rangeAxis != null) { rangeAxis.configure(); } return result; } CombinedRangeXYPlot();  CombinedRangeXYPlot(ValueAxis rangeAxis); @Override String getPlotType(); double getGap(); void setGap(double gap); void add(XYPlot subplot); void add(XYPlot subplot, int weight); void remove(XYPlot subplot); List<XYPlot> getSubplots(); @Override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
            PlotState parentState, PlotRenderingInfo info); @Override List<LegendItem> getLegendItems(); @Override void zoomDomainAxes(double factor, PlotRenderingInfo info,
                               Point2D source); @Override void zoomDomainAxes(double factor, PlotRenderingInfo info,
                               Point2D source, boolean useAnchor); @Override void zoomDomainAxes(double lowerPercent, double upperPercent,
                               PlotRenderingInfo info, Point2D source); @Override void panDomainAxes(double panRange, PlotRenderingInfo info,
            Point2D source); XYPlot findSubplot(PlotRenderingInfo info, Point2D source); @Override void setRenderer(XYItemRenderer renderer); @Override void setOrientation(PlotOrientation orientation); @Override void setShadowGenerator(ShadowGenerator generator); @Override Range getDataRange(ValueAxis axis); @Override void handleClick(int x, int y, PlotRenderingInfo info); @Override void plotChanged(PlotChangeEvent event); @Override boolean equals(Object obj); @Override Object clone(); }
CombinedRangeXYPlot extends XYPlot implements PlotChangeListener { @Override public Object clone() throws CloneNotSupportedException { CombinedRangeXYPlot result = (CombinedRangeXYPlot) super.clone(); result.subplots = (List<XYPlot>) ObjectUtilities.deepClone(this.subplots); for (XYPlot subplot : result.subplots) { subplot.setParent(result); } ValueAxis rangeAxis = result.getRangeAxis(); if (rangeAxis != null) { rangeAxis.configure(); } return result; } CombinedRangeXYPlot();  CombinedRangeXYPlot(ValueAxis rangeAxis); @Override String getPlotType(); double getGap(); void setGap(double gap); void add(XYPlot subplot); void add(XYPlot subplot, int weight); void remove(XYPlot subplot); List<XYPlot> getSubplots(); @Override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
            PlotState parentState, PlotRenderingInfo info); @Override List<LegendItem> getLegendItems(); @Override void zoomDomainAxes(double factor, PlotRenderingInfo info,
                               Point2D source); @Override void zoomDomainAxes(double factor, PlotRenderingInfo info,
                               Point2D source, boolean useAnchor); @Override void zoomDomainAxes(double lowerPercent, double upperPercent,
                               PlotRenderingInfo info, Point2D source); @Override void panDomainAxes(double panRange, PlotRenderingInfo info,
            Point2D source); XYPlot findSubplot(PlotRenderingInfo info, Point2D source); @Override void setRenderer(XYItemRenderer renderer); @Override void setOrientation(PlotOrientation orientation); @Override void setShadowGenerator(ShadowGenerator generator); @Override Range getDataRange(ValueAxis axis); @Override void handleClick(int x, int y, PlotRenderingInfo info); @Override void plotChanged(PlotChangeEvent event); @Override boolean equals(Object obj); @Override Object clone();  }