.getColorSchemes(getClass().getResource(NAME + ".colorschemes")); final SubstanceColorScheme activeScheme = schemes.get("RuneLite Active"); final SubstanceColorScheme enabledScheme = schemes.get("RuneLite Enabled");
/** * Creates a new close action. */ public CloseAction() { super(SubstanceCoreUtilities.getResourceBundle(rootPane).getString( "SystemMenu.close"), SubstanceImageCreator.getCloseIcon( SubstanceCoreUtilities.getSkin(rootPane) .getActiveColorScheme( DecorationAreaType.PRIMARY_TITLE_PANE), SubstanceCoreUtilities.getSkin(rootPane) .getBackgroundColorScheme( DecorationAreaType.PRIMARY_TITLE_PANE))); }
.getBackgroundColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE); Component titlePaneComp = SubstanceLookAndFeel .getTitlePaneComponent(SwingUtilities.windowForComponent(c)); SubstanceColorScheme borderScheme = skin.getColorScheme(titlePaneComp, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED);
/** * Creates a new maximize action. */ public MaximizeAction() { super( SubstanceCoreUtilities.getResourceBundle(rootPane) .getString("SystemMenu.maximize"), SubstanceImageCreator .getMaximizeIcon( SubstanceCoreUtilities .getSkin(rootPane) .getActiveColorScheme( DecorationAreaType.PRIMARY_TITLE_PANE), SubstanceCoreUtilities .getSkin(rootPane) .getEnabledColorScheme( DecorationAreaType.PRIMARY_TITLE_PANE))); }
.getActiveColorScheme(DecorationAreaType.NONE); SubstanceColorScheme mainEnabledScheme = skin .getEnabledColorScheme(DecorationAreaType.NONE); SubstanceColorScheme mainDisabledScheme = skin .getDisabledColorScheme(DecorationAreaType.NONE); Color controlText = new ColorUIResource(mainActiveScheme .getLightColor()); .getForegroundColor(mainDisabledScheme); Color disabledTextComponentForegroundColor = disabledForegroundColor; float alpha = skin.getAlpha(null, ComponentState.DISABLED_UNSELECTED); if (alpha < 1.0f) { ColorUIResource defaultTextBackgroundColor = SubstanceColorUtilities Color lineBwColor = new ColorUIResource(new Color(lcb, lcb, lcb)); SubstanceColorScheme textHighlightColorScheme = skin.getColorScheme( (Component) null, ColorSchemeAssociationKind.TEXT_HIGHLIGHT, ComponentState.SELECTED); if (textHighlightColorScheme == null) { textHighlightColorScheme = skin.getColorScheme(null, ComponentState.ROLLOVER_SELECTED); .getBackgroundColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE); skin.isRegisteredAsDecorationArea(DecorationAreaType.HEADER) ? new ColorUIResource( skin.getActiveColorScheme(DecorationAreaType.HEADER) .getMidColor())
public Object[] getDefaults(Object mSkin) { SubstanceSkin skin = (SubstanceSkin) mSkin; final SubstanceColorScheme mainActiveScheme = skin .getActiveColorScheme(DecorationAreaType.NONE); SubstanceColorScheme mainEnabledScheme = skin .getEnabledColorScheme(DecorationAreaType.NONE); SubstanceColorScheme mainDisabledScheme = skin .getDisabledColorScheme(DecorationAreaType.NONE); Color foregroundColor = SubstanceColorUtilities .getForegroundColor(mainEnabledScheme); .getForegroundColor(mainDisabledScheme); SubstanceColorScheme highlightColorScheme = skin.getColorScheme( (Component) null, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.SELECTED); if (highlightColorScheme == null) { highlightColorScheme = skin.getColorScheme(null, ComponentState.ROLLOVER_SELECTED); .getEnabledColorScheme(DecorationAreaType.HEADER); Color titlePaneForeground = new ColorUIResource(SubstanceColorUtilities .getForegroundColor(headerDecorationTheme));
@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); } }
private SubstanceColorScheme getColorScheme() { SubstanceSkin skin = SubstanceCortex.GlobalScope.getCurrentSkin(); return skin.getActiveColorScheme( SubstanceSlices.DecorationAreaType.NONE); }
/** * 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()); }
fadeGraphics.setColor(tabColor); fadeGraphics.fillRect(0, 0, fw, fh); if (skin.getWatermark() != null) { fadeGraphics.translate(-x, -y); skin.getWatermark().drawWatermarkImage(fadeGraphics, tabPane, x, y, fw, fh); fadeGraphics.translate(x, y); .getSelectedTabFadeStart(), skin .getSelectedTabFadeEnd());
if (!newSkin.isValid()) return false; if (!newSkin.isValid()) { return false; if ((currentSkin != null) && (currentSkin.getWatermark() != null)) { currentSkin.getWatermark().dispose(); if (newSkin.getWatermark() != null) { if (!newSkin.getWatermark().updateWatermarkImage(newSkin)) { return false; initFontDefaults(lafDefaults, SubstanceLookAndFeel .getFontPolicy().getFontSet("Substance", null)); newSkin.addCustomEntriesToTable(lafDefaults); SubstanceLookAndFeel.componentPlugins .processAllDefaultsEntries(lafDefaults, newSkin);
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(); } };
SubstanceColorScheme bgScheme = skin.getBackgroundColorScheme(DecorationAreaType.HEADER); SubstanceWatermark watermark = skin.getWatermark(); if ((watermark != null) && SubstanceCoreUtilities.toDrawWatermark(comp)) { watermark.drawWatermarkImage(g2d, comp, 0, 0, comp.getWidth(), comp.getHeight());
.getWatermark(); if (watermark != null) { watermark.drawWatermarkImage(g2d, comp, 0, 0, comp.getWidth(), comp
boolean isShowing = c.isShowing(); if (isShowing && (decorationType != DecorationAreaType.NONE) && (skin.isRegisteredAsDecorationArea(decorationType))) { .getSkin(c).getWatermark(); if ((watermark != null) && !isPreviewMode && !isInCellRenderer && SubstanceCoreUtilities.toDrawWatermark(c)) {
: skin.isRegisteredAsDecorationArea(decorationAreaType) || (skin.getOverlayPainters(decorationAreaType).size() > 0); toUseAlphaColors = toUseAlphaColors || toEnforceAlphaColors;
/** * 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()); }
SubstanceDecorationPainter painter = skin.getDecorationPainter(); .getWatermark(); if ((watermark != null) && !isPreviewMode && !isInCellRenderer && c.isShowing() && SubstanceCoreUtilities.toDrawWatermark(c)) {
/** * Paints all registered overlays on the specified component. Overlay * painters are registered with * {@link SubstanceSkin#addOverlayPainter(SubstanceOverlayPainter, DecorationAreaType...)} * API. * * @param g * Graphics context. * @param c * Component. * @param skin * Component skin. * @param decorationAreaType * Component decoration area type. */ public static void paintOverlays(Graphics g, Component c, SubstanceSkin skin, DecorationAreaType decorationAreaType) { List<SubstanceOverlayPainter> overlayPainters = skin .getOverlayPainters(decorationAreaType); if (overlayPainters.size() == 0) return; for (SubstanceOverlayPainter overlayPainter : overlayPainters) { Graphics2D g2d = (Graphics2D) g.create(); overlayPainter.paintOverlay(g2d, c, decorationAreaType, c .getWidth(), c.getHeight(), skin); g2d.dispose(); } } }
public UpdateOptimizationInfo(JComponent component) { this.component = component; this.toDrawWatermark = SubstanceCoreUtilities .toDrawWatermark(this.component); this.defaultScheme = SubstanceColorSchemeUtilities.getColorScheme( this.component, ComponentState.ENABLED); this.decorationAreaType = SubstanceLookAndFeel .getDecorationType(this.component); SubstanceSkin skin = SubstanceCoreUtilities.getSkin(this.component); this.isInDecorationArea = (this.decorationAreaType != null) && skin.isRegisteredAsDecorationArea(this.decorationAreaType) && SubstanceCoreUtilities.isOpaque(this.component); }