processing.app

## Class Platform

- Object
- - Platform

- Direct Known Subclasses:
    LinuxPlatform, MacPlatform, WindowsPlatform

      public class Platform
      extends Object

  Used by Base for platform-specific tweaking, for instance finding the sketchbook location using the Windows registry, or OS X event handling. The methods in this implementation are used by default, and can be overridden by a subclass, if loaded by Base.main(). These methods throw vanilla-flavored Exceptions, so that error handling occurs inside Base. There is currently no mechanism for adding new platforms, as the setup is not automated. We could use getProperty("os.arch") perhaps, but that's debatable (could be upper/lowercase, have spaces, etc.. basically we don't know if name is proper Java package syntax.)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `Platform.CLibrary`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Platform()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `deleteFile(File file)` Attempts to move to the Trash on OS X, or the Recycle Bin on Windows.
    `File` | `getDefaultSketchbookFolder()`
    `String` | `getenv(String variable)`
    `File` | `getSettingsFolder()` This function should throw an exception or return a value.
    `void` | `init(Base base)`
    `void` | `openFolder(File file)`
    `boolean` | `openFolderAvailable()`
    `void` | `openURL(String url)`
    `void` | `saveLanguage(String languageCode)`
    `void` | `setenv(String variable, String value)`
    `void` | `setLookAndFeel()` Set the default L & F.
    `int` | `unsetenv(String variable)`

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Platform

          public Platform()

  - ### Method Detail

    - #### setLookAndFeel

          public void setLookAndFeel()
                              throws Exception

      Set the default L & F. While I enjoy the bounty of the sixteen possible exception types that this UIManager method might throw, I feel that in just this one particular case, I'm being spoiled by those engineers at Sun, those Masters of the Abstractionverse. It leaves me feeling sad and overweight. So instead, I'll pretend that I'm not offered eleven dozen ways to report to the user exactly what went wrong, and I'll bundle them all into a single catch-all "Exception". Because in the end, all I really care about is whether things worked or not. And even then, I don't care.
      Throws:
        `Exception` - Just like I said.

    - #### saveLanguage

          public void saveLanguage(String languageCode)

    - #### init

          public void init(Base base)

    - #### getSettingsFolder

          public File getSettingsFolder()
                                 throws Exception

      This function should throw an exception or return a value. Do not return null.
      Throws:
        `Exception`

    - #### getDefaultSketchbookFolder

          public File getDefaultSketchbookFolder()
                                          throws Exception

      Returns:
        if not overridden, a folder named "sketchbook" in user.home.
      Throws:
        `Exception` - so that subclasses can throw a fit

    - #### openURL

          public void openURL(String url)
                       throws Exception

      Throws:
        `Exception`

    - #### openFolderAvailable

          public boolean openFolderAvailable()

    - #### openFolder

          public void openFolder(File file)
                          throws Exception

      Throws:
        `Exception`

    - #### deleteFile

          public final boolean deleteFile(File file)
                                   throws IOException

      Attempts to move to the Trash on OS X, or the Recycle Bin on Windows. Also tries to find a suitable Trash location on Linux. If not possible, just deletes the file or folder instead.
      Parameters:
        `file` - the folder or file to be removed/deleted
      Returns:
        true if the folder was successfully removed
      Throws:
        `IOException`

    - #### setenv

          public void setenv(String variable,
                    String value)

    - #### getenv

          public String getenv(String variable)

    - #### unsetenv

          public int unsetenv(String variable)