functional/SceneGraphTests/src/test/scenegraph/lcd/transparency/Factories.java

Print this page




   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  */
  24 package test.scenegraph.lcd.transparency;
  25 
  26 
  27 import javafx.scene.Node;
  28 import javafx.scene.layout.StackPane;
  29 import javafx.scene.layout.StackPaneBuilder;
  30 import javafx.scene.paint.Color;
  31 import javafx.scene.shape.RectangleBuilder;
  32 import javafx.scene.text.FontSmoothingType;
  33 import javafx.scene.text.TextBuilder;
  34 
  35 /**
  36  *
  37  * @author Alexander Petrov
  38  */
  39 public enum Factories implements Factory{
  40 
  41 
  42     TransparentPixel(new EmptyActionFactory() {
  43 
  44         public Node createNode(boolean lcd) {
  45             StackPane value = new StackPane();
  46 
  47             value.getChildren().addAll(
  48                     TextBuilder.create()
  49                         .text("Test")
  50                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
  51                         .build(),
  52                     RectangleBuilder.create()
  53                         .opacity(0)
  54                         .fill(Color.BLACK)
  55                         .height(1)
  56                         .width(1)
  57                         .build());
  58             return value;
  59         }
  60 
  61         public boolean isLCDWork() {
  62             return true;
  63         }
  64     }),
  65     TransparentBackground(new EmptyActionFactory() {
  66 
  67         public Node createNode(boolean lcd) {
  68             StackPane value = new StackPane();
  69 
  70             value.getChildren().addAll(
  71                     TextBuilder.create()
  72                         .text("Test")
  73                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
  74                         .build(),
  75                     RectangleBuilder.create()
  76                         .opacity(0)
  77                         .fill(Color.BLACK)
  78                         .height(100)
  79                         .width(100)
  80                         .build());
  81             return value;
  82         }
  83 
  84         public boolean isLCDWork() {
  85             return true;
  86         }
  87     }),
  88     TranslucentPixel(new EmptyActionFactory() {
  89 
  90         public Node createNode(boolean lcd) {
  91             StackPane value = new StackPane();
  92 
  93             value.getChildren().addAll(
  94                     TextBuilder.create()
  95                         .text("Test")
  96                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
  97                         .build(),
  98                     RectangleBuilder.create()
  99                         .opacity(0.5)
 100                         .fill(Color.BLACK)
 101                         .height(1)
 102                         .width(1)
 103                         .build());
 104             return value;
 105         }
 106 
 107         public boolean isLCDWork() {
 108             return true;
 109         }
 110     }),
 111     Translucent01Pixel(new EmptyActionFactory() {
 112 
 113         public Node createNode(boolean lcd) {
 114             StackPane value = new StackPane();
 115 
 116             value.getChildren().addAll(
 117                     TextBuilder.create()
 118                         .text("Test")
 119                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 120                         .build(),
 121                     RectangleBuilder.create()
 122                         .opacity(0.000001d)
 123                         .fill(Color.BLACK)
 124                         .height(1)
 125                         .width(1)
 126                         .build());
 127             return value;
 128         }
 129 
 130         public boolean isLCDWork() {
 131             return true;
 132         }
 133     }),
 134     Translucent09Pixel(new EmptyActionFactory() {
 135 
 136         public Node createNode(boolean lcd) {
 137             StackPane value = new StackPane();
 138 
 139             value.getChildren().addAll(
 140                     TextBuilder.create()
 141                         .text("Test")
 142                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 143                         .build(),
 144                     RectangleBuilder.create()
 145                         .opacity(0.9999999d)
 146                         .fill(Color.BLACK)
 147                         .height(1)
 148                         .width(1)
 149                         .build());
 150             return value;
 151         }
 152 
 153         public boolean isLCDWork() {
 154             return true;
 155         }
 156     }),
 157     TransparentRectangle(new EmptyActionFactory() {
 158 
 159         public Node createNode(boolean lcd) {
 160             StackPane value = new StackPane();
 161 
 162             value.getChildren().addAll(
 163                     TextBuilder.create()
 164                         .text("Test")
 165                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 166                         .build(),
 167                     RectangleBuilder.create()
 168                         .opacity(0)
 169                         .fill(Color.BLACK)
 170                         .height(100)
 171                         .width(100)
 172                         .build());
 173             return value;
 174         }
 175 
 176         public boolean isLCDWork() {
 177             return true;
 178         }
 179     }),
 180     TranslucentRectangle(new EmptyActionFactory() {
 181 
 182         public Node createNode(boolean lcd) {
 183             StackPane value = new StackPane();
 184 
 185             value.getChildren().addAll(
 186                     TextBuilder.create()
 187                         .text("Test")
 188                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 189                         .build(),
 190                     RectangleBuilder.create()
 191                         .opacity(0.5)
 192                         .fill(Color.BLACK)
 193                         .height(100)
 194                         .width(100)
 195                         .build());
 196             return value;
 197         }
 198 
 199         public boolean isLCDWork() {
 200             return true;
 201         }
 202     }),
 203     Translucent01Rectangle(new EmptyActionFactory() {
 204 
 205         public Node createNode(boolean lcd) {
 206             StackPane value = new StackPane();
 207 
 208             value.getChildren().addAll(
 209                     TextBuilder.create()
 210                         .text("Test")
 211                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 212                         .build(),
 213                     RectangleBuilder.create()
 214                         .opacity(0.000001d)
 215                         .fill(Color.BLACK)
 216                         .height(100)
 217                         .width(100)
 218                         .build());
 219             return value;
 220         }
 221 
 222         public boolean isLCDWork() {
 223             return true;
 224         }
 225     }),
 226     Translucent09Rectangle(new EmptyActionFactory() {
 227 
 228         public Node createNode(boolean lcd) {
 229             StackPane value = new StackPane();
 230 
 231             value.getChildren().addAll(
 232                     TextBuilder.create()
 233                         .text("Test")
 234                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 235                         .build(),
 236                     RectangleBuilder.create()
 237                         .opacity(0.9999999d)
 238                         .fill(Color.BLACK)
 239                         .height(100)
 240                         .width(100)
 241                         .build());
 242             return value;
 243         }
 244 
 245         public boolean isLCDWork() {
 246             return false;
 247         }
 248     }),
 249     TranslucentPixelBeforeText(new EmptyActionFactory() {
 250 
 251         public Node createNode(boolean lcd) {
 252             StackPane value = new StackPane();
 253 
 254             value.getChildren().addAll(
 255                     RectangleBuilder.create()
 256                         .opacity(0.5)
 257                         .fill(Color.BLACK)
 258                         .height(1)
 259                         .width(1)
 260                         .build(),
 261                     TextBuilder.create()
 262                         .text("Test")
 263                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 264                         .build()
 265                     );
 266             return value;
 267         }
 268 
 269         public boolean isLCDWork() {
 270             return true;
 271         }
 272     }),
 273     Translucent01PixelBeforeText(new EmptyActionFactory() {
 274 
 275         public Node createNode(boolean lcd) {
 276             StackPane value = new StackPane();
 277 
 278             value.getChildren().addAll(
 279                     RectangleBuilder.create()
 280                         .opacity(0.000001d)
 281                         .fill(Color.BLACK)
 282                         .height(1)
 283                         .width(1)
 284                         .build(),
 285                     TextBuilder.create()
 286                         .text("Test")
 287                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 288                         .build());
 289             return value;
 290         }
 291 
 292         public boolean isLCDWork() {
 293             return true;
 294         }
 295     }),
 296     Translucent09PixelBeforeText(new EmptyActionFactory() {
 297 
 298         public Node createNode(boolean lcd) {
 299             StackPane value = new StackPane();
 300 
 301             value.getChildren().addAll(
 302                     RectangleBuilder.create()
 303                         .opacity(0.9999999d)
 304                         .fill(Color.BLACK)
 305                         .height(1)
 306                         .width(1)
 307                         .build(),
 308                     TextBuilder.create()
 309                         .text("Test")
 310                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 311                         .build());
 312             return value;
 313         }
 314 
 315         public boolean isLCDWork() {
 316             return true;
 317         }
 318     }),
 319     TransparentRectangleBeforeText(new EmptyActionFactory() {
 320 
 321         public Node createNode(boolean lcd) {
 322             StackPane value = new StackPane();
 323 
 324             value.getChildren().addAll(
 325                     RectangleBuilder.create()
 326                         .opacity(0)
 327                         .fill(Color.BLACK)
 328                         .height(100)
 329                         .width(100)
 330                         .build(),
 331                     TextBuilder.create()
 332                         .text("Test")
 333                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 334                         .build());
 335             return value;
 336         }
 337 
 338         public boolean isLCDWork() {
 339             return true;
 340         }
 341     }),
 342     TranslucentRectangleBeforeText(new EmptyActionFactory() {
 343 
 344         public Node createNode(boolean lcd) {
 345             StackPane value = new StackPane();
 346 
 347             value.getChildren().addAll(
 348                     RectangleBuilder.create()
 349                         .opacity(0.5)
 350                         .fill(Color.BLACK)
 351                         .height(100)
 352                         .width(100)
 353                         .build(),
 354                     TextBuilder.create()
 355                         .text("Test")
 356                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 357                         .build());
 358             return value;
 359         }
 360 
 361         public boolean isLCDWork() {
 362             return true;
 363         }
 364     }),
 365     Translucent01RectangleBeforeText(new EmptyActionFactory() {
 366 
 367         public Node createNode(boolean lcd) {
 368             StackPane value = new StackPane();
 369 
 370             value.getChildren().addAll(
 371                     RectangleBuilder.create()
 372                         .opacity(0.000001d)
 373                         .fill(Color.BLACK)
 374                         .height(100)
 375                         .width(100)
 376                         .build(),
 377                     TextBuilder.create()
 378                         .text("Test")
 379                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 380                         .build());
 381             return value;
 382         }
 383 
 384         public boolean isLCDWork() {
 385             return true;
 386         }
 387     }),
 388     Translucent09RectangleBeforeText(new EmptyActionFactory() {
 389 
 390         public Node createNode(boolean lcd) {
 391             StackPane value = new StackPane();
 392 
 393             value.getChildren().addAll(
 394                     RectangleBuilder.create()
 395                         .opacity(0.9999999d)
 396                         .fill(Color.BLACK)
 397                         .height(100)
 398                         .width(100)
 399                         .build(),
 400                     TextBuilder.create()
 401                         .text("Test")
 402                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 403                         .build());
 404             return value;
 405         }
 406 
 407         public boolean isLCDWork() {
 408             return false;
 409         }
 410     }),
 411     TranslucentBackground(new EmptyActionFactory() {
 412 
 413         public Node createNode(boolean lcd) {
 414             StackPane value = new StackPane();
 415 
 416             value.getChildren().addAll(
 417                     TextBuilder.create()
 418                         .text("Test")
 419                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 420                         .build(),
 421                     RectangleBuilder.create()
 422                         .opacity(0.5)
 423                         .fill(Color.BLACK)
 424                         .height(100)
 425                         .width(100)
 426                         .build());
 427             return value;
 428         }
 429 
 430         public boolean isLCDWork() {
 431             return true;
 432         }
 433     }),
 434     TranslucentPane(new EmptyActionFactory() {
 435 
 436         public Node createNode(boolean lcd) {
 437             return StackPaneBuilder.create()
 438                     .opacity(0.5)
 439                     .children(TextBuilder.create()
 440                         .text("Test")
 441                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 442                         .build())
 443                     .build();
 444         }
 445 
 446         public boolean isLCDWork() {
 447             return false;
 448         }
 449     }),
 450     AddTranslucentPixel(new Factory() {
 451 
 452         public Node createNode(boolean lcd) {
 453             StackPane value = new StackPane();
 454 
 455             value.getChildren().addAll(
 456                     TextBuilder.create()
 457                         .text("Test")
 458                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 459                         .build());
 460             return value;
 461         }
 462 
 463         public boolean isLCDWork() {
 464             return true;
 465         }
 466 
 467         public void action(Node node) {
 468             StackPane pane = (StackPane) node;
 469             pane.getChildren().add(RectangleBuilder.create()
 470                         .opacity(0.5)
 471                         .fill(Color.BLACK)
 472                         .height(1)
 473                         .width(1)
 474                         .build());
 475 
 476         }
 477     }),
 478     AddTranslucent01Pixel(new Factory() {
 479 
 480         public Node createNode(boolean lcd) {
 481             StackPane value = new StackPane();
 482 
 483             value.getChildren().addAll(
 484                     TextBuilder.create()
 485                         .text("Test")
 486                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 487                         .build());
 488             return value;
 489         }
 490 
 491         public boolean isLCDWork() {
 492             return true;
 493         }
 494 
 495         public void action(Node node) {
 496             StackPane pane = (StackPane) node;
 497             pane.getChildren().add(RectangleBuilder.create()
 498                         .opacity(0.000001d)
 499                         .fill(Color.BLACK)
 500                         .height(1)
 501                         .width(1)
 502                         .build());
 503         }
 504     }),
 505     AddTranslucent09Pixel(new Factory() {
 506 
 507         public Node createNode(boolean lcd) {
 508             StackPane value = new StackPane();
 509 
 510             value.getChildren().addAll(
 511                     TextBuilder.create()
 512                         .text("Test")
 513                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 514                         .build());
 515             return value;
 516         }
 517 
 518         public boolean isLCDWork() {
 519             return true;
 520         }
 521 
 522         public void action(Node node) {
 523             StackPane pane = (StackPane) node;
 524             pane.getChildren().add(RectangleBuilder.create()
 525                         .opacity(0.9999999d)
 526                         .fill(Color.BLACK)
 527                         .height(1)
 528                         .width(1)
 529                         .build());
 530         }
 531     }),
 532     AddTransparentRectangle(new Factory() {
 533 
 534         public Node createNode(boolean lcd) {
 535             StackPane value = new StackPane();
 536 
 537             value.getChildren().addAll(
 538                     TextBuilder.create()
 539                         .text("Test")
 540                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 541                         .build());
 542             return value;
 543         }
 544 
 545         public boolean isLCDWork() {
 546             return true;
 547         }
 548 
 549         public void action(Node node) {
 550             StackPane pane = (StackPane) node;
 551             pane.getChildren().add(RectangleBuilder.create()
 552                         .opacity(0)
 553                         .fill(Color.BLACK)
 554                         .height(100)
 555                         .width(100)
 556                         .build());
 557         }
 558     }),
 559     AddTranslucentRectangle(new Factory() {
 560 
 561         public Node createNode(boolean lcd) {
 562             StackPane value = new StackPane();
 563 
 564             value.getChildren().addAll(
 565                     TextBuilder.create()
 566                         .text("Test")
 567                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 568                         .build());
 569             return value;
 570         }
 571 
 572         public boolean isLCDWork() {
 573             return true;
 574         }
 575 
 576         public void action(Node node) {
 577             StackPane pane = (StackPane) node;
 578             pane.getChildren().add(RectangleBuilder.create()
 579                         .opacity(0.5)
 580                         .fill(Color.BLACK)
 581                         .height(100)
 582                         .width(100)
 583                         .build());
 584         }
 585     }),
 586     AddTranslucent01Rectangle(new Factory() {
 587 
 588         public Node createNode(boolean lcd) {
 589             StackPane value = new StackPane();
 590 
 591             value.getChildren().addAll(
 592                     TextBuilder.create()
 593                         .text("Test")
 594                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 595                         .build());
 596             return value;
 597         }
 598 
 599         public boolean isLCDWork() {
 600             return true;
 601         }
 602 
 603         public void action(Node node) {
 604             StackPane pane = (StackPane) node;
 605             pane.getChildren().add(RectangleBuilder.create()
 606                         .opacity(0.000001d)
 607                         .fill(Color.BLACK)
 608                         .height(100)
 609                         .width(100)
 610                         .build());
 611         }
 612     }),
 613     AddTranslucent09Rectangle(new Factory() {
 614 
 615         public Node createNode(boolean lcd) {
 616             StackPane value = new StackPane();
 617 
 618             value.getChildren().addAll(
 619                     TextBuilder.create()
 620                         .text("Test")
 621                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 622                         .build());
 623             return value;
 624         }
 625 
 626         boolean value = true;
 627 
 628         public boolean isLCDWork() {
 629             return value;
 630         }
 631 
 632         public void action(Node node) {
 633             StackPane pane = (StackPane) node;
 634             pane.getChildren().add(RectangleBuilder.create()
 635                         .opacity(0.9999999d)
 636                         .fill(Color.BLACK)
 637                         .height(100)
 638                         .width(100)
 639                         .build());
 640             value = false;
 641         }
 642     }),
 643     AddTranslucentPixelBeforeText(new Factory() {
 644 
 645         public Node createNode(boolean lcd) {
 646             StackPane value = new StackPane();
 647 
 648             value.getChildren().addAll(
 649                     TextBuilder.create()
 650                         .text("Test")
 651                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 652                         .build());
 653             return value;
 654         }
 655 
 656         public boolean isLCDWork() {
 657             return true;
 658         }
 659 
 660         public void action(Node node) {
 661             StackPane pane = (StackPane) node;
 662             pane.getChildren().add(0, RectangleBuilder.create()
 663                         .opacity(0.5)
 664                         .fill(Color.BLACK)
 665                         .height(1)
 666                         .width(1)
 667                         .build());
 668 
 669         }
 670     }),
 671     AddTranslucent01PixelBeforeText(new Factory() {
 672 
 673         public Node createNode(boolean lcd) {
 674             StackPane value = new StackPane();
 675 
 676             value.getChildren().addAll(
 677                     TextBuilder.create()
 678                         .text("Test")
 679                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 680                         .build());
 681             return value;
 682         }
 683 
 684         public boolean isLCDWork() {
 685             return true;
 686         }
 687 
 688         public void action(Node node) {
 689             StackPane pane = (StackPane) node;
 690             pane.getChildren().add(0, RectangleBuilder.create()
 691                         .opacity(0.000001d)
 692                         .fill(Color.BLACK)
 693                         .height(1)
 694                         .width(1)
 695                         .build());
 696         }
 697     }),
 698     AddTranslucent09PixelBeforeText(new Factory() {
 699 
 700         public Node createNode(boolean lcd) {
 701             StackPane value = new StackPane();
 702 
 703             value.getChildren().addAll(
 704                     TextBuilder.create()
 705                         .text("Test")
 706                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 707                         .build());
 708             return value;
 709         }
 710 
 711         public boolean isLCDWork() {
 712             return true;
 713         }
 714 
 715         public void action(Node node) {
 716             StackPane pane = (StackPane) node;
 717             pane.getChildren().add(0, RectangleBuilder.create()
 718                         .opacity(0.9999999d)
 719                         .fill(Color.BLACK)
 720                         .height(1)
 721                         .width(1)
 722                         .build());
 723         }
 724     }),
 725     AddTransparentRectangleBeforeText(new Factory() {
 726 
 727         public Node createNode(boolean lcd) {
 728             StackPane value = new StackPane();
 729 
 730             value.getChildren().addAll(
 731                     TextBuilder.create()
 732                         .text("Test")
 733                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 734                         .build());
 735             return value;
 736         }
 737 
 738         public boolean isLCDWork() {
 739             return true;
 740         }
 741 
 742         public void action(Node node) {
 743             StackPane pane = (StackPane) node;
 744             pane.getChildren().add(0, RectangleBuilder.create()
 745                         .opacity(0)
 746                         .fill(Color.BLACK)
 747                         .height(100)
 748                         .width(100)
 749                         .build());
 750         }
 751     }),
 752     AddTranslucentRectangleBeforeText(new Factory() {
 753 
 754         public Node createNode(boolean lcd) {
 755             StackPane value = new StackPane();
 756 
 757             value.getChildren().addAll(
 758                     TextBuilder.create()
 759                         .text("Test")
 760                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 761                         .build());
 762             return value;
 763         }
 764 
 765         public boolean isLCDWork() {
 766             return true;
 767         }
 768 
 769         public void action(Node node) {
 770             StackPane pane = (StackPane) node;
 771             pane.getChildren().add(0, RectangleBuilder.create()
 772                         .opacity(0.5)
 773                         .fill(Color.BLACK)
 774                         .height(100)
 775                         .width(100)
 776                         .build());
 777         }
 778     }),
 779     AddTranslucent01RectangleBeforeText(new Factory() {
 780 
 781         public Node createNode(boolean lcd) {
 782             StackPane value = new StackPane();
 783 
 784             value.getChildren().addAll(
 785                     TextBuilder.create()
 786                         .text("Test")
 787                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 788                         .build());
 789             return value;
 790         }
 791 
 792         public boolean isLCDWork() {
 793             return true;
 794         }
 795 
 796         public void action(Node node) {
 797             StackPane pane = (StackPane) node;
 798             pane.getChildren().add(0, RectangleBuilder.create()
 799                         .opacity(0.000001d)
 800                         .fill(Color.BLACK)
 801                         .height(100)
 802                         .width(100)
 803                         .build());
 804         }
 805     }),
 806     AddTranslucent09RectangleBeforeText(new Factory() {
 807 
 808         public Node createNode(boolean lcd) {
 809             StackPane value = new StackPane();
 810 
 811             value.getChildren().addAll(
 812                     TextBuilder.create()
 813                         .text("Test")
 814                         .fontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY)
 815                         .build());
 816             return value;
 817         }
 818 
 819         boolean value = true;
 820 
 821         public boolean isLCDWork() {
 822             return value;
 823         }
 824 
 825         public void action(Node node) {
 826             StackPane pane = (StackPane) node;
 827             pane.getChildren().add(0, RectangleBuilder.create()
 828                         .opacity(0.9999999d)
 829                         .fill(Color.BLACK)
 830                         .height(100)
 831                         .width(100)
 832                         .build());
 833             value = false;
 834         }
 835     });
 836 
 837 
 838     private Factory factory;
 839 
 840     private Factories(Factory factory){
 841         this.factory = factory;
 842     }
 843 
 844     public Node createNode(boolean lcd) {
 845         return this.factory.createNode(lcd);
 846     }
 847 
 848     public boolean isLCDWork() {
 849         return this.factory.isLCDWork();
 850     }
 851 
 852     public void action(Node node){


   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  */
  24 package test.scenegraph.lcd.transparency;
  25 
  26 
  27 import javafx.scene.Node;
  28 import javafx.scene.layout.StackPane;

  29 import javafx.scene.paint.Color;
  30 import javafx.scene.shape.Rectangle;
  31 import javafx.scene.text.FontSmoothingType;
  32 import javafx.scene.text.Text;
  33 
  34 /**
  35  *
  36  * @author Alexander Petrov
  37  */
  38 public enum Factories implements Factory {
  39 
  40 
  41     TransparentPixel(new EmptyActionFactory() {
  42 
  43         public Node createNode(boolean lcd) {
  44             StackPane value = new StackPane();
  45                         Text t = new Text("Test");
  46                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
  47                         Rectangle r = new Rectangle(1, 1);
  48                         r.setOpacity(0);
  49                         r.setFill(Color.BLACK);
  50             value.getChildren().addAll(t, r);






  51             return value;
  52         }
  53 
  54         public boolean isLCDWork() {
  55             return true;
  56         }
  57     }),
  58     TransparentBackground(new EmptyActionFactory() {
  59 
  60         public Node createNode(boolean lcd) {
  61             StackPane value = new StackPane();
  62             Text t = new Text("Test");
  63                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
  64                         Rectangle r = new Rectangle(100, 100);
  65                         r.setOpacity(0);
  66                         r.setFill(Color.BLACK);
  67             value.getChildren().addAll(t, r);






  68             return value;
  69         }
  70 
  71         public boolean isLCDWork() {
  72             return true;
  73         }
  74     }),
  75     TranslucentPixel(new EmptyActionFactory() {
  76 
  77         public Node createNode(boolean lcd) {
  78             StackPane value = new StackPane();
  79             Text t = new Text("Test");
  80                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
  81                         Rectangle r = new Rectangle(1, 1);
  82                         r.setOpacity(0.5);
  83                         r.setFill(Color.BLACK);
  84             value.getChildren().addAll(t, r);






  85             return value;
  86         }
  87 
  88         public boolean isLCDWork() {
  89             return true;
  90         }
  91     }),
  92     Translucent01Pixel(new EmptyActionFactory() {
  93 
  94         public Node createNode(boolean lcd) {
  95             StackPane value = new StackPane();
  96                         Text t = new Text("Test");
  97                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
  98             Rectangle r = new Rectangle(1, 1);
  99                         r.setOpacity(0.000001d);
 100                         r.setFill(Color.BLACK);
 101             value.getChildren().addAll(t, r);






 102             return value;
 103         }
 104 
 105         public boolean isLCDWork() {
 106             return true;
 107         }
 108     }),
 109     Translucent09Pixel(new EmptyActionFactory() {
 110 
 111         public Node createNode(boolean lcd) {
 112             StackPane value = new StackPane();
 113                         Text t = new Text("Test");
 114                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 115             Rectangle r = new Rectangle(1, 1);
 116                         r.setOpacity(0.9999999d);
 117                         r.setFill(Color.BLACK);
 118             value.getChildren().addAll(t, r);






 119             return value;
 120         }
 121 
 122         public boolean isLCDWork() {
 123             return true;
 124         }
 125     }),
 126     TransparentRectangle(new EmptyActionFactory() {
 127 
 128         public Node createNode(boolean lcd) {
 129             StackPane value = new StackPane();
 130                         Text t = new Text("Test");
 131                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 132             Rectangle r = new Rectangle(100, 100);
 133                         r.setOpacity(0);
 134                         r.setFill(Color.BLACK);
 135             value.getChildren().addAll(t, r);






 136             return value;
 137         }
 138 
 139         public boolean isLCDWork() {
 140             return true;
 141         }
 142     }),
 143     TranslucentRectangle(new EmptyActionFactory() {
 144 
 145         public Node createNode(boolean lcd) {
 146             StackPane value = new StackPane();
 147                         Text t = new Text("Test");
 148                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 149             Rectangle r = new Rectangle(100, 100);
 150                         r.setOpacity(0.5);
 151                         r.setFill(Color.BLACK);
 152             value.getChildren().addAll(t, r);






 153             return value;
 154         }
 155 
 156         public boolean isLCDWork() {
 157             return true;
 158         }
 159     }),
 160     Translucent01Rectangle(new EmptyActionFactory() {
 161 
 162         public Node createNode(boolean lcd) {
 163             StackPane value = new StackPane();
 164                         Text t = new Text("Test");
 165                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 166             Rectangle r = new Rectangle(100, 100);
 167                         r.setOpacity(0.000001d);
 168                         r.setFill(Color.BLACK);
 169             value.getChildren().addAll(t, r);






 170             return value;
 171         }
 172 
 173         public boolean isLCDWork() {
 174             return true;
 175         }
 176     }),
 177     Translucent09Rectangle(new EmptyActionFactory() {
 178 
 179         public Node createNode(boolean lcd) {
 180             StackPane value = new StackPane();
 181                         Text t = new Text("Test");
 182                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 183             Rectangle r = new Rectangle(100, 100);
 184                         r.setOpacity(0.9999999d);
 185                         r.setFill(Color.BLACK);
 186             value.getChildren().addAll(t, r);






 187             return value;
 188         }
 189 
 190         public boolean isLCDWork() {
 191             return false;
 192         }
 193     }),
 194     TranslucentPixelBeforeText(new EmptyActionFactory() {
 195 
 196         public Node createNode(boolean lcd) {
 197             StackPane value = new StackPane();
 198                         Text t = new Text("Test");
 199                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 200             Rectangle r = new Rectangle(1, 1);
 201                         r.setOpacity(0.5);
 202                         r.setFill(Color.BLACK);
 203             value.getChildren().addAll(r, t);







 204             return value;
 205         }
 206 
 207         public boolean isLCDWork() {
 208             return true;
 209         }
 210     }),
 211     Translucent01PixelBeforeText(new EmptyActionFactory() {
 212 
 213         public Node createNode(boolean lcd) {
 214             StackPane value = new StackPane();
 215             Text t = new Text("Test");
 216                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 217                         Rectangle r = new Rectangle(1, 1);
 218                         r.setOpacity(0.000001d);
 219                         r.setFill(Color.BLACK);
 220             value.getChildren().addAll(r, t);






 221             return value;
 222         }
 223 
 224         public boolean isLCDWork() {
 225             return true;
 226         }
 227     }),
 228     Translucent09PixelBeforeText(new EmptyActionFactory() {
 229 
 230         public Node createNode(boolean lcd) {
 231             StackPane value = new StackPane();
 232                         Text t = new Text("Test");
 233                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 234             Rectangle r = new Rectangle(1, 1);
 235                         r.setOpacity(0.9999999d);
 236                         r.setFill(Color.BLACK);
 237             value.getChildren().addAll(r, t);






 238             return value;
 239         }
 240 
 241         public boolean isLCDWork() {
 242             return true;
 243         }
 244     }),
 245     TransparentRectangleBeforeText(new EmptyActionFactory() {
 246 
 247         public Node createNode(boolean lcd) {
 248             StackPane value = new StackPane();
 249                         Text t = new Text("Test");
 250                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 251                         Rectangle r = new Rectangle(100, 100);
 252                         r.setOpacity(0);
 253                         r.setFill(Color.BLACK);
 254             value.getChildren().addAll(r, t);






 255             return value;
 256         }
 257 
 258         public boolean isLCDWork() {
 259             return true;
 260         }
 261     }),
 262     TranslucentRectangleBeforeText(new EmptyActionFactory() {
 263 
 264         public Node createNode(boolean lcd) {
 265             StackPane value = new StackPane();
 266                         Text t = new Text("Test");
 267                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 268             Rectangle r = new Rectangle(100, 100);
 269                         r.setOpacity(0.5);
 270                         r.setFill(Color.BLACK);
 271             value.getChildren().addAll(r, t);






 272             return value;
 273         }
 274 
 275         public boolean isLCDWork() {
 276             return true;
 277         }
 278     }),
 279     Translucent01RectangleBeforeText(new EmptyActionFactory() {
 280 
 281         public Node createNode(boolean lcd) {
 282             StackPane value = new StackPane();
 283                         Text t = new Text("Test");
 284                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 285             Rectangle r = new Rectangle(100, 100);
 286                         r.setOpacity(0.000001d);
 287                         r.setFill(Color.BLACK);
 288             value.getChildren().addAll(r, t);






 289             return value;
 290         }
 291 
 292         public boolean isLCDWork() {
 293             return true;
 294         }
 295     }),
 296     Translucent09RectangleBeforeText(new EmptyActionFactory() {
 297 
 298         public Node createNode(boolean lcd) {
 299             StackPane value = new StackPane();
 300                         Text t = new Text("Test");
 301                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 302             Rectangle r = new Rectangle(100, 100);
 303                         r.setOpacity(0.9999999d);
 304                         r.setFill(Color.BLACK);
 305             value.getChildren().addAll(r, t);






 306             return value;
 307         }
 308 
 309         public boolean isLCDWork() {
 310             return false;
 311         }
 312     }),
 313     TranslucentBackground(new EmptyActionFactory() {
 314 
 315         public Node createNode(boolean lcd) {
 316             StackPane value = new StackPane();
 317                         Text t = new Text("Test");
 318                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 319             Rectangle r = new Rectangle(100, 100);
 320                         r.setOpacity(0.5);
 321                         r.setFill(Color.BLACK);
 322             value.getChildren().addAll(t, r);






 323             return value;
 324         }
 325 
 326         public boolean isLCDWork() {
 327             return true;
 328         }
 329     }),
 330     TranslucentPane(new EmptyActionFactory() {
 331 
 332         public Node createNode(boolean lcd) {
 333                         Text t = new Text("Test");
 334                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 335                         StackPane temp = new StackPane(t);
 336                         temp.setOpacity(0.5);
 337             return temp;


 338         }
 339 
 340         public boolean isLCDWork() {
 341             return false;
 342         }
 343     }),
 344     AddTranslucentPixel(new Factory() {
 345 
 346         public Node createNode(boolean lcd) {
 347             StackPane value = new StackPane();
 348                         Text t = new Text("Test");
 349                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 350             value.getChildren().addAll(t);



 351             return value;
 352         }
 353 
 354         public boolean isLCDWork() {
 355             return true;
 356         }
 357 
 358         public void action(Node node) {
 359             StackPane pane = (StackPane) node;
 360                         Rectangle r = new Rectangle(1, 1);
 361                         r.setOpacity(0.5);
 362                         r.setFill(Color.BLACK);
 363             pane.getChildren().add(r);


 364 
 365         }
 366     }),
 367     AddTranslucent01Pixel(new Factory() {
 368 
 369         public Node createNode(boolean lcd) {
 370             StackPane value = new StackPane();
 371             Text t = new Text("Test");
 372                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 373             value.getChildren().addAll(t);



 374             return value;
 375         }
 376 
 377         public boolean isLCDWork() {
 378             return true;
 379         }
 380 
 381         public void action(Node node) {
 382             StackPane pane = (StackPane) node;
 383                         Rectangle r = new Rectangle(1, 1);
 384                         r.setOpacity(0.000001d);
 385                         r.setFill(Color.BLACK);
 386             pane.getChildren().add(r);


 387         }
 388     }),
 389     AddTranslucent09Pixel(new Factory() {
 390 
 391         public Node createNode(boolean lcd) {
 392             StackPane value = new StackPane();
 393             Text t = new Text("Test");
 394                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 395             value.getChildren().addAll(t);



 396             return value;
 397         }
 398 
 399         public boolean isLCDWork() {
 400             return true;
 401         }
 402 
 403         public void action(Node node) {
 404             StackPane pane = (StackPane) node;
 405                         Rectangle r = new Rectangle(1, 1);
 406                         r.setOpacity(0.9999999d);
 407                         r.setFill(Color.BLACK);
 408             pane.getChildren().add(r);


 409         }
 410     }),
 411     AddTransparentRectangle(new Factory() {
 412 
 413         public Node createNode(boolean lcd) {
 414             StackPane value = new StackPane();
 415             Text t = new Text("Test");
 416                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 417             value.getChildren().addAll(t);



 418             return value;
 419         }
 420 
 421         public boolean isLCDWork() {
 422             return true;
 423         }
 424 
 425         public void action(Node node) {
 426             StackPane pane = (StackPane) node;
 427                         Rectangle r = new Rectangle(100, 100);
 428                         r.setOpacity(0);
 429                         r.setFill(Color.BLACK);
 430             pane.getChildren().add(r);


 431         }
 432     }),
 433     AddTranslucentRectangle(new Factory() {
 434 
 435         public Node createNode(boolean lcd) {
 436             StackPane value = new StackPane();
 437             Text t = new Text("Test");
 438                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 439             value.getChildren().addAll(t);



 440             return value;
 441         }
 442 
 443         public boolean isLCDWork() {
 444             return true;
 445         }
 446 
 447         public void action(Node node) {
 448             StackPane pane = (StackPane) node;
 449                         Rectangle r = new Rectangle(100, 100);
 450                         r.setOpacity(0.5);
 451                         r.setFill(Color.BLACK);
 452             pane.getChildren().add(r);


 453         }
 454     }),
 455     AddTranslucent01Rectangle(new Factory() {
 456 
 457         public Node createNode(boolean lcd) {
 458             StackPane value = new StackPane();
 459             Text t = new Text("Test");
 460                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 461             value.getChildren().addAll(t);



 462             return value;
 463         }
 464 
 465         public boolean isLCDWork() {
 466             return true;
 467         }
 468 
 469         public void action(Node node) {
 470             StackPane pane = (StackPane) node;
 471                         Rectangle r = new Rectangle(100, 100);
 472                         r.setOpacity(0.000001d);
 473                         r.setFill(Color.BLACK);
 474             pane.getChildren().add(r);


 475         }
 476     }),
 477     AddTranslucent09Rectangle(new Factory() {
 478 
 479         public Node createNode(boolean lcd) {
 480             StackPane value = new StackPane();
 481             Text t = new Text("Test");
 482                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 483             value.getChildren().addAll(t);



 484             return value;
 485         }
 486 
 487         boolean value = true;
 488 
 489         public boolean isLCDWork() {
 490             return value;
 491         }
 492 
 493         public void action(Node node) {
 494             StackPane pane = (StackPane) node;
 495                         Rectangle r = new Rectangle(100, 100);
 496                         r.setOpacity(0.9999999d);
 497                         r.setFill(Color.BLACK);
 498             pane.getChildren().add(r);


 499             value = false;
 500         }
 501     }),
 502     AddTranslucentPixelBeforeText(new Factory() {
 503 
 504         public Node createNode(boolean lcd) {
 505             StackPane value = new StackPane();
 506             Text t = new Text("Test");
 507                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 508             value.getChildren().addAll(t);



 509             return value;
 510         }
 511 
 512         public boolean isLCDWork() {
 513             return true;
 514         }
 515 
 516         public void action(Node node) {
 517             StackPane pane = (StackPane) node;
 518                         Rectangle r = new Rectangle(1, 1);
 519                         r.setOpacity(0.5);
 520                         r.setFill(Color.BLACK);
 521             pane.getChildren().add(0, r);


 522 
 523         }
 524     }),
 525     AddTranslucent01PixelBeforeText(new Factory() {
 526 
 527         public Node createNode(boolean lcd) {
 528             StackPane value = new StackPane();
 529             Text t = new Text("Test");
 530                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 531             value.getChildren().addAll(t);



 532             return value;
 533         }
 534 
 535         public boolean isLCDWork() {
 536             return true;
 537         }
 538 
 539         public void action(Node node) {
 540             StackPane pane = (StackPane) node;
 541                         Rectangle r = new Rectangle(1, 1);
 542                         r.setOpacity(0.000001d);
 543                         r.setFill(Color.BLACK);
 544             pane.getChildren().add(0, r);


 545         }
 546     }),
 547     AddTranslucent09PixelBeforeText(new Factory() {
 548 
 549         public Node createNode(boolean lcd) {
 550             StackPane value = new StackPane();
 551             Text t = new Text("Test");
 552                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 553             value.getChildren().addAll(t);



 554             return value;
 555         }
 556 
 557         public boolean isLCDWork() {
 558             return true;
 559         }
 560 
 561         public void action(Node node) {
 562             StackPane pane = (StackPane) node;
 563                         Rectangle r = new Rectangle(1, 1);
 564                         r.setOpacity(0.9999999d);
 565                         r.setFill(Color.BLACK);
 566             pane.getChildren().add(0, r);


 567         }
 568     }),
 569     AddTransparentRectangleBeforeText(new Factory() {
 570 
 571         public Node createNode(boolean lcd) {
 572             StackPane value = new StackPane();
 573             Text t = new Text("Test");
 574                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 575             value.getChildren().addAll(t);



 576             return value;
 577         }
 578 
 579         public boolean isLCDWork() {
 580             return true;
 581         }
 582 
 583         public void action(Node node) {
 584             StackPane pane = (StackPane) node;
 585                         Rectangle r = new Rectangle(100, 100);
 586                         r.setOpacity(0);
 587                         r.setFill(Color.BLACK);
 588             pane.getChildren().add(0, r);


 589         }
 590     }),
 591     AddTranslucentRectangleBeforeText(new Factory() {
 592 
 593         public Node createNode(boolean lcd) {
 594             StackPane value = new StackPane();
 595             Text t = new Text("Test");
 596                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 597             value.getChildren().addAll(t);



 598             return value;
 599         }
 600 
 601         public boolean isLCDWork() {
 602             return true;
 603         }
 604 
 605         public void action(Node node) {
 606             StackPane pane = (StackPane) node;
 607                         Rectangle r = new Rectangle(100, 100);
 608                         r.setOpacity(0.5);
 609                         r.setFill(Color.BLACK);
 610             pane.getChildren().add(0, r);


 611         }
 612     }),
 613     AddTranslucent01RectangleBeforeText(new Factory() {
 614 
 615         public Node createNode(boolean lcd) {
 616             StackPane value = new StackPane();
 617             Text t = new Text("Test");
 618                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 619             value.getChildren().addAll(t);



 620             return value;
 621         }
 622 
 623         public boolean isLCDWork() {
 624             return true;
 625         }
 626 
 627         public void action(Node node) {
 628             StackPane pane = (StackPane) node;
 629                         Rectangle r = new Rectangle(100, 100);
 630                         r.setOpacity(0.000001d);
 631                         r.setFill(Color.BLACK);
 632             pane.getChildren().add(0, r);


 633         }
 634     }),
 635     AddTranslucent09RectangleBeforeText(new Factory() {
 636 
 637         public Node createNode(boolean lcd) {
 638             StackPane value = new StackPane();
 639                         Text t = new Text("Test");
 640                         t.setFontSmoothingType(lcd?FontSmoothingType.LCD:FontSmoothingType.GRAY);
 641             value.getChildren().addAll(t);



 642             return value;
 643         }
 644 
 645         boolean value = true;
 646 
 647         public boolean isLCDWork() {
 648             return value;
 649         }
 650 
 651         public void action(Node node) {
 652             StackPane pane = (StackPane) node;
 653                         Rectangle r = new Rectangle(100, 100);
 654                         r.setOpacity(0.9999999d);
 655                         r.setFill(Color.BLACK);
 656             pane.getChildren().add(r);


 657             value = false;
 658         }
 659     });
 660 
 661 
 662     private Factory factory;
 663 
 664     private Factories(Factory factory){
 665         this.factory = factory;
 666     }
 667 
 668     public Node createNode(boolean lcd) {
 669         return this.factory.createNode(lcd);
 670     }
 671 
 672     public boolean isLCDWork() {
 673         return this.factory.isLCDWork();
 674     }
 675 
 676     public void action(Node node){