1
2
3
4 package org.sirius.server.win32.classes.controls;
5
6 import java.rmi.RemoteException;
7
8 import org.sirius.server.win32lib.controls.Win32LibControlsClient;
9 import org.sirius.server.win32lib.controls.scrollbar.IScrollBarContractProxy;
10
11
12
13
14
15 public class ScrollBar {
16
17 private final Win32LibControlsClient win32lib;
18
19
20
21
22 public ScrollBar() {
23 win32lib = new Win32LibControlsClient();
24 }
25
26
27
28
29
30
31
32 public Double getLowerBound(Integer hwnd) throws RemoteException {
33 return win32lib.scrollBar().getLowerBound(hwnd);
34 }
35
36
37
38
39
40
41
42 public Double getPosition(Integer hwnd) throws RemoteException {
43 return win32lib.scrollBar().getPosition(hwnd);
44 }
45
46
47
48
49
50
51
52 public Double getUpperBound(Integer hwnd) throws RemoteException {
53 return win32lib.scrollBar().getUpperBound(hwnd);
54 }
55
56
57
58
59
60
61
62
63 public void setPosition(Integer hwnd, Double pos) throws RemoteException {
64 win32lib.scrollBar().setPosition(hwnd, pos);
65 }
66
67 public Double getSmallStep(Integer hwnd) throws RemoteException{
68 return win32lib.scrollBar().getSmallStep(hwnd);
69 }
70
71 public Double getLargeStep(Integer hwnd) throws RemoteException{
72 return win32lib.scrollBar().getLargeStep(hwnd);
73 }
74
75 public void increment(Integer hwnd) throws RemoteException{
76 double position = this.getPosition(hwnd);
77 double step = this.getSmallStep(hwnd);
78 double max = this.getUpperBound(hwnd);
79
80 if(position + step <= max ){
81 this.setPosition(hwnd, position + step);
82 }
83 }
84
85 public void decrement(Integer hwnd) throws RemoteException{
86 double position = this.getPosition(hwnd);
87 double step = this.getSmallStep(hwnd);
88 double min = this.getLowerBound(hwnd);
89
90 if(position - step >= min ){
91 this.setPosition(hwnd, position - step);
92 }
93 }
94 }