@Test public void testRemoveSeries() { Plot plot = new MockPlot("MockPlot"); MockSeries m1 = new MockSeries(); MockSeries m2 = new MockSeries(); MockSeries m3 = new MockSeries(); plot.addSeries(m1, new MockFormatter1()); plot.addSeries(m2, new MockFormatter1()); plot.addSeries(m3, new MockFormatter1()); plot.addSeries(m1, new MockFormatter2()); plot.addSeries(m2, new MockFormatter2()); plot.addSeries(m3, new MockFormatter2()); assertEquals(2, plot.getRendererList().size()); assertEquals(3, plot.getRenderer(MockRenderer1.class).getSeriesList().size()); assertEquals(3, plot.getRenderer(MockRenderer2.class).getSeriesList().size()); plot.removeSeries(m1, MockRenderer1.class); assertEquals(2, plot.getRenderer(MockRenderer1.class).getSeriesList().size()); plot.removeSeries(m2, MockRenderer1.class); assertEquals(1, plot.getRenderer(MockRenderer1.class).getSeriesList().size()); plot.removeSeries(m2, MockRenderer1.class); assertEquals(1, plot.getRenderer(MockRenderer1.class).getSeriesList().size()); plot.removeSeries(m3, MockRenderer1.class); plot.addSeries(m1, new MockFormatter1()); plot.addSeries(m2, new MockFormatter1()); plot.addSeries(m3, new MockFormatter1()); plot.addSeries(m1, new MockFormatter1()); plot.addSeries(m2, new MockFormatter1()); plot.addSeries(m3, new MockFormatter1()); assertEquals(2, plot.getRendererList().size()); assertEquals(6, plot.getRenderer(MockRenderer1.class).getSeriesList().size()); assertEquals(3, plot.getRenderer(MockRenderer2.class).getSeriesList().size()); plot.removeSeries(m1); assertEquals(4, plot.getRenderer(MockRenderer1.class).getSeriesList().size()); assertEquals(2, plot.getRenderer(MockRenderer2.class).getSeriesList().size()); plot.removeSeries(m2); plot.removeSeries(m3); }
public synchronized boolean removeSeries(SeriesType series, Class<? extends RendererType> rendererClass) { List removedItems = getRegistry().remove(series, rendererClass); if (removedItems.size() == 1 && series instanceof PlotListener) { removeListener((PlotListener) series); return true; } return false; }
Plot extends View implements Resizable { public synchronized boolean removeSeries(SeriesType series, Class<? extends RendererType> rendererClass) { List removedItems = getRegistry().remove(series, rendererClass); if (removedItems.size() == 1 && series instanceof PlotListener) { removeListener((PlotListener) series); return true; } return false; } }
Plot extends View implements Resizable { public synchronized boolean removeSeries(SeriesType series, Class<? extends RendererType> rendererClass) { List removedItems = getRegistry().remove(series, rendererClass); if (removedItems.size() == 1 && series instanceof PlotListener) { removeListener((PlotListener) series); return true; } return false; } Plot(Context context, String title);  Plot(Context context, String title, RenderMode mode);  Plot(Context context, AttributeSet attrs);  Plot(Context context, AttributeSet attrs, int defStyle); }
Plot extends View implements Resizable { public synchronized boolean removeSeries(SeriesType series, Class<? extends RendererType> rendererClass) { List removedItems = getRegistry().remove(series, rendererClass); if (removedItems.size() == 1 && series instanceof PlotListener) { removeListener((PlotListener) series); return true; } return false; } Plot(Context context, String title);  Plot(Context context, String title, RenderMode mode);  Plot(Context context, AttributeSet attrs);  Plot(Context context, AttributeSet attrs, int defStyle); DisplayDimensions getDisplayDimensions(); HashMap<Class<? extends RendererType>, RendererType> getRenderers(); RegistryType getRegistry(); void setRegistry(RegistryType registry); TextLabelWidget getTitle(); void setTitle(TextLabelWidget title); void setTitle(String title); void setRenderMode(RenderMode mode); RenderMode getRenderMode(); synchronized boolean addListener(PlotListener listener); synchronized boolean removeListener(PlotListener listener); synchronized boolean addSeries(FormatterType formatter, SeriesType... series); synchronized boolean addSeries(SeriesType series, FormatterType formatter); synchronized boolean removeSeries(SeriesType series, Class<? extends RendererType> rendererClass); synchronized void removeSeries(SeriesType series); void clear(); boolean isEmpty(); FormatterType getFormatter(SeriesType series, Class<? extends RendererType> rendererClass); T getRenderer(Class<T> rendererClass); List<RendererType> getRendererList(); void setMarkupEnabled(boolean enabled); void redraw(); @Override synchronized void layout(final DisplayDimensions dims); void setBorderStyle(BorderStyle style, Float radiusX, Float radiusY); LayoutManager getLayoutManager(); void setLayoutManager(LayoutManager layoutManager); Paint getBackgroundPaint(); void setBackgroundPaint(Paint backgroundPaint); void setPlotMargins(float left, float top, float right, float bottom); void setPlotPadding(float left, float top, float right, float bottom); float getPlotMarginTop(); void setPlotMarginTop(float plotMarginTop); float getPlotMarginBottom(); void setPlotMarginBottom(float plotMarginBottom); float getPlotMarginLeft(); void setPlotMarginLeft(float plotMarginLeft); float getPlotMarginRight(); void setPlotMarginRight(float plotMarginRight); float getPlotPaddingTop(); void setPlotPaddingTop(float plotPaddingTop); float getPlotPaddingBottom(); void setPlotPaddingBottom(float plotPaddingBottom); float getPlotPaddingLeft(); void setPlotPaddingLeft(float plotPaddingLeft); float getPlotPaddingRight(); void setPlotPaddingRight(float plotPaddingRight); Paint getBorderPaint(); void setBorderPaint(Paint borderPaint); }
Plot extends View implements Resizable { public synchronized boolean removeSeries(SeriesType series, Class<? extends RendererType> rendererClass) { List removedItems = getRegistry().remove(series, rendererClass); if (removedItems.size() == 1 && series instanceof PlotListener) { removeListener((PlotListener) series); return true; } return false; } Plot(Context context, String title);  Plot(Context context, String title, RenderMode mode);  Plot(Context context, AttributeSet attrs);  Plot(Context context, AttributeSet attrs, int defStyle); DisplayDimensions getDisplayDimensions(); HashMap<Class<? extends RendererType>, RendererType> getRenderers(); RegistryType getRegistry(); void setRegistry(RegistryType registry); TextLabelWidget getTitle(); void setTitle(TextLabelWidget title); void setTitle(String title); void setRenderMode(RenderMode mode); RenderMode getRenderMode(); synchronized boolean addListener(PlotListener listener); synchronized boolean removeListener(PlotListener listener); synchronized boolean addSeries(FormatterType formatter, SeriesType... series); synchronized boolean addSeries(SeriesType series, FormatterType formatter); synchronized boolean removeSeries(SeriesType series, Class<? extends RendererType> rendererClass); synchronized void removeSeries(SeriesType series); void clear(); boolean isEmpty(); FormatterType getFormatter(SeriesType series, Class<? extends RendererType> rendererClass); T getRenderer(Class<T> rendererClass); List<RendererType> getRendererList(); void setMarkupEnabled(boolean enabled); void redraw(); @Override synchronized void layout(final DisplayDimensions dims); void setBorderStyle(BorderStyle style, Float radiusX, Float radiusY); LayoutManager getLayoutManager(); void setLayoutManager(LayoutManager layoutManager); Paint getBackgroundPaint(); void setBackgroundPaint(Paint backgroundPaint); void setPlotMargins(float left, float top, float right, float bottom); void setPlotPadding(float left, float top, float right, float bottom); float getPlotMarginTop(); void setPlotMarginTop(float plotMarginTop); float getPlotMarginBottom(); void setPlotMarginBottom(float plotMarginBottom); float getPlotMarginLeft(); void setPlotMarginLeft(float plotMarginLeft); float getPlotMarginRight(); void setPlotMarginRight(float plotMarginRight); float getPlotPaddingTop(); void setPlotPaddingTop(float plotPaddingTop); float getPlotPaddingBottom(); void setPlotPaddingBottom(float plotPaddingBottom); float getPlotPaddingLeft(); void setPlotPaddingLeft(float plotPaddingLeft); float getPlotPaddingRight(); void setPlotPaddingRight(float plotPaddingRight); Paint getBorderPaint(); void setBorderPaint(Paint borderPaint);  }