/** * Sets image watermark kind. * * @param kind * Image watermark kind. */ public void setKind(ImageWatermarkKind kind) { if (kind == null) { throw new IllegalArgumentException( "Can't pass null to SubstanceImageWatermark.setKind()"); } this.kind = kind; this.updateWatermarkImage(SubstanceLookAndFeel.getCurrentSkin(null)); }
/** * Sets image watermark kind. * * @param kind * Image watermark kind. */ public void setKind(ImageWatermarkKind kind) { if (kind == null) { throw new IllegalArgumentException( "Can't pass null to SubstanceImageWatermark.setKind()"); } this.kind = kind; this.updateWatermarkImage(SubstanceLookAndFeel.getCurrentSkin(null)); }
/** * Sets the {@link InputMapSet} to be used with Substance family. If the * specified set is <code>null</code>, the default will be reset. This * method does not require Substance to be the current look-and-feel, and * will cause Substance to be set as the current application look-and-feel. * * @param inputMapSet * The {@link InputMapSet} to be used with Substance family, or * <code>null</code> to reset to the default * * @see #getInputMapSet() * @see SubstanceLookAndFeel#SUBSTANCE_INPUT_MAP_SET_KEY */ public static void setInputMapSet(InputMapSet inputMapSet) { UIManager.put(SUBSTANCE_INPUT_MAP_SET_KEY, inputMapSet); SubstanceLookAndFeel.setSkin(SubstanceLookAndFeel.getCurrentSkin()); }
/** * Sets image watermark opacity. * * @param opacity * Image watermark opacity. * @throws IllegalArgumentException * if the argument is not in 0.0-1.0 range. */ public void setOpacity(float opacity) { if ((opacity < 0.0f) || (opacity > 1.0f)) { throw new IllegalArgumentException( "SubstanceImageWatermark.setOpacity() can get value in 0.0-1.0 range, was passed value " + opacity); } this.opacity = opacity; this.updateWatermarkImage(SubstanceLookAndFeel.getCurrentSkin(null)); } }
@Override public Icon getNumberIcon(int number) { SubstanceColorScheme colorScheme = SubstanceLookAndFeel.getCurrentSkin( null).getActiveColorScheme(DecorationAreaType.HEADER); return SubstanceImageCreator.getHexaMarker(number, colorScheme); }
@Override public Icon getNumberIcon(int number) { SubstanceColorScheme colorScheme = SubstanceLookAndFeel.getCurrentSkin( null).getActiveColorScheme(DecorationAreaType.HEADER); return SubstanceImageCreator.getHexaMarker(number, colorScheme); }
/** * Sets the {@link FontPolicy} to be used with Substance family. If the * specified policy is <code>null</code>, the default will be reset. This * method does not require Substance to be the current look-and-feel, and * will cause Substance to be set as the current application look-and-feel. * * @param fontPolicy * The {@link FontPolicy} to be used with Substance family, or * <code>null</code> to reset to the default * * @see #getFontPolicy() * @see SubstanceLookAndFeel#SUBSTANCE_FONT_POLICY_KEY */ public static void setFontPolicy(FontPolicy fontPolicy) { UIManager.put(SUBSTANCE_FONT_POLICY_KEY, fontPolicy); SubstanceSizeUtils.setControlFontSize(-1); SubstanceSizeUtils.resetPointsToPixelsRatio(fontPolicy); SubstanceLookAndFeel.setSkin(SubstanceLookAndFeel.getCurrentSkin()); }
/** * Paints background of the specified text component. * * @param g * Graphics context. * @param comp * Component. */ public static void paintTextCompBackground(Graphics g, JComponent comp) { Color backgroundFillColor = getTextBackgroundFillColor(comp); boolean toPaintWatermark = (SubstanceLookAndFeel.getCurrentSkin(comp) .getWatermark() != null) && (SubstanceCoreUtilities.toDrawWatermark(comp) || !comp .isOpaque()); paintTextCompBackground(g, comp, backgroundFillColor, toPaintWatermark); }
@Override public void run() { if (editorPane == null) return; Color foregr = editorPane.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { editorPane .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(editorPane) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(editorPane)))); } } });
@Override public void run() { if (textField == null) return; Color foregr = textField.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { textField .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(textField) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(textField)))); } } });
@Override public void run() { if (passwordField == null) return; Color foregr = passwordField.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { passwordField .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(passwordField) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(passwordField)))); } } });
@Override public void run() { if (textField == null) return; Color foregr = textField.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { textField .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(textField) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(textField)))); } } });
@Override public void run() { if (textField == null) return; Color foregr = textField.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { textField .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(textField) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(textField)))); } } });
@Override public void run() { if (passwordField == null) return; Color foregr = passwordField.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { passwordField .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(passwordField) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(passwordField)))); } } });
@Override public void run() { if (textPane == null) return; Color foregr = textPane.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { textPane .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(textPane) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(textPane)))); } } });
@Override public void run() { if (textField == null) return; Color foregr = textField.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { textField .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(textField) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(textField)))); } } });
@Override public void run() { if (textPane == null) return; Color foregr = textPane.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { textPane .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(textPane) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(textPane)))); } } });
@Override public void run() { if (editorPane == null) return; Color foregr = editorPane.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { editorPane .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(editorPane) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(editorPane)))); } } });
@Override public void run() { if (!SubstanceLookAndFeel.isCurrentLookAndFeel()) return; if (textArea == null) return; Color foregr = textArea.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { textArea .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(textArea) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(textArea)))); } } });
@Override public void run() { if (!SubstanceLookAndFeel.isCurrentLookAndFeel()) return; if (textArea == null) return; Color foregr = textArea.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { textArea .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(textArea) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(textArea)))); } } });