gnu.gleem
Class ManipManager

java.lang.Object
  |
  +--gnu.gleem.ManipManager

public class ManipManager
extends java.lang.Object

The ManipManager handles making manipulators visible in a window.


Method Summary
static ManipManager getManipManager()
          This class is a singleton.
 ScreenToRayMapping getScreenToRayMapping()
          Returns the current screen-to-ray mapping.
 void mouseDragged(java.awt.event.MouseEvent e)
          The ManipManager watches for the following events: mouseMoved, mouseDragged, mousePressed, and mouseReleased.
 void mouseMoved(java.awt.event.MouseEvent e)
          The ManipManager watches for the following events: mouseMoved, mouseDragged, mousePressed, and mouseReleased.
 void mousePressed(java.awt.event.MouseEvent e)
          The ManipManager watches for the following events: mouseMoved, mouseDragged, mousePressed, and mouseReleased.
 void mouseReleased(java.awt.event.MouseEvent e)
          The ManipManager watches for the following events: mouseMoved, mouseDragged, mousePressed, and mouseReleased.
 void registerWindow(gl4java.drawable.GLDrawable window)
          Make the ManipManager aware of the existence of a given window.
 void removeManipFromWindow(Manip manip, gl4java.drawable.GLDrawable window)
          Remove a given manipulator from a given window.
 void removeMouseListeners(gl4java.drawable.GLDrawable window)
          Removes the automatically-installed mouse listeners for the given window.
 void render(gl4java.drawable.GLDrawable window, gl4java.GLFunc gl)
          Cause the manipulators for a given window to be drawn.
 void setScreenToRayMapping(ScreenToRayMapping mapping)
          Allows changing of the screen-to-ray mapping.
 void setupMouseListeners(gl4java.drawable.GLDrawable window)
          Sets up a MouseListener and MouseMotionListener for the given window.
 void setWindowUpdateListener(WindowUpdateListener listener)
          Sets the WindowUpdateListener the ManipManager uses to force repainting of windows in which manipulators have moved.
 void showManipInWindow(Manip manip, gl4java.drawable.GLDrawable window)
          Make a given manipulator visible and active in a given window.
 void unregisterWindow(gl4java.drawable.GLDrawable window)
          Remove all references to a given window, including removing all manipulators from it.
 void updateCameraParameters(gl4java.drawable.GLDrawable window, CameraParameters params)
          This must be called for every registered window every time the camera parameters of the window change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getManipManager

public static ManipManager getManipManager()
This class is a singleton. Get the sole instance of the ManipManager.


registerWindow

public void registerWindow(gl4java.drawable.GLDrawable window)
Make the ManipManager aware of the existence of a given window. This causes mouse and mouse motion listeners to be installed on this window; see setupMouseListeners, below.


unregisterWindow

public void unregisterWindow(gl4java.drawable.GLDrawable window)
Remove all references to a given window, including removing all manipulators from it.


showManipInWindow

public void showManipInWindow(Manip manip,
                              gl4java.drawable.GLDrawable window)
Make a given manipulator visible and active in a given window.


removeManipFromWindow

public void removeManipFromWindow(Manip manip,
                                  gl4java.drawable.GLDrawable window)
Remove a given manipulator from a given window.


updateCameraParameters

public void updateCameraParameters(gl4java.drawable.GLDrawable window,
                                   CameraParameters params)
This must be called for every registered window every time the camera parameters of the window change.


setScreenToRayMapping

public void setScreenToRayMapping(ScreenToRayMapping mapping)
Allows changing of the screen-to-ray mapping. Default is a RightTruncPyrMapping.


getScreenToRayMapping

public ScreenToRayMapping getScreenToRayMapping()
Returns the current screen-to-ray mapping.


setWindowUpdateListener

public void setWindowUpdateListener(WindowUpdateListener listener)
Sets the WindowUpdateListener the ManipManager uses to force repainting of windows in which manipulators have moved. The default implementation, which can be restored by passing a null listener argument to this method, calls repaint() on the GLDrawable if it is not a GLRunnable instance (i.e., a GLAnimCanvas or GLAnimJPanel, which redraw themselves automatically).


render

public void render(gl4java.drawable.GLDrawable window,
                   gl4java.GLFunc gl)
Cause the manipulators for a given window to be drawn. The drawing occurs immediately; this routine must be called when an OpenGL context is valid, i.e., from within the display() method of a GLEventListener.


setupMouseListeners

public void setupMouseListeners(gl4java.drawable.GLDrawable window)
Sets up a MouseListener and MouseMotionListener for the given window. Since an application-level MouseListener or MouseMotionListener might want to intercept events and not pass them on to the ManipManager without relying on the ordering of listeners for the canvas (see the ExaminerViewer class), the setupMouseListeners and removeMouseListeners routines, as well as the appropriate delegate routines, are made public here.


removeMouseListeners

public void removeMouseListeners(gl4java.drawable.GLDrawable window)
Removes the automatically-installed mouse listeners for the given window. This allows application code to determine the policy for intercepting mouse events.


mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
The ManipManager watches for the following events: mouseMoved, mouseDragged, mousePressed, and mouseReleased. These routines are exposed so application-level code can intercept events when certain modifier keys are depressed.


mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
The ManipManager watches for the following events: mouseMoved, mouseDragged, mousePressed, and mouseReleased. These routines are exposed so application-level code can intercept events when certain modifier keys are depressed.


mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
The ManipManager watches for the following events: mouseMoved, mouseDragged, mousePressed, and mouseReleased. These routines are exposed so application-level code can intercept events when certain modifier keys are depressed.


mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
The ManipManager watches for the following events: mouseMoved, mouseDragged, mousePressed, and mouseReleased. These routines are exposed so application-level code can intercept events when certain modifier keys are depressed.