Examples of IController


Examples of org.datastorm.controller.IController

/**
* Show the Data Storm window and fire a sql query automatically.
*/
public void show(Connection connection, String sql) {
  try {
    IController controller = new Controller(connection);
    View view = new View(controller);
    controller.setView(view);
    controller.startUp(sql);
  }
  catch(SQLException e) {
    e.printStackTrace();
  }
}
View Full Code Here

Examples of org.jpacman.framework.controller.IController

   * @throws FactoryException when calling MainUI.initialize() fails.
   */
  @Test
  public void testInitialize() throws FactoryException
    assertNull(mainUI.getGame());
    IController ghostMover = mainUI.getGhostController();
   
    mainUI.initialize();
   
    assertNotNull(mainUI.getGame());
    assertEquals(ghostMover, mainUI.getGhostController());
View Full Code Here

Examples of org.jpacman.framework.controller.IController

  @Test
  public void testWithGhostController() throws FactoryException
    mainUI.initialize();
    assertNull(mainUI.getGhostController());
   
    IController ghostMover1 = new RandomGhostMover(mainUI.getGame());
    IController ghostMover2 = new RandomGhostMover(mainUI.getGame());
   
    //Below we apply forced pointer comparison to check the setter.
    mainUI.withGhostController(ghostMover1);
    assertSame(ghostMover1, mainUI.getGhostController());
   
View Full Code Here

Examples of srsim.domain.IController

public class ControllerTest {

  @Test
  public void testAttachingSensors() throws SimulationConfigurationException {
    IController controller = new HeatingController();
    ISensor sensor = new TemperatureSensor();
    IActuator actuator = new HeatingActuator();
    controller.attachSensor(sensor);
    controller.attachActuator(actuator);
  }
View Full Code Here

Examples of srsim.domain.IController

    }
    JsonArray controllers = roomDescription.getJsonArray("controllers");
    if (controllers != null) {
      for (JsonObject controllerDescription : controllers
          .getValuesAs(JsonObject.class)) {
        IController controller = (IController) Class.forName(
            controllerDescription.getString("class")).newInstance();
        controller.setId(controllerDescription.getJsonNumber("id")
            .longValue());
        JsonArray sensorArray = controllerDescription
            .getJsonArray("sensors");
        if (sensorArray != null) {
          for (JsonNumber sensorId : sensorArray
              .getValuesAs(JsonNumber.class)) {
            controller.attachSensor(sensorMap.get(sensorId
                .intValue()));
          }
        }
        JsonArray actuatorArray = controllerDescription
            .getJsonArray("actuators");
        if (actuatorArray != null) {
          for (JsonNumber actuatorId : actuatorArray
              .getValuesAs(JsonNumber.class)) {
            controller.attachActuator(actuatorMap.get(actuatorId
                .intValue()));
          }
        }
        room.addController(controller);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.