Package org.pushingpixels.substance.api

Examples of org.pushingpixels.substance.api.SubstanceColorScheme


    if (skin == null) {
      SubstanceCoreUtilities
          .traceSubstanceApiUsage(jtp,
              "Substance delegate used when Substance is not the current LAF");
    }
    SubstanceColorScheme nonColorized = skin.getColorScheme(jtp,
        associationKind, componentState);
    if (tabIndex >= 0) {
      Component component = jtp.getComponentAt(tabIndex);
      SubstanceColorScheme colorized = getColorizedScheme(component,
          nonColorized, jtp.getForegroundAt(tabIndex), jtp
              .getBackgroundAt(tabIndex), !componentState
              .isDisabled());
      return colorized;
    } else {
View Full Code Here


    if (skin == null) {
      SubstanceCoreUtilities
          .traceSubstanceApiUsage(component,
              "Substance delegate used when Substance is not the current LAF");
    }
    SubstanceColorScheme nonColorized = skin.getColorScheme(component,
        componentState);

    return getColorizedScheme(orig, nonColorized, !componentState
        .isDisabled());
  }
View Full Code Here

        && SubstanceCoreUtilities.hasFlatAppearance(component, false)
        && (componentState == ComponentState.ENABLED)) {
      component = component.getParent();
    }

    SubstanceColorScheme nonColorized = SubstanceCoreUtilities.getSkin(
        component).getColorScheme(component, associationKind,
        componentState);
    return getColorizedScheme(component, nonColorized, !componentState
        .isDisabled());
  }
View Full Code Here

        && SubstanceCoreUtilities.hasFlatAppearance(component, false)
        && (componentState == ComponentState.ENABLED)) {
      component = component.getParent();
    }

    SubstanceColorScheme nonColorized = SubstanceCoreUtilities.getSkin(
        component).getActiveColorScheme(
        SubstanceLookAndFeel.getDecorationType(component));
    return getColorizedScheme(component, nonColorized, !componentState
        .isDisabled());
  }
View Full Code Here

   * @return Transformed color scheme.
   */
  private SubstanceColorScheme getShiftScheme(SubstanceColorScheme orig) {
    HashMapKey key = SubstanceCoreUtilities.getHashKey(orig
        .getDisplayName(), this.getDisplayName(), this.transform);
    SubstanceColorScheme result = transformMap.get(key);
    if (result == null) {
      result = this.transform.transform(orig);
      transformMap.put(key, result);
    }
    return result;
View Full Code Here

    ClassicButtonShaper shaper = ClassicButtonShaper.INSTANCE;
    int comboFontSize = SubstanceSizeUtils.getComponentFontSize(combo);
    float radius = SubstanceSizeUtils
        .getClassicButtonCornerRadius(comboFontSize);

    SubstanceColorScheme baseFillScheme = SubstanceColorSchemeUtilities
        .getColorScheme(combo, currState);
    SubstanceColorScheme baseBorderScheme = SubstanceColorSchemeUtilities
        .getColorScheme(combo, ColorSchemeAssociationKind.BORDER,
            currState);

    HashMapKey keyBase = SubstanceCoreUtilities.getHashKey(width, height,
        baseFillScheme.getDisplayName(), baseBorderScheme
            .getDisplayName(), fillPainter.getDisplayName(),
        borderPainter.getDisplayName(), combo.getClass().getName(),
        radius, comboFontSize);
    BufferedImage layerBase = regularBackgrounds.get(keyBase);
    if (layerBase == null) {
      layerBase = createBackgroundImage(combo, shaper, fillPainter,
          borderPainter, width, height, baseFillScheme,
          baseBorderScheme, radius);
      regularBackgrounds.put(keyBase, layerBase);
    }
    if (currState.isDisabled() || (activeStates.size() == 1)) {
      return layerBase;
    }

    BufferedImage result = SubstanceCoreUtilities.getBlankImage(width,
        height);
    Graphics2D g2d = result.createGraphics();
    // draw the base layer
    g2d.drawImage(layerBase, 0, 0, null);
    // System.out.println("\nPainting base state " + currState);

    // draw the other active layers
    for (Map.Entry<ComponentState, StateTransitionTracker.StateContributionInfo> activeEntry : activeStates
        .entrySet()) {
      ComponentState activeState = activeEntry.getKey();
      // System.out.println("Painting state " + activeState + "[curr is "
      // + currState + "] with " + activeEntry.getValue());
      if (activeState == currState)
        continue;

      float stateContribution = activeEntry.getValue().getContribution();
      if (stateContribution > 0.0f) {
        g2d.setComposite(AlphaComposite.SrcOver
            .derive(stateContribution));

        SubstanceColorScheme fillScheme = SubstanceColorSchemeUtilities
            .getColorScheme(combo, activeState);
        SubstanceColorScheme borderScheme = SubstanceColorSchemeUtilities
            .getColorScheme(combo,
                ColorSchemeAssociationKind.BORDER, activeState);
        HashMapKey key = SubstanceCoreUtilities.getHashKey(width,
            height, fillScheme.getDisplayName(), borderScheme
                .getDisplayName(),
            fillPainter.getDisplayName(), borderPainter
                .getDisplayName(), combo.getClass().getName(),
            radius, comboFontSize);
        BufferedImage layer = regularBackgrounds.get(key);
View Full Code Here

  public SubstanceColorScheme getHighlightColorScheme(ComponentState state) {
    if (this.highlightSchemeMap == null) {
      this.highlightSchemeMap = new HashMap<ComponentState, SubstanceColorScheme>();
          //ComponentState.class);
    }
    SubstanceColorScheme result = this.highlightSchemeMap.get(state);
    if (result == null) {
      result = SubstanceColorSchemeUtilities
          .getColorScheme(this.component,
              ColorSchemeAssociationKind.HIGHLIGHT, state);
      this.highlightSchemeMap.put(state, result);
View Full Code Here

  public SubstanceColorScheme getBorderColorScheme(ComponentState state) {
    if (this.borderSchemeMap == null) {
      this.borderSchemeMap = new HashMap<ComponentState, SubstanceColorScheme>();
          //ComponentState.class);
    }
    SubstanceColorScheme result = this.borderSchemeMap.get(state);
    if (result == null) {
      result = SubstanceColorSchemeUtilities.getColorScheme(
          this.component, ColorSchemeAssociationKind.BORDER, state);
      this.borderSchemeMap.put(state, result);
    }
View Full Code Here

    }
    if (this.fillSchemeMap == null) {
      this.fillSchemeMap = new HashMap<ComponentState, SubstanceColorScheme>();
          //ComponentState.class);
    }
    SubstanceColorScheme result = this.fillSchemeMap.get(state);
    if (result == null) {
      result = SubstanceColorSchemeUtilities.getColorScheme(
          this.component, state);
      this.fillSchemeMap.put(state, result);
    }
View Full Code Here

      ComponentState state) {
    if (this.highlightBorderSchemeMap == null) {
      this.highlightBorderSchemeMap = new HashMap<ComponentState, SubstanceColorScheme>();
          //ComponentState.class);
    }
    SubstanceColorScheme result = this.highlightBorderSchemeMap.get(state);
    if (result == null) {
      result = SubstanceColorSchemeUtilities.getColorScheme(
          this.component,
          ColorSchemeAssociationKind.HIGHLIGHT_BORDER, state);
      this.highlightBorderSchemeMap.put(state, result);
View Full Code Here

TOP

Related Classes of org.pushingpixels.substance.api.SubstanceColorScheme

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.