Package net.alteiar.beans.map.size

Examples of net.alteiar.beans.map.size.MapElementSizePixel


    Double size = Double.valueOf(value);

    switch (UnityType.values()[comboBoxUnite.getSelectedIndex()]) {
    case PIXEL:
      element = new MapElementSizePixel(size);
      break;
    case METER:
      element = new MapElementSizeMeter(size);
      break;
    case CASES:
View Full Code Here


    battle.addPropertyChangeListener(listener);

    Point position = new Point(5, 5);
    Color color = Color.GREEN;
    MapElementSize width = new MapElementSizeMeter(6.0);
    MapElementSize height = new MapElementSizePixel(42.0);

    RectangleElement rectangle = new RectangleElement(position, color,
        width, height);

    Collection<UniqueID> elementsOnMap = battle.getElements();
View Full Code Here

  @Test(timeout = 5000)
  public void testMapElement() {
    Long waitingTime = 1000L;

    MapElementSize width = new MapElementSizePixel(20.0);
    MapElementSize height = new MapElementSizePixel(20.0);
    Point position = new Point(0, 0);

    RectangleElement targetRectangle = new RectangleElement(position,
        Color.RED, width, height);
View Full Code Here

  @Test(timeout = 5000)
  public void testMapElementMove() {
    Long waitingTime = 1000L;

    MapElementSize width = new MapElementSizePixel(20.0);
    MapElementSize height = new MapElementSizePixel(20.0);
    Point position = new Point(0, 0);

    RectangleElement targetRectangle = new RectangleElement(position,
        Color.RED, width, height);
View Full Code Here

  @Test(timeout = 5000)
  public void testRectangleSelection() {
    MapBean battle = getBattle();

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

    RectangleElement targetRectangle = new RectangleElement(position,
        Color.RED, width, height);
    MapElementFactory.buildMapElement(targetRectangle, battle);
View Full Code Here

  @Test(timeout = 5000)
  public void testRectangle() {
    MapBean battle = getBattle();

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

    RectangleElement targetRectangle = new RectangleElement(position,
        Color.RED, width, height);
    MapElementFactory.buildMapElement(targetRectangle, battle);

    RectangleElement rectangle = CampaignClient.getInstance().getBean(
        targetRectangle.getId(), 300L);

    assertEquals("The position should be equals", position,
        rectangle.getPosition());
    assertEquals("The color should be equals", Color.RED,
        rectangle.getColor());
    assertEquals("The angle should be equals", Double.valueOf(0),
        rectangle.getAngle());
    assertEquals("The width should be equals", width.getPixels(battle
        .getScale()), rectangle.getWidth().getPixels(battle.getScale()));
    assertEquals("The height should be equals", height.getPixels(battle
        .getScale()), rectangle.getHeight()
        .getPixels(battle.getScale()));

    MapElementSize newWidth = new MapElementSizeSquare(2.0);
    MapElementSize newHeight = new MapElementSizeSquare(3.0);
View Full Code Here

  public void testCircle() {
    Long waitingTime = 1000L;
    MapBean battle = CampaignClient.getInstance().getBean(battleId,
        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());
View Full Code Here

TOP

Related Classes of net.alteiar.beans.map.size.MapElementSizePixel

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.