Package ptolemy.gui

Class PtGUIUtilities


  • public class PtGUIUtilities
    extends java.lang.Object
    GUI Utilities.
    Since:
    Ptolemy II 8.0
    Version:
    $Id$
    Author:
    Christopher Brooks
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean macOSLookAndFeel()
      Return true if we are running under MacOS look and feel or if the ptolemy.ptII.MacOS property is defined.
      static boolean useFileDialog()
      Return true if java.awt.FileDialog should be used instead of javax.swing.JFileChooser.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • macOSLookAndFeel

        public static boolean macOSLookAndFeel()
        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.VergilApplication Or, under Cygwin:
          export JAVAFLAGS=-Dptolemy.ptII.MacOS=true
          $PTII/bin/vergil
          
        If the ptolemy.ptII.MacOS property is set to true, this method prints the message "ptolemy.ptII.MacOS = true property detected".
        Returns:
        True if the look and feel starts with "Mac OS" or the ptolemy.ptII.MacOS property is set to true.
      • useFileDialog

        public static boolean useFileDialog()
        Return true if java.awt.FileDialog should be used instead of javax.swing.JFileChooser. Certain platforms such as Mac OS X have a much better implementation of java.awt.FileDialog than they do of javax.swing.JFileChooser.

        If the ptolemy.ptII.useFileDialog property is set to "true", then return true. If the ptolemy.ptII.useFileDialog property is set to any other value, return false. If the ptolemy.ptII.useFileDialog property is not set, then return the value of #macOSLookAndFeel().

        To define ptolemy.ptII.useFileDialog, invoke Vergil with java -Dptolemy.ptII.useFileDialog=true -classpath $PTII ptolemy.vergil.VergilApplication Or, under Cygwin or bash:

          export JAVAFLAGS=-Dptolemy.ptII.useFileDialog=true
          $PTII/bin/vergil
          
        Returns:
        true if java.awt.FileDialog should be used.