Package pivot.wtk

Examples of pivot.wtk.Slider$SliderListenerList


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

    Slider slider = (Slider)component;
    slider.add(thumb);
  }
View Full Code Here


    Slider slider = (Slider)component;
    slider.add(thumb);
  }

  public void uninstall() {
    Slider slider = (Slider)getComponent();
    slider.remove(thumb);

    super.uninstall();
  }
View Full Code Here

  public Dimensions getPreferredSize() {
    return new Dimensions(getPreferredWidth(-1), getPreferredHeight(-1));
  }

  public void layout() {
    Slider slider = (Slider)getComponent();

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

    int minimum = slider.getMinimum();
    int maximum = slider.getMaximum();
    int value = slider.getValue();

    float ratio = (float)(value - minimum) / (maximum - minimum);

    thumb.setSize(thumbWidth, thumbHeight);
    thumb.setLocation((int)((float)(width - thumbWidth) * ratio),
 
View Full Code Here

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

            if (Mouse.getCapturer() == component) {
                Slider slider = (Slider)TerraSliderSkin.this.getComponent();
                int sliderWidth = slider.getWidth();
                int thumbWidth = thumb.getWidth();

                Point sliderCoordinates = thumb.mapPointToAncestor(slider, x, y);

                int minX = dragOffset.x;
                if (sliderCoordinates.x < minX) {
                    sliderCoordinates.x = minX;
                }

                int maxX = (sliderWidth - thumbWidth) + dragOffset.x;
                if (sliderCoordinates.x > maxX) {
                    sliderCoordinates.x = maxX;
                }

                float ratio = (float)(sliderCoordinates.x - dragOffset.x) / (sliderWidth - thumbWidth);

                int minimum = slider.getMinimum();
                int maximum = slider.getMaximum();

                int value = (int)(minimum + (float)(maximum - minimum) * ratio);
                slider.setValue(value);
            }

            return consumed;
        }
View Full Code Here

  implements SliderListener, SliderValueListener {
  @Override
  public void install(Component component) {
    super.install(component);

    Slider slider = (Slider)component;
    slider.getSliderListeners().add(this);
    slider.getSliderValueListeners().add(this);
  }
View Full Code Here

    slider.getSliderValueListeners().add(this);
  }

  @Override
  public void uninstall() {
    Slider slider = (Slider)getComponent();
    slider.getSliderListeners().remove(this);
    slider.getSliderValueListeners().remove(this);

    super.uninstall();
  }
View Full Code Here

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

        Slider slider = (Slider)component;
        slider.add(thumb);
    }
View Full Code Here

        Slider slider = (Slider)component;
        slider.add(thumb);
    }

    public void uninstall() {
        Slider slider = (Slider)getComponent();
        slider.remove(thumb);

        super.uninstall();
    }
View Full Code Here

    public Dimensions getPreferredSize() {
        return new Dimensions(getPreferredWidth(-1), getPreferredHeight(-1));
    }

    public void layout() {
        Slider slider = (Slider)getComponent();

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

        int minimum = slider.getMinimum();
        int maximum = slider.getMaximum();
        int value = slider.getValue();

        float ratio = (float)(value - minimum) / (maximum - minimum);

        thumb.setSize(thumbWidth, thumbHeight);
        thumb.setLocation((int)((float)(width - thumbWidth) * ratio),
 
View Full Code Here

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

            if (Mouse.getCapturer() == component) {
                Slider slider = (Slider)TerraSliderSkin.this.getComponent();
                int sliderWidth = slider.getWidth();
                int thumbWidth = thumb.getWidth();

                Point sliderLocation = thumb.mapPointToAncestor(slider, x, y);
                int sliderX = sliderLocation.x;

                int minX = dragOffset.x;
                if (sliderX < minX) {
                    sliderX = minX;
                }

                int maxX = (sliderWidth - thumbWidth) + dragOffset.x;
                if (sliderX > maxX) {
                    sliderX = maxX;
                }

                float ratio = (float)(sliderX - dragOffset.x) / (sliderWidth - thumbWidth);

                int minimum = slider.getMinimum();
                int maximum = slider.getMaximum();

                int value = (int)(minimum + (float)(maximum - minimum) * ratio);
                slider.setValue(value);
            }

            return consumed;
        }
View Full Code Here

TOP

Related Classes of pivot.wtk.Slider$SliderListenerList

Copyright © 2018 www.massapicom. 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.