本文整理匯總了Java中com.intellij.util.ui.UIUtil.isUnderAquaLookAndFeel方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.isUnderAquaLookAndFeel方法的具體用法?Java UIUtil.isUnderAquaLookAndFeel怎麽用?Java UIUtil.isUnderAquaLookAndFeel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.util.ui.UIUtil
的用法示例。
在下文中一共展示了UIUtil.isUnderAquaLookAndFeel方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: FixedSizeButton
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private FixedSizeButton(int size, JComponent component) {
Icon icon = AllIcons.General.Ellipsis;
if (icon != null) {
// loading may fail at design time
setIcon(icon);
}
else {
setText(".");
}
mySize = size;
myComponent = component;
setMargin(new Insets(0, 0, 0, 0));
setDefaultCapable(false);
setFocusable(false);
if (((UIUtil.isUnderAquaLookAndFeel()) && size == -1) || UIUtil.isUnderIntelliJLaF() || UIUtil.isUnderDarcula()) {
putClientProperty("JButton.buttonType", "square");
}
}
示例2: paintBorder
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
int labelX = x + outsideInsets.left;
int labelY = y + outsideInsets.top;
TitledSeparator titledSeparator = getTitledSeparator(c);
JLabel label = titledSeparator.getLabel();
Dimension labelSize = label.getPreferredSize();
label.setSize(labelSize);
g.translate(labelX, labelY);
label.paint(g);
int separatorX = labelX + labelSize.width + TitledSeparator.SEPARATOR_LEFT_INSET;
int separatorY = labelY + (UIUtil.isUnderAquaLookAndFeel() ? 2 : labelSize.height / 2 - 1);
int separatorW = Math.max(0, width - separatorX - TitledSeparator.SEPARATOR_RIGHT_INSET);
int separatorH = 2;
JSeparator separator = titledSeparator.getSeparator();
separator.setSize(separatorW, separatorH);
g.translate(separatorX - labelX, separatorY - labelY);
separator.paint(g);
g.translate(-separatorX, -separatorY);
}
示例3: setEnabled
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public void setEnabled(boolean enabled) {
if (UIUtil.isUnderAquaLookAndFeel()) {
final Editor editor = getEditor();
if (editor != null) {
editor.setBorder(enabled ? EDITOR_TEXTFIELD_BORDER : EDITOR_TEXTFIELD_DISABLED_BORDER);
}
}
super.setEnabled(enabled);
}
示例4: TreeListCellRenderer
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private TreeListCellRenderer(@NotNull final JComboBox comboBox, final boolean showRootNode, @Nullable final String defaultText) {
myComboBox = comboBox;
myShowRootNode = showRootNode;
myDefaultText = defaultText;
myUnderAquaLookAndFeel = UIUtil.isUnderAquaLookAndFeel();
setOpaque(!myUnderAquaLookAndFeel);
}
示例5: GradleEditorComboBoxEditor
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public GradleEditorComboBoxEditor() {
if (SystemInfo.isMac && UIUtil.isUnderAquaLookAndFeel()) {
myField = new MacComboBoxTextField();
} else {
myField = new JTextField();
myField.setBorder(null);
}
}
示例6: IdeaMenuUI
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public IdeaMenuUI() {
myMaxGutterIconWidth = JBUI.scale(18);
if (UIUtil.isUnderAquaLookAndFeel() || UIUtil.isUnderIntelliJLaF()) {
if (myAquaSelectedBackgroundPainter == null) myAquaSelectedBackgroundPainter = (Border) UIManager.get("MenuItem.selectedBackgroundPainter");
if (myAquaInvertedArrowIcon == null) myAquaInvertedArrowIcon = (Icon) UIManager.get("Menu.invertedArrowIcon");
if (myAquaDisabledArrowIcon == null) myAquaDisabledArrowIcon = (Icon) UIManager.get("Menu.disabledArrowIcon");
}
}
示例7: setEditor
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public final void setEditor(final ComboBoxEditor editor) {
ComboBoxEditor _editor = editor;
if (SystemInfo.isMac && (UIUtil.isUnderAquaLookAndFeel() || UIUtil.isUnderIntelliJLaF())) {
if (editor instanceof UIResource) {
_editor = new FixedComboBoxEditor();
}
}
super.setEditor(new MyEditor(this, _editor));
}
示例8: createUIComponents
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private void createUIComponents() {
myBrowserSelector = new BrowserSelector();
myBrowserComboBox = myBrowserSelector.getMainComponent();
if (UIUtil.isUnderAquaLookAndFeel()) {
myBrowserComboBox.setBorder(new EmptyBorder(3, 0, 0, 0));
}
}
示例9: hasFocus
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public boolean hasFocus() {
if (SystemInfo.isMac && UIUtil.isUnderAquaLookAndFeel() && myPaintingNow && isEditable) {
return false;
}
return super.hasFocus();
}
示例10: paint
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public void paint(Graphics g) {
if (!SystemInfo.isMac || UIUtil.isUnderAquaLookAndFeel()) { // avoid rendering problems with non-aqua (alloy) LaFs under mac
// actually, it's a bad idea to globally enable this for dialog graphics since renderers, for example, may not
// inherit graphics so rendering hints won't be applied and trees or lists may render ugly.
UISettings.setupAntialiasing(g);
}
super.paint(g);
}
示例11: repaintComboBox
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private void repaintComboBox() {
// TODO:
if (UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF() || (SystemInfo.isMac && UIUtil.isUnderAquaLookAndFeel())) {
IdeFocusManager.getInstance(getProject()).doWhenFocusSettlesDown(new Runnable() {
@Override
public void run() {
final Container parent = getParent();
if (parent != null) parent.repaint();
}
});
}
}
示例12: setOverlayed
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public void setOverlayed(boolean overlayed) {
if (Registry.is("disable.toolwindow.overlay")) return;
Color bg = UIUtil.getPanelBackground();
if (UIUtil.isUnderAquaLookAndFeel()) {
float[] result = Color.RGBtoHSB(bg.getRed(), bg.getGreen(), bg.getBlue(), new float[3]);
bg = new Color(Color.HSBtoRGB(result[0], result[1], result[2] - 0.08f > 0 ? result[2] - 0.08f : result[2]));
}
if (overlayed) {
setBackground(ColorUtil.toAlpha(bg, 190));
}
else {
setBackground(bg);
}
}
示例13: AwtPopupWrapper
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public AwtPopupWrapper(Popup popup, JBPopup jbPopup) {
myPopup = popup;
myJBPopup = jbPopup;
if (SystemInfo.isMac && UIUtil.isUnderAquaLookAndFeel()) {
final Component c = ReflectionUtil.getField(Popup.class, myPopup, Component.class, "component");
c.setBackground(UIUtil.getPanelBackground());
}
}
示例14: getListCellRendererComponent
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public Component getListCellRendererComponent(final JList list,
final Object value,
final int index,
final boolean isSelected,
final boolean cellHasFocus) {
clear();
myInList = index >= 0;
if (index >= 0) {
Object obj1 = myComboBox.getItemAt(index);
myChecked = obj1 != null && obj1.equals(myComboBox.getSelectedItem());
}
else {
myChecked = false;
}
int indent = 0;
if (myInList) {
final TreePath path = getTreeModelWrapper().getPathForRow(index);
indent = path == null ? 0 : (path.getPathCount() - 1 - (myShowRootNode ? 0 : 1)) *
(UIUtil.isUnderAquaLookAndFeel() ? 2 : 1) * INDENT;
}
setIpad(new Insets(1, !myInList || myEditable ? myUnderAquaLookAndFeel ? 0 : 5 : (myUnderAquaLookAndFeel ? 23 : 5) + indent, 1, 5));
setIcon(getValueIcon(value, index));
setIconOpaque(!myUnderAquaLookAndFeel);
myEditable = myComboBox.isEditable();
setForeground(isSelected ? list.getSelectionForeground() : list.getForeground());
if (!myUnderAquaLookAndFeel) setBackground(isSelected ? list.getSelectionBackground() : list.getBackground());
if (value instanceof CustomPresentation) {
((CustomPresentation)value).append(this, index);
} else {
if (value == null) {
if (index == -1 && myDefaultText != null) {
append(myDefaultText, SimpleTextAttributes.GRAY_ATTRIBUTES);
} else {
append("");
}
} else {
append(value.toString());
}
}
setSelected(isSelected);
setFont(list.getFont());
return this;
}
示例15: DockWindow
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private DockWindow(String id, Project project, DockContainer container, boolean dialog) {
super(project, null, dialog);
myId = id;
myContainer = container;
setProject(project);
if (!(container instanceof DockContainer.Dialog)) {
setStatusBar(WindowManager.getInstance().getStatusBar(project).createChild());
}
myUiContainer = new NonOpaquePanel(new BorderLayout());
NonOpaquePanel center = new NonOpaquePanel(new BorderLayout(0, 2));
if (UIUtil.isUnderAquaLookAndFeel()) {
center.setOpaque(true);
center.setBackground(JBTabsImpl.MAC_AQUA_BG_COLOR);
}
center.add(myNorthPanel, BorderLayout.NORTH);
myDockContentUiContainer = new NonOpaquePanel(new BorderLayout());
myDockContentUiContainer.add(myContainer.getContainerComponent(), BorderLayout.CENTER);
center.add(myDockContentUiContainer, BorderLayout.CENTER);
myUiContainer.add(center, BorderLayout.CENTER);
if (myStatusBar != null) {
myUiContainer.add(myStatusBar.getComponent(), BorderLayout.SOUTH);
}
setComponent(myUiContainer);
addDisposable(container);
IdeEventQueue.getInstance().addPostprocessor(this, this);
myContainer.addListener(new DockContainer.Listener.Adapter() {
@Override
public void contentRemoved(Object key) {
getReady().doWhenDone(new Runnable() {
@Override
public void run() {
if (myContainer.isEmpty()) {
close();
}
}
});
}
}, this);
UISettings.getInstance().addUISettingsListener(new UISettingsListener() {
@Override
public void uiSettingsChanged(UISettings source) {
updateNorthPanel();
}
}, this);
updateNorthPanel();
}