setIcon(ICON_NAME, true);
}
@Override
public void actionPerformed(ActionEvent arg0) {
Animation animation = factory.getActiveAnimation();
Sprite sprite = factory.getActiveSprite();
if (animation == null || sprite == null) {
Dialogs.warning(parent,
Messages.getString("MoveSpriteDownAction.NO_SPRITE")); //$NON-NLS-1$
return;
}
List<Sprite> list = animation.getSprites();
int index = list.indexOf(sprite);
if (index != -1 && index < list.size() - 1) {
List<Sprite> ordered = new ArrayList<Sprite>(list);
ordered.set(index, ordered.get(index + 1));
ordered.set(index + 1, sprite);
animation.setSprites(ordered);
factory.updateSprites();
}
}