Package tangowidget.util.listenerimpl

Examples of tangowidget.util.listenerimpl.ITableListenerImpl


    final JLChart chart = (JLChart) tth.findFirstComponent(JLChart.class,
        jf1);
    Assert.assertTrue("JLChart component not found", chart != null);

    final ITableListenerImpl listenerTest = new ITableListenerImpl();
    widget.addTableListener(listenerTest);

    tth.mouseClickOnComponent(chart);
    Sleeper.SECONDS.sleep(5);

    final int notifCount = listenerTest.getNotifyCount();
    Assert.assertTrue("listener has been notified " + notifCount
        + " instead of 6 times ", notifCount == 6);
    Assert.assertTrue(listenerTest.getNotification("selectedXChanged(int)") != null);
    Assert.assertTrue(listenerTest
        .getNotification("selectedXChanged(double)") != null);
    Assert.assertTrue(listenerTest.getNotification("selectedYChanged(int)") != null);
    Assert.assertTrue(listenerTest
        .getNotification("selectedYChanged(double)") != null);
    Assert.assertTrue(listenerTest.getNotification("selectedPointChanged") != null);

    // le clic est effectu� au milieu du composant
    final double xClick = xData[xData.length / 2]; // le spectre en x est
                            // lin�aire
    final double yClick = yData[yData.length / 2];

    // Assert.assertTrue(listenerTest.getNotification("selectedXChanged(int)").equals((int)xClick));
    // Assert.assertTrue(listenerTest.getNotification("selectedXChanged(double)").equals(xClick));
    // Assert.assertTrue(listenerTest.getNotification("selectedYChanged(int)").equals((int)yClick));
    // Assert.assertTrue(listenerTest.getNotification("selectedYChanged(double)").equals(yClick));

    widget.removeTableListener(listenerTest);
    listenerTest.reset();

    tth.mouseClickOnComponent(chart);
    Sleeper.SECONDS.sleep(1);

    Assert.assertTrue("listener should not be notified",
        listenerTest.getNotifyCount() == 0);

    // clean
    widget.stop();
    jf1.dispose();
  }
View Full Code Here


        final AttributeImagePanel widget = new AttributeImagePanel.Builder(m_deviceName,
                attributeName).jframe(jf1).build();
        Sleeper.SECONDS.sleep(2);

        final ITableListenerImpl listenerTest = new ITableListenerImpl();
        widget.addTableListener(listenerTest);

        // TODO http://controle/mantis/view.php?id=21242
        // attendre la disponibilit� d'une m�thode getImageZoneLocationOnScreen()
        // dans la classe ImageViewer permettant d'obtenir la localisation sur
View Full Code Here

        Sleeper.SECONDS.sleep(2);

        final JLChart chart = (JLChart) tth.findFirstComponent(JLChart.class, jf1);
        Assert.assertTrue("JLChart component not found", chart != null);

        final ITableListenerImpl listenerTest = new ITableListenerImpl();
        widget.addTableListener(listenerTest);

        tth.mouseClickOnComponent(chart);
        Sleeper.SECONDS.sleep(5);

        final int notifCount = listenerTest.getNotifyCount();
        Assert.assertTrue("listener has been notified " + notifCount + "instead of 6 times ",
                notifCount == 6);
        Assert.assertTrue(listenerTest.getNotification("selectedXChanged(int)") != null);
        Assert.assertTrue(listenerTest.getNotification("selectedXChanged(double)") != null);
        Assert.assertTrue(listenerTest.getNotification("selectedYChanged(int)") != null);
        Assert.assertTrue(listenerTest.getNotification("selectedYChanged(double)") != null);
        Assert.assertTrue(listenerTest.getNotification("selectedPointChanged") != null);

        // le clic est effectu� au milieu du composant
        final int xClick = data.length / 2;
        final double yClic = data[xClick];

        // Assert.assertTrue(listenerTest.getNotification("selectedXChanged(int)").equals(xClick));
        // Assert.assertTrue(listenerTest.getNotification("selectedXChanged(double)").equals((double)xClick));
        // Assert.assertTrue(listenerTest.getNotification("selectedYChanged(int)").equals((int)yClick));
        // Assert.assertTrue(listenerTest.getNotification("selectedYChanged(double)").equals(yClick));

        widget.removeTableListener(listenerTest);
        listenerTest.reset();

        tth.mouseClickOnComponent(chart);
        Sleeper.SECONDS.sleep(1);

        Assert.assertTrue("listener should not be notified", listenerTest.getNotifyCount() == 0);

        // clean
        widget.stop();
        jf1.dispose();
    }
View Full Code Here

    final AttributeImagePanel widget = new AttributeImagePanel.Builder(
        m_deviceName, attributeName).jframe(jf1).build();
    Sleeper.SECONDS.sleep(2);

    final ITableListenerImpl listenerTest = new ITableListenerImpl();
    widget.addTableListener(listenerTest);

    // TODO http://controle/mantis/view.php?id=21242
    // attendre la disponibilit� d'une m�thode
    // getImageZoneLocationOnScreen()
View Full Code Here

    final JLChart chart = (JLChart) tth.findFirstComponent(JLChart.class,
        jf1);
    Assert.assertTrue("JLChart component not found", chart != null);

    final ITableListenerImpl listenerTest = new ITableListenerImpl();
    widget.addTableListener(listenerTest);

    tth.mouseClickOnComponent(chart);
    Sleeper.SECONDS.sleep(5);

    final int notifCount = listenerTest.getNotifyCount();
    Assert.assertTrue("listener has been notified " + notifCount
        + "instead of 6 times ", notifCount == 6);
    Assert.assertTrue(listenerTest.getNotification("selectedXChanged(int)") != null);
    Assert.assertTrue(listenerTest
        .getNotification("selectedXChanged(double)") != null);
    Assert.assertTrue(listenerTest.getNotification("selectedYChanged(int)") != null);
    Assert.assertTrue(listenerTest
        .getNotification("selectedYChanged(double)") != null);
    Assert.assertTrue(listenerTest.getNotification("selectedPointChanged") != null);

    // le clic est effectu� au milieu du composant
    final int xClick = data.length / 2;
    final double yClic = data[xClick];

    // Assert.assertTrue(listenerTest.getNotification("selectedXChanged(int)").equals(xClick));
    // Assert.assertTrue(listenerTest.getNotification("selectedXChanged(double)").equals((double)xClick));
    // Assert.assertTrue(listenerTest.getNotification("selectedYChanged(int)").equals((int)yClick));
    // Assert.assertTrue(listenerTest.getNotification("selectedYChanged(double)").equals(yClick));

    widget.removeTableListener(listenerTest);
    listenerTest.reset();

    tth.mouseClickOnComponent(chart);
    Sleeper.SECONDS.sleep(1);

    Assert.assertTrue("listener should not be notified",
        listenerTest.getNotifyCount() == 0);

    // clean
    widget.stop();
    jf1.dispose();
  }
View Full Code Here

        Sleeper.SECONDS.sleep(2);

        final JLChart chart = (JLChart) tth.findFirstComponent(JLChart.class, jf1);
        Assert.assertTrue("JLChart component not found", chart != null);

        final ITableListenerImpl listenerTest = new ITableListenerImpl();
        widget.addTableListener(listenerTest);

        tth.mouseClickOnComponent(chart);
        Sleeper.SECONDS.sleep(5);

        final int notifCount = listenerTest.getNotifyCount();
        Assert.assertTrue("listener has been notified " + notifCount + " instead of 6 times ",
                notifCount == 6);
        Assert.assertTrue(listenerTest.getNotification("selectedXChanged(int)") != null);
        Assert.assertTrue(listenerTest.getNotification("selectedXChanged(double)") != null);
        Assert.assertTrue(listenerTest.getNotification("selectedYChanged(int)") != null);
        Assert.assertTrue(listenerTest.getNotification("selectedYChanged(double)") != null);
        Assert.assertTrue(listenerTest.getNotification("selectedPointChanged") != null);

        // le clic est effectu� au milieu du composant
        final double xClick = xData[xData.length / 2]; // le spectre en x est lin�aire
        final double yClick = yData[yData.length / 2];

        // Assert.assertTrue(listenerTest.getNotification("selectedXChanged(int)").equals((int)xClick));
        // Assert.assertTrue(listenerTest.getNotification("selectedXChanged(double)").equals(xClick));
        // Assert.assertTrue(listenerTest.getNotification("selectedYChanged(int)").equals((int)yClick));
        // Assert.assertTrue(listenerTest.getNotification("selectedYChanged(double)").equals(yClick));

        widget.removeTableListener(listenerTest);
        listenerTest.reset();

        tth.mouseClickOnComponent(chart);
        Sleeper.SECONDS.sleep(1);

        Assert.assertTrue("listener should not be notified", listenerTest.getNotifyCount() == 0);

        // clean
        widget.stop();
        jf1.dispose();
    }
View Full Code Here

TOP

Related Classes of tangowidget.util.listenerimpl.ITableListenerImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.