Skip to content

Commit 29e0761

Browse files
authored
JmeContext: add a getSystemListener() method (#1894)
1 parent ebf8a81 commit 29e0761

File tree

9 files changed

+97
-9
lines changed

9 files changed

+97
-9
lines changed

jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2021 jMonkeyEngine
2+
* Copyright (c) 2009-2023 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -257,6 +257,16 @@ public void setSettings(AppSettings settings) {
257257
}
258258
}
259259

260+
/**
261+
* Accesses the listener that receives events related to this context.
262+
*
263+
* @return the pre-existing instance
264+
*/
265+
@Override
266+
public SystemListener getSystemListener() {
267+
return listener;
268+
}
269+
260270
@Override
261271
public void setSystemListener(SystemListener listener) {
262272
this.listener = listener;

jme3-core/src/main/java/com/jme3/system/JmeContext.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2021 jMonkeyEngine
2+
* Copyright (c) 2009-2023 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -92,6 +92,13 @@ public enum Type {
9292
*/
9393
public void setSettings(AppSettings settings);
9494

95+
/**
96+
* Accesses the listener that receives events related to this context.
97+
*
98+
* @return the pre-existing instance
99+
*/
100+
public SystemListener getSystemListener();
101+
95102
/**
96103
* Sets the listener that will receive events relating to context
97104
* creation, update, and destroy.

jme3-core/src/main/java/com/jme3/system/NullContext.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2020 jMonkeyEngine
2+
* Copyright (c) 2009-2023 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -64,6 +64,16 @@ public Type getType() {
6464
return Type.Headless;
6565
}
6666

67+
/**
68+
* Accesses the listener that receives events related to this context.
69+
*
70+
* @return the pre-existing instance
71+
*/
72+
@Override
73+
public SystemListener getSystemListener() {
74+
return listener;
75+
}
76+
6777
@Override
6878
public void setSystemListener(SystemListener listener){
6979
this.listener = listener;

jme3-desktop/src/main/java/com/jme3/system/AWTContext.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2018 jMonkeyEngine
2+
* Copyright (c) 2009-2023 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -149,6 +149,16 @@ public void setSettings(AppSettings settings) {
149149
this.backgroundContext.setSettings(settings);
150150
}
151151

152+
/**
153+
* Accesses the listener that receives events related to this context.
154+
*
155+
* @return the pre-existing instance
156+
*/
157+
@Override
158+
public SystemListener getSystemListener() {
159+
return backgroundContext.getSystemListener();
160+
}
161+
152162
@Override
153163
public void setSystemListener(final SystemListener listener) {
154164
backgroundContext.setSystemListener(listener);

jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanelsContext.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2021 jMonkeyEngine
2+
* Copyright (c) 2009-2023 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -120,6 +120,16 @@ public Type getType() {
120120
return Type.OffscreenSurface;
121121
}
122122

123+
/**
124+
* Accesses the listener that receives events related to this context.
125+
*
126+
* @return the pre-existing instance
127+
*/
128+
@Override
129+
public SystemListener getSystemListener() {
130+
return listener;
131+
}
132+
123133
@Override
124134
public void setSystemListener(SystemListener listener) {
125135
this.listener = listener;

jme3-ios/src/main/java/com/jme3/system/ios/IGLESContext.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2012 jMonkeyEngine
2+
* Copyright (c) 2009-2023 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -83,6 +83,17 @@ public void setSettings(AppSettings settings) {
8383
}
8484
}
8585

86+
/**
87+
* Accesses the listener that receives events related to this context.
88+
*
89+
* @return the pre-existing instance
90+
*/
91+
@Override
92+
public SystemListener getSystemListener() {
93+
logger.log(Level.FINE, "IGLESContext getSystemListener");
94+
return listener;
95+
}
96+
8697
@Override
8798
public void setSystemListener(SystemListener listener) {
8899
logger.log(Level.FINE, "IGLESContext setSystemListener");

jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2022 jMonkeyEngine
2+
* Copyright (c) 2009-2023 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -91,6 +91,16 @@ public abstract class LwjglContext implements JmeContext {
9191
protected LwjglPlatform clPlatform;
9292
protected com.jme3.opencl.lwjgl.LwjglContext clContext;
9393

94+
/**
95+
* Accesses the listener that receives events related to this context.
96+
*
97+
* @return the pre-existing instance
98+
*/
99+
@Override
100+
public SystemListener getSystemListener() {
101+
return listener;
102+
}
103+
94104
@Override
95105
public void setSystemListener(SystemListener listener) {
96106
this.listener = listener;

jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2022 jMonkeyEngine
2+
* Copyright (c) 2009-2023 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -133,6 +133,16 @@ public abstract class LwjglContext implements JmeContext {
133133

134134
protected com.jme3.opencl.lwjgl.LwjglContext clContext;
135135

136+
/**
137+
* Accesses the listener that receives events related to this context.
138+
*
139+
* @return the pre-existing instance
140+
*/
141+
@Override
142+
public SystemListener getSystemListener() {
143+
return listener;
144+
}
145+
136146
@Override
137147
public void setSystemListener(final SystemListener listener) {
138148
this.listener = listener;

jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglContextVR.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.jme3.system.lwjgl;
22

33
/*
4-
* Copyright (c) 2009-2022 jMonkeyEngine
4+
* Copyright (c) 2009-2023 jMonkeyEngine
55
* All rights reserved.
66
*
77
* Redistribution and use in source and binary forms, with or without
@@ -79,6 +79,16 @@ public abstract class LwjglContextVR implements JmeContext {
7979
protected Timer timer;
8080
protected SystemListener listener;
8181

82+
/**
83+
* Accesses the listener that receives events related to this context.
84+
*
85+
* @return the pre-existing instance
86+
*/
87+
@Override
88+
public SystemListener getSystemListener() {
89+
return listener;
90+
}
91+
8292
@Override
8393
public void setSystemListener(SystemListener listener) {
8494
this.listener = listener;

0 commit comments

Comments
 (0)