/** * Returns the color scheme to be used for painting the watermark. If no * custom watermark color scheme is specified ({@link #watermarkScheme} is * <code>null</code>), the main default color scheme of this skin is used. * * @return The color scheme to be used for painting the watermark. */ public SubstanceColorScheme getWatermarkColorScheme() { if (this.watermarkScheme != null) { return this.watermarkScheme; } return this.colorSchemeBundleMap.get(DecorationAreaType.NONE) .getEnabledColorScheme(); }
/** * Returns the color scheme to be used for painting the watermark. If no * custom watermark color scheme is specified ({@link #watermarkScheme} is * <code>null</code>), the main default color scheme of this skin is used. * * @return The color scheme to be used for painting the watermark. */ public SubstanceColorScheme getWatermarkColorScheme() { if (this.watermarkScheme != null) { return this.watermarkScheme; } return this.colorSchemeBundleMap.get(DecorationAreaType.NONE) .getEnabledColorScheme(); }
/** * Returns the main enabled color scheme for the specific decoration area * type. Custom painting code that needs to consult the colors of the * specific component should use * {@link #getColorScheme(Component, ComponentState)} method and various * {@link SubstanceColorScheme} methods. * * @param decorationAreaType * Decoration area type. * @return The main enabled color scheme for this skin. * @see #getColorScheme(Component, ComponentState) */ public final SubstanceColorScheme getEnabledColorScheme( DecorationAreaType decorationAreaType) { if (this.colorSchemeBundleMap.containsKey(decorationAreaType)) return this.colorSchemeBundleMap.get(decorationAreaType) .getEnabledColorScheme(); return this.colorSchemeBundleMap.get(DecorationAreaType.NONE) .getEnabledColorScheme(); }
/** * Returns the main enabled color scheme for the specific decoration area * type. Custom painting code that needs to consult the colors of the * specific component should use * {@link #getColorScheme(Component, ComponentState)} method and various * {@link SubstanceColorScheme} methods. * * @param decorationAreaType * Decoration area type. * @return The main enabled color scheme for this skin. * @see #getColorScheme(Component, ComponentState) */ public final SubstanceColorScheme getEnabledColorScheme( DecorationAreaType decorationAreaType) { if (this.colorSchemeBundleMap.containsKey(decorationAreaType)) return this.colorSchemeBundleMap.get(decorationAreaType) .getEnabledColorScheme(); return this.colorSchemeBundleMap.get(DecorationAreaType.NONE) .getEnabledColorScheme(); }
/** * Registers the specified color scheme bundle to be used on controls in * decoration areas. * * @param bundle * The color scheme bundle to use on controls in decoration * areas. * @param areaTypes * Enumerates the area types that are affected by the parameters. */ public void registerDecorationAreaSchemeBundle( SubstanceColorSchemeBundle bundle, DecorationAreaType... areaTypes) { this.registerDecorationAreaSchemeBundle(bundle, bundle .getEnabledColorScheme(), areaTypes); }
/** * Returns the background color scheme for the specified decoration area * type. This method is mainly for the internal use of * {@link SubstanceDecorationPainter#paintDecorationArea(Graphics2D, Component, DecorationAreaType, int, int, SubstanceSkin)} * , but can be used in applications that wish to provide custom overlay * background painting (such as watermarks, for example). * * @param decorationAreaType * Decoration area type. * @return The background color scheme for the specified decoration area * type. */ public final SubstanceColorScheme getBackgroundColorScheme( DecorationAreaType decorationAreaType) { // 1 - check the registered background scheme for this specific area // type. if (this.backgroundColorSchemeMap.containsKey(decorationAreaType)) return this.backgroundColorSchemeMap.get(decorationAreaType); // 2 - check the registered scheme bundle for this specific area type. if (this.colorSchemeBundleMap.containsKey(decorationAreaType)) { SubstanceColorScheme registered = this.colorSchemeBundleMap.get( decorationAreaType).getEnabledColorScheme(); if (registered != null) return registered; } // 3 - return the background scheme for the default area type return this.backgroundColorSchemeMap.get(DecorationAreaType.NONE); }
/** * Registers the specified color scheme bundle to be used on controls in * decoration areas. * * @param bundle * The color scheme bundle to use on controls in decoration * areas. * @param areaTypes * Enumerates the area types that are affected by the parameters. */ public void registerDecorationAreaSchemeBundle( SubstanceColorSchemeBundle bundle, DecorationAreaType... areaTypes) { this.registerDecorationAreaSchemeBundle(bundle, bundle .getEnabledColorScheme(), areaTypes); }
/** * Returns the background color scheme for the specified decoration area * type. This method is mainly for the internal use of * {@link SubstanceDecorationPainter#paintDecorationArea(Graphics2D, Component, DecorationAreaType, int, int, SubstanceSkin)} * , but can be used in applications that wish to provide custom overlay * background painting (such as watermarks, for example). * * @param decorationAreaType * Decoration area type. * @return The background color scheme for the specified decoration area * type. */ public final SubstanceColorScheme getBackgroundColorScheme( DecorationAreaType decorationAreaType) { // 1 - check the registered background scheme for this specific area // type. if (this.backgroundColorSchemeMap.containsKey(decorationAreaType)) return this.backgroundColorSchemeMap.get(decorationAreaType); // 2 - check the registered scheme bundle for this specific area type. if (this.colorSchemeBundleMap.containsKey(decorationAreaType)) { SubstanceColorScheme registered = this.colorSchemeBundleMap.get( decorationAreaType).getEnabledColorScheme(); if (registered != null) return registered; } // 3 - return the background scheme for the default area type return this.backgroundColorSchemeMap.get(DecorationAreaType.NONE); }