List of usage examples for org.jfree.chart.annotations XYPointerAnnotation getY
public double getY()
From source file:com.bwc.ora.views.LabelPopupMenu.java
private void removeAnnotation() { for (Object annotation : chartPanel.getChart().getXYPlot().getAnnotations()) { if (annotation instanceof XYPointerAnnotation) { XYPointerAnnotation pointer = (XYPointerAnnotation) annotation; if (pointer.getX() == item.getDataset().getXValue(item.getSeriesIndex(), item.getItem()) && pointer.getY() == item.getDataset().getYValue(item.getSeriesIndex(), item.getItem())) { chartPanel.getChart().getXYPlot().removeAnnotation(pointer); break; }/* w ww .ja va2 s . c o m*/ } } }
From source file:com.bwc.ora.views.LabelPopupMenu.java
private boolean hasAnnoationAlready() { boolean hasAnnotationAlready = false; for (Object annotation : chartPanel.getChart().getXYPlot().getAnnotations()) { if (annotation instanceof XYPointerAnnotation) { XYPointerAnnotation pointer = (XYPointerAnnotation) annotation; if (pointer.getX() == item.getDataset().getXValue(item.getSeriesIndex(), item.getItem()) && pointer.getY() == item.getDataset().getYValue(item.getSeriesIndex(), item.getItem())) { hasAnnotationAlready = true; break; }/*from w ww . ja v a2s . co m*/ } } return hasAnnotationAlready; }