summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2013-04-19 00:35:51 -0700
committerHarvey Harrison <[email protected]>2013-04-19 00:37:01 -0700
commit318fca9cc13dce964ad73db033d77049d5aae663 (patch)
tree062122da2920e4e48c4b5b9048cf28403fe0e3de /src
parent4c8ff2eede274d496f1cdc263511463dbff17ee9 (diff)
j3dcore: add type information to userlist in ImageComponentRetained
- no need to synchronize on userlist, all access methods are already synchronized - add an early return to unindent a bunch of code - impossible to get a BackGroundRetained here, kill that else branch Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/classes/share/javax/media/j3d/ImageComponentRetained.java47
1 files changed, 21 insertions, 26 deletions
diff --git a/src/classes/share/javax/media/j3d/ImageComponentRetained.java b/src/classes/share/javax/media/j3d/ImageComponentRetained.java
index 56122e2..c38863f 100644
--- a/src/classes/share/javax/media/j3d/ImageComponentRetained.java
+++ b/src/classes/share/javax/media/j3d/ImageComponentRetained.java
@@ -146,10 +146,10 @@ abstract class ImageComponentRetained extends NodeComponentRetained {
int numXTiles = 0;
int numYTiles = 0;
- // lists of Node Components that are referencing this ImageComponent
- // object. This list is used to notify the referencing node components
- // of any changes of this ImageComponent.
- ArrayList userList = new ArrayList();
+// lists of Node Components that are referencing this ImageComponent
+// object. This list is used to notify the referencing node components
+// of any changes of this ImageComponent.
+private ArrayList<NodeComponentRetained> userList = new ArrayList<NodeComponentRetained>();
/**
* Retrieves the width of this image component object.
@@ -2161,28 +2161,23 @@ abstract class ImageComponentRetained extends NodeComponentRetained {
* the changes to the users
*/
synchronized void updateMirrorObject(int component, Object value) {
-
- //System.err.println("ImageComponent.updateMirrorObject");
-
- Object user;
-
- if (((component & IMAGE_CHANGED) != 0) ||
- ((component & SUBIMAGE_CHANGED) != 0)) {
- synchronized(userList) {
- for (int i = userList.size()-1; i >=0; i--) {
- user = userList.get(i);
- if (user != null) {
- if (user instanceof TextureRetained) {
- ((TextureRetained)user).notifyImageComponentImageChanged(this, (ImageComponentUpdateInfo)value);
- } else if (user instanceof RasterRetained) {
- ((RasterRetained)user).notifyImageComponentImageChanged(this, (ImageComponentUpdateInfo)value);
- } else if (user instanceof BackgroundRetained) {
- ((BackgroundRetained)user).notifyImageComponentImageChanged(this, (ImageComponentUpdateInfo)value);
- }
- }
- }
- }
- }
+ // System.err.println("ImageComponent.updateMirrorObject");
+ if ((component & IMAGE_CHANGED) == 0 &&
+ (component & SUBIMAGE_CHANGED) == 0)
+ return;
+
+ for (int i = userList.size() - 1; i >= 0; i--) {
+ NodeComponentRetained user = userList.get(i);
+ if (user == null)
+ continue;
+
+ if (user instanceof TextureRetained) {
+ ((TextureRetained)user).notifyImageComponentImageChanged(this, (ImageComponentUpdateInfo)value);
+ }
+ else if (user instanceof RasterRetained) {
+ ((RasterRetained)user).notifyImageComponentImageChanged(this, (ImageComponentUpdateInfo)value);
+ }
+ }
}
final void sendMessage(int attrMask, Object attr) {