本文整理匯總了Java中com.intellij.util.ui.UIUtil.getPanelBackground方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.getPanelBackground方法的具體用法?Java UIUtil.getPanelBackground怎麽用?Java UIUtil.getPanelBackground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.util.ui.UIUtil
的用法示例。
在下文中一共展示了UIUtil.getPanelBackground方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: paintBorder
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) {
final Graphics2D g2d = (Graphics2D) g.create();
final Color background = UIUtil.getPanelBackground();
g2d.setColor(background);
g2d.fillRect(0, 0, width, height);
Color topColor = UIUtil.isUnderDarcula() ? BORDER_TOP_COLOR.darker().darker() : BORDER_TOP_COLOR;
if (SystemInfo.isMac && UIUtil.isUnderIntelliJLaF()) {
topColor = Gray.xC9;
}
g2d.setColor(topColor);
g2d.drawLine(0, 0, width, 0);
if (!UIUtil.isUnderDarcula()) {
g2d.setColor(BORDER_BOTTOM_COLOR);
g2d.drawLine(0, height, width, height);
}
g2d.dispose();
}
示例2: paintComponent
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
protected void paintComponent(Graphics g) {
Color bg = getBackground();
if (bg == null) {
bg = UIUtil.getPanelBackground();
}
g.setColor(bg);
if (isOpaque()) {
g.fillRect(0,0, getWidth() - 1, getHeight()-1);
}
final Border border = getBorder();
final Insets insets = border == null ? new Insets(0,0,0,0) : border.getBorderInsets(this);
int x = (getWidth() - insets.left - insets.right - myIcon.getIconWidth()) / 2;
int y = insets.top;
myIcon.paintIcon(this, g, x, y);
g.setFont(getFont());
y += myIcon.getIconHeight();
final FontMetrics metrics = getFontMetrics(getFont());
x = (getWidth() - insets.left - insets.right - metrics.stringWidth(myLabel)) / 2;
y += 1.5 * metrics.getHeight();
g.setColor(UIUtil.getLabelForeground());
GraphicsUtil.setupAAPainting(g);
g.drawString(myLabel, x, y);
}
示例3: setActive
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public final void setActive(final boolean active) {
myActive = active;
if (active) {
myTitlePanel.setBackground(DARK_BLUE);
myTitlePanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED, DARK_BLUE_BRIGHTER, DARK_BLUE_DARKER));
myParentTitle.setForeground(Color.white);
}
else {
final Color color = UIUtil.getPanelBackground();
LOG.assertTrue(color != null);
myTitlePanel.setBackground(color);
myTitlePanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED, color.brighter(), color.darker()));
myParentTitle.setForeground(JBColor.foreground());
}
final int[] selectedIndices = myList.getSelectedIndices();
if (selectedIndices.length == 0 && myList.getModel().getSize() > 0) {
myList.setSelectedIndex(0);
if (!myList.hasFocus()) {
myList.requestFocus();
}
}
else if (myList.getModel().getSize() > 0) {
// need this to generate SelectionChanged events so that listeners, added by Commander, will be notified
myList.setSelectedIndices(selectedIndices);
}
}
示例4: setVisible
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public void setVisible(final boolean visible, boolean takeSnapshot) {
if (myVisible == visible) return;
if (myVisible && !visible && myCurrentAlpha != -1) return;
myVisible = visible;
if (myVisible) {
setVisible(myVisible);
myCurrentAlpha = -1;
}
if (myVisible) {
if (takeSnapshot && getWidth() > 0 && getHeight() > 0) {
mySnapshot = UIUtil.createImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
final Graphics2D g = mySnapshot.createGraphics();
myPane.paint(g);
final Component opaque = UIUtil.findNearestOpaque(this);
mySnapshotBg = opaque != null ? opaque.getBackground() : UIUtil.getPanelBackground();
g.dispose();
}
myProgress.resume();
} else {
disposeSnapshot();
myProgress.suspend();
myFadeOutAnimator.reset();
myFadeOutAnimator.resume();
}
}
示例5: setEnabled
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
if (myToggleHistoryLabel != null) {
final Color bg = enabled ? UIUtil.getTextFieldBackground() : UIUtil.getPanelBackground();
myToggleHistoryLabel.setBackground(bg);
myClearFieldLabel.setBackground(bg);
}
}
示例6: 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);
}
}
示例7: getGutterColor
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public static JBColor getGutterColor() {
return new JBColor(new NotNullProducer<Color>() {
@NotNull
@Override
public Color produce() {
Color color = EditorColorsManager.getInstance().getGlobalScheme().getColor(EditorColors.GUTTER_BACKGROUND);
return color == null ? UIUtil.getPanelBackground() : color;
}
});
}
示例8: getBackground
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public Color getBackground() {
return UIUtil.isUnderNimbusLookAndFeel() ? UIUtil.getPanelBackground() : UIUtil.getBgFillColor(getParent());
}
示例9: getEmptySpaceColor
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public Color getEmptySpaceColor() {
return UIUtil.isUnderAquaLookAndFeel() ? Gray.xC8 : UIUtil.getPanelBackground();
}
示例10: paintBorder
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public void paintBorder(Component c, Graphics g2, int x, int y, int width, int height) {
if (comboBox == null || arrowButton == null) {
return; //NPE on LaF change
}
hasFocus = false;
checkFocus();
final Graphics2D g = (Graphics2D)g2.create();
final Rectangle arrowButtonBounds = arrowButton.getBounds();
final int xxx = arrowButtonBounds.x - JBUI.scale(5);
final int H = height - JBUI.scale(2);
final int W = width - JBUI.scale(2);
final Shape clip = g.getClip();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
final int R = JBUI.scale(5);
if (hasFocus) {
g.clipRect(JBUI.scale(2), JBUI.scale(2), comboBox.getWidth()- JBUI.scale(4), comboBox.getHeight() - JBUI.scale(4));
}
final Color background = editor != null && comboBox.isEditable()
? editor.getBackground()
: UIUtil.getPanelBackground();
g.setColor(background);
g.fillRoundRect(x + JBUI.scale(1), y + JBUI.scale(1), W, H, R, R);
g.setColor(getArrowButtonFillColor(arrowButton.getBackground()));
g.fillRoundRect(xxx, y + JBUI.scale(1), width - xxx, H, R, R);
g.setColor(background);
g.fillRect(xxx, y + JBUI.scale(1), JBUI.scale(5), H);
final Color borderColor = getBorderColor();//ColorUtil.shift(UIUtil.getBorderColor(), 4);
g.setColor(getArrowButtonFillColor(borderColor));
int off = hasFocus ? 1 : 0;
g.drawLine(xxx + JBUI.scale(5), y + JBUI.scale(1) + off, xxx + JBUI.scale(5), height - JBUI.scale(2));
Rectangle r = rectangleForCurrentValue();
paintCurrentValueBackground(g, r, hasFocus);
paintCurrentValue(g, r, false);
if (hasFocus) {
g.setClip(clip);
DarculaUIUtil.paintFocusRing(g, JBUI.scale(2), JBUI.scale(2), width - JBUI.scale(4), height - JBUI.scale(4));
}
else {
g.setColor(borderColor);
g.drawRoundRect(JBUI.scale(1), JBUI.scale(1), width - JBUI.scale(2), height - JBUI.scale(2), R, R);
if (!UIUtil.isUnderDarcula() && comboBox.isEnabled()) {
g.setColor(getArrowButtonFillColor(getBorderColor()));
final int offX = xxx + JBUI.scale(5);
g.clipRect(offX, y, width - offX, height);
g.drawRoundRect(JBUI.scale(1), JBUI.scale(1), width - JBUI.scale(2), height - JBUI.scale(2), R, R);
}
}
g.dispose();
}
示例11: produce
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@NotNull
@Override
public Color produce() {
return UIUtil.isUnderDarcula() ? UIUtil.getPanelBackground() : Gray._255;
}
示例12: getBackground
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public Color getBackground() {
Color color = EditorColorsManager.getInstance().getGlobalScheme().getColor(EditorColors.READONLY_BACKGROUND_COLOR);
return color == null ? UIUtil.getPanelBackground() : color;
}
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:StringResourceEditorNotificationProvider.java