ballworld.view
Interface IModelControlAdapter


public interface IModelControlAdapter

Adapter that the view uses to communicate to the model for non-repetitive control tasks such as manipulating strategies.

Author:
swong

Method Summary
 java.lang.Object addPaintStrategy(java.lang.String text)
          Converts a paint strategy's class name in the form of a string, into an object that can be placed onto the paint strategy drop list
 java.lang.Object addStrategy(java.lang.String classname)
          Take the given short strategy name and return a corresponding something to put onto both drop lists.
 void clearBalls()
          Clear all the balls from the system
 java.lang.Object combineStrategies(java.lang.Object selectedItem1, java.lang.Object selectedItem2)
          Return a new object to put on both lists, given two items from the lists.
 void makeBall(java.lang.Object selectedItem1, java.lang.Object selectedObject2)
          Make a ball with the selected short update and paint strategy names.
 void makeSwitcherBall()
          Make a switcher ball
 void switchStrategy(java.lang.Object selectedItem)
          Switch the switcher strategy's decoree to the strategy denoted by the given item
 

Method Detail

addStrategy

java.lang.Object addStrategy(java.lang.String classname)
Take the given short strategy name and return a corresponding something to put onto both drop lists.

Parameters:
classname - The shortened class name of the desired strategy
Returns:
Something to put onto both the drop lists.

makeBall

void makeBall(java.lang.Object selectedItem1,
              java.lang.Object selectedObject2)
Make a ball with the selected short update and paint strategy names.

Parameters:
selectedItem1 - A shorten class name for the desired update strategy
selectedObject2 - A shorten class name for the desired paint strategy

combineStrategies

java.lang.Object combineStrategies(java.lang.Object selectedItem1,
                                   java.lang.Object selectedItem2)
Return a new object to put on both lists, given two items from the lists.

Parameters:
selectedItem1 - An object from one drop list
selectedItem2 - An object from the other drop list
Returns:
An object to put back on both lists.

switchStrategy

void switchStrategy(java.lang.Object selectedItem)
Switch the switcher strategy's decoree to the strategy denoted by the given item

Parameters:
selectedItem - An object from the top drop list to use as the new switcher decoree.

makeSwitcherBall

void makeSwitcherBall()
Make a switcher ball


clearBalls

void clearBalls()
Clear all the balls from the system


addPaintStrategy

java.lang.Object addPaintStrategy(java.lang.String text)
Converts a paint strategy's class name in the form of a string, into an object that can be placed onto the paint strategy drop list

Parameters:
text - The text from the user's input (text field)
Returns:
An object to put onto the paint strategy drop list.