X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTHScroller.java;h=9e9b372ec51854d8bf75e968746d65e58ef1c8c8;hb=56661844475522242093c8858ceb20fb15589da5;hp=d488ebf417db22b156484951fb856a31fb0a64bb;hpb=8c236a985851e21e6514b25f0795f8d4aead871a;p=nikiroo-utils.git diff --git a/src/jexer/THScroller.java b/src/jexer/THScroller.java index d488ebf..9e9b372 100644 --- a/src/jexer/THScroller.java +++ b/src/jexer/THScroller.java @@ -115,6 +115,15 @@ public final class THScroller extends TWidget { */ private int smallChange = 1; + /** + * Get the increment for clicking on an arrow. + * + * @return the increment value + */ + public int getSmallChange() { + return smallChange; + } + /** * Set the increment for clicking on an arrow. * @@ -129,6 +138,16 @@ public final class THScroller extends TWidget { */ private int bigChange = 20; + /** + * Set the increment for clicking in the bar between the box and an + * arrow. + * + * @return the increment value + */ + public int getBigChange() { + return bigChange; + } + /** * Set the increment for clicking in the bar between the box and an * arrow. @@ -218,6 +237,46 @@ public final class THScroller extends TWidget { } } + /** + * Perform a big step change left. + */ + public void bigDecrement() { + if (leftValue == rightValue) { + return; + } + value -= bigChange; + if (value < leftValue) { + value = leftValue; + } + } + + /** + * Perform a big step change right. + */ + public void bigIncrement() { + if (rightValue == leftValue) { + return; + } + value += bigChange; + if (value > rightValue) { + value = rightValue; + } + } + + /** + * Go to the left edge of the scroller. + */ + public void toLeft() { + value = leftValue; + } + + /** + * Go to the right edge of the scroller. + */ + public void toRight() { + value = rightValue; + } + /** * Handle mouse button releases. *