KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > java > swing > plaf > nimbus > OptionPanePainter


1 /*
2  * OptionPanePainter.java %E%
3  *
4  * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package com.sun.java.swing.plaf.nimbus;
8
9 import java.awt.*;
10 import java.awt.geom.*;
11 import java.awt.image.*;
12 import javax.swing.*;
13 import com.sun.java.swing.Painter;
14
15 /**
16  */

17 public final class OptionPanePainter extends AbstractRegionPainter {
18     //package private integers representing the available states that
19
//this painter will paint. These are used when creating a new instance
20
//of OptionPanePainter to determine which region/state is being painted
21
//by that instance.
22
static final int BACKGROUND_ENABLED = 1;
23     static final int ERRORICON_ENABLED = 2;
24     static final int INFORMATIONICON_ENABLED = 3;
25     static final int QUESTIONICON_ENABLED = 4;
26     static final int WARNINGICON_ENABLED = 5;
27
28
29     private int state; //refers to one of the static final ints above
30
private PaintContext ctx;
31
32     //the following 4 variables are reused during the painting code of the layers
33
private Path2D path = new Path2D.Float();
34     private Rectangle2D rect = new Rectangle2D.Float(0, 0, 0, 0);
35     private RoundRectangle2D roundRect = new RoundRectangle2D.Float(0, 0, 0, 0, 0, 0);
36     private Ellipse2D ellipse = new Ellipse2D.Float(0, 0, 0, 0);
37
38     //All Colors used for painting are stored here. Ideally, only those colors being used
39
//by a particular instance of OptionPanePainter would be created. For the moment at least,
40
//however, all are created for each instance.
41
private Color color1 = decodeColor("nimbusRed", -0.014814814f, 0.18384242f, 0.015686274f, 0);
42     private Color color2 = decodeColor("nimbusRed", -0.014814814f, -0.403261f, 0.21960783f, 0);
43     private Color color3 = decodeColor("nimbusRed", -0.014814814f, -0.07154381f, 0.11372548f, 0);
44     private Color color4 = decodeColor("nimbusRed", -0.014814814f, 0.110274374f, 0.07058823f, 0);
45     private Color color5 = decodeColor("nimbusRed", -0.014814814f, -0.05413574f, 0.2588235f, 0);
46     private Color color6 = new Color(250, 250, 250, 255);
47     private Color color7 = decodeColor("nimbusRed", 0.0f, -0.79881656f, 0.33725488f, -187);
48     private Color color8 = new Color(255, 200, 0, 255);
49     private Color color9 = decodeColor("nimbusInfoBlue", 0.0f, 0.06231594f, -0.054901958f, 0);
50     private Color color10 = decodeColor("nimbusInfoBlue", 3.1620264E-4f, 0.07790506f, -0.19215685f, 0);
51     private Color color11 = decodeColor("nimbusInfoBlue", -8.2296133E-4f, -0.44631243f, 0.19215685f, 0);
52     private Color color12 = decodeColor("nimbusInfoBlue", 0.0012729168f, -0.0739674f, 0.043137252f, 0);
53     private Color color13 = decodeColor("nimbusInfoBlue", 8.354187E-4f, -0.14148629f, 0.19999999f, 0);
54     private Color color14 = decodeColor("nimbusInfoBlue", -0.0014793873f, -0.41456455f, 0.16470587f, 0);
55     private Color color15 = decodeColor("nimbusInfoBlue", 3.437996E-4f, -0.14726585f, 0.043137252f, 0);
56     private Color color16 = decodeColor("nimbusInfoBlue", -4.271865E-4f, -0.0055555105f, 0.0f, 0);
57     private Color color17 = decodeColor("nimbusInfoBlue", 0.0f, 0.0f, 0.0f, 0);
58     private Color color18 = decodeColor("nimbusInfoBlue", -7.866621E-4f, -0.12728173f, 0.17254901f, 0);
59     private Color color19 = new Color(115, 120, 126, 255);
60     private Color color20 = new Color(26, 34, 43, 255);
61     private Color color21 = new Color(168, 173, 178, 255);
62     private Color color22 = new Color(101, 109, 118, 255);
63     private Color color23 = new Color(159, 163, 168, 255);
64     private Color color24 = new Color(116, 122, 130, 255);
65     private Color color25 = new Color(96, 104, 112, 255);
66     private Color color26 = new Color(118, 128, 138, 255);
67     private Color color27 = new Color(255, 255, 255, 255);
68     private Color color28 = decodeColor("nimbusAlertYellow", -4.9102306E-4f, 0.1372549f, -0.15294117f, 0);
69     private Color color29 = decodeColor("nimbusAlertYellow", -0.0015973002f, 0.1372549f, -0.3490196f, 0);
70     private Color color30 = decodeColor("nimbusAlertYellow", 6.530881E-4f, -0.40784314f, 0.0f, 0);
71     private Color color31 = decodeColor("nimbusAlertYellow", -3.9456785E-4f, -0.109803915f, 0.0f, 0);
72     private Color color32 = decodeColor("nimbusAlertYellow", 0.0f, 0.0f, 0.0f, 0);
73     private Color color33 = decodeColor("nimbusAlertYellow", 0.008085668f, -0.04705882f, 0.0f, 0);
74     private Color color34 = decodeColor("nimbusAlertYellow", 0.026515156f, -0.18431371f, 0.0f, 0);
75     private Color color35 = new Color(69, 69, 69, 255);
76     private Color color36 = new Color(0, 0, 0, 255);
77     private Color color37 = new Color(16, 16, 16, 255);
78
79
80     //Array of current component colors, updated in each paint call
81
private Object JavaDoc[] componentColors;
82
83     public OptionPanePainter(PaintContext ctx, int state) {
84         super();
85         this.state = state;
86         this.ctx = ctx;
87     }
88
89     @Override JavaDoc
90     protected void doPaint(Graphics2D g, JComponent c, int width, int height, Object JavaDoc[] extendedCacheKeys) {
91         //populate componentColors array with colors calculated in getExtendedCacheKeys call
92
componentColors = extendedCacheKeys;
93         //generate this entire method. Each state/bg/fg/border combo that has
94
//been painted gets its own KEY and paint method.
95
switch(state) {
96             case ERRORICON_ENABLED: painterrorIconEnabled(g); break;
97             case INFORMATIONICON_ENABLED: paintinformationIconEnabled(g); break;
98             case QUESTIONICON_ENABLED: paintquestionIconEnabled(g); break;
99             case WARNINGICON_ENABLED: paintwarningIconEnabled(g); break;
100
101         }
102     }
103         
104
105
106     @Override JavaDoc
107     protected final PaintContext getPaintContext() {
108         return ctx;
109     }
110
111     private void painterrorIconEnabled(Graphics2D g) {
112         path = decodePath1();
113         g.setPaint(color1);
114         g.fill(path);
115         path = decodePath2();
116         g.setPaint(decodeGradient1(path));
117         g.fill(path);
118         path = decodePath3();
119         g.setPaint(color6);
120         g.fill(path);
121         ellipse = decodeEllipse1();
122         g.setPaint(color6);
123         g.fill(ellipse);
124         path = decodePath4();
125         g.setPaint(color7);
126         g.fill(path);
127
128     }
129
130     private void paintinformationIconEnabled(Graphics2D g) {
131         ellipse = decodeEllipse2();
132         g.setPaint(color8);
133         g.fill(ellipse);
134         ellipse = decodeEllipse2();
135         g.setPaint(color8);
136         g.fill(ellipse);
137         ellipse = decodeEllipse2();
138         g.setPaint(color8);
139         g.fill(ellipse);
140         ellipse = decodeEllipse3();
141         g.setPaint(decodeGradient2(ellipse));
142         g.fill(ellipse);
143         ellipse = decodeEllipse4();
144         g.setPaint(decodeGradient3(ellipse));
145         g.fill(ellipse);
146         ellipse = decodeEllipse5();
147         g.setPaint(decodeGradient4(ellipse));
148         g.fill(ellipse);
149         path = decodePath5();
150         g.setPaint(color6);
151         g.fill(path);
152         ellipse = decodeEllipse6();
153         g.setPaint(color6);
154         g.fill(ellipse);
155
156     }
157
158     private void paintquestionIconEnabled(Graphics2D g) {
159         ellipse = decodeEllipse3();
160         g.setPaint(decodeGradient5(ellipse));
161         g.fill(ellipse);
162         ellipse = decodeEllipse4();
163         g.setPaint(decodeGradient6(ellipse));
164         g.fill(ellipse);
165         ellipse = decodeEllipse5();
166         g.setPaint(decodeGradient7(ellipse));
167         g.fill(ellipse);
168         path = decodePath6();
169         g.setPaint(color27);
170         g.fill(path);
171         ellipse = decodeEllipse1();
172         g.setPaint(color27);
173         g.fill(ellipse);
174
175     }
176
177     private void paintwarningIconEnabled(Graphics2D g) {
178         rect = decodeRect1();
179         g.setPaint(color8);
180         g.fill(rect);
181         path = decodePath7();
182         g.setPaint(decodeGradient8(path));
183         g.fill(path);
184         path = decodePath8();
185         g.setPaint(decodeGradient9(path));
186         g.fill(path);
187         path = decodePath9();
188         g.setPaint(decodeGradient10(path));
189         g.fill(path);
190         ellipse = decodeEllipse7();
191         g.setPaint(color37);
192         g.fill(ellipse);
193
194     }
195
196
197
198     private Path2D decodePath1() {
199         path.reset();
200         path.moveTo(decodeX(1.0f), decodeY(1.2708334f));
201         path.lineTo(decodeX(1.2708334f), decodeY(1.0f));
202         path.lineTo(decodeX(1.6875f), decodeY(1.0f));
203         path.lineTo(decodeX(1.9583333f), decodeY(1.2708334f));
204         path.lineTo(decodeX(1.9583333f), decodeY(1.6875f));
205         path.lineTo(decodeX(1.6875f), decodeY(1.9583333f));
206         path.lineTo(decodeX(1.2708334f), decodeY(1.9583333f));
207         path.lineTo(decodeX(1.0f), decodeY(1.6875f));
208         path.lineTo(decodeX(1.0f), decodeY(1.2708334f));
209         path.closePath();
210         return path;
211     }
212
213     private Path2D decodePath2() {
214         path.reset();
215         path.moveTo(decodeX(1.0208334f), decodeY(1.2916666f));
216         path.lineTo(decodeX(1.2916666f), decodeY(1.0208334f));
217         path.lineTo(decodeX(1.6666667f), decodeY(1.0208334f));
218         path.lineTo(decodeX(1.9375f), decodeY(1.2916666f));
219         path.lineTo(decodeX(1.9375f), decodeY(1.6666667f));
220         path.lineTo(decodeX(1.6666667f), decodeY(1.9375f));
221         path.lineTo(decodeX(1.2916666f), decodeY(1.9375f));
222         path.lineTo(decodeX(1.0208334f), decodeY(1.6666667f));
223         path.lineTo(decodeX(1.0208334f), decodeY(1.2916666f));
224         path.closePath();
225         return path;
226     }
227
228     private Path2D decodePath3() {
229         path.reset();
230         path.moveTo(decodeX(1.4166666f), decodeY(1.2291666f));
231         path.curveTo(decodeAnchorX(1.4166666269302368f, 0.0f), decodeAnchorY(1.2291666269302368f, -2.0f), decodeAnchorX(1.4791666269302368f, -2.0f), decodeAnchorY(1.1666666269302368f, 0.0f), decodeX(1.4791666f), decodeY(1.1666666f));
232         path.curveTo(decodeAnchorX(1.4791666269302368f, 2.0f), decodeAnchorY(1.1666666269302368f, 0.0f), decodeAnchorX(1.5416667461395264f, 0.0f), decodeAnchorY(1.2291666269302368f, -2.0f), decodeX(1.5416667f), decodeY(1.2291666f));
233         path.curveTo(decodeAnchorX(1.5416667461395264f, 0.0f), decodeAnchorY(1.2291666269302368f, 2.0f), decodeAnchorX(1.5f, 0.0f), decodeAnchorY(1.6041667461395264f, 0.0f), decodeX(1.5f), decodeY(1.6041667f));
234         path.lineTo(decodeX(1.4583334f), decodeY(1.6041667f));
235         path.curveTo(decodeAnchorX(1.4583333730697632f, 0.0f), decodeAnchorY(1.6041667461395264f, 0.0f), decodeAnchorX(1.4166666269302368f, 0.0f), decodeAnchorY(1.2291666269302368f, 2.0f), decodeX(1.4166666f), decodeY(1.2291666f));
236         path.closePath();
237         return path;
238     }
239
240     private Ellipse2D decodeEllipse1() {
241         ellipse.setFrame(decodeX(1.4166666f), //x
242
decodeY(1.6666667f), //y
243
decodeX(1.5416667f) - decodeX(1.4166666f), //width
244
decodeY(1.7916667f) - decodeY(1.6666667f)); //height
245
return ellipse;
246     }
247
248     private Path2D decodePath4() {
249         path.reset();
250         path.moveTo(decodeX(1.0208334f), decodeY(1.2851562f));
251         path.lineTo(decodeX(1.2799479f), decodeY(1.0208334f));
252         path.lineTo(decodeX(1.6783855f), decodeY(1.0208334f));
253         path.lineTo(decodeX(1.9375f), decodeY(1.28125f));
254         path.lineTo(decodeX(1.9375f), decodeY(1.6666667f));
255         path.lineTo(decodeX(1.6666667f), decodeY(1.9375f));
256         path.lineTo(decodeX(1.2851562f), decodeY(1.936198f));
257         path.lineTo(decodeX(1.0221354f), decodeY(1.673177f));
258         path.lineTo(decodeX(1.0208334f), decodeY(1.5f));
259         path.lineTo(decodeX(1.0416666f), decodeY(1.5f));
260         path.lineTo(decodeX(1.0416666f), decodeY(1.6666667f));
261         path.lineTo(decodeX(1.2916666f), decodeY(1.9166667f));
262         path.lineTo(decodeX(1.6666667f), decodeY(1.9166667f));
263         path.lineTo(decodeX(1.9166667f), decodeY(1.6666667f));
264         path.lineTo(decodeX(1.9166667f), decodeY(1.2916666f));
265         path.lineTo(decodeX(1.6666667f), decodeY(1.0416666f));
266         path.lineTo(decodeX(1.2916666f), decodeY(1.0416666f));
267         path.lineTo(decodeX(1.0416666f), decodeY(1.2916666f));
268         path.lineTo(decodeX(1.0416666f), decodeY(1.5f));
269         path.lineTo(decodeX(1.0208334f), decodeY(1.5f));
270         path.lineTo(decodeX(1.0208334f), decodeY(1.2851562f));
271         path.closePath();
272         return path;
273     }
274
275     private Ellipse2D decodeEllipse2() {
276         ellipse.setFrame(decodeX(1.0f), //x
277
decodeY(1.0f), //y
278
decodeX(1.0f) - decodeX(1.0f), //width
279
decodeY(1.0f) - decodeY(1.0f)); //height
280
return ellipse;
281     }
282
283     private Ellipse2D decodeEllipse3() {
284         ellipse.setFrame(decodeX(1.0f), //x
285
decodeY(1.0f), //y
286
decodeX(1.9583333f) - decodeX(1.0f), //width
287
decodeY(1.9583333f) - decodeY(1.0f)); //height
288
return ellipse;
289     }
290
291     private Ellipse2D decodeEllipse4() {
292         ellipse.setFrame(decodeX(1.0208334f), //x
293
decodeY(1.0208334f), //y
294
decodeX(1.9375f) - decodeX(1.0208334f), //width
295
decodeY(1.9375f) - decodeY(1.0208334f)); //height
296
return ellipse;
297     }
298
299     private Ellipse2D decodeEllipse5() {
300         ellipse.setFrame(decodeX(1.0416666f), //x
301
decodeY(1.0416666f), //y
302
decodeX(1.9166667f) - decodeX(1.0416666f), //width
303
decodeY(1.9166667f) - decodeY(1.0416666f)); //height
304
return ellipse;
305     }
306
307     private Path2D decodePath5() {
308         path.reset();
309         path.moveTo(decodeX(1.375f), decodeY(1.375f));
310         path.curveTo(decodeAnchorX(1.375f, 2.5f), decodeAnchorY(1.375f, 0.0f), decodeAnchorX(1.5f, -1.1875f), decodeAnchorY(1.375f, 0.0f), decodeX(1.5f), decodeY(1.375f));
311         path.curveTo(decodeAnchorX(1.5f, 1.1875f), decodeAnchorY(1.375f, 0.0f), decodeAnchorX(1.5416667461395264f, 0.0f), decodeAnchorY(1.4375f, -2.0f), decodeX(1.5416667f), decodeY(1.4375f));
312         path.curveTo(decodeAnchorX(1.5416667461395264f, 0.0f), decodeAnchorY(1.4375f, 2.0f), decodeAnchorX(1.5416667461395264f, 0.0f), decodeAnchorY(1.6875f, 0.0f), decodeX(1.5416667f), decodeY(1.6875f));
313         path.curveTo(decodeAnchorX(1.5416667461395264f, 0.0f), decodeAnchorY(1.6875f, 0.0f), decodeAnchorX(1.6028645038604736f, -2.5625f), decodeAnchorY(1.6875f, 0.0625f), decodeX(1.6028645f), decodeY(1.6875f));
314         path.curveTo(decodeAnchorX(1.6028645038604736f, 2.5625f), decodeAnchorY(1.6875f, -0.0625f), decodeAnchorX(1.6041667461395264f, 2.5625f), decodeAnchorY(1.7708332538604736f, 0.0f), decodeX(1.6041667f), decodeY(1.7708333f));
315         path.curveTo(decodeAnchorX(1.6041667461395264f, -2.5625f), decodeAnchorY(1.7708332538604736f, 0.0f), decodeAnchorX(1.3567708730697632f, 2.5f), decodeAnchorY(1.7708332538604736f, 0.0625f), decodeX(1.3567709f), decodeY(1.7708333f));
316         path.curveTo(decodeAnchorX(1.3567708730697632f, -2.5f), decodeAnchorY(1.7708332538604736f, -0.0625f), decodeAnchorX(1.3541666269302368f, -2.4375f), decodeAnchorY(1.6875f, 0.0f), decodeX(1.3541666f), decodeY(1.6875f));
317         path.curveTo(decodeAnchorX(1.3541666269302368f, 2.4375f), decodeAnchorY(1.6875f, 0.0f), decodeAnchorX(1.4166666269302368f, 0.0f), decodeAnchorY(1.6875f, 0.0f), decodeX(1.4166666f), decodeY(1.6875f));
318         path.lineTo(decodeX(1.4166666f), decodeY(1.4583334f));
319         path.curveTo(decodeAnchorX(1.4166666269302368f, 0.0f), decodeAnchorY(1.4583333730697632f, 0.0f), decodeAnchorX(1.375f, 2.75f), decodeAnchorY(1.4583333730697632f, 0.0f), decodeX(1.375f), decodeY(1.4583334f));
320         path.curveTo(decodeAnchorX(1.375f, -2.75f), decodeAnchorY(1.4583333730697632f, 0.0f), decodeAnchorX(1.375f, -2.5f), decodeAnchorY(1.375f, 0.0f), decodeX(1.375f), decodeY(1.375f));
321         path.closePath();
322         return path;
323     }
324
325     private Ellipse2D decodeEllipse6() {
326         ellipse.setFrame(decodeX(1.4166666f), //x
327
decodeY(1.1666666f), //y
328
decodeX(1.5416667f) - decodeX(1.4166666f), //width
329
decodeY(1.2916666f) - decodeY(1.1666666f)); //height
330
return ellipse;
331     }
332
333     private Path2D decodePath6() {
334         path.reset();
335         path.moveTo(decodeX(1.3125f), decodeY(1.3723959f));
336         path.curveTo(decodeAnchorX(1.3125f, 1.5f), decodeAnchorY(1.3723958730697632f, 1.375f), decodeAnchorX(1.3997396230697632f, -0.75f), decodeAnchorY(1.3580728769302368f, 1.1875f), decodeX(1.3997396f), decodeY(1.3580729f));
337         path.curveTo(decodeAnchorX(1.3997396230697632f, 0.75f), decodeAnchorY(1.3580728769302368f, -1.1875f), decodeAnchorX(1.46875f, -1.8125f), decodeAnchorY(1.2903646230697632f, 0.0f), decodeX(1.46875f), decodeY(1.2903646f));
338         path.curveTo(decodeAnchorX(1.46875f, 1.8125f), decodeAnchorY(1.2903646230697632f, 0.0f), decodeAnchorX(1.53515625f, 0.0f), decodeAnchorY(1.3502603769302368f, -1.5625f), decodeX(1.5351562f), decodeY(1.3502604f));
339         path.curveTo(decodeAnchorX(1.53515625f, 0.0f), decodeAnchorY(1.3502603769302368f, 1.5625f), decodeAnchorX(1.4700521230697632f, 1.25f), decodeAnchorY(1.4283853769302368f, -1.1875f), decodeX(1.4700521f), decodeY(1.4283854f));
340         path.curveTo(decodeAnchorX(1.4700521230697632f, -1.25f), decodeAnchorY(1.4283853769302368f, 1.1875f), decodeAnchorX(1.41796875f, -0.0625f), decodeAnchorY(1.5442707538604736f, -1.5f), decodeX(1.4179688f), decodeY(1.5442708f));
341         path.curveTo(decodeAnchorX(1.41796875f, 0.0625f), decodeAnchorY(1.5442707538604736f, 1.5f), decodeAnchorX(1.4765625f, -1.3125f), decodeAnchorY(1.6028645038604736f, 0.0f), decodeX(1.4765625f), decodeY(1.6028645f));
342         path.curveTo(decodeAnchorX(1.4765625f, 1.3125f), decodeAnchorY(1.6028645038604736f, 0.0f), decodeAnchorX(1.5403645038604736f, 0.0f), decodeAnchorY(1.546875f, 1.625f), decodeX(1.5403645f), decodeY(1.546875f));
343         path.curveTo(decodeAnchorX(1.5403645038604736f, 0.0f), decodeAnchorY(1.546875f, -1.625f), decodeAnchorX(1.61328125f, -1.1875f), decodeAnchorY(1.46484375f, 1.25f), decodeX(1.6132812f), decodeY(1.4648438f));
344         path.curveTo(decodeAnchorX(1.61328125f, 1.1875f), decodeAnchorY(1.46484375f, -1.25f), decodeAnchorX(1.6666667461395264f, 0.0625f), decodeAnchorY(1.3463541269302368f, 3.3125f), decodeX(1.6666667f), decodeY(1.3463541f));
345         path.curveTo(decodeAnchorX(1.6666667461395264f, -0.0625f), decodeAnchorY(1.3463541269302368f, -3.3125f), decodeAnchorX(1.4830728769302368f, 6.125f), decodeAnchorY(1.16796875f, -0.0625f), decodeX(1.4830729f), decodeY(1.1679688f));
346         path.curveTo(decodeAnchorX(1.4830728769302368f, -6.125f), decodeAnchorY(1.16796875f, 0.0625f), decodeAnchorX(1.3046875f, 0.4375f), decodeAnchorY(1.2890625f, -1.25f), decodeX(1.3046875f), decodeY(1.2890625f));
347         path.curveTo(decodeAnchorX(1.3046875f, -0.4375f), decodeAnchorY(1.2890625f, 1.25f), decodeAnchorX(1.3125f, -1.5f), decodeAnchorY(1.3723958730697632f, -1.375f), decodeX(1.3125f), decodeY(1.3723959f));
348         path.closePath();
349         return path;
350     }
351
352     private Rectangle2D decodeRect1() {
353             rect.setRect(decodeX(1.0f), //x
354
decodeY(1.0f), //y
355
decodeX(1.0f) - decodeX(1.0f), //width
356
decodeY(1.0f) - decodeY(1.0f)); //height
357
return rect;
358     }
359
360     private Path2D decodePath7() {
361         path.reset();
362         path.moveTo(decodeX(1.5f), decodeY(1.0208334f));
363         path.curveTo(decodeAnchorX(1.5f, 2.0f), decodeAnchorY(1.0208333730697632f, 0.0f), decodeAnchorX(1.56640625f, 0.0f), decodeAnchorY(1.08203125f, 0.0f), decodeX(1.5664062f), decodeY(1.0820312f));
364         path.lineTo(decodeX(1.9427083f), decodeY(1.779948f));
365         path.curveTo(decodeAnchorX(1.9427082538604736f, 0.0f), decodeAnchorY(1.7799479961395264f, 0.0f), decodeAnchorX(1.9752604961395264f, 0.0f), decodeAnchorY(1.8802082538604736f, -2.375f), decodeX(1.9752605f), decodeY(1.8802083f));
366         path.curveTo(decodeAnchorX(1.9752604961395264f, 0.0f), decodeAnchorY(1.8802082538604736f, 2.375f), decodeAnchorX(1.9166667461395264f, 0.0f), decodeAnchorY(1.9375f, 0.0f), decodeX(1.9166667f), decodeY(1.9375f));
367         path.lineTo(decodeX(1.0833334f), decodeY(1.9375f));
368         path.curveTo(decodeAnchorX(1.0833333730697632f, 0.0f), decodeAnchorY(1.9375f, 0.0f), decodeAnchorX(1.0247396230697632f, 0.125f), decodeAnchorY(1.8815104961395264f, 2.25f), decodeX(1.0247396f), decodeY(1.8815105f));
369         path.curveTo(decodeAnchorX(1.0247396230697632f, -0.125f), decodeAnchorY(1.8815104961395264f, -2.25f), decodeAnchorX(1.0598958730697632f, 0.0f), decodeAnchorY(1.78125f, 0.0f), decodeX(1.0598959f), decodeY(1.78125f));
370         path.lineTo(decodeX(1.4375f), decodeY(1.0833334f));
371         path.curveTo(decodeAnchorX(1.4375f, 0.0f), decodeAnchorY(1.0833333730697632f, 0.0f), decodeAnchorX(1.5f, -2.0f), decodeAnchorY(1.0208333730697632f, 0.0f), decodeX(1.5f), decodeY(1.0208334f));
372         path.closePath();
373         return path;
374     }
375
376     private Path2D decodePath8() {
377         path.reset();
378         path.moveTo(decodeX(1.4986979f), decodeY(1.0429688f));
379         path.curveTo(decodeAnchorX(1.4986978769302368f, 1.75f), decodeAnchorY(1.04296875f, 0.0f), decodeAnchorX(1.5546875f, 0.0f), decodeAnchorY(1.0950521230697632f, 0.0f), decodeX(1.5546875f), decodeY(1.0950521f));
380         path.lineTo(decodeX(1.9322917f), decodeY(1.8007812f));
381         path.curveTo(decodeAnchorX(1.9322917461395264f, 0.0f), decodeAnchorY(1.80078125f, 0.0f), decodeAnchorX(1.95703125f, 0.0f), decodeAnchorY(1.875f, -1.4375f), decodeX(1.9570312f), decodeY(1.875f));
382         path.curveTo(decodeAnchorX(1.95703125f, 0.0f), decodeAnchorY(1.875f, 1.4375f), decodeAnchorX(1.8841145038604736f, 0.0f), decodeAnchorY(1.9166667461395264f, 0.0f), decodeX(1.8841145f), decodeY(1.9166667f));
383         path.lineTo(decodeX(1.1002604f), decodeY(1.9166667f));
384         path.curveTo(decodeAnchorX(1.1002603769302368f, 0.0f), decodeAnchorY(1.9166667461395264f, 0.0f), decodeAnchorX(1.0455728769302368f, 0.0625f), decodeAnchorY(1.8723957538604736f, 1.625f), decodeX(1.0455729f), decodeY(1.8723958f));
385         path.curveTo(decodeAnchorX(1.0455728769302368f, -0.0625f), decodeAnchorY(1.8723957538604736f, -1.625f), decodeAnchorX(1.0755208730697632f, 0.0f), decodeAnchorY(1.7903645038604736f, 0.0f), decodeX(1.0755209f), decodeY(1.7903645f));
386         path.lineTo(decodeX(1.4414062f), decodeY(1.1028646f));
387         path.curveTo(decodeAnchorX(1.44140625f, 0.0f), decodeAnchorY(1.1028646230697632f, 0.0f), decodeAnchorX(1.4986978769302368f, -1.75f), decodeAnchorY(1.04296875f, 0.0f), decodeX(1.4986979f), decodeY(1.0429688f));
388         path.closePath();
389         return path;
390     }
391
392     private Path2D decodePath9() {
393         path.reset();
394         path.moveTo(decodeX(1.5f), decodeY(1.2291666f));
395         path.curveTo(decodeAnchorX(1.5f, 2.0f), decodeAnchorY(1.2291666269302368f, 0.0f), decodeAnchorX(1.5625f, 0.0f), decodeAnchorY(1.3125f, -2.0f), decodeX(1.5625f), decodeY(1.3125f));
396         path.curveTo(decodeAnchorX(1.5625f, 0.0f), decodeAnchorY(1.3125f, 2.0f), decodeAnchorX(1.5f, 1.3125f), decodeAnchorY(1.6666667461395264f, 0.0f), decodeX(1.5f), decodeY(1.6666667f));
397         path.curveTo(decodeAnchorX(1.5f, -1.3125f), decodeAnchorY(1.6666667461395264f, 0.0f), decodeAnchorX(1.4375f, 0.0f), decodeAnchorY(1.3125f, 2.0f), decodeX(1.4375f), decodeY(1.3125f));
398         path.curveTo(decodeAnchorX(1.4375f, 0.0f), decodeAnchorY(1.3125f, -2.0f), decodeAnchorX(1.5f, -2.0f), decodeAnchorY(1.2291666269302368f, 0.0f), decodeX(1.5f), decodeY(1.2291666f));
399         path.closePath();
400         return path;
401     }
402
403     private Ellipse2D decodeEllipse7() {
404         ellipse.setFrame(decodeX(1.4375f), //x
405
decodeY(1.7291667f), //y
406
decodeX(1.5625f) - decodeX(1.4375f), //width
407
decodeY(1.8541667f) - decodeY(1.7291667f)); //height
408
return ellipse;
409     }
410
411
412
413     private Paint decodeGradient1(Shape s) {
414         Rectangle2D bounds = s.getBounds2D();
415         float x = (float)bounds.getX();
416         float y = (float)bounds.getY();
417         float w = (float)bounds.getWidth();
418         float h = (float)bounds.getHeight();
419         return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
420                 new float[] { 0.0f,0.17258064f,0.3451613f,0.5145161f,0.683871f,0.9f,1.0f },
421                 new Color[] { color2,
422                             decodeColor(color2,color3,0.5f),
423                             color3,
424                             decodeColor(color3,color4,0.5f),
425                             color4,
426                             decodeColor(color4,color5,0.5f),
427                             color5});
428     }
429
430     private Paint decodeGradient2(Shape s) {
431         Rectangle2D bounds = s.getBounds2D();
432         float x = (float)bounds.getX();
433         float y = (float)bounds.getY();
434         float w = (float)bounds.getWidth();
435         float h = (float)bounds.getHeight();
436         return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
437                 new float[] { 0.0f,0.5f,1.0f },
438                 new Color[] { color9,
439                             decodeColor(color9,color10,0.5f),
440                             color10});
441     }
442
443     private Paint decodeGradient3(Shape s) {
444         Rectangle2D bounds = s.getBounds2D();
445         float x = (float)bounds.getX();
446         float y = (float)bounds.getY();
447         float w = (float)bounds.getWidth();
448         float h = (float)bounds.getHeight();
449         return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
450                 new float[] { 0.0f,0.24143836f,0.48287672f,0.7414384f,1.0f },
451                 new Color[] { color11,
452                             decodeColor(color11,color12,0.5f),
453                             color12,
454                             decodeColor(color12,color13,0.5f),
455                             color13});
456     }
457
458     private Paint decodeGradient4(Shape s) {
459         Rectangle2D bounds = s.getBounds2D();
460         float x = (float)bounds.getX();
461         float y = (float)bounds.getY();
462         float w = (float)bounds.getWidth();
463         float h = (float)bounds.getHeight();
464         return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
465                 new float[] { 0.0f,0.14212328f,0.28424656f,0.39212328f,0.5f,0.60958904f,0.7191781f,0.85958904f,1.0f },
466                 new Color[] { color14,
467                             decodeColor(color14,color15,0.5f),
468                             color15,
469                             decodeColor(color15,color16,0.5f),
470                             color16,
471                             decodeColor(color16,color17,0.5f),
472                             color17,
473                             decodeColor(color17,color18,0.5f),
474                             color18});
475     }
476
477     private Paint decodeGradient5(Shape s) {
478         Rectangle2D bounds = s.getBounds2D();
479         float x = (float)bounds.getX();
480         float y = (float)bounds.getY();
481         float w = (float)bounds.getWidth();
482         float h = (float)bounds.getHeight();
483         return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
484                 new float[] { 0.0f,0.5f,1.0f },
485                 new Color[] { color19,
486                             decodeColor(color19,color20,0.5f),
487                             color20});
488     }
489
490     private Paint decodeGradient6(Shape s) {
491         Rectangle2D bounds = s.getBounds2D();
492         float x = (float)bounds.getX();
493         float y = (float)bounds.getY();
494         float w = (float)bounds.getWidth();
495         float h = (float)bounds.getHeight();
496         return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
497                 new float[] { 0.0f,0.5f,1.0f },
498                 new Color[] { color21,
499                             decodeColor(color21,color22,0.5f),
500                             color22});
501     }
502
503     private Paint decodeGradient7(Shape s) {
504         Rectangle2D bounds = s.getBounds2D();
505         float x = (float)bounds.getX();
506         float y = (float)bounds.getY();
507         float w = (float)bounds.getWidth();
508         float h = (float)bounds.getHeight();
509         return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
510                 new float[] { 0.0f,0.15239726f,0.30479452f,0.47945207f,0.6541096f,0.8270548f,1.0f },
511                 new Color[] { color23,
512                             decodeColor(color23,color24,0.5f),
513                             color24,
514                             decodeColor(color24,color25,0.5f),
515                             color25,
516                             decodeColor(color25,color26,0.5f),
517                             color26});
518     }
519
520     private Paint decodeGradient8(Shape s) {
521         Rectangle2D bounds = s.getBounds2D();
522         float x = (float)bounds.getX();
523         float y = (float)bounds.getY();
524         float w = (float)bounds.getWidth();
525         float h = (float)bounds.getHeight();
526         return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
527                 new float[] { 0.0f,0.5f,1.0f },
528                 new Color[] { color28,
529                             decodeColor(color28,color29,0.5f),
530                             color29});
531     }
532
533     private Paint decodeGradient9(Shape s) {
534         Rectangle2D bounds = s.getBounds2D();
535         float x = (float)bounds.getX();
536         float y = (float)bounds.getY();
537         float w = (float)bounds.getWidth();
538         float h = (float)bounds.getHeight();
539         return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
540                 new float[] { 0.0f,0.1729452f,0.3458904f,0.49315068f,0.64041096f,0.7328767f,0.8253425f,0.9126712f,1.0f },
541                 new Color[] { color30,
542                             decodeColor(color30,color31,0.5f),
543                             color31,
544                             decodeColor(color31,color32,0.5f),
545                             color32,
546                             decodeColor(color32,color33,0.5f),
547                             color33,
548                             decodeColor(color33,color34,0.5f),
549                             color34});
550     }
551
552     private Paint decodeGradient10(Shape s) {
553         Rectangle2D bounds = s.getBounds2D();
554         float x = (float)bounds.getX();
555         float y = (float)bounds.getY();
556         float w = (float)bounds.getWidth();
557         float h = (float)bounds.getHeight();
558         return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
559                 new float[] { 0.0f,0.5f,1.0f },
560                 new Color[] { color35,
561                             decodeColor(color35,color36,0.5f),
562                             color36});
563     }
564
565
566 }
567
Popular Tags