Examples of SubstanceColorScheme


Examples of org.pushingpixels.substance.api.SubstanceColorScheme

        bounds.y, this.tree.getWidth() - this.tree.getInsets().right
            - this.tree.getInsets().left, bounds.height);
    if (dropLocation != null && dropLocation.getChildIndex() == -1
        && tree.getRowForPath(dropLocation.getPath()) == row) {
      // mark drop location
      SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
          .getColorScheme(tree,
              ColorSchemeAssociationKind.TEXT_HIGHLIGHT,
              currState);
      SubstanceColorScheme borderScheme = SubstanceColorSchemeUtilities
          .getColorScheme(tree, ColorSchemeAssociationKind.BORDER,
              currState);
      HighlightPainterUtils.paintHighlight(g2d, this.rendererPane,
          renderer, rowRectangle, 0.8f, null, scheme, borderScheme);
    } else {
      if (hasHighlights) {
        if (activeStates == null) {
          float alpha = SubstanceColorSchemeUtilities
              .getHighlightAlpha(this.tree, currState);
          if (alpha > 0.0f) {
            SubstanceColorScheme fillScheme = SubstanceColorSchemeUtilities
                .getColorScheme(this.tree,
                    ColorSchemeAssociationKind.HIGHLIGHT,
                    currState);
            SubstanceColorScheme borderScheme = SubstanceColorSchemeUtilities
                .getColorScheme(this.tree,
                    ColorSchemeAssociationKind.HIGHLIGHT,
                    currState);
            g2d.setComposite(LafWidgetUtilities.getAlphaComposite(
                this.tree, alpha, g));
            // Fix for defect 180 - painting the
            // highlight beneath the entire row
            HighlightPainterUtils.paintHighlight(g2d,
                this.rendererPane, renderer, rowRectangle,
                0.8f, null, fillScheme, borderScheme);
            g2d.setComposite(LafWidgetUtilities.getAlphaComposite(
                this.tree, g));
          }
        } else {
          for (Map.Entry<ComponentState, StateTransitionTracker.StateContributionInfo> stateEntry : activeStates
              .entrySet()) {
            ComponentState activeState = stateEntry.getKey();
            float alpha = SubstanceColorSchemeUtilities
                .getHighlightAlpha(this.tree, activeState)
                * stateEntry.getValue().getContribution();
            if (alpha == 0.0f)
              continue;
            SubstanceColorScheme fillScheme = SubstanceColorSchemeUtilities
                .getColorScheme(this.tree,
                    ColorSchemeAssociationKind.HIGHLIGHT,
                    activeState);
            SubstanceColorScheme borderScheme = SubstanceColorSchemeUtilities
                .getColorScheme(this.tree,
                    ColorSchemeAssociationKind.HIGHLIGHT,
                    activeState);
            g2d.setComposite(LafWidgetUtilities.getAlphaComposite(
                this.tree, alpha, g));
View Full Code Here

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

Examples of org.pushingpixels.substance.api.SubstanceColorScheme

    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

Examples of org.pushingpixels.substance.api.SubstanceColorScheme

        && 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

Examples of org.pushingpixels.substance.api.SubstanceColorScheme

        && 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

Examples of org.pushingpixels.substance.api.SubstanceColorScheme

   * @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

Examples of org.pushingpixels.substance.api.SubstanceColorScheme

    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

Examples of org.pushingpixels.substance.api.SubstanceColorScheme

  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

Examples of org.pushingpixels.substance.api.SubstanceColorScheme

  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

Examples of org.pushingpixels.substance.api.SubstanceColorScheme

    }
    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
TOP
Copyright © 2018 www.massapi.com. 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.