Package net.edzard.kinetic

Examples of net.edzard.kinetic.Circle


    stage.add(layer);
  }

  public void testCreationZOrder() {
    for (int i=0; i < 3; ++i) {
      Circle c = Kinetic.createCircle(new Vector2d(10,10), 5);
      layer.add(c);
      assertEquals(i, c.getZIndex())
    }
  } 
View Full Code Here


   */
  // TODO: does not work with current test system setup
  public void testIntersects() {
   
    // Create a circle
    Circle c = Kinetic.createCircle(origin, radius);
    layer.add(c);
    stage.draw()// TODO: This has an issue
   
    // Check for a point in the circle
    assertTrue("Point should intersect shape", c.intersects(origin))// TODO: As well as this
   
    // Check for a point outside of the circle
    assertFalse("Point should not intersect shape", c.intersects(outlier));
 
View Full Code Here

  public void testGetChildren() { 
       
    // Create a group
    final Group group = Kinetic.createGroup();
   
    final Circle c1 = Kinetic.createCircle(origin1, radius);
    c1.setName(name1);
    group.add(c1);
   
    final Circle c2 = Kinetic.createCircle(origin2, radius);
    c2.setName(name2);
    group.add(c2);
   
    layer.add(group);
    stage.draw();
   
View Full Code Here

  private Vector2d pos1 = new Vector2d(100,100);
  private Vector2d pos2 = new Vector2d(111,111);
 
  public void testAnimatingPosition() {
   
    final Circle e = Kinetic.createCircle(pos1, 10);
   
    final Animation animation = Kinetic.createAnimation(layer, new Drawable() {
      @Override
      public void draw(Frame frame) {
        e.setPosition(pos2);
        assertEquals("Position cannot be set", pos2, e.getPosition());
      }
    });
   
    assertEquals("Position cannot be set", pos1, e.getPosition());
    animation.start();
    layer.draw();
    animation.stop();
    assertEquals("Animated position does not match", pos2, e.getPosition());
 
View Full Code Here

TOP

Related Classes of net.edzard.kinetic.Circle

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.