当前位置: 首页>>代码示例>>Java>>正文


Java UISettings.setupAntialiasing方法代码示例

本文整理汇总了Java中com.intellij.ide.ui.UISettings.setupAntialiasing方法的典型用法代码示例。如果您正苦于以下问题:Java UISettings.setupAntialiasing方法的具体用法?Java UISettings.setupAntialiasing怎么用?Java UISettings.setupAntialiasing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ide.ui.UISettings的用法示例。


在下文中一共展示了UISettings.setupAntialiasing方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: paintIcon

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
public void paintIcon(final Component c, Graphics graphics) {
  if (myCounter <= 0)
    return;
  final Rectangle moreRect = getIconRec();

  if (moreRect == null) return;

  int iconY = getIconY(moreRect);
  int iconX = getIconX(moreRect);
  graphics.setFont(UIUtil.getLabelFont().deriveFont((float)Math.min(8, UIUtil.getButtonFont().getSize())));
  int width = graphics.getFontMetrics().stringWidth(String.valueOf(myCounter));
  iconX -= width / 2 + 1;

  AllIcons.General.MoreTabs.paintIcon(c, graphics, iconX, iconY);
  Graphics g = graphics.create();
  try {
    UISettings.setupAntialiasing(g);
    UIUtil.drawStringWithHighlighting(g, String.valueOf(myCounter),
                                      iconX + AllIcons.General.MoreTabs.getIconWidth() + 2,
                                      iconY + AllIcons.General.MoreTabs.getIconHeight() - 5,
                                      JBColor.BLACK,
                                      ColorUtil.withAlpha(JBColor.WHITE, .9));
  } finally {
    g.dispose();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:MoreTabsIcon.java

示例2: paintEmptyText

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
public void paintEmptyText(@NotNull final JComponent splitters, @NotNull Graphics g) {
  UISettings.setupAntialiasing(g);
  g.setColor(new JBColor(Gray._80, Gray._160));
  g.setFont(JBUI.Fonts.label(16f));
  UIUtil.TextPainter painter = new UIUtil.TextPainter().withLineSpacing(1.8f);
  advertiseActions(splitters, painter);
  painter.draw(g, new PairFunction<Integer, Integer, Couple<Integer>>() {
    @Override
    public Couple<Integer> fun(Integer width, Integer height) {
      Dimension s = splitters.getSize();
      int w = (s.width - width) / 2;
      int h = s.height * 3 / 8; // fix vertical position @ golden ratio
      return Couple.of(w, h);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:EditorEmptyTextPainter.java

示例3: paintComponent

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
public void paintComponent(Graphics g) {
  Icon icon = getIcon();
  FontMetrics fm = getFontMetrics(getFont());
  Rectangle viewRect = new Rectangle(getSize());
  JBInsets.removeFrom(viewRect, getInsets());

  Rectangle iconRect = new Rectangle();
  Rectangle textRect = new Rectangle();
  String text = SwingUtilities.layoutCompoundLabel(this, fm, getText(), icon,
                                                   SwingConstants.CENTER, horizontalTextAlignment(),
                                                   SwingConstants.CENTER, horizontalTextPosition(),
                                                   viewRect, iconRect, textRect, iconTextSpace());
  ActionButtonLook look = ActionButtonLook.IDEA_LOOK;
  look.paintBackground(g, this);
  look.paintIconAt(g, this, icon, iconRect.x, iconRect.y);
  look.paintBorder(g, this);

  UISettings.setupAntialiasing(g);
  g.setColor(isButtonEnabled() ? getForeground() : getInactiveTextColor());
  SwingUtilities2.drawStringUnderlineCharAt(this, g, text,
                                            getMnemonicCharIndex(text),
                                            textRect.x,
                                            textRect.y + fm.getAscent());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ActionButtonWithText.java

示例4: paint

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
@Override
public void paint(Graphics g) {
  boolean isDarkBackground = UIUtil.isUnderDarcula();
  UISettings.setupAntialiasing(g);
  g.setColor(new JBColor(isDarkBackground ? Gray._230 : Gray._80, Gray._160));
  g.setFont(JBUI.Fonts.label(isDarkBackground ? 24f : 20f));

  UIUtil.TextPainter painter = new UIUtil.TextPainter().withLineSpacing(1.5f);
  painter.withShadow(true, new JBColor(Gray._200.withAlpha(100), Gray._0.withAlpha(255)));

  painter.appendLine("No files are open");//.underlined(new JBColor(Gray._150, Gray._180));
  painter.draw(g, new PairFunction<Integer, Integer, Couple<Integer>>() {
    @Override
    public Couple<Integer> fun(Integer width, Integer height) {
      Dimension s = EmptyStatePanel.this.getSize();
      return Couple.of((s.width - width) / 2, (s.height - height) / 2);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:PreviewManagerImpl.java

示例5: paint

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
@Override
public void paint(Graphics g) {
  Rectangle clip = g.getClipBounds();
  if (clip.height <= 0 || maxContentWidth == 0) {
    return;
  }

  if (atLineStart) {
    // don't paint in the overlapped region
    if (clip.x >= maxContentWidth) {
      return;
    }

    g.setColor(editor.getBackgroundColor());
    g.fillRect(clip.x, clip.y, Math.min(clip.width, maxContentWidth - clip.x), clip.height);
  }

  UISettings.setupAntialiasing(g);

  Graphics2D g2 = (Graphics2D)g;
  Object hint = g2.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
  if (!UIUtil.isRetina()) {
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
  }

  try {
    paintAnnotations(g, clip);
  }
  finally {
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, hint);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:ConsoleGutterComponent.java

示例6: drawString

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
protected void drawString(Graphics g, String s, int accChar, int textX, int textY) {
  UISettings.setupAntialiasing(g);
  if (s.indexOf('\n') == -1)
    BasicGraphicsUtils.drawString(g, s, accChar, textX, textY);
  else {
    String[] strs = splitStringByLines(s);
    int height = g.getFontMetrics().getHeight();
    // Only the first line can have the accel char
    BasicGraphicsUtils.drawString(g, strs[0], accChar, textX, textY);
    for (int i = 1; i < strs.length; i++) {
      g.drawString(strs[i], textX, textY + (height * i));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:MultiLineLabelUI.java

示例7: paintComponent

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
protected void paintComponent(Graphics g) {
  g.setColor(GroupedElementsRenderer.POPUP_SEPARATOR_FOREGROUND);

  if (hasCaption()) {
    Rectangle viewR = new Rectangle(0, getVgap(), getWidth() - 1, getHeight() - getVgap() - 1);
    Rectangle iconR = new Rectangle();
    Rectangle textR = new Rectangle();
    String s = SwingUtilities
      .layoutCompoundLabel(g.getFontMetrics(), myCaption, null, CENTER,
                           myCaptionCentered ? CENTER : LEFT,
                           CENTER,
                           myCaptionCentered ? CENTER : LEFT,
                           viewR, iconR, textR, 0);
    final int lineY = textR.y + textR.height / 2;
    if (s.equals(myCaption) && viewR.width - textR.width > 2 * getHgap()) {
      if (myCaptionCentered) {
        g.drawLine(0, lineY, textR.x - getHgap(), lineY);
      }
      g.drawLine(textR.x + textR.width + getHgap(), lineY, getWidth() - 1, lineY);
    }
    UISettings.setupAntialiasing(g);
    g.setColor(GroupedElementsRenderer.POPUP_SEPARATOR_TEXT_FOREGROUND);
    g.drawString(s, textR.x, textR.y + g.getFontMetrics().getAscent());
  }
  else {
    g.drawLine(0, getVgap(), getWidth() - 1, getVgap());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:SeparatorWithText.java

示例8: paintComponent

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
protected void paintComponent(final Graphics g) {
  if (myCompact) {
    super.paintComponent(g);
    return;
  }

  final GraphicsConfig c = GraphicsUtil.setupAAPainting(g);
  UISettings.setupAntialiasing(g);

  int arc = 8;
  Color bg = getBackground();
  final Rectangle bounds = myProcessName.getBounds();
  final Rectangle label = SwingUtilities.convertRectangle(myProcessName.getParent(), bounds, this);

  g.setColor(UIUtil.getPanelBackground());
  g.fillRoundRect(0, 0, getWidth() - 1, getHeight() - 1, arc, arc);

  if (!UIUtil.isUnderDarcula()) {
    bg = ColorUtil.toAlpha(bg.darker().darker(), 230);
    g.setColor(bg);

    g.fillRoundRect(0, 0, getWidth() - 1, getHeight() - 1, arc, arc);

    g.setColor(UIUtil.getPanelBackground());
    g.fillRoundRect(0, getHeight() / 2, getWidth() - 1, getHeight() / 2, arc, arc);
    g.fillRect(0, (int)label.getMaxY() + 1, getWidth() - 1, getHeight() / 2);
  } else {
    bg = bg.brighter();
    g.setColor(bg);
    g.drawLine(0, (int)label.getMaxY() + 1, getWidth() - 1, (int)label.getMaxY() + 1);
  }

  g.setColor(bg);
  g.drawRoundRect(0, 0, getWidth() - 1, getHeight() - 1, arc, arc);

  c.restore();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:InlineProgressIndicator.java

示例9: paintChildren

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
@Override
protected void paintChildren(Graphics g) {
  Graphics2D graphics = (Graphics2D) g.create();

  UISettings.setupAntialiasing(graphics);
  super.paintChildren(graphics);

  Rectangle r = getBounds();
  if (!isActive() && !UIUtil.isUnderDarcula()) {
    graphics.setColor(new Color(255, 255, 255, 30));
    graphics.fill(r);
  }

  graphics.dispose();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ToolWindowHeader.java

示例10: paint

import com.intellij.ide.ui.UISettings; //导入方法依赖的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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DialogWrapperPeerImpl.java

示例11: paintIcon

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
  UISettings.setupAntialiasing(g);
  if (myTextHeight <= 0) {
    myTextHeight = g.getFont().createGlyphVector(((Graphics2D)g).getFontRenderContext(), myText).getPixelBounds(null, 0, 0).height;
  }

  g.setColor(UIUtil.getLabelForeground());
  g.drawString(myText, x + 2, y + myControlHeight - ((myControlHeight - myTextHeight) / 2));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:TextIcon.java

示例12: applyRenderingHints

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
protected void applyRenderingHints(Graphics g) {
  UISettings.setupAntialiasing(g);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:HighlightableComponent.java

示例13: applyAdditionalHints

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
protected void applyAdditionalHints(@NotNull Graphics2D g) {
  UISettings.setupAntialiasing(g);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:SimpleColoredComponent.java

示例14: paint

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
@Override
public void paint(@NotNull Graphics g) {
  UISettings.setupAntialiasing(g);
  //noinspection Since15
  super.paint(g);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:IdeFrameImpl.java

示例15: paint

import com.intellij.ide.ui.UISettings; //导入方法依赖的package包/类
@Override
public void paint(Graphics g) {
  UISettings.setupAntialiasing(g);
  super.paint(g);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:FrameWrapper.java


注:本文中的com.intellij.ide.ui.UISettings.setupAntialiasing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。