Examples of Panorama


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 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

        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

Examples of org.apache.pivot.wtk.Panorama

    @Override
    public Dimensions getPreferredSize() {
        Dimensions preferredSize = null;

        // The panorama's preferred size is the preferred size of the view
        Panorama panorama = (Panorama)getComponent();
        Component view = panorama.getView();
        if (view == null) {
            preferredSize = new Dimensions(0, 0);
        } else {
            preferredSize = view.getPreferredSize();
        }
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

        return preferredSize;
    }

    @Override
    public void layout() {
        Panorama panorama = (Panorama)getComponent();
        int width = getWidth();
        int height = getHeight();

        Component view = panorama.getView();
        if (view != null) {
            Dimensions viewSize = view.getPreferredSize();
            view.setSize(Math.max(width, viewSize.width), Math.max(height, viewSize.height));
            int viewWidth = view.getWidth();
            int viewHeight = view.getHeight();

            int maxScrollTop = getMaxScrollTop();
            if (panorama.getScrollTop() > maxScrollTop) {
                panorama.setScrollTop(maxScrollTop);
            }

            int maxScrollLeft = getMaxScrollLeft();
            if (panorama.getScrollLeft() > maxScrollLeft) {
                panorama.setScrollLeft(maxScrollLeft);
            }

            if (width < viewWidth) {
                // Show east/west buttons
                eastButton.setSize(eastButton.getPreferredWidth(), height);
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

    @Override
    public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount,
        int wheelRotation, int x, int y) {
        boolean consumed = false;

        Panorama panorama = (Panorama)getComponent();
        Component view = panorama.getView();

        if (view != null) {
            // The scroll orientation is tied to whether the shift key was
            // presssed while the mouse wheel was scrolled
            if (Keyboard.isPressed(Keyboard.Modifier.SHIFT)) {
                // Treat the mouse wheel as a horizontal scroll event
                int previousScrollLeft = panorama.getScrollLeft();
                int newScrollLeft = previousScrollLeft + (scrollAmount * wheelRotation *
                    (int)INITIAL_SCROLL_DISTANCE);

                if (wheelRotation > 0) {
                    int maxScrollLeft = getMaxScrollLeft();
                    newScrollLeft = Math.min(newScrollLeft, maxScrollLeft);

                    if (previousScrollLeft < maxScrollLeft) {
                        consumed = true;
                    }
                } else {
                    newScrollLeft = Math.max(newScrollLeft, 0);

                    if (previousScrollLeft > 0) {
                        consumed = true;
                    }
                }

                panorama.setScrollLeft(newScrollLeft);
            } else {
                // Treat the mouse wheel as a vertical scroll event
                int previousScrollTop = panorama.getScrollTop();
                int newScrollTop = previousScrollTop + (scrollAmount * wheelRotation *
                    (int)INITIAL_SCROLL_DISTANCE);

                if (wheelRotation > 0) {
                    int maxScrollTop = getMaxScrollTop();
                    newScrollTop = Math.min(newScrollTop, maxScrollTop);

                    if (previousScrollTop < maxScrollTop) {
                        consumed = true;
                    }
                } else {
                    newScrollTop = Math.max(newScrollTop, 0);

                    if (previousScrollTop > 0) {
                        consumed = true;
                    }
                }

                panorama.setScrollTop(newScrollTop);
            }
        }

        return consumed;
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Panorama

    }

    protected int getMaxScrollTop() {
        int maxScrollTop = 0;

        Panorama panorama = (Panorama)getComponent();
        int height = getHeight();

        Component view = panorama.getView();
        if (view != null) {
            maxScrollTop = Math.max(view.getHeight() - height, 0);
        }

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