Package fr.soleil.globalscreen.tangowidget.attribute

Examples of fr.soleil.globalscreen.tangowidget.attribute.AttributeImagePanelCometeV2


        // Initialiser le device et le composant
        initFirstDevice();
        int data[] = readImageAttribute(m_deviceProxy, attributeName);

        final AttributeImagePanelCometeV2 widget = new AttributeImagePanelCometeV2.Builder(
                m_deviceName, attributeName).alarmEnable(false).jframe(jf1).confirmation(false)
                .build();

        Sleeper.SECONDS.sleep(2);

        final Object numberMatrix = widget.getData();
        Assert.assertTrue("Widget does'nt reflect image attribute", equality(numberMatrix, data));

        // modifier la valeur de l'attribut
        for (int i = 0; i < data.length; i++) {
            data[i] += i;
        }

        m_deviceProxy.write_attribute(new DeviceAttribute(attributeName, data, widget.getDimX(),
                widget.getDimY()));

        Sleeper.SECONDS.sleep(2);

        Assert.assertTrue("Widget does'nt reflect image attribute",
                equality(widget.getData(), data));

        // Faire varier le nom de l'attribut
        attributeName = "int_image_ro";
        data = readImageAttribute(m_deviceProxy2, attributeName);

        widget.setAttributeName(attributeName);
        Sleeper.SECONDS.sleep(2);

        Assert.assertTrue("Widget does'nt reflect image attribute",
                equality(widget.getData(), data));

        // Faire varier le nom du device
        initSecondDevice();
        data = readImageAttribute(m_deviceProxy2, attributeName);

        widget.setDeviceName(m_deviceName2);
        Sleeper.SECONDS.sleep(2);

        // TODO
        // le changement de device ne fonctionne pas
        // Assert.assertTrue("Widget does'nt reflect image attribute",equality(widget.getData(),data));

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


        jf1 = new JFrame();

        // Initialiser le device et le composant
        initFirstDevice();
        final AttributeImagePanelCometeV2 widget = new AttributeImagePanelCometeV2.Builder(
                m_deviceName, attributeName).alarmEnable(false).jframe(jf1).confirmation(false)
                .build();

        Sleeper.SECONDS.sleep(2);

        final ImageViewer imageViewer = (ImageViewer) tth
                .findFirstComponent(ImageViewer.class, jf1);
        Assert.assertTrue("Image viewer not found", imageViewer != null);

        imageViewer.showTable();

        Sleeper.SECONDS.sleep(1);

        final JDialog tableDialog = tth.findDialog("Matrix Data");
        Assert.assertTrue("Table dialog not found", tableDialog != null);

        final NumberTable table = (NumberTable) tth.findFirstComponent(NumberTable.class,
                tableDialog);
        Assert.assertTrue("Table not found", table != null);

        widget.setUserEnabled(false);
        Sleeper.SECONDS.sleep(1);

        Assert.assertFalse("Table should not be editable", table.isEditable());

        System.out.println("test userEnable true source ro");
        widget.setUserEnabled(true);
        Sleeper.SECONDS.sleep(1);

        Assert.assertFalse("Table should not be editable", table.isEditable());

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

        jf1 = new JFrame();

        // Initialiser le device et le composant
        initFirstDevice();
        final AttributeImagePanelCometeV2 widget = new AttributeImagePanelCometeV2.Builder(
                m_deviceName, attributeName).alarmEnable(alarmEnabled).jframe(jf1)
                .confirmation(false).build();

        Sleeper.SECONDS.sleep(2);

        // final GComponentFinder finder = new GComponentFinder(ImageViewer.class);

        final ImageViewer imageViewer = (ImageViewer) tth
                .findFirstComponent(ImageViewer.class, jf1);

        // final ImageViewer imageViewer = (ImageViewer) finder.find(jf, 0);
        Assert.assertTrue("Image viewer not found", imageViewer != null);

        imageViewer.showTable();

        Sleeper.SECONDS.sleep(1);

        final JDialog tableDialog = tth.findDialog("Matrix Data");
        Assert.assertTrue("Table dialog not found", tableDialog != null);

        final NumberTable table = (NumberTable) tth.findFirstComponent(NumberTable.class,
                tableDialog);
        Assert.assertTrue("Table not found", table != null);

        widget.setUserEnabled(false);
        Sleeper.SECONDS.sleep(1);

        Assert.assertTrue("Table should not be editable", !table.isEditable());

        widget.setUserEnabled(true);
        Sleeper.SECONDS.sleep(1);

        Assert.assertTrue("Table should be editable", table.isEditable());

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

        jf1 = new JFrame();

        // Initialiser le device et le composant
        initFirstDevice();
        final AttributeImagePanelCometeV2 widget = new AttributeImagePanelCometeV2.Builder(
                m_deviceName, attributeName).monochrome(true).alarmEnable(false).jframe(jf1)
                .confirmation(false).build();

        Sleeper.SECONDS.sleep(2);

        final ImageViewer imageViewer = (ImageViewer) tth
                .findFirstComponent(ImageViewer.class, jf1);
        Assert.assertTrue("Image viewer not found", imageViewer != null);

        final BufferedImage image = imageViewer.getImage();

        for (int x = 0; x < image.getWidth(); x++) {
            for (int y = 0; y < image.getHeight(); y++) {
                Assert.assertTrue("Image is not BW", isBWColor(new Color(image.getRGB(0, 0))));
            }
        }

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

    // Initialiser le device et le composant
    initFirstDevice();
    int data[] = readImageAttribute(m_deviceProxy, attributeName);

    final AttributeImagePanelCometeV2 widget = new AttributeImagePanelCometeV2.Builder(
        m_deviceName, attributeName).alarmEnable(false).jframe(jf1)
        .confirmation(false).build();

    Sleeper.SECONDS.sleep(2);

    final Object numberMatrix = widget.getData();
    Assert.assertTrue("Widget does'nt reflect image attribute",
        equality(numberMatrix, data));

    // modifier la valeur de l'attribut
    for (int i = 0; i < data.length; i++) {
      data[i] += i;
    }

    m_deviceProxy.write_attribute(new DeviceAttribute(attributeName, data,
        widget.getDimX(), widget.getDimY()));

    Sleeper.SECONDS.sleep(2);

    Assert.assertTrue("Widget does'nt reflect image attribute",
        equality(widget.getData(), data));

    // Faire varier le nom de l'attribut
    attributeName = "int_image_ro";
    data = readImageAttribute(m_deviceProxy2, attributeName);

    widget.setAttributeName(attributeName);
    Sleeper.SECONDS.sleep(2);

    Assert.assertTrue("Widget does'nt reflect image attribute",
        equality(widget.getData(), data));

    // Faire varier le nom du device
    initSecondDevice();
    data = readImageAttribute(m_deviceProxy2, attributeName);

    widget.setDeviceName(m_deviceName2);
    Sleeper.SECONDS.sleep(2);

    // TODO
    // le changement de device ne fonctionne pas
    // Assert.assertTrue("Widget does'nt reflect image attribute",equality(widget.getData(),data));

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

    jf1 = new JFrame();

    // Initialiser le device et le composant
    initFirstDevice();
    final AttributeImagePanelCometeV2 widget = new AttributeImagePanelCometeV2.Builder(
        m_deviceName, attributeName).alarmEnable(false).jframe(jf1)
        .confirmation(false).build();

    Sleeper.SECONDS.sleep(2);

    final ImageViewer imageViewer = (ImageViewer) tth.findFirstComponent(
        ImageViewer.class, jf1);
    Assert.assertTrue("Image viewer not found", imageViewer != null);

    imageViewer.showTable();

    Sleeper.SECONDS.sleep(1);

    final JDialog tableDialog = tth.findDialog("Matrix Data");
    Assert.assertTrue("Table dialog not found", tableDialog != null);

    final NumberTable table = (NumberTable) tth.findFirstComponent(
        NumberTable.class, tableDialog);
    Assert.assertTrue("Table not found", table != null);

    widget.setUserEnabled(false);
    Sleeper.SECONDS.sleep(1);

    Assert.assertFalse("Table should not be editable", table.isEditable());

    System.out.println("test userEnable true source ro");
    widget.setUserEnabled(true);
    Sleeper.SECONDS.sleep(1);

    Assert.assertFalse("Table should not be editable", table.isEditable());

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

    jf1 = new JFrame();

    // Initialiser le device et le composant
    initFirstDevice();
    final AttributeImagePanelCometeV2 widget = new AttributeImagePanelCometeV2.Builder(
        m_deviceName, attributeName).alarmEnable(alarmEnabled)
        .jframe(jf1).confirmation(false).build();

    Sleeper.SECONDS.sleep(2);

    // final GComponentFinder finder = new
    // GComponentFinder(ImageViewer.class);

    final ImageViewer imageViewer = (ImageViewer) tth.findFirstComponent(
        ImageViewer.class, jf1);

    // final ImageViewer imageViewer = (ImageViewer) finder.find(jf, 0);
    Assert.assertTrue("Image viewer not found", imageViewer != null);

    imageViewer.showTable();

    Sleeper.SECONDS.sleep(1);

    final JDialog tableDialog = tth.findDialog("Matrix Data");
    Assert.assertTrue("Table dialog not found", tableDialog != null);

    final NumberTable table = (NumberTable) tth.findFirstComponent(
        NumberTable.class, tableDialog);
    Assert.assertTrue("Table not found", table != null);

    widget.setUserEnabled(false);
    Sleeper.SECONDS.sleep(1);

    Assert.assertTrue("Table should not be editable", !table.isEditable());

    widget.setUserEnabled(true);
    Sleeper.SECONDS.sleep(1);

    Assert.assertTrue("Table should be editable", table.isEditable());

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

    jf1 = new JFrame();

    // Initialiser le device et le composant
    initFirstDevice();
    final AttributeImagePanelCometeV2 widget = new AttributeImagePanelCometeV2.Builder(
        m_deviceName, attributeName).monochrome(true)
        .alarmEnable(false).jframe(jf1).confirmation(false).build();

    Sleeper.SECONDS.sleep(2);

    final ImageViewer imageViewer = (ImageViewer) tth.findFirstComponent(
        ImageViewer.class, jf1);
    Assert.assertTrue("Image viewer not found", imageViewer != null);

    final BufferedImage image = imageViewer.getImage();

    for (int x = 0; x < image.getWidth(); x++) {
      for (int y = 0; y < image.getHeight(); y++) {
        Assert.assertTrue("Image is not BW",
            isBWColor(new Color(image.getRGB(0, 0))));
      }
    }

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

TOP

Related Classes of fr.soleil.globalscreen.tangowidget.attribute.AttributeImagePanelCometeV2

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.