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 tw 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(0.9375f, 0.0f, 0.0f, 0.9375f, 0.0f, 0.0f));
// _0_0
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_0 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_0
paint = new Color(222, 33, 16, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(0.0, 0.0);
((GeneralPath)shape).lineTo(768.0, 0.0);
((GeneralPath)shape).lineTo(768.0, 512.0);
((GeneralPath)shape).lineTo(0.0, 512.0);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_0);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_1 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_1
paint = new Color(8, 57, 156, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(0.0, 0.0);
((GeneralPath)shape).lineTo(385.69, 0.0);
((GeneralPath)shape).lineTo(385.69, 256.0);
((GeneralPath)shape).lineTo(0.0, 256.0);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_1);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_2 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_2
paint = new Color(255, 255, 255, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(282.098, 178.555);
((GeneralPath)shape).lineTo(234.76599, 168.82199);
((GeneralPath)shape).lineTo(244.849, 216.08199);
((GeneralPath)shape).lineTo(208.716, 183.99399);
((GeneralPath)shape).lineTo(193.812, 229.96399);
((GeneralPath)shape).lineTo(178.568, 184.09698);
((GeneralPath)shape).lineTo(142.68199, 216.46399);
((GeneralPath)shape).lineTo(152.415, 169.13199);
((GeneralPath)shape).lineTo(105.155, 179.20499);
((GeneralPath)shape).lineTo(137.243, 143.08199);
((GeneralPath)shape).lineTo(91.273994, 128.17798);
((GeneralPath)shape).lineTo(137.129, 112.933975);
((GeneralPath)shape).lineTo(104.772995, 77.043976);
((GeneralPath)shape).lineTo(152.105, 86.77397);
((GeneralPath)shape).lineTo(142.032, 39.51197);
((GeneralPath)shape).lineTo(178.155, 71.604965);
((GeneralPath)shape).lineTo(193.059, 25.634964);
((GeneralPath)shape).lineTo(208.30301, 71.493965);
((GeneralPath)shape).lineTo(244.18901, 39.133965);
((GeneralPath)shape).lineTo(234.45601, 86.46896);
((GeneralPath)shape).lineTo(281.716, 76.38896);
((GeneralPath)shape).lineTo(249.628, 112.520966);
((GeneralPath)shape).lineTo(295.59802, 127.41396);
((GeneralPath)shape).lineTo(249.74202, 142.65796);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_2);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_3 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_3
paint = new Color(0, 83, 135, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(238.47, 174.924);
((GeneralPath)shape).lineTo(223.535, 182.856);
((GeneralPath)shape).lineTo(208.965, 191.464);
((GeneralPath)shape).lineTo(192.047, 190.88101);
((GeneralPath)shape).lineTo(175.12799, 191.07901);
((GeneralPath)shape).lineTo(160.76799, 182.13802);
((GeneralPath)shape).lineTo(146.00899, 173.86302);
((GeneralPath)shape).lineTo(138.05598, 158.95702);
((GeneralPath)shape).lineTo(129.42499, 144.43701);
((GeneralPath)shape).lineTo(129.999, 127.56301);
((GeneralPath)shape).lineTo(129.81099, 110.68001);
((GeneralPath)shape).lineTo(138.77599, 96.36001);
((GeneralPath)shape).lineTo(147.07399, 81.64401);
((GeneralPath)shape).lineTo(162.00899, 73.710014);
((GeneralPath)shape).lineTo(176.57898, 65.10301);
((GeneralPath)shape).lineTo(193.49799, 65.683014);
((GeneralPath)shape).lineTo(210.42598, 65.49001);
((GeneralPath)shape).lineTo(224.78798, 74.430016);
((GeneralPath)shape).lineTo(239.53497, 82.70502);
((GeneralPath)shape).lineTo(247.48798, 97.60602);
((GeneralPath)shape).lineTo(256.11996, 112.12602);
((GeneralPath)shape).lineTo(255.54596, 129.00003);
((GeneralPath)shape).lineTo(255.73296, 145.88303);
((GeneralPath)shape).lineTo(246.76796, 160.20602);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_3);
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
AffineTransform defaultTransform__0_0_4 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_4
paint = new Color(255, 255, 255, 255);
shape = new GeneralPath();
((GeneralPath)shape).moveTo(244.637, 128.28);
((GeneralPath)shape).curveTo(244.637, 156.926, 221.415, 180.147, 192.771, 180.147);
((GeneralPath)shape).curveTo(164.127, 180.147, 140.90399, 156.926, 140.90399, 128.281);
((GeneralPath)shape).curveTo(140.90399, 99.63602, 164.12599, 76.41501, 192.771, 76.41501);
((GeneralPath)shape).curveTo(221.416, 76.41501, 244.637, 99.63601, 244.637, 128.281);
((GeneralPath)shape).closePath();
g.setPaint(paint);
g.fill(shape);
g.setTransform(defaultTransform__0_0_4);
g.setTransform(defaultTransform__0_0);
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 tw() {
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();
}
}