de.grogra.imp3d
Class View3D

java.lang.Object
  extended by de.grogra.pf.ui.PanelDecorator
      extended by de.grogra.imp.View
          extended by de.grogra.imp3d.View3D
All Implemented Interfaces:
ViewConfig3D, Manageable, SharedObjectReference, Context, Panel, Disposable, ModifiableMap.Producer, java.util.EventListener, javax.swing.event.TreeModelListener

public class View3D
extends View
implements SharedObjectReference, ViewConfig3D

A View3D is a View which displays a graph as a 3D structure.

Author:
Ole Kniemeyer

Nested Class Summary
static class View3D.Type
           
 
Nested classes/interfaces inherited from class de.grogra.imp.View
View.SceneListener
 
Nested classes/interfaces inherited from interface de.grogra.util.EventListener
EventListener.Bicast, EventListener.Multicaster
 
Field Summary
static View3D.Type $TYPE
           
static SCOType.Field camera$FIELD
           
protected  CanvasCamera canvasCam
           
static UIProperty DISPLAY
           
static IOFlavor FLAVOR
           
static java.lang.String INITIAL_CAMERA
           
static SCOType.Field navigator$FIELD
           
static UIProperty TOOL
           
 
Fields inherited from class de.grogra.imp.View
COMPONENT, epsilon$FIELD, graphDescriptor$FIELD, I18N, listeners, LOD_MAX, LOD_MIN, LOD_TYPE, magnitude$FIELD, SCALE_COUNT, SCALES_CHANGED, SCALES_VISIBLE, visibleLayers$FIELD, visibleScales$FIELD, visualEpsilon$FIELD
 
Fields inherited from class de.grogra.pf.ui.PanelDecorator
decorator, panel
 
Fields inherited from interface de.grogra.pf.ui.Panel
DEC_WAIT_CURSOR, DEFAULT_CURSOR, INC_WAIT_CURSOR, INHERIT_CURSOR, PANEL_ID, WAIT_CURSOR
 
Constructor Summary
View3D()
           
 
Method Summary
protected  ViewEventHandler createEventHandler()
           
 void dolly(int dx, int dy)
           
 void dollyOrZoom(int dx, int dy)
           
 float estimateScaleAt(float x, float y, float z, Matrix4d t)
           
 float estimateScaleAt(Tuple3d p, Matrix4d t)
           
 float estimateScaleAt(Tuple3f p, Matrix4d t)
           
 void eventOccured(java.util.EventObject e)
          This method is invoked on registered event listeners when event has occured.
 Camera getCamera()
           
 CanvasCamera getCanvasCamera()
           
static Light getDefaultLight(Camera camera, Matrix4d lightToWorld)
          Computes a default light to use when a scene contains no lights.
 Light getDefaultLight(Matrix4d lightToWorld)
          Computes a default light to use when a scene contains no lights.
static View3D getDefaultView(Context ctx)
           
static ViewConfig3D getDefaultViewConfig(Context ctx)
           
 IOFlavor getFlavor()
           
 ManageableType getManageableType()
           
 Navigator3DFactory getNavigator()
           
static Selectable getSelectableCamera(Context ctx)
           
protected  UIProperty getToolProperty()
           
protected  void initialize(Panel panel, Map params)
           
protected  void installImpl()
           
 boolean isToolGraph(Graph graph)
           
 void move(int dx, int dy)
           
 void pick(int x, int y, PickList list)
           
 void repaint()
           
 void rotate(int dx, int dy)
           
 void setCameraTransformation(Matrix4d transformation)
           
 void setExtent(Tuple3f center, float radius)
          This callback method should be invoked by the 3D-ViewComponent which displays the scene in order to inform this View3D about the geometrical extent of the whole scene.
 void setNavigator(Navigator3DFactory value)
           
 void sharedObjectModified(Shareable object, Transaction t)
           
protected  void uninstallImpl()
           
static ViewConfig3D withCamera(ViewConfig3D v, Camera c)
           
 
Methods inherited from class de.grogra.imp.View
addEventListener, addMappings, create, dispose, disposeRenderer, fieldModified, get, get, getActiveTool, getEpsilon, getEpsilonSquared, getEventHandler, getGraph, getMagnitude, getMagnitudeSquared, getPathFor, getSelectableGraph, getSelectableLayers, getSelectableScales, getSize, getStamp, getViewComponent, getViewComponent, getVisibleScales, getVisualEpsilon, getVisualEpsilonSquared, getWorkbenchGraphState, isInVisibleLayer, manageableReadResolve, manageableWriteReplace, removeEventListener, render, renderToFile, repaint, set, setActiveTool, setDimensions, setDimensions, setEpsilon, setGraph, setGraph, setMagnitude, setViewComponent, setVisualEpsilon, substituteSelection, treeNodesChanged, treeNodesInserted, treeNodesRemoved, treeStructureChanged, uninstall
 
Methods inherited from class de.grogra.pf.ui.PanelDecorator
checkClose, getComponent, getContent, getDecorator, getMenu, getPanel, getPanelId, getUIPropertyMap, getWindow, getWorkbench, initDecorator, initPanel, resolve, setContent, setCursor, setMenu, show
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.grogra.imp3d.ViewConfig3D
getEpsilon, getGraph, getWorkbench, isInVisibleLayer
 

Field Detail

$TYPE

public static final View3D.Type $TYPE

camera$FIELD

public static final SCOType.Field camera$FIELD

canvasCam

protected CanvasCamera canvasCam

DISPLAY

public static final UIProperty DISPLAY

FLAVOR

public static final IOFlavor FLAVOR

INITIAL_CAMERA

public static final java.lang.String INITIAL_CAMERA
See Also:
Constant Field Values

navigator$FIELD

public static final SCOType.Field navigator$FIELD

TOOL

public static final UIProperty TOOL
Constructor Detail

View3D

public View3D()
Method Detail

createEventHandler

protected ViewEventHandler createEventHandler()
Specified by:
createEventHandler in class View

dolly

public void dolly(int dx,
                  int dy)

dollyOrZoom

public void dollyOrZoom(int dx,
                        int dy)

estimateScaleAt

public float estimateScaleAt(float x,
                             float y,
                             float z,
                             Matrix4d t)

estimateScaleAt

public float estimateScaleAt(Tuple3d p,
                             Matrix4d t)

estimateScaleAt

public float estimateScaleAt(Tuple3f p,
                             Matrix4d t)

eventOccured

public void eventOccured(java.util.EventObject e)
Description copied from interface: EventListener
This method is invoked on registered event listeners when event has occured. This general listener interface does not restrict the possible kinds of events. Concrete sources of events should specify which events they may fire.

Overrides:
eventOccured in class View
Parameters:
e - an event

getCamera

public Camera getCamera()
Specified by:
getCamera in interface ViewConfig3D

getCanvasCamera

public CanvasCamera getCanvasCamera()

getDefaultLight

public static Light getDefaultLight(Camera camera,
                                    Matrix4d lightToWorld)
Computes a default light to use when a scene contains no lights.

Parameters:
camera - used camera
lightToWorld - the computed transformation for the light is placed in here
Returns:
a default light

getDefaultLight

public Light getDefaultLight(Matrix4d lightToWorld)
Description copied from interface: ViewConfig3D
Computes a default light to use when a scene contains no lights.

Specified by:
getDefaultLight in interface ViewConfig3D
Parameters:
lightToWorld - the computed transformation for the light is placed in here
Returns:
a default light

getDefaultView

public static View3D getDefaultView(Context ctx)

getDefaultViewConfig

public static ViewConfig3D getDefaultViewConfig(Context ctx)

getFlavor

public IOFlavor getFlavor()
Specified by:
getFlavor in class View

getManageableType

public ManageableType getManageableType()
Specified by:
getManageableType in interface Manageable

getNavigator

public Navigator3DFactory getNavigator()

getSelectableCamera

public static Selectable getSelectableCamera(Context ctx)

getToolProperty

protected UIProperty getToolProperty()
Specified by:
getToolProperty in class View

initialize

protected void initialize(Panel panel,
                          Map params)
Overrides:
initialize in class View

installImpl

protected void installImpl()
Specified by:
installImpl in class View

isToolGraph

public boolean isToolGraph(Graph graph)
Specified by:
isToolGraph in class View

move

public void move(int dx,
                 int dy)

pick

public final void pick(int x,
                       int y,
                       PickList list)
Specified by:
pick in class View

repaint

public void repaint()

rotate

public void rotate(int dx,
                   int dy)

setCameraTransformation

public void setCameraTransformation(Matrix4d transformation)

setExtent

public void setExtent(Tuple3f center,
                      float radius)
This callback method should be invoked by the 3D-ViewComponent which displays the scene in order to inform this View3D about the geometrical extent of the whole scene. center and radius should define a bounding sphere (or at least an approximation thereof) of all visible finite objects in view coordinates, i.e., after Camera.getWorldToViewTransformation() has been applied.

Parameters:
center - center of bounding sphere
radius - radius of bounding sphere

setNavigator

public void setNavigator(Navigator3DFactory value)

sharedObjectModified

public void sharedObjectModified(Shareable object,
                                 Transaction t)
Specified by:
sharedObjectModified in interface SharedObjectReference

uninstallImpl

protected void uninstallImpl()
Specified by:
uninstallImpl in class View

withCamera

public static ViewConfig3D withCamera(ViewConfig3D v,
                                      Camera c)