diff --git a/src/main/java/pixelitor/filters/ChannelToTransparency.java b/src/main/java/pixelitor/filters/ChannelToTransparency.java index 1a06bfa09..2ddb6dc16 100644 --- a/src/main/java/pixelitor/filters/ChannelToTransparency.java +++ b/src/main/java/pixelitor/filters/ChannelToTransparency.java @@ -95,7 +95,7 @@ int getChannelValue(int rgb) { } @Override - public void randomize() { + public void randomizeSettings() { // no settings } diff --git a/src/main/java/pixelitor/filters/Colorize.java b/src/main/java/pixelitor/filters/Colorize.java index ff01e71e7..24613e1f8 100644 --- a/src/main/java/pixelitor/filters/Colorize.java +++ b/src/main/java/pixelitor/filters/Colorize.java @@ -24,6 +24,7 @@ import java.awt.Color; import java.awt.image.BufferedImage; +import java.io.Serial; import static pixelitor.filters.gui.ColorParam.TransparencyPolicy.NO_TRANSPARENCY; import static pixelitor.gui.GUIText.BRIGHTNESS; @@ -36,6 +37,9 @@ public class Colorize extends ParametrizedFilter { public static final String NAME = i18n("colorize"); + @Serial + private static final long serialVersionUID = 7036946857972080432L; + private final RangeParam brightnessParam = new RangeParam( BRIGHTNESS, -100, 0, 100); private final ColorParam colorParam = new ColorParam( diff --git a/src/main/java/pixelitor/filters/ParametrizedFilter.java b/src/main/java/pixelitor/filters/ParametrizedFilter.java index 4747e25de..99066abb0 100644 --- a/src/main/java/pixelitor/filters/ParametrizedFilter.java +++ b/src/main/java/pixelitor/filters/ParametrizedFilter.java @@ -54,7 +54,7 @@ protected void showAffectedArea() { } @Override - public void randomize() { + public void randomizeSettings() { paramSet.randomize(); } diff --git a/src/main/java/pixelitor/filters/PoissonDiskTester.java b/src/main/java/pixelitor/filters/PoissonDiskTester.java index ecb6fc213..2ea520e22 100644 --- a/src/main/java/pixelitor/filters/PoissonDiskTester.java +++ b/src/main/java/pixelitor/filters/PoissonDiskTester.java @@ -27,6 +27,7 @@ import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.BufferedImage; +import java.io.Serial; import java.util.SplittableRandom; import static java.awt.RenderingHints.KEY_ANTIALIASING; @@ -39,6 +40,9 @@ public class PoissonDiskTester extends ParametrizedFilter { public static final String NAME = "Poisson Disk Sampling"; + @Serial + private static final long serialVersionUID = -6684473485597318552L; + private final RangeParam distance = new RangeParam("Distance", 10, 20, 300); private final RangeParam k = new RangeParam("k", 1, 30, 100); private final BooleanParam improved = new BooleanParam("Improved", false); diff --git a/src/main/java/pixelitor/filters/RandomFilter.java b/src/main/java/pixelitor/filters/RandomFilter.java index ad9e6021e..12fca5de0 100644 --- a/src/main/java/pixelitor/filters/RandomFilter.java +++ b/src/main/java/pixelitor/filters/RandomFilter.java @@ -38,7 +38,7 @@ protected BufferedImage transform(BufferedImage src, BufferedImage dest) { } @Override - public void randomize() { + public void randomizeSettings() { throw new UnsupportedOperationException("this should not be called"); } diff --git a/src/main/java/pixelitor/filters/convolve/Convolve.java b/src/main/java/pixelitor/filters/convolve/Convolve.java index e78f5e250..daa638d2e 100644 --- a/src/main/java/pixelitor/filters/convolve/Convolve.java +++ b/src/main/java/pixelitor/filters/convolve/Convolve.java @@ -74,7 +74,7 @@ public FilterGUI createGUI(Drawable dr, boolean reset) { } @Override - public void randomize() { + public void randomizeSettings() { kernelMatrix = createRandomKernelMatrix(matrixOrder); } diff --git a/src/main/java/pixelitor/filters/curves/ToneCurvesFilter.java b/src/main/java/pixelitor/filters/curves/ToneCurvesFilter.java index e1dadbaac..7f891d02c 100644 --- a/src/main/java/pixelitor/filters/curves/ToneCurvesFilter.java +++ b/src/main/java/pixelitor/filters/curves/ToneCurvesFilter.java @@ -85,7 +85,7 @@ public BufferedImage transform(BufferedImage src, BufferedImage dest) { } @Override - public void randomize() { + public void randomizeSettings() { // not supported yet } diff --git a/src/main/java/pixelitor/filters/gui/FilterWithGUI.java b/src/main/java/pixelitor/filters/gui/FilterWithGUI.java index 710452a2e..eb5978c17 100644 --- a/src/main/java/pixelitor/filters/gui/FilterWithGUI.java +++ b/src/main/java/pixelitor/filters/gui/FilterWithGUI.java @@ -50,7 +50,7 @@ protected FilterWithGUI() { */ public abstract FilterGUI createGUI(Drawable dr, boolean reset); - public abstract void randomize(); + public abstract void randomizeSettings(); private JMenuBar getMenuBar() { boolean addPresets = canHaveUserPresets() || hasBuiltinPresets(); diff --git a/src/main/java/pixelitor/filters/levels/Levels.java b/src/main/java/pixelitor/filters/levels/Levels.java index 52e046162..2beccb7d6 100644 --- a/src/main/java/pixelitor/filters/levels/Levels.java +++ b/src/main/java/pixelitor/filters/levels/Levels.java @@ -73,7 +73,7 @@ public BufferedImage transform(BufferedImage src, BufferedImage dest) { } @Override - public void randomize() { + public void randomizeSettings() { int inputDark = Rnd.nextInt(255); int inputLight = Rnd.nextInt(255); int outputDark = Rnd.nextInt(255); diff --git a/src/main/java/pixelitor/filters/painters/TextFilter.java b/src/main/java/pixelitor/filters/painters/TextFilter.java index 70afcea40..7aa44d7db 100644 --- a/src/main/java/pixelitor/filters/painters/TextFilter.java +++ b/src/main/java/pixelitor/filters/painters/TextFilter.java @@ -71,7 +71,7 @@ public FilterGUI createGUI(Drawable dr, boolean reset) { } @Override - public void randomize() { + public void randomizeSettings() { settings.randomize(); } diff --git a/src/main/java/pixelitor/filters/painters/TextSettings.java b/src/main/java/pixelitor/filters/painters/TextSettings.java index 230d1d764..b46868654 100644 --- a/src/main/java/pixelitor/filters/painters/TextSettings.java +++ b/src/main/java/pixelitor/filters/painters/TextSettings.java @@ -161,6 +161,10 @@ public boolean hasWatermark() { return watermark; } + public void setWatermark(boolean watermark) { + this.watermark = watermark; + } + public double getRotation() { return rotation; } diff --git a/src/main/java/pixelitor/utils/debug/Debug.java b/src/main/java/pixelitor/utils/debug/Debug.java index 1e52c3981..49cf6f1cb 100644 --- a/src/main/java/pixelitor/utils/debug/Debug.java +++ b/src/main/java/pixelitor/utils/debug/Debug.java @@ -495,13 +495,15 @@ private static void addSmartFilter(Composition comp, Filter filter) { TextSettings settings = new TextSettings(); settings.randomize(); settings.setText(filter.getName()); + settings.setWatermark(false); TextLayer textLayer = new TextLayer(comp, "", settings); textLayer.updateLayerName(); SmartObject smartObject = new SmartObject(textLayer); + smartObject.setOpacity(0.2f, false); new Composition.LayerAdder(comp).add(smartObject); if (filter instanceof FilterWithGUI guiFilter) { - guiFilter.randomize(); + guiFilter.randomizeSettings(); smartObject.startPreviewing(); filter.startOn(smartObject, PREVIEWING); smartObject.onFilterDialogAccepted(filter.getName()); diff --git a/src/main/java/pixelitor/utils/test/RandomGUITest.java b/src/main/java/pixelitor/utils/test/RandomGUITest.java index 0c11aa94c..9efec0612 100644 --- a/src/main/java/pixelitor/utils/test/RandomGUITest.java +++ b/src/main/java/pixelitor/utils/test/RandomGUITest.java @@ -457,7 +457,7 @@ private static void randomFilter() { long runCountBefore = Filter.runCount; if (filter instanceof FilterWithGUI guiFilter) { - guiFilter.randomize(); + guiFilter.randomizeSettings(); dr.startPreviewing(); try {