Package framework.event.filter

Examples of framework.event.filter.EventSenderComponentFilter


    this.centreOfOrbitPath = path;
    this.isOrbitingPositionComponent = true;
    Component c = ComponentSystem.getInstance().getComponent(path);
    if(c != null && c.isType(PositionComponent.class)){
      centreOfOrbit = ((PositionComponent) c).getVector();
      EventSystem.getInstance().registerEventListener(this, "PositionChanged", new EventSenderComponentFilter(new ComponentPathFilter(path)));
    }
  }
View Full Code Here


    this.height = height;
    this.canMoveVertically = canMoveVertically;
    this.canMoveHorizontally = canMoveHorizontally;
   
    SiblingFilter siblingFilter = new SiblingFilter(this, PositionComponent.class);
    EventSystem.getInstance().registerEventListener(this, "PositionChanged", new EventSenderComponentFilter(siblingFilter));
  }
View Full Code Here

  public CollisionComponent(CollisionMask mask){
    super();
    this.mask = mask;
    RelativeComponentPath posPath = new RelativeComponentPath(PositionComponent.class.getName(), this, 1, new int[]{0});
    ComponentFilter posFilter = new ComponentPathFilter(posPath);
    EventSystem.getInstance().registerEventListener(this, "PositionChanged", new EventSenderComponentFilter(posFilter));

    RelativeComponentPath orientPath = new RelativeComponentPath(OrientationComponent.class.getName(), this, 1, new int[]{0});
    ComponentFilter orientFilter = new ComponentPathFilter(orientPath);
    EventSystem.getInstance().registerEventListener(this, "OrientationChanged", new EventSenderComponentFilter(orientFilter));
  }
View Full Code Here

    return cursorParent;
  }

  private static void setUpEventListener(Component collis) {
    ComponentPath path = new AbsoluteComponentPath(collis);
    EventSenderComponentFilter filter = new EventSenderComponentFilter(new ComponentPathFilter(path));
    EventListener listener = generateCollisionListener();

    EventSystem.getInstance().registerEventListener(listener, "CollisionStarted", filter);
    EventSystem.getInstance().registerEventListener(listener, "CollisionStopped", filter);
    EventSystem.getInstance().registerEventListener(listener, "MouseReleased", null);
View Full Code Here

  }

  private void init() {
    EventSystem.getInstance().registerEventListener(this, "MouseReleased", null);
    SiblingFilter filter = new SiblingFilter(this, CollisionComponent.class.getName());
    EventSystem.getInstance().registerEventListener(this, "CollisionStarted", new EventSenderComponentFilter(filter));
    EventSystem.getInstance().registerEventListener(this, "CollisionStopped", new EventSenderComponentFilter(filter));
  }
View Full Code Here

    setOffsetFromOrigin(offsetFromOrigin);

    RelativeComponentPath orientPath = new RelativeComponentPath(OrientationComponent.class.getName(), this, 1, new int[]{0});
    ComponentFilter orientFilter = new ComponentPathFilter(orientPath);
    EventSystem.getInstance().registerEventListener(this, "OrientationChanged", new EventSenderComponentFilter(orientFilter));
  }
View Full Code Here

TOP

Related Classes of framework.event.filter.EventSenderComponentFilter

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.