com.yobotics.simulationconstructionset.util.graphics
Class BagOfBalls

java.lang.Object
  extended by com.yobotics.simulationconstructionset.util.graphics.BagOfBalls

public class BagOfBalls
extends java.lang.Object

Title: BagOfBalls

Description: Class for displaying multiple points in the SCS GUI.

Copyright: Copyright (c) 2006-2009

Company: IHMC

Version:
1.0
Author:
IHMC LearningLocomotion Team

Constructor Summary
BagOfBalls(double sizeInMeters, java.lang.String name, java.util.ArrayList<AppearanceDefinition> appearances, YoVariableRegistry parentYoVariableRegistry, DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
          Creates a BagOfBalls with the size being the same as the number of Appearances given.
BagOfBalls(int numberOfBalls, double sizeInMeters, AppearanceDefinition appearance, YoVariableRegistry parentYoVariableRegistry, DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
           
BagOfBalls(int numberOfBalls, double sizeInMeters, java.lang.String name, AppearanceDefinition appearance, YoVariableRegistry parentYoVariableRegistry, DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
          Creates a BagOfBalls with the given number of balls, and all the balls with the given Appearance.
BagOfBalls(int numberOfBalls, double sizeInMeters, java.lang.String name, YoVariableRegistry parentYoVariableRegistry, DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
           
BagOfBalls(int numberOfBalls, double sizeInMeters, YoVariableRegistry parentYoVariableRegistry, DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
           
BagOfBalls(int numberOfBalls, YoVariableRegistry parentYoVariableRegistry, DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
           
BagOfBalls(YoVariableRegistry parentYoVariableRegistry, DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
           
 
Method Summary
static BagOfBalls createPatrioticBag(int numberOfBalls, double sizeInMeters, java.lang.String name, YoVariableRegistry parentYoVariableRegistry, DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
          Create a Bag of Balls with alternating ball color going through Red, White, and Blue.
static BagOfBalls createRainbowBag(int numberOfBalls, double sizeInMeters, java.lang.String name, YoVariableRegistry parentYoVariableRegistry, DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
          Create a Bag of Balls with alternating ball color going through the cycle of the colors of the rainbow.
 void hideAll()
          Hides all the balls.
 void reset()
          Resets by placing all the balls at (0, 0, 0) and making the first ball be the next ball to place.
 void setBall(FramePoint location)
          Sets the next ball to the given location.
 void setBall(FramePoint location, AppearanceDefinition appearance)
           
 void setBall(FramePoint location, AppearanceDefinition appearance, int ballIndex)
          Sets the next ball to the given location, and gives it the given appearance.
 void setBall(FramePoint location, int ballIndex)
           
 void setBallLoop(FramePoint location)
          Sets the next ball to the given location.
 void setBallLoop(FramePoint location, AppearanceDefinition appearance)
          Sets the next ball to the given location with the given Appearance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BagOfBalls

public BagOfBalls(YoVariableRegistry parentYoVariableRegistry,
                  DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)

BagOfBalls

public BagOfBalls(int numberOfBalls,
                  YoVariableRegistry parentYoVariableRegistry,
                  DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)

BagOfBalls

public BagOfBalls(int numberOfBalls,
                  double sizeInMeters,
                  YoVariableRegistry parentYoVariableRegistry,
                  DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)

BagOfBalls

public BagOfBalls(int numberOfBalls,
                  double sizeInMeters,
                  java.lang.String name,
                  YoVariableRegistry parentYoVariableRegistry,
                  DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)

BagOfBalls

public BagOfBalls(int numberOfBalls,
                  double sizeInMeters,
                  AppearanceDefinition appearance,
                  YoVariableRegistry parentYoVariableRegistry,
                  DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)

BagOfBalls

public BagOfBalls(int numberOfBalls,
                  double sizeInMeters,
                  java.lang.String name,
                  AppearanceDefinition appearance,
                  YoVariableRegistry parentYoVariableRegistry,
                  DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
Creates a BagOfBalls with the given number of balls, and all the balls with the given Appearance.

Parameters:
numberOfBalls - int Number of balls to create.
sizeInMeters - double Size of each ball in meters.
name - String Name of the BagOfBalls
appearance - Appearance for each of the balls.
parentYoVariableRegistry - YoVariableRegistry to register the BagOfBalls with.
dynamicGraphicObjectsListRegistry - DynamicGraphicObjectsListRegistry to register the BagOfBalls with.

BagOfBalls

public BagOfBalls(double sizeInMeters,
                  java.lang.String name,
                  java.util.ArrayList<AppearanceDefinition> appearances,
                  YoVariableRegistry parentYoVariableRegistry,
                  DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
Creates a BagOfBalls with the size being the same as the number of Appearances given.

Parameters:
sizeInMeters - double Size of each ball in meters.
name - String Name of the BagOfBalls
appearances - ArrayList of the Appearance for each of the balls.
parentYoVariableRegistry - YoVariableRegistry to register the BagOfBalls with.
dynamicGraphicObjectsListRegistry - DynamicGraphicObjectsListRegistry to register the BagOfBalls with.
Method Detail

createPatrioticBag

public static BagOfBalls createPatrioticBag(int numberOfBalls,
                                            double sizeInMeters,
                                            java.lang.String name,
                                            YoVariableRegistry parentYoVariableRegistry,
                                            DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
Create a Bag of Balls with alternating ball color going through Red, White, and Blue.

Parameters:
numberOfBalls - int Number of balls to create.
sizeInMeters - double Size of each ball in meters.
name - String Name of the BagOfBalls to create.
parentYoVariableRegistry - YoVariableRegistry to register the BagOfBalls with.
dynamicGraphicObjectsListRegistry - DynamicGraphicObjectsListRegistry to register the BagOfBalls with.
Returns:
BagOfBalls

createRainbowBag

public static BagOfBalls createRainbowBag(int numberOfBalls,
                                          double sizeInMeters,
                                          java.lang.String name,
                                          YoVariableRegistry parentYoVariableRegistry,
                                          DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
Create a Bag of Balls with alternating ball color going through the cycle of the colors of the rainbow.

Parameters:
numberOfBalls - int Number of balls to create.
sizeInMeters - double Size of each ball in meters.
name - String Name of the BagOfBalls to create.
parentYoVariableRegistry - YoVariableRegistry to register the BagOfBalls with.
dynamicGraphicObjectsListRegistry - DynamicGraphicObjectsListRegistry to register the BagOfBalls with.
Returns:
BagOfBalls

setBall

public void setBall(FramePoint location,
                    int ballIndex)

setBall

public void setBall(FramePoint location)
Sets the next ball to the given location. If all the balls have been set, then does nothing.

Parameters:
location - FramePoint to set the next ball to.

setBall

public void setBall(FramePoint location,
                    AppearanceDefinition appearance)

setBall

public void setBall(FramePoint location,
                    AppearanceDefinition appearance,
                    int ballIndex)
Sets the next ball to the given location, and gives it the given appearance. If all the balls have been set, then does nothing.

Parameters:
location - FramePoint to set the next ball to.
appearance - Appearance to give the next ball.

setBallLoop

public void setBallLoop(FramePoint location)
Sets the next ball to the given location. If all the balls have been set, then loops to the first ball.

Parameters:
location - FramePoint to set the next ball to.

setBallLoop

public void setBallLoop(FramePoint location,
                        AppearanceDefinition appearance)
Sets the next ball to the given location with the given Appearance. If all the balls have been set, then loops to the first ball.

Parameters:
location - FramePoint to set the next ball to.
appearance - Appearance to give the next ball.

reset

public void reset()
Resets by placing all the balls at (0, 0, 0) and making the first ball be the next ball to place.


hideAll

public void hideAll()
Hides all the balls.