Package ch.bfh.ti.kybernetik.engine.controller.observerCommands.model

Examples of ch.bfh.ti.kybernetik.engine.controller.observerCommands.model.LightBulbModelObserverCommand


   */
  @Override
  public boolean addLightBulbController(LightBulbController lightBulbController) {
    boolean added = this.getLightBulbControllers().add(lightBulbController);
    if (added) {
      this.notifyObservers(new LightBulbModelObserverCommand(lightBulbController.getLightBulb(),
          LightBulbModelCommandState.LIGHTBULB_ADDED));
    }
    return added;

  }
View Full Code Here


  @Override
  public void removeLightBulb(LightBulb lightBulb) {
    LightBulbController lbcToRemove = this.getLightBulbControllerForLightBulb(lightBulb);
    if (lbcToRemove != null) {
      this.getLightBulbControllers().remove(lbcToRemove);
      this.notifyObservers(new LightBulbModelObserverCommand(lbcToRemove.getLightBulb(), LightBulbModelCommandState.LIGHTBULB_REMOVED));
    }
  }
View Full Code Here

      if (rmlmoc.getState() == RoboterMoveModelObserverCommandState.ROBOTER_MOVE_ADDED) {
        RoboterMoveListComponent rtc = findOrAddRoboterTraceComponent(rmlmoc.getModel());
        rtc.setMoves(rmlmoc.getPayLoad());
      }
    } else if (observerCommand instanceof LightBulbModelObserverCommand) {
      LightBulbModelObserverCommand lbmoc = (LightBulbModelObserverCommand) observerCommand;
      if (lbmoc.getState() == LightBulbModelCommandState.LIGHTBULB_ADDED) {
        this.lightBulbComponents.add(new LightBulbComponent(lbmoc.getModel()));
      } else if (lbmoc.getState() == LightBulbModelCommandState.LIGHTBULB_REMOVED) {
        LightBulbComponent rc = findOrAddLightBulbComponent(lbmoc.getModel());
        this.lightBulbComponents.remove(rc);
      }
    }
  }
View Full Code Here

TOP

Related Classes of ch.bfh.ti.kybernetik.engine.controller.observerCommands.model.LightBulbModelObserverCommand

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.