package test.check.svg; import java.awt.*; import java.awt.geom.*; import javax.swing.Icon; import javax.swing.plaf.UIResource; import org.pushingpixels.lafwidget.icon.IsHiDpiAware; import org.pushingpixels.lafwidget.icon.IsResizable; /** * This class has been automatically generated using <a * href="https://github.com/kirill-grouchnikov/flamingo">Flamingo SVG transcoder</a>. */ public class Format_text_strikethrough implements Icon, UIResource, IsResizable, IsHiDpiAware { /** * Paints the transcoded SVG image on the specified graphics context. You * can install a custom transformation on the graphics context to scale the * image. * * @param g * Graphics context. */ public static void paint(Graphics2D g) { Shape shape = null; Paint paint = null; Stroke stroke = null; float origAlpha = 1.0f; Composite origComposite = ((Graphics2D)g).getComposite(); if (origComposite instanceof AlphaComposite) { AlphaComposite origAlphaComposite = (AlphaComposite)origComposite; if (origAlphaComposite.getRule() == AlphaComposite.SRC_OVER) { origAlpha = origAlphaComposite.getAlpha(); } } AffineTransform defaultTransform_ = g.getTransform(); // g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0 g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_0 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0_0 g.setComposite(AlphaComposite.getInstance(3, 0.15f * origAlpha)); AffineTransform defaultTransform__0_0_0 = g.getTransform(); g.transform(new AffineTransform(1.4701440334320068f, 0.0f, 0.0f, 0.5354740023612976f, -12.76416015625f, 20.915340423583984f)); // _0_0_0 paint = new RadialGradientPaint(new Point2D.Double(24.837125778198242, 36.42112731933594), 15.644737f, new Point2D.Double(24.837125778198242, 36.42112731933594), new float[] {0.0f,1.0f}, new Color[] {new Color(0, 0, 0, 255),new Color(0, 0, 0, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 0.5367230176925659f, 6.419148134724885E-15f, 16.87306022644043f)); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(40.48186, 36.421127); ((GeneralPath)shape).curveTo(40.483814, 39.421745, 37.50237, 42.19488, 32.66107, 43.69549); ((GeneralPath)shape).curveTo(27.81977, 45.196106, 21.854479, 45.196106, 17.01318, 43.69549); ((GeneralPath)shape).curveTo(12.17188, 42.19488, 9.190436, 39.421745, 9.192389, 36.421127); ((GeneralPath)shape).curveTo(9.190436, 33.42051, 12.17188, 30.647373, 17.01318, 29.14676); ((GeneralPath)shape).curveTo(21.854479, 27.646149, 27.81977, 27.646149, 32.66107, 29.14676); ((GeneralPath)shape).curveTo(37.50237, 30.647373, 40.483814, 33.42051, 40.48186, 36.421127); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.fill(shape); g.setTransform(defaultTransform__0_0_0); g.setTransform(defaultTransform__0_0); g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_1 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0_1 g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_1_0 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0_1_0 paint = new LinearGradientPaint(new Point2D.Double(29.033241271972656, 36.44520950317383), new Point2D.Double(14.333789825439453, 9.459654808044434), new float[] {0.0f,1.0f}, new Color[] {new Color(73, 127, 198, 255),new Color(144, 179, 217, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f)); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(20.0, 4.5); ((GeneralPath)shape).lineTo(5.0, 41.5); ((GeneralPath)shape).lineTo(11.0, 41.5); ((GeneralPath)shape).lineTo(14.25, 33.5); ((GeneralPath)shape).lineTo(33.75, 33.5); ((GeneralPath)shape).lineTo(37.0, 41.5); ((GeneralPath)shape).lineTo(43.0, 41.5); ((GeneralPath)shape).lineTo(28.0, 4.5); ((GeneralPath)shape).lineTo(20.0, 4.5); ((GeneralPath)shape).closePath(); ((GeneralPath)shape).moveTo(24.0, 9.5); ((GeneralPath)shape).lineTo(31.71875, 28.5); ((GeneralPath)shape).lineTo(16.28125, 28.5); ((GeneralPath)shape).lineTo(24.0, 9.5); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.fill(shape); paint = new LinearGradientPaint(new Point2D.Double(22.125, 34.96281051635742), new Point2D.Double(22.125, 6.25), new float[] {0.0f,1.0f}, new Color[] {new Color(42, 83, 135, 255),new Color(52, 101, 164, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 4.0f)); stroke = new BasicStroke(1.0f,0,0,4.0f,null,0.0f); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(20.0, 4.5); ((GeneralPath)shape).lineTo(5.0, 41.5); ((GeneralPath)shape).lineTo(11.0, 41.5); ((GeneralPath)shape).lineTo(14.25, 33.5); ((GeneralPath)shape).lineTo(33.75, 33.5); ((GeneralPath)shape).lineTo(37.0, 41.5); ((GeneralPath)shape).lineTo(43.0, 41.5); ((GeneralPath)shape).lineTo(28.0, 4.5); ((GeneralPath)shape).lineTo(20.0, 4.5); ((GeneralPath)shape).closePath(); ((GeneralPath)shape).moveTo(24.0, 9.5); ((GeneralPath)shape).lineTo(31.71875, 28.5); ((GeneralPath)shape).lineTo(16.28125, 28.5); ((GeneralPath)shape).lineTo(24.0, 9.5); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.setStroke(stroke); g.draw(shape); g.setTransform(defaultTransform__0_1_0); g.setComposite(AlphaComposite.getInstance(3, 0.6f * origAlpha)); AffineTransform defaultTransform__0_1_1 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0_1_1 paint = new LinearGradientPaint(new Point2D.Double(19.89179229736328, 16.114627838134766), new Point2D.Double(21.50684356689453, 85.69680786132812), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(179, 179, 179, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f)); stroke = new BasicStroke(1.0f,0,0,4.0f,null,0.0f); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(10.5, 40.5); ((GeneralPath)shape).lineTo(6.646263, 40.5); ((GeneralPath)shape).lineTo(20.682829, 5.5); ((GeneralPath)shape).lineTo(27.353737, 5.5); ((GeneralPath)shape).lineTo(41.68283, 40.5); ((GeneralPath)shape).lineTo(37.865658, 40.5); ((GeneralPath)shape).lineTo(34.403564, 32.469063); ((GeneralPath)shape).lineTo(13.523417, 32.36827); ((GeneralPath)shape).curveTo(13.523417, 32.36827, 10.5, 40.5, 10.5, 40.5); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.setStroke(stroke); g.draw(shape); g.setTransform(defaultTransform__0_1_1); g.setComposite(AlphaComposite.getInstance(3, 0.46703297f * origAlpha)); AffineTransform defaultTransform__0_1_2 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0_1_2 paint = new LinearGradientPaint(new Point2D.Double(24.911611557006836, 22.13603973388672), new Point2D.Double(24.911611557006836, 6.4029130935668945), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(255, 255, 255, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f)); stroke = new BasicStroke(1.0f,0,0,4.0f,null,0.0f); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(14.68934, 29.5); ((GeneralPath)shape).lineTo(33.258884, 29.5); ((GeneralPath)shape).lineTo(24.041632, 6.81103); ((GeneralPath)shape).lineTo(14.68934, 29.5); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.setStroke(stroke); g.draw(shape); g.setTransform(defaultTransform__0_1_2); g.setComposite(AlphaComposite.getInstance(3, 0.16470589f * origAlpha)); AffineTransform defaultTransform__0_1_3 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0_1_3 paint = new LinearGradientPaint(new Point2D.Double(16.841535568237305, 24.0), new Point2D.Double(16.841535568237305, 25.010555267333984), new float[] {0.0f,1.0f}, new Color[] {new Color(0, 0, 0, 255),new Color(0, 0, 0, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(12.34375, 22.0); ((GeneralPath)shape).lineTo(10.75, 26.0); ((GeneralPath)shape).curveTo(10.75, 26.0, 17.84375, 26.0, 17.84375, 26.0); ((GeneralPath)shape).lineTo(19.46875, 22.0); ((GeneralPath)shape).lineTo(12.34375, 22.0); ((GeneralPath)shape).closePath(); ((GeneralPath)shape).moveTo(28.53125, 22.0); ((GeneralPath)shape).lineTo(30.15625, 26.0); ((GeneralPath)shape).lineTo(37.25, 26.0); ((GeneralPath)shape).lineTo(35.65625, 22.0); ((GeneralPath)shape).lineTo(28.53125, 22.0); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.fill(shape); g.setTransform(defaultTransform__0_1_3); g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_1_4 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0_1_4 paint = new LinearGradientPaint(new Point2D.Double(27.675018310546875, 45.398963928222656), new Point2D.Double(16.074399948120117, 27.920007705688477), new float[] {0.0f,1.0f}, new Color[] {new Color(73, 127, 198, 255),new Color(144, 179, 217, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, -23.0f)); shape = new Rectangle2D.Double(4.5, 20.5, 39.0, 3.0); g.setPaint(paint); g.fill(shape); paint = new LinearGradientPaint(new Point2D.Double(5.027165412902832, 27.761903762817383), new Point2D.Double(5.027165412902832, 20.416152954101562), new float[] {0.0f,1.0f}, new Color[] {new Color(42, 83, 135, 255),new Color(52, 101, 164, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); stroke = new BasicStroke(1.0f,1,1,4.0f,null,0.0f); shape = new Rectangle2D.Double(4.5, 20.5, 39.0, 3.0); g.setPaint(paint); g.setStroke(stroke); g.draw(shape); g.setTransform(defaultTransform__0_1_4); g.setComposite(AlphaComposite.getInstance(3, 0.8f * origAlpha)); AffineTransform defaultTransform__0_1_5 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0_1_5 paint = new LinearGradientPaint(new Point2D.Double(39.42120361328125, 41.45926284790039), new Point2D.Double(-24.13001823425293, 41.5), new float[] {0.0f,1.0f}, new Color[] {new Color(255, 255, 255, 255),new Color(255, 255, 255, 0)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, -20.0f)); stroke = new BasicStroke(1.0f,2,0,4.0f,null,0.0f); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(5.5, 21.5); ((GeneralPath)shape).lineTo(42.5, 21.5); g.setPaint(paint); g.setStroke(stroke); g.draw(shape); g.setTransform(defaultTransform__0_1_5); g.setTransform(defaultTransform__0_1); g.setTransform(defaultTransform__0); g.setTransform(defaultTransform_); } /** * Returns the X of the bounding box of the original SVG image. * * @return The X of the bounding box of the original SVG image. */ public static double getOrigX() { return 0.7471050024032593; } /** * Returns the Y of the bounding box of the original SVG image. * * @return The Y of the bounding box of the original SVG image. */ public static double getOrigY() { return 3.999483108520508; } /** * Returns the width of the bounding box of the original SVG image. * * @return The width of the bounding box of the original SVG image. */ public static double getOrigWidth() { return 46.00577163696289; } /** * Returns the height of the bounding box of the original SVG image. * * @return The height of the bounding box of the original SVG image. */ public static double getOrigHeight() { return 41.1171989440918; } /** * The current width of this resizable icon. */ private int width; /** * The current height of this resizable icon. */ private int height; /** * Creates a new transcoded SVG image. */ public Format_text_strikethrough() { this.width = (int) getOrigWidth(); this.height = (int) getOrigHeight(); } /* * (non-Javadoc) * * @see javax.swing.Icon#getIconHeight() */ @Override public int getIconHeight() { return height; } /* * (non-Javadoc) * * @see javax.swing.Icon#getIconWidth() */ @Override public int getIconWidth() { return width; } @Override public void setDimension(Dimension newDimension) { this.width = newDimension.width; this.height = newDimension.height; } @Override public boolean isHiDpiAware() { return true; } /* * (non-Javadoc) * * @see javax.swing.Icon#paintIcon(java.awt.Component, java.awt.Graphics, * int, int) */ @Override public void paintIcon(Component c, Graphics g, int x, int y) { Graphics2D g2d = (Graphics2D) g.create(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.translate(x, y); double coef1 = (double) this.width / (double) getOrigWidth(); double coef2 = (double) this.height / (double) getOrigHeight(); double coef = Math.min(coef1, coef2); g2d.clipRect(0, 0, this.width, this.height); g2d.scale(coef, coef); g2d.translate(-getOrigX(), -getOrigY()); if (coef1 != coef2) { if (coef1 < coef2) { int extraDy = (int) ((getOrigWidth() - getOrigHeight()) / 2.0); g2d.translate(0, extraDy); } else { int extraDx = (int) ((getOrigHeight() - getOrigWidth()) / 2.0); g2d.translate(extraDx, 0); } } paint(g2d); g2d.dispose(); } public static Format_text_strikethrough of(int width, int height) { Format_text_strikethrough result = new Format_text_strikethrough(); result.width = width; result.height = height; return result; } }