Skip to content

Commit

Permalink
Rename renderColorTokens to colorTokens
Browse files Browse the repository at this point in the history
For #400
  • Loading branch information
kirill-grouchnikov committed Dec 16, 2024
1 parent dfcf094 commit b286b1a
Show file tree
Hide file tree
Showing 61 changed files with 493 additions and 493 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public Check() {
RadianceSkin skin = RadianceThemingCortex.ComponentScope.getCurrentSkin(this.getRootPane());
if (skin instanceof TonalSkin) {
setIconImage(RadianceLogo.getLogoImage(this,
skin.getBackgroundRenderColorTokens(
skin.getBackgroundColorTokens(
RadianceThemingSlices.DecorationAreaType.PRIMARY_TITLE_PANE)));
} else {
setIconImage(RadianceLogo.getLogoImage(this,
Expand All @@ -99,7 +99,7 @@ public Check() {
RadianceSkin skin = RadianceThemingCortex.ComponentScope.getCurrentSkin(getRootPane());
if (skin instanceof TonalSkin) {
setIconImage(RadianceLogo.getLogoImage(Check.this,
skin.getBackgroundRenderColorTokens(
skin.getBackgroundColorTokens(
DecorationAreaType.PRIMARY_TITLE_PANE)));
} else {
setIconImage(RadianceLogo.getLogoImage(Check.this,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.pushingpixels.radiance.theming.api.RadianceThemingCortex;
import org.pushingpixels.radiance.theming.api.RadianceThemingSlices;
import org.pushingpixels.radiance.theming.api.colorscheme.RadianceColorScheme;
import org.pushingpixels.radiance.theming.api.palette.ExtendedContainerRenderColorTokens;
import org.pushingpixels.radiance.theming.api.palette.ExtendedContainerColorTokens;

import javax.swing.*;
import java.awt.*;
Expand All @@ -53,10 +53,10 @@ public static RadianceIcon getLogoIcon(RadianceColorScheme scheme) {
return base;
}

public static RadianceIcon getLogoIcon(ExtendedContainerRenderColorTokens renderColorTokens) {
public static RadianceIcon getLogoIcon(ExtendedContainerColorTokens colorTokens) {
// Step 1 - create a colorized version of the transcoded Radiance logo
RadianceIcon base = radiance_menu.factory().createNewIcon();
base.setColorFilter(color -> renderColorTokens.getBaseContainerColorTokens()
base.setColorFilter(color -> colorTokens.getBaseContainerColorTokens()
.getOnContainer());
// Step 2 - configure the colorized version to be 16x16
base.setDimension(new Dimension(16, 16));
Expand All @@ -68,8 +68,8 @@ public static BufferedImage getLogoImage(Component comp, RadianceColorScheme sch
return getLogoIcon(scheme).toImage(RadianceCommonCortex.getScaleFactor(comp));
}

public static BufferedImage getLogoImage(Component comp, ExtendedContainerRenderColorTokens renderColorTokens) {
return getLogoIcon(renderColorTokens).toImage(RadianceCommonCortex.getScaleFactor(comp));
public static BufferedImage getLogoImage(Component comp, ExtendedContainerColorTokens colorTokens) {
return getLogoIcon(colorTokens).toImage(RadianceCommonCortex.getScaleFactor(comp));
}

public static void configureOn(JFrame frame) {
Expand All @@ -86,11 +86,11 @@ public static void configureOn(JFrame frame) {
public static void tonalConfigureOn(JFrame frame) {
frame.setIconImage(RadianceLogo.getLogoImage(frame,
RadianceThemingCortex.ComponentScope.getCurrentSkin(frame.getRootPane())
.getBackgroundRenderColorTokens(RadianceThemingSlices.DecorationAreaType.PRIMARY_TITLE_PANE)));
.getBackgroundColorTokens(RadianceThemingSlices.DecorationAreaType.PRIMARY_TITLE_PANE)));
RadianceThemingCortex.GlobalScope.registerSkinChangeListener(() -> SwingUtilities.invokeLater(
() -> frame.setIconImage(RadianceLogo.getLogoImage(frame,
RadianceThemingCortex.ComponentScope.getCurrentSkin(frame.getRootPane())
.getBackgroundRenderColorTokens(
.getBackgroundColorTokens(
RadianceThemingSlices.DecorationAreaType.PRIMARY_TITLE_PANE)))));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
package org.pushingpixels.radiance.demo.theming.main.check;

import org.pushingpixels.radiance.theming.api.colorscheme.RadianceColorScheme;
import org.pushingpixels.radiance.theming.api.palette.ContainerRenderColorTokens;
import org.pushingpixels.radiance.theming.api.palette.ContainerColorTokens;
import org.pushingpixels.radiance.theming.api.titlepane.DefaultTitlePaneButtonsProvider;
import org.pushingpixels.radiance.theming.api.titlepane.TitlePaneButtonProvider;

Expand Down Expand Up @@ -67,7 +67,7 @@ public void drawIcon(Graphics2D g, RadianceColorScheme scheme, float alpha, int
}

@Override
public void drawIcon(Graphics2D g, ContainerRenderColorTokens renderColorTokens,
public void drawIcon(Graphics2D g, ContainerColorTokens colorTokens,
float alpha, int iconSize) {
Graphics2D graphics = (Graphics2D) g.create();
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
Expand All @@ -78,7 +78,7 @@ public void drawIcon(Graphics2D g, ContainerRenderColorTokens renderColorTokens,
int start = iconSize / 4;
int end = iconSize - start;

Color primaryColor = renderColorTokens.getOnContainer();
Color primaryColor = colorTokens.getOnContainer();

Stroke primaryStroke = new BasicStroke(1.5f,
BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
Expand Down Expand Up @@ -125,7 +125,7 @@ public void drawIcon(Graphics2D g, RadianceColorScheme scheme, float alpha, int
}

@Override
public void drawIcon(Graphics2D g, ContainerRenderColorTokens renderColorTokens, float alpha, int iconSize) {
public void drawIcon(Graphics2D g, ContainerColorTokens colorTokens, float alpha, int iconSize) {
Graphics2D graphics = (Graphics2D) g.create();
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
Expand All @@ -135,7 +135,7 @@ public void drawIcon(Graphics2D g, ContainerRenderColorTokens renderColorTokens,
int start = iconSize / 4;
int end = iconSize - start;

Color primaryColor = renderColorTokens.getOnContainer();
Color primaryColor = colorTokens.getOnContainer();

Stroke primaryStroke = new BasicStroke(1.5f,
BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
Expand Down Expand Up @@ -182,7 +182,7 @@ public void drawIcon(Graphics2D g, RadianceColorScheme scheme, float alpha, int
}

@Override
public void drawIcon(Graphics2D g, ContainerRenderColorTokens renderColorTokens, float alpha, int iconSize) {
public void drawIcon(Graphics2D g, ContainerColorTokens colorTokens, float alpha, int iconSize) {
Graphics2D graphics = (Graphics2D) g.create();
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
Expand All @@ -192,7 +192,7 @@ public void drawIcon(Graphics2D g, ContainerRenderColorTokens renderColorTokens,
int start = iconSize / 4;
int end = iconSize - start;

Color primaryColor = renderColorTokens.getOnContainer();
Color primaryColor = colorTokens.getOnContainer();

Stroke primaryStroke = new BasicStroke(1.5f,
BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
Expand Down Expand Up @@ -239,7 +239,7 @@ public void drawIcon(Graphics2D g, RadianceColorScheme scheme, float alpha, int
}

@Override
public void drawIcon(Graphics2D g, ContainerRenderColorTokens renderColorTokens, float alpha, int iconSize) {
public void drawIcon(Graphics2D g, ContainerColorTokens colorTokens, float alpha, int iconSize) {
Graphics2D graphics = (Graphics2D) g.create();
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
Expand All @@ -250,7 +250,7 @@ public void drawIcon(Graphics2D g, ContainerRenderColorTokens renderColorTokens,
int end = iconSize - start;
int mid = (start + end) / 2;

Color primaryColor = renderColorTokens.getOnContainer();
Color primaryColor = colorTokens.getOnContainer();

Stroke primaryStroke = new BasicStroke(1.5f,
BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
import org.pushingpixels.radiance.theming.api.*;
import org.pushingpixels.radiance.theming.api.colorscheme.RadianceColorScheme;
import org.pushingpixels.radiance.theming.api.painter.border.RadianceBorderPainter;
import org.pushingpixels.radiance.theming.api.palette.ContainerRenderColorTokens;
import org.pushingpixels.radiance.theming.api.palette.ExtendedContainerRenderColorTokens;
import org.pushingpixels.radiance.theming.api.palette.ContainerColorTokens;
import org.pushingpixels.radiance.theming.api.palette.ExtendedContainerColorTokens;
import org.pushingpixels.radiance.theming.api.palette.TonalSkin;
import org.pushingpixels.radiance.theming.internal.painter.DecorationPainterUtils;

Expand Down Expand Up @@ -89,7 +89,7 @@ protected void paintComponent(Graphics g) {
RadianceSkin skin = RadianceThemingCortex.ComponentScope.getCurrentSkin(this);
Color accentedFill = Color.RED;
if (skin instanceof TonalSkin) {
ExtendedContainerRenderColorTokens colorTokens = skin.getBackgroundRenderColorTokens(
ExtendedContainerColorTokens colorTokens = skin.getBackgroundColorTokens(
DecorationPainterUtils.getDecorationType(this));
accentedFill = colorTokens.getBaseContainerColorTokens()
.getContainerLow();
Expand Down Expand Up @@ -167,7 +167,7 @@ public void paintBorder(Component c, Graphics g, int x, int y, int width, int he
1.0f, 0, radiusOuter);

if (skin instanceof TonalSkin) {
ContainerRenderColorTokens containerTokens = skin.getRenderColorTokens(
ContainerColorTokens containerTokens = skin.getRenderColorTokens(
contentWrapper,
RadianceThemingSlices.ContainerColorTokensAssociationKind.DEFAULT,
ComponentState.ENABLED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.pushingpixels.radiance.demo.theming.main.check.svg.tango.*;
import org.pushingpixels.radiance.theming.api.colorscheme.RadianceColorScheme;
import org.pushingpixels.radiance.theming.api.icon.RadianceIconPack;
import org.pushingpixels.radiance.theming.api.palette.ContainerRenderColorTokens;
import org.pushingpixels.radiance.theming.api.palette.ContainerColorTokens;

/**
* Custom Radiance icon pack based on Tango icons (license in resources/TangoIcons.license).
Expand Down Expand Up @@ -152,7 +152,7 @@ public RadianceIcon getInspectIcon(int preferredSize,

@Override
public RadianceIcon getInspectIcon(int preferredSize,
ContainerRenderColorTokens preferredIconColorTokens) {
ContainerColorTokens preferredIconColorTokens) {
return system_search.uiResourceOf(preferredSize, preferredSize);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@
package org.pushingpixels.radiance.demo.theming.main.palette;

import org.pushingpixels.radiance.common.api.RadianceCommonCortex;
import org.pushingpixels.radiance.theming.api.palette.ContainerRenderColorTokens;
import org.pushingpixels.radiance.theming.api.palette.ContainerColorTokens;

import javax.swing.*;
import java.awt.*;
import java.awt.geom.Rectangle2D;

public class ContainerPalettePreview extends JComponent {
private ContainerRenderColorTokens colorTokens;
private ContainerColorTokens colorTokens;

public ContainerPalettePreview(ContainerRenderColorTokens colorTokens) {
public ContainerPalettePreview(ContainerColorTokens colorTokens) {
this.colorTokens = colorTokens;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
*/
package org.pushingpixels.radiance.theming.api;

import org.pushingpixels.radiance.theming.api.palette.ContainerRenderColorTokens;
import org.pushingpixels.radiance.theming.api.palette.ContainerColorTokens;
import org.pushingpixels.radiance.theming.api.palette.ExtendedContainerColorTokens;
import org.pushingpixels.radiance.theming.api.palette.RadianceColorScheme2;
import org.pushingpixels.radiance.theming.api.palette.ExtendedContainerRenderColorTokens;

import java.util.*;

Expand Down Expand Up @@ -203,7 +203,7 @@ public void registerHighlightAlpha(float alpha, ComponentState... states) {
* @return The color scheme of the component in the specified component
* state.
*/
public ContainerRenderColorTokens getColorRenderTokens(ComponentState componentState,
public ContainerColorTokens getColorRenderTokens(ComponentState componentState,
RadianceThemingSlices.ContainerType inactiveContainerType) {
if (componentState.isDisabled()) {
return getColorRenderTokens(componentState.getEnabledMatch(), inactiveContainerType);
Expand All @@ -220,7 +220,7 @@ public ContainerRenderColorTokens getColorRenderTokens(ComponentState componentS
: this.mainColorScheme.getContainerTokens(inactiveContainerType);
}

public ExtendedContainerRenderColorTokens getExtendedRenderColorTokens(ComponentState componentState,
public ExtendedContainerColorTokens getExtendedRenderColorTokens(ComponentState componentState,
RadianceThemingSlices.ContainerType inactiveContainerType) {
if (componentState.isDisabled()) {
return getExtendedRenderColorTokens(componentState.getEnabledMatch(), inactiveContainerType);
Expand All @@ -237,7 +237,7 @@ public ExtendedContainerRenderColorTokens getExtendedRenderColorTokens(Component
: this.mainColorScheme.getExtendedContainerTokens(inactiveContainerType);
}

public ContainerRenderColorTokens getSystemRenderColorTokens(
public ContainerColorTokens getSystemRenderColorTokens(
RadianceThemingSlices.SystemContainerType systemContainerType) {

switch (systemContainerType) {
Expand Down Expand Up @@ -361,7 +361,7 @@ public void registerColorScheme(RadianceColorScheme2 scheme,
* the component under the specified component state.
* @see #registerColorScheme(RadianceColorScheme2, ComponentState...)
*/
public ContainerRenderColorTokens getColorRenderTokens(
public ContainerColorTokens getColorRenderTokens(
RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind,
ComponentState componentState, boolean allowFallback,
RadianceThemingSlices.ContainerType inactiveContainerType) {
Expand Down
Loading

0 comments on commit b286b1a

Please sign in to comment.