Examples of Panorama


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 TerraMenuPopupSkin() {
        TerraTheme theme = (TerraTheme)Theme.getTheme();
        setBackgroundColor((Color)null);

        panorama = new Panorama();
        panorama.getStyles().put("buttonBackgroundColor", Color.WHITE);

        border = new Border(panorama);

        border.getStyles().put("color", theme.getColor(7));
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

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

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

        suggestionListViewBorder = new Border(suggestionListViewPanorama);
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

Examples of org.apache.pivot.wtk.Panorama

    @Override
    public void install(Component component) {
        super.install(component);

        Panorama panorama = (Panorama)component;
        panorama.getViewportListeners().add(this);

        // Add scroll arrow link buttons and attach mouse listeners
        // to them; the mouse handlers should call setScrollTop() and
        // setScrollLeft() on the panorama as appropriate
        panorama.add(northButton);
        northButton.getComponentMouseListeners().add(buttonMouseListener);

        panorama.add(southButton);
        southButton.getComponentMouseListeners().add(buttonMouseListener);

        panorama.add(eastButton);
        eastButton.getComponentMouseListeners().add(buttonMouseListener);

        panorama.add(westButton);
        westButton.getComponentMouseListeners().add(buttonMouseListener);

        updateScrollButtonVisibility();
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

    @Override
    public int getPreferredWidth(int height) {
        int preferredWidth = 0;

        // The panorama's preferred width is the preferred width of the view
        Panorama panorama = (Panorama)getComponent();
        Component view = panorama.getView();
        if (view != null) {
            preferredWidth = view.getPreferredWidth(height);
        }

        return preferredWidth;
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

    @Override
    public int getPreferredHeight(int width) {
        int preferredHeight = 0;

        // The panorama's preferred height is the preferred height of the view
        Panorama panorama = (Panorama)getComponent();
        Component view = panorama.getView();
        if (view != null) {
            preferredHeight = view.getPreferredHeight(width);
        }

        return preferredHeight;
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.