Package fr.soleil.globalscreen.tangowidget.attribute

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


        // reset device for test

        initFirstDevice();
        // we re use jfAfterStart and widgetAfterStart to test
        // - if bean is disable if attribute Name is read only
        final AttributeNumberScalarWheelSwitch widget = new AttributeNumberScalarWheelSwitch.Builder(
                m_deviceName, "double_scalar_r").jframe(jf1).build();

        Sleeper.SECONDS.sleep(2);

        final List<ArrowButton> upButtons = new ArrayList<ArrowButton>();
        final List<ArrowButton> downButtons = new ArrayList<ArrowButton>();
        getButtons(jf1, upButtons, downButtons);

        // TODO yes or no ?
        // Assert.assertTrue("Invalid behavior, buttons shouldn't be visible (attr read only)",
        // upButtons.isEmpty() & downButtons.isEmpty());
        for (int i = 0; i < upButtons.size(); i++) {
            Assert.assertFalse("Button shouldn't be enable", upButtons.get(i).isEnabled()
                    || downButtons.get(i).isEnabled());
        }

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


     */
    private void completeAttributeNameValidConfTest(final String deviceName,
            final String attributeName, final boolean beforeStart) throws DevFailed {

        jf1 = new JFrame();
        final AttributeNumberScalarWheelSwitch widget;

        initFirstDevice();

        // init the widget with a completeAttributeName, in first case before
        // the start of bean and in second case after.
        if (beforeStart) {
            widget = new AttributeNumberScalarWheelSwitch.Builder(deviceName, attributeName)
                    .jframe(jf1).build();
        }
        else {
            widget = new AttributeNumberScalarWheelSwitch.Builder(m_deviceName, "double_scalar_r")
                    .jframe(jf1).build();
            Sleeper.SECONDS.sleep(1);
            widget.setDeviceName(deviceName);
            widget.setAttributeName(attributeName);
        }
        Sleeper.SECONDS.sleep(1);

        final List<ArrowButton> upButtons = new ArrayList<ArrowButton>();
        final List<ArrowButton> downButtons = new ArrayList<ArrowButton>();
        getButtons(jf1, upButtons, downButtons);

        // assert device is updated when bean change value
        controlWriteTxtFieldUpdateDoubleAtt(upButtons, downButtons, m_deviceProxy, widget,
                attributeName, false);

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

    // reset device for test

    initFirstDevice();
    // we re use jfAfterStart and widgetAfterStart to test
    // - if bean is disable if attribute Name is read only
    final AttributeNumberScalarWheelSwitch widget = new AttributeNumberScalarWheelSwitch.Builder(
        m_deviceName, "double_scalar_r").jframe(jf1).build();

    Sleeper.SECONDS.sleep(2);

    final List<ArrowButton> upButtons = new ArrayList<ArrowButton>();
    final List<ArrowButton> downButtons = new ArrayList<ArrowButton>();
    getButtons(jf1, upButtons, downButtons);

    // TODO yes or no ?
    // assertTrue("Invalid behavior, buttons shouldn't be visible (attr read only)",
    // upButtons.isEmpty() & downButtons.isEmpty());
    for (int i = 0; i < upButtons.size(); i++) {
      assertFalse("Button shouldn't be enable", upButtons.get(i)
          .isEnabled() || downButtons.get(i).isEnabled());
    }

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

  private void completeAttributeNameValidConfTest(final String deviceName,
      final String attributeName, final boolean beforeStart)
      throws DevFailed {

    jf1 = new JFrame();
    final AttributeNumberScalarWheelSwitch widget;

    initFirstDevice();

    // init the widget with a completeAttributeName, in first case before
    // the start of bean and in second case after.
    if (beforeStart) {
      widget = new AttributeNumberScalarWheelSwitch.Builder(deviceName,
          attributeName).jframe(jf1).build();
    } else {
      widget = new AttributeNumberScalarWheelSwitch.Builder(m_deviceName,
          "double_scalar_r").jframe(jf1).build();
      Sleeper.SECONDS.sleep(1);
      widget.setDeviceName(deviceName);
      widget.setAttributeName(attributeName);
    }
    Sleeper.SECONDS.sleep(4);

    final List<ArrowButton> upButtons = new ArrayList<ArrowButton>();
    final List<ArrowButton> downButtons = new ArrayList<ArrowButton>();
    getButtons(jf1, upButtons, downButtons);

    // assert device is updated when bean change value
    controlWriteTxtFieldUpdateDoubleAtt(upButtons, downButtons,
        m_deviceProxy, widget, attributeName, false);

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

    jf1 = new JFrame();

    final String attributeName = "double_scalar_rw_with_format";
    // Initialiser le device et le composant
    initFirstDevice();
    final AttributeNumberScalarWheelSwitch widget = new AttributeNumberScalarWheelSwitch.Builder(
        m_deviceName, attributeName).jframe(jf1).build();

    Sleeper.SECONDS.sleep(2);
    final JLabel label = getLabel(jf1);
    assertNotNull("can't find label");

    // v�rifier que la valeur courante de l'attribut est bien affich�e
    double value = 1234.567;
    m_deviceProxy
        .write_attribute(new DeviceAttribute(attributeName, value));
    final String format = "%7.3f";
    assertTrue(waitLabelText(label, formatValue(value, format), 5000));

    // stop widget and check is disconected
    widget.stop();
    Sleeper.SECONDS.sleep(2);
    assertEquals("+X.XX", label.getText());

    // restart and bean show the same value as device
    widget.start();
    Sleeper.SECONDS.sleep(2);
    assertTrue(waitLabelText(label, formatValue(value, format), 5000));

    // test write ok after restart
    value = 1234.568;
    m_deviceProxy
        .write_attribute(new DeviceAttribute(attributeName, value));
    assertTrue("write failed after restart",
        waitLabelText(label, formatValue(value, format), 5000));

    widget.stop();
    jf1.dispose();

  }
View Full Code Here

TOP

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

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.