package Savage.Tools.Visualization;

import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.EnvironmentalEffects.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Grouping.*;
import org.web3d.x3d.jsail.Lighting.*;
import org.web3d.x3d.jsail.Navigation.*;

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * <p> Reverse engineer and hopefully elaborate on Pajek visualization structures. </p>
 <p> Related links: Catalog page <a href="../../../../Tools/Visualization/PajekVisualizationExamplesIndex.html" target="_blank">PajekVisualizationExamples</a>,  source <a href="../../../../Tools/Visualization/PajekVisualizationExamples.java">PajekVisualizationExamples.java</a>, <a href="https://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank">X3D Resources</a>, <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a>, and <a href="https://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank">X3D Tooltips</a>. </p>
	<table style="color:black; border:0px solid; border-spacing:10px 0px;">
        <caption>Scene Meta Information</caption>
		<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="../../../../Tools/Visualization/PajekVisualizationExamples.x3d">PajekVisualizationExamples.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> Reverse engineer and hopefully elaborate on Pajek visualization structures </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Don Brutzman and Elaine Reid </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 17 May 2011 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> modified </i> </td>
			<td> 25 September 2023 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://pajek.imfm.si" target="_blank">http://pajek.imfm.si</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> subject </i> </td>
			<td> network visualization </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> identifier </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/Savage/Tools/Visualization/PajekVisualizationExamples.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/Tools/Visualization/PajekVisualizationExamples.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> X3D-Edit, <a href="https://www.web3d.org/x3d/tools/X3D-Edit" target="_blank">https://www.web3d.org/x3d/tools/X3D-Edit</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> license </i> </td>
			<td> <a href="../../../../Tools/Visualization/../../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="https://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="https://www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">X3dToJava.xslt</a>
		stylesheet
	       (<a href="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">version control</a>)
                which is used to create Java source code from an original <code>.x3d</code> model.
	</p>

	* @author Don Brutzman and Elaine Reid
 */

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

	/** Create and initialize the X3D model for this object. */
	public final void initialize()
	{
            try { // catch-all
  x3dModel = new X3D().setProfile(X3D.PROFILE_IMMERSIVE).setVersion(X3D.VERSION_3_2)
  .setHead(new head()
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("PajekVisualizationExamples.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("Reverse engineer and hopefully elaborate on Pajek visualization structures"))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("Don Brutzman and Elaine Reid"))
    .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("17 May 2011"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("25 September 2023"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://pajek.imfm.si"))
    .addMeta(new meta().setName(meta.NAME_SUBJECT    ).setContent("network visualization"))
    .addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/Savage/Tools/Visualization/PajekVisualizationExamples.x3d"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("X3D-Edit, https://www.web3d.org/x3d/tools/X3D-Edit"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../../license.html")))
  .setScene(new Scene()
    .addChild(new WorldInfo().setTitle("PajekVisualizationExamples.x3d"))
    .addChild(new ExternProtoDeclare("Arc").setName("Arc").setAppinfo("Arc is a network connection between Vertex nodes, displayed using Cylinder/Cone (arrow/arrowhead) geometry with modifiable color and transparency").setUrl(new String[] {"PajekVisualizationPrototypes.x3d#Arc","https://www.web3d.org/x3d/content/examples/Savage/Tools/Visualization/PajekVisualizationPrototypes.x3d#Arc"})
      .addField(new field().setName("name").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("name to identify this Arc"))
      .addField(new field().setName("description").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("popup text describing this Arc"))
      .addField(new field().setName("cylinderHeight").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("length of Arc between Vertex locations"))
      .addField(new field().setName("url").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("link to some other resource"))
      .addField(new field().setName("cylinderTranslation").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("location of Arc"))
      .addField(new field().setName("coneTranslation").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("see TODO items in ArcScript"))
      .addField(new field().setName("rotation").setType(field.TYPE_SFROTATION).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("orientation of Arc"))
      .addField(new field().setName("displayMode").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("rendering choices: BallAndStick, Ball, Stick"))
      .addField(new field().setName("diffuseColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("diffuseColor of Arc"))
      .addField(new field().setName("transparency").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("transparency of Arc"))
      .addField(new field().setName("ballRadius").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("offset distance for Cone arrowhead; TODO this needs to match values in the Vertex protopye, which is iniitialized separately"))
      .addField(new field().setName("traceEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("debug trace to Browser output console")))
    .addComments(" Add any ROUTEs here that connect ProtoInstance to/from prior nodes in Scene (and outside of ProtoDeclare) ")
    .addComments(" Default values for fieldValue types instead of for the Prototype ")
    .addComments(" Add any ROUTEs here that connect ProtoInstance to/from prior nodes in Scene (and outside of ProtoDeclare) ")
    .addChild(new ExternProtoDeclare("Vertex").setName("Vertex").setAppinfo("Vertex is a node, typically connected by zero or more Arc segments, and displayed using Sphere geometry with modifiable color and transparency").setUrl(new String[] {"PajekVisualizationPrototypes.x3d#Vertex","https://www.web3d.org/x3d/content/examples/Savage/Tools/Visualization/PajekVisualizationPrototypes.x3d#Vertex"})
      .addField(new field().setName("name").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("name to identify this Vertex"))
      .addField(new field().setName("description").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("popup text describing this Vertex"))
      .addField(new field().setName("url").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("link to some other resource"))
      .addField(new field().setName("radius").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("size of Vertex ball"))
      .addField(new field().setName("displayMode").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("rendering choices: BallAndStick, Ball, Stick"))
      .addField(new field().setName("diffuseColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("diffuseColor of Vertex"))
      .addField(new field().setName("transparency").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("transparency of Vertex"))
      .addField(new field().setName("translation").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("location of Vertex"))
      .addField(new field().setName("vertexText").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("labels to identify Vertex"))
      .addField(new field().setName("textTranslation").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("location of Text"))
      .addField(new field().setName("textColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("diffuseColor of Text")))
    .addChild(new ProtoInstance("Vertex").setContainerField("children")
      .addFieldValue(new fieldValue().setName("name"))
      .addFieldValue(new fieldValue().setName("description"))
      .addFieldValue(new fieldValue().setName("radius").setValue(0.0))
      .addFieldValue(new fieldValue().setName("displayMode"))
      .addFieldValue(new fieldValue().setName("diffuseColor").setValue(new SFColor(0.0,0.0,0.0)))
      .addFieldValue(new fieldValue().setName("transparency").setValue(0))
      .addFieldValue(new fieldValue().setName("translation").setValue(new SFVec3f(0.0,0.0,0.0)))
      .addFieldValue(new fieldValue().setName("textTranslation").setValue(new SFVec3f(0.0,0.0,0.0)))
      .addFieldValue(new fieldValue().setName("textColor").setValue(new SFColor(0.0,0.0,0.0))))
    .addComments(" Add any ROUTEs here that connect ProtoInstance to/from prior nodes in Scene (and outside of ProtoDeclare) ")
    .addChild(new ExternProtoDeclare("NetworkText").setName("NetworkText").setAppinfo("Text describing what the Vertices and Arcs are about").setUrl(new String[] {"PajekVisualizationPrototypes.x3d#NetworkText","https://www.web3d.org/x3d/content/examples/Savage/Tools/Visualization/PajekVisualizationPrototypes.x3d#NetworkText"})
      .addField(new field().setName("text").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("information to identify the Integral Network")))
    .addChild(new ProtoInstance("NetworkText").setContainerField("children"))
    .addComments(" Add any ROUTEs here that connect ProtoInstance to/from prior nodes in Scene (and outside of ProtoDeclare) ")
    .addChild(new Background().setGroundAngle(new double[] {1.309,1.570796}).setGroundColor(new MFColor(new double[] {0.0,0.5,0.7,0.0,0.4,0.7,0.6,0.5,0.7})).setSkyAngle(new double[] {1.309,1.571}).setSkyColor(new MFColor(new double[] {0.0,0.5,0.8,0.0,0.6,0.7,0.6,0.6,0.7})))
    .addChild(new PointLight().setAmbientIntensity(1).setLocation(0.0,0.0,5.0).setRadius(30))
    .addChild(new NavigationInfo().setTransitionType(new String[] {"ANIMATE"}).setType(new String[] {"EXAMINE","FLY","ANY"}))
    .addChild(new Viewpoint().setDescription("Inspect 15JAN2010Newman").setOrientation(1.0,0.0,0.0,-0.0997).setPosition(0.0,2.0,20.0))
    .addComments(" type=\"3D\" <date day =\"3\" month=\"5\" year=\"2011\"/> ")
    .addChild(new Transform("infogroup").setTranslation(-8.0,2.0,-4.0)
      .addChild(new Transform("NetText").setTranslation(0.0,6.0,0.0)
        .addChild(new ProtoInstance("NetworkText").setContainerField("children")
          .addFieldValue(new fieldValue().setName("text").setValue(new String[] {"15JAN2010"})))))
    .addChild(new Group()
      .addChild(new Transform()
        .addChild(new ProtoInstance("Vertex").setContainerField("children")
          .addFieldValue(new fieldValue().setName("name").setValue("Vertex 1"))
          .addFieldValue(new fieldValue().setName("description").setValue("2010-01-15-ARMY.MIL"))
          .addFieldValue(new fieldValue().setName("radius").setValue(.1500))
          .addFieldValue(new fieldValue().setName("displayMode").setValue("BallAndStick"))
          .addFieldValue(new fieldValue().setName("diffuseColor").setValue(new SFColor(0.0,0.0,0.0)))
          .addFieldValue(new fieldValue().setName("transparency").setValue(0))
          .addFieldValue(new fieldValue().setName("translation").setValue(new SFVec3f(0.06344,-0.26178,-0.55101)))
          .addFieldValue(new fieldValue().setName("vertexText").setValue(new String[] {"2010-01-15-ARMY.MIL"}))
          .addFieldValue(new fieldValue().setName("textTranslation").setValue(new SFVec3f(0.06344,-0.26178,-0.55101)))
          .addFieldValue(new fieldValue().setName("textColor").setValue(new SFColor(0.0,0.0,0.0))))
        .addChild(new ProtoInstance("Arc").setContainerField("children")
          .addFieldValue(new fieldValue().setName("name").setValue("1.24"))
          .addFieldValue(new fieldValue().setName("description").setValue("From blah to blah"))
          .addFieldValue(new fieldValue().setName("url").setValue(new String[] {"http://www.google.com"}))
          .addFieldValue(new fieldValue().setName("cylinderHeight").setValue(0.64770))
          .addFieldValue(new fieldValue().setName("cylinderTranslation").setValue(new SFVec3f(-0.35062,-0.44066,-0.60713)))
          .addFieldValue(new fieldValue().setName("coneTranslation").setValue(new SFVec3f(-.48422,-.53116,-.63552)))
          .addFieldValue(new fieldValue().setName("rotation").setValue(new SFRotation(-11.22472,0.0,52.81325,2.15598)))
          .addFieldValue(new fieldValue().setName("displayMode").setValue("BallAndStick"))
          .addFieldValue(new fieldValue().setName("diffuseColor").setValue(new SFColor(0.0,0.0,0.0)))
          .addFieldValue(new fieldValue().setName("transparency").setValue(0))
          .addFieldValue(new fieldValue().setName("ballRadius").setValue(1)))
        .addChild(new ProtoInstance("Vertex").setContainerField("children")
          .addFieldValue(new fieldValue().setName("name").setValue("Vertex 2"))
          .addFieldValue(new fieldValue().setName("description").setValue("2010-01-15BLOGS.STATE.GOV-INDEX.PHP"))
          .addFieldValue(new fieldValue().setName("vertexText").setValue(new String[] {"2010-01-15BLOGS.STATE.GOV-INDEX.PHP"}))
          .addFieldValue(new fieldValue().setName("textTranslation").setValue(new SFVec3f(1.43526,1.19707,0.67279)))
          .addFieldValue(new fieldValue().setName("textColor").setValue(new SFColor(0.0,0.0,0.0)))
          .addFieldValue(new fieldValue().setName("url").setValue(new String[] {"http://www.state.gov"}))
          .addFieldValue(new fieldValue().setName("translation").setValue(new SFVec3f(1.28526,1.19707,0.67279)))
          .addFieldValue(new fieldValue().setName("radius").setValue(0.1500))
          .addFieldValue(new fieldValue().setName("displayMode").setValue("BallAndStick"))
          .addFieldValue(new fieldValue().setName("diffuseColor").setValue(new SFColor(0.5020,0.0,0.0)))
          .addFieldValue(new fieldValue().setName("transparency").setValue(0)))
        .addChild(new ProtoInstance("Arc").setContainerField("children")
          .addFieldValue(new fieldValue().setName("name").setValue("1.26"))
          .addFieldValue(new fieldValue().setName("description").setValue("From blah1 to blah1"))
          .addFieldValue(new fieldValue().setName("url").setValue(new String[] {"http://www.google.com"}))
          .addFieldValue(new fieldValue().setName("cylinderHeight").setValue(1.28361))
          .addFieldValue(new fieldValue().setName("cylinderTranslation").setValue(new SFVec3f(-0.12911,0.32068,-0.81718)))
          .addFieldValue(new fieldValue().setName("coneTranslation").setValue(new SFVec3f(-0.16106,0.75793,-1.01700)))
          .addFieldValue(new fieldValue().setName("rotation").setValue(new SFRotation(-53.23500,0.0,8.51149,0.43344)))
          .addFieldValue(new fieldValue().setName("displayMode").setValue("BallAndStick"))
          .addFieldValue(new fieldValue().setName("diffuseColor").setValue(new SFColor(0.0,0.0,0.0)))
          .addFieldValue(new fieldValue().setName("transparency").setValue(0))
          .addFieldValue(new fieldValue().setName("ballRadius").setValue(1)))
        .addChild(new ProtoInstance("Vertex").setContainerField("children")
          .addFieldValue(new fieldValue().setName("name").setValue("Vertex 3"))
          .addFieldValue(new fieldValue().setName("description").setValue("2010-01-15-FEEDS.FEEDBURNER.COM-DIPNOTE"))
          .addFieldValue(new fieldValue().setName("vertexText").setValue(new String[] {"2010-01-15-FEEDS.FEEDBURNER.COM-DIPNOTE"}))
          .addFieldValue(new fieldValue().setName("textColor").setValue(new SFColor(0.0,0.0,0.0)))
          .addFieldValue(new fieldValue().setName("textTranslation").setValue(new SFVec3f(0.08377,1.98542,-1.19849)))
          .addFieldValue(new fieldValue().setName("url").setValue(new String[] {"http://www.feedburner.com"}))
          .addFieldValue(new fieldValue().setName("translation").setValue(new SFVec3f(-0.06623,1.98542,-1.19849)))
          .addFieldValue(new fieldValue().setName("radius").setValue(.1500))
          .addFieldValue(new fieldValue().setName("displayMode").setValue("BallAndStick"))
          .addFieldValue(new fieldValue().setName("diffuseColor").setValue(new SFColor(1.0000,0.0,0.0)))
          .addFieldValue(new fieldValue().setName("transparency").setValue(0)))
        .addChild(new ProtoInstance("Arc").setContainerField("children")
          .addFieldValue(new fieldValue().setName("name").setValue("1.39"))
          .addFieldValue(new fieldValue().setName("description").setValue("From blah2 to blah2"))
          .addFieldValue(new fieldValue().setName("url").setValue(new String[] {"http://www.google.com"}))
          .addFieldValue(new fieldValue().setName("cylinderHeight").setValue(1.12537))
          .addFieldValue(new fieldValue().setName("cylinderTranslation").setValue(new SFVec3f(-0.35500,-0.38541,-1.02982)))
          .addFieldValue(new fieldValue().setName("coneTranslation").setValue(new SFVec3f(-0.54712,-0.47389,-1.37249)))
          .addFieldValue(new fieldValue().setName("rotation").setValue(new SFRotation(-95.76386,0.0,53.68924,1.79233)))
          .addFieldValue(new fieldValue().setName("displayMode").setValue("BallAndStick"))
          .addFieldValue(new fieldValue().setName("diffuseColor").setValue(new SFColor(0.0,0.0,0.0)))
          .addFieldValue(new fieldValue().setName("transparency").setValue(0))
          .addFieldValue(new fieldValue().setName("ballRadius").setValue(1))))));
            }
            catch (Exception ex)
            {       
                System.err.println ("*** Further hints on X3DJSAIL errors and exceptions at");
                System.err.println ("*** https://www.web3d.org/specifications/java/X3DJSAIL.html");
                throw (ex);
            }
	}
	// end of initialize() method

	/** The initialized model object, created within initialize() method. */
	private X3D 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="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html">X3D</a>
	 * @return PajekVisualizationExamples model
	 */
	public X3D 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="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html#handleArguments-java.lang.String:A-">X3D.handleArguments(args)</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html#validationReport--">X3D.validationReport()</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html">CommandLine</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html#USAGE">CommandLine.USAGE</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/ConfigurationProperties.html">ConfigurationProperties</a>
     */
    public static void main(String args[])
    {
        System.out.println("Build this X3D model, showing validation diagnostics...");
        X3D thisExampleX3dModel = new PajekVisualizationExamples().getX3dModel();
//      System.out.println("X3D model construction complete.");
	
        // next handle command line arguments
        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(X3D.FILE_EXTENSION_X3D) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_CLASSICVRML) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_X3DB) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_VRML97) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_EXI) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_GZIP) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_ZIP) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_HTML) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_XHTML))
                        {
                                argumentsLoadNewModel = true;
                                fileName = arg;
                        }
                }
        }
        if      (argumentsLoadNewModel)
                System.out.println("WARNING: \"Savage.Tools.Visualization.PajekVisualizationExamples\" 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
                thisExampleX3dModel.handleArguments(args);
	
        if (validate)
        {
            //  System.out.println("--- TODO fix duplicated outputs ---"); // omit when duplicated outputs problem is solved/refactored
		String validationResults = thisExampleX3dModel.validationReport();
            //  System.out.println("-----------------------------------"); // omit when duplicated outputs problem is solved/refactored
                System.out.print("Savage.Tools.Visualization.PajekVisualizationExamples self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

                // experimental: test X3DJSAIL output files
                // Tools/Visualization/PajekVisualizationExamples_JavaExport.* file validation is checked when building X3D Example Archives
                String filenameX3D  = "Tools/Visualization/PajekVisualizationExamples_JavaExport.x3d"; 
                String filenameX3DV = "Tools/Visualization/PajekVisualizationExamples_JavaExport.x3dv"; 
                String filenameJSON = "Tools/Visualization/PajekVisualizationExamples_JavaExport.json";
                thisExampleX3dModel.toFileX3D        (filenameX3D);
                thisExampleX3dModel.toFileClassicVRML(filenameX3DV);
// TODO         thisExampleX3dModel.toFileJSON       (filenameJSON);
        }
    }
}
