當前位置: 首頁>>代碼示例>>Java>>正文


Java SystemInfo.isMacOSLeopard方法代碼示例

本文整理匯總了Java中com.intellij.openapi.util.SystemInfo.isMacOSLeopard方法的典型用法代碼示例。如果您正苦於以下問題:Java SystemInfo.isMacOSLeopard方法的具體用法?Java SystemInfo.isMacOSLeopard怎麽用?Java SystemInfo.isMacOSLeopard使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.util.SystemInfo的用法示例。


在下文中一共展示了SystemInfo.isMacOSLeopard方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setAlphaMode

import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
private static void setAlphaMode(Window window, float ratio) {
  try {
    if (SystemInfo.isMacOSLeopard) {
      if (window instanceof JWindow) {
        ((JWindow)window).getRootPane().putClientProperty("Window.alpha", 1.0f - ratio);
      } else if (window instanceof JDialog) {
        ((JDialog)window).getRootPane().putClientProperty("Window.alpha", 1.0f - ratio);
      } else if (window instanceof JFrame) {
        ((JFrame)window).getRootPane().putClientProperty("Window.alpha", 1.0f - ratio);
      }
    }
    else if (AWTUtilitiesWrapper.isTranslucencySupported(AWTUtilitiesWrapper.TRANSLUCENT)) {
      AWTUtilitiesWrapper.setWindowOpacity(window, 1.0f - ratio);
    }
    else {
      WindowUtils.setWindowAlpha(window, 1.0f - ratio);
    }
  }
  catch (Throwable e) {
    LOG.debug(e);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:WindowManagerImpl.java

示例2: fixPopupWeight

import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
/**
 * The following code is a trick! By default Swing uses lightweight and "medium" weight
 * popups to show JPopupMenu. The code below force the creation of real heavyweight menus -
 * this increases speed of popups and allows to get rid of some drawing artifacts.
 */
private static void fixPopupWeight() {
  int popupWeight = OurPopupFactory.WEIGHT_MEDIUM;
  String property = System.getProperty("idea.popup.weight");
  if (property != null) property = property.toLowerCase(Locale.ENGLISH).trim();
  if (SystemInfo.isMacOSLeopard) {
    // force heavy weight popups under Leopard, otherwise they don't have shadow or any kind of border.
    popupWeight = OurPopupFactory.WEIGHT_HEAVY;
  }
  else if (property == null) {
    // use defaults if popup weight isn't specified
    if (SystemInfo.isWindows) {
      popupWeight = OurPopupFactory.WEIGHT_HEAVY;
    }
  }
  else {
    if ("light".equals(property)) {
      popupWeight = OurPopupFactory.WEIGHT_LIGHT;
    }
    else if ("medium".equals(property)) {
      popupWeight = OurPopupFactory.WEIGHT_MEDIUM;
    }
    else if ("heavy".equals(property)) {
      popupWeight = OurPopupFactory.WEIGHT_HEAVY;
    }
    else {
      LOG.error("Illegal value of property \"idea.popup.weight\": " + property);
    }
  }

  PopupFactory factory = PopupFactory.getSharedInstance();
  if (!(factory instanceof OurPopupFactory)) {
    factory = new OurPopupFactory(factory);
    PopupFactory.setSharedInstance(factory);
  }
  PopupUtil.setPopupType(factory, popupWeight);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:42,代碼來源:LafManagerImpl.java

示例3: createSouthPanel

import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
/**
 * Creates panel located at the south of the content pane. By default that
 * panel contains dialog's buttons. This default implementation uses <code>createActions()</code>
 * and <code>createJButtonForAction(Action)</code> methods to construct the panel.
 *
 * @return south panel
 */
@NotNull
private JComponent createSouthPanel() {
  Action[] actions = createActions();
  List<JButton> buttons = new ArrayList<JButton>();

  JPanel panel = new JPanel(new BorderLayout());
  final JPanel lrButtonsPanel = new JPanel(new GridBagLayout());
  final Insets insets = SystemInfo.isMacOSLeopard ? new Insets(0, 0, 0, 0) : new Insets(8, 0, 0, 0);

  if (actions.length > 0) {
    int gridX = 0;
    lrButtonsPanel.add(Box.createHorizontalGlue(),    // left strut
                       new GridBagConstraints(gridX++, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insets, 0,
                                              0));
    if (actions.length > 0) {
      JPanel buttonsPanel = createButtons(actions, buttons);
      lrButtonsPanel.add(buttonsPanel,
                         new GridBagConstraints(gridX, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, insets, 0, 0));
    }
  }

  panel.add(lrButtonsPanel, BorderLayout.CENTER);

  panel.setBorder(IdeBorderFactory.createEmptyBorder(WizardConstants.STUDIO_WIZARD_INSETS));

  return panel;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:35,代碼來源:FirstRunWizardHost.java

示例4: isSearchControlUISupported

import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
protected boolean isSearchControlUISupported() {
  return (SystemInfo.isMacOSLeopard && UIUtil.isUnderAquaLookAndFeel()) || UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:SearchTextField.java


注:本文中的com.intellij.openapi.util.SystemInfo.isMacOSLeopard方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。