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