本文整理汇总了Java中org.jfree.chart.event.MarkerChangeListener类的典型用法代码示例。如果您正苦于以下问题:Java MarkerChangeListener类的具体用法?Java MarkerChangeListener怎么用?Java MarkerChangeListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MarkerChangeListener类属于org.jfree.chart.event包,在下文中一共展示了MarkerChangeListener类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testListenersWithCategoryPlot
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的package包/类
/**
* Checks that a CategoryPlot deregisters listeners when clearing markers.
*/
public void testListenersWithCategoryPlot() {
CategoryPlot plot = new CategoryPlot();
CategoryMarker marker1 = new CategoryMarker("X");
ValueMarker marker2 = new ValueMarker(1.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: testListenersWithXYPlot
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的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));
}
示例3: testListenersWithCategoryPlot
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的package包/类
/**
* Checks that a CategoryPlot deregisters listeners when clearing markers.
*/
@Test
public void testListenersWithCategoryPlot() {
CategoryPlot plot = new CategoryPlot();
CategoryMarker marker1 = new CategoryMarker("X");
ValueMarker marker2 = new ValueMarker(1.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));
}
示例4: testListenersWithXYPlot
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的package包/类
/**
* Checks that an XYPlot deregisters listeners when clearing markers.
*/
@Test
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));
}
示例5: testAddDomainMarker
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的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));
}
示例6: testAddRangeMarker
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的package包/类
/**
* Some tests for the addRangeMarker() method(s).
*/
public void testAddRangeMarker() {
XYPlot plot = new XYPlot();
Marker m = new ValueMarker(1.0);
plot.addRangeMarker(m);
List listeners = Arrays.asList(m.getListeners(
MarkerChangeListener.class));
assertTrue(listeners.contains(plot));
plot.clearRangeMarkers();
listeners = Arrays.asList(m.getListeners(MarkerChangeListener.class));
assertFalse(listeners.contains(plot));
}
示例7: testAddDomainMarker
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的package包/类
/**
* Some tests for the addDomainMarker() method(s).
*/
public void testAddDomainMarker() {
CategoryPlot plot = new CategoryPlot();
CategoryMarker m = new CategoryMarker("C1");
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));
}
示例8: testAddRangeMarker
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的package包/类
/**
* Some tests for the addRangeMarker() method(s).
*/
public void testAddRangeMarker() {
CategoryPlot plot = new CategoryPlot();
Marker m = new ValueMarker(1.0);
plot.addRangeMarker(m);
List listeners = Arrays.asList(m.getListeners(
MarkerChangeListener.class));
assertTrue(listeners.contains(plot));
plot.clearRangeMarkers();
listeners = Arrays.asList(m.getListeners(MarkerChangeListener.class));
assertFalse(listeners.contains(plot));
}
示例9: notifyListeners
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的package包/类
/**
* Notifies all registered listeners that the marker has been modified.
*
* @param event information about the change event.
*
* @since 1.0.3
*/
public void notifyListeners(MarkerChangeEvent event) {
Object[] listeners = this.listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == MarkerChangeListener.class) {
((MarkerChangeListener) listeners[i + 1]).markerChanged(event);
}
}
}
示例10: testAddDomainMarker
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的package包/类
/**
* Some tests for the addDomainMarker() method(s).
*/
@Test
public void testAddDomainMarker() {
CategoryPlot plot = new CategoryPlot();
CategoryMarker m = new CategoryMarker("C1");
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));
}
示例11: testAddRangeMarker
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的package包/类
/**
* Some tests for the addRangeMarker() method(s).
*/
@Test
public void testAddRangeMarker() {
CategoryPlot plot = new CategoryPlot();
Marker m = new ValueMarker(1.0);
plot.addRangeMarker(m);
List listeners = Arrays.asList(m.getListeners(
MarkerChangeListener.class));
assertTrue(listeners.contains(plot));
plot.clearRangeMarkers();
listeners = Arrays.asList(m.getListeners(MarkerChangeListener.class));
assertFalse(listeners.contains(plot));
}
示例12: testAddDomainMarker
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的package包/类
/**
* Some tests for the addDomainMarker() method(s).
*/
@Test
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));
}
示例13: testAddRangeMarker
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的package包/类
/**
* Some tests for the addRangeMarker() method(s).
*/
@Test
public void testAddRangeMarker() {
XYPlot plot = new XYPlot();
Marker m = new ValueMarker(1.0);
plot.addRangeMarker(m);
List listeners = Arrays.asList(m.getListeners(
MarkerChangeListener.class));
assertTrue(listeners.contains(plot));
plot.clearRangeMarkers();
listeners = Arrays.asList(m.getListeners(MarkerChangeListener.class));
assertFalse(listeners.contains(plot));
}
示例14: notifyListeners
import org.jfree.chart.event.MarkerChangeListener; //导入依赖的package包/类
/**
* Notifies all registered listeners that the marker has been modified.
*
* @param event information about the change event.
*
* @since 1.0.3
*/
public void notifyListeners(MarkerChangeEvent event) {
Object[] listeners = this.listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == MarkerChangeListener.class) {
((MarkerChangeListener) listeners[i + 1]).markerChanged(event);
}
}
}