[kepler-dev] Kepler/Ptolemy on the Mac

Christopher Hylands Brooks cxh at eecs.berkeley.edu
Mon May 24 22:12:01 PDT 2004


I did a clean cvs checkout of the Ptolemy II development tree
on the Mac and I was able to:
* Get the context menu by doing control-click
* Connect and disconnect ports

One problem is that meta-click did not create a relation for me.
I did not try connecting from a relation to a port, I'll try tomorrow
am.

Also, control-R does not run a model.

I ran through the What's New in 4.0 demos and they worked for me.

Our plan is to release Ptolemy II 4.0 in mid June, probably on June
18th.  That release will include the Mac fixes.

Until then, the Ptolemy II CVS tree has the fixes.

-Christopher



--------

    I spent some time over the weekend getting a Mac to work with Eclipse
    and CVS.  It turns out that one problem was that we had directories
    like sdf/demo/foo that I had previously renamed to sdf/demo/Foo and
    something got confused, saying that sdf/demo/foo was already present,
    even though really, it was in the CVS repository Attic.
    
    I'm not sure if this is a Mac filesystem problem, a CVS problem or
    and Eclipse problem.  
    Lesson learned: get the case right in directory names when checking in
    files.
    
    In anycase, over the space of Saturday afternoon, I checked out the
    CVS tree several times and finally got it all to work.
    
    Another issue is that we need to include a default .classpath file
    that has most of the optional packages excluded.  I'll see about
    this. 
    
    Steve and I just spent two hours together hacking on the laptop, and
    he was able to get the Control-Click to bring up the context menu.
    The bad news is that we are not able to connect actors right now.  The
    laptop was not on the campus network, so we were using a thumbdrive to
    transfer files, so things might be working correctly on the CVS tree,
    but not on the hacked up version on the laptop.  I'll try doing a
    clean cvs checkout and rebuild at somepoint over the next few days.
    
    The problem we are facing is that the Mac actually belongs to my wife,
    Tansy, and she uses it much of the time.  So, getting time on it, or
    taking it to work is a little bit awkward.  Tansy might have an older
    clunky laptop that can be made to work, but it might also be worth
    getting an Apple for this use.  The cheapest iBook is $900 edu.
    pricing.  I'm not sure I want to get a cheap iBook, but it might
    be worth it if we are serious about supporting the Mac.
    
    Anyway, we made progress today, and hopefully we can hack on this
    further sometime soon.
    
    BTW - I'm not sure if I mentioned that I added
    ptolemy/vergil/kernel/VergilUtilties.java that has a method 
    that checks for the mac: 
    
        /** Return true if we are running under MacOS look and feel or
         *  if the ptolemy.ptII.MacOS property is defined.
         *  To define ptolemy.ptII.MacOS, invoke Vergil with
         *  java -Dptolemy.ptII.MacOS=true -classpath $PTII ptolemy.vergil.Verg
   ilApplication
         *  Or, under Cygwin:
         *  <pre>
         *  export JAVAFLAGS=-Dptolemy.ptII.MacOS=true
         *  $PTII/bin/vergil
         *  </pre>
         *  If the ptolemy.ptII.MacOS property is set to true, this method
         *  prints the message "ptolemy.ptII.MacOS = true property detected".
         *
         *  @return True if the look and feel starts with "Mac OS" or the
         *  ptolemy.ptII.MacOS property is set to true.
         */   
        public static boolean macOSLookAndFeel() {
            // Dan Higgins writes:
            // "Apple suggests in their tech note 2042 (
            // http://developer.apple.com/documentation/Java/Conceptual/Java131
   Development/x_platform/
            // chapter_5_section_5.html) that the statement
            //
            // System.getProperty("mrj.version")
            //
            // should be used to detect a mac, with any non-null result
            // indicating that the machine is a mac. This approach is
            // independent of the string value which may change."
    
            // However, calling getProperty will likely fail in applets
            // or within the sandbox, so we use this method instead.
    
            if (StringUtilities.getProperty("ptolemy.ptII.MacOS").equals("true"
   )) {
                System.out.println("ptolemy.ptII.MacOS = true property detected
   ");
                return true;
            }
            return UIManager.getLookAndFeel().getName().startsWith("Mac OS");
        }
    }
    
    -Christopher
    
      
    
    
    --------
    
        Dan,
        
        What became of your inquiry into using the apple command key instead of
    
        the control key on the mac for all modifier operations?  As Mac 
        generally uses this command modifier, it seems like the right think to 
        do, which would then free up the control key modifier to act in the 
        Mac-standard way to get the context menu.  There must be a way to 
        automattically map all cntrl funcitons in ptolemy to command functions 
        when on the mac.
        
        Matt
        
        higgins at nceas.ucsb.edu wrote:
        
        > Hi All,
        > 
        > I have been investigating the use of Kepler/Ptolemy on the Mac. I did
    fin
       d
        > some threads on Mac use (especial concerning the single button mouse)
   , bu
       t I
        > was still having some problems. In particular, one can find in the
        > 'ActorEditorGraphController' class the code fragment
        > 
        >         if (UIManager.getLookAndFeel().getName().startsWith("MacOS"))
    {
        >             // On the Mac, do not override Control-Click, which is
        >             // used to bring up the context menu
        >             _linkCreator.setMouseFilter(_metaFilter);
        >         } else {
        >             _linkCreator.setMouseFilter(_controlFilter);
        >         }
        > 
        > Note the 'getName()' call and the string comparison to "MacOS". Unfor
   tuna
       tely,
        > a test on my Mac (OS version 10.3.3) shows that the getName method re
   turn
       s 
        > "Mac OS X Aqua" (note the spaces!). Due to the spaces, the names do n
   ot m
       atch 
        > and the Mac is NEVER detected!
        > 
        > Apple suggests in their tech note 2042 (http://developer.apple.com/
        > documentation/Java/Conceptual/Java131Development/x_platform/
        > chapter_5_section_5.html) that the statement
        > 
        > System.getProperty("mrj.version")
        > 
        > should be used to detect a mac, with any non-null result indicating t
   hat 
       the 
        > machine is a mac. This approach is independent of the string value wh
   ich 
       may 
        > change.
        > 
        > I did try changing the Kepler code to correct this detection problem.
    I w
       as 
        > able to get it to properly detect my Mac, but it still does not popup
    the
        
        > context menu using the control key + click. Anyone have any ideas?
        > 
        > Incidently, a 2 button mouse plugged into the Mac USB port does work 
   OK w
       ith 
        > current code.
        > 
        > Dan Higgins
        > NCEAS
        > 
        > 
        > -------------------------------------------------
        > This mail sent through IMP: http://horde.org/imp/
        > _______________________________________________
        > kepler-dev mailing list
        > kepler-dev at ecoinformatics.org
        > http://www.ecoinformatics.org/mailman/listinfo/kepler-dev
        
        
        
        _______________________________________________
        kepler-dev mailing list
        kepler-dev at ecoinformatics.org
        http://www.ecoinformatics.org/mailman/listinfo/kepler-dev
    --------
    _______________________________________________
    kepler-dev mailing list
    kepler-dev at ecoinformatics.org
    http://www.ecoinformatics.org/mailman/listinfo/kepler-dev
--------



More information about the Kepler-dev mailing list