/**
* Main class, so you can have an example. You can put your own attribute names in parameter
*/
public static void main(String[] args) {
IFrame frame = CometeWidgetFactory.createFrame();
String tmpDeviceName = null;
String tmpAttributeName = null;
if (args != null && args.length > 1) {
tmpDeviceName = args[0];
tmpAttributeName = args[1];
}
else {
tmpDeviceName = "tango/tangotest/titan";
tmpAttributeName = "string_image";
}
StringImageTable f = new StringImageTable();
IStringTableListener listener = new IStringTableListener() {
@Override
public void selectedColumnChanged(int col) {
System.out.println("selectedColumnChanged="+col);
}
@Override
public void selectedRowChanged(int col) {
System.out.println("selectedRowChanged="+col);
}
@Override
public void selectedValueChanged(String value) {
System.out.println("selectedValueChanged="+value);
}
@Override
public void selectedPointChanged(Point point) {
System.out.println("selectedPointChanged=" + point);
}
@Override
public void valueChanged(IMatrix matrix) {
System.out.println("valueChanged=" + matrix);
}
};
f.addStringTableListener(listener);
f.setSize(300, 300);
f.setPreferredSize(f.getSize());
f.setDeviceName(tmpDeviceName);
f.setToolTipText(tmpDeviceName + "/" + tmpAttributeName);
f.setEntityName(tmpAttributeName);
f.initDAO();
frame.setContentPane(f);
frame.setSize(640, 480);
frame.setTitle(f.getClass().getName());
frame.setDefaultCloseOperation(IFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}