本文整理匯總了Java中org.jfree.chart.plot.XYPlot.clearDomainMarkers方法的典型用法代碼示例。如果您正苦於以下問題:Java XYPlot.clearDomainMarkers方法的具體用法?Java XYPlot.clearDomainMarkers怎麽用?Java XYPlot.clearDomainMarkers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.plot.XYPlot
的用法示例。
在下文中一共展示了XYPlot.clearDomainMarkers方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testListenersWithXYPlot
import org.jfree.chart.plot.XYPlot; //導入方法依賴的package包/類
/**
* Checks that an XYPlot deregisters listeners when clearing markers.
*/
public void testListenersWithXYPlot() {
XYPlot plot = new XYPlot();
ValueMarker marker1 = new ValueMarker(1.0);
ValueMarker marker2 = new ValueMarker(2.0);
plot.addDomainMarker(marker1);
plot.addRangeMarker(marker2);
EventListener[] listeners1 = marker1.getListeners(
MarkerChangeListener.class);
assertTrue(Arrays.asList(listeners1).contains(plot));
EventListener[] listeners2 = marker1.getListeners(
MarkerChangeListener.class);
assertTrue(Arrays.asList(listeners2).contains(plot));
plot.clearDomainMarkers();
plot.clearRangeMarkers();
listeners1 = marker1.getListeners(MarkerChangeListener.class);
assertFalse(Arrays.asList(listeners1).contains(plot));
listeners2 = marker1.getListeners(MarkerChangeListener.class);
assertFalse(Arrays.asList(listeners2).contains(plot));
}
示例2: testAddDomainMarker
import org.jfree.chart.plot.XYPlot; //導入方法依賴的package包/類
/**
* Some tests for the addDomainMarker() method(s).
*/
public void testAddDomainMarker() {
XYPlot plot = new XYPlot();
Marker m = new ValueMarker(1.0);
plot.addDomainMarker(m);
List listeners = Arrays.asList(m.getListeners(
MarkerChangeListener.class));
assertTrue(listeners.contains(plot));
plot.clearDomainMarkers();
listeners = Arrays.asList(m.getListeners(MarkerChangeListener.class));
assertFalse(listeners.contains(plot));
}