1 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 17 public final class TreePainter extends AbstractRegionPainter { 18 static final int BACKGROUND_DISABLED = 1; 23 static final int BACKGROUND_ENABLED = 2; 24 static final int BACKGROUND_ENABLED_SELECTED = 3; 25 static final int LEAFICON_ENABLED = 4; 26 static final int CLOSEDICON_ENABLED = 5; 27 static final int OPENICON_ENABLED = 6; 28 static final int COLLAPSEDICON_ENABLED = 7; 29 static final int COLLAPSEDICON_ENABLED_SELECTED = 8; 30 static final int EXPANDEDICON_ENABLED = 9; 31 static final int EXPANDEDICON_ENABLED_SELECTED = 10; 32 33 34 private int state; private PaintContext ctx; 36 37 private Path2D path = new Path2D.Float(); 39 private Rectangle2D rect = new Rectangle2D.Float(0, 0, 0, 0); 40 private RoundRectangle2D roundRect = new RoundRectangle2D.Float(0, 0, 0, 0, 0, 0); 41 private Ellipse2D ellipse = new Ellipse2D.Float(0, 0, 0, 0); 42 43 private Color color1 = decodeColor("nimbusBlueGrey", 0.007936537f, -0.065654516f, -0.13333333f, 0); 47 private Color color2 = new Color(97, 98, 102, 255); 48 private Color color3 = decodeColor("nimbusBlueGrey", -0.032679737f, -0.043332636f, 0.24705881f, 0); 49 private Color color4 = decodeColor("nimbusBlueGrey", 0.0f, -0.110526316f, 0.25490195f, 0); 50 private Color color5 = decodeColor("nimbusBase", 0.0077680945f, -0.51781034f, 0.3490196f, 0); 51 private Color color6 = decodeColor("nimbusBase", 0.013940871f, -0.599277f, 0.41960782f, 0); 52 private Color color7 = decodeColor("nimbusBase", 0.004681647f, -0.4198052f, 0.14117646f, 0); 53 private Color color8 = decodeColor("nimbusBase", 0.0f, -0.6357143f, 0.45098037f, -127); 54 private Color color9 = decodeColor("nimbusBlueGrey", 0.0f, 0.0f, -0.21f, -99); 55 private Color color10 = decodeColor("nimbusBase", 2.9569864E-4f, -0.45978838f, 0.2980392f, 0); 56 private Color color11 = decodeColor("nimbusBase", 0.0015952587f, -0.34848025f, 0.18823528f, 0); 57 private Color color12 = decodeColor("nimbusBase", 0.0015952587f, -0.30844158f, 0.09803921f, 0); 58 private Color color13 = decodeColor("nimbusBase", 0.0015952587f, -0.27329817f, 0.035294116f, 0); 59 private Color color14 = decodeColor("nimbusBase", 0.004681647f, -0.6198413f, 0.43921566f, 0); 60 private Color color15 = decodeColor("nimbusBase", 0.0f, -0.6357143f, 0.45098037f, -125); 61 private Color color16 = decodeColor("nimbusBase", 0.0f, -0.6357143f, 0.45098037f, -50); 62 private Color color17 = decodeColor("nimbusBase", 0.0f, -0.6357143f, 0.45098037f, -100); 63 private Color color18 = decodeColor("nimbusBase", 0.0012094378f, -0.23571429f, -0.0784314f, 0); 64 private Color color19 = decodeColor("nimbusBase", 2.9569864E-4f, -0.115166366f, -0.2627451f, 0); 65 private Color color20 = decodeColor("nimbusBase", 0.0027436614f, -0.335015f, 0.011764705f, 0); 66 private Color color21 = decodeColor("nimbusBase", 0.0024294257f, -0.3857143f, 0.031372547f, 0); 67 private Color color22 = decodeColor("nimbusBase", 0.0018081069f, -0.3595238f, -0.13725492f, 0); 68 private Color color23 = new Color(255, 200, 0, 255); 69 private Color color24 = decodeColor("nimbusBase", 0.004681647f, -0.33496243f, -0.027450979f, 0); 70 private Color color25 = decodeColor("nimbusBase", 0.0019934773f, -0.361378f, -0.10588238f, 0); 71 private Color color26 = decodeColor("nimbusBlueGrey", -0.6111111f, -0.110526316f, -0.34509805f, 0); 72 73 74 private Object [] componentColors; 76 77 public TreePainter(PaintContext ctx, int state) { 78 super(); 79 this.state = state; 80 this.ctx = ctx; 81 } 82 83 @Override 84 protected void doPaint(Graphics2D g, JComponent c, int width, int height, Object [] extendedCacheKeys) { 85 componentColors = extendedCacheKeys; 87 switch(state) { 90 case LEAFICON_ENABLED: paintleafIconEnabled(g); break; 91 case CLOSEDICON_ENABLED: paintclosedIconEnabled(g); break; 92 case OPENICON_ENABLED: paintopenIconEnabled(g); break; 93 case COLLAPSEDICON_ENABLED: paintcollapsedIconEnabled(g); break; 94 case COLLAPSEDICON_ENABLED_SELECTED: paintcollapsedIconEnabledAndSelected(g); break; 95 case EXPANDEDICON_ENABLED: paintexpandedIconEnabled(g); break; 96 case EXPANDEDICON_ENABLED_SELECTED: paintexpandedIconEnabledAndSelected(g); break; 97 98 } 99 } 100 101 102 103 @Override 104 protected final PaintContext getPaintContext() { 105 return ctx; 106 } 107 108 private void paintleafIconEnabled(Graphics2D g) { 109 path = decodePath1(); 110 g.setPaint(color1); 111 g.fill(path); 112 rect = decodeRect1(); 113 g.setPaint(color2); 114 g.fill(rect); 115 path = decodePath2(); 116 g.setPaint(decodeGradient1(path)); 117 g.fill(path); 118 path = decodePath3(); 119 g.setPaint(decodeGradient2(path)); 120 g.fill(path); 121 path = decodePath4(); 122 g.setPaint(color7); 123 g.fill(path); 124 path = decodePath5(); 125 g.setPaint(color8); 126 g.fill(path); 127 128 } 129 130 private void paintclosedIconEnabled(Graphics2D g) { 131 path = decodePath6(); 132 g.setPaint(color9); 133 g.fill(path); 134 path = decodePath7(); 135 g.setPaint(decodeGradient3(path)); 136 g.fill(path); 137 path = decodePath8(); 138 g.setPaint(decodeGradient4(path)); 139 g.fill(path); 140 rect = decodeRect2(); 141 g.setPaint(color15); 142 g.fill(rect); 143 rect = decodeRect3(); 144 g.setPaint(color16); 145 g.fill(rect); 146 rect = decodeRect4(); 147 g.setPaint(color17); 148 g.fill(rect); 149 path = decodePath9(); 150 g.setPaint(decodeGradient5(path)); 151 g.fill(path); 152 path = decodePath10(); 153 g.setPaint(decodeGradient6(path)); 154 g.fill(path); 155 path = decodePath11(); 156 g.setPaint(color23); 157 g.fill(path); 158 159 } 160 161 private void paintopenIconEnabled(Graphics2D g) { 162 path = decodePath6(); 163 g.setPaint(color9); 164 g.fill(path); 165 path = decodePath12(); 166 g.setPaint(decodeGradient3(path)); 167 g.fill(path); 168 path = decodePath13(); 169 g.setPaint(decodeGradient4(path)); 170 g.fill(path); 171 rect = decodeRect2(); 172 g.setPaint(color15); 173 g.fill(rect); 174 rect = decodeRect3(); 175 g.setPaint(color16); 176 g.fill(rect); 177 rect = decodeRect4(); 178 g.setPaint(color17); 179 g.fill(rect); 180 path = decodePath14(); 181 g.setPaint(decodeGradient5(path)); 182 g.fill(path); 183 path = decodePath15(); 184 g.setPaint(decodeGradient7(path)); 185 g.fill(path); 186 path = decodePath11(); 187 g.setPaint(color23); 188 g.fill(path); 189 190 } 191 192 private void paintcollapsedIconEnabled(Graphics2D g) { 193 path = decodePath16(); 194 g.setPaint(color26); 195 g.fill(path); 196 197 } 198 199 private void paintcollapsedIconEnabledAndSelected(Graphics2D g) { 200 path = decodePath16(); 201 g.setPaint(color4); 202 g.fill(path); 203 204 } 205 206 private void paintexpandedIconEnabled(Graphics2D g) { 207 path = decodePath17(); 208 g.setPaint(color26); 209 g.fill(path); 210 211 } 212 213 private void paintexpandedIconEnabledAndSelected(Graphics2D g) { 214 path = decodePath17(); 215 g.setPaint(color4); 216 g.fill(path); 217 218 } 219 220 221 222 private Path2D decodePath1() { 223 path.reset(); 224 path.moveTo(decodeX(0.2f), decodeY(0.0f)); 225 path.lineTo(decodeX(0.2f), decodeY(3.0f)); 226 path.lineTo(decodeX(0.4f), decodeY(3.0f)); 227 path.lineTo(decodeX(0.4f), decodeY(0.2f)); 228 path.lineTo(decodeX(1.9197531f), decodeY(0.2f)); 229 path.lineTo(decodeX(2.6f), decodeY(0.9f)); 230 path.lineTo(decodeX(2.6f), decodeY(3.0f)); 231 path.lineTo(decodeX(2.8f), decodeY(3.0f)); 232 path.lineTo(decodeX(2.8f), decodeY(0.88888896f)); 233 path.lineTo(decodeX(1.9537036f), decodeY(0.0f)); 234 path.lineTo(decodeX(0.2f), decodeY(0.0f)); 235 path.closePath(); 236 return path; 237 } 238 239 private Rectangle2D decodeRect1() { 240 rect.setRect(decodeX(0.4f), decodeY(2.8f), decodeX(2.6f) - decodeX(0.4f), decodeY(3.0f) - decodeY(2.8f)); return rect; 245 } 246 247 private Path2D decodePath2() { 248 path.reset(); 249 path.moveTo(decodeX(1.8333333f), decodeY(0.2f)); 250 path.lineTo(decodeX(1.8333333f), decodeY(1.0f)); 251 path.lineTo(decodeX(2.6f), decodeY(1.0f)); 252 path.lineTo(decodeX(1.8333333f), decodeY(0.2f)); 253 path.closePath(); 254 return path; 255 } 256 257 private Path2D decodePath3() { 258 path.reset(); 259 path.moveTo(decodeX(1.8333333f), decodeY(0.2f)); 260 path.lineTo(decodeX(0.4f), decodeY(0.2f)); 261 path.lineTo(decodeX(0.4f), decodeY(2.8f)); 262 path.lineTo(decodeX(2.6f), decodeY(2.8f)); 263 path.lineTo(decodeX(2.6f), decodeY(1.0f)); 264 path.lineTo(decodeX(1.8333333f), decodeY(1.0f)); 265 path.lineTo(decodeX(1.8333333f), decodeY(0.2f)); 266 path.closePath(); 267 return path; 268 } 269 270 private Path2D decodePath4() { 271 path.reset(); 272 path.moveTo(decodeX(1.8333333f), decodeY(0.2f)); 273 path.lineTo(decodeX(1.6234567f), decodeY(0.2f)); 274 path.lineTo(decodeX(1.6296296f), decodeY(1.2037038f)); 275 path.lineTo(decodeX(2.6f), decodeY(1.2006173f)); 276 path.lineTo(decodeX(2.6f), decodeY(1.0f)); 277 path.lineTo(decodeX(1.8333333f), decodeY(1.0f)); 278 path.lineTo(decodeX(1.8333333f), decodeY(0.2f)); 279 path.closePath(); 280 return path; 281 } 282 283 private Path2D decodePath5() { 284 path.reset(); 285 path.moveTo(decodeX(1.8333333f), decodeY(0.4f)); 286 path.lineTo(decodeX(1.8333333f), decodeY(0.2f)); 287 path.lineTo(decodeX(0.4f), decodeY(0.2f)); 288 path.lineTo(decodeX(0.4f), decodeY(2.8f)); 289 path.lineTo(decodeX(2.6f), decodeY(2.8f)); 290 path.lineTo(decodeX(2.6f), decodeY(1.0f)); 291 path.lineTo(decodeX(2.4f), decodeY(1.0f)); 292 path.lineTo(decodeX(2.4f), decodeY(2.6f)); 293 path.lineTo(decodeX(0.6f), decodeY(2.6f)); 294 path.lineTo(decodeX(0.6f), decodeY(0.4f)); 295 path.lineTo(decodeX(1.8333333f), decodeY(0.4f)); 296 path.closePath(); 297 return path; 298 } 299 300 private Path2D decodePath6() { 301 path.reset(); 302 path.moveTo(decodeX(0.0f), decodeY(2.4f)); 303 path.lineTo(decodeX(0.0f), decodeY(2.6f)); 304 path.lineTo(decodeX(0.2f), decodeY(3.0f)); 305 path.lineTo(decodeX(2.6f), decodeY(3.0f)); 306 path.lineTo(decodeX(2.8f), decodeY(2.6f)); 307 path.lineTo(decodeX(2.8f), decodeY(2.4f)); 308 path.lineTo(decodeX(0.0f), decodeY(2.4f)); 309 path.closePath(); 310 return path; 311 } 312 313 private Path2D decodePath7() { 314 path.reset(); 315 path.moveTo(decodeX(0.6f), decodeY(2.6f)); 316 path.lineTo(decodeX(0.6037037f), decodeY(1.8425925f)); 317 path.lineTo(decodeX(0.8f), decodeY(1.0f)); 318 path.lineTo(decodeX(2.8f), decodeY(1.0f)); 319 path.lineTo(decodeX(2.8f), decodeY(1.3333334f)); 320 path.lineTo(decodeX(2.6f), decodeY(2.6f)); 321 path.lineTo(decodeX(0.6f), decodeY(2.6f)); 322 path.closePath(); 323 return path; 324 } 325 326 private Path2D decodePath8() { 327 path.reset(); 328 path.moveTo(decodeX(0.2f), decodeY(2.6f)); 329 path.lineTo(decodeX(0.4f), decodeY(2.6f)); 330 path.lineTo(decodeX(0.40833336f), decodeY(1.8645833f)); 331 path.lineTo(decodeX(0.79583335f), decodeY(0.8f)); 332 path.lineTo(decodeX(2.4f), decodeY(0.8f)); 333 path.lineTo(decodeX(2.4f), decodeY(0.6f)); 334 path.lineTo(decodeX(1.5f), decodeY(0.6f)); 335 path.lineTo(decodeX(1.3333334f), decodeY(0.4f)); 336 path.lineTo(decodeX(1.3333334f), decodeY(0.2f)); 337 path.lineTo(decodeX(0.6f), decodeY(0.2f)); 338 path.lineTo(decodeX(0.6f), decodeY(0.4f)); 339 path.lineTo(decodeX(0.4f), decodeY(0.6f)); 340 path.lineTo(decodeX(0.2f), decodeY(0.6f)); 341 path.lineTo(decodeX(0.2f), decodeY(2.6f)); 342 path.closePath(); 343 return path; 344 } 345 346 private Rectangle2D decodeRect2() { 347 rect.setRect(decodeX(0.2f), decodeY(0.6f), decodeX(0.4f) - decodeX(0.2f), decodeY(0.8f) - decodeY(0.6f)); return rect; 352 } 353 354 private Rectangle2D decodeRect3() { 355 rect.setRect(decodeX(0.6f), decodeY(0.2f), decodeX(1.3333334f) - decodeX(0.6f), decodeY(0.4f) - decodeY(0.2f)); return rect; 360 } 361 362 private Rectangle2D decodeRect4() { 363 rect.setRect(decodeX(1.5f), decodeY(0.6f), decodeX(2.4f) - decodeX(1.5f), decodeY(0.8f) - decodeY(0.6f)); return rect; 368 } 369 370 private Path2D decodePath9() { 371 path.reset(); 372 path.moveTo(decodeX(3.0f), decodeY(0.8f)); 373 path.lineTo(decodeX(3.0f), decodeY(1.0f)); 374 path.lineTo(decodeX(2.4f), decodeY(1.0f)); 375 path.lineTo(decodeX(2.4f), decodeY(0.6f)); 376 path.lineTo(decodeX(1.5f), decodeY(0.6f)); 377 path.lineTo(decodeX(1.3333334f), decodeY(0.4f)); 378 path.lineTo(decodeX(1.3333334f), decodeY(0.2f)); 379 path.lineTo(decodeX(0.5888889f), decodeY(0.20370372f)); 380 path.lineTo(decodeX(0.5962963f), decodeY(0.34814817f)); 381 path.lineTo(decodeX(0.34814817f), decodeY(0.6f)); 382 path.lineTo(decodeX(0.2f), decodeY(0.6f)); 383 path.lineTo(decodeX(0.2f), decodeY(2.6f)); 384 path.lineTo(decodeX(2.6f), decodeY(2.6f)); 385 path.lineTo(decodeX(2.6f), decodeY(1.3333334f)); 386 path.lineTo(decodeX(2.774074f), decodeY(1.1604939f)); 387 path.lineTo(decodeX(2.8f), decodeY(1.0f)); 388 path.lineTo(decodeX(3.0f), decodeY(1.0f)); 389 path.lineTo(decodeX(2.8925927f), decodeY(1.1882716f)); 390 path.lineTo(decodeX(2.8f), decodeY(1.3333334f)); 391 path.lineTo(decodeX(2.8f), decodeY(2.6f)); 392 path.lineTo(decodeX(2.6f), decodeY(2.8f)); 393 path.lineTo(decodeX(0.2f), decodeY(2.8f)); 394 path.lineTo(decodeX(0.0f), decodeY(2.6f)); 395 path.lineTo(decodeX(0.0f), decodeY(0.65185183f)); 396 path.lineTo(decodeX(0.63703704f), decodeY(0.0f)); 397 path.lineTo(decodeX(1.3333334f), decodeY(0.0f)); 398 path.lineTo(decodeX(1.5925925f), decodeY(0.4f)); 399 path.lineTo(decodeX(2.4f), decodeY(0.4f)); 400 path.lineTo(decodeX(2.6f), decodeY(0.6f)); 401 path.lineTo(decodeX(2.6f), decodeY(0.8f)); 402 path.lineTo(decodeX(3.0f), decodeY(0.8f)); 403 path.closePath(); 404 return path; 405 } 406 407 private Path2D decodePath10() { 408 path.reset(); 409 path.moveTo(decodeX(2.4f), decodeY(1.0f)); 410 path.lineTo(decodeX(2.4f), decodeY(0.8f)); 411 path.lineTo(decodeX(0.74814814f), decodeY(0.8f)); 412 path.lineTo(decodeX(0.4037037f), decodeY(1.8425925f)); 413 path.lineTo(decodeX(0.4f), decodeY(2.6f)); 414 path.lineTo(decodeX(0.6f), decodeY(2.6f)); 415 path.lineTo(decodeX(0.5925926f), decodeY(2.225926f)); 416 path.lineTo(decodeX(0.916f), decodeY(0.996f)); 417 path.lineTo(decodeX(2.4f), decodeY(1.0f)); 418 path.closePath(); 419 return path; 420 } 421 422 private Path2D decodePath11() { 423 path.reset(); 424 path.moveTo(decodeX(2.2f), decodeY(2.2f)); 425 path.lineTo(decodeX(2.2f), decodeY(2.2f)); 426 path.closePath(); 427 return path; 428 } 429 430 private Path2D decodePath12() { 431 path.reset(); 432 path.moveTo(decodeX(0.6f), decodeY(2.6f)); 433 path.lineTo(decodeX(0.6f), decodeY(2.2f)); 434 path.lineTo(decodeX(0.8f), decodeY(1.3333334f)); 435 path.lineTo(decodeX(2.8f), decodeY(1.3333334f)); 436 path.lineTo(decodeX(2.8f), decodeY(1.6666667f)); 437 path.lineTo(decodeX(2.6f), decodeY(2.6f)); 438 path.lineTo(decodeX(0.6f), decodeY(2.6f)); 439 path.closePath(); 440 return path; 441 } 442 443 private Path2D decodePath13() { 444 path.reset(); 445 path.moveTo(decodeX(0.2f), decodeY(2.6f)); 446 path.lineTo(decodeX(0.4f), decodeY(2.6f)); 447 path.lineTo(decodeX(0.4f), decodeY(2.0f)); 448 path.lineTo(decodeX(0.8f), decodeY(1.1666666f)); 449 path.lineTo(decodeX(2.4f), decodeY(1.1666666f)); 450 path.lineTo(decodeX(2.4f), decodeY(0.6f)); 451 path.lineTo(decodeX(1.5f), decodeY(0.6f)); 452 path.lineTo(decodeX(1.3333334f), decodeY(0.4f)); 453 path.lineTo(decodeX(1.3333334f), decodeY(0.2f)); 454 path.lineTo(decodeX(0.6f), decodeY(0.2f)); 455 path.lineTo(decodeX(0.6f), decodeY(0.4f)); 456 path.lineTo(decodeX(0.4f), decodeY(0.6f)); 457 path.lineTo(decodeX(0.2f), decodeY(0.6f)); 458 path.lineTo(decodeX(0.2f), decodeY(2.6f)); 459 path.closePath(); 460 return path; 461 } 462 463 private Path2D decodePath14() { 464 path.reset(); 465 path.moveTo(decodeX(3.0f), decodeY(1.1666666f)); 466 path.lineTo(decodeX(3.0f), decodeY(1.3333334f)); 467 path.lineTo(decodeX(2.4f), decodeY(1.3333334f)); 468 path.lineTo(decodeX(2.4f), decodeY(0.6f)); 469 path.lineTo(decodeX(1.5f), decodeY(0.6f)); 470 path.lineTo(decodeX(1.3333334f), decodeY(0.4f)); 471 path.lineTo(decodeX(1.3333334f), decodeY(0.2f)); 472 path.lineTo(decodeX(0.5888889f), decodeY(0.20370372f)); 473 path.lineTo(decodeX(0.5962963f), decodeY(0.34814817f)); 474 path.lineTo(decodeX(0.34814817f), decodeY(0.6f)); 475 path.lineTo(decodeX(0.2f), decodeY(0.6f)); 476 path.lineTo(decodeX(0.2f), decodeY(2.6f)); 477 path.lineTo(decodeX(2.6f), decodeY(2.6f)); 478 path.lineTo(decodeX(2.6f), decodeY(2.0f)); 479 path.lineTo(decodeX(2.6f), decodeY(1.8333333f)); 480 path.lineTo(decodeX(2.916f), decodeY(1.3533334f)); 481 path.lineTo(decodeX(2.98f), decodeY(1.3766667f)); 482 path.lineTo(decodeX(2.8f), decodeY(1.8333333f)); 483 path.lineTo(decodeX(2.8f), decodeY(2.0f)); 484 path.lineTo(decodeX(2.8f), decodeY(2.6f)); 485 path.lineTo(decodeX(2.6f), decodeY(2.8f)); 486 path.lineTo(decodeX(0.2f), decodeY(2.8f)); 487 path.lineTo(decodeX(0.0f), decodeY(2.6f)); 488 path.lineTo(decodeX(0.0f), decodeY(0.65185183f)); 489 path.lineTo(decodeX(0.63703704f), decodeY(0.0f)); 490 path.lineTo(decodeX(1.3333334f), decodeY(0.0f)); 491 path.lineTo(decodeX(1.5925925f), decodeY(0.4f)); 492 path.lineTo(decodeX(2.4f), decodeY(0.4f)); 493 path.lineTo(decodeX(2.6f), decodeY(0.6f)); 494 path.lineTo(decodeX(2.6f), decodeY(1.1666666f)); 495 path.lineTo(decodeX(3.0f), decodeY(1.1666666f)); 496 path.closePath(); 497 return path; 498 } 499 500 private Path2D decodePath15() { 501 path.reset(); 502 path.moveTo(decodeX(2.4f), decodeY(1.3333334f)); 503 path.lineTo(decodeX(2.4f), decodeY(1.1666666f)); 504 path.lineTo(decodeX(0.74f), decodeY(1.1666666f)); 505 path.lineTo(decodeX(0.4f), decodeY(2.0f)); 506 path.lineTo(decodeX(0.4f), decodeY(2.6f)); 507 path.lineTo(decodeX(0.6f), decodeY(2.6f)); 508 path.lineTo(decodeX(0.5925926f), decodeY(2.225926f)); 509 path.lineTo(decodeX(0.8f), decodeY(1.3333334f)); 510 path.lineTo(decodeX(2.4f), decodeY(1.3333334f)); 511 path.closePath(); 512 return path; 513 } 514 515 private Path2D decodePath16() { 516 path.reset(); 517 path.moveTo(decodeX(0.0f), decodeY(0.0f)); 518 path.lineTo(decodeX(1.2397541f), decodeY(0.70163935f)); 519 path.lineTo(decodeX(0.0f), decodeY(3.0f)); 520 path.lineTo(decodeX(0.0f), decodeY(0.0f)); 521 path.closePath(); 522 return path; 523 } 524 525 private Path2D decodePath17() { 526 path.reset(); 527 path.moveTo(decodeX(0.0f), decodeY(0.0f)); 528 path.lineTo(decodeX(1.25f), decodeY(0.0f)); 529 path.lineTo(decodeX(0.70819676f), decodeY(2.9901638f)); 530 path.lineTo(decodeX(0.0f), decodeY(0.0f)); 531 path.closePath(); 532 return path; 533 } 534 535 536 537 private Paint decodeGradient1(Shape s) { 538 Rectangle2D bounds = s.getBounds2D(); 539 float x = (float)bounds.getX(); 540 float y = (float)bounds.getY(); 541 float w = (float)bounds.getWidth(); 542 float h = (float)bounds.getHeight(); 543 return decodeGradient((0.046296295f * w) + x, (0.9675926f * h) + y, (0.4861111f * w) + x, (0.5324074f * h) + y, 544 new float[] { 0.0f,0.5f,1.0f }, 545 new Color[] { color3, 546 decodeColor(color3,color4,0.5f), 547 color4}); 548 } 549 550 private Paint decodeGradient2(Shape s) { 551 Rectangle2D bounds = s.getBounds2D(); 552 float x = (float)bounds.getX(); 553 float y = (float)bounds.getY(); 554 float w = (float)bounds.getWidth(); 555 float h = (float)bounds.getHeight(); 556 return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, 557 new float[] { 0.0f,0.5f,1.0f }, 558 new Color[] { color5, 559 decodeColor(color5,color6,0.5f), 560 color6}); 561 } 562 563 private Paint decodeGradient3(Shape s) { 564 Rectangle2D bounds = s.getBounds2D(); 565 float x = (float)bounds.getX(); 566 float y = (float)bounds.getY(); 567 float w = (float)bounds.getWidth(); 568 float h = (float)bounds.getHeight(); 569 return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, 570 new float[] { 0.04191617f,0.10329342f,0.16467066f,0.24550897f,0.3263473f,0.6631737f,1.0f }, 571 new Color[] { color10, 572 decodeColor(color10,color11,0.5f), 573 color11, 574 decodeColor(color11,color12,0.5f), 575 color12, 576 decodeColor(color12,color13,0.5f), 577 color13}); 578 } 579 580 private Paint decodeGradient4(Shape s) { 581 Rectangle2D bounds = s.getBounds2D(); 582 float x = (float)bounds.getX(); 583 float y = (float)bounds.getY(); 584 float w = (float)bounds.getWidth(); 585 float h = (float)bounds.getHeight(); 586 return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, 587 new float[] { 0.0f,0.5f,1.0f }, 588 new Color[] { color5, 589 decodeColor(color5,color14,0.5f), 590 color14}); 591 } 592 593 private Paint decodeGradient5(Shape s) { 594 Rectangle2D bounds = s.getBounds2D(); 595 float x = (float)bounds.getX(); 596 float y = (float)bounds.getY(); 597 float w = (float)bounds.getWidth(); 598 float h = (float)bounds.getHeight(); 599 return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, 600 new float[] { 0.0f,0.5f,1.0f }, 601 new Color[] { color18, 602 decodeColor(color18,color19,0.5f), 603 color19}); 604 } 605 606 private Paint decodeGradient6(Shape s) { 607 Rectangle2D bounds = s.getBounds2D(); 608 float x = (float)bounds.getX(); 609 float y = (float)bounds.getY(); 610 float w = (float)bounds.getWidth(); 611 float h = (float)bounds.getHeight(); 612 return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, 613 new float[] { 0.0f,0.12724552f,0.25449103f,0.62724555f,1.0f }, 614 new Color[] { color20, 615 decodeColor(color20,color21,0.5f), 616 color21, 617 decodeColor(color21,color22,0.5f), 618 color22}); 619 } 620 621 private Paint decodeGradient7(Shape s) { 622 Rectangle2D bounds = s.getBounds2D(); 623 float x = (float)bounds.getX(); 624 float y = (float)bounds.getY(); 625 float w = (float)bounds.getWidth(); 626 float h = (float)bounds.getHeight(); 627 return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, 628 new float[] { 0.0f,0.5f,1.0f }, 629 new Color[] { color24, 630 decodeColor(color24,color25,0.5f), 631 color25}); 632 } 633 634 635 } 636 | Popular Tags |