예제 #1
0
 @Nullable
 private RangeHighlighter addLine(
     final ChangeHighlighterHolder markup,
     int line,
     final TextDiffType type,
     SeparatorPlacement placement) {
   RangeHighlighter highlighter = markup.addLineHighlighter(line, LAYER, type, myApplied);
   if (highlighter == null) {
     return null;
   }
   highlighter.setLineSeparatorPlacement(placement);
   highlighter.setLineSeparatorRenderer(
       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 (type.isApplied()) {
               UIUtil.drawBoldDottedLine(g2, x1, x2, y, null, color, false);
             } else {
               DiffUtil.drawDoubleShadowedLine(g2, x1, x2, y, color);
             }
           }
         }
       });
   return highlighter;
 }