Examples of ScrollBar


Examples of org.apache.pivot.wtk.ScrollBar

            return (orientation == Orientation.HORIZONTAL ? 5 : 7);
        }

        @Override
        public int getHeight() {
            ScrollBar scrollBar = (ScrollBar)getComponent();
            Orientation orientation = scrollBar.getOrientation();
            return (orientation == Orientation.HORIZONTAL ? 7 : 5);
        }
View Full Code Here

Examples of org.apache.pivot.wtk.ScrollBar

    }

    protected class ScrollUpImage extends ScrollButtonImage {
        @Override
        public void paint(Graphics2D graphics) {
            ScrollBar scrollBar = (ScrollBar)getComponent();

            int width = getWidth();
            int height = getHeight();

            graphics.setPaint(scrollButtonImageColor);
            graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);

            GeneralPath arrow = new GeneralPath(GeneralPath.WIND_EVEN_ODD);

            if (scrollBar.getOrientation() == Orientation.HORIZONTAL) {
                arrow.moveTo(width + 0.5f, 0);
                arrow.lineTo(0, height / 2.0f);
                arrow.lineTo(width + 0.5f, height);
            } else {
                arrow.moveTo(0, height + 0.5f);
View Full Code Here

Examples of org.apache.pivot.wtk.ScrollBar

    }

    protected class ScrollDownImage extends ScrollButtonImage {
        @Override
        public void paint(Graphics2D graphics) {
            ScrollBar scrollBar = (ScrollBar)getComponent();

            int width = getWidth();
            int height = getHeight();

            graphics.setPaint(scrollButtonImageColor);
            graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);

            GeneralPath arrow = new GeneralPath(GeneralPath.WIND_EVEN_ODD);

            if (scrollBar.getOrientation() == Orientation.HORIZONTAL) {
                arrow.moveTo(0, 0);
                arrow.lineTo(width + 0.5f, height / 2.0f);
                arrow.lineTo(0, height);
            } else {
                arrow.moveTo(0, 0);
View Full Code Here

Examples of org.apache.pivot.wtk.ScrollBar

            // No-op
        }

        @Override
        public void paint(Graphics2D graphics) {
            ScrollBar scrollBar = (ScrollBar)TerraScrollBarSkin.this.getComponent();
            Orientation orientation = scrollBar.getOrientation();

            int width = getWidth();
            int height = getHeight();

            // Paint the background
View Full Code Here

Examples of org.apache.pivot.wtk.ScrollBar

        @Override
        public boolean mouseMove(Component component, int x, int y) {
            boolean consumed = super.mouseMove(component, x, y);

            if (Mouse.getCapturer() == component) {
                ScrollBar scrollBar = (ScrollBar)TerraScrollBarSkin.this.getComponent();
                Orientation orientation = scrollBar.getOrientation();

                // Calculate the new scroll bar value
                int pixelValue;
                if (orientation == Orientation.HORIZONTAL) {
                    pixelValue = component.getX() - scrollUpButton.getWidth() + x - dragOffset;
                } else {
                    pixelValue = component.getY() - scrollUpButton.getHeight() + y - dragOffset;
                }

                int realValue = (int)(pixelValue / getValueScale());

                // Bound the value
                int start = scrollBar.getStart();
                int end = scrollBar.getEnd();
                int extent = scrollBar.getExtent();
                realValue = Math.min(Math.max(realValue - start, start), end - extent);

                // Update the scroll bar
                scrollBar.setValue(realValue);
            }

            return consumed;
        }
View Full Code Here

Examples of org.apache.pivot.wtk.ScrollBar

        @Override
        public boolean mouseDown(Component component, Mouse.Button button, int x, int y) {
            boolean consumed = super.mouseDown(component, button, x, y);

            if (button == Mouse.Button.LEFT) {
                ScrollBar scrollBar = (ScrollBar)TerraScrollBarSkin.this.getComponent();
                Orientation orientation = scrollBar.getOrientation();

                dragOffset = (orientation == Orientation.HORIZONTAL ? x : y);
                Mouse.capture(component);
                consumed = true;
            }
View Full Code Here

Examples of org.eclipse.draw2d.ScrollBar

        currentLocation.y += step;
      }
      viewport.setViewLocation(currentLocation);

      // refreshes the scrollbar so they can disppear if needed
      ScrollBar scrollbar = scrollpane.getVerticalScrollBar();
      scrollbar.invalidate();
      scrollbar.validate();
    }
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.ScrollBar

  }

  public static int getTableAdjustHorizontallyBy(Table t) {
    if (!bFixGTKBug || t == null || t.isDisposed())
      return 0;
    ScrollBar sb = t.getHorizontalBar();
    if (sb == null)
      return 0;
    return sb.getSelection();
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.ScrollBar

  private void onTreeResize() {
    int totalWidth = fTree.getParent().getClientArea().width;
    totalWidth -= fTree.getBorderWidth() * 2;

    ScrollBar verticalBar = fTree.getVerticalBar();
    if (verticalBar != null)
      totalWidth -= fTree.getVerticalBar().getSize().x;

    /* Bug on Mac: Width is too big */
    if (Application.IS_MAC)
View Full Code Here

Examples of org.eclipse.swt.widgets.ScrollBar

  private void onTableResize() {
    int totalWidth = fTable.getParent().getClientArea().width;
    totalWidth -= fTable.getBorderWidth() * 2;

    ScrollBar verticalBar = fTable.getVerticalBar();
    if (verticalBar != null)
      totalWidth -= fTable.getVerticalBar().getSize().x;

    /* Bug on Mac: Width is too big */
    if (Application.IS_MAC)
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.