Skip to content
Snippets Groups Projects
Commit 02ecc599 authored by Terry D. Norbraten's avatar Terry D. Norbraten
Browse files

[Terry N.] implement new fields value getter

parent 16c714d8
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,9 @@ import org.web3d.vrml.nodes.VRMLSingleExternalNodeType; ...@@ -26,7 +26,9 @@ import org.web3d.vrml.nodes.VRMLSingleExternalNodeType;
import org.web3d.vrml.nodes.VRMLFieldData; import org.web3d.vrml.nodes.VRMLFieldData;
import org.web3d.vrml.nodes.VRMLUrlListener; import org.web3d.vrml.nodes.VRMLUrlListener;
import org.web3d.vrml.nodes.VRMLContentStateListener; import org.web3d.vrml.nodes.VRMLContentStateListener;
import org.web3d.vrml.renderer.common.nodes.BaseTexture2DNode; import org.web3d.vrml.renderer.common.nodes.BaseTexture2DNode;
import org.web3d.vrml.util.URLChecker; import org.web3d.vrml.util.URLChecker;
/** /**
...@@ -129,17 +131,14 @@ public class BaseImageTexture extends BaseTexture2DNode ...@@ -129,17 +131,14 @@ public class BaseImageTexture extends BaseTexture2DNode
new VRMLFieldDeclaration(FieldConstants.FIELD, new VRMLFieldDeclaration(FieldConstants.FIELD,
"SFNode", "SFNode",
"textureProperties"); "textureProperties");
fieldDecl[FIELD_AUTOREFRESH] = fieldDecl[FIELD_AUTOREFRESH] =
new VRMLFieldDeclaration(FieldConstants.FIELD, new VRMLFieldDeclaration(FieldConstants.FIELD,
"SFTime", "SFTime",
"autoRefresh"); "autoRefresh");
fieldDecl[FIELD_AUTOREFRESHTIMELIMIT] = fieldDecl[FIELD_AUTOREFRESHTIMELIMIT] =
new VRMLFieldDeclaration(FieldConstants.FIELD, new VRMLFieldDeclaration(FieldConstants.FIELD,
"SFTime", "SFTime",
"autoRefreshTimeLimit"); "autoRefreshTimeLimit");
fieldDecl[FIELD_LOAD] = fieldDecl[FIELD_LOAD] =
new VRMLFieldDeclaration(FieldConstants.FIELD, new VRMLFieldDeclaration(FieldConstants.FIELD,
"SFBool", "SFBool",
...@@ -159,7 +158,7 @@ public class BaseImageTexture extends BaseTexture2DNode ...@@ -159,7 +158,7 @@ public class BaseImageTexture extends BaseTexture2DNode
fieldMap.put("repeatS", FIELD_REPEATS); fieldMap.put("repeatS", FIELD_REPEATS);
fieldMap.put("repeatT", FIELD_REPEATT); fieldMap.put("repeatT", FIELD_REPEATT);
fieldMap.put("textureProperties", FIELD_TEXTURE_PROPERTIES); fieldMap.put("textureProperties", FIELD_TEXTURE_PROPERTIES);
fieldMap.put("autoRefresh",FIELD_AUTOREFRESH); fieldMap.put("autoRefresh",FIELD_AUTOREFRESH);
fieldMap.put("autoRefreshTimeLimit",FIELD_AUTOREFRESHTIMELIMIT); fieldMap.put("autoRefreshTimeLimit",FIELD_AUTOREFRESHTIMELIMIT);
fieldMap.put("load",FIELD_LOAD); fieldMap.put("load",FIELD_LOAD);
...@@ -219,7 +218,7 @@ public class BaseImageTexture extends BaseTexture2DNode ...@@ -219,7 +218,7 @@ public class BaseImageTexture extends BaseTexture2DNode
index = node.getFieldIndex("load"); index = node.getFieldIndex("load");
field = node.getFieldValue(index); field = node.getFieldValue(index);
vfLoad = field.booleanValue; vfLoad = field.booleanValue;
} }
catch(VRMLException ve) { catch(VRMLException ve) {
throw new IllegalArgumentException(ve.getMessage()); throw new IllegalArgumentException(ve.getMessage());
} }
...@@ -292,7 +291,7 @@ public class BaseImageTexture extends BaseTexture2DNode ...@@ -292,7 +291,7 @@ public class BaseImageTexture extends BaseTexture2DNode
fireFieldChanged(FIELD_LOAD); fireFieldChanged(FIELD_LOAD);
} }
} }
/** /**
* Get a string for caching this object. Null means do not cache this * Get a string for caching this object. Null means do not cache this
* texture. * texture.
...@@ -365,7 +364,7 @@ public class BaseImageTexture extends BaseTexture2DNode ...@@ -365,7 +364,7 @@ public class BaseImageTexture extends BaseTexture2DNode
public void setWorldUrl(String url) { public void setWorldUrl(String url) {
if((url == null) || (url.isEmpty())) if((url == null) || (url.isEmpty()))
return; return;
worldURL = url; worldURL = url;
} }
...@@ -417,7 +416,7 @@ public class BaseImageTexture extends BaseTexture2DNode ...@@ -417,7 +416,7 @@ public class BaseImageTexture extends BaseTexture2DNode
return vfURL; return vfURL;
} }
//---------------------------------------------------------- //----------------------------------------------------------
// Methods overriding BaseTexture2DNode abstract class. // Methods overriding BaseTexture2DNode abstract class.
//---------------------------------------------------------- //----------------------------------------------------------
...@@ -634,17 +633,24 @@ public class BaseImageTexture extends BaseTexture2DNode ...@@ -634,17 +633,24 @@ public class BaseImageTexture extends BaseTexture2DNode
@Override @Override
public VRMLFieldData getFieldValue(int index) throws InvalidFieldException { public VRMLFieldData getFieldValue(int index) throws InvalidFieldException {
VRMLFieldData fieldData = fieldLocalData.get(); VRMLFieldData fieldData = fieldLocalData.get();
fieldData.clear();
switch(index) { switch(index) {
case FIELD_URL: case FIELD_URL:
fieldData.clear();
fieldData.stringArrayValues = vfURL; fieldData.stringArrayValues = vfURL;
fieldData.dataType = VRMLFieldData.STRING_ARRAY_DATA; fieldData.dataType = VRMLFieldData.STRING_ARRAY_DATA;
fieldData.numElements = vfURL.length; fieldData.numElements = vfURL.length;
break; break;
case FIELD_AUTOREFRESH:
fieldData.doubleValue = vfAutoRefresh;
fieldData.dataType = VRMLFieldData.DOUBLE_DATA;
break;
case FIELD_AUTOREFRESHTIMELIMIT:
fieldData.doubleValue = vfAutoRefreshTimeLimit;
fieldData.dataType = VRMLFieldData.DOUBLE_DATA;
break;
default: default:
return(super.getFieldValue(index)); return super.getFieldValue(index);
} }
return fieldData; return fieldData;
...@@ -723,7 +729,7 @@ public class BaseImageTexture extends BaseTexture2DNode ...@@ -723,7 +729,7 @@ public class BaseImageTexture extends BaseTexture2DNode
public void setValue(int index, double value) public void setValue(int index, double value)
throws InvalidFieldException { throws InvalidFieldException {
switch(index) switch(index)
{ {
case FIELD_AUTOREFRESH: case FIELD_AUTOREFRESH:
setAutoRefresh(value); setAutoRefresh(value);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment