Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 8.61 KB | None | 0 0
  1.  
  2.  
  3. import java.awt.*;
  4. import java.awt.geom.*;
  5. import java.awt.image.*;
  6. import static java.awt.Color.*;
  7. import static java.awt.MultipleGradientPaint.CycleMethod.*;
  8. import static java.awt.MultipleGradientPaint.ColorSpaceType.*;
  9.  
  10. /**
  11.  * This class has been automatically generated using
  12.  * <a href="http://ebourg.github.io/flamingo-svg-transcoder/">Flamingo SVG transcoder</a>.
  13.  */
  14. public class Drawing implements javax.swing.Icon {
  15.  
  16.     /** The width of this icon. */
  17.     private int width;
  18.  
  19.     /** The height of this icon. */
  20.     private int height;
  21.  
  22.     /** The rendered image. */
  23.     private BufferedImage image;
  24.  
  25.     /**
  26.      * Creates a new transcoded SVG image.
  27.      */
  28.     public Drawing() {
  29.         this(375, 258);
  30.     }
  31.  
  32.     /**
  33.      * Creates a new transcoded SVG image.
  34.      */
  35.     public Drawing(int width, int height) {
  36.         this.width = width;
  37.         this.height = height;
  38.     }
  39.  
  40.     @Override
  41.     public int getIconHeight() {
  42.         return height;
  43.     }
  44.  
  45.     @Override
  46.     public int getIconWidth() {
  47.         return width;
  48.     }
  49.  
  50.     @Override
  51.     public void paintIcon(Component c, Graphics g, int x, int y) {
  52.         if (image == null) {
  53.             image = new BufferedImage(getIconWidth(), getIconHeight(), BufferedImage.TYPE_INT_ARGB);
  54.             double coef = Math.min((double) width / (double) 375, (double) height / (double) 258);
  55.            
  56.             Graphics2D g2d = image.createGraphics();
  57.             g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  58.             g2d.scale(coef, coef);
  59.             paint(g2d);
  60.             g2d.dispose();
  61.         }
  62.        
  63.         g.drawImage(image, x, y, null);
  64.     }
  65.  
  66.     /**
  67.      * Paints the transcoded SVG image on the specified graphics context.
  68.      *
  69.      * @param g Graphics context.
  70.      */
  71.     private static void paint(Graphics2D g) {
  72.         Shape shape = null;
  73.        
  74.         float origAlpha = 1.0f;
  75.        
  76.         java.util.LinkedList<AffineTransform> transformations = new java.util.LinkedList<AffineTransform>();
  77.        
  78.  
  79.         //
  80.         transformations.push(g.getTransform());
  81.         g.transform(new AffineTransform(3.7795277f, 0, 0, 3.7795277f, 0, 5.7671015E-5f));
  82.  
  83.         // _0
  84.  
  85.         // _0_0
  86.  
  87.         // _0_0_0
  88.         shape = new Ellipse2D.Double(93.49911499023438, 22.539958953857422, 31.739280700683594, 30.416364669799805);
  89.         g.setPaint(BLACK);
  90.         g.setStroke(new BasicStroke(0.2752997f, 0, 0, 4));
  91.         g.draw(shape);
  92.  
  93.         // _0_0_1
  94.         shape = new Ellipse2D.Double(64.23841857910156, 17.280088424682617, 53.70768356323242, 37.83268356323242);
  95.         g.setPaint(WHITE);
  96.         g.fill(shape);
  97.         g.setPaint(BLACK);
  98.         g.setStroke(new BasicStroke(0.22951913f, 0, 0, 4));
  99.         g.draw(shape);
  100.  
  101.         // _0_0_2
  102.         shape = new Rectangle2D.Double(62.140167236328125, 12.444101333618164, 47.573978424072266, 24.23537826538086);
  103.         g.setPaint(WHITE);
  104.         g.fill(shape);
  105.  
  106.         // _0_0_3
  107.         shape = new GeneralPath();
  108.         ((GeneralPath) shape).moveTo(64.2087, 36.716145);
  109.         ((GeneralPath) shape).curveTo(64.2087, 36.716145, 63.830727, 31.755207, 63.216515, 35.58222);
  110.  
  111.         g.setPaint(BLACK);
  112.         g.setStroke(new BasicStroke(0.26458332f, 0, 0, 4));
  113.         g.draw(shape);
  114.  
  115.         // _0_0_4
  116.         shape = new GeneralPath();
  117.         ((GeneralPath) shape).moveTo(63.21652, 35.58222);
  118.         ((GeneralPath) shape).curveTo(63.21652, 35.58222, 61.071087, 47.771168, 59.73474, 43.895756);
  119.         ((GeneralPath) shape).curveTo(56.66114, 35.2095, 58.131123, 32.1359, 56.66114, 35.2095);
  120.  
  121.         g.draw(shape);
  122.  
  123.         // _0_0_5
  124.         shape = new GeneralPath();
  125.         ((GeneralPath) shape).moveTo(56.66114, 35.2095);
  126.         ((GeneralPath) shape).curveTo(55.5625, 39.692707, 55.60975, 40.425037, 55.60975, 40.425037);
  127.  
  128.         g.draw(shape);
  129.         transformations.push(g.getTransform());
  130.         g.transform(new AffineTransform(0.8660254f, -0.5f, 0.5f, 0.8660254f, 0, 0));
  131.  
  132.         // _0_0_6
  133.         shape = new Ellipse2D.Double(8.177994728088379, 38.75354766845703, 22.35439109802246, 29.704303741455078);
  134.         g.setPaint(WHITE);
  135.         g.fill(shape);
  136.         g.setPaint(BLACK);
  137.         g.setStroke(new BasicStroke(0.3608328f, 0, 0, 4));
  138.         g.draw(shape);
  139.  
  140.         g.setTransform(transformations.pop()); // _0_0_6
  141.  
  142.         // _0_0_7
  143.         shape = new GeneralPath();
  144.         ((GeneralPath) shape).moveTo(39.28862, 48.57297);
  145.         ((GeneralPath) shape).curveTo(66.282845, 64.74278, 70.69279, 56.32379, 66.282845, 64.74278);
  146.  
  147.         g.setStroke(new BasicStroke(0.26458332f, 0, 0, 4));
  148.         g.draw(shape);
  149.  
  150.         // _0_0_8
  151.         shape = new Rectangle2D.Double(29.533283233642578, 21.712385177612305, 21.247926712036133, 27.528762817382812);
  152.         g.setPaint(WHITE);
  153.         g.fill(shape);
  154.         transformations.push(g.getTransform());
  155.         g.transform(new AffineTransform(0.9947872f, 0.10197258f, -0.10032884f, 0.99495435f, 0, 0));
  156.  
  157.         // _0_0_9
  158.         shape = new Rectangle2D.Double(51.518306732177734, 21.962921142578125, 7.769160747528076, 15.631926536560059);
  159.         g.fill(shape);
  160.  
  161.         g.setTransform(transformations.pop()); // _0_0_9
  162.         transformations.push(g.getTransform());
  163.         g.transform(new AffineTransform(0.93055636f, 0.36614877f, -0.16104122f, 0.9869477f, 0, 0));
  164.  
  165.         // _0_0_10
  166.         shape = new Ellipse2D.Double(48.721580505371094, 30.30084800720215, 3.7043793201446533, 2.741414785385132);
  167.         g.fill(shape);
  168.         g.setPaint(BLACK);
  169.         g.setStroke(new BasicStroke(0.26878935f, 0, 0, 4));
  170.         g.draw(shape);
  171.  
  172.         g.setTransform(transformations.pop()); // _0_0_10
  173.         transformations.push(g.getTransform());
  174.         g.transform(new AffineTransform(0.9659258f, -0.25881904f, 0.25881904f, 0.9659258f, 0, 0));
  175.  
  176.         // _0_0_11
  177.         shape = new Ellipse2D.Double(41.714134216308594, 59.618247985839844, 0.4009042978286743, 2.1381561756134033);
  178.         g.fill(shape);
  179.         g.setStroke(new BasicStroke(0.26458332f, 0, 0, 4));
  180.         g.draw(shape);
  181.  
  182.         g.setTransform(transformations.pop()); // _0_0_11
  183.         transformations.push(g.getTransform());
  184.         g.transform(new AffineTransform(0.9659258f, -0.25881904f, 0.25881904f, 0.9659258f, 0, 0));
  185.  
  186.         // _0_0_12
  187.         shape = new Ellipse2D.Double(43.392189025878906, 59.93424987792969, 0.4009042978286743, 2.405425548553467);
  188.         g.fill(shape);
  189.         g.draw(shape);
  190.  
  191.         g.setTransform(transformations.pop()); // _0_0_12
  192.  
  193.         // _0_0_13
  194.         shape = new GeneralPath();
  195.         ((GeneralPath) shape).moveTo(55.458424, 56.457424);
  196.         ((GeneralPath) shape).curveTo(61.739258, 55.254715, 61.605625, 53.918365, 61.605625, 53.918365);
  197.  
  198.         g.draw(shape);
  199.  
  200.         // _0_0_14
  201.         shape = new GeneralPath();
  202.         ((GeneralPath) shape).moveTo(66.282845, 64.74278);
  203.         ((GeneralPath) shape).lineTo(60.937454, 74.36449);
  204.  
  205.         g.draw(shape);
  206.  
  207.         // _0_0_15
  208.         shape = new GeneralPath();
  209.         ((GeneralPath) shape).moveTo(108.37779, 52.849285);
  210.         ((GeneralPath) shape).lineTo(115.59407, 76.10174);
  211.  
  212.         g.draw(shape);
  213.         transformations.push(g.getTransform());
  214.         g.transform(new AffineTransform(0.9165458f, -0.39992973f, 0.26577786f, 0.9640343f, 0, 0));
  215.  
  216.         // _0_0_16
  217.         shape = new Rectangle2D.Double(86.037841796875, 91.03500366210938, 5.16782283782959, 3.1380815505981445);
  218.         g.setPaint(WHITE);
  219.         g.fill(shape);
  220.  
  221.         g.setTransform(transformations.pop()); // _0_0_16
  222.  
  223.         // _0_0_17
  224.         shape = new GeneralPath();
  225.         ((GeneralPath) shape).moveTo(60.93745, 74.36448);
  226.         ((GeneralPath) shape).curveTo(60.93745, 74.36448, 60.239952, 78.10454, 63.547245, 73.71056);
  227.         ((GeneralPath) shape).curveTo(66.85454, 69.31659, 70.55915, 71.55815, 70.55915, 71.55815);
  228.         ((GeneralPath) shape).curveTo(70.55915, 71.55815, 74.9691, 75.834465, 74.56819, 79.17533);
  229.         ((GeneralPath) shape).curveTo(74.16729, 82.516205, 75.217255, 78.15178, 75.217255, 78.15178);
  230.         ((GeneralPath) shape).curveTo(75.217255, 78.15178, 75.90454, 68.48455, 89.535286, 67.950005);
  231.         ((GeneralPath) shape).curveTo(103.16604, 67.41547, 108.51143, 79.70987, 108.51143, 79.70987);
  232.         ((GeneralPath) shape).curveTo(108.51143, 79.70987, 108.244156, 73.56267, 109.31324, 72.22632);
  233.         ((GeneralPath) shape).curveTo(110.38231, 70.88997, 115.59407, 76.10172, 115.59407, 76.10172);
  234.  
  235.         g.setPaint(BLACK);
  236.         g.draw(shape);
  237.  
  238.         g.setTransform(transformations.pop()); // _0
  239.  
  240.     }
  241. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement