Example usage for org.jfree.chart.plot XYPlot removeDomainMarker

List of usage examples for org.jfree.chart.plot XYPlot removeDomainMarker

Introduction

In this page you can find the example usage for org.jfree.chart.plot XYPlot removeDomainMarker.

Prototype

public boolean removeDomainMarker(Marker marker) 

Source Link

Document

Removes a marker for the domain axis and sends a PlotChangeEvent to all registered listeners.

Usage

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();
}