Example usage for com.google.gwt.user.client.ui Label addTouchMoveHandler

List of usage examples for com.google.gwt.user.client.ui Label addTouchMoveHandler

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui Label addTouchMoveHandler.

Prototype

public HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler) 

Source Link

Usage

From source file:nl.mpi.tg.eg.experiment.client.view.AnnotationTimelinePanel.java

License:Open Source License

private void insertTierAnnotation(final AnnotationData annotationData, final VideoPanel videoPanel,
        final AnnotationTimelineView annotationTimelineView) {
    final Label label1 = new Label(annotationData.getAnnotationHtml());
    label1.setStylePrimaryName("annotationTimelineTierSegment");
    final SingleShotEventListner tierSegmentListner = new SingleShotEventListner() {

        @Override// w  w  w . java  2s .c  om
        protected void singleShotFired() {
            //                if (addAnnotationButton != null) {
            //                    // todo: this would be better if the button was not added when a tier is clicked
            //                    absolutePanel.remove(addAnnotationButton);
            //                }
            clearHighlights();
            videoPanel.playSegment(annotationData);
            annotationTimelineView.setEditingAnnotation(annotationData);
            label1.setStyleDependentName("Highlight", true);
            resetSingleShot();
        }
    };
    label1.addClickHandler(tierSegmentListner);
    label1.addTouchStartHandler(tierSegmentListner);
    label1.addTouchMoveHandler(tierSegmentListner);
    label1.addTouchEndHandler(tierSegmentListner);
    label1.setWidth(getWidth(annotationData, videoPanel.getDurationTime()) + "px");
    final int topPosition = getTierTopPosition(annotationData.getStimulus());
    absolutePanel.add(label1, getLeftPosition(annotationData, videoPanel.getDurationTime()), topPosition);
    annotationLebels.put(annotationData, label1);
}

From source file:nl.mpi.tg.eg.experiment.client.view.MenuButton.java

License:Open Source License

public MenuButton(final PresenterEventListner presenterListerner) {
    final Label headerIcon = new Label();
    headerIcon.addStyleName("headerIcon");
    if (presenterListerner != null) {
        final Label headerArrow = new Label();
        headerArrow.addStyleName("headerArrow");
        this.add(headerArrow);

        final Label headerButton = new Label(presenterListerner.getLabel());
        headerButton.addStyleName("headerButton");
        this.add(headerButton);
        SingleShotEventListner singleShotEventListner = new SingleShotEventListner() {

            @Override/* w  w w  .ja v a2 s . com*/
            protected void singleShotFired() {
                presenterListerner.eventFired(null, this);
            }
        };
        headerArrow.addClickHandler(singleShotEventListner);
        headerButton.addClickHandler(singleShotEventListner);
        headerIcon.addClickHandler(singleShotEventListner);

        headerArrow.addTouchStartHandler(singleShotEventListner);
        headerButton.addTouchStartHandler(singleShotEventListner);
        headerIcon.addTouchStartHandler(singleShotEventListner);
        headerArrow.addTouchMoveHandler(singleShotEventListner);
        headerButton.addTouchMoveHandler(singleShotEventListner);
        headerIcon.addTouchMoveHandler(singleShotEventListner);
        headerArrow.addTouchEndHandler(singleShotEventListner);
        headerButton.addTouchEndHandler(singleShotEventListner);
        headerIcon.addTouchEndHandler(singleShotEventListner);
    }
    this.add(headerIcon);
}

From source file:nl.mpi.tg.eg.experiment.client.view.SimpleView.java

License:Open Source License

public void addInfoButton(final PresenterEventListner presenterListerner) {
    final Label headerButton = new Label(presenterListerner.getLabel());
    headerButton.addStyleName("headerButton");
    SingleShotEventListner singleShotEventListner = new SingleShotEventListner() {

        @Override/*from  w w w .  j  a v a2 s  .c o m*/
        protected void singleShotFired() {
            presenterListerner.eventFired(null, this);
        }
    };
    headerButton.addClickHandler(singleShotEventListner);
    headerButton.addTouchStartHandler(singleShotEventListner);
    headerButton.addTouchMoveHandler(singleShotEventListner);
    headerButton.addTouchEndHandler(singleShotEventListner);
    headerPanel.setWidget(0, 2, headerButton);
}

From source file:nl.ru.languageininteraction.synaesthesia.client.view.MenuButton.java

License:Open Source License

public MenuButton(final PresenterEventListner presenterListerner) {
    final Label headerIcon = new Label();
    headerIcon.addStyleName("headerIcon");
    if (presenterListerner != null) {
        final Label headerArrow = new Label();
        headerArrow.addStyleName("headerArrow");
        this.add(headerArrow);

        final Label headerButton = new Label(presenterListerner.getLabel());
        headerButton.addStyleName("headerButton");
        this.add(headerButton);
        SingleShotEventListner singleShotEventListner = new SingleShotEventListner() {

            @Override//from   w w w .j a  va  2s. c  o m
            protected void singleShotFired() {
                presenterListerner.eventFired(null);
            }
        };
        headerArrow.addClickHandler(singleShotEventListner);
        headerButton.addClickHandler(singleShotEventListner);
        headerIcon.addClickHandler(singleShotEventListner);

        headerArrow.addTouchStartHandler(singleShotEventListner);
        headerButton.addTouchStartHandler(singleShotEventListner);
        headerIcon.addTouchStartHandler(singleShotEventListner);
        headerArrow.addTouchMoveHandler(singleShotEventListner);
        headerButton.addTouchMoveHandler(singleShotEventListner);
        headerIcon.addTouchMoveHandler(singleShotEventListner);
        headerArrow.addTouchEndHandler(singleShotEventListner);
        headerButton.addTouchEndHandler(singleShotEventListner);
        headerIcon.addTouchEndHandler(singleShotEventListner);
    }
    this.add(headerIcon);
}