org.openide.util.Utilities.getOperatingSystem()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(160)

本文整理了Java中org.openide.util.Utilities.getOperatingSystem()方法的一些代码示例,展示了Utilities.getOperatingSystem()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.getOperatingSystem()方法的具体详情如下:
包路径:org.openide.util.Utilities
类名称:Utilities
方法名:getOperatingSystem

Utilities.getOperatingSystem介绍

[英]Get the operating system on which NetBeans is running.
[中]获取运行NetBeans的操作系统。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-util

/** Test whether NetBeans is running on some variant of Windows.
* @return <code>true</code> if Windows, <code>false</code> if some other manner of operating system
*/
public static boolean isWindows() {
  return (getOperatingSystem() & OS_WINDOWS_MASK) != 0;
}

代码示例来源:origin: org.netbeans.api/org-openide-util

/** Test whether NetBeans is running on Mac OS X.
 * @since 7.7
* @return <code>true</code> if Mac, <code>false</code> if some other manner of operating system
*/
public static boolean isMac() {
  return (getOperatingSystem() & OS_MAC) != 0;
}

代码示例来源:origin: org.netbeans.api/org-openide-util

/** Test whether NetBeans is running on some variant of Unix.
* Linux is included as well as the commercial vendors and Mac OS X.
* @return <code>true</code> some sort of Unix, <code>false</code> if some other manner of operating system
*/
public static boolean isUnix() {
  return (getOperatingSystem() & OS_UNIX_MASK) != 0;
}

代码示例来源:origin: org.netbeans.api/org-openide-util

/** Test whether the operating system supports icons on frames (windows).
* @return <code>true</code> if it does <em>not</em>
* @deprecated Obsolete, useless method, no replacement.
*/
@Deprecated public static boolean isLargeFrameIcons() {
  return (getOperatingSystem() == OS_SOLARIS) || (getOperatingSystem() == OS_HP);
}

代码示例来源:origin: org.netbeans.api/org-openide-util

/** @return true iff current thread is EventDispatchThread */
static boolean isDispatchThread() {
  boolean dispatch = EventQueue.isDispatchThread();
  if (!dispatch && (Utilities.getOperatingSystem() == Utilities.OS_SOLARIS)) {
    // on solaris the event queue is not always recognized correctly
    // => try to guess by name
    dispatch = (Thread.currentThread().getClass().getName().indexOf("EventDispatchThread") >= 0); // NOI18N
  }
  return dispatch;
}

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

/** Compute the system name of this filesystem for a given root directory.
* <P>
* The default implementation simply returns the filename separated by slashes.
* @see FileSystem#setSystemName
* @param rootFile root directory for the filesystem
* @return system name for the filesystem
*/
protected String computeSystemName(File rootFile) {
  String retVal = rootFile.getAbsolutePath().replace(File.separatorChar, '/');
  return ((Utilities.isWindows() || (Utilities.getOperatingSystem() == Utilities.OS_OS2))) ? retVal.toLowerCase()
                                               : retVal;
}

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

if((Utilities.getOperatingSystem() & Utilities.OS_WINVISTA) != 0) {
  if(retVal == null) {
    retVal = file.getAbsoluteFile();

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

if (Utilities.getOperatingSystem() == Utilities.OS_VMS) {
  if (Character.isLowerCase(name.charAt(0))) {
    r = map.get(name.toUpperCase());

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

private static File normalizeFileImpl(File file) {
  // XXX should use NIO in JDK 7; see #6358641
  Parameters.notNull("file", file);  //NOI18N
  File retFile;
  LOG.log(Level.FINE, "FileUtil.normalizeFile for {0}", file); // NOI18N
  long now = System.currentTimeMillis();
  if ((Utilities.isWindows() || (Utilities.getOperatingSystem() == Utilities.OS_OS2))) {
    retFile = normalizeFileOnWindows(file);
  } else if (Utilities.isMac()) {
    retFile = normalizeFileOnMac(file);
  } else {
    retFile = normalizeFileOnUnixAlike(file);
  }
  File ret = (file.getPath().equals(retFile.getPath())) ? file : retFile;
  long took = System.currentTimeMillis() - now;
  if (took > 500) {
    LOG.log(Level.WARNING, "FileUtil.normalizeFile({0}) took {1} ms. Result is {2}", new Object[]{file, took, ret});
  }
  return ret;
}

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

if ((Utilities.getOperatingSystem() == Utilities.OS_VMS) && (arr[0] != null) && (f != null)) {
  if (arr[0].equalsIgnoreCase("_nbattrs.")) {
    try {
if ((Utilities.getOperatingSystem() == Utilities.OS_VMS) && (arr[i] != null) && (f != null)) {
  if (arr[i].equalsIgnoreCase("_nbattrs.")) {
    try {

代码示例来源:origin: org.netbeans.api/org-openide-util

if (getOperatingSystem() == OS_MAC) {
  needed |= KeyEvent.CTRL_MASK;
} else {

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

if ((Utilities.isWindows() || (Utilities.getOperatingSystem() == Utilities.OS_OS2)) || Utilities.isMac()) {

代码示例来源:origin: org.netbeans.api/org-openide-util-ui

/** Test whether the operating system supports icons on frames (windows).
* @return <code>true</code> if it does <em>not</em>
* @deprecated Obsolete, useless method, no replacement.
*/
@Deprecated public static boolean isLargeFrameIcons() {
  return (getOperatingSystem() == OS_SOLARIS) || (getOperatingSystem() == OS_HP);
}

代码示例来源:origin: org.netbeans.api/org-openide-util-ui

if (getOperatingSystem() == BaseUtilities.OS_MAC) {
  needed |= KeyEvent.CTRL_MASK;
} else {

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Compute the system name of this filesystem for a given root directory.
* <P>
* The default implementation simply returns the filename separated by slashes.
* @see FileSystem#setSystemName
* @param rootFile root directory for the filesystem
* @return system name for the filesystem
*/
protected String computeSystemName (File rootFile) {        
  String retVal = rootFile.getAbsolutePath ().replace(File.separatorChar, '/');
  return ((Utilities.isWindows () || (Utilities.getOperatingSystem () == Utilities.OS_OS2))) ? retVal.toLowerCase() : retVal;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Creates BufferedImage with Transparency.TRANSLUCENT */
static final java.awt.image.BufferedImage createBufferedImage(int width, int height) {
  if (Utilities.getOperatingSystem() == Utilities.OS_MAC) {
    return new BufferedImage (width, height, BufferedImage.TYPE_INT_ARGB_PRE);
  }
  java.awt.image.ColorModel model = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().
                   getDefaultScreenDevice().getDefaultConfiguration().getColorModel(java.awt.Transparency.TRANSLUCENT);
  java.awt.image.BufferedImage buffImage = new java.awt.image.BufferedImage(model,
      model.createCompatibleWritableRaster(width, height), model.isAlphaPremultiplied(), null);
  return buffImage;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Creates BufferedImage with Transparency.TRANSLUCENT */
static final java.awt.image.BufferedImage createBufferedImage(int width, int height) {
  if (Utilities.getOperatingSystem() == Utilities.OS_MAC) {
    return new BufferedImage (width, height, BufferedImage.TYPE_INT_ARGB_PRE);
  }
  java.awt.image.ColorModel model = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().
                   getDefaultScreenDevice().getDefaultConfiguration().getColorModel(java.awt.Transparency.TRANSLUCENT);
  java.awt.image.BufferedImage buffImage = new java.awt.image.BufferedImage(model,
      model.createCompatibleWritableRaster(width, height), model.isAlphaPremultiplied(), null);
  return buffImage;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

protected OutputStream outputStream (final String name) throws java.io.IOException {
  OutputStream retVal = new FileOutputStream (getFile (name));
  // workaround for #42624
  if ((Utilities.getOperatingSystem () & Utilities.OS_MAC) != 0) {
    retVal = getOutputStreamForMac42624(retVal, name);
  }
  return retVal;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-utils

private AllLibraryFileFilter() {
  filters.add(ElfStaticLibraryFileFilter.getInstance());
  if (Utilities.isWindows()) {
    filters.add(PeDynamicLibraryFileFilter.getInstance());
    filters.add(PeStaticLibraryFileFilter.getInstance());
  } else if (Utilities.getOperatingSystem() == Utilities.OS_MAC) {
    filters.add(MacOSXDynamicLibraryFileFilter.getInstance());
  } else {
    filters.add(ElfDynamicLibraryFileFilter.getInstance());
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

public WidgetAction.State mousePressed(Widget widget, WidgetAction.WidgetMouseEvent event) {
  if (isLocked ())
    return State.createLocked (widget, this);
  if ((event.getModifiers () & modifiers) == modifiers) {
    if ((Utilities.getOperatingSystem () & Utilities.OS_MAC) != 0)
      macLocking = true;
    return super.mousePressedCore(widget,event);
  }
  return State.REJECTED;
}

相关文章