Apache Lucene open-source search software
Changed visibility of methods to allow easier extensions - Thx Dave Spencer for suggestion. Subclasses can now override highlightTerm to format text with spans/divs etc instead of default <font> tag
Mark Harwoodb64bf341ff87
diff --git a/sandbox/contributions/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java b/sandbox/contributions/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.javaindex 680b0f87f17..cbea86c3e15 100644--- a/sandbox/contributions/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java+++ b/sandbox/contributions/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java@@ -143,7 +143,7 @@ public class GradientFormatter implements Formatterreturn sb.toString();}- private String getForegroundColorString(float score)+ protected String getForegroundColorString(float score){int rVal = getColorVal(fgRMin, fgRMax, score);int gVal = getColorVal(fgGMin, fgGMax, score);@@ -156,7 +156,7 @@ public class GradientFormatter implements Formatterreturn sb.toString();}- private String getBackgroundColorString(float score)+ protected String getBackgroundColorString(float score){int rVal = getColorVal(bgRMin, bgRMax, score);int gVal = getColorVal(bgGMin, bgGMax, score);