当前位置: 首页>>代码示例>>Java>>正文


Java MarkerChangeListener类代码示例

本文整理汇总了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));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:23,代码来源:MarkerTests.java

示例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));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:23,代码来源:MarkerTests.java

示例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));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:24,代码来源:MarkerTest.java

示例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));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:24,代码来源:MarkerTest.java

示例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));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:XYPlotTests.java

示例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));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:XYPlotTests.java

示例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));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:CategoryPlotTests.java

示例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));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:CategoryPlotTests.java

示例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);
        }
    }

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:Marker.java

示例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));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:16,代码来源:CategoryPlotTest.java

示例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));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:16,代码来源:CategoryPlotTest.java

示例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));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:16,代码来源:XYPlotTest.java

示例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));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:16,代码来源:XYPlotTest.java

示例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);
        }
    }

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:18,代码来源:Marker.java


注:本文中的org.jfree.chart.event.MarkerChangeListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。