aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/share/javax/media
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2012-03-03 14:04:28 -0800
committerHarvey Harrison <[email protected]>2012-03-03 14:53:31 -0800
commitef7c7458b9166abf83756e16aa29bf93b7dd2c3a (patch)
tree2baedd9f504fdaf376bb7f0cf0d6590d382e4027 /src/classes/share/javax/media
parent634ff30472247bdfb03f1dffe74417601dd4743f (diff)
j3dcore: add an early return to the enable/disable event functions to reduce indentation
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/classes/share/javax/media')
-rw-r--r--src/classes/share/javax/media/j3d/VirtualUniverse.java268
1 files changed, 120 insertions, 148 deletions
diff --git a/src/classes/share/javax/media/j3d/VirtualUniverse.java b/src/classes/share/javax/media/j3d/VirtualUniverse.java
index e5cfb6d..4b55459 100644
--- a/src/classes/share/javax/media/j3d/VirtualUniverse.java
+++ b/src/classes/share/javax/media/j3d/VirtualUniverse.java
@@ -699,238 +699,210 @@ synchronized ViewPlatformRetained[] getViewPlatformList() {
}
void disableFocusEvents() {
- ViewPlatformRetained vp;
- View views[];
ViewPlatformRetained[] vps = getViewPlatformList();
enableFocus = false;
- if (vps != null) {
- for (int i = 0; i < vps.length; i++) {
- vp = vps[i];
- views = vp.getViewList();
- for (int j = views.length - 1; j >= 0; j--) {
- Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
- while (cvs.hasMoreElements()) {
- Canvas3D cv = cvs.nextElement();
- // offscreen canvas does not have event catcher
- if (cv.eventCatcher != null)
- cv.eventCatcher.disableFocusEvents();
- }
+ if (vps == null)
+ return;
+
+ for (int i = 0; i < vps.length; i++) {
+ View[] views = vps[i].getViewList();
+ for (int j = views.length - 1; j >= 0; j--) {
+ Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
+ while (cvs.hasMoreElements()) {
+ Canvas3D cv = cvs.nextElement();
+ // offscreen canvas does not have event catcher
+ if (cv.eventCatcher != null)
+ cv.eventCatcher.disableFocusEvents();
}
}
}
}
void enableFocusEvents() {
- ViewPlatformRetained vp;
- View views[];
ViewPlatformRetained[] vps = getViewPlatformList();
enableFocus = true;
- if (vps != null) {
- for (int i = 0; i < vps.length; i++) {
- vp = vps[i];
- views = vp.getViewList();
- for (int j = views.length - 1; j >= 0; j--) {
- Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
- while (cvs.hasMoreElements()) {
- Canvas3D cv = cvs.nextElement();
- // offscreen canvas does not have event catcher
- if (cv.eventCatcher != null)
- cv.eventCatcher.enableFocusEvents();
- }
+ if (vps == null)
+ return;
+
+ for (int i = 0; i < vps.length; i++) {
+ View[] views = vps[i].getViewList();
+ for (int j = views.length - 1; j >= 0; j--) {
+ Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
+ while (cvs.hasMoreElements()) {
+ Canvas3D cv = cvs.nextElement();
+ // offscreen canvas does not have event catcher
+ if (cv.eventCatcher != null)
+ cv.eventCatcher.enableFocusEvents();
}
}
}
}
void disableKeyEvents() {
- ViewPlatformRetained vp;
ViewPlatformRetained[] vps = getViewPlatformList();
- View views[];
-
enableKey = false;
- if (vps != null) {
- for (int i = 0; i < vps.length; i++) {
- vp = vps[i];
- views = vp.getViewList();
- for (int j = views.length - 1; j >= 0; j--) {
- Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
- while (cvs.hasMoreElements()) {
- Canvas3D cv = cvs.nextElement();
- // offscreen canvas does not have event catcher
- if (cv.eventCatcher != null)
- cv.eventCatcher.disableKeyEvents();
- }
+ if (vps == null)
+ return;
+
+ for (int i = 0; i < vps.length; i++) {
+ View[] views = vps[i].getViewList();
+ for (int j = views.length - 1; j >= 0; j--) {
+ Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
+ while (cvs.hasMoreElements()) {
+ Canvas3D cv = cvs.nextElement();
+ // offscreen canvas does not have event catcher
+ if (cv.eventCatcher != null)
+ cv.eventCatcher.disableKeyEvents();
}
}
}
}
void enableKeyEvents() {
- ViewPlatformRetained vp;
ViewPlatformRetained[] vps = getViewPlatformList();
- View views[];
-
enableKey = true;
- if (vps != null) {
- for (int i = 0; i < vps.length; i++) {
- vp = vps[i];
- views = vp.getViewList();
- for (int j = views.length - 1; j >= 0; j--) {
- Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
- while (cvs.hasMoreElements()) {
- Canvas3D cv = cvs.nextElement();
- // offscreen canvas does not have event catcher
- if (cv.eventCatcher != null)
- cv.eventCatcher.enableKeyEvents();
- }
+ if (vps == null)
+ return;
+
+ for (int i = 0; i < vps.length; i++) {
+ View[] views = vps[i].getViewList();
+ for (int j = views.length - 1; j >= 0; j--) {
+ Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
+ while (cvs.hasMoreElements()) {
+ Canvas3D cv = cvs.nextElement();
+ // offscreen canvas does not have event catcher
+ if (cv.eventCatcher != null)
+ cv.eventCatcher.enableKeyEvents();
}
}
}
}
void disableMouseEvents() {
- View views[];
- ViewPlatformRetained vp;
ViewPlatformRetained[] vps = getViewPlatformList();
-
enableMouse = false;
- if (vps != null) {
- for (int i = 0; i < vps.length; i++) {
- vp = vps[i];
- views = vp.getViewList();
- for (int j = views.length - 1; j >= 0; j--) {
- Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
- while (cvs.hasMoreElements()) {
- Canvas3D cv = cvs.nextElement();
- // offscreen canvas does not have event catcher
- if (cv.eventCatcher != null)
- cv.eventCatcher.disableMouseEvents();
- }
+ if (vps == null)
+ return;
+
+ for (int i = 0; i < vps.length; i++) {
+ View[] views = vps[i].getViewList();
+ for (int j = views.length - 1; j >= 0; j--) {
+ Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
+ while (cvs.hasMoreElements()) {
+ Canvas3D cv = cvs.nextElement();
+ // offscreen canvas does not have event catcher
+ if (cv.eventCatcher != null)
+ cv.eventCatcher.disableMouseEvents();
}
}
}
}
void enableMouseEvents() {
- View views[];
- ViewPlatformRetained vp;
ViewPlatformRetained[] vps = getViewPlatformList();
-
enableMouse = true;
- if (vps != null) {
- for (int i = 0; i < vps.length; i++) {
- vp = vps[i];
- views = vp.getViewList();
- for (int j = views.length - 1; j >= 0; j--) {
- Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
- while (cvs.hasMoreElements()) {
- Canvas3D cv = cvs.nextElement();
- // offscreen canvas does not have event catcher
- if (cv.eventCatcher != null)
- cv.eventCatcher.enableMouseEvents();
- }
+ if (vps == null)
+ return;
+
+ for (int i = 0; i < vps.length; i++) {
+ View[] views = vps[i].getViewList();
+ for (int j = views.length - 1; j >= 0; j--) {
+ Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
+ while (cvs.hasMoreElements()) {
+ Canvas3D cv = cvs.nextElement();
+ // offscreen canvas does not have event catcher
+ if (cv.eventCatcher != null)
+ cv.eventCatcher.enableMouseEvents();
}
}
}
}
void disableMouseMotionEvents() {
- View views[];
- ViewPlatformRetained vp;
ViewPlatformRetained[] vps = getViewPlatformList();
-
enableMouseMotion = false;
- if (vps != null) {
- for (int i = 0; i < vps.length; i++) {
- vp = vps[i];
- views = vp.getViewList();
- for (int j = views.length - 1; j >= 0; j--) {
- Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
- while (cvs.hasMoreElements()) {
- Canvas3D cv = cvs.nextElement();
- // offscreen canvas does not have event catcher
- if (cv.eventCatcher != null)
- cv.eventCatcher.disableMouseMotionEvents();
- }
+ if (vps == null)
+ return;
+
+ for (int i = 0; i < vps.length; i++) {
+ View[] views = vps[i].getViewList();
+ for (int j = views.length - 1; j >= 0; j--) {
+ Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
+ while (cvs.hasMoreElements()) {
+ Canvas3D cv = cvs.nextElement();
+ // offscreen canvas does not have event catcher
+ if (cv.eventCatcher != null)
+ cv.eventCatcher.disableMouseMotionEvents();
}
}
}
}
void enableMouseMotionEvents() {
- View views[];
- ViewPlatformRetained vp;
ViewPlatformRetained[] vps = getViewPlatformList();
-
enableMouseMotion = true;
- if (vps != null) {
- for (int i = 0; i < vps.length; i++) {
- vp = vps[i];
- views = vp.getViewList();
- for (int j = views.length - 1; j >= 0; j--) {
- Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
- while (cvs.hasMoreElements()) {
- Canvas3D cv = cvs.nextElement();
- // offscreen canvas does not have event catcher
- if (cv.eventCatcher != null)
- cv.eventCatcher.enableMouseMotionEvents();
- }
+ if (vps == null)
+ return;
+
+ for (int i = 0; i < vps.length; i++) {
+ View[] views = vps[i].getViewList();
+ for (int j = views.length - 1; j >= 0; j--) {
+ Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
+ while (cvs.hasMoreElements()) {
+ Canvas3D cv = cvs.nextElement();
+ // offscreen canvas does not have event catcher
+ if (cv.eventCatcher != null)
+ cv.eventCatcher.enableMouseMotionEvents();
}
}
}
}
void disableMouseWheelEvents() {
- View views[];
- ViewPlatformRetained vp;
ViewPlatformRetained[] vps = getViewPlatformList();
-
enableMouseWheel = false;
- if (vps != null) {
- for (int i = 0; i < vps.length; i++) {
- vp = vps[i];
- views = vp.getViewList();
- for (int j = views.length - 1; j >= 0; j--) {
- Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
- while (cvs.hasMoreElements()) {
- Canvas3D cv = cvs.nextElement();
- // offscreen canvas does not have event catcher
- if (cv.eventCatcher != null)
- cv.eventCatcher.disableMouseWheelEvents();
- }
+ if (vps == null)
+ return;
+
+ for (int i = 0; i < vps.length; i++) {
+ View[] views = vps[i].getViewList();
+ for (int j = views.length - 1; j >= 0; j--) {
+ Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
+ while (cvs.hasMoreElements()) {
+ Canvas3D cv = cvs.nextElement();
+ // offscreen canvas does not have event catcher
+ if (cv.eventCatcher != null)
+ cv.eventCatcher.disableMouseWheelEvents();
}
}
}
}
void enableMouseWheelEvents() {
- View views[];
- ViewPlatformRetained vp;
ViewPlatformRetained[] vps = getViewPlatformList();
-
enableMouseWheel = true;
- if (vps != null) {
- for (int i = 0; i < vps.length; i++) {
- vp = vps[i];
- views = vp.getViewList();
- for (int j = views.length - 1; j >= 0; j--) {
- Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
- while (cvs.hasMoreElements()) {
- Canvas3D cv = cvs.nextElement();
- // offscreen canvas does not have event catcher
- if (cv.eventCatcher != null)
- cv.eventCatcher.enableMouseWheelEvents();
- }
+ if (vps == null)
+ return;
+
+ for (int i = 0; i < vps.length; i++) {
+ View[] views = vps[i].getViewList();
+ for (int j = views.length - 1; j >= 0; j--) {
+ Enumeration<Canvas3D> cvs = views[j].getAllCanvas3Ds();
+ while (cvs.hasMoreElements()) {
+ Canvas3D cv = cvs.nextElement();
+ // offscreen canvas does not have event catcher
+ if (cv.eventCatcher != null)
+ cv.eventCatcher.enableMouseWheelEvents();
}
}
}