package com.seaglasslookandfeel.icons; import java.awt.*; import java.awt.geom.*; import javax.swing.Icon; /** * This class has been automatically generated using svg2java * */ public class FolderHomeIcon implements Icon { private float origAlpha = 1.0f; /** * 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 void paint(Graphics2D g) { g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); origAlpha = 1.0f; Composite origComposite = g.getComposite(); if (origComposite instanceof AlphaComposite) { AlphaComposite origAlphaComposite = (AlphaComposite)origComposite; if (origAlphaComposite.getRule() == AlphaComposite.SRC_OVER) { origAlpha = origAlphaComposite.getAlpha(); } } // _0 AffineTransform trans_0 = g.getTransform(); paintRootGraphicsNode_0(g); g.setTransform(trans_0); } private void paintShapeNode_0_0_0_0(Graphics2D g) { Rectangle2D.Double shape0 = new Rectangle2D.Double(3.4108753204345703, 6.967115879058838, 9.395554542541504, 7.862049102783203); g.setPaint(new LinearGradientPaint(new Point2D.Double(-6.536110877990723, -19.8179931640625), new Point2D.Double(-10.107403755187988, -19.81723976135254), new float[] {0.0f,1.0f}, new Color[] {new Color(33, 153, 255, 255),new Color(171, 236, 255, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(3.710136890411377f, 0.0f, 0.0f, 3.1079695224761963f, 40.813621520996094f, 73.7785415649414f))); g.fill(shape0); g.setPaint(new Color(0, 143, 244, 255)); g.setStroke(new BasicStroke(0.848933f,0,0,4.0f,null,0.0f)); g.draw(shape0); } private void paintShapeNode_0_0_0_1(Graphics2D g) { GeneralPath shape1 = new GeneralPath(); shape1.moveTo(-2.8669329, -6.202803); shape1.lineTo(-8.820576, -6.142075); shape1.lineTo(-5.8963456, -11.328445); shape1.closePath(); g.setPaint(new LinearGradientPaint(new Point2D.Double(-10.63449764251709, -21.764833450317383), new Point2D.Double(-10.617325782775879, -23.629880905151367), new float[] {0.0f,1.0f}, new Color[] {new Color(33, 153, 255, 255),new Color(171, 236, 255, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(1.8868346214294434f, 0.0f, 0.0f, 1.4989235401153564f, 14.2290678024292f, 26.43236541748047f))); g.fill(shape1); g.setPaint(new Color(0, 143, 244, 255)); g.setStroke(new BasicStroke(0.57000023f,0,0,4.0f,null,0.0f)); g.draw(shape1); } private void paintShapeNode_0_0_0_2(Graphics2D g) { Rectangle2D.Double shape2 = new Rectangle2D.Double(5.186069965362549, 10.723807334899902, 2.0223355293273926, 4.0988593101501465); g.setPaint(new LinearGradientPaint(new Point2D.Double(-7.575003147125244, -19.838491439819336), new Point2D.Double(-10.107403755187988, -19.81723976135254), new float[] {0.0f,1.0f}, new Color[] {new Color(33, 153, 255, 255),new Color(171, 236, 255, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(4.607216835021973f, 0.0f, 0.0f, 3.8574249744415283f, 48.4862174987793f, 88.15104675292969f))); g.fill(shape2); g.setPaint(new Color(0, 143, 244, 255)); g.setStroke(new BasicStroke(0.68437374f,0,0,4.0f,null,0.0f)); g.draw(shape2); } private void paintShapeNode_0_0_0_3(Graphics2D g) { Rectangle2D.Double shape3 = new Rectangle2D.Double(9.003052711486816, 10.756638526916504, 2.784526824951172, 1.738211750984192); g.setPaint(new LinearGradientPaint(new Point2D.Double(-7.575003147125244, -19.838491439819336), new Point2D.Double(-10.107403755187988, -19.81723976135254), new float[] {0.0f,1.0f}, new Color[] {new Color(33, 153, 255, 255),new Color(171, 236, 255, 255)}, MultipleGradientPaint.CycleMethod.NO_CYCLE, MultipleGradientPaint.ColorSpaceType.SRGB, new AffineTransform(6.343615531921387f, 0.0f, 0.0f, 1.6358261108398438f, 68.62245178222656f, 43.591365814208984f))); g.fill(shape3); g.setPaint(new Color(0, 143, 244, 255)); g.setStroke(new BasicStroke(0.52295256f,0,0,4.0f,null,0.0f)); g.draw(shape3); } private void paintCompositeGraphicsNode_0_0_0(Graphics2D g) { // _0_0_0_0 AffineTransform trans_0_0_0_0 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); paintShapeNode_0_0_0_0(g); g.setTransform(trans_0_0_0_0); // _0_0_0_1 AffineTransform trans_0_0_0_1 = g.getTransform(); g.transform(new AffineTransform(1.966328740119934f, 0.0f, 0.0f, 1.1280816793441772f, 19.599395751953125f, 14.288103103637695f)); paintShapeNode_0_0_0_1(g); g.setTransform(trans_0_0_0_1); // _0_0_0_2 AffineTransform trans_0_0_0_2 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); paintShapeNode_0_0_0_2(g); g.setTransform(trans_0_0_0_2); // _0_0_0_3 AffineTransform trans_0_0_0_3 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); paintShapeNode_0_0_0_3(g); g.setTransform(trans_0_0_0_3); } private void paintCanvasGraphicsNode_0_0(Graphics2D g) { // _0_0_0 AffineTransform trans_0_0_0 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); paintCompositeGraphicsNode_0_0_0(g); g.setTransform(trans_0_0_0); } private void paintRootGraphicsNode_0(Graphics2D g) { // _0_0 g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha)); AffineTransform trans_0_0 = g.getTransform(); g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f)); paintCanvasGraphicsNode_0_0(g); g.setTransform(trans_0_0); } /** * 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 int getOrigX() { return 2; } /** * 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 int getOrigY() { return 1; } /** * 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 int getOrigWidth() { return 14; } /** * 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 int getOrigHeight() { return 15; } /** * 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 FolderHomeIcon() { 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; } /* * Set the dimension of the icon. */ public void setDimension(Dimension newDimension) { this.width = newDimension.width; this.height = newDimension.height; } /* * (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.translate(x, y); double coef1 = (double) this.width / (double) getOrigWidth(); double coef2 = (double) this.height / (double) getOrigHeight(); double coef = Math.min(coef1, coef2); g2d.scale(coef, coef); paint(g2d); g2d.dispose(); } }