本文整理匯總了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();
}