code: public static Insets getPaintingInsets(SynthContext state, Insets insets) {
          if (state.getRegion().isSubregion()) {
              insets = state.getStyle().getInsets(state, insets);
          } else {
              insets = state.getComponent().getInsets(insets);
          }
  
          return insets;
      }
docs: A convenience method to return where the foreground should be painted for
  the Component identified by the passed in AbstractSynthContext.
  
  @param  state  the SynthContext representing the current state.
  @param  insets an Insets object to be filled with the painting insets.
  
  @return the insets object passed in and filled with the painting insets.