package X3dForWebAuthors.Chapter05AppearanceMaterialTextures;

/*
Copyright (c) 1995-2019 held by the author(s).  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer
      in the documentation and/or other materials provided with the
      distribution.
    * Neither the name of the Web3D Consortium (http://www.web3D.org)
      nor the names of its contributors may be used to endorse or
      promote products derived from this software without specific
      prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

import java.util.*;
import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Geometry3D.*;
import org.web3d.x3d.jsail.Grouping.*;
import org.web3d.x3d.jsail.Interpolation.*;
import org.web3d.x3d.jsail.Rendering.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Texturing.*;
import org.web3d.x3d.jsail.Time.*;

// Javadoc annotations follow, see below for source.
/**
 * <p> This is a prototype for a CircleFish, which is also used by CircleFishLod. Default fish size: length is 1 m (Y-axis), max Height is 1 m (Z-axis), max Width is 10 cm (X-axis). </p>
 <p> Related links: <a href="../../../Chapter05AppearanceMaterialTextures/CircleFishPrototype.java">CircleFishPrototype.java</a> source, <a href="../../../Chapter05AppearanceMaterialTextures/CircleFishPrototypeIndex.html" target="_top">CircleFishPrototype catalog page</a>, <a href="http://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank">X3D Resources</a>, <a href="http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a>, and <a href="http://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank">X3D Tooltips</a>. </p>
	<table style="color:black; border:0px solid; border-spacing:10px 0px;" summary="Scene Metadata">
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center; padding:10px 0px;"><i>meta tags</i></td>
			<td style="text-align:left;   padding:10px 0px;">&nbsp; Document Metadata </td>
		</tr>

		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> title </i> </td>
			<td> <a href="../../../Chapter05AppearanceMaterialTextures/CircleFishPrototype.x3d">CircleFishPrototype.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> This is a prototype for a CircleFish, which is also used by CircleFishLod. Default fish size: length is 1 m (Y-axis), max Height is 1 m (Z-axis), max Width is 10 cm (X-axis). </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Ildeniz Duman </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> translator </i> </td>
			<td> Scott Tufts </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 1 May 1998 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> translated </i> </td>
			<td> 11 December 2001 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> modified </i> </td>
			<td> 1 April 2007 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://X3dGraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishPrototype.x3d" target="_blank">http://X3dGraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishPrototype.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> identifier </i> </td>
			<td> <a href="http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter05AppearanceMaterialTextures/CircleFishPrototype.x3d" target="_blank">http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter05AppearanceMaterialTextures/CircleFishPrototype.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> X3D-Edit 3.3, <a href="https://savage.nps.edu/X3D-Edit" target="_blank">https://savage.nps.edu/X3D-Edit</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> license </i> </td>
			<td> <a href="../../../Chapter05AppearanceMaterialTextures/../license.html">../license.html</a> </td>
		</tr>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center;" colspan="2">  &nbsp; </td>
		</tr>
	</table>

	<p>
		This program uses the
		<a href="http://www.web3d.org/specifications/java/X3DJSAIL.html" target="_blank">X3D Java Scene Access Interface Library (X3DJSAIL)</a>.
		It has been produced using the 
		<a href="http://www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">X3dToJava.xslt</a>
		stylesheet to create Java source code from an <code>.x3d</code> model.
	</p>

	* @author Ildeniz Duman
 */

public class CircleFishPrototype
{
	/** Default constructor to create this object. */
	public CircleFishPrototype ()
	{
	  initialize();
	}

	/** Create and initialize the X3D model for this object. */
	public final void initialize()
	{
  x3dModel = new X3DObject().setProfile(X3DObject.PROFILE_IMMERSIVE).setVersion(X3DObject.VERSION_3_3)
  .setHead(new headObject()
    .addMeta(new metaObject().setName(metaObject.NAME_TITLE      ).setContent("CircleFishPrototype.x3d"))
    .addMeta(new metaObject().setName(metaObject.NAME_DESCRIPTION).setContent("This is a prototype for a CircleFish, which is also used by CircleFishLod. Default fish size: length is 1 m (Y-axis), max Height is 1 m (Z-axis), max Width is 10 cm (X-axis)."))
    .addMeta(new metaObject().setName(metaObject.NAME_CREATOR    ).setContent("Ildeniz Duman"))
    .addMeta(new metaObject().setName(metaObject.NAME_TRANSLATOR ).setContent("Scott Tufts"))
    .addMeta(new metaObject().setName(metaObject.NAME_CREATED    ).setContent("1 May 1998"))
    .addMeta(new metaObject().setName(metaObject.NAME_TRANSLATED ).setContent("11 December 2001"))
    .addMeta(new metaObject().setName(metaObject.NAME_MODIFIED   ).setContent("1 April 2007"))
    .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE  ).setContent("http://X3dGraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishPrototype.x3d"))
    .addMeta(new metaObject().setName(metaObject.NAME_IDENTIFIER ).setContent("http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter05AppearanceMaterialTextures/CircleFishPrototype.x3d"))
    .addMeta(new metaObject().setName(metaObject.NAME_GENERATOR  ).setContent("X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit"))
    .addMeta(new metaObject().setName(metaObject.NAME_LICENSE    ).setContent("../license.html")))
  .setScene(new SceneObject()
    .addChild(new ProtoDeclareObject("CircleFish").setName("CircleFish")
      .setProtoInterface(new ProtoInterfaceObject()
        .addField(new fieldObject().setName("skinTextureUrl").setType(fieldObject.TYPE_MFSTRING).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT))
        .addField(new fieldObject().setName("fishScale").setType(fieldObject.TYPE_SFVEC3F).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3fObject(1.0f,1.0f,1.0f)))
        .addField(new fieldObject().setName("fishColor").setType(fieldObject.TYPE_SFCOLOR).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColorObject(0.5f,0.5f,0.5f)))
        .addField(new fieldObject().setName("finColor").setType(fieldObject.TYPE_SFCOLOR).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColorObject(0.5f,0.5f,0.5f)))
        .addField(new fieldObject().setName("positionKey").setType(fieldObject.TYPE_MFFLOAT).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new float[] {0.0f,0.125f,0.25f,0.375f,0.5f,0.625f,0.750f,0.8751f}))
        .addField(new fieldObject().setName("positionKeyValue").setType(fieldObject.TYPE_MFVEC3F).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new MFVec3fObject(new MFVec3fObject(new float[] {1.5f,2.0f,0.0f,1.5f,0.0f,-1.0f,0.0f,-1.0f,-1.0f,-1.5f,0.0f,-1.0f,-1.5f,2.0f,0.0f,-1.5f,0.0f,1.0f,0.0f,-2.0f,1.0f,1.5f,0.0f,1.0f,1.5f,2.0f,0.0f}))))
        .addField(new fieldObject().setName("orientationKey").setType(fieldObject.TYPE_MFFLOAT).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new float[] {0.0f,0.25f,0.5f,0.750f,1.0f}))
        .addField(new fieldObject().setName("orientationKeyValue").setType(fieldObject.TYPE_MFROTATION).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new MFRotationObject(new MFRotationObject(new float[] {0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,-1.57f,0.0f,1.0f,0.0f,-3.14f,0.0f,1.0f,0.0f,-4.71f,0.0f,1.0f,0.0f,-6.28f}))))
        .addField(new fieldObject().setName("orbitTime").setType(fieldObject.TYPE_SFTIME).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(90)))
      .setProtoBody(new ProtoBodyObject()
        .addChild(new TransformObject("Way")
          .addChild(new TransformObject().setRotation(1.0f,0.0f,0.0f,1.395f)
            .addChild(new TransformObject("FishTransform")
              .setIS(new ISObject()
                .addConnect(new connectObject().setNodeField("scale").setProtoField("fishScale")))
              .addChild(new ShapeObject()
                .setAppearance(new AppearanceObject()
                  .setMaterial(new MaterialObject("FishColor")
                    .setIS(new ISObject()
                      .addConnect(new connectObject().setNodeField("diffuseColor").setProtoField("fishColor"))))
                  .setTexture(new ImageTextureObject("FishTexture")
                    .setIS(new ISObject()
                      .addConnect(new connectObject().setNodeField("url").setProtoField("skinTextureUrl")))))
                .setGeometry(new ExtrusionObject("FishBodyExtrusion").setCreaseAngle(0.57f).setCrossSection(new MFVec2fObject(new float[] {-0.1f,1.0f,0.1f,1.0f,0.5f,0.5f,0.5f,-0.5f,0.1f,-1.0f,-0.1f,-1.0f,-0.5f,-0.5f,-0.5f,0.5f,-0.1f,1.0f})).setScale(new MFVec2fObject(new float[] {0.03f,0.03f,0.05f,0.3f,0.05f,0.45f,0.1f,0.5f,0.05f,0.45f,0.05f,0.2f,0.03f,0.4f})).setSpine(new MFVec3fObject(new float[] {0.0f,1.0f,0.0f,0.0f,0.8f,0.0f,0.0f,0.6f,0.0f,0.0f,0.5f,0.0f,0.0f,0.3f,0.0f,0.0f,0.2f,0.0f,0.0f,0.0f,0.0f}))))
              .addChild(new ShapeObject()
                .setAppearance(new AppearanceObject("FinSkin")
                  .setMaterial(new MaterialObject("FinColor").setTransparency(0.2f)
                    .setIS(new ISObject()
                      .addConnect(new connectObject().setNodeField("diffuseColor").setProtoField("finColor"))))))
              .addChild(new TransformObject().setTranslation(0.015f,0.8f,-0.2f)
                .addChild(new ShapeObject("Eye")
                  .setAppearance(new AppearanceObject()
                    .setMaterial(new MaterialObject().setDiffuseColor(0.5f,0.5f,0.5f).setShininess(1f).setSpecularColor(0.3f,0.3f,0.3f)))
                  .setGeometry(new SphereObject().setRadius(0.03f))))
              .addChild(new TransformObject().setTranslation(-0.015f,0.8f,-0.2f)
                .addChild(new ShapeObject().setUSE("Eye")))
              .addChild(new TransformObject().setScale(1.0f,1.0f,0.7f).setTranslation(0.0f,0.98f,0.0f)
                .addChild(new ShapeObject().setUSE("Eye")))
              .addChild(new TransformObject("LeftPectoral").setTranslation(0.04f,0.4f,0.3f)
                .addChild(new ShapeObject()
                  .setAppearance(new AppearanceObject().setUSE("FinSkin"))
                  .setGeometry(new IndexedFaceSetObject().setSolid(false).setCoordIndex(new int[] {0,1,2,-1})
                    .setCoord(new CoordinateObject().setPoint(new MFVec3fObject(new float[] {0.0f,0.0f,0.0f,0.0f,0.2f,0.0f,0.2f,0.1f,0.0f}))))))
              .addChild(new TransformObject("RightPectoral").setTranslation(-0.04f,0.4f,0.3f)
                .addChild(new ShapeObject()
                  .setAppearance(new AppearanceObject().setUSE("FinSkin"))
                  .setGeometry(new IndexedFaceSetObject().setSolid(false).setCoordIndex(new int[] {0,1,2,-1})
                    .setCoord(new CoordinateObject().setPoint(new MFVec3fObject(new float[] {0.0f,0.0f,0.0f,0.0f,0.2f,0.0f,-0.2f,0.1f,0.0f}))))))))
          .addChild(new GroupObject("AnimationGroup")
            .addChild(new TimeSensorObject("Timer").setCycleInterval(5).setLoop(true))
            .addChild(new CoordinateInterpolatorObject("Waggler").setKey(new float[] {0.0f,0.15f,0.28f,0.4f,0.55f,0.7f,0.85f,1.0f}).setKeyValue(new MFVec3fObject(new float[] {0.0f,1.0f,0.0f,0.0f,0.8f,0.0f,0.0f,0.6f,0.0f,0.0f,0.5f,0.0f,0.0f,0.3f,0.0f,0.0f,0.2f,0.0f,0.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.8f,0.0f,0.0f,0.6f,0.0f,0.0f,0.5f,0.0f,0.05f,0.3f,0.0f,0.1f,0.2f,0.0f,0.2f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.8f,0.0f,0.0f,0.6f,0.0f,0.0f,0.5f,0.0f,0.0f,0.3f,0.0f,0.0f,0.2f,0.0f,0.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.8f,0.0f,0.0f,0.6f,0.0f,0.0f,0.5f,0.0f,-0.05f,0.3f,0.0f,-0.1f,0.2f,0.0f,-0.2f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.8f,0.0f,0.0f,0.6f,0.0f,0.0f,0.5f,0.0f,0.0f,0.3f,0.0f,0.0f,0.2f,0.0f,0.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.8f,0.0f,0.0f,0.6f,0.0f,0.0f,0.5f,0.0f,0.05f,0.3f,0.0f,0.1f,0.2f,0.0f,0.2f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.8f,0.0f,0.0f,0.6f,0.0f,0.0f,0.5f,0.0f,0.0f,0.3f,0.0f,0.0f,0.2f,0.0f,0.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.8f,0.0f,0.0f,0.6f,0.0f,0.0f,0.5f,0.0f,0.0f,0.3f,0.0f,0.0f,0.2f,0.0f,0.0f,0.0f,0.0f})))
            .addChild(new ROUTEObject().setFromNode("Timer").setFromField("fraction_changed").setToNode("Waggler").setToField("set_fraction"))
            .addChild(new ROUTEObject().setFromNode("Waggler").setFromField("value_changed").setToNode("FishBodyExtrusion").setToField("set_spine"))
            .addChild(new OrientationInterpolatorObject("LeftPectoralRotation").setKey(new float[] {0.0f,0.3f,0.7f,1.0f}).setKeyValue(new MFRotationObject(new float[] {0.0f,1.0f,0.0f,-.349f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,-.349f})))
            .addChild(new ROUTEObject().setFromNode("Timer").setFromField("fraction_changed").setToNode("LeftPectoralRotation").setToField("set_fraction"))
            .addChild(new ROUTEObject().setFromNode("LeftPectoralRotation").setFromField("value_changed").setToNode("LeftPectoral").setToField("set_rotation"))
            .addChild(new OrientationInterpolatorObject("RightPectoralRotation").setKey(new float[] {0.0f,0.3f,0.7f,1.0f}).setKeyValue(new MFRotationObject(new float[] {0.0f,1.0f,0.0f,.349f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,.349f})))
            .addChild(new ROUTEObject().setFromNode("Timer").setFromField("fraction_changed").setToNode("RightPectoralRotation").setToField("set_fraction"))
            .addChild(new ROUTEObject().setFromNode("RightPectoralRotation").setFromField("value_changed").setToNode("RightPectoral").setToField("set_rotation"))
            .addChild(new TimeSensorObject("OrbitClock").setLoop(true)
              .setIS(new ISObject()
                .addConnect(new connectObject().setNodeField("cycleInterval").setProtoField("orbitTime"))))
            .addChild(new PositionInterpolatorObject("CirclefishPath")
              .setIS(new ISObject()
                .addConnect(new connectObject().setNodeField("key").setProtoField("positionKey"))
                .addConnect(new connectObject().setNodeField("keyValue").setProtoField("positionKeyValue"))))
            .addChild(new OrientationInterpolatorObject("CircleFishAngle")
              .setIS(new ISObject()
                .addConnect(new connectObject().setNodeField("key").setProtoField("orientationKey"))
                .addConnect(new connectObject().setNodeField("keyValue").setProtoField("orientationKeyValue"))))
            .addChild(new ROUTEObject().setFromNode("OrbitClock").setFromField("fraction_changed").setToNode("CirclefishPath").setToField("set_fraction"))
            .addChild(new ROUTEObject().setFromNode("OrbitClock").setFromField("fraction_changed").setToNode("CircleFishAngle").setToField("set_fraction"))
            .addChild(new ROUTEObject().setFromNode("CirclefishPath").setFromField("value_changed").setToNode("Way").setToField("set_translation"))
            .addChild(new ROUTEObject().setFromNode("CircleFishAngle").setFromField("value_changed").setToNode("Way").setToField("set_rotation"))))))
    .addComments(" ==================== ")
    .addChild(new ProtoInstanceObject("CircleFish")));
    }
	// end of initialize() method

	/** The initialized model object, created within initialize() method. */
	private X3DObject x3dModel;

	/** Provide a 
	 * <a href="https://dzone.com/articles/java-copy-shallow-vs-deep-in-which-you-will-swim" target="_blank">shallow copy</a>
	 * of the X3D model.
	 * @see <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3DObject.html">X3DObject</a>
	 * @return CircleFishPrototype model
	 */
	public X3DObject getX3dModel()
	{	  
		return x3dModel;
	}
	   
    /** Default main() method provided for test purposes, uses CommandLine to set global ConfigurationProperties for this object.
     * @param args array of input parameters, provided as arguments
	 * @see <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3DObject.html#handleArguments-java.lang.String:A-">X3DObject.handleArguments(args)</a>
	 * @see <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3DObject.html#validationReport--">X3DObject.validationReport()</a>
     * @see <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html">CommandLine</a>
     * @see <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html#USAGE">CommandLine.USAGE</a>
     * @see <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/ConfigurationProperties.html">ConfigurationProperties</a>
     */
    public static void main(String args[])
    {
        X3DObject thisExampleX3dObject = new CircleFishPrototype().getX3dModel();

		boolean hasArguments = (args != null) && (args.length > 0);
		boolean validate = true; // default
		boolean argumentsLoadNewModel = false;
		String  fileName = new String();

		if (args != null)
		{
			for (String arg : args)
			{
				if (arg.toLowerCase().startsWith("-v") || arg.toLowerCase().contains("validate"))
				{
					validate = true; // making sure
				}
				if (arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_X3D) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_CLASSICVRML) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_X3DB) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_VRML97) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_EXI) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_GZIP) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_ZIP) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_HTML) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_XHTML))
				{
					argumentsLoadNewModel = true;
					fileName = arg;
				}
			}
		}
		if      (argumentsLoadNewModel)
			System.out.println("WARNING: \"CircleFishPrototype\" model invocation is attempting to load file \"" + fileName + "\" instead of simply validating itself... file loading ignored.");
		else if (hasArguments) // if no arguments provided, this method produces usage warning
			thisExampleX3dObject.handleArguments(args);

		if (validate)
		{
			System.out.print("Java program \"CircleFishPrototype\" self-validation test results: ");
			String validationResults = thisExampleX3dObject.validationReport();
			System.out.println(validationResults);
		}
    }
}
