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 ViewListIcon 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) {
RoundRectangle2D.Double shape0 = new RoundRectangle2D.Double(2.303576946258545, 0.9705909490585327, 11.702507972717285, 14.64108943939209, 1.711881160736084, 1.711881160736084);
g.setPaint(new Color(119, 119, 118, 91));
g.fill(shape0);
}
private void paintShapeNode_0_0_0_1(Graphics2D g) {
RoundRectangle2D.Double shape1 = new RoundRectangle2D.Double(0.7421406507492065, 0.6831681728363037, 14.290312767028809, 14.64108943939209, 1.711881160736084, 1.711881160736084);
g.setPaint(new Color(255, 255, 255, 255));
g.fill(shape1);
g.setPaint(new Color(0, 119, 203, 161));
g.setStroke(new BasicStroke(0.27626216f,0,2,4.0f,null,0.0f));
g.draw(shape1);
}
private void paintShapeNode_0_0_0_2(Graphics2D g) {
Rectangle2D.Double shape2 = new Rectangle2D.Double(2.366633415222168, 3.130628824234009, 10.811881065368652, 0.5097317695617676);
g.fill(shape2);
}
private void paintShapeNode_0_0_0_3(Graphics2D g) {
Rectangle2D.Double shape3 = new Rectangle2D.Double(2.356137990951538, 4.895227909088135, 10.811881065368652, 0.5097317695617676);
g.fill(shape3);
}
private void paintShapeNode_0_0_0_4(Graphics2D g) {
Rectangle2D.Double shape4 = new Rectangle2D.Double(2.3613858222961426, 6.625022888183594, 10.811881065368652, 0.5097317695617676);
g.fill(shape4);
}
private void paintShapeNode_0_0_0_5(Graphics2D g) {
Rectangle2D.Double shape5 = new Rectangle2D.Double(2.350890636444092, 8.38962173461914, 10.811881065368652, 0.5097317695617676);
g.fill(shape5);
}
private void paintShapeNode_0_0_0_6(Graphics2D g) {
Rectangle2D.Double shape6 = new Rectangle2D.Double(2.364009380340576, 10.102014541625977, 10.811881065368652, 0.5097317695617676);
g.fill(shape6);
}
private void paintShapeNode_0_0_0_7(Graphics2D g) {
Rectangle2D.Double shape7 = new Rectangle2D.Double(2.3535141944885254, 11.866613388061523, 10.811881065368652, 0.5097317695617676);
g.fill(shape7);
}
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.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
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);
// _0_0_0_4
AffineTransform trans_0_0_0_4 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
paintShapeNode_0_0_0_4(g);
g.setTransform(trans_0_0_0_4);
// _0_0_0_5
AffineTransform trans_0_0_0_5 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
paintShapeNode_0_0_0_5(g);
g.setTransform(trans_0_0_0_5);
// _0_0_0_6
AffineTransform trans_0_0_0_6 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
paintShapeNode_0_0_0_6(g);
g.setTransform(trans_0_0_0_6);
// _0_0_0_7
AffineTransform trans_0_0_0_7 = g.getTransform();
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
paintShapeNode_0_0_0_7(g);
g.setTransform(trans_0_0_0_7);
}
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 1;
}
/**
* 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 15;
}
/**
* 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 16;
}
/**
* 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 ViewListIcon() {
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();
}
}