Examples of ScrollPane


Examples of lupos.gui.operatorgraph.visualeditor.visualrif.util.ScrollPane


    this.setVisualRifEditor(visualRifEditor);
    this.setDocumentContainer(documentContainer);

    this.add("Explorer",new ScrollPane(this.generateComponent()));

  }
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.visualrif.util.ScrollPane

      this.documentEditorPane = new DocumentEditorPane(this.visualRifEditor);
      this.documentEditorPane.setDocumentName(this.documentName);


      final JPanel topPanel = new JPanel(new BorderLayout());
      topPanel.add(new ScrollPane(this.documentEditorPane.getVisualGraphs().get(0)));

      final JPanel bottomPanel = new JPanel(new BorderLayout());
      bottomPanel.add(new ScrollPane(new JTextField()));

      final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
      splitPane.setContinuousLayout(true);
      splitPane.setOneTouchExpandable(true);
      splitPane.setResizeWeight(0.8);
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.visualrif.util.ScrollPane

        this.groupEditorPane.setVisualRifEditor(this.visualRifEditor);
        this.groupEditorPane.setGroupName(this.groupName);
       
       
        JPanel topPanel = new JPanel(new BorderLayout());
        topPanel.add(new ScrollPane(this.groupEditorPane.getVisualGraphs().get(0)));

        JPanel bottomPanel = new JPanel(new BorderLayout());
        bottomPanel.add(new ScrollPane(new JTextField()));

        JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        splitPane.setContinuousLayout(true);
        splitPane.setOneTouchExpandable(true);
        splitPane.setResizeWeight(0.8);
View Full Code Here

Examples of org.apache.pivot.wtk.ScrollPane

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

        ScrollPane scrollPane = (ScrollPane)component;
        scrollPane.getViewportListeners().add(this);
        scrollPane.getScrollPaneListeners().add(this);

        scrollPane.add(horizontalScrollBar);
        scrollPane.add(verticalScrollBar);

        scrollPane.add(topLeftCorner);
        scrollPane.add(bottomLeftCorner);
        scrollPane.add(bottomRightCorner);
        scrollPane.add(topRightCorner);

        horizontalScrollBar.getScrollBarValueListeners().add(this);
        verticalScrollBar.getScrollBarValueListeners().add(this);
    }
View Full Code Here

Examples of org.apache.pivot.wtk.ScrollPane

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

        ScrollPane scrollPane = (ScrollPane)getComponent();
        Component view = scrollPane.getView();

        if (view != null) {
            int preferredRowHeaderWidth = 0;
            Component rowHeader = scrollPane.getRowHeader();
            if (rowHeader != null) {
                preferredRowHeaderWidth = rowHeader.getPreferredWidth(-1);
            }

            int preferredColumnHeaderHeight = 0;
            Component columnHeader = scrollPane.getColumnHeader();
            if (columnHeader != null) {
                preferredColumnHeaderHeight = columnHeader.getPreferredHeight(-1);
            }

            ScrollBarPolicy verticalPolicy = scrollPane.getVerticalScrollBarPolicy();

            if (verticalPolicy != ScrollBarPolicy.FILL) {
                // Get the unconstrained preferred size of the view
                Dimensions preferredViewSize = view.getPreferredSize();
View Full Code Here

Examples of org.apache.pivot.wtk.ScrollPane

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

        ScrollPane scrollPane = (ScrollPane)getComponent();
        Component view = scrollPane.getView();

        if (view != null) {
            int preferredRowHeaderWidth = 0;
            Component rowHeader = scrollPane.getRowHeader();
            if (rowHeader != null) {
                preferredRowHeaderWidth = rowHeader.getPreferredWidth(-1);
            }

            int preferredColumnHeaderHeight = 0;
            Component columnHeader = scrollPane.getColumnHeader();
            if (columnHeader != null) {
                preferredColumnHeaderHeight = columnHeader.getPreferredHeight(-1);
            }

            ScrollBarPolicy horizontalPolicy = scrollPane.getHorizontalScrollBarPolicy();

            if (horizontalPolicy != ScrollBarPolicy.FILL) {
                // Get the unconstrained preferred size of the view
                Dimensions preferredViewSize = view.getPreferredSize();
View Full Code Here

Examples of org.apache.pivot.wtk.ScrollPane

        return preferredHeight;
    }

    @Override
    public Dimensions getPreferredSize() {
        ScrollPane scrollPane = (ScrollPane)getComponent();

        int preferredWidth = 0;
        int preferredHeight = 0;

        Component view = scrollPane.getView();
        if (view != null) {
            Dimensions preferredViewSize = view.getPreferredSize();

            preferredWidth += preferredViewSize.width;
            preferredHeight += preferredViewSize.height;

            Component rowHeader = scrollPane.getRowHeader();
            if (rowHeader != null) {
                preferredWidth += rowHeader.getPreferredWidth(-1);
            }

            Component columnHeader = scrollPane.getColumnHeader();
            if (columnHeader != null) {
                preferredHeight += columnHeader.getPreferredHeight(-1);
            }

            if (scrollPane.getHorizontalScrollBarPolicy() == ScrollBarPolicy.ALWAYS) {
                preferredHeight += horizontalScrollBar.getPreferredHeight(-1);
            }

            if (scrollPane.getVerticalScrollBarPolicy() == ScrollBarPolicy.ALWAYS) {
                preferredWidth += verticalScrollBar.getPreferredWidth(-1);
            }
        }

        return new Dimensions(preferredWidth, preferredHeight);
View Full Code Here

Examples of org.apache.pivot.wtk.ScrollPane

        return new Dimensions(preferredWidth, preferredHeight);
    }

    @Override
    public int getBaseline(int width, int height) {
        ScrollPane scrollPane = (ScrollPane)getComponent();

        Component view = scrollPane.getView();
        Component rowHeader = scrollPane.getRowHeader();
        Component columnHeader = scrollPane.getColumnHeader();

        int baseline = -1;

        int clientWidth = width;
        int clientHeight = height;
View Full Code Here

Examples of org.apache.pivot.wtk.ScrollPane

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

        ScrollPane scrollPane = (ScrollPane)getComponent();
        Component view = scrollPane.getView();

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

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

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

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

                scrollPane.setScrollTop(newScrollTop);
            }
        }

        return consumed;
    }
View Full Code Here

Examples of org.apache.pivot.wtk.ScrollPane

    @Override
    public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
        boolean consumed = super.keyPressed(component, keyCode, keyLocation);

        if (!consumed) {
            ScrollPane scrollPane = (ScrollPane)getComponent();

            int scrollTop = scrollPane.getScrollTop();
            int scrollLeft = scrollPane.getScrollLeft();

            if (keyCode == Keyboard.KeyCode.UP) {
                int newScrollTop = Math.max(scrollTop -
                    verticalScrollBar.getUnitIncrement(), 0);

                scrollPane.setScrollTop(newScrollTop);

                consumed = (newScrollTop != scrollTop);
            } else if (keyCode == Keyboard.KeyCode.DOWN) {
                int newScrollTop = Math.min(scrollTop +
                    verticalScrollBar.getUnitIncrement(), getMaxScrollTop());

                scrollPane.setScrollTop(newScrollTop);

                consumed = (newScrollTop != scrollTop);
            } else if (keyCode == Keyboard.KeyCode.LEFT) {
                int newScrollLeft = Math.max(scrollLeft -
                    horizontalScrollBar.getUnitIncrement(), 0);

                scrollPane.setScrollLeft(newScrollLeft);

                consumed = (newScrollLeft != scrollLeft);
            } else if (keyCode == Keyboard.KeyCode.RIGHT) {
                int newScrollLeft = Math.min(scrollLeft +
                    horizontalScrollBar.getUnitIncrement(), getMaxScrollLeft());

                scrollPane.setScrollLeft(newScrollLeft);

                consumed = (newScrollLeft != scrollLeft);
            } else if (keyCode == Keyboard.KeyCode.PAGE_UP) {
                int increment = verticalScrollBar.getBlockIncrement();
                int newScrollTop = Math.max(scrollTop - increment, 0);

                scrollPane.setScrollTop(newScrollTop);

                consumed = (newScrollTop != scrollTop);
            } else if (keyCode == Keyboard.KeyCode.PAGE_DOWN) {
                int increment = verticalScrollBar.getBlockIncrement();
                int newScrollTop = Math.min(scrollTop + increment, getMaxScrollTop());

                scrollPane.setScrollTop(newScrollTop);

                consumed = (newScrollTop != scrollTop);
            }
        }
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.