-
-
Notifications
You must be signed in to change notification settings - Fork 7k
/
Copy pathOSUtils.java
36 lines (30 loc) · 927 Bytes
/
OSUtils.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package processing.app.helpers;
public class OSUtils {
/**
* returns true if running on windows.
*/
static public boolean isWindows() {
//return PApplet.platform == PConstants.WINDOWS;
return System.getProperty("os.name").contains("Windows");
}
/**
* true if running on linux.
*/
static public boolean isLinux() {
//return PApplet.platform == PConstants.LINUX;
return System.getProperty("os.name").contains("Linux");
}
/**
* returns true if Processing is running on a Mac OS X machine.
*/
static public boolean isMacOS() {
//return PApplet.platform == PConstants.MACOSX;
return System.getProperty("os.name").contains("Mac");
}
static public boolean hasMacOSStyleMenus() {
return OSUtils.isMacOS() && "true".equals(System.getProperty("apple.laf.useScreenMenuBar"));
}
static public String version() {
return System.getProperty("os.version");
}
}