antialias lines

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9181]
This commit is contained in:
parrt 2011-10-24 14:41:37 -08:00
parent 08bba26940
commit 490cec9af6
1 changed files with 9 additions and 2 deletions

View File

@ -29,10 +29,13 @@
package org.antlr.v4.runtime.tree.gui;
import org.abego.treelayout.*;
import org.abego.treelayout.NodeExtentProvider;
import org.abego.treelayout.TreeForTreeLayout;
import org.abego.treelayout.TreeLayout;
import org.abego.treelayout.util.DefaultConfiguration;
import org.antlr.v4.runtime.BaseRecognizer;
import org.antlr.v4.runtime.tree.*;
import org.antlr.v4.runtime.tree.Tree;
import org.antlr.v4.runtime.tree.Trees;
import javax.swing.*;
import java.awt.*;
@ -151,6 +154,10 @@ public class TreeViewer extends JComponent {
public void paint(Graphics g) {
super.paint(g);
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
paintEdges(g, getTree().getRoot());
// paint the boxes