當前位置: 首頁>>代碼示例>>Java>>正文


Java UIUtil.drawBoldDottedLine方法代碼示例

本文整理匯總了Java中com.intellij.util.ui.UIUtil.drawBoldDottedLine方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.drawBoldDottedLine方法的具體用法?Java UIUtil.drawBoldDottedLine怎麽用?Java UIUtil.drawBoldDottedLine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.util.ui.UIUtil的用法示例。


在下文中一共展示了UIUtil.drawBoldDottedLine方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawPolygon

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private void drawPolygon(@NotNull Graphics2D g, int startY, int height, @NotNull Color color, boolean applied) {
  int scrollbarWidth = myEditor.getScrollPane().getVerticalScrollBar().getWidth();
  int startX = 0;
  int endX = startX + scrollbarWidth - 1;

  int endY = startY + height;

  g.setColor(color);
  if (!applied) {
    if (height > 2) {
      g.fillRect(startX, startY, scrollbarWidth, height);

      Color framingColor = DiffUtil.getFramingColor(color);
      UIUtil.drawLine(g, startX, startY, endX, startY, null, framingColor);
      UIUtil.drawLine(g, startX, endY, endX, endY, null, framingColor);
    }
    else {
      DiffUtil.drawDoubleShadowedLine(g, startX, endX, startY, color);
    }
  }
  else {
    UIUtil.drawBoldDottedLine(g, startX, endX, startY, null, color, false);
    UIUtil.drawBoldDottedLine(g, startX, endX, endY, null, color, false);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:26,代碼來源:EditorPlace.java

示例2: paintTextEffect

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private void paintTextEffect(Graphics2D g, float xFrom, float xTo, int y, Color effectColor, EffectType effectType) {
  int xStart = (int)xFrom;
  int xEnd = (int)xTo;
  g.setColor(effectColor);
  if (effectType == EffectType.LINE_UNDERSCORE) {
    UIUtil.drawLine(g, xStart, y + 1, xEnd, y + 1);
  }
  else if (effectType == EffectType.BOLD_LINE_UNDERSCORE) {
    int height = JBUI.scale(Registry.intValue("editor.bold.underline.height", 2));
    g.fillRect(xStart, y, xEnd - xStart, height);
  }
  else if (effectType == EffectType.STRIKEOUT) {
    int y1 = y - myView.getCharHeight() / 2;
    UIUtil.drawLine(g, xStart, y1, xEnd, y1);
  }
  else if (effectType == EffectType.WAVE_UNDERSCORE) {
    UIUtil.drawWave(g, new Rectangle(xStart, y + 1, xEnd - xStart, myView.getDescent() - 1));
  }
  else if (effectType == EffectType.BOLD_DOTTED_LINE) {
    UIUtil.drawBoldDottedLine(g, xStart, xEnd, SystemInfo.isMac ? y : y + 1, myEditor.getBackgroundColor(), g.getColor(), false);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:EditorPainter.java

示例3: drawDottedDoubleChunkBorderLine

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public static void drawDottedDoubleChunkBorderLine(@NotNull Graphics2D g, int x1, int x2, int y, @NotNull Color color) {
  UIUtil.drawBoldDottedLine(g, x1, x2, y - 1, null, color, false);
  UIUtil.drawBoldDottedLine(g, x1, x2, y, null, color, false);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:DiffDrawUtil.java

示例4: drawDottedChunkBorderLine

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public static void drawDottedChunkBorderLine(@NotNull Graphics2D g, int x1, int x2, int y, @NotNull Color color) {
  UIUtil.drawBoldDottedLine(g, x1, x2, y - 1, null, color, false);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:DiffDrawUtil.java

示例5: drawBoldDottedFramingLines

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public static void drawBoldDottedFramingLines(@NotNull Graphics2D g, int startX, int endX, int startY, int bottomY, @NotNull Color color) {
  UIUtil.drawBoldDottedLine(g, startX, endX, startY, null, color, false);
  UIUtil.drawBoldDottedLine(g, startX, endX, bottomY, null, color, false);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:DiffUtil.java

示例6: addBlock

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Nullable
private RangeHighlighter addBlock(CharSequence text, ChangeSide changeSide, final ChangeHighlighterHolder markup, TextDiffType diffType) {
  EditorColorsScheme colorScheme = markup.getEditor().getColorsScheme();
  Color separatorColor = getSeparatorColor(diffType.getLegendColor(colorScheme));

  int length = text.length();
  int start = changeSide.getStart();
  int end = start + length;
  RangeHighlighter highlighter = markup.addRangeHighlighter(start, end, LAYER, diffType, HighlighterTargetArea.EXACT_RANGE, myApplied);

  LineSeparatorRenderer lineSeparatorRenderer = new LineSeparatorRenderer() {
    @Override
    public void drawLine(Graphics g, int x1, int x2, int y) {
      Graphics2D g2 = (Graphics2D)g;
      Color color = myDiffType.getPolygonColor(markup.getEditor());
      if (color != null) {
        if (myApplied) {
          Rectangle bounds = g.getClipBounds();
          x1 = Math.max(x1, bounds.x); // do not paint line behind clip bounds - it's very slow for dotted line
          if (x1 >= x2) return;

          UIUtil.drawBoldDottedLine(g2, x1, x2, y, null, color, false);
        }
        else {
          UIUtil.drawLine(g2, x1, y, x2, y, null, DiffUtil.getFramingColor(color));
        }
      }
    }
  };

  if (highlighter != null) {
    highlighter.setLineSeparatorPlacement(SeparatorPlacement.TOP);
    highlighter.setLineSeparatorColor(separatorColor);
    highlighter.setLineSeparatorRenderer(lineSeparatorRenderer);
  }

  if (text.charAt(length - 1) == '\n') {
    end--;
  }

  highlighter = markup.addRangeHighlighter(start, end, LAYER, TextDiffType.NONE, HighlighterTargetArea.EXACT_RANGE, myApplied);
  if (highlighter != null) {
    highlighter.setLineSeparatorPlacement(SeparatorPlacement.BOTTOM);
    highlighter.setLineSeparatorColor(separatorColor);
    highlighter.setLineSeparatorRenderer(lineSeparatorRenderer);
  }
  return highlighter;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:49,代碼來源:ChangeType.java


注:本文中的com.intellij.util.ui.UIUtil.drawBoldDottedLine方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。