本文整理汇总了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);
}
}
示例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);
}
示例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;
}
示例4: isSearchControlUISupported
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
protected boolean isSearchControlUISupported() {
return (SystemInfo.isMacOSLeopard && UIUtil.isUnderAquaLookAndFeel()) || UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF();
}