org.apache.log4j.chainsaw.color
Class RuleColorizer

java.lang.Object
  extended by org.apache.log4j.chainsaw.color.RuleColorizer
All Implemented Interfaces:
Colorizer

public class RuleColorizer
extends java.lang.Object
implements Colorizer

A colorizer supporting an ordered collection of ColorRules, including support for notification of color rule changes via a propertyChangeListener and the 'colorrule' property.

Author:
Scott Deboy

Constructor Summary
RuleColorizer()
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
           
 void addRule(java.lang.String ruleSetName, org.apache.log4j.rule.ColorRule rule)
           
 void addRules(java.util.Map newRules)
           
 java.awt.Color getBackgroundColor(org.apache.log4j.spi.LoggingEvent event)
          Given a LoggingEvent, returns a Color to use for background, or null if this instance cannot determine one, or that the stanard color should be used.
 java.awt.Color getForegroundColor(org.apache.log4j.spi.LoggingEvent event)
           
 java.util.Map getRules()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void removeRule(java.lang.String ruleSetName, java.lang.String expression)
           
 void setCurrentRuleSet(java.lang.String ruleSetName)
           
 void setFindRule(org.apache.log4j.rule.Rule findRule)
           
 void setLoggerRule(org.apache.log4j.rule.Rule loggerRule)
           
 void setRules(java.util.Map rules)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleColorizer

public RuleColorizer()
Method Detail

setLoggerRule

public void setLoggerRule(org.apache.log4j.rule.Rule loggerRule)

setFindRule

public void setFindRule(org.apache.log4j.rule.Rule findRule)

setRules

public void setRules(java.util.Map rules)

getRules

public java.util.Map getRules()

addRules

public void addRules(java.util.Map newRules)

addRule

public void addRule(java.lang.String ruleSetName,
                    org.apache.log4j.rule.ColorRule rule)

removeRule

public void removeRule(java.lang.String ruleSetName,
                       java.lang.String expression)

setCurrentRuleSet

public void setCurrentRuleSet(java.lang.String ruleSetName)

getBackgroundColor

public java.awt.Color getBackgroundColor(org.apache.log4j.spi.LoggingEvent event)
Description copied from interface: Colorizer
Given a LoggingEvent, returns a Color to use for background, or null if this instance cannot determine one, or that the stanard color should be used.

Specified by:
getBackgroundColor in interface Colorizer
Returns:
background color

getForegroundColor

public java.awt.Color getForegroundColor(org.apache.log4j.spi.LoggingEvent event)
Specified by:
getForegroundColor in interface Colorizer

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)
Parameters:
propertyName -
listener -


Copyright © 2007 Apache Software Foundation. All Rights Reserved.