|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvisad.MouseHelper
public class MouseHelper
MouseHelper is the VisAD helper class for MouseBehaviorJ3D and MouseBehaviorJ2D.
MouseHelper is preferred by cats everywhere.
Field Summary | |
---|---|
static int |
CENTER
|
static int |
CURSOR_ROTATE
|
static int |
CURSOR_TRANSLATE
|
static int |
CURSOR_ZOOM
|
static int |
DIRECT
|
static int |
LEFT
|
static int |
NFUNCTIONS
|
static int |
NONE
|
static int |
RIGHT
|
static int |
ROTATE
|
static int |
TRANSLATE
|
static int |
ZOOM
|
Constructor Summary | |
---|---|
MouseHelper(DisplayRenderer r,
MouseBehavior b)
|
Method Summary | |
---|---|
void |
print_matrix(java.lang.String title,
double[] m)
Print out a readable form of a matrix. |
void |
processEvent(java.awt.AWTEvent event)
Process the given event treating it as a local event. |
void |
processEvent(java.awt.AWTEvent event,
int remoteId)
Process the given event, treating it as coming from a remote source if remote flag is set. |
void |
rendererDeleted(DataRenderer renderer)
Implementation for RendererSourceListener. |
void |
setEnableCombos(boolean e)
Enable/disable the interpretation of any pair of mouse buttons as the third button. |
void |
setFunctionMap(int[][][] map)
Set mapping from (button, ctrl, shift) to function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NONE
public static final int ROTATE
public static final int ZOOM
public static final int TRANSLATE
public static final int CURSOR_TRANSLATE
public static final int CURSOR_ZOOM
public static final int CURSOR_ROTATE
public static final int DIRECT
public static final int NFUNCTIONS
public static final int LEFT
public static final int CENTER
public static final int RIGHT
Constructor Detail |
---|
public MouseHelper(DisplayRenderer r, MouseBehavior b)
Method Detail |
---|
public void processEvent(java.awt.AWTEvent event)
event
- event to process.public void processEvent(java.awt.AWTEvent event, int remoteId)
event
- event to process.remoteId
- id of remote source.public void setEnableCombos(boolean e)
e
- enable/disable. If true (default), interpret any pair
of mouse buttons as the third button.public void setFunctionMap(int[][][] map) throws VisADException
map[button][ctrl][shift] = MouseHelper.NONE for no function MouseHelper.ROTATE for box rotate MouseHelper.ZOOM for box zoom MouseHelper.TRANSLATE for box translate MouseHelper.CURSOR_TRANSLATE for cursor translate MouseHelper.CURSOR_ZOOM for cursor on Z axis (3-D only) MouseHelper.CURSOR_ROTATE for box rotate with cursor MouseHelper.DIRECT for direct manipulate where button = 0 (left), 1 (center), 2 (right) ctrl = 0 (CTRL key not pressed), 1 (CTRL key pressed) shift = 0 (SHIFT key not pressed), 1 (SHIFT key pressed) Note some direct manipulation DataRenderers test the status of CTRL and SHIFT keys, so it is advisable that the DIRECT function be invariant to the state of ctrl and shift in the map array. For example, to set the left mouse button for direct manipulation, and the center button for box rotation (only without shift or control): mouse_helper.setFunctionMap(new int[][][] {{{MouseHelper.DIRECT, MouseHelper.DIRECT}, {MouseHelper.DIRECT, MouseHelper.DIRECT}}, {{MouseHelper.ROTATE, MouseHelper.NONE}, {MouseHelper.NONE, MouseHelper.NONE}}, {{MouseHelper.NONE, MouseHelper.NONE}, {MouseHelper.NONE, MouseHelper.NONE}}});
map
- map of functions. map must be int[3][2][2]
VisADException
- bad mappublic void print_matrix(java.lang.String title, double[] m)
title
- title to prepend to output.m
- matrix to print.public void rendererDeleted(DataRenderer renderer)
rendererDeleted
in interface RendererSourceListener
renderer
- DataRenderer that was deleted.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |