本文整理匯總了Java中org.pushingpixels.substance.api.ColorSchemeAssociationKind類的典型用法代碼示例。如果您正苦於以下問題:Java ColorSchemeAssociationKind類的具體用法?Java ColorSchemeAssociationKind怎麽用?Java ColorSchemeAssociationKind使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ColorSchemeAssociationKind類屬於org.pushingpixels.substance.api包,在下文中一共展示了ColorSchemeAssociationKind類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getColorSchemeForState
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
private SubstanceColorScheme getColorSchemeForState(JList list,
SubstanceListUI ui, ComponentState state) {
UpdateOptimizationInfo updateOptimizationInfo = ui
.getUpdateOptimizationInfo();
if (state == ComponentState.ENABLED) {
if (updateOptimizationInfo == null) {
return SubstanceColorSchemeUtilities
.getColorScheme(list, state);
} else {
return updateOptimizationInfo.getDefaultScheme();
}
} else {
if (updateOptimizationInfo == null) {
return SubstanceColorSchemeUtilities.getColorScheme(list,
ColorSchemeAssociationKind.HIGHLIGHT, state);
} else {
return updateOptimizationInfo.getHighlightColorScheme(state);
}
}
}
示例2: getColorSchemeForState
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
private SubstanceColorScheme getColorSchemeForState(JList list, int index,
SubstanceListUI listUI, ComponentState state) {
boolean toUseHighlightKindForCurrState = (index >= 0)
&& (state.isFacetActive(ComponentStateFacet.ROLLOVER) || state
.isFacetActive(ComponentStateFacet.SELECTION));
UpdateOptimizationInfo updateOptimizationInfo = listUI
.getUpdateOptimizationInfo();
if (toUseHighlightKindForCurrState) {
if (updateOptimizationInfo == null) {
return SubstanceColorSchemeUtilities.getColorScheme(list,
ColorSchemeAssociationKind.HIGHLIGHT, state);
} else {
return updateOptimizationInfo.getHighlightColorScheme(state);
}
} else {
if (updateOptimizationInfo == null) {
return SubstanceColorSchemeUtilities
.getColorScheme(list, state);
} else {
return updateOptimizationInfo.getDefaultScheme();
}
}
}
示例3: getIcon
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
/**
* Retrieves icon that matches the specified state of the slider thumb.
*
* @param state
* Slider state.
* @param prevState
* The previous slider state.
* @param slider
* The slider itself.
* @param sliderIcon
* The slider icon.
* @return Icon that matches the specified state of the slider thumb.
*/
private static Icon getIcon(JTree tree, boolean isCollapsed) {
ComponentState state = ((tree == null) || tree.isEnabled()) ? ComponentState.ENABLED
: ComponentState.DISABLED_UNSELECTED;
SubstanceColorScheme fillScheme = SubstanceColorSchemeUtilities
.getColorScheme(tree, state);
SubstanceColorScheme borderScheme = SubstanceColorSchemeUtilities
.getColorScheme(tree, ColorSchemeAssociationKind.BORDER,
state);
int fontSize = SubstanceSizeUtils.getComponentFontSize(tree);
HashMapKey key = SubstanceCoreUtilities.getHashKey(fontSize,
fillScheme.getDisplayName(), borderScheme.getDisplayName(),
isCollapsed);
Icon result = TreeIcon.icons.get(key);
if (result != null)
return result;
result = new ImageIcon(SubstanceImageCreator.getTreeIcon(tree,
fillScheme, borderScheme, isCollapsed));
TreeIcon.icons.put(key, result);
return result;
}
示例4: getColorScheme
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
/**
* Returns the color scheme of the specified tabbed pane tab.
*
* @param jtp
* Tabbed pane.
* @param tabIndex
* Tab index.
* @param componentState
* Tab component state.
* @return The color scheme of the specified tabbed pane tab.
*/
public static SubstanceColorScheme getColorScheme(final JTabbedPane jtp,
final int tabIndex, ColorSchemeAssociationKind associationKind,
ComponentState componentState) {
SubstanceSkin skin = SubstanceCoreUtilities.getSkin(jtp);
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 {
return getColorizedScheme(jtp, nonColorized, !componentState
.isDisabled());
}
}
示例5: getColorSchemeFill
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
private SubstanceColorScheme getColorSchemeFill(boolean hasFocus) {
if (hasFocus) {
return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.NONE,
ColorSchemeAssociationKind.FILL, ComponentState.SELECTED);
} else {
return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.NONE,
ColorSchemeAssociationKind.FILL, ComponentState.DEFAULT);
}
}
示例6: getColorSchemeBorder
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
private SubstanceColorScheme getColorSchemeBorder(boolean hasFocus) {
if (hasFocus) {
return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.NONE,
ColorSchemeAssociationKind.BORDER, ComponentState.SELECTED);
} else {
return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.NONE,
ColorSchemeAssociationKind.BORDER, ComponentState.DEFAULT);
}
}
示例7: getDefaultBackgroundColor
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
public static Color getDefaultBackgroundColor() {
if (Configuration.useRibbonInterface.get()) {
return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor();
} else {
return SystemColor.control;
}
}
示例8: getSelectedColor
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
public static Color getSelectedColor() {
if (Configuration.useRibbonInterface.get()) {
return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getBackgroundFillColor();
} else {
return SystemColor.textHighlight;
}
}
示例9: getControlColor
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
private static Color getControlColor() {
if (Configuration.useRibbonInterface.get()) {
return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor();
} else {
return SystemColor.control;
}
}
示例10: getBackgroundColor
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
public static Color getBackgroundColor() {
if (Configuration.useRibbonInterface.get()) {
return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor();
} else {
return SystemColor.control;
}
}
示例11: getColorSchemeForState
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
private SubstanceColorScheme getColorSchemeForState(JTree tree,
SubstanceTreeUI ui, ComponentState activeState) {
SubstanceColorScheme scheme = (activeState == ComponentState.ENABLED) ? ui
.getDefaultColorScheme()
: SubstanceColorSchemeUtilities.getColorScheme(tree,
ColorSchemeAssociationKind.HIGHLIGHT, activeState);
if (scheme == null) {
scheme = SubstanceColorSchemeUtilities.getColorScheme(tree,
ColorSchemeAssociationKind.HIGHLIGHT, activeState);
}
return scheme;
}
示例12: getHighlightColorScheme
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
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);
}
return result;
}
示例13: getBorderColorScheme
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
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);
}
return result;
}
示例14: getHighlightBorderColorScheme
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
public SubstanceColorScheme getHighlightBorderColorScheme(
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);
}
return result;
}
示例15: applyHighlightColorScheme
import org.pushingpixels.substance.api.ColorSchemeAssociationKind; //導入依賴的package包/類
/**
* Applies the specified highlight schemes on the relevant parts of the
* specified scheme bundle.
*
* @param schemeBundle
* Scheme bundle.
* @param highlightScheme
* Highlight scheme.
* @param highlightBorderScheme
* Highlight border scheme.
*/
private static void applyHighlightColorScheme(
SubstanceColorSchemeBundle schemeBundle,
SubstanceColorScheme highlightScheme,
SubstanceColorScheme highlightBorderScheme) {
// specify custom alpha values for the highlights
schemeBundle.registerHighlightColorScheme(highlightScheme, 0.75f,
ComponentState.ROLLOVER_UNSELECTED);
schemeBundle.registerHighlightColorScheme(highlightScheme, 0.9f,
ComponentState.SELECTED);
schemeBundle.registerHighlightColorScheme(highlightScheme, 1.0f,
ComponentState.ROLLOVER_SELECTED);
schemeBundle.registerHighlightColorScheme(highlightScheme, 1.0f,
ComponentState.ARMED, ComponentState.ROLLOVER_ARMED);
// use for borders on rollover controls
schemeBundle.registerColorScheme(highlightBorderScheme,
ColorSchemeAssociationKind.BORDER,
ComponentState.ROLLOVER_ARMED,
ComponentState.ROLLOVER_SELECTED,
ComponentState.ROLLOVER_UNSELECTED);
// use for fill of selected controls
schemeBundle.registerColorScheme(highlightScheme,
ColorSchemeAssociationKind.FILL, ComponentState.SELECTED,
ComponentState.ROLLOVER_SELECTED);
// use for borders of highlights
schemeBundle.registerColorScheme(highlightScheme,
ColorSchemeAssociationKind.HIGHLIGHT_BORDER, ComponentState
.getActiveStates());
// use for text highlight
schemeBundle.registerColorScheme(highlightScheme,
ColorSchemeAssociationKind.TEXT_HIGHLIGHT,
ComponentState.SELECTED, ComponentState.ROLLOVER_SELECTED);
// use for armed controls
schemeBundle.registerColorScheme(highlightScheme, ComponentState.ARMED,
ComponentState.ROLLOVER_ARMED);
}