Package org.jamesii.core.observe

Examples of org.jamesii.core.observe.Mediator


    ICoupledModel m = (ICoupledModel) model;

    AbstractState mapState = ((IAtomicModel<?>) m.getModel("Map")).getState();

    mapState.setMediator(new Mediator());

    // System.out.println("Instrumenting the model");

    IObserver<? extends IObservable> obs = null;
View Full Code Here


  private List<IObserver<? extends IObservable>> observers;

  @Override
  public void instrumentModel(IModel model,
      IComputationTaskConfiguration simConfig) {
    model.setMediator(new Mediator());
    ICARulesModel m = (ICARulesModel) model;
    ICARulesGrid g = m.getGrid();

    // try to extract a custom cell renderer from the simulation configuration
    Object userParameters = simConfig.getParameters().get("user.parameters");
View Full Code Here

  private List<IObserver<? extends IObservable>> observers;

  @Override
  public void instrumentModel(IModel model,
      IComputationTaskConfiguration simConfig) {
    model.setMediator(new Mediator());
    IObserver<? extends IObservable> obs = new CAStateSumModelObs();
    model.registerObserver(obs);
    observers = new ArrayList<>();
    observers.clear();
    observers.add(obs);
View Full Code Here

    frame.add(grid);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();

    Mediator medi = new Mediator();
    rule22Grid.getState().setMediator(medi);
    rule22Grid.getState().registerObserver(obs);

    rule22Grid.init();
View Full Code Here

    rule22Grid =
        new RuleGrid("Wolfram's Rule " + launcher.rule, launcher.getWidth(),
            rule);

    Mediator medi = new Mediator();
    CAGridObserver go = new CAGridObserver();
    rule22Grid.getState().setMediator(medi);
    rule22Grid.getState().registerObserver(go);

    rule22Grid.init();
View Full Code Here

  /**
   * Test changed.
   */
  public void testChanged() {
    Entity e = new Entity();
    IMediator medi = new Mediator();
    e.setMediator(medi);
    e.registerObserver(new TestObserver());
    e.changed();

    IEntity b = executed;
View Full Code Here

  /**
   * Test changed object.
   */
  public void testChangedObject() {
    Entity e = new Entity();
    IMediator medi = new Mediator();
    e.setMediator(medi);
    e.registerObserver(new TestObserver());
    Object o = new Object();
    e.changed(o);

View Full Code Here

  /**
   * Test get mediator.
   */
  public void testGetMediator() {
    Entity e = new Entity();
    IMediator medi = new Mediator();
    e.setMediator(medi);

    assertTrue(medi == e.getMediator());
  }
View Full Code Here

   */
  public void testIsObserved() {
    Entity e = new Entity();
    assertTrue(!e.isObserved());

    e.setMediator(new Mediator());
    assertTrue(e.isObserved());
  }
View Full Code Here

      exc = true;
    }

    assertTrue("Registered observer without a mediator ", exc);

    e.setMediator(new Mediator());

    exc = false;

    try {
      e.registerObserver(new TestObserver());
View Full Code Here

TOP

Related Classes of org.jamesii.core.observe.Mediator

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.