SIMILE | Timeline | Documentation | Ether Painters

- SIMILE
- Timeline
- Documentation
- Ether Painters

# Ether Painters

An ether painter is an object made use by a band to paint markings on its background. These markings make the mapping from pixels to date/time of the band's ether visible to the user and helps her gauge when each particular event happens. An ether painter should be constructed by client code for the initialization of a band in a timeline, and then not touched again by client code.

## Interface

An ether painter must expose the following Javascript interface:

constructor ( params )
params is an object whose fields carry initialization settings for the ether painter. Different ether painter classes require different fields in this initialization object. Refer to the documentation of each ether painter class for details (see Ether Painters in Library below).
initialize ( band, timeline )
The ether painter is to paint the background of the given band of the given timeline. This method is called by the band itself as it is being initialized. Client code is not supposed to call this method.
paint ()
(Re)paint the band's background. The band will call this method when it needs to be (re)painted, at construction time as well as whenever its origin is shifted. Client code is not supposed to call this method.
softPaint ()
(Re)paint any part of the band's background that is positioned relative to the visible area of the band. The band will call this method whenever it is scrolled. Client code is not supposed to call this method.
setHighlight ( startDate, endDate )
Show a highlight between the two given Date objects.

## Ether Painters in Library

There are currently 2 ether painter classes provided by default: Timeline.GregorianEtherPainter and Timeline.HotZoneGregorianEtherPainter. They all expose the interface above, but they differ in their initialization parameters.

There is also an undocumented Timeline.JapaneseEraEtherPainter.