Package ch.bfh.ti.kybernetik.engine.controller.lightBulb

Examples of ch.bfh.ti.kybernetik.engine.controller.lightBulb.LightBulbController


    }
  }

  @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


  private LightBulbController getLightBulbControllerForLightBulb(LightBulb lightBulb) {
    Collection<LightBulbController> list = getLightBulbControllers();
    final Iterator<LightBulbController> i = list.iterator();
    while (i.hasNext()) {
      LightBulbController lightBulbController = i.next();
      if (lightBulbController.getLightBulb().equals(lightBulb)) {
        return lightBulbController;
      }
    }
    return null;
  }
View Full Code Here

  private static LightBulbController[] buildLightBulbControllers(int width, int height) {

    final LightBulbController[] lightBulbControllers = new LightBulbController[INIT_LIGHTBULBCONTROLLERS_NUMBERS];
    for (int i = 0; i < lightBulbControllers.length; i++) {
      LightBulbController lbc2 = LightBulbControllerFactory.createRandomLightBulbConroller(width, height);
      lightBulbControllers[i] = lbc2;
    }

    return lightBulbControllers;
  }
View Full Code Here

  private JButton getAddRandomLightBulbButton() {
    JButton addRoboterButton = new JButton("Create Random LightBulb");
    addRoboterButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent event) {
        LightBulbController lightBulbController = LightBulbControllerFactory.createRandomLightBulbConroller(simulator.getWidth(),
            simulator.getWidth());

        simulator.addLightBulbController(lightBulbController);
      }
    });
View Full Code Here

TOP

Related Classes of ch.bfh.ti.kybernetik.engine.controller.lightBulb.LightBulbController

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.