summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/gui/BoxHighlightPainter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cuchaz/enigma/gui/BoxHighlightPainter.java')
-rw-r--r--src/main/java/cuchaz/enigma/gui/BoxHighlightPainter.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/cuchaz/enigma/gui/BoxHighlightPainter.java b/src/main/java/cuchaz/enigma/gui/BoxHighlightPainter.java
index efe6b50..b66d13d 100644
--- a/src/main/java/cuchaz/enigma/gui/BoxHighlightPainter.java
+++ b/src/main/java/cuchaz/enigma/gui/BoxHighlightPainter.java
@@ -21,12 +21,12 @@ import javax.swing.text.JTextComponent;
21 21
22public abstract class BoxHighlightPainter implements Highlighter.HighlightPainter { 22public abstract class BoxHighlightPainter implements Highlighter.HighlightPainter {
23 23
24 private Color m_fillColor; 24 private Color fillColor;
25 private Color m_borderColor; 25 private Color borderColor;
26 26
27 protected BoxHighlightPainter(Color fillColor, Color borderColor) { 27 protected BoxHighlightPainter(Color fillColor, Color borderColor) {
28 m_fillColor = fillColor; 28 this.fillColor = fillColor;
29 m_borderColor = borderColor; 29 this.borderColor = borderColor;
30 } 30 }
31 31
32 @Override 32 @Override
@@ -34,17 +34,17 @@ public abstract class BoxHighlightPainter implements Highlighter.HighlightPainte
34 Rectangle bounds = getBounds(text, start, end); 34 Rectangle bounds = getBounds(text, start, end);
35 35
36 // fill the area 36 // fill the area
37 if (m_fillColor != null) { 37 if (this.fillColor != null) {
38 g.setColor(m_fillColor); 38 g.setColor(this.fillColor);
39 g.fillRoundRect(bounds.x, bounds.y, bounds.width, bounds.height, 4, 4); 39 g.fillRoundRect(bounds.x, bounds.y, bounds.width, bounds.height, 4, 4);
40 } 40 }
41 41
42 // draw a box around the area 42 // draw a box around the area
43 g.setColor(m_borderColor); 43 g.setColor(this.borderColor);
44 g.drawRoundRect(bounds.x, bounds.y, bounds.width, bounds.height, 4, 4); 44 g.drawRoundRect(bounds.x, bounds.y, bounds.width, bounds.height, 4, 4);
45 } 45 }
46 46
47 protected static Rectangle getBounds(JTextComponent text, int start, int end) { 47 public static Rectangle getBounds(JTextComponent text, int start, int end) {
48 try { 48 try {
49 // determine the bounds of the text 49 // determine the bounds of the text
50 Rectangle bounds = text.modelToView(start).union(text.modelToView(end)); 50 Rectangle bounds = text.modelToView(start).union(text.modelToView(end));