Examples of Panorama


Examples of org.apache.pivot.wtk.Panorama

    }

    protected int getMaxScrollLeft() {
        int maxScrollLeft = 0;

        Panorama panorama = (Panorama)getComponent();
        int width = getWidth();

        Component view = panorama.getView();
        if (view != null) {
            maxScrollLeft = Math.max(view.getWidth() - width, 0);
        }

        return maxScrollLeft;
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

        return maxScrollLeft;
    }

    protected void updateScrollButtonVisibility() {
        Panorama panorama = (Panorama)getComponent();
        boolean mouseOver = panorama.isMouseOver();

        int scrollTop = panorama.getScrollTop();
        int maxScrollTop = getMaxScrollTop();
        northButton.setVisible((alwaysShowScrollButtons
            || mouseOver) && scrollTop > 0);
        southButton.setVisible((alwaysShowScrollButtons
            || mouseOver) && scrollTop < maxScrollTop);

        int scrollLeft = panorama.getScrollLeft();
        int maxScrollLeft = getMaxScrollLeft();
        westButton.setVisible((alwaysShowScrollButtons
            || mouseOver) && scrollLeft > 0);
        eastButton.setVisible((alwaysShowScrollButtons
            || mouseOver) && scrollLeft < maxScrollLeft);
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

    }

    private class ScrollCallback implements Runnable {
        @Override
        public void run() {
            Panorama panorama = (Panorama)getComponent();

            if (northButton.isMouseOver()) {
                int scrollTop = Math.max(panorama.getScrollTop()
                    - (int)scrollDistance, 0);
                if (scrollTop == 0
                    && scheduledScrollCallback != null) {
                    scheduledScrollCallback.cancel();
                    scheduledScrollCallback = null;
                }

                panorama.setScrollTop(scrollTop);
            } else if (southButton.isMouseOver()) {
                int maxScrollTop = getMaxScrollTop();
                int scrollTop = Math.min(panorama.getScrollTop()
                    + (int)scrollDistance, maxScrollTop);
                if (scrollTop == maxScrollTop
                    && scheduledScrollCallback != null) {
                    scheduledScrollCallback.cancel();
                    scheduledScrollCallback = null;
                }

                panorama.setScrollTop(scrollTop);
            } else if (eastButton.isMouseOver()) {
                int maxScrollLeft = getMaxScrollLeft();
                int scrollLeft = Math.min(panorama.getScrollLeft()
                    + (int)scrollDistance, maxScrollLeft);
                if (scrollLeft == maxScrollLeft
                    && scheduledScrollCallback != null) {
                    scheduledScrollCallback.cancel();
                    scheduledScrollCallback = null;
                }

                panorama.setScrollLeft(scrollLeft);
            } else if (westButton.isMouseOver()) {
                int scrollLeft = Math.max(panorama.getScrollLeft()
                    - (int)scrollDistance, 0);
                if (scrollLeft == 0
                    && scheduledScrollCallback != null) {
                    scheduledScrollCallback.cancel();
                    scheduledScrollCallback = null;
                }

                panorama.setScrollLeft(scrollLeft);
            }

            scrollDistance = Math.min(scrollDistance * SCROLL_ACCELERATION,
                MAXIMUM_SCROLL_DISTANCE);
        }
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

    public void startup(Display display, Map<String, String> properties)
        throws Exception {
        frame1 = new Frame();
        frame1.setTitle("Panorama Test 1");

        Panorama panorama = new Panorama();
        frame1.setContent(panorama);
        frame1.setPreferredSize(240, 320);

        ImageView imageView = new ImageView();
        imageView.setImage(getClass().getResource("IMG_0767_2.jpg"));
        panorama.setView(imageView);
        frame1.open(display);

        BXMLSerializer bxmlSerializer = new BXMLSerializer();
        frame2 = new Frame((Component)bxmlSerializer.readObject(getClass().getResource("panorama_test.bxml")));
        frame2.setTitle("Panorama Test 2");
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

    public TerraSuggestionPopupSkin () {
        listView.getStyles().put("variableItemHeight", true);
        listView.getListViewSelectionListeners().add(listViewSelectionListener);
        listView.getComponentKeyListeners().add(listViewKeyListener);

        listViewPanorama = new Panorama(listView);
        listViewPanorama.getStyles().put("buttonBackgroundColor",
            listView.getStyles().get("backgroundColor"));
        listViewPanorama.getStyles().put("alwaysShowScrollButtons", true);

        listViewBorder = new Border(listViewPanorama);
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

        disabledBevelColor = disabledBackgroundColor;

        listViewPopup.getWindowStateListeners().add(listViewPopupStateListener);

        // Create the panorama and border
        listViewPanorama = new Panorama(listView);
        listViewPanorama.getStyles().put("buttonBackgroundColor",
            listView.getStyles().get("backgroundColor"));
        listViewPanorama.getStyles().put("alwaysShowScrollButtons", true);

        listViewBorder = new Border(listViewPanorama);
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

        disabledBevelColor = disabledBackgroundColor;

        listViewPopup.getWindowStateListeners().add(listViewPopupStateListener);

        // Create the panorama and border
        listViewPanorama = new Panorama(listView);
        listViewPanorama.getStyles().put("buttonBackgroundColor",
            listView.getStyles().get("backgroundColor"));
        listViewPanorama.getStyles().put("alwaysShowScrollButtons", true);

        listViewBorder = new Border(listViewPanorama);
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

        disabledBevelColor = disabledBackgroundColor;

        listViewPopup.getWindowStateListeners().add(listViewPopupStateListener);

        // Create the panorama and border
        listViewPanorama = new Panorama(listView);
        listViewPanorama.getStyles().put("buttonBackgroundColor",
            listView.getStyles().get("backgroundColor"));
        listViewPanorama.getStyles().put("alwaysShowScrollButtons", true);

        listViewBorder = new Border(listViewPanorama);
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

    public TerraSuggestionPopupSkin () {
        listView.getStyles().put("variableItemHeight", true);
        listView.getListViewSelectionListeners().add(listViewSelectionListener);
        listView.getComponentKeyListeners().add(listViewKeyListener);

        listViewPanorama = new Panorama(listView);
        listViewPanorama.getStyles().put("buttonBackgroundColor",
            listView.getStyles().get("backgroundColor"));
        listViewPanorama.getStyles().put("alwaysShowScrollButtons", true);

        listViewBorder = new Border(listViewPanorama);
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

        disabledBevelColor = disabledBackgroundColor;

        listViewPopup.getWindowStateListeners().add(listViewPopupStateListener);

        // Create the panorama and border
        listViewPanorama = new Panorama(listView);
        listViewPanorama.getStyles().put("buttonBackgroundColor",
            listView.getStyles().get("backgroundColor"));
        listViewPanorama.getStyles().put("alwaysShowScrollButtons", true);

        listViewBorder = new Border(listViewPanorama);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.