ui/src/main/java/ucar/nc2/ui/event/ActionCoordinator.java
static public void main( String[] argv) {
    ActionCoordinator ac = new ActionCoordinator("test");
/*    System.out.println("failure test------------");
    try {
      ac.addActionSourceListener(new ActionSourceListener("that") {
        public void actionPerformed( java.awt.event.ActionEvent e) {
          System.out.println(" event ok ");
        }
      });
      System.out.println("good dog!");
    } catch (IllegalArgumentException e) {
      System.out.println("bad dog! = "+e);
    }

    System.out.println("next test------------");  */
    ActionSourceListener as1 = new ActionSourceListener("test") {
      public void actionPerformed( ActionValueEvent e) {
        System.out.println(" first listener got event "+e.getValue());
      }
    };
    ac.addActionSourceListener(as1);

    ActionSourceListener as2 = new ActionSourceListener("test") {
      public void actionPerformed( ActionValueEvent e) {
        System.out.println(" second listener got event "+e.getValue());
      }
    };
    ac.addActionSourceListener(as2);

    ActionSourceListener as3 = new ActionSourceListener("test") {
      public void actionPerformed( ActionValueEvent e) {
        System.out.println(" third listener got event "+e.getValue());
      }
    };
    ac.addActionSourceListener(as3);

    as1.fireActionValueEvent("testing", "newValue 1");
    as2.fireActionValueEvent("testing", "newValue 2");
  }
static public void main( String[] argv) {
    ActionCoordinator ac = new ActionCoordinator("test");
/*    System.out.println("failure test------------");
    try {
      ac.addActionSourceListener(new ActionSourceListener("that") {
        public void actionPerformed( java.awt.event.ActionEvent e) {
          System.out.println(" event ok ");
        }
      });
      System.out.println("good dog!");
    } catch (IllegalArgumentException e) {
      System.out.println("bad dog! = "+e);
    }

    System.out.println("next test------------");  */
    ActionSourceListener as1 = new ActionSourceListener("test") {
      public void actionPerformed( ActionValueEvent e) {
        System.out.println(" first listener got event "+e.getValue());
      }
    };
    ac.addActionSourceListener(as1);

    ActionSourceListener as2 = new ActionSourceListener("test") {
      public void actionPerformed( ActionValueEvent e) {
        System.out.println(" second listener got event "+e.getValue());
      }
    };
    ac.addActionSourceListener(as2);

    ActionSourceListener as3 = new ActionSourceListener("test") {
      public void actionPerformed( ActionValueEvent e) {
        System.out.println(" third listener got event "+e.getValue());
      }
    };
    ac.addActionSourceListener(as3);

    as1.fireActionValueEvent("testing", "newValue 1");
    as2.fireActionValueEvent("testing", "newValue 2");
  }
static public void main ( String [ ] argv ) { ActionCoordinator ac = new ActionCoordinator ( "test" ) ; /*    System.out.println("failure test------------");
    try {
      ac.addActionSourceListener(new ActionSourceListener("that") {
        public void actionPerformed( java.awt.event.ActionEvent e) {
          System.out.println(" event ok ");
        }
      });
      System.out.println("good dog!");
    } catch (IllegalArgumentException e) {
      System.out.println("bad dog! = "+e);
    }

    System.out.println("next test------------");  */ ActionSourceListener as1 = new ActionSourceListener ( "test" ) { public void actionPerformed ( ActionValueEvent e ) { System . out . println ( " first listener got event " + e . getValue ( ) ) ; } } ; ac . addActionSourceListener ( as1 ) ; ActionSourceListener as2 = new ActionSourceListener ( "test" ) { public void actionPerformed ( ActionValueEvent e ) { System . out . println ( " second listener got event " + e . getValue ( ) ) ; } } ; ac . addActionSourceListener ( as2 ) ; ActionSourceListener as3 = new ActionSourceListener ( "test" ) { public void actionPerformed ( ActionValueEvent e ) { System . out . println ( " third listener got event " + e . getValue ( ) ) ; } } ; ac . addActionSourceListener ( as3 ) ; as1 . fireActionValueEvent ( "testing" , "newValue 1" ) ; as2 . fireActionValueEvent ( "testing" , "newValue 2" ) ; }
add an ActionValue listener
public void addActionValueListener( ActionValueListener l) {
lm.addListener(l);
}
remove an ActionValue listener
public void removeActionValueListener( ActionValueListener l) {
lm.removeListener(l);
}
add an ActionValue listener public void addActionValueListener ( ActionValueListener l ) { lm . addListener ( l ) ; } remove an ActionValue listener public void removeActionValueListener ( ActionValueListener l ) { lm . removeListener ( l ) ; }