From 9483697b1d9b63974b716916ccd32bc6a0b8c0b4 Mon Sep 17 00:00:00 2001
From: hoijui <hoijui.quaero@gmail.com>
Date: Mon, 21 Feb 2011 13:38:23 +0100
Subject: [PATCH] fixes for ViewMap The 3D canvas was not added to the JFrame.

---
 .../hyperassociativemap/visualization/ViewMap.java | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/syncleus/dann/examples/hyperassociativemap/visualization/ViewMap.java b/src/main/java/com/syncleus/dann/examples/hyperassociativemap/visualization/ViewMap.java
index 5e190e4..524dfe0 100644
--- a/src/main/java/com/syncleus/dann/examples/hyperassociativemap/visualization/ViewMap.java
+++ b/src/main/java/com/syncleus/dann/examples/hyperassociativemap/visualization/ViewMap.java
@@ -67,15 +67,18 @@ public class ViewMap extends JFrame implements ActionListener, WindowListener, K
 		}
 		catch (ComponentUnavailableException exc)
 		{
+			myMapVisual = null;
 			this.add(exc.newPanel());
 		}
 		this.mapVisual = myMapVisual;
+		if (this.mapVisual != null) {
+			this.add(this.mapVisual);
+		}
 
 		this.addWindowListener(this);
 		this.setFocusTraversalKeysEnabled(false);
 
 		this.setSize(800, 600);
-
 	}
 
 	@Override
@@ -188,22 +191,27 @@ public class ViewMap extends JFrame implements ActionListener, WindowListener, K
 
 	private static boolean checkClasses()
 	{
+		// This class does not exist in Java3D 1.3.1, so we can not use this
+		// test. Fortunately, it will still fail gracefully later, if Java3D
+		// is not is installed properly.
+		/*
 		try
 		{
 			Class.forName("javax.media.j3d.NativePipeline");
 		}
 		catch (ClassNotFoundException caughtException)
 		{
-			System.out.println("java3D library isnt in classpath!");
+			System.out.println("Java3D library is not in classpath!");
 			return false;
 		}
+		*/
 
 		return true;
 	}
 
 	public static void main(final String[] args)
 	{
-		//check that the java3D drivers are present
+		// check that the Java3D drivers are present
 		if (!checkClasses())
 		{
 			return;
-- 
GitLab