Examples of EventSystem


Examples of framework.event.EventSystem

    gc.getInput().addMouseListener(MouseListenerSystem.getInstance());
  }

  @Override
  public void update(GameContainer gc, int delta) throws SlickException{
    EventSystem es = EventSystem.getInstance();
    while(!es.isEmpty()){
      es.evaluateNextEvent();
    }
    clock.tick(delta);
  }
View Full Code Here

Examples of org.jmanage.event.EventSystem

            if(!appConfig.isCluster())
                addApplication(appConfig);
        }
       
        // TODO: perfect dependency to be injected via Spring framework --rk
        EventSystem eventSystem = EventSystem.getInstance();
        
        /* Add the recorder to record the downtimes to the DB */
        eventSystem.addListener(recorder, ApplicationEvent.class);

        /* application event listener to add */
        eventSystem.addListener(new EventListener(){
            public void handleEvent(EventObject event) {
                if(!(event instanceof ApplicationEvent)){
                    throw new IllegalArgumentException("event must be of type ApplicationEvent");
                }
                if(event instanceof NewApplicationEvent){
View Full Code Here

Examples of org.terasology.entitySystem.event.internal.EventSystem

        PrefabManager prefabManager = new PojoPrefabManager();
        entityManager.setPrefabManager(prefabManager);
        CoreRegistry.put(PrefabManager.class, prefabManager);

        // Event System
        EventSystem eventSystem = new EventSystemImpl(library.getEventLibrary(), networkSystem);
        entityManager.setEventSystem(eventSystem);
        CoreRegistry.put(EventSystem.class, eventSystem);

        // TODO: Review - NodeClassLibrary related to the UI for behaviours. Should not be here and probably not even in the CoreRegistry
        CoreRegistry.put(OneOfProviderFactory.class, new OneOfProviderFactory());
View Full Code Here

Examples of org.terasology.entitySystem.event.internal.EventSystem

        iterator.next();
    }

    @Test
    public void addComponentEventSent() {
        EventSystem eventSystem = mock(EventSystem.class);
        entityManager.setEventSystem(eventSystem);
        EntityRef entity1 = entityManager.create();
        StringComponent comp = entity1.addComponent(new StringComponent());

        verify(eventSystem).send(entity1, OnAddedComponent.newInstance(), comp);
View Full Code Here

Examples of org.terasology.entitySystem.event.internal.EventSystem

        verify(eventSystem).send(entity1, OnActivatedComponent.newInstance(), comp);
    }

    @Test
    public void removeComponentEventSent() {
        EventSystem eventSystem = mock(EventSystem.class);

        EntityRef entity1 = entityManager.create();
        StringComponent comp = entity1.addComponent(new StringComponent());
        entityManager.setEventSystem(eventSystem);
        entity1.removeComponent(StringComponent.class);
View Full Code Here

Examples of org.terasology.entitySystem.event.internal.EventSystem

        verify(eventSystem).send(entity1, BeforeRemoveComponent.newInstance(), comp);
    }

    @Test
    public void changeComponentEventSentWhenSave() {
        EventSystem eventSystem = mock(EventSystem.class);

        EntityRef entity1 = entityManager.create();
        StringComponent comp = entity1.addComponent(new StringComponent());
        entityManager.setEventSystem(eventSystem);
        entity1.saveComponent(comp);
View Full Code Here

Examples of org.terasology.entitySystem.event.internal.EventSystem

        verify(eventSystem).send(entity1, OnChangedComponent.newInstance(), comp);
    }

    @Test
    public void changeComponentEventSentWhenAddOverExisting() {
        EventSystem eventSystem = mock(EventSystem.class);

        EntityRef entity1 = entityManager.create();
        entity1.addComponent(new StringComponent());
        entityManager.setEventSystem(eventSystem);
        StringComponent comp2 = entity1.addComponent(new StringComponent());
View Full Code Here

Examples of org.terasology.entitySystem.event.internal.EventSystem

        verify(eventSystem).send(entity1, OnChangedComponent.newInstance(), comp2);
    }

    @Test
    public void massRemovedComponentEventSentOnDestroy() {
        EventSystem eventSystem = mock(EventSystem.class);

        EntityRef entity1 = entityManager.create();
        entity1.addComponent(new StringComponent());
        entityManager.setEventSystem(eventSystem);
        entity1.destroy();
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.