Search in sources :

Example 1 with IStarFocus

use of gaiasky.scenegraph.IStarFocus in project gaiasky by langurmonkey.

the class UncertaintiesHandler method notify.

@Override
public void notify(final Event event, Object source, final Object... data) {
    switch(event) {
        case SHOW_UNCERTAINTIES:
            if (data[0] instanceof IStarFocus) {
                final IStarFocus s = (IStarFocus) data[0];
                GaiaSky.postRunnable(new Runnable() {

                    @Override
                    public void run() {
                        ParticleGroup pg = load(s.getCandidateId());
                        GaiaSky.instance.sceneGraph.getRoot().addChild(pg, true);
                        particleGroups.add(pg);
                    }
                });
            }
            break;
        case HIDE_UNCERTAINTIES:
            GaiaSky.postRunnable(new Runnable() {

                @Override
                public void run() {
                    for (ParticleGroup pg : particleGroups) {
                        GaiaSky.instance.sceneGraph.getRoot().removeChild(pg, true);
                    }
                    particleGroups.clear();
                }
            });
            break;
        default:
            break;
    }
}
Also used : IStarFocus(gaiasky.scenegraph.IStarFocus) ParticleGroup(gaiasky.scenegraph.ParticleGroup)

Aggregations

IStarFocus (gaiasky.scenegraph.IStarFocus)1 ParticleGroup (gaiasky.scenegraph.ParticleGroup)1