use of com.intellij.openapi.ui.GraphicsConfig in project intellij-community by JetBrains.
the class DiffDividerDrawUtil method paintSeparators.
public static void paintSeparators(@NotNull Graphics2D gg, int width, @NotNull Editor editor1, @NotNull Editor editor2, @NotNull DividerSeparatorPaintable paintable) {
List<DividerSeparator> polygons = createVisibleSeparators(editor1, editor2, paintable);
GraphicsConfig config = GraphicsUtil.setupAAPainting(gg);
for (DividerSeparator polygon : polygons) {
polygon.paint(gg, width);
}
config.restore();
}
use of com.intellij.openapi.ui.GraphicsConfig in project intellij-community by JetBrains.
the class SwitcherToolWindowsListRenderer method doPaint.
@Override
protected void doPaint(Graphics2D g) {
GraphicsConfig config = new GraphicsConfig(g);
if (hide) {
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.15f));
}
super.doPaint(g);
config.restore();
}
use of com.intellij.openapi.ui.GraphicsConfig in project intellij-community by JetBrains.
the class JBOptionButton method paintChildren.
@Override
protected void paintChildren(Graphics g) {
super.paintChildren(g);
if (myPaintDefaultIfSingle && myOptions.length == 0) {
return;
}
if (SystemInfo.isMac && UIUtil.isUnderIntelliJLaF()) {
int x = getWidth() - getInsets().right - 10;
Icon icon = AllIcons.Mac.YosemiteOptionButtonSelector;
int y = (getHeight() - icon.getIconHeight()) / 2;
GraphicsConfig config = isEnabled() ? new GraphicsConfig(g) : GraphicsUtil.paintWithAlpha(g, 0.6f);
icon.paintIcon(this, g, x, y);
config.restore();
return;
}
boolean dark = UIUtil.isUnderDarcula();
int off = dark ? 6 : 0;
Icon icon = AllIcons.General.ArrowDown;
if (UIUtil.isUnderIntelliJLaF() && !UIUtil.isUnderWin10LookAndFeel()) {
icon = AllIcons.General.ArrowDown_white;
}
icon.paintIcon(this, g, myMoreRec.x - off, myMoreRec.y);
if (dark)
return;
final Insets insets = getInsets();
int y1 = myMoreRec.y - 2;
int y2 = getHeight() - insets.bottom - 2;
if (y1 < getInsets().top) {
y1 = insets.top;
}
final int x = myMoreRec.x - 4;
UIUtil.drawDottedLine(((Graphics2D) g), x, y1, x, y2, null, Color.darkGray);
}
use of com.intellij.openapi.ui.GraphicsConfig in project intellij-community by JetBrains.
the class IdeaActionButtonLook method paintBorder.
protected void paintBorder(Graphics g, Dimension size, int state) {
GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
try {
if (UIUtil.isUnderAquaLookAndFeel()) {
if (state == ActionButtonComponent.POPPED) {
g.setColor(JBColor.GRAY);
((Graphics2D) g).draw(getShape(size));
}
} else if (SystemInfo.isMac && UIUtil.isUnderIntelliJLaF()) {
//do nothing
} else if (UIUtil.isUnderWin10LookAndFeel()) {
g.setColor(Gray.xC4);
g.drawRect(1, 1, size.width - 3, size.height - 3);
g.setColor(Gray.xD6);
g.drawLine(2, 2, size.width - 3, 2);
g.setColor(Gray.xD9);
g.drawLine(2, 3, 2, size.width - 3);
g.drawLine(size.width - 3, 3, size.width - 3, size.width - 3);
} else {
Color color = UIUtil.isUnderDarcula() ? ColorUtil.shift(UIUtil.getPanelBackground(), 2.04D) : Gray.xA1;
g.setColor(color);
((Graphics2D) g).setStroke(BASIC_STROKE);
((Graphics2D) g).draw(getShape(size));
}
} finally {
config.restore();
}
}
use of com.intellij.openapi.ui.GraphicsConfig in project intellij-community by JetBrains.
the class SidePanelCountLabel method paintComponent.
@Override
protected void paintComponent(Graphics g) {
g.setColor(isSelected() ? UIUtil.getListSelectionBackground() : UIUtil.SIDE_PANEL_BACKGROUND);
g.fillRect(0, 0, getWidth(), getHeight());
if (StringUtil.isEmpty(getText()))
return;
final JBColor deepBlue = new JBColor(new Color(0x97A4B2), new Color(92, 98, 113));
g.setColor(isSelected() ? Gray._255.withAlpha(UIUtil.isUnderDarcula() ? 100 : 220) : deepBlue);
final GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
g.fillRoundRect(0, 3, getWidth() - 6 - 1, getHeight() - 6, getHeight() - 6, getHeight() - 6);
config.restore();
setForeground(isSelected() ? deepBlue.darker() : UIUtil.getListForeground(true));
super.paintComponent(g);
}
Aggregations