Details

    • Type: Patch
    • Status: Resolved (View Workflow)
    • Priority: Trivial
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 5.1.0.M2
    • Component/s: None
    • Labels:
      None
    • Affects:
      Interactive Demo/Tutorial
    • Estimated Difficulty:
      Low

      Description

      pacman example needs to better support UIManager calls for non windows platforms. Also, the monster rule has a missing common on the GoUp rule.

      ------
      begin patch
      ------
      Index: drools-examples-drl/src/main/java/org/drools/examples/pacman/PacmanGui.java
      ===================================================================
      — drools-examples-drl/src/main/java/org/drools/examples/pacman/PacmanGui.java (revision 32679)
      +++ drools-examples-drl/src/main/java/org/drools/examples/pacman/PacmanGui.java (working copy)
      @@ -27,9 +27,19 @@

      public static void init(final StatefulKnowledgeSession ksession) {
      try {

      • UIManager.setLookAndFeel( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" );
      • //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
      • //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
        + String osName = System.getProperty("os.name");
        + if (osName.indexOf("Linux") >= 0) { + UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); + }

        + else if (osName.indexOf("Windows") >= 0)

        { + UIManager.setLookAndFeel( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" ); + }

        + else if (osName.indexOf("Mac") >= 0)

        { + UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel"); + }

        + else

        { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + }

        } catch ( UnsupportedLookAndFeelException ex )

        { ex.printStackTrace(); }

        catch ( IllegalAccessException ex ) {
        Index: drools-examples-drl/src/main/rules/org/drools/examples/pacman/monster.drl
        ===================================================================

          • drools-examples-drl/src/main/rules/org/drools/examples/pacman/monster.drl (revision 32679)
            +++ drools-examples-drl/src/main/rules/org/drools/examples/pacman/monster.drl (working copy)
            @@ -122,7 +122,7 @@
            then
            retract( $d );
            retract( $df );
      • insert( new Direction($df.fromChar, 0 Direction.UP ) );
        + insert( new Direction($df.fromChar, 0, Direction.UP ) );
        end

      /**

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mark.proctor Mark Proctor
                Reporter:
                randy.secrist Randy Secrist
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: