Class OSPDesktop

java.lang.Object
org.opensourcephysics.desktop.OSPDesktop

public class OSPDesktop extends Object
OSPDesktop invokes the java.awt.Desktop API using reflection for Java 1.5 compatibility.
Author:
Wolfgang Christian
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    browse(String uriName)
    Launches the default browser to display a URI.
    static boolean
    browse(URI uri)
    Launches the default browser to display a URI.
    static boolean
    Display a URL in the system browser.
    static boolean
    edit(File file)
    Launches the default application to edit a file.
    static boolean
    Determines if the desktop API is supported.
    static boolean
    Launches the default email program without a recipient.
    static boolean
    mail(String addr)
    Launches the default email program with the given address.
    static boolean
    open(File file)
    Launches the default application to edit a file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OSPDesktop

      public OSPDesktop()
  • Method Details

    • displayURL

      public static boolean displayURL(String url)
      Display a URL in the system browser. Attempts to open URL with desktop API if available; attempts Ostermiller code otherwise.
      Returns:
      true if successful
    • isDesktopSupported

      public static boolean isDesktopSupported()
      Determines if the desktop API is supported.
      Returns:
      true if the desktop API is supported.
    • browse

      public static boolean browse(String uriName)
      Launches the default browser to display a URI.
      Parameters:
      uriName -
    • browse

      public static boolean browse(URI uri)
      Launches the default browser to display a URI.
      Parameters:
      uri -
      Returns:
      true if successful
    • mail

      public static boolean mail(String addr)
      Launches the default email program with the given address.
      Parameters:
      addr -
      Returns:
      true if successful
    • mail

      public static boolean mail()
      Launches the default email program without a recipient.
      Returns:
      true if successful
    • edit

      public static boolean edit(File file)
      Launches the default application to edit a file.
      Parameters:
      file -
    • open

      public static boolean open(File file)
      Launches the default application to edit a file.
      Parameters:
      file -