Doc patch

Anything related to a beta release of JPatch: Bugs, enhancements, general discussion...

Doc patch

Postby Matthias » Sat Dec 30, 2006 1:12 am

Hi,

just tried the development version (0.5.2) and, being pissed that the add point tool always jumps back to the default tool after one point I checked out the source.
While wading through the source, writing my comments to parts I had understood, I found the part where to disable the behavior.

Well, now I have a patch with some javadocs I'd like to submit. Where to do this? You disabled the sourceforge patch tracker...
Here are the first 2 files, tell me if you want more (and how). The patch is against the 0.5.2 tag, trunk seems to be broken atm.

Code: Select all
Index: /home/matthias/project/workspace/JPatch/src/jpatch/Launcher.java
===================================================================
--- /home/matthias/project/workspace/JPatch/src/jpatch/Launcher.java   (revision 384)
+++ /home/matthias/project/workspace/JPatch/src/jpatch/Launcher.java   (working copy)
@@ -7,6 +7,10 @@
import jpatch.boundary.*;
import jpatch.entity.*;

+/**
+ * Entry point for JPatch. Asks the user to use either the modeler, the
+ * animator or the configuration editor.
+ */
public final class Launcher {
   private static BFrame frame;
   /* private static GlTest gltest; */
@@ -11,6 +15,7 @@
   private static BFrame frame;
   /* private static GlTest gltest; */
   public static void main(String[] args) {
+    // some splashscreen test, disabled
      if (false) {
         try {
            UIManager.setLookAndFeel(JPatchSettings.getInstance().strPlafClassName);
@@ -27,6 +32,7 @@
         splash.clearSplash();
         return;
      }
+    // check command line arguments...
      if (args.length >=1) {
         if (args[0].equals("-animator")) launchAnimator();
         else if (args[0].equals("-modeler")) launchModeler();
@@ -31,9 +37,10 @@
         if (args[0].equals("-animator")) launchAnimator();
         else if (args[0].equals("-modeler")) launchModeler();
         else if (args[0].equals("-settings")) settings();
-         else System.out.println("usage java -jpatch.jar [-animator | -modeler | -settings]");
+         else System.out.println("usage java -jar jpatch.jar [-animator | -modeler | -settings]");
      }
      else {
+      // ... no arguments, so ask the user what to start
         try {
            UIManager.setLookAndFeel(JPatchSettings.getInstance().strPlafClassName);
         } catch (Exception e) {
Index: /home/matthias/project/workspace/JPatch/src/jpatch/boundary/JPatchKeyAdapter.java
===================================================================
--- /home/matthias/project/workspace/JPatch/src/jpatch/boundary/JPatchKeyAdapter.java   (revision 384)
+++ /home/matthias/project/workspace/JPatch/src/jpatch/boundary/JPatchKeyAdapter.java   (working copy)
@@ -4,6 +4,11 @@
import java.awt.event.*;
import java.util.*;

+/**
+ * A key event dispatcher. Keeps track of Key-Object bindings and calls
+ * the objects actionPerformed()/doClick() methods. Only <i>ActionListener</i>
+ * and <i>AbstractButton</i> is supported at the moment.
+ * */
public class JPatchKeyAdapter extends KeyAdapter {
   private ArrayList listKeys = new ArrayList();
   //private Map mapKeys = new HashMap();
@@ -8,6 +13,10 @@
   private ArrayList listKeys = new ArrayList();
   //private Map mapKeys = new HashMap();
   
+  /**
+   * Adds a key-object binding. The object should be an instance of
+   * <i>ActionListener</i> or <i>AbstractButton</i>.
+   */
   public void addKey(JPatchKey key, Object object) {
      if (listKeys.indexOf(key) != -1) {
         //throw new IllegalArgumentException(key + " already assigned");
@@ -20,6 +29,7 @@
      //System.out.println(key);
   }
   
+  /** clears all key bindings */
   public void removeAllKeys() {
      //System.out.println("remove all keys");
      listKeys.clear();
@@ -26,6 +36,7 @@
      //System.out.println(listKeys.size());
   }
   
+  /** removes the binding for <i>key</i> from the list */
   public void removeKey(JPatchKey key) {
      //System.out.print("remove key " + key);
      for (int i = 0, n = listKeys.size(); i < n; i += 2) {
@@ -44,7 +55,8 @@
      //}
      //mapKeys.remove(key);
   }
-   
+
+  /** processes the key event by forwarding it to the internal key-bindings */
   public void keyPressed(KeyEvent keyEvent) {
      for (int i = 0; i < listKeys.size(); i += 2) {
         JPatchKey key = (JPatchKey)listKeys.get(i);
Matthias
 
Posts: 1
Joined: Sat Dec 30, 2006 12:53 am
Location: Germany

Postby pndragon » Sat Dec 30, 2006 3:56 am

Any patches at this time have to be submitted directly to Sacha and he is currently unavailable until after the New Year.

Sadly, Sascha is stopping development of the patch modeler in favor of an SDS modeler. In my opinion, this may be a mistake. There are several free full-featured SDS modelers available already. Why reinvent the wheel? Patch modeler/animators are a little harder to came by.

--- Jim
"We're so sorry, Uncle Albert,
But we haven't done a bloody thing all day."
--- Paul McCartney
pndragon
 
Posts: 591
Joined: Sun Dec 05, 2004 1:27 am
Location: North Carolina

Postby sascha » Wed Jan 03, 2007 11:29 am

The latest versions (I can't exactly tell since when) had the following behavior implemented: Some of the tool buttons show a little lock symbol if you move your mouse over them. If these buttons are double-clicked, the mode won't change, otherwise JPatch switches back to the default tool after the respective tool was used.
You can try it with this version (which has a horrible bug with undo/redo in the modeler :( )
I plan to keep this as the default unless someone comes up with a better idea.

JPatch is currently undergoing some major changes (e.g. switching from Hash-like patches to subdivision surfaces), so I'm afraid that I can't include any patches right now.
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Postby kl » Thu Jan 11, 2007 6:29 pm

sascha wrote:JPatch is currently undergoing some major changes (e.g. switching from Hash-like patches to subdivision surfaces), so I'm afraid that I can't include any patches right now.


Does it make the model smoother?

Currently I have a problem, the model looks very smooth in JPatch, but some area has weird surface after export to POV-ray.

Sometime 'missing triagles' happens, to avoid this problem, I export it to .obj, and use other tool to convert the .obj to POV.
kl
 
Posts: 46
Joined: Thu Jul 07, 2005 12:07 am


Return to Beta

Who is online

Users browsing this forum: No registered users and 3 guests

cron