import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.ui.GraphicsConfig;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.ui.GraphicsUtil;
import com.intellij.util.ui.JBInsets;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import javax.swing.border.Border;
import javax.swing.tree.TreeCellRenderer;
import java.awt.*;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.PathIterator;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
}
// 2. Waved effect
if (attributes.isWaved()) {
- if (attributes.getWaveColor() != null) {
- g.setColor(attributes.getWaveColor());
- }
- final int wavedAt = textBaseline + 1;
- for (int x = offset; x <= offset + fragmentWidth; x += 4) {
- UIUtil.drawLine(g, x, wavedAt, x + 2, wavedAt + 2);
- UIUtil.drawLine(g, x + 3, wavedAt + 1, x + 4, wavedAt);
+ GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
+ Stroke oldStroke = g.getStroke();
+ try {
+ g.setStroke(new BasicStroke(.7F));
+ if (attributes.getWaveColor() != null) {
+ g.setColor(attributes.getWaveColor());
+ }
+ final int wavedAt = textBaseline + 1;
+ GeneralPath wavePath = new GeneralPath(PathIterator.WIND_EVEN_ODD);
+ wavePath.moveTo(offset, wavedAt);
+ for (int x = offset; x <= offset + fragmentWidth; x += 4) {
+ wavePath.lineTo(x + 2, wavedAt + 2);
+ wavePath.lineTo(x + 4, wavedAt);
+ }
+ g.draw(wavePath);
+ } finally {
+ config.restore();
+ g.setStroke(oldStroke);
}
}
// 3. Underline