2 * Jexer - Java Text User Interface
4 * The MIT License (MIT)
6 * Copyright (C) 2019 Kevin Lamonte
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
26 * @author Kevin Lamonte [kevin.lamonte@gmail.com]
32 * Scrollable provides a public API for horizontal and vertical scrollbars.
33 * Note that not all Scrollables support both horizontal and vertical
34 * scrolling; for those that only support a subset, it is expected that the
35 * methods corresponding to the missing scrollbar quietly succeed without
36 * throwing any exceptions.
38 public interface Scrollable
{
41 * Get the horizontal scrollbar, or null if this Viewport does not
42 * support horizontal scrolling.
44 * @return the horizontal scrollbar
46 public THScroller
getHorizontalScroller();
49 * Get the vertical scrollbar, or null if this Viewport does not support
52 * @return the vertical scrollbar
54 public TVScroller
getVerticalScroller();
57 * Get the value that corresponds to being on the top edge of the
58 * vertical scroll bar.
60 * @return the scroll value
62 public int getTopValue();
65 * Set the value that corresponds to being on the top edge of the
66 * vertical scroll bar.
68 * @param topValue the new scroll value
70 public void setTopValue(final int topValue
);
73 * Get the value that corresponds to being on the bottom edge of the
74 * vertical scroll bar.
76 * @return the scroll value
78 public int getBottomValue();
81 * Set the value that corresponds to being on the bottom edge of the
82 * vertical scroll bar.
84 * @param bottomValue the new scroll value
86 public void setBottomValue(final int bottomValue
);
89 * Get current value of the vertical scroll.
91 * @return the scroll value
93 public int getVerticalValue();
96 * Set current value of the vertical scroll.
98 * @param value the new scroll value
100 public void setVerticalValue(final int value
);
103 * Get the increment for clicking on an arrow on the vertical scrollbar.
105 * @return the increment value
107 public int getVerticalSmallChange();
110 * Set the increment for clicking on an arrow on the vertical scrollbar.
112 * @param smallChange the new increment value
114 public void setVerticalSmallChange(final int smallChange
);
117 * Get the increment for clicking in the bar between the box and an
118 * arrow on the vertical scrollbar.
120 * @return the increment value
122 public int getVerticalBigChange();
125 * Set the increment for clicking in the bar between the box and an
126 * arrow on the vertical scrollbar.
128 * @param bigChange the new increment value
130 public void setVerticalBigChange(final int bigChange
);
133 * Perform a small step change up.
135 public void verticalDecrement();
138 * Perform a small step change down.
140 public void verticalIncrement();
143 * Perform a big step change up.
145 public void bigVerticalDecrement();
148 * Perform a big step change down.
150 public void bigVerticalIncrement();
153 * Go to the top edge of the vertical scroller.
158 * Go to the bottom edge of the vertical scroller.
160 public void toBottom();
163 * Get the value that corresponds to being on the left edge of the
164 * horizontal scroll bar.
166 * @return the scroll value
168 public int getLeftValue();
171 * Set the value that corresponds to being on the left edge of the
172 * horizontal scroll bar.
174 * @param leftValue the new scroll value
176 public void setLeftValue(final int leftValue
);
179 * Get the value that corresponds to being on the right edge of the
180 * horizontal scroll bar.
182 * @return the scroll value
184 public int getRightValue();
187 * Set the value that corresponds to being on the right edge of the
188 * horizontal scroll bar.
190 * @param rightValue the new scroll value
192 public void setRightValue(final int rightValue
);
195 * Get current value of the horizontal scroll.
197 * @return the scroll value
199 public int getHorizontalValue();
202 * Set current value of the horizontal scroll.
204 * @param value the new scroll value
206 public void setHorizontalValue(final int value
);
209 * Get the increment for clicking on an arrow on the horizontal
212 * @return the increment value
214 public int getHorizontalSmallChange();
217 * Set the increment for clicking on an arrow on the horizontal
220 * @param smallChange the new increment value
222 public void setHorizontalSmallChange(final int smallChange
);
225 * Get the increment for clicking in the bar between the box and an
226 * arrow on the horizontal scrollbar.
228 * @return the increment value
230 public int getHorizontalBigChange();
233 * Set the increment for clicking in the bar between the box and an
234 * arrow on the horizontal scrollbar.
236 * @param bigChange the new increment value
238 public void setHorizontalBigChange(final int bigChange
);
241 * Perform a small step change left.
243 public void horizontalDecrement();
246 * Perform a small step change right.
248 public void horizontalIncrement();
251 * Perform a big step change left.
253 public void bigHorizontalDecrement();
256 * Perform a big step change right.
258 public void bigHorizontalIncrement();
261 * Go to the left edge of the horizontal scroller.
263 public void toLeft();
266 * Go to the right edge of the horizontal scroller.
268 public void toRight();
271 * Go to the top-left edge of the horizontal and vertical scrollers.
273 public void toHome();
276 * Go to the bottom-right edge of the horizontal and vertical scrollers.