Hi Jesper
It should work just fine with calling doPrepare as long as the layers
beneath are marked as background.
See also
http://www.nabble.com/animated-OMGraphic-performance-tf2651634.html#a7399408
Something like following should work with ok perf
public class AnimTest extends OMGraphicHandlerLayer {
private ArrayList<OMRaster> frames = new ArrayList<OMRaster>();
private int frameCntr = 0;
Timer timer = null;
public AnimTest() {
super();
timer = new Timer(200, new ActionListener() {
public void actionPerformed(ActionEvent evt) {
doPrepare();
}
});
}
public void setProperties(String prefix, Properties props) {
...
OMRaster r = new OMRaster(56f, 10f, waypointIcon);
r.setRenderType(OMGraphic.RENDERTYPE_LATLON);
frames.add(r);
timer.start();
}
public synchronized OMGraphicList prepare() {
// return new OMGraphicList();
OMGraphicList l = getList() == null ? new OMGraphicList() :
getList();
l.clear();
OMRaster r = frames.get(frameCntr++);
r.generate(getProjection());
l.add(r);
if (frameCntr > frames.size() - 1)
frameCntr = 0;
return l;
}
}
Regards
Carsten
--
View this message in context: http://www.nabble.com/Fast-repaint-of-a-animated-icon--tf3285436.html#a9141581
Sent from the OpenMap mailing list archive at Nabble.com.
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Sun Feb 25 2007 - 02:51:14 EST