@Override public void paintDecorationArea(Graphics2D graphics, Component comp, DecorationAreaType decorationAreaType, int width, int height, SubstanceSkin skin) { graphics .setColor(skin.getBackgroundColorScheme( DecorationAreaType.PRIMARY_TITLE_PANE) .getBackgroundFillColor()); graphics.fillRect(0, 0, width, height); } }
public void paintDecorationArea(Graphics2D graphics, Component comp, DecorationAreaType decorationAreaType, int width, int height, SubstanceSkin skin) { graphics .setColor(skin.getBackgroundColorScheme( DecorationAreaType.PRIMARY_TITLE_PANE) .getBackgroundFillColor()); graphics.fillRect(0, 0, width, height); } }
@Override public void propertyChange(PropertyChangeEvent e) { super.propertyChange(e); String pName = e.getPropertyName(); if (pName.equals("active")) { SubstanceSkin skin = SubstanceCoreUtilities.getSkin(this.titleBar); SubstanceColorScheme bgColorScheme = skin.getBackgroundColorScheme(DecorationAreaType.HEADER); Color bgFillColor = bgColorScheme.getBackgroundFillColor(); Color fgColor = bgColorScheme.getForegroundColor(); boolean isActive = ((Boolean) e.getNewValue()).booleanValue(); if (isActive) { titleBar.getTitleLabel().setForeground(fgColor); } else { fgColor = SubstanceColorUtilities.getInterpolatedColor(fgColor, bgFillColor, 0.2f); titleBar.getTitleLabel().setForeground(fgColor); } titleBar.getTitleLabel().repaint(); } }
public void paint(Graphics2D g, Object jxTitledPanel, int width, int height) { JComponent titledPanel = (JComponent) jxTitledPanel; Graphics2D g2d = (Graphics2D) g.create(); // g2d.translate(10, 10); DecorationAreaType decorationType = SubstanceLookAndFeel .getDecorationType(titledPanel); if ((decorationType != null) && (SubstanceCoreUtilities.getSkin(titledPanel) .isRegisteredAsDecorationArea(decorationType))) { DecorationPainterUtils.paintDecorationBackground(g2d, titledPanel, false); } else { BackgroundPaintingUtils.fillAndWatermark(g2d, titledPanel, SubstanceCoreUtilities.getSkin(titledPanel) .getBackgroundColorScheme(decorationType) .getBackgroundFillColor(), new Rectangle(0, 0, titledPanel.getWidth(), titledPanel .getHeight())); } g2d.dispose(); } };
@Override public void installUI(JComponent c) { super.installUI(c); SubstanceLookAndFeel.setDecorationType(this.titleBar, DecorationAreaType.GENERAL); Color backgr = this.titleBar.getBackground(); if (backgr == null || backgr instanceof UIResource) { Color toSet = SubstanceColorSchemeUtilities.getColorScheme(this.titleBar, ComponentState.ENABLED).getBackgroundFillColor(); this.titleBar.setBackground(new ColorUIResource(toSet)); } SubstanceSkin skin = SubstanceCoreUtilities.getSkin(this.titleBar); SubstanceColorScheme bgColorScheme = skin.getBackgroundColorScheme(DecorationAreaType.HEADER); Color bgFillColor = bgColorScheme.getBackgroundFillColor(); Color fgColor = bgColorScheme.getForegroundColor(); fgColor = SubstanceColorUtilities.getInterpolatedColor(fgColor, bgFillColor, 0.2f); titleBar.getTitleLabel().setForeground(fgColor); }
/** * Returns the default background color for the components of the specified * class. * * @param toTreatAsTextComponent * if the component is to be colored as a text component. * @param skin * Skin. * @param isDisabled * Indication whether the result should be for disabled * components. * @return The default background color for the components of the specified * class. */ public static ColorUIResource getDefaultBackgroundColor( boolean toTreatAsTextComponent, SubstanceSkin skin, boolean isDisabled) { if (toTreatAsTextComponent || isDisabled) return new ColorUIResource(skin.getEnabledColorScheme( DecorationAreaType.NONE).getTextBackgroundFillColor()); return new ColorUIResource(skin.getEnabledColorScheme( DecorationAreaType.NONE).getBackgroundFillColor()); }
/** * Returns the default background color for the components of the specified * class. * * @param componentClass * Component class. * @param skin * Skin. * @param isDisabled * Indication whether the result should be for disabled * components. * @return The default background color for the components of the specified * class. */ public static ColorUIResource getDefaultBackgroundColor( boolean toTreatAsTextComponent, SubstanceSkin skin, boolean isDisabled) { if (toTreatAsTextComponent || isDisabled) return new ColorUIResource(skin.getEnabledColorScheme( DecorationAreaType.NONE).getTextBackgroundFillColor()); return new ColorUIResource(skin.getEnabledColorScheme( DecorationAreaType.NONE).getBackgroundFillColor()); }
/** * Returns the default background color for the specified component. * * @param comp * Component. * @param compState * Component state. * @return The default background color for the components of the specified * class. */ public static ColorUIResource getDefaultBackgroundColor(Component comp, ComponentState compState) { if (comp instanceof JTextComponent) { // special case for text-based components return new ColorUIResource(SubstanceColorSchemeUtilities .getColorScheme(comp, compState) .getTextBackgroundFillColor()); } return new ColorUIResource(SubstanceLookAndFeel.getCurrentSkin(comp) .getBackgroundColorScheme( SubstanceLookAndFeel.getDecorationType(comp)) .getBackgroundFillColor()); }
@Override protected void installDefaults() { super.installDefaults(); Font f = this.desktopIcon.getFont(); if ((f == null) || (f instanceof UIResource)) { this.desktopIcon.setFont(UIManager.getFont("DesktopIcon.font")); } this.width = UIManager.getInt("DesktopIcon.width"); this.desktopIcon.setBackground(SubstanceCoreUtilities.getSkin( this.desktopIcon.getInternalFrame()).getBackgroundColorScheme( DecorationAreaType.SECONDARY_TITLE_PANE) // SubstanceColorSchemeUtilities // //.getColorScheme(this.desktopIcon.getInternalFrame(), // ComponentState.ACTIVE). .getBackgroundFillColor()); }
/** * Returns the default background color for the specified component. * * @param comp * Component. * @param compState * Component state. * @return The default background color for the components of the specified * class. */ public static ColorUIResource getDefaultBackgroundColor(Component comp, ComponentState compState) { if (comp instanceof JTextComponent) { // special case for text-based components return new ColorUIResource(SubstanceColorSchemeUtilities .getColorScheme(comp, compState) .getTextBackgroundFillColor()); } return new ColorUIResource(SubstanceLookAndFeel.getCurrentSkin(comp) .getBackgroundColorScheme( SubstanceLookAndFeel.getDecorationType(comp)) .getBackgroundFillColor()); }
@Override protected void installDefaults() { super.installDefaults(); Font f = this.desktopIcon.getFont(); if ((f == null) || (f instanceof UIResource)) { this.desktopIcon.setFont(UIManager.getFont("DesktopIcon.font")); } this.width = UIManager.getInt("DesktopIcon.width"); this.desktopIcon.setBackground(SubstanceCoreUtilities.getSkin( this.desktopIcon.getInternalFrame()).getBackgroundColorScheme( DecorationAreaType.SECONDARY_TITLE_PANE) // SubstanceColorSchemeUtilities // //.getColorScheme(this.desktopIcon.getInternalFrame(), // ComponentState.ACTIVE). .getBackgroundFillColor()); }
component.isEnabled() ? ComponentState.ENABLED : ComponentState.DISABLED_UNSELECTED); backgr = scheme.getBackgroundFillColor(); } else { ComponentState state = component.isEnabled() ? ComponentState.ENABLED
component.isEnabled() ? ComponentState.ENABLED : ComponentState.DISABLED_UNSELECTED); backgr = scheme.getBackgroundFillColor(); } else { ComponentState state = component.isEnabled() ? ComponentState.ENABLED
.getForegroundColor(mainEnabledScheme); Color backgroundColor = new ColorUIResource(mainActiveScheme .getBackgroundFillColor()); Color disabledForegroundColor = SubstanceColorUtilities .getForegroundColor(mainDisabledScheme);
.getForegroundColor(mainEnabledScheme); Color backgroundActiveColor = new ColorUIResource(mainActiveScheme .getBackgroundFillColor()); Color backgroundDefaultColor = new ColorUIResource(mainEnabledScheme .getBackgroundFillColor()); Color textBackgroundColor = new ColorUIResource(mainActiveScheme .getTextBackgroundFillColor()); textHighlightColorScheme.getForegroundColor()); Color selectionCellBackgroundColor = new ColorUIResource( textHighlightColorScheme.getBackgroundFillColor());
.getForegroundColor(mainEnabledScheme); Color backgroundActiveColor = new ColorUIResource( mainActiveScheme.getBackgroundFillColor()); Color backgroundDefaultColor = new ColorUIResource( mainEnabledScheme.getBackgroundFillColor()); Color textBackgroundColor = new ColorUIResource( mainActiveScheme.getTextBackgroundFillColor()); textHighlightColorScheme.getForegroundColor()); Color selectionCellBackgroundColor = new ColorUIResource( textHighlightColorScheme.getBackgroundFillColor()); new ColorUIResource(skin.getBackgroundColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE).getBackgroundFillColor()), new ColorUIResource(skin.getColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED).getBackgroundFillColor()), new ColorUIResource(mainEnabledScheme.getBackgroundFillColor()), ? DecorationAreaType.PRIMARY_TITLE_PANE : DecorationAreaType.PRIMARY_TITLE_PANE_INACTIVE ).getBackgroundFillColor()), ? DecorationAreaType.PRIMARY_TITLE_PANE : DecorationAreaType.PRIMARY_TITLE_PANE_INACTIVE, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED).getBackgroundFillColor()), new ColorUIResource(skin.getBackgroundColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE).getBackgroundFillColor()), new ColorUIResource(skin.getBackgroundColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE_INACTIVE).getBackgroundFillColor()),