forked from kirill-grouchnikov/flamingo
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathedit_copy.java
254 lines (209 loc) · 10.1 KB
/
edit_copy.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
package test.svg.transcoded;
import java.awt.*;
import java.awt.geom.*;
import static java.awt.Color.*;
import static java.awt.MultipleGradientPaint.CycleMethod.*;
import static java.awt.MultipleGradientPaint.ColorSpaceType.*;
/**
* This class has been automatically generated using
* <a href="http://ebourg.github.io/flamingo-svg-transcoder/">Flamingo SVG transcoder</a>.
*/
public class edit_copy implements org.pushingpixels.flamingo.api.common.icon.ResizableIcon {
/**
* 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;
float origAlpha = 1.0f;
Composite origComposite = g.getComposite();
if (origComposite instanceof AlphaComposite) {
AlphaComposite origAlphaComposite = (AlphaComposite)origComposite;
if (origAlphaComposite.getRule() == AlphaComposite.SRC_OVER) {
origAlpha = origAlphaComposite.getAlpha();
}
}
java.util.LinkedList<AffineTransform> transformations = new java.util.LinkedList<AffineTransform>();
//
// _0
// _0_0
g.setComposite(AlphaComposite.getInstance(3, 0.49999997f * origAlpha));
transformations.push(g.getTransform());
g.transform(new AffineTransform(1.001508f, 0, 0, 1.000616f, -0.05002205f, -0.06304895f));
// _0_0_0
g.setComposite(AlphaComposite.getInstance(3, 0.08522725f * origAlpha));
// _0_0_0_0
shape = new Rectangle2D.Double(20.161836624145508, 34.03341293334961, 13, 2);
g.setPaint(BLACK);
g.fill(shape);
g.setComposite(AlphaComposite.getInstance(3, 0.49999997f * origAlpha));
// _0_0_0_1
shape = new RoundRectangle2D.Double(1.5484408140182495, 1.5629303455352783, 30.95155906677246, 35.976688385009766, 1.131310224533081, 1.1323192119598389);
g.setPaint(new LinearGradientPaint(new Point2D.Double(22.308330535888672, 18.99213981628418), new Point2D.Double(35.78529357910156, 39.49823760986328), new float[]{0, 0.59928656f, 0.82758623f, 1}, new Color[]{new Color(0xF0F0EF), new Color(0xE8E8E8), WHITE, new Color(0xD8D8D3)}, NO_CYCLE, SRGB, new AffineTransform(1.065698f, 0, 0, 0.987595f, -8.54832f, -4.891713f)));
g.fill(shape);
g.setPaint(new Color(0x888A85));
g.setStroke(new BasicStroke(0.99893934f, 0, 0, 4));
g.draw(shape);
// _0_0_0_2
shape = new Rectangle2D.Double(2.532512903213501, 2.5605955123901367, 28.970741271972656, 33.981056213378906);
g.setPaint(new LinearGradientPaint(new Point2D.Double(26.076091766357422, 26.69667625427246), new Point2D.Double(30.811172485351562, 42.00735092163086), new float[]{0, 1}, new Color[]{WHITE, new Color(0xFFFFFF, true)}, NO_CYCLE, SRGB, new AffineTransform(0.998504f, 0, 0, 0.998246f, -6.970391f, -4.892901f)));
g.setStroke(new BasicStroke(0.99893963f, 0, 0, 4));
g.draw(shape);
g.setComposite(AlphaComposite.getInstance(3, 0.08522725f * origAlpha));
// _0_0_0_3
shape = new Rectangle2D.Double(7.016119003295898, 10.033413887023926, 21, 2);
g.setPaint(BLACK);
g.fill(shape);
// _0_0_0_4
shape = new Rectangle2D.Double(7.016119003295898, 14.033413887023926, 20, 2);
g.fill(shape);
// _0_0_0_5
shape = new Rectangle2D.Double(7.016119003295898, 18.033414840698242, 18, 2);
g.fill(shape);
// _0_0_0_6
shape = new Rectangle2D.Double(7.016119003295898, 22.033414840698242, 21, 2);
g.fill(shape);
// _0_0_0_7
shape = new Rectangle2D.Double(7.016119003295898, 26.03341293334961, 13, 2);
g.fill(shape);
g.setTransform(transformations.pop()); // _0_0_0
g.setComposite(AlphaComposite.getInstance(3, 1 * origAlpha));
// _0_0_1
// _0_0_1_0
shape = new GeneralPath();
((GeneralPath) shape).moveTo(15.072946, 10.500852);
((GeneralPath) shape).lineTo(44.929333, 10.500852);
((GeneralPath) shape).curveTo(45.24507, 10.500852, 45.499256, 10.753945, 45.499256, 11.068324);
((GeneralPath) shape).lineTo(45.499256, 38.235687);
((GeneralPath) shape).curveTo(45.499256, 40.71214, 38.619446, 46.538773, 36.231323, 46.538773);
((GeneralPath) shape).lineTo(15.072946, 46.538773);
((GeneralPath) shape).curveTo(14.757206, 46.538773, 14.50302, 46.285683, 14.50302, 45.9713);
((GeneralPath) shape).lineTo(14.50302, 11.068324);
((GeneralPath) shape).curveTo(14.50302, 10.753945, 14.757206, 10.500852, 15.072946, 10.500852);
((GeneralPath) shape).closePath();
g.setPaint(new LinearGradientPaint(new Point2D.Double(22.308330535888672, 18.99213981628418), new Point2D.Double(35.78529357910156, 39.49823760986328), new float[]{0, 0.59928656f, 0.82758623f, 1}, new Color[]{new Color(0xF0F0EF), new Color(0xE8E8E8), WHITE, new Color(0xD8D8D3)}, NO_CYCLE, SRGB, new AffineTransform(1.067236f, 0, 0, 0.989276f, 4.391684f, 4.035227f)));
g.fill(shape);
g.setPaint(new Color(0x888A85));
g.setStroke(new BasicStroke(1, 0, 0, 4));
g.draw(shape);
// _0_0_1_1
shape = new Rectangle2D.Double(15.502950668334961, 11.5, 28.99734878540039, 34.04076385498047);
g.setPaint(new LinearGradientPaint(new Point2D.Double(26.076091766357422, 26.69667625427246), new Point2D.Double(30.811172485351562, 42.00735092163086), new float[]{0, 1}, new Color[]{WHITE, new Color(0xFFFFFF, true)}, NO_CYCLE, SRGB, new AffineTransform(0.999421f, 0, 0, 1, 5.991319f, 4.033411f)));
g.draw(shape);
// _0_0_1_2
shape = new GeneralPath();
((GeneralPath) shape).moveTo(36.220917, 46.536964);
((GeneralPath) shape).curveTo(38.251335, 46.866863, 45.80971, 42.00704, 45.50533, 38.039124);
((GeneralPath) shape).curveTo(43.942066, 40.46222, 40.746807, 39.32586, 36.63805, 39.48487);
((GeneralPath) shape).curveTo(36.63805, 39.48487, 37.033417, 46.036964, 36.220917, 46.536964);
((GeneralPath) shape).closePath();
g.setPaint(new LinearGradientPaint(new Point2D.Double(35.99658203125, 40.458221435546875), new Point2D.Double(33.664920806884766, 37.770721435546875), new float[]{0, 1}, new Color[]{new Color(0x7C7C7C), new Color(0xB8B8B8)}, NO_CYCLE, SRGB, new AffineTransform(1, 0, 0, 1, 6.161836f, 4.033411f)));
g.fill(shape);
g.setPaint(new Color(0x868A84));
g.draw(shape);
g.setComposite(AlphaComposite.getInstance(3, 0.36931816f * origAlpha));
// _0_0_1_3
shape = new GeneralPath();
((GeneralPath) shape).moveTo(37.671356, 44.345463);
((GeneralPath) shape).curveTo(39.041134, 43.661636, 42.099606, 42.198997, 43.398987, 40.317993);
((GeneralPath) shape).curveTo(41.80289, 40.99805, 40.451176, 40.527493, 37.69665, 40.5084);
((GeneralPath) shape).curveTo(37.69665, 40.5084, 37.858974, 43.570496, 37.671356, 44.345463);
((GeneralPath) shape).closePath();
g.setPaint(new LinearGradientPaint(new Point2D.Double(33.39600372314453, 36.92133331298828), new Point2D.Double(34.170047760009766, 38.07038116455078), new float[]{0, 1}, new Color[]{WHITE, new Color(0xFFFFFF, true)}, NO_CYCLE, SRGB, new AffineTransform(1, 0, 0, 1, 6.161836f, 3.658411f)));
g.draw(shape);
g.setComposite(AlphaComposite.getInstance(3, 0.17045452f * origAlpha));
// _0_0_1_4
shape = new Rectangle2D.Double(20, 19.033414840698242, 21, 2);
g.setPaint(BLACK);
g.fill(shape);
// _0_0_1_5
shape = new Rectangle2D.Double(20, 23.033414840698242, 19.992233276367188, 2);
g.fill(shape);
// _0_0_1_6
shape = new Rectangle2D.Double(20, 27.033414840698242, 17.976701736450195, 2);
g.fill(shape);
// _0_0_1_7
shape = new Rectangle2D.Double(20, 31.033414840698242, 21, 2);
g.fill(shape);
}
/**
* 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 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 static int getOrigY() {
return 2;
}
/**
* 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 46;
}
/**
* 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 47;
}
/**
* 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 edit_copy() {
this.width = getOrigWidth();
this.height = getOrigHeight();
}
@Override
public int getIconHeight() {
return height;
}
@Override
public int getIconWidth() {
return width;
}
/*
* (non-Javadoc)
*
* @see org.pushingpixels.flamingo.api.common.icon.ResizableIcon#setDimension(java.awt.Dimension)
*/
@Override
public void setDimension(Dimension dimension) {
this.width = dimension.width;
this.height = dimension.height;
}
@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.scale(coef, coef);
paint(g2d);
g2d.dispose();
}
}