Class TerraScrollBarSkin

    • Constructor Detail

      • TerraScrollBarSkin

        public TerraScrollBarSkin()
    • Method Detail

      • install

        public void install​(Component component)
        Description copied from class: ComponentSkin
        Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.
        Specified by:
        install in interface Skin
        Overrides:
        install in class ContainerSkin
        Parameters:
        component - The component to which the skin is being attached.
      • getPreferredWidth

        public int getPreferredWidth​(int height)
        Description copied from interface: ConstrainedVisual
        Returns the visual's preferred width given the provided height constraint.
        Specified by:
        getPreferredWidth in interface ConstrainedVisual
        Overrides:
        getPreferredWidth in class ContainerSkin
        Parameters:
        height - The height by which to constrain the preferred width, or -1 for no constraint.
        Returns:
        The preferred width given the height constraint.
      • getPreferredHeight

        public int getPreferredHeight​(int width)
        Description copied from interface: ConstrainedVisual
        Returns the visual's preferred height given the provided width constraint.
        Specified by:
        getPreferredHeight in interface ConstrainedVisual
        Overrides:
        getPreferredHeight in class ContainerSkin
        Parameters:
        width - The width by which to constrain the preferred height, or -1 for no constraint.
        Returns:
        The preferred height given the width constraint.
      • layout

        public void layout()
        Description copied from interface: Skin
        If the component on which the skin is installed is a container, lays out the container's children.
        Specified by:
        layout in interface Skin
      • paint

        public void paint​(java.awt.Graphics2D graphics)
        Description copied from interface: Visual
        Paints the visual.
        Specified by:
        paint in interface Visual
        Overrides:
        paint in class ContainerSkin
        Parameters:
        graphics - The graphics context in which to paint the visual.
      • getMinimumHandleLength

        public int getMinimumHandleLength()
      • setMinimumHandleLength

        public void setMinimumHandleLength​(int minimumHandleLength)
      • getBorderColor

        public java.awt.Color getBorderColor()
      • setBorderColor

        public void setBorderColor​(java.awt.Color borderColor)
      • setBorderColor

        public final void setBorderColor​(java.lang.String borderColor)
      • setBorderColor

        public final void setBorderColor​(int borderColor)
      • getScrollButtonImageColor

        public java.awt.Color getScrollButtonImageColor()
      • setScrollButtonImageColor

        public void setScrollButtonImageColor​(java.awt.Color scrollButtonImageColor)
      • setScrollButtonImageColor

        public final void setScrollButtonImageColor​(java.lang.String scrollButtonImageColor)
      • setScrollButtonImageColor

        public final void setScrollButtonImageColor​(int scrollButtonImageColor)
      • getScrollButtonBackgroundColor

        public java.awt.Color getScrollButtonBackgroundColor()
      • setScrollButtonBackgroundColor

        public void setScrollButtonBackgroundColor​(java.awt.Color scrollButtonBackgroundColor)
      • setScrollButtonBackgroundColor

        public final void setScrollButtonBackgroundColor​(java.lang.String scrollButtonBackgroundColor)
      • setScrollButtonBackgroundColor

        public final void setScrollButtonBackgroundColor​(int scrollButtonBackgroundColor)
      • getScrollButtonDisabledBackgroundColor

        public java.awt.Color getScrollButtonDisabledBackgroundColor()
      • setScrollButtonDisabledBackgroundColor

        public void setScrollButtonDisabledBackgroundColor​(java.awt.Color scrollButtonDisabledBackgroundColor)
      • setScrollButtonDisabledBackgroundColor

        public final void setScrollButtonDisabledBackgroundColor​(java.lang.String scrollButtonDisabledBackgroundColor)
      • setScrollButtonDisabledBackgroundColor

        public final void setScrollButtonDisabledBackgroundColor​(int scrollButtonDisabledBackgroundColor)
      • getScrollButtonPressedBackgroundColor

        public java.awt.Color getScrollButtonPressedBackgroundColor()
      • setScrollButtonPressedBackgroundColor

        public void setScrollButtonPressedBackgroundColor​(java.awt.Color scrollButtonPressedBackgroundColor)
      • setScrollButtonPressedBackgroundColor

        public final void setScrollButtonPressedBackgroundColor​(java.lang.String scrollButtonPressedBackgroundColor)
      • setScrollButtonPressedBackgroundColor

        public final void setScrollButtonPressedBackgroundColor​(int scrollButtonPressedBackgroundColor)
      • getScrollButtonHighlightedBackgroundColor

        public java.awt.Color getScrollButtonHighlightedBackgroundColor()
      • setScrollButtonHighlightedBackgroundColor

        public void setScrollButtonHighlightedBackgroundColor​(java.awt.Color scrollButtonHighlightedBackgroundColor)
      • setScrollButtonHighlightedBackgroundColor

        public final void setScrollButtonHighlightedBackgroundColor​(java.lang.String scrollButtonHighlightedBackgroundColor)
      • setScrollButtonHighlightedBackgroundColor

        public final void setScrollButtonHighlightedBackgroundColor​(int scrollButtonHighlightedBackgroundColor)
      • mouseDown

        public boolean mouseDown​(Component component,
                                 Mouse.Button button,
                                 int x,
                                 int y)
        Initiates automatic block scrolling. This only happens if the handle is visible since whether the user clicked before or after the handle determines the direction of the scrolling.
        Specified by:
        mouseDown in interface ComponentMouseButtonListener
        Overrides:
        mouseDown in class ComponentSkin
        Parameters:
        component - The scroll bar.
        button - The button that was pressed.
        x - The x-coordinate of the event in the scroll bar's coordinate space.
        y - The y-coordinate of the event in the scroll bar's coordinate space.
        Returns:
        true to consume the event; false to allow it to propagate (default).
      • mouseUp

        public boolean mouseUp​(Component component,
                               Mouse.Button button,
                               int x,
                               int y)
        Cancels automatic block scrolling.
        Specified by:
        mouseUp in interface ComponentMouseButtonListener
        Overrides:
        mouseUp in class ComponentSkin
        Parameters:
        component - The scroll bar.
        button - The button that was released.
        x - The x-coordinate of the event in the scroll bar's coordinate space.
        y - The y-coordinate of the event in the scroll bar's coordinate space.
        Returns:
        true to consume the event; false to allow it to propagate (default).
      • mouseWheel

        public boolean mouseWheel​(Component component,
                                  Mouse.ScrollType scrollType,
                                  int scrollAmount,
                                  int wheelRotation,
                                  int x,
                                  int y)
        Updates the scroll bar's value.
        Specified by:
        mouseWheel in interface ComponentMouseWheelListener
        Overrides:
        mouseWheel in class ComponentSkin
        Parameters:
        component - The scroll bar.
        scrollType - Unit or block scrolling.
        scrollAmount - The amount of scrolling.
        wheelRotation - -1 or 1 for backward or forward scrolling, respectively.
        x - The x-coordinate of the event in the scroll bar's coordinate space.
        y - The y-coordinate of the event in the scroll bar's coordinate space.
        Returns:
        true to consume the event; false to allow it to propagate.
      • orientationChanged

        public void orientationChanged​(ScrollBar scrollBar,
                                       Orientation previousOrientation)
        Description copied from interface: ScrollBarListener
        Called when a scroll bar's orientation has changed.
        Specified by:
        orientationChanged in interface ScrollBarListener
        Parameters:
        scrollBar - The scroll bar that changed orientation.
        previousOrientation - The previous orientation.
      • scopeChanged

        public void scopeChanged​(ScrollBar scrollBar,
                                 int previousStart,
                                 int previousEnd,
                                 int previousExtent)
        Description copied from interface: ScrollBarListener
        Called when a scroll bar's scope has changed.
        Specified by:
        scopeChanged in interface ScrollBarListener
        Parameters:
        scrollBar - The scroll bar that changed.
        previousStart - The previous start value.
        previousEnd - The previous end value.
        previousExtent - The previous scroll bar extent value.
      • unitIncrementChanged

        public void unitIncrementChanged​(ScrollBar scrollBar,
                                         int previousUnitIncrement)
        Description copied from interface: ScrollBarListener
        Called when a scroll bar's unit increment has changed.
        Specified by:
        unitIncrementChanged in interface ScrollBarListener
        Parameters:
        scrollBar - The scroll bar that changed.
        previousUnitIncrement - The previous unit increment value.
      • blockIncrementChanged

        public void blockIncrementChanged​(ScrollBar scrollBar,
                                          int previousBlockIncrement)
        Description copied from interface: ScrollBarListener
        Called when a scroll bar's block increment has changed.
        Specified by:
        blockIncrementChanged in interface ScrollBarListener
        Parameters:
        scrollBar - The scroll bar that changed.
        previousBlockIncrement - The previous block increment value.
      • valueChanged

        public void valueChanged​(ScrollBar scrollBar,
                                 int previousValue)
        Description copied from interface: ScrollBarValueListener
        Called when a scroll bar's value has changed.
        Specified by:
        valueChanged in interface ScrollBarValueListener
        Parameters:
        scrollBar - The scroll bar that is changing.
        previousValue - The previous value of this scroll bar.