|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgizmoball.GLBoardView
public class GLBoardView
A BoardView that renders the Board using
OpenGL.
TODO: Better specs.
board : Board -
the Board this GLBoardView is in charge
of displaying
gizmoViews : set of GLGizmoViews -
the GLGizmoViews that are required to render
board
selectedGizmo : Gizmo -
a special Gizmo not part of board that
this GLBoardView will render such that it stands out
| Field Summary | |
|---|---|
static String |
rcsid
Class revision identifier. |
| Constructor Summary | |
|---|---|
GLBoardView(javax.media.opengl.GLAutoDrawable drawable)
Creates a new GLBoardView not tracking any
Board. |
|
| Method Summary | |
|---|---|
void |
display(javax.media.opengl.GLAutoDrawable drawable)
|
void |
displayChanged(javax.media.opengl.GLAutoDrawable drawable,
boolean modeChanged,
boolean deviceChanged)
|
void |
init(javax.media.opengl.GLAutoDrawable drawable)
|
void |
redraw()
Redraws the display of the Board. |
void |
reshape(javax.media.opengl.GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
|
void |
setBoard(Board board)
Sets the Board this GLBoardView should be
displaying. |
void |
setSelectedGizmo(Gizmo gizmo)
Sets the selected Gizmo to the given
Gizmo. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String rcsid
rcsid contains an RCS Id
keyword string that may be used to identify which revision of
GLBoardView.java was used to generate an instance of
GLBoardView.class. To identify the revision of a
GLBoardView.class file, run "ident
GLBoardView.class" (ident is part of the RCS
software package).
| Constructor Detail |
|---|
public GLBoardView(javax.media.opengl.GLAutoDrawable drawable)
GLBoardView not tracking any
Board. This GLBoardView will render in
the given GLAutoDrawable.
Eventually, setBoard(gizmoball.Board) should be called so that this
GLBoardView will actually have something to render.
drawable - the GLAutoDrawable this
GLBoardView should render indrawable != nullboard = null and gizmoViews =
the empty set and selectedGizmo = null| Method Detail |
|---|
public void redraw()
Board. This method
updates the display so that the user sees an up-to-date
representation of the Board this
BoardView is displaying.
redraw in interface BoardViewpublic void init(javax.media.opengl.GLAutoDrawable drawable)
init in interface javax.media.opengl.GLEventListenerpublic void display(javax.media.opengl.GLAutoDrawable drawable)
display in interface javax.media.opengl.GLEventListener
public void reshape(javax.media.opengl.GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
reshape in interface javax.media.opengl.GLEventListener
public void displayChanged(javax.media.opengl.GLAutoDrawable drawable,
boolean modeChanged,
boolean deviceChanged)
displayChanged in interface javax.media.opengl.GLEventListenerpublic void setBoard(Board board)
Board this GLBoardView should be
displaying. Also updates various state so that this
GLBoardView is ready to render the new
Board.
This GLBoardView will register itself with the new
Board as a BoardObserver. If
Board was non-null before this
operation, then this GLBoardView will also
deregister itself from the previous Board it was
displaying.
This GLBoardView will also discard the
GLGizmoViews it was previously using (if any), and
generate the new GLGizmoViews necessary to display
the new Board.
board - the Board to be displayed by this
GLBoardViewboard != null this.board = board
gizmoViews updated to reflect the new
this.board
public void setSelectedGizmo(Gizmo gizmo)
Gizmo to the given
Gizmo. The given Gizmo will be rendered
in such a way that it should stand out. Call this method with the
argument null to clear the selected
Gizmo (make it so that no Gizmo is
selected).
gizmo - Gizmo to be selected
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||