Esempio n. 1
0
  /**
   * Registers the specified color scheme bundle and background color scheme to be used on controls
   * in decoration areas.
   *
   * @param bundle The color scheme bundle to use on controls in decoration areas.
   * @param backgroundColorScheme The color scheme to use for background of controls in decoration
   *     areas.
   * @param areaTypes Enumerates the area types that are affected by the parameters.
   */
  public void registerDecorationAreaSchemeBundle(
      SubstanceColorSchemeBundle bundle,
      SubstanceColorScheme backgroundColorScheme,
      DecorationAreaType... areaTypes) {
    if (bundle == null) return;

    if (backgroundColorScheme == null) {
      throw new IllegalArgumentException("Cannot pass null background color scheme");
    }

    for (DecorationAreaType areaType : areaTypes) {
      this.decoratedAreaSet.add(areaType);
      this.colorSchemeBundleMap.put(areaType, bundle);
      this.backgroundColorSchemeMap.put(areaType, backgroundColorScheme);

      // if (areaType == DecorationAreaType.NONE) {
      // this.defaultColorScheme = bundle.getDefaultColorScheme();
      // }
    }
    this.statesWithAlpha.addAll(bundle.getStatesWithAlpha());
  }