code: public SeaGlassPainter getBackgroundPainter(SynthContext ctx) {
          Values  v      = getValues(ctx);
          int     xstate = getExtendedState(ctx, v);
          SeaGlassPainter p      = null;
  
          // check the cache
          tmpKey.init("backgroundPainter$$instance", xstate);
          p = (SeaGlassPainter) v.cache.get(tmpKey);
  
          if (p != null)
              return p;
  
          // not in cache, so lookup and store in cache
          RuntimeState s         = null;
          int[]        lastIndex = new int[] { -1 };
  
          while ((s = getNextState(v.states, lastIndex, xstate)) != null) {
  
              if (s.backgroundPainter != null) {
                  p = s.backgroundPainter;
  
                  break;
              }
          }
  
          if (p == null)
              p = (SeaGlassPainter) get(ctx, "backgroundPainter");
  
          if (p != null) {
              v.cache.put(new CacheKey("backgroundPainter$$instance", xstate), p);
          }
  
          return p;
      }
docs: Gets the appropriate background Painter, if there is one, for the state
  specified in the given SynthContext. This method does appropriate
  fallback searching, as described in #get.
  
  @param  ctx The SynthContext. Must not be null.
  
  @return The background painter associated for the given state, or null if
  none could be found.