Commit Diff


commit - 72deef483a78424392f0521cbae2872aa9ab3419
commit + dd5b15d42d1c234d425ffe08bbc7b49091c2ff0a
blob - 4b30399351aaa5c667a68823a55e6360f7809c8a
blob + 5351f0b50c42a6e0ad2537eeb811bf12ff7bd10d
--- MePixel.iws
+++ MePixel.iws
@@ -16,7 +16,16 @@
     <option name="USER" value="" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" name="Default" comment="" />
+    <list default="true" name="Default" comment="">
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/thinkberg/mepixel/CameraGrabberThread.java" afterPath="$PROJECT_DIR$/src/com/thinkberg/mepixel/CameraGrabberThread.java" />
+      <change type="DELETED" beforePath="$PROJECT_DIR$/src/com/thinkberg/launcher" afterPath="" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/thinkberg/mepixel/MePixelLauncher.java" afterPath="$PROJECT_DIR$/src/com/thinkberg/mepixel/MePixelLauncher.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/thinkberg/mepixel/MePixel.java" afterPath="$PROJECT_DIR$/src/com/thinkberg/mepixel/MePixel.java" />
+      <change type="DELETED" beforePath="$PROJECT_DIR$/src/com/thinkberg/mepixel/CharDisplay.java" afterPath="" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/MePixel.iws" afterPath="$PROJECT_DIR$/MePixel.iws" />
+      <change type="DELETED" beforePath="$PROJECT_DIR$/src/com/thinkberg/launcher/Launcher.java" afterPath="" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/thinkberg/mepixel/BufferedDisplay.java" />
+    </list>
   </component>
   <component name="ChangeListSynchronizer" />
   <component name="ChangesViewManager" flattened_view="true" />
@@ -140,10 +149,10 @@
   </component>
   <component name="FileEditorManager">
     <leaf>
-      <file leaf-file-name="build.xml" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/build.xml">
+      <file leaf-file-name="MePixel.java" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/com/thinkberg/mepixel/MePixel.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="65" column="8" selection-start="2409" selection-end="2409" vertical-scroll-proportion="0.66493505">
+            <state line="21" column="3" selection-start="614" selection-end="614" vertical-scroll-proportion="0.17532468">
               <folding />
             </state>
           </provider>
@@ -152,27 +161,16 @@
       <file leaf-file-name="MePixelLauncher.java" pinned="false" current="true" current-in-tab="true">
         <entry file="file://$PROJECT_DIR$/src/com/thinkberg/mepixel/MePixelLauncher.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="53" column="56" selection-start="1815" selection-end="1815" vertical-scroll-proportion="1.1575">
-              <folding>
-                <element signature="imports" expanded="true" />
-              </folding>
-            </state>
-          </provider>
-        </entry>
-      </file>
-      <file leaf-file-name="Launcher.java" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/src/com/thinkberg/launcher/Launcher.java">
-          <provider selected="true" editor-type-id="text-editor">
-            <state line="70" column="8" selection-start="2736" selection-end="2736" vertical-scroll-proportion="0.9350649">
+            <state line="36" column="0" selection-start="1166" selection-end="1166" vertical-scroll-proportion="0.2353896">
               <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="mepixel.manifest" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/src/META-INF/mepixel.manifest">
+      <file leaf-file-name="BufferedDisplay.java" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/com/thinkberg/mepixel/BufferedDisplay.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="3" column="0" selection-start="126" selection-end="126" vertical-scroll-proportion="0.09">
+            <state line="18" column="13" selection-start="431" selection-end="431" vertical-scroll-proportion="0.2282092">
               <folding />
             </state>
           </provider>
@@ -278,14 +276,6 @@
           <option name="myItemId" value="Libraries" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.LibraryGroupNode" />
         </PATH_ELEMENT>
-        <PATH_ELEMENT>
-          <option name="myItemId" value="QTJava" />
-          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.NamedLibraryElementNode" />
-        </PATH_ELEMENT>
-        <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:/System/Library/Java/Extensions/QTJava.zip" />
-          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
-        </PATH_ELEMENT>
       </PATH>
       <PATH>
         <PATH_ELEMENT>
@@ -297,20 +287,6 @@
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="Libraries" />
-          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.LibraryGroupNode" />
-        </PATH_ELEMENT>
-      </PATH>
-      <PATH>
-        <PATH_ELEMENT>
-          <option name="myItemId" value="MePixel.ipr" />
-          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
-        </PATH_ELEMENT>
-        <PATH_ELEMENT>
-          <option name="myItemId" value="MePixel" />
-          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
-        </PATH_ELEMENT>
-        <PATH_ELEMENT>
           <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
@@ -402,10 +378,6 @@
           <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/src/com/thinkberg" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
-        <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/src/com/thinkberg/launcher" />
-          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
-        </PATH_ELEMENT>
       </PATH>
     </subPane>
   </component>
@@ -420,7 +392,7 @@
       <showLibraryContents />
       <hideEmptyPackages />
       <abbreviatePackageNames />
-      <showStructure ProjectPane="false" PackagesPane="false" Favorites="false" />
+      <showStructure Scope="false" ProjectPane="false" PackagesPane="false" Favorites="false" />
       <autoscrollToSource />
       <autoscrollFromSource />
       <sortByType />
@@ -465,19 +437,6 @@
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
       <option name="ALTERNATIVE_JRE_PATH" />
     </configuration>
-    <configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false">
-      <option name="MAIN_CLASS_NAME" />
-      <option name="VM_PARAMETERS" />
-      <option name="PROGRAM_PARAMETERS" />
-      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" />
-      <option name="ENABLE_SWING_INSPECTOR" value="false" />
-      <module name="" />
-      <method>
-        <option name="Make" value="true" />
-      </method>
-    </configuration>
     <configuration default="true" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
       <module name="" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -497,6 +456,19 @@
         <option name="Make" value="true" />
       </method>
     </configuration>
+    <configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false">
+      <option name="MAIN_CLASS_NAME" />
+      <option name="VM_PARAMETERS" />
+      <option name="PROGRAM_PARAMETERS" />
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH" />
+      <option name="ENABLE_SWING_INSPECTOR" value="false" />
+      <module name="" />
+      <method>
+        <option name="Make" value="true" />
+      </method>
+    </configuration>
     <configuration default="false" name="MePixel" type="Application" factoryName="Application" enabled="false" merge="false">
       <option name="MAIN_CLASS_NAME" value="com.thinkberg.mepixel.MePixel" />
       <option name="VM_PARAMETERS" value="" />
@@ -540,7 +512,16 @@
       </method>
     </configuration>
   </component>
-  <component name="ScopeViewComponent" />
+  <component name="ScopeViewComponent">
+    <subPane subId="Project">
+      <PATH>
+        <PATH_ELEMENT USER_OBJECT="Root">
+          <option name="myItemId" value="" />
+          <option name="myItemType" value="" />
+        </PATH_ELEMENT>
+      </PATH>
+    </subPane>
+  </component>
   <component name="SelectInManager" />
   <component name="StarteamConfiguration">
     <option name="SERVER" value="" />
@@ -589,6 +570,7 @@
     <option name="UPDATE_RUN_STATUS" value="false" />
     <option name="UPDATE_RECURSIVELY" value="true" />
     <option name="MERGE_DRY_RUN" value="false" />
+    <configuration useDefault="true">/Users/leo/.subversion</configuration>
     <upgradeMode>auto</upgradeMode>
   </component>
   <component name="TodoView" selected-index="0">
@@ -617,13 +599,13 @@
       <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24938875" order="0" />
       <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32892805" order="1" />
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="1" />
-      <window_info id="Messages" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32892805" order="8" />
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32892805" order="8" />
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="6" />
       <window_info id="Profile" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
       <window_info id="Module Dependencies" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
       <window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
       <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
-      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.12224939" order="1" />
+      <window_info id="Ant Build" active="true" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.12224939" order="1" />
       <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
       <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32892805" order="2" />
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="2" />
@@ -661,7 +643,7 @@
     <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
     <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
     <option name="ERROR_OCCURED" value="false" />
-    <option name="ACTIVE_VCS_NAME" />
+    <option name="ACTIVE_VCS_NAME" value="svn" />
     <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
     <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
     <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
@@ -726,13 +708,6 @@
     <option name="myLastEditedConfigurable" />
   </component>
   <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/src/com/thinkberg/mepixel/CharDisplay.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="14" column="13" selection-start="258" selection-end="258" vertical-scroll-proportion="0.1711569">
-          <folding />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/build.properties">
       <provider selected="true" editor-type-id="text-editor">
         <state line="0" column="56" selection-start="14" selection-end="56" vertical-scroll-proportion="0.0">
@@ -740,13 +715,6 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/thinkberg/mepixel/CameraGrabberThread.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="88" column="17" selection-start="2498" selection-end="2498" vertical-scroll-proportion="0.4326466">
-          <folding />
-        </state>
-      </provider>
-    </entry>
     <entry file="jar:///System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar!/java/util/AbstractList.class">
       <provider selected="true" editor-type-id="text-editor">
         <state line="73" column="0" selection-start="2279" selection-end="2279" vertical-scroll-proportion="0.812987">
@@ -754,42 +722,45 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/thinkberg/mepixel/MePixel.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="66" column="16" selection-start="2015" selection-end="2015" vertical-scroll-proportion="0.077922076">
-          <folding>
-            <element signature="imports" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/build.xml">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="65" column="8" selection-start="2409" selection-end="2409" vertical-scroll-proportion="0.66493505">
+        <state line="65" column="8" selection-start="2409" selection-end="2409" vertical-scroll-proportion="0.7694805">
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/META-INF/mepixel.manifest">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="3" column="0" selection-start="126" selection-end="126" vertical-scroll-proportion="0.09">
+        <state line="3" column="0" selection-start="126" selection-end="126" vertical-scroll-proportion="0.0570523">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/thinkberg/launcher/Launcher.java">
+    <entry file="file://$PROJECT_DIR$/src/com/thinkberg/mepixel/CameraGrabberThread.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="70" column="8" selection-start="2736" selection-end="2736" vertical-scroll-proportion="0.9350649">
+        <state line="110" column="0" selection-start="3069" selection-end="3069" vertical-scroll-proportion="0.53246754">
           <folding />
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/thinkberg/mepixel/BufferedDisplay.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="18" column="13" selection-start="431" selection-end="431" vertical-scroll-proportion="0.2282092">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/thinkberg/mepixel/MePixel.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="21" column="3" selection-start="614" selection-end="614" vertical-scroll-proportion="0.17532468">
+          <folding />
+        </state>
+      </provider>
+    </entry>
     <entry file="file://$PROJECT_DIR$/src/com/thinkberg/mepixel/MePixelLauncher.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="53" column="56" selection-start="1815" selection-end="1815" vertical-scroll-proportion="1.1575">
-          <folding>
-            <element signature="imports" expanded="true" />
-          </folding>
+        <state line="36" column="0" selection-start="1166" selection-end="1166" vertical-scroll-proportion="0.2353896">
+          <folding />
         </state>
       </provider>
     </entry>
blob - 651b950075ea2cc925f77379afb9804c8cd3b75b (mode 644)
blob + /dev/null
--- src/com/thinkberg/launcher/Launcher.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (c) 2007, Matthias L. Jugel. All Rights Reserved.
- * See http://thinkberg.com/ for details and instructions.
- */
-package com.thinkberg.launcher;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.Policy;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.jar.Attributes;
-import java.util.jar.JarInputStream;
-import java.util.jar.Manifest;
-import java.util.jar.JarEntry;
-
-/**
- * Launcher for Java Applications. Creates the classpath and then starts the application.
- * The launcher extracts all available jar files found in the Class-Path of the launcher jar
- * file and adds them to the system class path before executing the real code.
- *
- * @author Matthias L. Jugel
- */
-public class Launcher {
-  public final static String CLASSPATH = "launcher.classpath";
-
-  protected static boolean debug = false;
-
-  private final static URL location = Launcher.class.getProtectionDomain().getCodeSource().getLocation();
-
-  /**
-   * Invokes the main() method of the class to be launched with the arguments provided.
-   * This is a wrapper to configure class path and other settings before launching the actual code.
-   *
-   * @param mainClassName the class to be launched
-   * @param args standard command line arguments
-   * @throws ClassNotFoundException
-   * @throws NoSuchMethodException
-   * @throws IllegalAccessException
-   * @throws InvocationTargetException
-   */
-  public static void invokeMain(String mainClassName, final String args[])
-          throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
-    // get the parent class loader
-    ClassLoader parentClassLoader = Thread.currentThread().getContextClassLoader();
-    if (null == parentClassLoader) {
-      parentClassLoader = Launcher.class.getClassLoader();
-    }
-    if (null == parentClassLoader) {
-      parentClassLoader = ClassLoader.getSystemClassLoader();
-    }
-    URLClassLoader classLoader = new URLClassLoader(initClassPath(System.getProperty(CLASSPATH)),
-                                                    parentClassLoader);
-    Thread.currentThread().setContextClassLoader(classLoader);
-
-    // for the sake of Java Web Start it is necessary to uninstall the security manager
-    if (System.getSecurityManager() != null) {
-      System.err.println("Launcher: uninstalling security manager ...");
-      System.setSecurityManager(null);
-    }
-
-    try {
-      Policy.getPolicy().refresh();
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-
-    // load and start main class
-    Class mainClass = classLoader.loadClass(mainClassName);
-    final Method main = mainClass.getDeclaredMethod("main", new Class[]{String[].class});
-    main.invoke(null, new Object[]{args});
-  }
-
-  /**
-   * Initialize the class path dynamically from information available in the manifest file.
-   *
-   * @param extraClassPath extra class path elements
-   * @return the URL array with the new class path
-   */
-  protected static URL[] initClassPath(String extraClassPath) {
-    List urlArray = new ArrayList();
-    InputStream manifestIn = null;
-    InputStream jarIn = null;
-    try {
-      manifestIn = location.openStream();
-      JarInputStream launcherJarIs = new JarInputStream(manifestIn);
-      Manifest launcherManifest = launcherJarIs.getManifest();
-      Attributes launcherAttribs = launcherManifest.getMainAttributes();
-      String mainJarAttr = launcherAttribs.getValue("Launcher-Main-Jar");
-      if (System.getProperty("launcher.main.jar") != null) {
-        mainJarAttr = System.getProperty("launcher.main.jar");
-      }
-      URL mainJarUrl = getResourceUrl(mainJarAttr);
-      jarIn = mainJarUrl.openStream();
-      Manifest mainManifest = new JarInputStream(jarIn).getManifest();
-      Attributes mainAttributes = mainManifest.getMainAttributes();
-      String manifestClassPath = mainAttributes.getValue("Class-Path");
-
-      urlArray.add(mainJarUrl);
-      // append extra class path to manifest class path (after replacing separatorchar)
-      if (extraClassPath != null && extraClassPath.length() > 0) {
-        manifestClassPath += " " + extraClassPath.replace(File.pathSeparatorChar, ' ');
-      }
-
-      List extractedFiles = new ArrayList();
-      StringBuffer classPath = new StringBuffer(location.getFile());
-      if(manifestClassPath != null && manifestClassPath.length() != 0) {
-        StringTokenizer tokenizer = new StringTokenizer(manifestClassPath, " \t" + File.pathSeparatorChar, false);
-        while (tokenizer.hasMoreTokens()) {
-          String entry = tokenizer.nextToken();
-          try {
-            URL classPathEntry = getResourceUrl(entry);
-            extractedFiles.add(entry);
-            urlArray.add(classPathEntry);
-            classPath.append(File.pathSeparatorChar);
-            classPath.append(classPathEntry.getFile());
-          } catch (IOException e) {
-            System.err.println("Error: Missing resource ("+entry+") ignored, expect errors ...");
-          }
-        }
-      }
-
-      // ensure we extract all jar files from the launcher package and add them to the class path
-      // we do not rely on the Class-Path entry 
-      List classpathList = new ArrayList(urlArray);
-      JarEntry jarEntry = null;
-      while(null != (jarEntry = launcherJarIs.getNextJarEntry())) {
-        if(!jarEntry.isDirectory() &&
-                (jarEntry.getName().endsWith(".jar") || jarEntry.getName().endsWith(".zip")) && 
-                !extractedFiles.contains(jarEntry.getName())) {
-          try {
-            URL classPathEntry = getResourceUrl(jarEntry.getName());
-            if(!classpathList.contains(classPathEntry)) {
-              urlArray.add(classPathEntry);
-              classPath.append(File.pathSeparatorChar);
-              classPath.append(classPathEntry.getFile());
-            }
-          } catch (IOException e) {
-            System.err.println("Error: Missing or corrupted resource ("+jarEntry.getName()+") ignored.");
-          }
-        }
-      }
-
-      System.setProperty("java.class.path", classPath.toString());
-    } catch (IOException e) {
-      System.err.println("Error: Set the system property launcher.main.jar to specify the jar file to start.");
-      e.printStackTrace();
-    } finally {
-      try { manifestIn.close(); } catch (Throwable ignore) { };
-      try { jarIn.close(); } catch (Throwable ignore) { };
-    }
-    return (URL[]) urlArray.toArray(new URL[0]);
-  }
-
-  /**
-   * Make a URL from a resource name. Necessary for creating a URL class loader.
-   * @param resource resource name/path
-   * @return the url pointing to the resource
-   * @throws IOException
-   */
-  private static URL getResourceUrl(String resource) throws IOException {
-    File directoryBase = new File(location.getFile()).getParentFile();
-    File file = new File(resource);
-    // see if this  is an absolute URL
-    if (file.isAbsolute() && file.exists()) {
-      return file.toURL();
-    }
-    // handle non-absolute URLs
-    file = new File(directoryBase, resource);
-    if (file.exists()) {
-      return file.toURL();
-    }
-
-    URL resourceURL = Launcher.class.getResource("/" + resource);
-    if (null != resourceURL) {
-      return extract(resourceURL);
-    }
-
-    throw new MalformedURLException("missing resource: " + resource);
-  }
-
-  /**
-   * Extract file from launcher jar to be able to access is via classpath.
-   *
-   * @param resource the jar resource to be extracted
-   * @return a url pointing to the new file
-   * @throws IOException if the extraction was not possible
-   */
-  private static URL extract(URL resource) throws IOException {
-    if(debug) {
-      System.err.println("Launcher: extracting '" + resource.getFile() + "' ...");
-    }
-    File f = File.createTempFile("launcher_", ".jar");
-    f.deleteOnExit();
-    if (f.getParentFile() != null) {
-      f.getParentFile().mkdirs();
-    }
-    InputStream is = new BufferedInputStream(resource.openStream());
-    FileOutputStream os = new FileOutputStream(f);
-    byte[] arr = new byte[8192];
-    for (int i = 0; i >= 0; i = is.read(arr)) {
-      os.write(arr, 0, i);
-    }
-    is.close();
-    os.close();
-    return f.toURL();
-  }
-}
\ No newline at end of file
blob - 546687fccc91450227fb3c6005c5b6034488d129
blob + 0f538f2bde4cdab2d264d69ded00d6ec51ba9a98
--- src/com/thinkberg/mepixel/CameraGrabberThread.java
+++ src/com/thinkberg/mepixel/CameraGrabberThread.java
@@ -9,23 +9,19 @@ import quicktime.QTException;
 import quicktime.QTRuntimeException;
 import quicktime.QTRuntimeHandler;
 import quicktime.QTSession;
-import quicktime.io.QTFile;
-import quicktime.io.OpenMovieFile;
 import quicktime.qd.PixMap;
+import quicktime.qd.QDConstants;
 import quicktime.qd.QDGraphics;
 import quicktime.qd.QDRect;
-import quicktime.qd.QDConstants;
 import quicktime.std.StdQTConstants;
-import quicktime.std.movies.Movie;
 import quicktime.std.sg.SGVideoChannel;
 import quicktime.std.sg.SequenceGrabber;
 import quicktime.util.RawEncodedImage;
 
-import java.awt.image.BufferedImage;
-import java.awt.image.WritableRaster;
-import java.io.File;
-
 /**
+ * This thread is solely responsible for getting images from a sequence grabber and copying
+ * them into a pixel data array. Uses Quicktime to get the images by doing some fake recording.
+ *
  * @author Matthias L. Jugel
  */
 public class CameraGrabberThread extends Thread {
@@ -61,9 +57,9 @@ public class CameraGrabberThread extends Thread {
     channel.setUsage(StdQTConstants.seqGrabPreview);
     grabber.prepare(true, false);
 
-		grabber.setDataOutput( null, StdQTConstants.seqGrabDontMakeMovie);
-		grabber.prepare(true, true);
-		grabber.startRecord();
+    grabber.setDataOutput(null, StdQTConstants.seqGrabDontMakeMovie);
+    grabber.prepare(true, true);
+    grabber.startRecord();
 
     PixMap pixMap = graphics.getPixMap();
     rowEncodedImage = pixMap.getPixelData();
@@ -73,7 +69,8 @@ public class CameraGrabberThread extends Thread {
       public void exceptionOccurred(
               QTRuntimeException e, Object eGenerator,
               String methodNameIfKnown, boolean unrecoverableFlag) {
-        System.out.println("what should i do?");
+        System.err.println("A Quicktime error has occurred: " + e.getMessage());
+        e.printStackTrace();
       }
     });
   }
@@ -85,7 +82,7 @@ public class CameraGrabberThread extends Thread {
   public int getCameraHeight() {
     return height;
   }
-  
+
   public void enable() {
     running = true;
     start();
@@ -104,7 +101,6 @@ public class CameraGrabberThread extends Thread {
     } catch (QTException e) {
       e.printStackTrace();
     }
-    QTSession.close();
   }
 
   public int[] getPixelData() {
blob - /dev/null
blob + deedc8f08cbf751168a30a155647f2a2e3e23680 (mode 644)
--- /dev/null
+++ src/com/thinkberg/mepixel/BufferedDisplay.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, Matthias L. Jugel. All Rights Reserved.
+ * See http://thinkberg.com/ for details and instructions.
+ */
+
+package com.thinkberg.mepixel;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * A simple display that does some backing store based painting. It is fullscreen and without
+ * a window.
+ *
+ * @author Matthias L. Jugel
+ */
+public class BufferedDisplay extends JFrame {
+  private Image backingStore;
+  private int xOffset;
+  private int yOffset;
+
+  public BufferedDisplay() {
+    super();
+
+    setUndecorated(true);
+    setExtendedState(Frame.MAXIMIZED_BOTH);
+    setVisible(true);
+    setBackground(Color.BLACK);
+
+    getGraphicsConfiguration().getDevice().setFullScreenWindow(this);
+
+  }
+
+  public void setBackingStore(Image image) {
+    backingStore = image;
+    xOffset = (getWidth() - backingStore.getWidth(this)) / 2;
+    yOffset = (getHeight() - backingStore.getHeight(this)) / 2;
+  }
+
+  /**
+   * Paint the current screen using the backing store image.
+   */
+  public void paint(Graphics g) {
+    if (backingStore != null) {
+      g.drawImage(backingStore, xOffset, yOffset, this);
+    }
+  }
+}
blob - 159f9e4a0d0c7bfd4a3fc5fc65a7d12af7ca9d7e (mode 644)
blob + /dev/null
--- src/com/thinkberg/mepixel/CharDisplay.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2007, Matthias L. Jugel. All Rights Reserved.
- * See http://thinkberg.com/ for details and instructions.
- */
-
-package com.thinkberg.mepixel;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.KeyListener;
-import java.awt.event.KeyEvent;
-
-/**
- * @author Matthias L. Jugel
- */
-public class CharDisplay extends JFrame {
-  private Image backingStore;
-  private int xOffset;
-  private int yOffset;
-
-  public CharDisplay() {
-    super();
-
-    setUndecorated(true);
-    setExtendedState(Frame.MAXIMIZED_BOTH);
-    setVisible(true);
-    setBackground(Color.BLACK);
-
-    getGraphicsConfiguration().getDevice().setFullScreenWindow(this);
-
-  }
-
-  public void setBackingStore(Image image) {
-    backingStore = image;
-    xOffset = (getWidth() - backingStore.getWidth(this)) / 2;
-    yOffset = (getHeight() - backingStore.getHeight(this)) / 2;
-  }
-
-  /**
-   * Paint the current screen using the backing store image.
-   */
-  public void paint(Graphics g) {
-    if (backingStore != null) {
-      g.drawImage(backingStore, xOffset, yOffset, this);
-    }
-  }
-}
blob - c0000c00c997ac78b8fe7d5b1d9ac2c793c9641e
blob + d7a62eb0dbcd64db9e6c636b7eaaa01933bcb285
--- src/com/thinkberg/mepixel/MePixel.java
+++ src/com/thinkberg/mepixel/MePixel.java
@@ -7,24 +7,21 @@ package com.thinkberg.mepixel;
 
 import quicktime.QTException;
 
+import java.awt.*;
 import java.awt.event.KeyAdapter;
 import java.awt.event.KeyEvent;
 import java.awt.image.BufferedImage;
-import java.awt.*;
 import java.io.BufferedReader;
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.Policy;
-import java.util.Arrays;
-import java.util.List;
-import java.util.ArrayList;
 
-
+/**
+ * MePixel -- a fun application for your webcam. It can display the image using zeros and ones
+ * or just as rectangles (filled or empty) depending on the brightness of a certain area on
+ * screen.
+ *
+ * @author Matthias L. Jugel
+ */
 public class MePixel {
   private static int delay = 20;
   private static boolean fillSwap = true;
@@ -65,7 +62,7 @@ public class MePixel {
     try {
       cameraGrabber.init();
     } catch (QTException e) {
-      System.err.println("Camera grabber failed: "+e.getMessage()+" (no camera found?)");
+      System.err.println("Camera grabber failed: " + e.getMessage() + " (no camera found?)");
       System.err.println("Exiting ...");
       System.exit(-1);
     }
@@ -76,8 +73,8 @@ public class MePixel {
 
     int[] pixelData = cameraGrabber.getPixelData();
 
-    CharDisplay charDisplay = new CharDisplay();
-    charDisplay.addKeyListener(new KeyAdapter() {
+    BufferedDisplay bufferedDisplay = new BufferedDisplay();
+    bufferedDisplay.addKeyListener(new KeyAdapter() {
       public void keyPressed(KeyEvent keyEvent) {
         switch (keyEvent.getKeyCode()) {
           case KeyEvent.VK_UP:
@@ -102,11 +99,11 @@ public class MePixel {
     });
 
     Font font = new Font("Bitstream Vera Sans Mono", Font.PLAIN, fontSize);
-    charDisplay.setFont(font);
-    int charWidth = charDisplay.getFontMetrics(font).charWidth('@');
-    int charHeight = charDisplay.getFontMetrics(font).getHeight();
-    int adaptedScreenHeight = charDisplay.getHeight() / charHeight;
-    int adaptedScreenWidth = charDisplay.getWidth() / charWidth;
+    bufferedDisplay.setFont(font);
+    int charWidth = bufferedDisplay.getFontMetrics(font).charWidth('@');
+    int charHeight = bufferedDisplay.getFontMetrics(font).getHeight();
+    int adaptedScreenHeight = bufferedDisplay.getHeight() / charHeight;
+    int adaptedScreenWidth = bufferedDisplay.getWidth() / charWidth;
     System.out.println("Using a character size of [" + charWidth + "x" + charHeight + "] pixels");
     System.out.println("The screen is divided into [" + adaptedScreenWidth + "x" + adaptedScreenHeight + "] squares");
 
@@ -116,7 +113,7 @@ public class MePixel {
                                                   BufferedImage.TYPE_INT_RGB);
     Graphics2D cachedImageG2D = cachedImage.createGraphics();
     cachedImageG2D.setFont(font);
-    charDisplay.setBackingStore(cachedImage);
+    bufferedDisplay.setBackingStore(cachedImage);
     float[] hsvValues = new float[3];
 
     int rectWidth = cameraWidth / adaptedScreenWidth;
@@ -126,7 +123,7 @@ public class MePixel {
       for (int row = 0; row < cameraHeight; row += rectHeight) {
         int y = (row / rectHeight) * charHeight;
 
-        cachedImageG2D.setColor(charDisplay.getBackground());
+        cachedImageG2D.setColor(bufferedDisplay.getBackground());
         cachedImageG2D.fillRect(0, y, cameraWidth * charWidth, charHeight);
 
         for (int column = 0; column < cameraWidth; column += rectWidth) {
@@ -154,7 +151,7 @@ public class MePixel {
             }
           }
         }
-        charDisplay.repaint();
+        bufferedDisplay.repaint();
         try {
           Thread.sleep(delay);
         } catch (InterruptedException e) {
blob - a8824b9f57659c7d3bc986b296c7ecd8d019b96f
blob + 502c12a8854edfb641a1b016dcd3d57943d25ad2
--- src/com/thinkberg/mepixel/MePixelLauncher.java
+++ src/com/thinkberg/mepixel/MePixelLauncher.java
@@ -16,6 +16,10 @@ import java.util.Arrays;
 import java.util.List;
 
 /**
+ * Launcher class for the MePixel Application. This launcher ensures that quicktime is in the
+ * class path by checking well known locations for QTJava.zip and adding it to a special
+ * class loader used to load the actual code.
+ *
  * @author Matthias L. Jugel
  */
 public class MePixelLauncher {
@@ -29,13 +33,6 @@ public class MePixelLauncher {
 
     System.err.println("MePixelLauncher (c) 2007 Matthias L. Jugel. All Rights Reserved.");
     System.err.println("++ Checking Quicktime installation ...");
-    ClassLoader parentClassLoader = Thread.currentThread().getContextClassLoader();
-    if (null == parentClassLoader) {
-      parentClassLoader = MePixel.class.getClassLoader();
-    }
-    if (null == parentClassLoader) {
-      parentClassLoader = ClassLoader.getSystemClassLoader();
-    }
 
     List<URL> classPath = new ArrayList<URL>();
     classPath.add(MePixel.class.getProtectionDomain().getCodeSource().getLocation());
@@ -50,8 +47,7 @@ public class MePixelLauncher {
         }
       }
     }
-    URLClassLoader classLoader = new URLClassLoader(classPath.toArray(new URL[0]),
-                                                    null);
+    URLClassLoader classLoader = new URLClassLoader(classPath.toArray(new URL[0]), ClassLoader.getSystemClassLoader());
     Thread.currentThread().setContextClassLoader(classLoader);
 
     // for the sake of Java Web Start it is necessary to uninstall the security manager
@@ -67,8 +63,8 @@ public class MePixelLauncher {
     }
 
     System.err.println();
-    // load and start main class
     try {
+      // load and start main class
       Class mainClass = classLoader.loadClass("com.thinkberg.mepixel.MePixel");
       final Constructor mainContructor = mainClass.getConstructor(String[].class);
       mainContructor.newInstance(new Object[]{args});