forked from phoedos/pmd
minor optimization
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4711 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -21,12 +21,13 @@ import java.awt.Color;
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
public class SourceCodePanel
|
||||
extends JPanel
|
||||
implements ViewerModelListener {
|
||||
public class SourceCodePanel extends JPanel implements ViewerModelListener {
|
||||
|
||||
private ViewerModel model;
|
||||
private JTextArea sourceCodeArea;
|
||||
|
||||
private static final Color highlightColor = new Color(79, 237, 111);
|
||||
|
||||
public SourceCodePanel(ViewerModel model) {
|
||||
this.model = model;
|
||||
init();
|
||||
@ -69,7 +70,7 @@ public class SourceCodePanel
|
||||
(sourceCodeArea.getLineStartOffset(node.getEndLine() - 1) +
|
||||
node.getEndColumn());
|
||||
sourceCodeArea.getHighlighter().addHighlight(startOffset, end,
|
||||
new DefaultHighlighter.DefaultHighlightPainter(new Color(79, 237, 111)));
|
||||
new DefaultHighlighter.DefaultHighlightPainter(highlightColor));
|
||||
sourceCodeArea.moveCaretPosition(startOffset);
|
||||
} catch (BadLocationException exc) {
|
||||
throw new IllegalStateException(exc.getMessage());
|
||||
|
Reference in New Issue
Block a user