ACOP Label

AcopLabel

Description

AcopLabel is an AcopDisplayer which can show string or number values. In general this displayer can only show readable strings, which means that any other value that needs to be shown here has to be converted to string. If this displayer is used for presenting double values or double value arrays, those will be converted to a single line strings and then showed on the label. This displayer does not allow setting of any values.

Code examples

The following lines show an example how to use the features of the AcopLabel.

Common features

For features shared with other ACOP Beans see this page.

If we are using the label to display a multi-channel array but we are only interested in the first 3 devices. We create a new ConnectionParameters object with specified propertySize and set them on the label.

ConnectionParameters p1 = new ConnectionParameters("TINE","context", "server", "device", "property", AccessMode.POLL, 1000, 3);
try {
        label.setConnectionParameters(p1);
} catch (CommonException e) {
        e.printStackTrace();
} catch (PropertyVetoException e) {
        e.printStackTrace();
}

Other properties

Other properties of the label can also simply be adjusted by calling the appropriate setter methods. These properties include background/foreground color, title etc.:

label.setBackground(Color.RED);
label.setForeground(Color.GREEN);

Complete source code for examples

See the complete source code used in this examples.