ScrollBarAdapter.java
01 /*
02  * SPDX-License-Identifier: Apache-2.0
03  *
04  * Copyright 2008-2017 the original author or authors.
05  *
06  * Licensed under the Apache License, Version 2.0 (the "License");
07  * you may not use this file except in compliance with the License.
08  * You may obtain a copy of the License at
09  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 package griffon.pivot.support.adapters;
19 
20 import griffon.core.CallableWithArgs;
21 
22 /**
23  @author Andres Almiray
24  @since 2.0.0
25  */
26 public class ScrollBarAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.ScrollBarListener {
27     private CallableWithArgs<Void> orientationChanged;
28     private CallableWithArgs<Void> scopeChanged;
29     private CallableWithArgs<Void> unitIncrementChanged;
30     private CallableWithArgs<Void> blockIncrementChanged;
31 
32     public CallableWithArgs<Void> getOrientationChanged() {
33         return this.orientationChanged;
34     }
35 
36     public CallableWithArgs<Void> getScopeChanged() {
37         return this.scopeChanged;
38     }
39 
40     public CallableWithArgs<Void> getUnitIncrementChanged() {
41         return this.unitIncrementChanged;
42     }
43 
44     public CallableWithArgs<Void> getBlockIncrementChanged() {
45         return this.blockIncrementChanged;
46     }
47 
48 
49     public void setOrientationChanged(CallableWithArgs<Void> orientationChanged) {
50         this.orientationChanged = orientationChanged;
51     }
52 
53     public void setScopeChanged(CallableWithArgs<Void> scopeChanged) {
54         this.scopeChanged = scopeChanged;
55     }
56 
57     public void setUnitIncrementChanged(CallableWithArgs<Void> unitIncrementChanged) {
58         this.unitIncrementChanged = unitIncrementChanged;
59     }
60 
61     public void setBlockIncrementChanged(CallableWithArgs<Void> blockIncrementChanged) {
62         this.blockIncrementChanged = blockIncrementChanged;
63     }
64 
65 
66     public void orientationChanged(org.apache.pivot.wtk.ScrollBar arg0, org.apache.pivot.wtk.Orientation arg1) {
67         if (orientationChanged != null) {
68             orientationChanged.call(arg0, arg1);
69         }
70     }
71 
72     public void scopeChanged(org.apache.pivot.wtk.ScrollBar arg0, int arg1, int arg2, int arg3) {
73         if (scopeChanged != null) {
74             scopeChanged.call(arg0, arg1, arg2, arg3);
75         }
76     }
77 
78     public void unitIncrementChanged(org.apache.pivot.wtk.ScrollBar arg0, int arg1) {
79         if (unitIncrementChanged != null) {
80             unitIncrementChanged.call(arg0, arg1);
81         }
82     }
83 
84     public void blockIncrementChanged(org.apache.pivot.wtk.ScrollBar arg0, int arg1) {
85         if (blockIncrementChanged != null) {
86             blockIncrementChanged.call(arg0, arg1);
87         }
88     }
89 
90 }