Saturday, November 10, 2007

WWJ LayerSet updated

I put here the link to the updated version.

Basically I have added a couple of useful methods to query if an object or a class is contained by the LayerSet or some other contained Layer.


@Override
public boolean contains(Object o) {

if (super.contains(o)) {
return true;
}

for (Iterator it = this.iterator(); it.hasNext();) {
Layer layer = it.next();
if (layer instanceof LayerList) {
if (((LayerList) layer).contains(o)) {
return true;
}
}
}

return false;
}


Finally, I have added the mothod 'indexOf' that given a class returns the first instance ocurrence in the list (the search is not recursively).

1 comment:

Unknown said...

Hello !

Can you tell me a little more haw it works ? How is it displayed by the layerManager ?

Thanks !