Search in sources :

Example 1 with ScrollEvent

use of org.zkoss.zk.ui.event.ScrollEvent in project spatial-portal by AtlasOfLivingAustralia.

the class GDMComposer method afterCompose.

@Override
public void afterCompose() {
    super.afterCompose();
    this.selectedMethod = StringConstants.GDM;
    this.totalSteps = 5;
    this.loadAreaLayers();
    this.loadSpeciesLayers();
    this.loadGridLayers(true, false, true);
    this.updateWindowTitle();
    try {
        sitesslider.addEventListener("onScrolling", new EventListener() {

            @Override
            public void onEvent(Event event) throws Exception {
                if (event instanceof ScrollEvent) {
                    ScrollEvent se = (ScrollEvent) event;
                    double a = se.getPos();
                    double b = a / maxScroll;
                    long p = Math.round(b * 100);
                    sitesslider.setSlidingtext(Math.round(a) + " - " + p + "%");
                }
            }
        });
    } catch (Exception e) {
        LOGGER.debug("Error in slider");
        LOGGER.debug(e.getMessage());
    }
}
Also used : ScrollEvent(org.zkoss.zk.ui.event.ScrollEvent) Event(org.zkoss.zk.ui.event.Event) ScrollEvent(org.zkoss.zk.ui.event.ScrollEvent) EventListener(org.zkoss.zk.ui.event.EventListener)

Aggregations

Event (org.zkoss.zk.ui.event.Event)1 EventListener (org.zkoss.zk.ui.event.EventListener)1 ScrollEvent (org.zkoss.zk.ui.event.ScrollEvent)1