|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
TurtleWorld
Class to represent a 2d world that can hold turtles and display them Copyright Georgia Institute of Technology 2004
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
TurtleWorld()
Constructor that takes no arguments |
Method Summary | |
void |
addModel(Object model)
Method to add a model to this model displayer |
boolean |
containsTurtle(Turtle turtle)
Method to check if this world contains the passed turtle |
int |
getHeight()
Method to get the height in pixels |
Turtle |
getLastTurtle()
Metod to get the last turtle in this world |
int |
getWidth()
Method to get the width in pixels |
void |
modelChanged()
Method that allows the model to notify the display |
void |
paintComponent(Graphics g)
Method to paint this component |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ModelDisplay |
clearBackground, getGraphics, remove |
Constructor Detail |
public TurtleWorld()
Method Detail |
public void paintComponent(Graphics g)
g
- the graphics contextpublic Turtle getLastTurtle()
public void addModel(Object model)
addModel
in interface ModelDisplay
model
- the model object to addpublic boolean containsTurtle(Turtle turtle)
public int getWidth()
getWidth
in interface ModelDisplay
public int getHeight()
getHeight
in interface ModelDisplay
public void modelChanged()
modelChanged
in interface ModelDisplay
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |