| 1 |
package processing.app.helpers; |
| 2 |
|
| 3 |
public class OSUtils { |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
static public boolean isWindows() { |
| 9 |
|
| 10 |
return System.getProperty("os.name").contains("Windows"); |
| 11 |
} |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
static public boolean isLinux() { |
| 17 |
|
| 18 |
return System.getProperty("os.name").contains("Linux"); |
| 19 |
} |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
static public boolean isMacOS() { |
| 25 |
|
| 26 |
return System.getProperty("os.name").contains("Mac"); |
| 27 |
} |
| 28 |
|
| 29 |
static public boolean hasMacOSStyleMenus() { |
| 30 |
return OSUtils.isMacOS() && "true".equals(System.getProperty("apple.laf.useScreenMenuBar")); |
| 31 |
} |
| 32 |
|
| 33 |
static public String version() { |
| 34 |
return System.getProperty("os.version"); |
| 35 |
} |
| 36 |
} |