@Override public ColorSchemeAssociationKind getColorSchemeAssociationKind( ComponentState state) { if (!state.isDisabled() && (state != ComponentState.ENABLED)) { // use HIGHLIGHT return ColorSchemeAssociationKind.HIGHLIGHT; } return ColorSchemeAssociationKind.MARK; } };
private SubstanceColorScheme getColorSchemeForState(JXTaskPane group, ComponentState state) { ColorSchemeAssociationKind assocKind = ColorSchemeAssociationKind.FILL; if (!state.isDisabled() && (state != ComponentState.ENABLED)) { // use HIGHLIGHT assocKind = ColorSchemeAssociationKind.HIGHLIGHT; } SubstanceColorScheme currScheme = SubstanceColorSchemeUtilities .getColorScheme(group, assocKind, state); return currScheme; }
.containsKey(state)) continue; if (state.isDisabled()) continue; if (state == ComponentState.ENABLED)
.containsKey(state)) continue; if (state.isDisabled()) continue; if (state == ComponentState.ENABLED)
if (state.isDisabled()) continue; if (state == ComponentState.ENABLED)
if (state.isDisabled()) continue; if (state == ComponentState.ENABLED)
if (!currState.isDisabled() && (currState != ComponentState.ENABLED)) currAssocKind = ColorSchemeAssociationKind.HIGHLIGHT; SubstanceColorScheme colorScheme = SubstanceColorSchemeUtilities .getColorScheme(menuComponent, currAssocKind, currState); if (currState.isDisabled() || (activeStates == null) || (activeStates.size() == 1)) { return colorScheme.getForegroundColor(); ColorSchemeAssociationKind assocKind = ColorSchemeAssociationKind.FILL; if (!activeState.isDisabled() && (activeState != ComponentState.ENABLED)) assocKind = ColorSchemeAssociationKind.HIGHLIGHT;
|| (button instanceof JRadioButton) || (button instanceof JCheckBox)) { if (!currState.isDisabled()) { currState = ComponentState.ENABLED; activeStates = null; if (currState.isDisabled() || (activeStates == null) || (activeStates.size() == 1)) { return colorScheme.getForegroundColor();
@Override protected Color getPaintColor(JXTaskPane group) { StateTransitionTracker.ModelStateInfo modelStateInfo = stateTransitionTracker .getModelStateInfo(); Map<ComponentState, StateTransitionTracker.StateContributionInfo> activeStates = modelStateInfo .getStateContributionMap(); ComponentState currState = stateTransitionTracker .getModelStateInfo().getCurrModelState(); if (currState.isDisabled() || (activeStates.size() == 1)) return getColorSchemeForState(group, currState) .getForegroundColor(); float aggrRed = 0; float aggrGreen = 0; float aggrBlue = 0; for (Map.Entry<ComponentState, StateTransitionTracker.StateContributionInfo> activeEntry : modelStateInfo .getStateContributionMap().entrySet()) { ComponentState activeState = activeEntry.getKey(); SubstanceColorScheme scheme = getColorSchemeForState(group, activeState); Color schemeFg = scheme.getForegroundColor(); float contribution = activeEntry.getValue().getContribution(); aggrRed += schemeFg.getRed() * contribution; aggrGreen += schemeFg.getGreen() * contribution; aggrBlue += schemeFg.getBlue() * contribution; } return new Color((int) aggrRed, (int) aggrGreen, (int) aggrBlue); }
/** * Returns the color scheme of the component. * * @param component * Component. * @param associationKind * Association kind. * @param componentState * Component state. * @return Component color scheme. */ public static SubstanceColorScheme getColorScheme(Component component, ColorSchemeAssociationKind associationKind, ComponentState componentState) { // special case - if the component is marked as flat and // it is in the default state, get the color scheme of the parent. // However, flat toolbars should be ignored, since they are // the "top" level decoration area. if (!(component instanceof JToolBar) && 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()); }
/** * Returns the color scheme of the component. * * @param component * Component. * @param associationKind * Association kind. * @param componentState * Component state. * @return Component color scheme. */ public static SubstanceColorScheme getColorScheme(Component component, ColorSchemeAssociationKind associationKind, ComponentState componentState) { // special case - if the component is marked as flat and // it is in the default state, get the color scheme of the parent. // However, flat toolbars should be ignored, since they are // the "top" level decoration area. if (!(component instanceof JToolBar) && 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()); }
.getColorScheme(comp, ColorSchemeAssociationKind.MARK, currState); if (currState.isDisabled() || (activeStates == null) || (activeStates.size() == 1)) { return colorScheme.getFocusRingColor();
/** * Returns the color scheme of the component. * * @param component * Component. * @param componentState * Component state. * @return Component color scheme. */ public static SubstanceColorScheme getActiveColorScheme( Component component, ComponentState componentState) { // special case - if the component is marked as flat and // it is in the default state, get the color scheme of the parent. // However, flat toolbars should be ignored, since they are // the "top" level decoration area. if (!(component instanceof JToolBar) && 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()); }
/** * Returns the color scheme of the component. * * @param component * Component. * @param associationKind * Association kind. * @param componentState * Component state. * @return Component color scheme. */ public static SubstanceColorScheme getActiveColorScheme( Component component, ComponentState componentState) { // special case - if the component is marked as flat and // it is in the default state, get the color scheme of the parent. // However, flat toolbars should be ignored, since they are // the "top" level decoration area. if (!(component instanceof JToolBar) && 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()); }
nonColorized, jtp.getForegroundAt(tabIndex), jtp .getBackgroundAt(tabIndex), !componentState .isDisabled()); return colorized; } else { return getColorizedScheme(jtp, nonColorized, !componentState .isDisabled());
nonColorized, jtp.getForegroundAt(tabIndex), jtp .getBackgroundAt(tabIndex), !componentState .isDisabled()); return colorized; } else { return getColorizedScheme(jtp, nonColorized, !componentState .isDisabled());
|| currState .isFacetActive(ComponentStateFacet.SELECTION) || currState.isDisabled()) {
|| currState .isFacetActive(ComponentStateFacet.SELECTION) || currState.isDisabled()) {