Package org.apache.log4j.chainsaw.color

## Class RuleColorizer

- java.lang.Object
- - org.apache.log4j.chainsaw.color.RuleColorizer

- All Implemented Interfaces:
    `Colorizer`

      public class RuleColorizer
      extends 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 <sdeboy@apache.org>

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `RuleColorizer()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addPropertyChangeListener​(PropertyChangeListener listener)` |
    `void` | `addPropertyChangeListener​(String propertyName, PropertyChangeListener listener)` |
    `void` | `addRule​(String ruleSetName, org.apache.log4j.rule.ColorRule rule)` |
    `void` | `addRules​(Map newRules)` |
    `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.
    `List` | `getCurrentRules()` |
    `Vector` | `getDefaultColors()` |
    `org.apache.log4j.rule.Rule` | `getFindRule()` |
    `Color` | `getForegroundColor​(org.apache.log4j.spi.LoggingEvent event)` |
    `org.apache.log4j.rule.Rule` | `getLoggerRule()` |
    `Map` | `getRules()` |
    `void` | `loadColorSettings​(String name)` | Load panel color settings if they exist - otherwise, load default color settings
    `void` | `removePropertyChangeListener​(PropertyChangeListener listener)` |
    `void` | `removeRule​(String ruleSetName, String expression)` |
    `void` | `saveColorSettings​(String name)` | Save panel color settings
    `void` | `setCurrentRuleSet​(String ruleSetName)` |
    `void` | `setFindRule​(org.apache.log4j.rule.Rule findRule)` |
    `void` | `setLoggerRule​(org.apache.log4j.rule.Rule loggerRule)` |
    `void` | `setRules​(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)

    - #### getFindRule

          public org.apache.log4j.rule.Rule getFindRule()

    - #### getLoggerRule

          public org.apache.log4j.rule.Rule getLoggerRule()

    - #### setRules

          public void setRules​(Map rules)

    - #### getRules

          public Map getRules()

    - #### getCurrentRules

          public List getCurrentRules()

    - #### addRules

          public void addRules​(Map newRules)

    - #### addRule

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

    - #### removeRule

          public void removeRule​(String ruleSetName,
                                 String expression)

    - #### setCurrentRuleSet

          public void setCurrentRuleSet​(String ruleSetName)

    - #### getBackgroundColor

          public 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 Color getForegroundColor​(org.apache.log4j.spi.LoggingEvent event)

      Specified by:
        `getForegroundColor` in interface `Colorizer`

    - #### addPropertyChangeListener

          public void addPropertyChangeListener​(PropertyChangeListener listener)

    - #### removePropertyChangeListener

          public void removePropertyChangeListener​(PropertyChangeListener listener)

    - #### addPropertyChangeListener

          public void addPropertyChangeListener​(String propertyName,
                                                PropertyChangeListener listener)

      Parameters:
        `propertyName` -
        `listener` -

    - #### saveColorSettings

          public void saveColorSettings​(String name)

      Save panel color settings

    - #### loadColorSettings

          public void loadColorSettings​(String name)

      Load panel color settings if they exist - otherwise, load default color settings

    - #### getDefaultColors

          public Vector getDefaultColors()