Package jexer

Class TScrollableWidget

    • Field Detail

      • hScroller

        protected THScroller hScroller
        The horizontal scrollbar.
      • vScroller

        protected TVScroller vScroller
        The vertical scrollbar.
    • Constructor Detail

      • TScrollableWidget

        protected TScrollableWidget​(TWidget parent)
        Protected constructor.
        Parameters:
        parent - parent widget
      • TScrollableWidget

        protected TScrollableWidget​(TWidget parent,
                                    int x,
                                    int y,
                                    int width,
                                    int height)
        Protected constructor.
        Parameters:
        parent - parent widget
        x - column relative to parent
        y - row relative to parent
        width - width of widget
        height - height of widget
      • TScrollableWidget

        protected TScrollableWidget​(TWidget parent,
                                    boolean enabled)
        Protected constructor used by subclasses that are disabled by default.
        Parameters:
        parent - parent widget
        enabled - if true assume enabled
      • TScrollableWidget

        protected TScrollableWidget​(TWidget parent,
                                    boolean enabled,
                                    int x,
                                    int y,
                                    int width,
                                    int height)
        Protected constructor used by subclasses that are disabled by default.
        Parameters:
        parent - parent widget
        enabled - if true assume enabled
        x - column relative to parent
        y - row relative to parent
        width - width of widget
        height - height of widget
    • Method Detail

      • onResize

        public void onResize​(TResizeEvent event)
        Handle window/screen resize events.
        Overrides:
        onResize in class TWidget
        Parameters:
        event - resize event
      • placeScrollbars

        protected void placeScrollbars()
        Place the scrollbars on the edge of this widget, and adjust bigChange to match the new size. This is called by onResize().
      • reflowData

        public void reflowData()
        Recompute whatever data is displayed by this widget.
      • getHorizontalScroller

        public THScroller getHorizontalScroller()
        Get the horizontal scrollbar, or null if this Viewport does not support horizontal scrolling.
        Specified by:
        getHorizontalScroller in interface Scrollable
        Returns:
        the horizontal scrollbar
      • getVerticalScroller

        public TVScroller getVerticalScroller()
        Get the vertical scrollbar, or null if this Viewport does not support vertical scrolling.
        Specified by:
        getVerticalScroller in interface Scrollable
        Returns:
        the vertical scrollbar
      • getTopValue

        public int getTopValue()
        Get the value that corresponds to being on the top edge of the vertical scroll bar.
        Specified by:
        getTopValue in interface Scrollable
        Returns:
        the scroll value
      • setTopValue

        public void setTopValue​(int topValue)
        Set the value that corresponds to being on the top edge of the vertical scroll bar.
        Specified by:
        setTopValue in interface Scrollable
        Parameters:
        topValue - the new scroll value
      • getBottomValue

        public int getBottomValue()
        Get the value that corresponds to being on the bottom edge of the vertical scroll bar.
        Specified by:
        getBottomValue in interface Scrollable
        Returns:
        the scroll value
      • setBottomValue

        public void setBottomValue​(int bottomValue)
        Set the value that corresponds to being on the bottom edge of the vertical scroll bar.
        Specified by:
        setBottomValue in interface Scrollable
        Parameters:
        bottomValue - the new scroll value
      • getVerticalValue

        public int getVerticalValue()
        Get current value of the vertical scroll.
        Specified by:
        getVerticalValue in interface Scrollable
        Returns:
        the scroll value
      • setVerticalValue

        public void setVerticalValue​(int value)
        Set current value of the vertical scroll.
        Specified by:
        setVerticalValue in interface Scrollable
        Parameters:
        value - the new scroll value
      • getVerticalSmallChange

        public int getVerticalSmallChange()
        Get the increment for clicking on an arrow on the vertical scrollbar.
        Specified by:
        getVerticalSmallChange in interface Scrollable
        Returns:
        the increment value
      • setVerticalSmallChange

        public void setVerticalSmallChange​(int smallChange)
        Set the increment for clicking on an arrow on the vertical scrollbar.
        Specified by:
        setVerticalSmallChange in interface Scrollable
        Parameters:
        smallChange - the new increment value
      • getVerticalBigChange

        public int getVerticalBigChange()
        Get the increment for clicking in the bar between the box and an arrow on the vertical scrollbar.
        Specified by:
        getVerticalBigChange in interface Scrollable
        Returns:
        the increment value
      • setVerticalBigChange

        public void setVerticalBigChange​(int bigChange)
        Set the increment for clicking in the bar between the box and an arrow on the vertical scrollbar.
        Specified by:
        setVerticalBigChange in interface Scrollable
        Parameters:
        bigChange - the new increment value
      • verticalDecrement

        public void verticalDecrement()
        Perform a small step change up.
        Specified by:
        verticalDecrement in interface Scrollable
      • verticalIncrement

        public void verticalIncrement()
        Perform a small step change down.
        Specified by:
        verticalIncrement in interface Scrollable
      • bigVerticalDecrement

        public void bigVerticalDecrement()
        Perform a big step change up.
        Specified by:
        bigVerticalDecrement in interface Scrollable
      • bigVerticalIncrement

        public void bigVerticalIncrement()
        Perform a big step change down.
        Specified by:
        bigVerticalIncrement in interface Scrollable
      • toTop

        public void toTop()
        Go to the top edge of the vertical scroller.
        Specified by:
        toTop in interface Scrollable
      • toBottom

        public void toBottom()
        Go to the bottom edge of the vertical scroller.
        Specified by:
        toBottom in interface Scrollable
      • getLeftValue

        public int getLeftValue()
        Get the value that corresponds to being on the left edge of the horizontal scroll bar.
        Specified by:
        getLeftValue in interface Scrollable
        Returns:
        the scroll value
      • setLeftValue

        public void setLeftValue​(int leftValue)
        Set the value that corresponds to being on the left edge of the horizontal scroll bar.
        Specified by:
        setLeftValue in interface Scrollable
        Parameters:
        leftValue - the new scroll value
      • getRightValue

        public int getRightValue()
        Get the value that corresponds to being on the right edge of the horizontal scroll bar.
        Specified by:
        getRightValue in interface Scrollable
        Returns:
        the scroll value
      • setRightValue

        public void setRightValue​(int rightValue)
        Set the value that corresponds to being on the right edge of the horizontal scroll bar.
        Specified by:
        setRightValue in interface Scrollable
        Parameters:
        rightValue - the new scroll value
      • getHorizontalValue

        public int getHorizontalValue()
        Get current value of the horizontal scroll.
        Specified by:
        getHorizontalValue in interface Scrollable
        Returns:
        the scroll value
      • setHorizontalValue

        public void setHorizontalValue​(int value)
        Set current value of the horizontal scroll.
        Specified by:
        setHorizontalValue in interface Scrollable
        Parameters:
        value - the new scroll value
      • getHorizontalSmallChange

        public int getHorizontalSmallChange()
        Get the increment for clicking on an arrow on the horizontal scrollbar.
        Specified by:
        getHorizontalSmallChange in interface Scrollable
        Returns:
        the increment value
      • setHorizontalSmallChange

        public void setHorizontalSmallChange​(int smallChange)
        Set the increment for clicking on an arrow on the horizontal scrollbar.
        Specified by:
        setHorizontalSmallChange in interface Scrollable
        Parameters:
        smallChange - the new increment value
      • getHorizontalBigChange

        public int getHorizontalBigChange()
        Get the increment for clicking in the bar between the box and an arrow on the horizontal scrollbar.
        Specified by:
        getHorizontalBigChange in interface Scrollable
        Returns:
        the increment value
      • setHorizontalBigChange

        public void setHorizontalBigChange​(int bigChange)
        Set the increment for clicking in the bar between the box and an arrow on the horizontal scrollbar.
        Specified by:
        setHorizontalBigChange in interface Scrollable
        Parameters:
        bigChange - the new increment value
      • horizontalDecrement

        public void horizontalDecrement()
        Perform a small step change left.
        Specified by:
        horizontalDecrement in interface Scrollable
      • horizontalIncrement

        public void horizontalIncrement()
        Perform a small step change right.
        Specified by:
        horizontalIncrement in interface Scrollable
      • toLeft

        public void toLeft()
        Go to the left edge of the horizontal scroller.
        Specified by:
        toLeft in interface Scrollable
      • toRight

        public void toRight()
        Go to the right edge of the horizontal scroller.
        Specified by:
        toRight in interface Scrollable
      • toHome

        public void toHome()
        Go to the top-left edge of the horizontal and vertical scrollers.
        Specified by:
        toHome in interface Scrollable
      • toEnd

        public void toEnd()
        Go to the bottom-right edge of the horizontal and vertical scrollers.
        Specified by:
        toEnd in interface Scrollable