camera3d.gui
Class ViewportWindowManager

java.lang.Object
  extended bycamera3d.gui.ViewportWindowManager
All Implemented Interfaces:
SceneObjectsChangeListener, VcObjectChangeListener

public final class ViewportWindowManager
extends java.lang.Object
implements SceneObjectsChangeListener, VcObjectChangeListener

This class manages all ViewportInternalCombos present at the application. One of its responsibilities is notifying the ViewportInternalCombos of changes in the number of VcViews of the scene.

Author:
Fábio Roberto de Miranda, Carlos da Silva dos Santos

Constructor Summary
ViewportWindowManager(javax.swing.JDesktopPane desktop, J3DBase base, GUIControl guiControl)
           
ViewportWindowManager(javax.swing.JDesktopPane desktop, J3DBase base, GUIControl guiControl, SelectionList list)
           
 
Method Summary
 void addViewport(VcView view)
          Adds a new viewport window to workspace.
 void disableMessageInAllViewports()
           
 void enableMessageInAllViewports(java.lang.String s)
           
 java.util.List getListOfFrames()
          Returns a list of active ViewportFrames
 int getNumberOfViewports()
          Returns the number of active viewports
 Viewport getViewportByLabel(java.lang.String viewName)
          Returns a reference to a viewport given its name.
 void moveViewportToFront(Viewport viewport)
          Moves input Viewport to front.
 void printListOfViews()
           
 void sceneObjectsChanged(SceneObjectsChangedEvent event)
          Method from SceneObjectsChangeListener interface.
 void setCursorInViewports(TransformType type)
           
 void setPickingInViewports(boolean pickEnable)
           
 void setSelectionList(SelectionList list)
           
 void setViewInViewport(int viewportIndex, VcView view)
          Changes the view shown by a certain viewport.
 void setViewportLocation(int viewportIndex, boolean internal, int x, int y, int width, int height)
           
 void setViewportsEventHandler(ViewportsEventHandler handler)
           
 void vcObjectChanged(VcObjectEvent event)
          Method from VcObjectChangeListener interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewportWindowManager

public ViewportWindowManager(javax.swing.JDesktopPane desktop,
                             J3DBase base,
                             GUIControl guiControl)

ViewportWindowManager

public ViewportWindowManager(javax.swing.JDesktopPane desktop,
                             J3DBase base,
                             GUIControl guiControl,
                             SelectionList list)
Method Detail

setViewportsEventHandler

public void setViewportsEventHandler(ViewportsEventHandler handler)

setViewInViewport

public void setViewInViewport(int viewportIndex,
                              VcView view)
Changes the view shown by a certain viewport.

Parameters:
viewportIndex - index of viewport whose view will be changed.
view - new view to be shown by viewport. Must be non null.
Throws:
java.lang.IndexOutOfBoundsException - if viewportIndex is invalid.

moveViewportToFront

public void moveViewportToFront(Viewport viewport)
Moves input Viewport to front.


addViewport

public void addViewport(VcView view)
Adds a new viewport window to workspace.

Parameters:
view - VcView that will be shown by new viewport window.

getNumberOfViewports

public int getNumberOfViewports()
Returns the number of active viewports


getListOfFrames

public java.util.List getListOfFrames()
Returns a list of active ViewportFrames


setViewportLocation

public void setViewportLocation(int viewportIndex,
                                boolean internal,
                                int x,
                                int y,
                                int width,
                                int height)

sceneObjectsChanged

public void sceneObjectsChanged(SceneObjectsChangedEvent event)
Method from SceneObjectsChangeListener interface. ViewportWindowManager will only care about addition/removal of VcView objects. Then it will propagate the changes to the viewports.

Specified by:
sceneObjectsChanged in interface SceneObjectsChangeListener
Parameters:
event - signals changes in the scene graph.

vcObjectChanged

public void vcObjectChanged(VcObjectEvent event)
Method from VcObjectChangeListener interface. Necessary to filter changes made to VcView objects and propagate them to viewport windows.

Specified by:
vcObjectChanged in interface VcObjectChangeListener
Parameters:
event - Signals changes made to objects in the scene graph.

printListOfViews

public void printListOfViews()

getViewportByLabel

public Viewport getViewportByLabel(java.lang.String viewName)
Returns a reference to a viewport given its name. If there is no viewport whose name coincides with the input parameter the method returns null;

Parameters:
viewName - name of the view to be retrieved.
Returns:
a reference to the viewport if it exists, null otherwise.

enableMessageInAllViewports

public void enableMessageInAllViewports(java.lang.String s)

setCursorInViewports

public void setCursorInViewports(TransformType type)

disableMessageInAllViewports

public void disableMessageInAllViewports()

setPickingInViewports

public void setPickingInViewports(boolean pickEnable)

setSelectionList

public void setSelectionList(SelectionList list)


Copyright © 2001-2003 F.R. Miranda, C.S. Santos, J.E. Kogler Jr.. All Rights Reserved.