Monday, October 22, 2007

WWJ LayerSet

Since the beginning I was surprised in the way some virtual globes handles layers and WWJ is not an exception.

I imagine a layer as an object that contains more objects, some of ones can be rendered. Render a layer implies render all its objects. Following this, an object in a layer, maybe a layer itself and can contain more objects (including layers).

With this idea I created my amzaing RenderableGroup object (in my deprecated Balloon Core API :( ).
The good thing is I could do the same in WWJ in a few days :)

LayerSet allows create like tree of layers. It is a subclass of LayerList and also implements
the Layer interface, so you can create composite LayerSets. Example:


MainLayer
|
|-- GroupA
| |-- IconLayer
| |-- RenderableLayer
|
|-- GroupB
|-- ScalebarLayer
|-- WorldmapLayer


Because it is a LayerList you can pass to any Model class.

The operation setOpacity, setEnable, render and so on, makes changes iteratively in all contained elements.

Source code here.

No comments: