Examples of CircleElement


Examples of net.alteiar.beans.map.elements.CircleElement

    return panelSize.getMapElementSize(0);
  }

  @Override
  public CircleElement buildMapElement(Point position) {
    return new CircleElement(position, getSelectedColor(), getElementSize());
  }
View Full Code Here

Examples of net.alteiar.beans.map.elements.CircleElement

        waitingTime);

    MapElementSize circleRadius = new MapElementSizePixel(20.0);
    Point position = new Point(5, 5);

    CircleElement circleClient = new CircleElement(position, Color.RED,
        circleRadius);
    MapElementFactory.buildMapElement(circleClient, battle);

    circleClient = CampaignClient.getInstance().getBean(
        circleClient.getId(), 300L);

    assertEquals("The position should be equals", position,
        circleClient.getPosition());
    assertEquals("The color should be equals", Color.RED,
        circleClient.getColor());
    assertEquals("The angle should be equals", Double.valueOf(0),
        circleClient.getAngle());
    assertEquals("The radius should be equals",
        circleRadius.getPixels(battle.getScale()), circleClient
            .getRadius().getPixels(battle.getScale()));

    assertEquals("The width and the height should be equals",
        circleClient.getWidthPixels(), circleClient.getHeightPixels());

    BufferedImage imgGenerated = new BufferedImage(1000, 1000,
        BufferedImage.TYPE_INT_ARGB);
    Graphics2D g2 = (Graphics2D) imgGenerated.getGraphics();
    circleClient.draw(g2, 1.0, true);
    g2.dispose();

    BufferedImage imgExpected = new BufferedImage(1000, 1000,
        BufferedImage.TYPE_INT_ARGB);
    g2 = (Graphics2D) imgExpected.getGraphics();
    circleClient.draw(g2, 1.0, true);
    g2.dispose();

    try {
      assertTrue("images should be same",
          compareImage(imgExpected, imgGenerated));
    } catch (IOException e) {
      fail("fail to compare images");
    }

    Double angle = 25.0;
    Boolean isHidden = !circleClient.isHiddenForPlayer();
    Point newPosition = new Point(12, 12);
    circleClient.setHiddenForPlayer(isHidden);
    circleClient.setPosition(newPosition);
    circleClient.setAngle(angle);

    waitForChange(circleClient, "getPosition", newPosition);
    waitForChange(circleClient, "getAngle", angle);
    waitForChange(circleClient, "isHiddenForPlayer", isHidden);
    waitForChange(circleClient, "getPosition", newPosition);
    waitForChange(circleClient, "getPosition", newPosition);

    assertEquals("The position should be equals", newPosition,
        circleClient.getPosition());
    assertEquals("The color should be equals", angle,
        circleClient.getAngle());
    assertEquals("The angle should be equals", isHidden,
        circleClient.isHiddenForPlayer());

    assertTrue("the circle not contain point (5,5)",
        !circleClient.contain(new Point(5, 5)));

    assertTrue("the circle contain point (32,32)",
        circleClient.contain(new Point(32, 32)));

    MapElementSize newCircleRadius = new MapElementSizeMeter(1.5);
    circleClient.setRadius(newCircleRadius);
    sleep();
    assertEquals("radius should be equals",
        newCircleRadius.getPixels(battle.getScale()), circleClient
            .getRadius().getPixels(battle.getScale()));

    Color color = Color.BLUE;
    circleClient.setColor(color);
    sleep();
    assertEquals("radius should be equals", color, circleClient.getColor());
  }
View Full Code Here

Examples of net.alteiar.beans.map.elements.CircleElement

    return panelSize.getMapElementSize(0);
  }

  @Override
  public CircleElement buildMapElement(Point position) {
    return new CircleElement(position, getSelectedColor(), getElementSize());
  }
View Full Code Here

Examples of net.alteiar.beans.map.elements.CircleElement

  }

  @Override
  protected void mapElementChanged() {
    CircleElement circle = getMapElement();
    panelRadius.setElementSizeAt(0, circle.getRadius());
  }
View Full Code Here

Examples of net.alteiar.beans.map.elements.CircleElement

    return "le rayon est invalide";
  }

  @Override
  public void applyModification() {
    CircleElement circleElement = getMapElement();
    circleElement.setRadius(panelRadius.getMapElementSize(0));
  }
View Full Code Here

Examples of net.alteiar.beans.map.elements.CircleElement

  }

  @Override
  protected void mapElementChanged() {
    CircleElement circle = getMapElement();
    panelRadius.setElementSizeAt(0, circle.getRadius());
  }
View Full Code Here

Examples of net.alteiar.beans.map.elements.CircleElement

    return "le rayon est invalide";
  }

  @Override
  public void applyModification() {
    CircleElement circleElement = getMapElement();
    circleElement.setRadius(panelRadius.getMapElementSize(0));
  }
View Full Code Here

Examples of net.alteiar.map.elements.CircleElement

    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);
View Full Code Here

Examples of net.alteiar.map.elements.CircleElement

    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

Examples of net.alteiar.map.elements.CircleElement

    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);
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.