private IAnimation createAnimation( List<SimpleFeature> current ) {
final List<IDrawCommand> commands = new ArrayList<IDrawCommand>();
for( SimpleFeature feature : current ) {
if (feature == null || feature.getFeatureType().getGeometryDescriptor() == null)
continue;
DrawFeatureCommand command = null;
if (feature instanceof IAdaptable) {
Layer layer = (Layer) ((IAdaptable) feature).getAdapter(Layer.class);
if (layer != null)
try {
command = new DrawFeatureCommand(feature, layer);
} catch (IOException e) {
// do nothing... thats life
}
}
if (command == null) {
command = new DrawFeatureCommand(feature);
}
command.setMap(getMap());
command.preRender();
commands.add(command);
}
Rectangle2D rect = new Rectangle();
// for( IDrawCommand command : commands ) {
// rect=rect.createUnion(command.getValidArea());