Package net.sf.arianne.marboard.server.entity.shape

Examples of net.sf.arianne.marboard.server.entity.shape.Dot


    String rpclass = object.getRPClass().getName();

    if (rpclass.equals("user")) {
      return new User(object);
    } else if (rpclass.equals("dot")) {
      return new Dot(object);
    } else if (rpclass.equals("rectangle")) {
      return new Rectangle(object);
    } else if (rpclass.equals("straight_line")) {
      return new StraightLine(object);
    } else if (rpclass.equals("circle")) {
View Full Code Here


    MarboardZone zone = new MarboardZone("initial_zone");
    super.addRPZone(zone);

    for (int i = 0; i < 20; i++) {
      Shape shape = new Dot(Color.BLACK.getRGB(), i, i * 25 + 25, i * 25 + 25, i);
      zone.add(shape);
    }

    Shape shape = new Dot(Color.RED.getRGB(), 10, 50, 25, 30);
    zone.add(shape);
  }
View Full Code Here

   * @param action the action to be executed
   */
  @Override
  protected void perform(User user, RPAction action) {
    MarboardZone zone = user.getZone();
    Shape shape = new Dot(action.getInt("color"), action.getInt("thickness"), action.getInt("x"), action.getInt("y"));
    zone.add(shape);
  }
View Full Code Here

  @Test
  public void testFixZIndexForShape() {
    MarboardZone zone = new MarboardZone("testFixZIndexForShape");
    MarboardWorld.get().addRPZone(zone);

    Shape shape = new Dot(0, 0, 0, 0);
    assertFalse(shape.has("z"));

    zone.add(shape);
    assertThat(shape.get("z"), equalTo("1"));

    shape = new Dot(2, 2, 2, 2, 20);
    assertTrue(shape.has("z"));

    zone.add(shape);
    assertThat(shape.get("z"), equalTo("20"));

    shape = new Dot(3, 3, 3, 3);
    assertFalse(shape.has("z"));

    zone.add(shape);
    assertThat(shape.get("z"), equalTo("21"));
   
  }
View Full Code Here

  @Test
  public void testFixAllZIndicesForAllOtherShapesAbove() {
    MarboardZone zone = new MarboardZone("testFixAllZIndicesForAllOtherShapesAbove");
    MarboardWorld.get().addRPZone(zone);

    zone.add(new Dot(1, 1, 1, 1, 1));
    zone.add(new Dot(2, 2, 2, 2, 2));
    zone.add(new Dot(4, 4, 4, 4, 3));
    zone.add(new Dot(5, 5, 5, 5, 4));
    zone.add(new Dot(6, 6, 6, 6, 5));

    zone.add(new User("testuser"));
   
    zone.fixAllZIndicesForAllOtherShapesAbove(3, new Dot(3, 3, 3, 3, 3));

    for (RPObject object : zone) {
      assertEquals(object.get("x"), object.get("z"));
    }

    Shape shape = new Dot(7, 7, 7, 7);
    zone.add(shape);
    assertThat(shape.get("z"), equalTo("7"));
  }
View Full Code Here

  @Test
  public void testZIndexOverflow() {
    MarboardZone zone = new MarboardZone("testZIndexOverflow");
    MarboardWorld.get().addRPZone(zone);

    Shape shape = new Dot(1, 1, 1, 1, Integer.MAX_VALUE - 20);
    zone.add(shape);
   
    assertThat(shape.getInt("z"), equalTo(1));
  }
View Full Code Here

TOP

Related Classes of net.sf.arianne.marboard.server.entity.shape.Dot

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.