Package java.util

Examples of java.util.Observer


      updatePlayerQuest((CircumstancesOfDeath) arg);
    }
  }

  private void buildSecretRoomArea(final StendhalRPZone zone, final Map<String, String> attributes) {
    Observer observer = new DrowObserver();
   
    // describe secret room tunnel here
    final Area a1 = new Area(zone, 33, 50, 10, 20);
    final Area a2 = new Area(zone, 23, 021, 49);
   
View Full Code Here


      updatePlayerQuest((CircumstancesOfDeath) arg);
    }
  }

  private void buildSecretRoomArea(final StendhalRPZone zone, final Map<String, String> attributes) {
    Observer observer = new DrowObserver();
    for(CreatureRespawnPoint p:zone.getRespawnPointList()) {
      if(p!=null) {
        if(creatures.indexOf(p.getPrototypeCreature().getName())!=-1) {
          // it is our creature, will add observer now
          p.addObserver(observer);
View Full Code Here

            Integer index = new Integer(i);

            // Replace or remove ParamObserver as needed.
            Object oldObs;
            if(parameter instanceof DeferredData) {
                Observer obs =
                    new ParamObserver(i, (DeferredData)parameter);
                oldObs = paramObservers.put(index, obs);
            } else {
                oldObs = paramObservers.remove(index);
            }
View Full Code Here

  }

  @Test
  public void shouldNotifyObserversOnInputChange() {
    final int[] updateCount = {0};
    Observer observer = new Observer() {
      @Override
      public void update(Observable arg0, Object arg1) {
        updateCount[0]++;
      }
    };
View Full Code Here

  @Test
  public void setVisualCategoryShouldNotifyObserversWhenTheCategoryIsChanged() {
    // Given we have an observer observing on the provider:
    final int[] updateCount = {0};
    Observer observer = new Observer() {
      @Override
      public void update(Observable ob, Object arg) {
        // Updates the counter when notified:
        updateCount[0]++;
      }
View Full Code Here

        newConverter());
    provider.setVisualCategory(category);

    // And we have an observer observing on the provider:
    final int[] updateCount = {0};
    Observer observer = new Observer() {
      @Override
      public void update(Observable ob, Object arg) {
        // Updates the counter when notified:
        updateCount[0]++;
      }
View Full Code Here

    public void testProperties() {
        SubsystemState state = new SubsystemState();

        final List<Observable> observables = new ArrayList<Observable>();
        final List<Object> arguments = new ArrayList<Object>();
        Observer o = new Observer() {
            @Override
            public void update(Observable o, Object arg) {
                observables.add(o);
                arguments.add(arg);
            }
View Full Code Here

    public void testModules() {
        SubsystemState state = new SubsystemState();

        final List<Observable> observables = new ArrayList<Observable>();
        final List<Object> arguments = new ArrayList<Object>();
        Observer o = new Observer() {
            @Override
            public void update(Observable o, Object arg) {
                observables.add(o);
                arguments.add(arg);
            }
View Full Code Here

    public void testActivation() {
        SubsystemState state = new SubsystemState();

        final List<Observable> observables = new ArrayList<Observable>();
        final List<Object> arguments = new ArrayList<Object>();
        Observer o = new Observer() {
            @Override
            public void update(Observable o, Object arg) {
                observables.add(o);
                arguments.add(arg);
            }
View Full Code Here

        if ( o == null )
        {
            o = new RequestObservable();
        }
       
        o.addObserver( new Observer()
        {
            public void update( Observable o, Object arg )
            {
                listener.requestAbandoned( AbstractAbandonableRequest.this );
            }
View Full Code Here

TOP

Related Classes of java.util.Observer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.