List of usage examples for org.jfree.chart.plot XYPlot removeDomainMarker
public boolean removeDomainMarker(Marker marker)
From source file:com.trivadis.loganalysis.ui.ChartPanel.java
private void removeMarkers(final GarbageCollectionType type) { if (!isDisposed()) { final XYPlot plot = jfreeChart.getXYPlot(); for (final Marker marker : markersByType.get(type)) { plot.removeDomainMarker(marker); }/*from w w w . j a v a 2 s .c o m*/ } }
From source file:de.tor.tribes.ui.views.DSWorkbenchStatsFrame.java
private void setEndAnnotation() { XYPlot plot = ((XYPlot) chart.getPlot()); double x = plot.getDomainCrosshairValue(); if (endPointer != null) { plot.removeDomainMarker(endPointer); }//from w w w .j a v a2 s. c o m if (endPointer != null && endPointer.getValue() == x) { plot.removeDomainMarker(endPointer); endPointer = null; } else { if (startPointer != null) { if (startPointer.getValue() > x) { //flip start and end plot.removeDomainMarker(startPointer); endPointer = new ValueMarker(startPointer.getValue()); endPointer.setLabel("Ende"); endPointer.setPaint(Color.red); plot.addDomainMarker(endPointer); startPointer = new ValueMarker(x); startPointer.setLabel("Start"); startPointer.setPaint(Color.green); plot.addDomainMarker(startPointer); } else { endPointer = new ValueMarker(x); endPointer.setLabel("Ende"); endPointer.setPaint(Color.red); plot.addDomainMarker(endPointer); } } else { endPointer = new ValueMarker(x); endPointer.setLabel("Ende"); endPointer.setPaint(Color.red); plot.addDomainMarker(endPointer); } } jChartPanel.repaint(); }
From source file:de.tor.tribes.ui.views.DSWorkbenchStatsFrame.java
private void setStartAnnotation() { XYPlot plot = ((XYPlot) chart.getPlot()); double x = plot.getDomainCrosshairValue(); if (startPointer != null) { plot.removeDomainMarker(startPointer); }/*from w w w .ja v a 2s.c o m*/ if (startPointer != null && startPointer.getValue() == x) { plot.removeDomainMarker(startPointer); startPointer = null; } else { if (endPointer != null) { if (endPointer.getValue() < x) { //flip start and end plot.removeDomainMarker(endPointer); startPointer = new ValueMarker(endPointer.getValue()); startPointer.setLabel("Start"); startPointer.setPaint(Color.green); plot.addDomainMarker(startPointer); endPointer = new ValueMarker(x); endPointer.setLabel("Ende"); endPointer.setPaint(Color.red); plot.addDomainMarker(endPointer); } else { startPointer = new ValueMarker(x); startPointer.setLabel("Start"); startPointer.setPaint(Color.green); plot.addDomainMarker(startPointer); } } else { startPointer = new ValueMarker(x); startPointer.setLabel("Start"); startPointer.setPaint(Color.green); plot.addDomainMarker(startPointer); } } jChartPanel.repaint(); }