Package net.alteiar.documents.map

Examples of net.alteiar.documents.map.MapBean


  public TriggerEditor(TriggerBean mapElement) throws ClassNotFoundException {
    super(mapElement);
    this.add(new JLabel("Lier des effets au déclencheur:"),
        BorderLayout.NORTH);
    selectedEffect = 1;
    MapBean map = CampaignClient.getInstance().getBean(mapElement.getMapId());
    HashSet<UniqueID> elements = map.getElements();
    effets = new ArrayList<Effect>();
    selectedEffects = new ArrayList<Integer>();
    for (UniqueID element : elements) {
      BasicBean effect = CampaignClient.getInstance().getBean(element);
      if (Beans.isInstanceOf(effect, Effect.class)) {
View Full Code Here


  public EffectEditor(Effect mapElement) throws ClassNotFoundException {
    super(mapElement);
    this.add(new JLabel("Lier des effets au déclencheur:"),
        BorderLayout.NORTH);
    selectedTrigger = 1;
    MapBean map = CampaignClient.getInstance().getBean(mapElement.getMapId());
    HashSet<UniqueID> elements = map.getElements();
    triggers = new ArrayList<TriggerBean>();
    selectedTriggers = new ArrayList<Integer>();
    for (UniqueID element : elements) {
      BasicBean effect = CampaignClient.getInstance().getBean(element);
      if (Beans.isInstanceOf(effect, TriggerBean.class)) {
View Full Code Here

    typeActOn = typeBean;
    actOn = new ArrayList<UniqueID>();

    this.setMapId(mapId);

    MapBean map = CampaignClient.getInstance().getBean(this.getMapId());
    HashSet<UniqueID> elements = map.getElements();
    for (UniqueID element : elements) {
      BasicBean elem = CampaignClient.getInstance().getBean(element);
      if (Beans.isInstanceOf(elem, typeActOn)) {
        actOn.add(elem.getId());
      }
    }
    map.addVetoableChangeListener(this);
  }
View Full Code Here

    isActivate = false;
    typeOfActivator = typeBean;

    this.setMapId(mapID);

    MapBean map = CampaignClient.getInstance().getBean(this.getMapId());
    HashSet<UniqueID> elements = map.getElements();
    for (UniqueID element : elements) {
      MapElement activator = CampaignClient.getInstance()
          .getBean(element);

      if (Beans.isInstanceOf(activator, typeOfActivator)) {
        activator.addPropertyChangeListener(this);
      }
    }
    map.addPropertyChangeListener(new MapObserver());
  }
View Full Code Here

  public ArrayList<UniqueID> getActOn() {
    return this.actOn;
  }

  public void deleteEffect() {
    MapBean map = (MapBean) CampaignClient.getInstance().getBean(this.getMapId());
    map.removeVetoableChangeListener(this);
    map.removeElement(this.getId());
  }
View Full Code Here

  @Override
  public void setMapId(UniqueID mapId) {
    super.setMapId(mapId);

    MapBean map = getMap();
    HashSet<UniqueID> elements = map.getElements();
    for (UniqueID elementId : elements) {
      MapElement element = CampaignClient.getInstance()
          .getBean(elementId);

      // element.contain(p)
View Full Code Here

    }
  }

  @Test
  public void testActivate() {
    MapBean map = addBean(new MapBean("map"));

    MapElementSize width = new MapElementSizePixel(20.0);
    MapElementSize height = new MapElementSizePixel(20.0);
    MyInternalEffect effect = addBean(new MyInternalEffect());

    RectangleElement rectangleElement = new RectangleElement(
        new Point(0, 0), Color.BLACK, width, height);

    PositionTrigger positionTrigger = new PositionTrigger(
        new CircleElement(new Point(25, 25), Color.red, width),
        effect.getId(), RectangleElement.class, map.getId());

    MapElementFactory.buildMapElement(rectangleElement, map);
    MapElementFactory.buildMapElement(positionTrigger, map);
    positionTrigger = getBeans(positionTrigger);
View Full Code Here

        effect.getDesactivationCount());
  }

  @Test
  public void testOneShotEffect() {
    MapBean map = addBean(new MapBean("map"));

    MapElementSize width = new MapElementSizePixel(20.0);
    MapElementSize height = new MapElementSizePixel(20.0);
    MyOneShotInternalEffect effect = addBean(new MyOneShotInternalEffect());

    RectangleElement rectangleElement = new RectangleElement(
        new Point(0, 0), Color.BLACK, width, height);

    PositionTrigger positionTrigger = new PositionTrigger(
        new CircleElement(new Point(25, 25), Color.red, width),
        effect.getId(), RectangleElement.class, map.getId());

    MapElementFactory.buildMapElement(rectangleElement, map);
    MapElementFactory.buildMapElement(positionTrigger, map);

    assertTrue("trigger should'nt be activated",
View Full Code Here

        effect.getDesactivationCount());
  }

  @Test
  public void testSuiteEffect() {
    MapBean map = addBean(new MapBean("map"));

    MapElementSize width = new MapElementSizePixel(10.0);
    MapElementSize height = new MapElementSizePixel(10.0);
    EffectSuite effectSuite = addBean(new EffectSuite());

    MyInternalEffect basicEffect1 = addBean(new MyInternalEffect());
    MyInternalEffect basicEffect2 = addBean(new MyInternalEffect());

    effectSuite.addEffect(basicEffect1.getId());
    effectSuite.addEffect(basicEffect2.getId());

    PositionTrigger positionTrigger = new PositionTrigger(
        new CircleElement(new Point(20, 20), Color.red, width),
        effectSuite.getId(), RectangleElement.class, map.getId());

    MapElementFactory.buildMapElement(positionTrigger, map);
    positionTrigger = getBeans(positionTrigger);

    RectangleElement rectangleElement = new RectangleElement(
View Full Code Here

  }

  // @Test
  public void testDelayedEffect() {
    MapBean map = new MapBean("map");
    CampaignClient.getInstance().addBean(map);
    map = CampaignClient.getInstance().getBean(map.getId(), 2000);

    MapElementSize width = new MapElementSizePixel(20.0);
    MapElementSize height = new MapElementSizePixel(20.0);
    DelayedEffect effect = new DelayedEffect(new CircleElement(new Point(
        18, 18), Color.red, width), false, RectangleElement.class,
        10000, map.getId());
    BasicEffect t1 = new BasicEffect(new CircleElement(new Point(18, 18),
        Color.red, width), false, RectangleElement.class, map.getId());

    effect.addEffect(t1);

    MapElementFactory.buildMapElement(effect, map);
    MapElementFactory.buildMapElement(t1, map);
View Full Code Here

TOP

Related Classes of net.alteiar.documents.map.MapBean

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.