de.uka.algo.GT3D
Class VisualizationFramework

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by de.uka.algo.GT3D.VisualizationFramework
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class VisualizationFramework
extends javax.swing.JFrame
implements java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseMotionListener, java.awt.event.MouseListener, java.awt.event.MouseWheelListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  int aimTolerance
           
private  javax.media.j3d.Canvas3D c3d
           
private  javax.swing.JButton cameraInfo
           
private  javax.vecmath.Matrix3d camHeading
           
private  javax.vecmath.Vector3d camPosition
           
(package private)  java.awt.Point canvasTopLeft
           
private  javax.swing.JLabel coordLabel
           
(package private)  double cosmX
           
(package private)  double cosmY
           
(package private)  double cosmZ
           
private  int currentPressedKey
           
private  javax.vecmath.Vector3d dazuPosition
           
private  javax.media.j3d.TransformGroup flyingCamera
           
private  javax.swing.JButton invertMouseY
           
private  double keyRollFactor
           
private  double knueppelSensitivity
           
private  double lookSensitivity
           
private  javax.swing.JLabel messageLabel
           
private  javax.media.j3d.Transform3D moveCamera
           
private  double moveSensitivity
           
private  double mWheelRollFactor
           
(package private)  double mX
           
(package private)  double mY
           
(package private)  double mZ
           
(package private)  java.lang.String navFile
           
private  com.sun.j3d.utils.picking.PickCanvas pickCanvas
           
(package private)  boolean playOn
           
(package private)  boolean recordOn
           
(package private)  double refX
           
(package private)  double refY
           
(package private) static int resolutionX
           
(package private) static int resolutionY
           
private  javax.vecmath.Matrix3d rotMatX
           
private  javax.vecmath.Matrix3d rotMatY
           
private  javax.vecmath.Matrix3d rotMatYtoMinusZ
           
private  javax.vecmath.Matrix3d rotMatZ
           
private  javax.media.j3d.BranchGroup scene
           
(package private)  double sinmX
           
(package private)  double sinmY
           
(package private)  double sinmZ
           
private  javax.vecmath.Vector3d startPosition
           
private  javax.vecmath.Matrix3d startRotation
           
(package private)  java.io.BufferedReader statsRead
           
(package private)  java.io.BufferedWriter statsWrite
           
private  boolean steuerKnueppelMode
           
private  javax.vecmath.Vector3f tempRotAxis
           
(package private)  java.awt.Robot theRobot
          Used for moving the cursor to the center when reset key is pressed
private  javax.swing.Timer timer
           
private  int timerMillis
           
(package private)  int tourCounter
           
private  javax.vecmath.Matrix3d unitMatrix3D
           
private  com.sun.j3d.utils.universe.ViewingPlatform vPlatform
           
(package private)  double Ysign
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
VisualizationFramework(java.awt.event.KeyListener kl)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
private  void addStatsToNavFile()
           
private  boolean getNextStepData()
           
private  void initializeNavFile()
           
 void keyEvaluation(int keyNumber)
          interprets user input and performs calculations
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent m)
           
 void mouseDragged(java.awt.event.MouseEvent m)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent m)
           
 void mousePressed(java.awt.event.MouseEvent m)
           
 void mouseReleased(java.awt.event.MouseEvent m)
           
 void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
           
 void printCameraStats()
           
private  java.lang.String printVector(javax.vecmath.Vector3d vec, int decDig, int fracDig)
           
 void resetPosAndHeading()
           
private  void rotMatReset()
          resets the camera heading
 void setRoot(javax.media.j3d.BranchGroup rootNode)
          inserts a root node of a 3d scene into a freshly created universe.
 void setStartPosition(javax.vecmath.Vector3d startPos)
           
 void start()
           
private  void tourPlay()
           
private  void tourRecord()
           
private  void updateCameraTransformation(java.awt.Point mousePoint)
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

c3d

private javax.media.j3d.Canvas3D c3d

cameraInfo

private javax.swing.JButton cameraInfo

invertMouseY

private javax.swing.JButton invertMouseY

messageLabel

private javax.swing.JLabel messageLabel

coordLabel

private javax.swing.JLabel coordLabel

currentPressedKey

private int currentPressedKey

timer

private javax.swing.Timer timer

timerMillis

private int timerMillis

recordOn

boolean recordOn

playOn

boolean playOn

tourCounter

int tourCounter

navFile

java.lang.String navFile

statsWrite

java.io.BufferedWriter statsWrite

statsRead

java.io.BufferedReader statsRead

flyingCamera

private javax.media.j3d.TransformGroup flyingCamera

moveCamera

private javax.media.j3d.Transform3D moveCamera

vPlatform

private com.sun.j3d.utils.universe.ViewingPlatform vPlatform

pickCanvas

private com.sun.j3d.utils.picking.PickCanvas pickCanvas

scene

private javax.media.j3d.BranchGroup scene

aimTolerance

private int aimTolerance

lookSensitivity

private double lookSensitivity

knueppelSensitivity

private double knueppelSensitivity

moveSensitivity

private double moveSensitivity

keyRollFactor

private double keyRollFactor

mWheelRollFactor

private double mWheelRollFactor

steuerKnueppelMode

private boolean steuerKnueppelMode

camHeading

private javax.vecmath.Matrix3d camHeading

camPosition

private javax.vecmath.Vector3d camPosition

rotMatX

private javax.vecmath.Matrix3d rotMatX

rotMatY

private javax.vecmath.Matrix3d rotMatY

rotMatZ

private javax.vecmath.Matrix3d rotMatZ

unitMatrix3D

private javax.vecmath.Matrix3d unitMatrix3D

rotMatYtoMinusZ

private javax.vecmath.Matrix3d rotMatYtoMinusZ

startRotation

private javax.vecmath.Matrix3d startRotation

dazuPosition

private javax.vecmath.Vector3d dazuPosition

startPosition

private javax.vecmath.Vector3d startPosition

tempRotAxis

private javax.vecmath.Vector3f tempRotAxis

mX

double mX

cosmX

double cosmX

sinmX

double sinmX

mY

double mY

cosmY

double cosmY

sinmY

double sinmY

mZ

double mZ

cosmZ

double cosmZ

sinmZ

double sinmZ

refX

double refX

refY

double refY

canvasTopLeft

java.awt.Point canvasTopLeft

Ysign

double Ysign

resolutionX

static int resolutionX

resolutionY

static int resolutionY

theRobot

java.awt.Robot theRobot
Used for moving the cursor to the center when reset key is pressed

Constructor Detail

VisualizationFramework

public VisualizationFramework(java.awt.event.KeyListener kl)
                       throws java.awt.AWTException
Parameters:
kl - A key listener that will get all key events for the window
Throws:
java.awt.AWTException
Method Detail

setRoot

public void setRoot(javax.media.j3d.BranchGroup rootNode)
inserts a root node of a 3d scene into a freshly created universe.

Parameters:
rootNode - The root of the scene to insert.

rotMatReset

private void rotMatReset()
resets the camera heading


keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyEvaluation

public void keyEvaluation(int keyNumber)
interprets user input and performs calculations

Parameters:
keyNumber - The code of the currently pressed key.

addStatsToNavFile

private void addStatsToNavFile()

initializeNavFile

private void initializeNavFile()

tourRecord

private void tourRecord()

tourPlay

private void tourPlay()

resetPosAndHeading

public void resetPosAndHeading()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

getNextStepData

private boolean getNextStepData()
                         throws java.io.IOException
Throws:
java.io.IOException

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent m)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent m)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

updateCameraTransformation

private void updateCameraTransformation(java.awt.Point mousePoint)

printVector

private java.lang.String printVector(javax.vecmath.Vector3d vec,
                                     int decDig,
                                     int fracDig)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent m)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

printCameraStats

public void printCameraStats()

mousePressed

public void mousePressed(java.awt.event.MouseEvent m)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent m)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Specified by:
mouseWheelMoved in interface java.awt.event.MouseWheelListener

setStartPosition

public void setStartPosition(javax.vecmath.Vector3d startPos)

start

public void start()