shout3d.core
Interface Shout3DViewer

All Known Implementing Classes:
Shout3DApplet, Shout3DPanel

public abstract interface Shout3DViewer
extends CoreShout3DViewer

An interface that extends CoreShout3DViewer to have Shout3D-specific features


Method Summary
 boolean addRoute(Field fromField, Field toField)
          Adds a route that copies values from 'fromField' to 'toField' each time that fromField's value changes.
 void clearResourceCaches()
          Clears the cache of loaded resources, freeing the memory that holds them.
 boolean deleteRoute(Field fromField, Field toField)
          Removes any existing route from fromField to toField Returns true if a route existed and was removed, false otherwise
 java.awt.Component getComponent()
          Gets the Java Component in which this viewer is being displayed.
 boolean isAntiAliased()
          Returns whether antialiasing is enabled
 boolean isBilinearFiltering()
          Returns whether bilinear filtering is enabled on textures
 boolean isLoadResourcesInSeparateThread()
          Returns whether resources should are being loaded in a separate thread.
 boolean isPixelDoubling()
          Returns whether pixel doubling is enabled.
 boolean isPixelDoublingSmooth()
          Returns true if pixel doubling is enabled and the style in use is smooth style.
 boolean isRenderLoopPaused()
          Gets whether the rendering loop is currently paused
 boolean isRouted(Field fromField, Field toField)
          Checks if a route currently exists from fromField to toField
 void renderOnce()
          This method will render one frame if the render loop is paused.
 void setAntiAliased(boolean newVal)
          Sets whether antialiasing is enabled.
 void setBilinearFiltering(boolean newVal)
          Sets whether bilinear filtering is enabled on textures.
 void setLoadResourcesInSeparateThread(boolean newVal)
          Sets resources (textures and sounds) should be loaded in a separate thread from the main thread.
 void setPixelDoubling(boolean enabled, boolean useSmoothStyle)
          Sets whether pixel doubling is enabled on the view.
 void setRenderLoopPaused(boolean isPaused)
          Sets whether the rendering loop should be paused
 
Methods inherited from interface shout3d.core.CoreShout3DViewer
getClock, getCurrentBindableNode, getDeviceListener, getNewPicker, getNewSearcher, getNodeByName, getProfile, getRenderer, getResourceListener, getScene, getVersion, loadURL, setScene, setSceneFromURL
 

Method Detail

getComponent

public java.awt.Component getComponent()
Gets the Java Component in which this viewer is being displayed.
Returns:
the Component

addRoute

public boolean addRoute(Field fromField,
                        Field toField)
                 throws Shout3DException
Adds a route that copies values from 'fromField' to 'toField' each time that fromField's value changes. Does not copy the value immediately from fromField to toField. So the values will not be made to match until setValue() is called on fromField. (Note: this behavior was different in prior to Shout3D 1.0.3. In Shout3D 1.0, 1.0.1, and 1.0.2, addRoute() would copy the value from fromField to toField, so the values would match after this call.) Throws a Shout3DException if the two fields are not of the same type. Will not add a second route if a route already exists. Returns true if a route was added, false otherwise
Parameters:
fromField - the field from which values will be copied
toField - the field to which values will be copied
Returns:
true if the route was added, false otherwise

deleteRoute

public boolean deleteRoute(Field fromField,
                           Field toField)
Removes any existing route from fromField to toField Returns true if a route existed and was removed, false otherwise
Parameters:
fromField - the field from which values will be copied
toField - the field to which values will be copied
Returns:
true if the route was removed, false otherwise

isRouted

public boolean isRouted(Field fromField,
                        Field toField)
Checks if a route currently exists from fromField to toField
Returns:
true if the route exists, false otherwise

clearResourceCaches

public void clearResourceCaches()
Clears the cache of loaded resources, freeing the memory that holds them. Normally, a texture, sound or Shout3d scene that is loaded by the applet is stored in a cache, so that if another node requires that texture (or other resource) the resource does not need to be fetched and loaded again. This method frees those caches, which frees memory while making it so that all resources will be fetched if they are requested anew. Note: Textures and sounds that have already been loaded into nodes will be stored until those nodes are in turn freed. The caches are a separate entity.

setAntiAliased

public void setAntiAliased(boolean newVal)
Sets whether antialiasing is enabled. (Default is false) This performs antialiasing of all geometry against the background.
Parameters:
newVal - whether antialiasing should be enabled

isAntiAliased

public boolean isAntiAliased()
Returns whether antialiasing is enabled
Returns:
whether antialiasing is currently enabled

setBilinearFiltering

public void setBilinearFiltering(boolean newVal)
Sets whether bilinear filtering is enabled on textures. (Default is false) This results in higher quality, but slower rendering of the textures
Parameters:
newVal - whether bilinear filtering should be enabled

isBilinearFiltering

public boolean isBilinearFiltering()
Returns whether bilinear filtering is enabled on textures
Returns:
whether bilinear filtering is currently enabled

setLoadResourcesInSeparateThread

public void setLoadResourcesInSeparateThread(boolean newVal)
Sets resources (textures and sounds) should be loaded in a separate thread from the main thread. (Default is true)
Parameters:
newVal - whether resources should be loaded in a separate thread.

isLoadResourcesInSeparateThread

public boolean isLoadResourcesInSeparateThread()
Returns whether resources should are being loaded in a separate thread.
Returns:
whether resources should are being loaded in a separate thread.

setRenderLoopPaused

public void setRenderLoopPaused(boolean isPaused)
Sets whether the rendering loop should be paused
Parameters:
isPaused -  

isRenderLoopPaused

public boolean isRenderLoopPaused()
Gets whether the rendering loop is currently paused
Returns:
is the rendering loop paused

renderOnce

public void renderOnce()
This method will render one frame if the render loop is paused. If the render loop is not paused, there is no effect. The rendering will include calls to the onPreRender and onPostRender of all the Renderer's registered RenderObservers.

setPixelDoubling

public void setPixelDoubling(boolean enabled,
                             boolean useSmoothStyle)
Sets whether pixel doubling is enabled on the view. (Default is false) This results in faster rendering but lower detail. Rendering is done at half the resolution of the panel, then the rendering is blown up to fill the entire panel. If useSmoothStyle is false, then each pixel of the lo-res image is drawn as a square of 2x2 pixels exactly the same. If useSmoothStyle is true, then some filtering is done to smooth the image out a bit. This method is slower but looks better in some cases. By default, pixel doubling is not enabled.
Parameters:
enabled - whether pixel doubling should be enabled
useSmoothStyle - if enabled is true, whether the doubling should be smooth style

isPixelDoubling

public boolean isPixelDoubling()
Returns whether pixel doubling is enabled.
Returns:
whether pixel doubling is enabled

isPixelDoublingSmooth

public boolean isPixelDoublingSmooth()
Returns true if pixel doubling is enabled and the style in use is smooth style. Returns false otherwise