diff --git a/platform/util/src/com/intellij/ui/paint/RectanglePainter2D.java b/platform/util/src/com/intellij/ui/paint/RectanglePainter2D.java index 3bd8f95a5f07..7e9562112ce6 100644 --- a/platform/util/src/com/intellij/ui/paint/RectanglePainter2D.java +++ b/platform/util/src/com/intellij/ui/paint/RectanglePainter2D.java @@ -29,6 +29,11 @@ import static com.intellij.ui.paint.PaintUtil.alignToInt; */ public enum RectanglePainter2D implements RegionPainter2D { DRAW { + @Override + public void paint(Graphics2D g, double x, double y, double width, double height, @Nullable Double arc) { + paint(g, x, y, width, height, arc, StrokeType.INSIDE, 1, RenderingHints.VALUE_ANTIALIAS_DEFAULT); + } + /** * @see #paint(Graphics2D, double, double, double, double, Double, StrokeType, double, Object) */ @@ -132,6 +137,11 @@ public enum RectanglePainter2D implements RegionPainter2D { }, FILL { + @Override + public void paint(Graphics2D g, double x, double y, double width, double height, @Nullable Double arc) { + paint(g, x, y, width, height, arc, StrokeType.INSIDE, 1, RenderingHints.VALUE_ANTIALIAS_DEFAULT); + } + /** * @see #paint(Graphics2D, double, double, double, double, Double, StrokeType, double, Object) */ @@ -261,4 +271,43 @@ public enum RectanglePainter2D implements RegionPainter2D { } return new Rectangle2D.Double(x, y, prefWidth, prefHeight); } + + /** + * Paints on the given {@link Graphics2D} object. + * Renders to the given {@link Graphics2D} object. + * + * @param g the {@code Graphics2D} object to render to + * @param x X position of the area to paint + * @param y Y position of the area to paint + * @param width width of the area to paint + * @param g the {@code Graphics2D} object to render to + * @param x X position of the area to paint + * @param y Y position of the area to paint + * @param width width of the area to paint + * @param height height of the area to paint + * @param object an optional configuration parameter + * @param strokeType the stroke type + * @param strokeWidth the stroke width + * @param valueAA overrides current {@link RenderingHints#KEY_ANTIALIASING} to {@code valueAA} + */ + public abstract void paint(@NotNull Graphics2D g, + double x, double y, double width, double height, + @Nullable Double arc, + @NotNull StrokeType strokeType, + double strokeWidth, + @NotNull Object valueAA); + + public abstract void paint(@NotNull Graphics2D g, + double x, double y, double width, double height, + @NotNull StrokeType strokeType, + double strokeWidth); + + public abstract void paint(@NotNull Graphics2D g, double x, double y, double width, double height); + + public abstract void paint(@NotNull final Graphics2D g, + Rectangle2D rect, + @Nullable Double arc, + @NotNull StrokeType strokeType, + double strokeWidth, + @NotNull Object valueAA); } diff --git a/platform/util/src/com/intellij/ui/paint/RegionPainter2D.java b/platform/util/src/com/intellij/ui/paint/RegionPainter2D.java index e10105037b26..42dc917f589b 100644 --- a/platform/util/src/com/intellij/ui/paint/RegionPainter2D.java +++ b/platform/util/src/com/intellij/ui/paint/RegionPainter2D.java @@ -1,13 +1,10 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ui.paint; -import com.intellij.ui.paint.LinePainter2D.StrokeType; import com.intellij.util.ui.RegionPainter; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.awt.*; -import java.awt.geom.Rectangle2D; /** * A {@code double} version of RegionPainter. @@ -25,28 +22,6 @@ public interface RegionPainter2D { * @param width width of the area to paint * @param height height of the area to paint * @param object an optional configuration parameter - * @param strokeType the stroke type - * @param strokeWidth the stroke width - * @param valueAA overrides current {@link RenderingHints#KEY_ANTIALIASING} to {@code valueAA} */ - void paint(@NotNull Graphics2D g, - double x, double y, double width, double height, - @Nullable T object, - @NotNull StrokeType strokeType, - double strokeWidth, - @NotNull Object valueAA); - - void paint(@NotNull Graphics2D g, - double x, double y, double width, double height, - @NotNull StrokeType strokeType, - double strokeWidth); - - void paint(@NotNull Graphics2D g, double x, double y, double width, double height); - - void paint(@NotNull final Graphics2D g, - Rectangle2D rect, - @Nullable T object, - @NotNull StrokeType strokeType, - double strokeWidth, - @NotNull Object valueAA); + void paint(Graphics2D g, double x, double y, double width, double height, @Nullable T object); }