A component for generating graphical representations of current weather data seems like a reasonable first attempt at integrating weather stations into bridge. This component ("WeatherIcon"?) would:
- Provide graphical representation of a configurable set of data items, possibly including:
- Time at which the data was collected
- Temperature
- Wind speed/direction/gust/chill
- Total rain
- Humidity
- Barometric pressure
- Support configurable sizes (probably a fixed number of these, e.g., 16x16, 32x32, 128x128)
- Support pulling data from a remote file (e.g., via http) and local caching of data. Since we may eventually store the data directly in bridge, the data retrieval mechanism should be abstracted so that alternate mechanisms can be added later without breaking existing objects.
With such a component, users could:
- Embed the "live" weather icon for their local weather station in their web pages. (This would be vaguely similar to the web counter object.)
- Embed the weather icon on a whiteboard, possibly along with a static map of the region or a regional weather map taken from an noaa site. As additional weather tools become available, these icons could serve as navigation points on the whiteboards.
- Embed the weather icon on a whiteboard layer in a zoomable map. (Support for these layers exists, though the UI for setting them up does not.)
Parts of this component implementation might include:
- WebIconDataSource interface for classes that know how to retrieve data from somewhere. An initial implementation of this class could retrieve a text file via http and parse the data.
- WebIcon. Replicable class for storing:
- Instance of a configured WebIconDataSource class
- Cached data values from the last time the values were retrieved
- Interval at which the cached data is expired
- Configuration information for size and set of values to be displayed
- WebIconComponentView. Subclass of DefaultComponentView that provides a user interface for configuring and previewing a WebIcon.
- WebIconWebView. Implementation of the WebView interface that knows how to draw the icon to an awt/swing Component, which can then be rendered as a GIF or JPEG.
The existing web counter (edu.vt.cs.collab.bridge.apps.web.BasicWebCounter) and equation (edu.vt.chci.formula.rpn.RPNFormula) objects are vaguely similar and might serve as useful models for the weather icon. To facilitate loading the weather icon classes on-demand, it will probably make sense to locate these classes somewhere in the edu.vt.chci.... subtree.
|