/**
* Main class, so you can have an example. You can put your own attribute names in parameter
*/
public static void main(final String[] args) {
final IFrame frame = new Frame();// CometeWidgetFactory.createFrame();
String tmpDeviceName = null;
String tmpAttributeName = null;
if (args != null && args.length > 1) {
tmpDeviceName = args[0];
tmpAttributeName = args[1];
}
else {
tmpDeviceName = "test/gs/1";
tmpAttributeName = "double_scalar_rw";
}
final NumberScalarInput f = new NumberScalarInput();
f.setSize(300, 300);
f.setPreferredSize(f.getSize());
f.setDeviceName(tmpDeviceName);
f.setEntityName(tmpAttributeName);
f.setConfirmation(false);
// f.setStateEnabled(false);
// f.setTextButton("Mon Texte");
// f.setBackgroundButton(Color.BLUE);
// f.setBackgroundTextField(Color.RED);
f.addWidgetListener(new IWidgetListener() {
@Override
public void booleanDataChanged(final boolean value) {
System.out.println("booleanDataChanged " + value);
}
@Override
public void booleanValueChanged(final boolean value) {
System.out.println("booleanValueChanged " + value);
}
@Override
public void doubleDataChanged(final double value) {
System.out.println("doubleDataChanged " + value);
}
@Override
public void doubleValueChanged(final double value) {
System.out.println("doubleValueChanged " + value);
}
@Override
public void stringDataChanged(final String value) {
System.out.println("stringDataChanged " + value);
}
@Override
public void stringValueChanged(final String value) {
System.out.println("stringValueChanged " + value);
}
});
f.initDAO();
frame.setContentPane(f);
frame.setSize(640, 480);
frame.setTitle(f.getClass().getName());
frame.setDefaultCloseOperation(IFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
//
// new Thread() {
// @Override
// public void run() {
// try {