AcopSpider is an error tracking monitor for Acop components. The component can be installed into any container and will be presented as a small spider icon.
Upon constructing this component it will start monitoring all TINE connections. When there is an error in any of the connections the component will change color from green to red and will start blinking. Clicking on the icon will open a dialog with description of the error. If there is an AcopDisplayer in the same window as the spider is and that particular error is connected with one of the displayers, the spider will change the visual appearance of the displayer to notify the user what the error refers to.
AcopSpider can also be used for logging the exceptions that occurs during the operation.
The following lines show an example how to use the features of the AcopSpider.
How to represent TINE connection errors with the spider? First we create an instance of the AcopSpider object.
AcopSpider spider = new AcopSpider();
and add it to your application GUI
JFrame applicationFrame = new JFrame(); applicationFrame.getContentPane().add(spider);
the spider should immediately start monitoring all TINE connections for any errors.
If the displayed spider size does not match the size of the spider icon, we can rescale the image to fit the size of the spider component
spider.rescaleIconToFit();
or we can enable this to happen automatically whenever the spider component is resized
spider.setAutoResize(true);
We can paint overlaid error notification signals over display components.
This feature can be enabled globally
spider.setPaintOverlayDecorations(true);
or disabled
spider.setPaintOverlayDecorations(false);
We can add errors, which occur during operations to the spider
Exception exception = new RuntimeException(); spider.addError(exception);
We can check at any time if there are any errors caught by the spider
spider.isError();
See the complete source code used in this examples.