com.microcrowd.loader.java3d.max3ds
Class Main

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by com.microcrowd.loader.java3d.max3ds.Main
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class Main
extends java.applet.Applet

Provides an example of loader usage with key navigation. If loaded as an applet expects a 'url' parameter tag which must be specified as a fully qualified url. If there isn't a url tag it looks for an applet parameter called filename. If this is run from the command line it will try to load the file passed in at the prompt, unless a command line argument 'url' is the first argument. Then it will load the url represented as the second command argument.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Main()
           
 
Method Summary
 void addViewKeyBehavior(TransformGroup viewTransformGroup)
          Adds a behavior to the view that listens to the canvas.
protected  void configureView(ViewPlatform platform, View view)
          Creates a physical environment and physical body and adds it them the view which is configured to use a regular screen display for configuration.
 BranchGroup createSceneGraph()
          Constructs a scene graph.
 BranchGroup createUniverse(View view, Scene scene)
          Creates a universe with a locale turns the scene graph.
 Scene getScene(java.net.URL location)
          load the scene.
 void init()
          Initializes applet.
 void Main()
          This is called during initialization of the applet,
static void main(java.lang.String[] args)
          If loaded from the command line a modelFile must be provided.
 void turnOnBehaviors(Behavior[] behaviors)
          Turns on all the behaviors provided.
static void usage()
           
static void usage(java.lang.String message)
           
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Main

public Main()
Method Detail

main

public static void main(java.lang.String[] args)
If loaded from the command line a modelFile must be provided. args are or url


init

public void init()
Initializes applet. If this is loaded from a command line the model is loaded from the parameters provided. If it is loaded from an applet the parameter tag 'model' is checked for a path to a model.

Overrides:
init in class java.applet.Applet

Main

public void Main()
This is called during initialization of the applet,


getScene

public Scene getScene(java.net.URL location)
load the scene.


turnOnBehaviors

public void turnOnBehaviors(Behavior[] behaviors)
Turns on all the behaviors provided.

Parameters:
bahaviors - the behaviors to enable.

createSceneGraph

public BranchGroup createSceneGraph()
Constructs a scene graph.
  1. Creates a branch group
  2. Adds the parent transform group to it.


createUniverse

public BranchGroup createUniverse(View view,
                                  Scene scene)
Creates a universe with a locale turns the scene graph. Builds a scene branch group and adds it to the locale. Builds a view platform that uses the provided view and adds that to the locale.

Parameters:
view - the view to use in the view platform
scene - the scene to grab a camera from as a default view
Returns:
the root group of the scene branch of the universe. This is what other groups for display are added to.

addViewKeyBehavior

public void addViewKeyBehavior(TransformGroup viewTransformGroup)
Adds a behavior to the view that listens to the canvas. This allows 1st person navigation.


configureView

protected void configureView(ViewPlatform platform,
                             View view)
Creates a physical environment and physical body and adds it them the view which is configured to use a regular screen display for configuration. The view is attached to the platform.

Parameters:
platform - the platform which will have the view attached to it.
view - the view to which the body and environment will be added. canvas 3d added to it.

usage

public static void usage()

usage

public static void usage(java.lang.String message)


Copyright © 2000-2011 Microcrowd. All Rights Reserved.