/** * Sets the title list for the chart (completely replaces any existing * titles) and sends a {@link ChartChangeEvent} to all registered * listeners. * * @param subtitles the new list of subtitles (<code>null</code> not * permitted). * * @see #getSubtitles() */ public void setSubtitles(List subtitles) { if (subtitles == null) { throw new NullPointerException("Null 'subtitles' argument."); } setNotify(false); clearSubtitles(); Iterator iterator = subtitles.iterator(); while (iterator.hasNext()) { Title t = (Title) iterator.next(); if (t != null) { addSubtitle(t); } } setNotify(true); // this fires a ChartChangeEvent }
/** * Sets the title list for the chart (completely replaces any existing * titles) and sends a {@link ChartChangeEvent} to all registered * listeners. * * @param subtitles the new list of subtitles ({@code null} not * permitted). * * @see #getSubtitles() */ public void setSubtitles(List<Title> subtitles) { Args.nullNotPermitted(subtitles, "subtitles"); setNotify(false); clearSubtitles(); for (Title t: subtitles) { if (t != null) { addSubtitle(t); } } setNotify(true); // this fires a ChartChangeEvent }
/** * Create a chart with the underlying dataset. * @return The chart. */ protected JFreeChart createChart() { XYDataset dataset = new TimeSeriesCollection(); JFreeChart chart = ChartFactory.createTimeSeriesChart("Service Quality", "ms", "score", dataset, true, true, true); chart.setNotify(true); ChartPanel panel = new ChartPanel(chart); panel.setFillZoomRectangle(true); frame = new JFrame(); JPanel content = new JPanel(new BorderLayout()); content.add(panel, BorderLayout.CENTER); frame.setContentPane(panel); frame.pack(); frame.setVisible(true); return chart; }
private void toggleColor() { BufferedImage image = plot.getImage(); if (image != null) { if (!plotColorsInverted) { image = new BufferedImage(untoggledColorModel, image.getRaster(), image.isAlphaPremultiplied(), null); } else { image = new BufferedImage(toggledColorModel, image.getRaster(), image.isAlphaPremultiplied(), null); } plot.setImage(image); densityPlotDisplay.getChart().setNotify(true); plotColorsInverted = !plotColorsInverted; } }
private void toggleColor() { BufferedImage image = plot.getImage(); if (image != null) { if (!plotColorsInverted) { image = new BufferedImage(untoggledColorModel, image.getRaster(), image.isAlphaPremultiplied(), null); } else { image = new BufferedImage(toggledColorModel, image.getRaster(), image.isAlphaPremultiplied(), null); } plot.setImage(image); densityPlotDisplay.getChart().setNotify(true); plotColorsInverted = !plotColorsInverted; } }
return; this.chart.setNotify(true); // force a redraw
public void update(Planar<GrayF32> color , InterleavedU8 binary ) { // this is supposed to speed it up. not sure if it does chartHS.chart.setNotify(false); chartVS.chart.setNotify(false); chartHS.dataset.removeAllSeries(); chartVS.dataset.removeAllSeries(); XYSeries seriesHS = new XYSeries("1"); XYSeries seriesVS = new XYSeries("2"); GrayF32 H = color.getBand(0); GrayF32 S = color.getBand(1); GrayF32 V = color.getBand(2); for( int y = 0; y < binary.height; y++ ) { int index = binary.startIndex + y*binary.stride; for( int x = 0; x < binary.width; x++ ) { if( binary.data[index++] == 1 ) { float h = H.unsafe_get(x,y); float s = S.unsafe_get(x,y); float v = V.unsafe_get(x,y); seriesHS.add(h, s); seriesVS.add(v, s); } } } chartHS.dataset.addSeries(seriesHS); chartVS.dataset.addSeries(seriesVS); chartHS.chart.setNotify(true); chartVS.chart.setNotify(true); repaint(); }
return; this.chart.setNotify(true); // force a redraw
protected synchronized void updateResults() { JFreeChart chart; if (numberOfAllPaths <= 0) { makePromptInteractive(false); if (graphFrame != null) { chart = graphFrame.chartPanel.getChart(); if (chart != null) { chart.setNotify(false); final TextTitle currentitle = chart.getTitle(); if (currentitle != null) currentitle.setText(""); final XYPlot plot = chart.getXYPlot(); if (plot != null) plot.setDataset(null); chart.setNotify(true); } } } else { // valid paths to be analyzed makePromptInteractive(true); final ShollResults results = getCurrentResults(); resultsPanel.updateFromResults(results); chart = results.createGraph(); if (chart == null) return; if (graphFrame == null) graphFrame = new GraphFrame(chart, results.getSuggestedSuffix()); else graphFrame.updateWithNewChart(chart, results.getSuggestedSuffix()); } }
chart.setNotify(autorepaint);
chart.setNotify(autorepaint);
chart.setNotify(autorepaint);
chart.setNotify(autorepaint);
this.chart.setNotify(true);