package test.check.svg.flags; 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://flamingo.dev.java.net">Flamingo SVG transcoder</a>. */ public class cn 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 paint = new Color(222, 41, 16, 255); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(0.0, 0.0); ((GeneralPath)shape).lineTo(640.0, 0.0); ((GeneralPath)shape).lineTo(640.0, 480.0); ((GeneralPath)shape).lineTo(0.0, 480.0); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.fill(shape); g.setTransform(defaultTransform__0_0); g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_1 = g.getTransform(); g.transform(new AffineTransform(71.99909973144531f, 0.0f, 0.0f, 72.0f, 119.9990005493164f, 120.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 Color(255, 222, 0, 255); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(-0.588, 0.81); ((GeneralPath)shape).lineTo(0.0, -1.0); ((GeneralPath)shape).lineTo(0.588, 0.81); ((GeneralPath)shape).lineTo(-0.952, -0.31); ((GeneralPath)shape).lineTo(0.952, -0.31); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.fill(shape); g.setTransform(defaultTransform__0_1_0); g.setTransform(defaultTransform__0_1); g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_2 = g.getTransform(); g.transform(new AffineTransform(-12.335619926452637f, -20.587099075317383f, 20.58683967590332f, -12.335769653320312f, 240.29100036621094f, 47.99599838256836f)); // _0_2 g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_2_0 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0_2_0 paint = new Color(255, 222, 0, 255); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(-0.588, 0.81); ((GeneralPath)shape).lineTo(0.0, -1.0); ((GeneralPath)shape).lineTo(0.588, 0.81); ((GeneralPath)shape).lineTo(-0.952, -0.31); ((GeneralPath)shape).lineTo(0.952, -0.31); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.fill(shape); g.setTransform(defaultTransform__0_2_0); g.setTransform(defaultTransform__0_2); g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_3 = g.getTransform(); g.transform(new AffineTransform(-3.385730028152466f, -23.759979248046875f, 23.759679794311523f, -3.385780096054077f, 287.95001220703125f, 95.7959976196289f)); // _0_3 g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_3_0 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0_3_0 paint = new Color(255, 222, 0, 255); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(-0.588, 0.81); ((GeneralPath)shape).lineTo(0.0, -1.0); ((GeneralPath)shape).lineTo(0.588, 0.81); ((GeneralPath)shape).lineTo(-0.952, -0.31); ((GeneralPath)shape).lineTo(0.952, -0.31); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.fill(shape); g.setTransform(defaultTransform__0_3_0); g.setTransform(defaultTransform__0_3); g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_4 = g.getTransform(); g.transform(new AffineTransform(6.599100112915039f, -23.074899673461914f, 23.074600219726562f, 6.5991902351379395f, 287.9590148925781f, 168.01199340820312f)); // _0_4 g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_4_0 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0_4_0 paint = new Color(255, 222, 0, 255); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(-0.588, 0.81); ((GeneralPath)shape).lineTo(0.0, -1.0); ((GeneralPath)shape).lineTo(0.588, 0.81); ((GeneralPath)shape).lineTo(-0.952, -0.31); ((GeneralPath)shape).lineTo(0.952, -0.31); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.fill(shape); g.setTransform(defaultTransform__0_4_0); g.setTransform(defaultTransform__0_4); g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_5 = g.getTransform(); g.transform(new AffineTransform(14.999099731445312f, -18.735570907592773f, 18.73533058166504f, 14.999290466308594f, 239.93299865722656f, 216.0540008544922f)); // _0_5 g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform defaultTransform__0_5_0 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); // _0_5_0 paint = new Color(255, 222, 0, 255); shape = new GeneralPath(); ((GeneralPath)shape).moveTo(-0.588, 0.81); ((GeneralPath)shape).lineTo(0.0, -1.0); ((GeneralPath)shape).lineTo(0.588, 0.81); ((GeneralPath)shape).lineTo(-0.952, -0.31); ((GeneralPath)shape).lineTo(0.952, -0.31); ((GeneralPath)shape).closePath(); g.setPaint(paint); g.fill(shape); g.setTransform(defaultTransform__0_5_0); g.setTransform(defaultTransform__0_5); 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 int getOrigX() { return 0; } /** * 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 int getOrigY() { return 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 int getOrigWidth() { return 640; } /** * 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 int getOrigHeight() { return 480; } /** * The current width of this resizable icon. */ int width; /** * The current height of this resizable icon. */ int height; /** * Creates a new transcoded SVG image. */ public cn() { this.width = getOrigWidth(); this.height = 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); paint(g2d); g2d.dispose(); } }