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


Java RectanglePainter类代码示例

本文整理汇总了Java中com.intellij.ui.paint.RectanglePainter的典型用法代码示例。如果您正苦于以下问题:Java RectanglePainter类的具体用法?Java RectanglePainter怎么用?Java RectanglePainter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: paint

import com.intellij.ui.paint.RectanglePainter; //导入依赖的package包/类
@Override
void paint(Graphics2D g) {
  Rectangle r = new Rectangle(getSize());
  JBInsets.removeFrom(r, getInsets());
  if (r.height % 2 == 1) r.height++;
  int arcSize = JBUI.scale(26);

  JBInsets.removeFrom(r, new JBInsets(1, 1, 1, 1));
  if (myTextArea.hasFocus()) {
    g.setColor(myTextArea.getBackground());
    RectanglePainter.FILL.paint(g, r.x, r.y, r.width, r.height, arcSize);
    DarculaUIUtil.paintSearchFocusRing(g, r, myTextArea, arcSize);
  }
  else {
    arcSize -= JBUI.scale(5);
    RectanglePainter
            .paint(g, r.x, r.y, r.width, r.height, arcSize, myTextArea.getBackground(), myTextArea.isEnabled() ? Gray._100 : Gray._83);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:SearchTextArea.java

示例2: draw

import com.intellij.ui.paint.RectanglePainter; //导入依赖的package包/类
protected void draw(final Graphics2D g, final int x, final int y, final int width, final int height) {
  RectanglePainter.DRAW.paint(g, x, y, width, height, null);
}
 
开发者ID:ChrisRM,项目名称:material-theme-jetbrains,代码行数:4,代码来源:UIReplacer.java

示例3: fill

import com.intellij.ui.paint.RectanglePainter; //导入依赖的package包/类
@Override
protected void fill(Graphics2D g, int x, int y, int width, int height, boolean border) {
  RectanglePainter.FILL.paint(g, x, y, width, height, Math.min(width, height));
}
 
开发者ID:JetBrains,项目名称:jediterm,代码行数:5,代码来源:ScrollPainter.java

示例4: draw

import com.intellij.ui.paint.RectanglePainter; //导入依赖的package包/类
@Override
protected void draw(Graphics2D g, int x, int y, int width, int height) {
  RectanglePainter.DRAW.paint(g, x, y, width, height, Math.min(width, height));
}
 
开发者ID:JetBrains,项目名称:jediterm,代码行数:5,代码来源:ScrollPainter.java

示例5: paint

import com.intellij.ui.paint.RectanglePainter; //导入依赖的package包/类
@Override
public void paint(@Nonnull final Crumb c, @Nonnull final Graphics2D g2, final int height, final int pageOffset) {
  final PainterSettings s = getSettings();
  final Font oldFont = g2.getFont();
  final int offset = c.getOffset() - pageOffset;

  final int width = c.getWidth();
  RectanglePainter.paint(g2, offset + 2, 2, width - 4, height - 4, ROUND_VALUE + 2, s.getBackgroundColor(c), s.getBorderColor(c));

  final Color textColor = s.getForegroundColor(c);
  if (textColor != null) {
    g2.setColor(textColor);
  }

  final Font font = s.getFont(g2, c);
  if (font != null) {
    g2.setFont(font);
  }

  final FontMetrics fm = g2.getFontMetrics();

  String string = c.getString();
  if (fm.stringWidth(string) > width) {
    final int dotsWidth = fm.stringWidth("...");
    final StringBuilder sb = new StringBuilder();
    int length = 0;
    for (int i = 0; i < string.length(); i++) {
      final int charWidth = fm.charWidth(string.charAt(i));
      if (length + charWidth + dotsWidth > width) {
        break;
      }

      length += charWidth;
      sb.append(string.charAt(i));
    }

    string = sb.append("...").toString();
  }

  g2.drawString(string, offset + ROUND_VALUE + 5, height - fm.getDescent() - 5);

  g2.setFont(oldFont);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:44,代码来源:BreadcrumbsComponent.java


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