當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。