summaryrefslogtreecommitdiff
path: root/src/cuchaz/enigma/gui/SelectionHighlightPainter.java
diff options
context:
space:
mode:
authorGravatar jeff2014-08-22 01:25:52 -0400
committerGravatar jeff2014-08-22 01:25:52 -0400
commit32b7ea70ff20d3584f8021e598141c20c2200398 (patch)
treebb5b26427c76b9e31ff146e952e765c9c36b3383 /src/cuchaz/enigma/gui/SelectionHighlightPainter.java
parentfixed constructor references in call graph searches (diff)
downloadenigma-fork-32b7ea70ff20d3584f8021e598141c20c2200398.tar.gz
enigma-fork-32b7ea70ff20d3584f8021e598141c20c2200398.tar.xz
enigma-fork-32b7ea70ff20d3584f8021e598141c20c2200398.zip
added show token effects
Diffstat (limited to 'src/cuchaz/enigma/gui/SelectionHighlightPainter.java')
-rw-r--r--src/cuchaz/enigma/gui/SelectionHighlightPainter.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/cuchaz/enigma/gui/SelectionHighlightPainter.java b/src/cuchaz/enigma/gui/SelectionHighlightPainter.java
new file mode 100644
index 0000000..35f9451
--- /dev/null
+++ b/src/cuchaz/enigma/gui/SelectionHighlightPainter.java
@@ -0,0 +1,35 @@
1/*******************************************************************************
2 * Copyright (c) 2014 Jeff Martin.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the GNU Public License v3.0
5 * which accompanies this distribution, and is available at
6 * http://www.gnu.org/licenses/gpl.html
7 *
8 * Contributors:
9 * Jeff Martin - initial API and implementation
10 ******************************************************************************/
11package cuchaz.enigma.gui;
12
13import java.awt.BasicStroke;
14import java.awt.Color;
15import java.awt.Graphics;
16import java.awt.Graphics2D;
17import java.awt.Rectangle;
18import java.awt.Shape;
19
20import javax.swing.text.Highlighter;
21import javax.swing.text.JTextComponent;
22
23public class SelectionHighlightPainter implements Highlighter.HighlightPainter
24{
25 @Override
26 public void paint( Graphics g, int start, int end, Shape shape, JTextComponent text )
27 {
28 // draw a thick border
29 Graphics2D g2d = (Graphics2D)g;
30 Rectangle bounds = BoxHighlightPainter.getBounds( text, start, end );
31 g2d.setColor( Color.black );
32 g2d.setStroke( new BasicStroke( 2.0f ) );
33 g2d.drawRoundRect( bounds.x, bounds.y, bounds.width, bounds.height, 4, 4 );
34 }
35}