001 /*
002 * SPDX-License-Identifier: Apache-2.0
003 *
004 * Copyright 2008-2017 the original author or authors.
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License");
007 * you may not use this file except in compliance with the License.
008 * You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018 package griffon.pivot.support.adapters;
019
020 import griffon.core.CallableWithArgs;
021
022 /**
023 * @author Andres Almiray
024 * @since 2.0.0
025 */
026 public class MovieAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.media.MovieListener {
027 private CallableWithArgs<Void> regionUpdated;
028 private CallableWithArgs<Void> baselineChanged;
029 private CallableWithArgs<Void> sizeChanged;
030 private CallableWithArgs<Void> currentFrameChanged;
031 private CallableWithArgs<Void> loopingChanged;
032 private CallableWithArgs<Void> movieStarted;
033 private CallableWithArgs<Void> movieStopped;
034
035 public CallableWithArgs<Void> getRegionUpdated() {
036 return this.regionUpdated;
037 }
038
039 public CallableWithArgs<Void> getBaselineChanged() {
040 return this.baselineChanged;
041 }
042
043 public CallableWithArgs<Void> getSizeChanged() {
044 return this.sizeChanged;
045 }
046
047 public CallableWithArgs<Void> getCurrentFrameChanged() {
048 return this.currentFrameChanged;
049 }
050
051 public CallableWithArgs<Void> getLoopingChanged() {
052 return this.loopingChanged;
053 }
054
055 public CallableWithArgs<Void> getMovieStarted() {
056 return this.movieStarted;
057 }
058
059 public CallableWithArgs<Void> getMovieStopped() {
060 return this.movieStopped;
061 }
062
063
064 public void setRegionUpdated(CallableWithArgs<Void> regionUpdated) {
065 this.regionUpdated = regionUpdated;
066 }
067
068 public void setBaselineChanged(CallableWithArgs<Void> baselineChanged) {
069 this.baselineChanged = baselineChanged;
070 }
071
072 public void setSizeChanged(CallableWithArgs<Void> sizeChanged) {
073 this.sizeChanged = sizeChanged;
074 }
075
076 public void setCurrentFrameChanged(CallableWithArgs<Void> currentFrameChanged) {
077 this.currentFrameChanged = currentFrameChanged;
078 }
079
080 public void setLoopingChanged(CallableWithArgs<Void> loopingChanged) {
081 this.loopingChanged = loopingChanged;
082 }
083
084 public void setMovieStarted(CallableWithArgs<Void> movieStarted) {
085 this.movieStarted = movieStarted;
086 }
087
088 public void setMovieStopped(CallableWithArgs<Void> movieStopped) {
089 this.movieStopped = movieStopped;
090 }
091
092
093 public void regionUpdated(org.apache.pivot.wtk.media.Movie arg0, int arg1, int arg2, int arg3, int arg4) {
094 if (regionUpdated != null) {
095 regionUpdated.call(arg0, arg1, arg2, arg3, arg4);
096 }
097 }
098
099 public void baselineChanged(org.apache.pivot.wtk.media.Movie arg0, int arg1) {
100 if (baselineChanged != null) {
101 baselineChanged.call(arg0, arg1);
102 }
103 }
104
105 public void sizeChanged(org.apache.pivot.wtk.media.Movie arg0, int arg1, int arg2) {
106 if (sizeChanged != null) {
107 sizeChanged.call(arg0, arg1, arg2);
108 }
109 }
110
111 public void currentFrameChanged(org.apache.pivot.wtk.media.Movie arg0, int arg1) {
112 if (currentFrameChanged != null) {
113 currentFrameChanged.call(arg0, arg1);
114 }
115 }
116
117 public void loopingChanged(org.apache.pivot.wtk.media.Movie arg0) {
118 if (loopingChanged != null) {
119 loopingChanged.call(arg0);
120 }
121 }
122
123 public void movieStarted(org.apache.pivot.wtk.media.Movie arg0) {
124 if (movieStarted != null) {
125 movieStarted.call(arg0);
126 }
127 }
128
129 public void movieStopped(org.apache.pivot.wtk.media.Movie arg0) {
130 if (movieStopped != null) {
131 movieStopped.call(arg0);
132 }
133 }
134
135 }
|