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 import org.apache.pivot.wtk.media.Image;
022
023 /**
024 * @author Andres Almiray
025 * @since 2.0.0
026 */
027 public class WindowAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.WindowListener {
028 private CallableWithArgs<Void> iconAdded;
029 private CallableWithArgs<Void> iconInserted;
030 private CallableWithArgs<Void> iconsRemoved;
031 private CallableWithArgs<Void> titleChanged;
032 private CallableWithArgs<Void> contentChanged;
033 private CallableWithArgs<Void> activeChanged;
034 private CallableWithArgs<Void> maximizedChanged;
035
036 public CallableWithArgs<Void> getIconAdded() {
037 return this.iconAdded;
038 }
039
040 public CallableWithArgs<Void> getIconInserted() {
041 return this.iconInserted;
042 }
043
044 public CallableWithArgs<Void> getIconsRemoved() {
045 return this.iconsRemoved;
046 }
047
048 public CallableWithArgs<Void> getTitleChanged() {
049 return this.titleChanged;
050 }
051
052 public CallableWithArgs<Void> getContentChanged() {
053 return this.contentChanged;
054 }
055
056 public CallableWithArgs<Void> getActiveChanged() {
057 return this.activeChanged;
058 }
059
060 public CallableWithArgs<Void> getMaximizedChanged() {
061 return this.maximizedChanged;
062 }
063
064
065 public void setIconAdded(CallableWithArgs<Void> iconAdded) {
066 this.iconAdded = iconAdded;
067 }
068
069 public void setIconInserted(CallableWithArgs<Void> iconInserted) {
070 this.iconInserted = iconInserted;
071 }
072
073 public void setIconsRemoved(CallableWithArgs<Void> iconsRemoved) {
074 this.iconsRemoved = iconsRemoved;
075 }
076
077 public void setTitleChanged(CallableWithArgs<Void> titleChanged) {
078 this.titleChanged = titleChanged;
079 }
080
081 public void setContentChanged(CallableWithArgs<Void> contentChanged) {
082 this.contentChanged = contentChanged;
083 }
084
085 public void setActiveChanged(CallableWithArgs<Void> activeChanged) {
086 this.activeChanged = activeChanged;
087 }
088
089 public void setMaximizedChanged(CallableWithArgs<Void> maximizedChanged) {
090 this.maximizedChanged = maximizedChanged;
091 }
092
093
094 public void iconAdded(org.apache.pivot.wtk.Window arg0, org.apache.pivot.wtk.media.Image arg1) {
095 if (iconAdded != null) {
096 iconAdded.call(arg0, arg1);
097 }
098 }
099
100 public void iconInserted(org.apache.pivot.wtk.Window arg0, org.apache.pivot.wtk.media.Image arg1, int arg2) {
101 if (iconInserted != null) {
102 iconInserted.call(arg0, arg1, arg2);
103 }
104 }
105
106 public void iconsRemoved(org.apache.pivot.wtk.Window arg0, int arg1, org.apache.pivot.collections.Sequence<Image> arg2) {
107 if (iconsRemoved != null) {
108 iconsRemoved.call(arg0, arg1, arg2);
109 }
110 }
111
112 public void titleChanged(org.apache.pivot.wtk.Window arg0, java.lang.String arg1) {
113 if (titleChanged != null) {
114 titleChanged.call(arg0, arg1);
115 }
116 }
117
118 public void contentChanged(org.apache.pivot.wtk.Window arg0, org.apache.pivot.wtk.Component arg1) {
119 if (contentChanged != null) {
120 contentChanged.call(arg0, arg1);
121 }
122 }
123
124 public void activeChanged(org.apache.pivot.wtk.Window arg0, org.apache.pivot.wtk.Window arg1) {
125 if (activeChanged != null) {
126 activeChanged.call(arg0, arg1);
127 }
128 }
129
130 public void maximizedChanged(org.apache.pivot.wtk.Window arg0) {
131 if (maximizedChanged != null) {
132 maximizedChanged.call(arg0);
133 }
134 }
135
136 }
|