Examples of SubstanceColorScheme


Examples of org.pushingpixels.substance.api.SubstanceColorScheme

  /**
   * Creates a new <code>Silver</code> skin.
   */
  public MistSilverSkin() {
    SubstanceColorScheme activeScheme = new MetallicColorScheme().tint(0.1)
        .named("Mist Silver Active");
    SubstanceColorScheme enabledScheme = new MetallicColorScheme().shade(
        0.05).named("Mist Silver Enabled");
    SubstanceColorScheme disabledScheme = new LightGrayColorScheme().tone(
        0.2).named("Mist Silver Disabled");
    SubstanceColorScheme lightBlueScheme = new SteelBlueColorScheme()
        .saturate(-0.3).tint(0.5).named("Mist Silver Light Blue");

    SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle(
        activeScheme, enabledScheme, disabledScheme);
    defaultSchemeBundle.registerColorScheme(enabledScheme.tone(0.4),
View Full Code Here

Examples of org.pushingpixels.substance.api.SubstanceColorScheme

        // elements in the drop down list
        StateTransitionTracker.ModelStateInfo modelStateInfo = listUI
            .getModelStateInfo(index, result);
        ComponentState currState = listUI.getCellState(index, result);
        if (modelStateInfo == null) {
          SubstanceColorScheme scheme = getColorSchemeForState(list,
              index, listUI, currState);
          // SubstanceColorScheme scheme =
          // SubstanceColorSchemeUtilities
          // .getColorScheme(list, kindForCurr, currState);
          result.setForeground(new ColorUIResource(scheme
              .getForegroundColor()));
        } else {
          Map<ComponentState, StateContributionInfo> activeStates = modelStateInfo
              .getStateContributionMap();
          SubstanceColorScheme colorScheme = getColorSchemeForState(
              list, index, listUI, currState);
          if (currState.isDisabled() || (activeStates == null)
              || (activeStates.size() == 1)) {
            super.setForeground(new ColorUIResource(colorScheme
                .getForegroundColor()));
          } else {
            float aggrRed = 0.0f;
            float aggrGreen = 0.0f;
            float aggrBlue = 0.0f;
            for (Map.Entry<ComponentState, StateTransitionTracker.StateContributionInfo> activeEntry : modelStateInfo
                .getStateContributionMap().entrySet()) {
              ComponentState activeState = activeEntry.getKey();
              float activeContribution = activeEntry.getValue()
                  .getContribution();
              if (activeContribution == 0.0f)
                continue;

              SubstanceColorScheme scheme = getColorSchemeForState(
                  list, index, listUI, activeState);
              // SubstanceColorScheme scheme = (activeState ==
              // ComponentState.DEFAULT) ? listUI
              // .getDefaultColorScheme()
              // : listUI.getHighlightColorScheme(activeState);
              // if (scheme == null) {
              // scheme = (activeState == ComponentState.DEFAULT)
              // ?
              // SubstanceColorSchemeUtilities
              // .getColorScheme(list, activeState)
              // : SubstanceColorSchemeUtilities
              // .getColorScheme(
              // list,
              // ColorSchemeAssociationKind.HIGHLIGHT,
              // activeState);
              // }
              Color schemeFg = scheme.getForegroundColor();
              aggrRed += schemeFg.getRed() * activeContribution;
              aggrGreen += schemeFg.getGreen()
                  * activeContribution;
              aggrBlue += schemeFg.getBlue() * activeContribution;
            }
 
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.