|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y25.view.Graph25DView
Displays and navigates a Graph25D
.
Usually, this class is used in the following way:
// 1. create a Graph25D Graph25D graph25d = new Graph25D(); // 2. create a Graph25DView and associate view modes with it Graph25DView view25d = new Graph25DView(); view25d.setGraph25D(graph25d); view25d.addViewMode25D(new NavigationMode25D()); // 3. create a panel and put the view inside JPanel panel = new JPanel(); panel.add(view25d.getGLCanvas());
Field Summary | |
protected Animator |
animator
The animator that drives the redraw of the entire scene every frame. |
protected Camera |
camera
Handles the viewing transform. |
protected GLCanvas |
glCanvas
The OpenGL canvas that this view uses for rendering. |
protected Graph25D |
graph25D
A reference to the graph that is displayed. |
protected LinkedList |
viewModes
Stores the view modes associated with this view. |
Constructor Summary | |
Graph25DView()
Creates an empty Graph25DView . |
Method Summary | |
void |
addViewMode25D(ViewMode25D vm)
Adds the given view mode to this view and makes it active. |
void |
display(GLAutoDrawable drawable)
Renders the scene into the given drawable. |
void |
displayChanged(GLAutoDrawable drawable,
boolean modeChanged,
boolean deviceChanged)
Currently, this method is empty. |
protected void |
displayGraph25D(GLAutoDrawable drawable)
Renders the Graph25D that is associated with this view
into the given drawable. |
protected void |
displayGraph2D(GLAutoDrawable drawable,
Graph2D g2D)
Renders a Graph2D into the given drawable. |
protected void |
displayGraph2DLayer(GLAutoDrawable drawable,
Graph2D g2D)
Renders the layer representation of the given Graph2D into
the given drawable. |
Camera |
getCamera()
Returns the camera this view uses for displaying the scene. |
GLCanvas |
getGLCanvas()
Returns the OpenGL canvas this view renders into. |
Graph25D |
getGraph25D()
Returns the graph that is displayed in this view. |
BufferedImage |
getPicture()
Takes a screenshot of the current view and returns it. |
Iterator |
getViewModes()
Returns an interator to all view modes that have been added to this view. |
void |
init(GLAutoDrawable drawable)
Initializes the view. |
void |
reshape(GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
Adjusts camera parameters when the canvas this view renders into is resized. |
void |
setActiveViewMode(ViewMode25D vm)
Sets the given view mode as the active view mode. |
void |
setGraph25D(Graph25D g)
Sets the graph that is displayed in this view. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected GLCanvas glCanvas
protected Animator animator
protected Camera camera
protected LinkedList viewModes
protected Graph25D graph25D
Constructor Detail |
public Graph25DView()
Graph25DView
.
Method Detail |
public GLCanvas getGLCanvas()
public Camera getCamera()
public void setGraph25D(Graph25D g)
public Graph25D getGraph25D()
null
if no graph is associated with the view.
public BufferedImage getPicture()
public void init(GLAutoDrawable drawable)
Sets the standard lights, whether or not to use antialiasing and various other OpenGL states.
This method does not have to be called directly, since that is handled by the Java OpenGL system.
init
in interface GLEventListener
GLEventListener.init(javax.media.opengl.GLAutoDrawable)
public void display(GLAutoDrawable drawable)
This method does not have to be called directly, since that is handled by the Java OpenGL system.
display
in interface GLEventListener
GLEventListener.display(javax.media.opengl.GLAutoDrawable)
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
This method does not have to be called directly, since that is handled by the Java OpenGL system.
reshape
in interface GLEventListener
GLEventListener.reshape(javax.media.opengl.GLAutoDrawable,
int, int, int, int)
public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged)
This method does not have to be called directly, since that is handled by the Java OpenGL system.
displayChanged
in interface GLEventListener
GLEventListener.displayChanged(javax.media.opengl.GLAutoDrawable,
boolean, boolean)
protected void displayGraph25D(GLAutoDrawable drawable)
Graph25D
that is associated with this view
into the given drawable.
For rendering individual Graph2D
s, this method calls
displayGraph2D()
. Layers are rendered through a
call to displayGraph2DLayer()
.
protected void displayGraph2D(GLAutoDrawable drawable, Graph2D g2D)
Graph2D
into the given drawable.
protected void displayGraph2DLayer(GLAutoDrawable drawable, Graph2D g2D)
Graph2D
into
the given drawable.
public void addViewMode25D(ViewMode25D vm)
There can only be one active view mode at a time.
public Iterator getViewModes()
public void setActiveViewMode(ViewMode25D vm)
There can only be one active view mode at a time.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |