本文整理汇总了Java中org.apache.commons.lang.SystemUtils.IS_OS_MAC_OSX属性的典型用法代码示例。如果您正苦于以下问题:Java SystemUtils.IS_OS_MAC_OSX属性的具体用法?Java SystemUtils.IS_OS_MAC_OSX怎么用?Java SystemUtils.IS_OS_MAC_OSX使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.lang.SystemUtils
的用法示例。
在下文中一共展示了SystemUtils.IS_OS_MAC_OSX属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFileChooser
/**
* Creates a FileChooser appropriate for the user's OS.
*
* @param parent
* The Component over which the FileChooser should appear.
* @param prefs
* A FileConfigure that stores the preferred starting directory of the FileChooser in preferences
*/
public static FileChooser createFileChooser(Component parent, DirectoryConfigurer prefs, int mode) {
FileChooser fc;
if (SystemUtils.IS_OS_MAC_OSX) {
// Mac has a good native file dialog
fc = new NativeFileChooser(parent, prefs, mode);
}
else if (mode == FILES_ONLY && SystemUtils.IS_OS_WINDOWS) {
// Window has a good native file dialog, but it doesn't support selecting directories
fc = new NativeFileChooser(parent, prefs, mode);
}
else {
// Linux's native dialog is inferior to Swing's
fc = new SwingFileChooser(parent, prefs, mode);
}
return fc;
}
示例2: tryConvertingInMemory
private boolean tryConvertingInMemory(Reference<BufferedImage> ref) {
/*
* Having an OutOfMemoryException while converting in memory is
* apparently catastrophic on Apple's Java 6 JVM (and possibly also
* on their Java 5 JVM as well). In-memory tiling also uses far more
* memory than it should on Apple's Java 6 JVM due to
* Graphics2D.drawImage making an intermediate copy of the image data.
* Hence, we ensure that when using Java 5 or 6 on Mac OS X, we never
* try in-memory conversion for images which can't comfortably have
* three copies existing simultaneously in memory.
*/
return !SystemUtils.IS_OS_MAC_OSX ||
(!SystemUtils.IS_JAVA_1_6 && !SystemUtils.IS_JAVA_1_5) ||
4*ref.obj.getHeight()*ref.obj.getWidth() <=
Runtime.getRuntime().maxMemory()/4;
}
示例3: main
public static void main(String... args) {
invisible = new JFrame();
try {
invisible.setIconImage(ImageIO.read(FileUtil.getResource("icon.png")));
} catch (IOException e) {
e.printStackTrace();
}
// Our discord-rpc library doesn't support macOS yet
if (!SystemTray.isSupported() || !Desktop.isDesktopSupported() || SystemUtils.IS_OS_MAC_OSX) { // We do this because if there is no sys-tray icon users can't terminate the program, which would be bad
JOptionPane.showMessageDialog(null, "Your platform isn't supported currently!", "Unsupported platform!", JOptionPane.ERROR_MESSAGE);
return;
}
new Courier();
}
示例4: getHomeDir
public static File getHomeDir() {
// FIXME: creation of VASSAL's home should be moved someplace else, possibly
// to the new Application class when it's merged with the trunk.
if (homeDir == null) {
if (SystemUtils.IS_OS_MAC_OSX) {
homeDir = new File(
System.getProperty("user.home"), "Library/Application Support/VASSAL"
);
}
else if (SystemUtils.IS_OS_WINDOWS) {
homeDir = new File(System.getenv("APPDATA") + "/VASSAL");
}
else {
homeDir = new File(System.getProperty("user.home"), ".VASSAL");
}
if (!homeDir.exists()) {
// FIXME: What if this fails? This should be done from someplace that
// can signal failure properly.
homeDir.mkdirs();
}
}
return homeDir;
}
示例5: tryConvertingInMemory
private boolean tryConvertingInMemory(Reference<BufferedImage> ref) {
/*
* Having an OutOfMemoryException while converting in memory is
* apparently catastrophic on Apple's Java 6 JVM (and possibly also
* on their Java 5 JVM as well). In-memory tiling also uses far more
* memory than it should on Apple's Java 6 JVM due to
* Graphics2D.drawImage making an intermediate copy of the image data.
* Hence, we ensure that when using Java 5 or 6 on Mac OS X, we never
* try in-memory conversion for images which can't comfortably have
* three copies existing simultaneously in memory.
*/
return !SystemUtils.IS_OS_MAC_OSX ||
(!SystemUtils.IS_JAVA_1_6 && !SystemUtils.IS_JAVA_1_5) ||
4*ref.obj.getHeight()*ref.obj.getWidth() <=
Runtime.getRuntime().maxMemory()/4;
}
示例6: getJRECACerts
/**
* Constructs the operating system specific File path of the JRE cacerts file.
*
* @return a File representing the path to the command.
*/
public static File getJRECACerts()
{
File cacertsFile;
String cacertsFilepath = "lib" + File.separator + "security" + File.separator + "cacerts";
// For IBM's JDK 1.2
if ( SystemUtils.IS_OS_AIX )
{
cacertsFile = new File( SystemUtils.getJavaHome() + "/", cacertsFilepath );
}
else if ( SystemUtils.IS_OS_MAC_OSX ) // what about IS_OS_MAC_OS ??
{
cacertsFile = new File( SystemUtils.getJavaHome() + "/", cacertsFilepath );
}
else
{
cacertsFile = new File( SystemUtils.getJavaHome() + "/", cacertsFilepath );
}
return cacertsFile;
}
示例7: FullscreenUtility
/**
* Construct with the given JFrame. The utility will allow the frame to be
* toggled between windowed and fullscreen mode.
*
* @param frame
* The frame.
*/
public FullscreenUtility(JFrame frame) {
this.window = frame;
if (SystemUtils.IS_OS_MAC_OSX) {
// if we're on a mac, we'll add the fullscreen hint to the window so
// the standard controls work
try {
final Class<?> util = Class.forName("com.apple.eawt.FullScreenUtilities");
final Class<?> params[] = new Class[] { Window.class, Boolean.TYPE };
final Method method = util.getMethod("setWindowCanFullScreen", params);
method.invoke(util, window, true);
} catch (final Exception e) {
// ignore
}
}
}
示例8: create
static BaseConnection create()
{
if (SystemUtils.IS_OS_MAC_OSX)
return new BaseConnectionOsx();
if (SystemUtils.IS_OS_UNIX)
return new BaseConnectionUnix();
if (SystemUtils.IS_OS_WINDOWS)
return new BaseConnectionWindows();
throw new IllegalStateException("This OS is not supported");
}
示例9: isApplicable
@Override
protected boolean isApplicable() {
final boolean nettyDoesNotSupportMacUnixSockets = SystemUtils.IS_OS_MAC_OSX &&
ComparableVersion.OS_VERSION.isLessThan("10.12");
return nettyDoesNotSupportMacUnixSockets && socketFile.exists();
}
开发者ID:testcontainers,项目名称:testcontainers-java,代码行数:7,代码来源:ProxiedUnixSocketClientProviderStrategy.java
示例10: isApplicable
@Override
protected boolean isApplicable() {
final boolean nettyDoesSupportMacUnixSockets = SystemUtils.IS_OS_MAC_OSX &&
ComparableVersion.OS_VERSION.isGreaterThanOrEqualTo("10.12");
return SystemUtils.IS_OS_LINUX || nettyDoesSupportMacUnixSockets;
}
示例11: PlatformDetection
public PlatformDetection() {
// resolve OS
if (SystemUtils.IS_OS_WINDOWS) {
this.os = OS_WINDOWS;
} else if (SystemUtils.IS_OS_MAC_OSX) {
this.os = OS_OSX;
} else if (SystemUtils.IS_OS_SOLARIS) {
this.os = OS_SOLARIS;
} else if (SystemUtils.IS_OS_LINUX) {
this.os = OS_LINUX;
} else {
throw new IllegalArgumentException("Unknown operating system " + SystemUtils.OS_NAME);
}
// resolve architecture
Map<String, String> archMap = new HashMap<String, String>();
archMap.put("x86", ARCH_X86_32);
archMap.put("i386", ARCH_X86_32);
archMap.put("i486", ARCH_X86_32);
archMap.put("i586", ARCH_X86_32);
archMap.put("i686", ARCH_X86_32);
archMap.put("x86_64", ARCH_X86_64);
archMap.put("amd64", ARCH_X86_64);
archMap.put("powerpc", ARCH_PPC);
this.arch = archMap.get(SystemUtils.OS_ARCH);
if (this.arch == null) {
throw new IllegalArgumentException("Unknown architecture " + SystemUtils.OS_ARCH);
}
}
示例12: setFullscreen
/**
* Method allows changing whether this window is displayed in fullscreen or
* windowed mode.
*
* @param fullscreen
* true = change to fullscreen, false = change to windowed
*/
public void setFullscreen(boolean fullscreen) {
if (this.fullscreen != fullscreen) {
if (SystemUtils.IS_OS_MAC_OSX) {
setFullscreenOSX(fullscreen);
} else {
setFullscreenAWT(fullscreen);
}
}
}
示例13: createMenuManager
protected MenuManager createMenuManager() {
return SystemUtils.IS_OS_MAC_OSX ?
new MacOSXMenuManager() : new EditorMenuManager();
}
示例14: createMenuManager
protected MenuManager createMenuManager() {
return SystemUtils.IS_OS_MAC_OSX ?
new MacOSXMenuManager() : new PlayerMenuManager();
}
示例15: isMacOSX
/** @depricated Use {@link SystemUtils.IS_OS_MAC_OSX} instead */
@Deprecated
public static boolean isMacOSX() {
return SystemUtils.IS_OS_MAC_OSX;
}