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_italic 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, 6.000003814697266f, 1.0f)); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(34.0, 4.5); ((GeneralPath)shape).lineTo(4.0, 41.5); ((GeneralPath)shape).lineTo(10.500004, 41.5); ((GeneralPath)shape).lineTo(16.990517, 33.5); ((GeneralPath)shape).lineTo(36.5, 33.5); ((GeneralPath)shape).lineTo(36.500004, 41.5); ((GeneralPath)shape).lineTo(41.5, 41.5); ((GeneralPath)shape).lineTo(41.5, 4.5); ((GeneralPath)shape).lineTo(34.0, 4.5); ((GeneralPath)shape).closePath(); ((GeneralPath)shape).moveTo(36.5, 9.5); ((GeneralPath)shape).lineTo(36.5, 28.5); ((GeneralPath)shape).lineTo(21.047087, 28.5); ((GeneralPath)shape).lineTo(36.5, 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, 6.000003814697266f, 4.0f)); stroke = new BasicStroke(1.0f,0,0,4.0f,null,0.0f); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(34.0, 4.5); ((GeneralPath)shape).lineTo(4.0, 41.5); ((GeneralPath)shape).lineTo(10.500004, 41.5); ((GeneralPath)shape).lineTo(16.990517, 33.5); ((GeneralPath)shape).lineTo(36.5, 33.5); ((GeneralPath)shape).lineTo(36.500004, 41.5); ((GeneralPath)shape).lineTo(41.5, 41.5); ((GeneralPath)shape).lineTo(41.5, 4.5); ((GeneralPath)shape).lineTo(34.0, 4.5); ((GeneralPath)shape).closePath(); ((GeneralPath)shape).moveTo(36.5, 9.5); ((GeneralPath)shape).lineTo(36.5, 28.5); ((GeneralPath)shape).lineTo(21.047087, 28.5); ((GeneralPath)shape).lineTo(36.5, 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.7f * 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(20.846664428710938, 15.432576179504395), new Point2D.Double(21.077463150024414, 61.9260368347168), 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, 6.000003814697266f, 1.0f)); stroke = new BasicStroke(1.0f,0,0,4.0f,null,0.0f); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(6.1325827, 40.5); ((GeneralPath)shape).lineTo(34.5, 5.5); ((GeneralPath)shape).lineTo(40.5, 5.5); ((GeneralPath)shape).lineTo(40.5, 40.5); ((GeneralPath)shape).lineTo(37.38827, 40.48699); ((GeneralPath)shape).lineTo(37.38827, 32.490986); ((GeneralPath)shape).lineTo(16.793787, 32.490986); ((GeneralPath)shape).lineTo(9.899495, 40.5); ((GeneralPath)shape).lineTo(6.1325827, 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.3846154f * 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(30.123498916625977, 28.5), new Point2D.Double(30.916004180908203, 5.399416446685791), 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, 5.000006198883057f, 1.0f)); stroke = new BasicStroke(1.0f,0,0,4.0f,null,0.0f); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(18.976889, 29.411612); ((GeneralPath)shape).lineTo(37.47949, 29.5); ((GeneralPath)shape).lineTo(37.38827, 6.8994164); ((GeneralPath)shape).lineTo(18.976889, 29.411612); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.setStroke(stroke); g.draw(shape); g.setTransform(defaultTransform__0_1_2); 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 4.0; } /** * 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.11668014526367; } /** * 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_italic() { 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_italic of(int width, int height) { Format_text_italic result = new Format_text_italic(); result.width = width; result.height = height; return result; } }