vmm.ode
Class ODE_3D.ODEView

java.lang.Object
  extended by vmm.core.View
      extended by vmm.core3D.View3D
          extended by vmm.ode.ODE_3D.ODEView
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ChangeListener, Decorateable, Parameterizable
Enclosing class:
ODE_3D

public class ODE_3D.ODEView
extends View3D

Represents the default view for an ODEFirstOrder2D.


Field Summary
protected  ToggleAction animateDrawingToggle
           
protected  ToggleAction connectDotsToggle
           
protected  AbstractActionVMM continueOrbitAction
           
protected  AbstractActionVMM eraseOrbitsAction
           
protected  ActionRadioGroup orbitTypeSelect
           
protected  ToggleAction showControlPanelToggle
           
protected  ToggleAction showDirectionFieldToggle
           
protected  ToggleAction showProjectedOrbitsToggle
           
 
Fields inherited from class vmm.core3D.View3D
CROSS_EYE_STEREO_VIEW, leftStereographOSI, MONOCULAR_VIEW, projectionCommands, RED_GREEN_STEREO_VIEW, rightStereographOSI, set3DViewOptionsAction, setViewpointAction, stereoComposite, STEREOGRAPH_VIEW, transform3D, viewStyleCommands
 
Fields inherited from class vmm.core.View
backgroundCommands, buildAnimation, buildingImageForFilmstrip, currentGraphics, decorations, directOffscreenDrawing, fullOSI, needsRedraw, offscreenImageType, parameters, showAxesAction
 
Constructor Summary
ODE_3D.ODEView()
           
 
Method Summary
 void addExtraXML(org.w3c.dom.Document containingDocument, org.w3c.dom.Element viewElement)
          Overridden to add extra transform info.
 ActionList getActions()
          Generates a list of "Action commands" that can be applied to this View.
 boolean getAnimateDrawing()
           
 boolean getConnectDotsOnOrbit()
          Tells whether orbits should be drawn as dots or as solid lines.
protected  vmm.ode.ODE_3D.Orbit getCurrentOrbit()
          Returns the current orbit (shown in green), if any.
 double getCurrentTimeFromControlPanel()
           
 MouseTask getDefaultMouseTask()
          Returns a MouseTase of type BasicMouseTask3D, which is approriate for most 3D views.
 int getOrbitType()
           
 boolean getShowControlPanel()
           
 boolean getShowDirectionField()
           
 boolean getShowProjectedOrbits()
           
 void readExtraXML(org.w3c.dom.Element viewInfo)
          Overridden to read back the extra transform info.
 void setAnimateDrawing(boolean animateDrawing)
           
 void setConnectDotsOnOrbit(boolean connectDotsOnOrbit)
          Set the property that tells whether an orbit should be drawn simply as a sequence of dots, or the dots should be connected to make a solid curve.
protected  void setCurrentOrbit(vmm.ode.ODE_3D.Orbit orbit)
          Sets the current orbit (shown in green).
 void setDisplay(Display display)
          Set the display where this view draws its exhibit.
 void setExhibit(Exhibit ex)
          Set the exhibit shown in this view.
 void setOrbitType(int type)
           
 void setShowControlPanel(boolean showControlPanel)
           
 void setShowDirectionField(boolean showDirectionField)
          The showDirectionField property determines whether a direction field is drawn for the exhibit in this view.
 void setShowProjectedOrbits(boolean showProjectedOrbits)
          When the showProjectedOrbits property is true, an auxiliary view is added to the bottom of the display where the x- and y-coordinates of the points on the current orbit are plotted.
 void startOrbitAtPoint(double[] initialPointData)
           
 void stateChanged(javax.swing.event.ChangeEvent evt)
          React to a change by rebuilding the offscreen bit map.
 
Methods inherited from class vmm.core3D.View3D
clearOSI, clip, createAxes, createOSI, drawCollaredCurve, drawCollaredCurve, drawCollaredCurve, drawCurve, drawCurve, drawCurve, drawDot, drawLine, drawPixel, drawPixelDirect, drawPixels, drawString, drawWireframeSurface, finish, finishOSIDraw, finishStereoView, getEnableThreeD, getOrthographicProjection, getSavedAuxiliaryTransformForEnableThreeD, getSettingsCommands, getTransform3D, getViewCommands, getViewPoint, getViewStyle, getViewUp, moveStereographImages, needsNewOSI, prepareOSIForDrawing, putOSI, setBackground, setEnableThreeD, setOrthographicProjection, setSavedAuxiliaryTransformForEnableThreeD, setTransform, setUpForLeftEye, setUpForRightEye, setViewPoint, setViewStyle, setViewUp, setWindowForUseWhileThreeDDisabled, stereographLeftEyeRect, stereographRightEyeRect, takeExhibit
 
Methods inherited from class vmm.core.View
addDecoration, addParameter, beginDrawToOffscreenImage, clearDecorations, doDraw, drawCurve, drawCurve, drawCurve, drawDot, drawLine, drawLine, drawLineDirect, drawPixel, drawPixel, drawPixels, drawString, drawString, endDrawToOffscreenImage, fillRectDirect, forceRedraw, getActionsForViewAndExhibit, getAdditionalAnimations, getAdditionalAnimationsForViewAndExhibit, getAntialiased, getApplyGraphics2DTransform, getBackground, getColor, getDecorations, getDisplay, getExhibit, getFastDrawing, getForeground, getImage, getName, getParameterByName, getParameters, getPreserveAspect, getRequestedWindow, getSettingsCommandsForViewAndExhibit, getShowAxes, getStatusText, getTitle, getTransform, getViewAndExhibitParameters, getWindow, parameterChanged, removeDecoration, removeParameter, render, setAntialiased, setApplyGraphics2DTransform, setColor, setFastDrawing, setFastDrawing, setForeground, setName, setPreserveAspect, setShowAxes, setStrokeSizeMultiplier, setWindow, setWindow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

showDirectionFieldToggle

protected ToggleAction showDirectionFieldToggle

showProjectedOrbitsToggle

protected ToggleAction showProjectedOrbitsToggle

showControlPanelToggle

protected ToggleAction showControlPanelToggle

animateDrawingToggle

protected ToggleAction animateDrawingToggle

continueOrbitAction

protected AbstractActionVMM continueOrbitAction

connectDotsToggle

protected ToggleAction connectDotsToggle

eraseOrbitsAction

protected AbstractActionVMM eraseOrbitsAction

orbitTypeSelect

protected ActionRadioGroup orbitTypeSelect
Constructor Detail

ODE_3D.ODEView

public ODE_3D.ODEView()
Method Detail

getShowDirectionField

public boolean getShowDirectionField()

setShowDirectionField

public void setShowDirectionField(boolean showDirectionField)
The showDirectionField property determines whether a direction field is drawn for the exhibit in this view. This property is true by default. This method has no effect if the exhbit can't show direction fields.


getAnimateDrawing

public boolean getAnimateDrawing()

setAnimateDrawing

public void setAnimateDrawing(boolean animateDrawing)

getCurrentOrbit

protected vmm.ode.ODE_3D.Orbit getCurrentOrbit()
Returns the current orbit (shown in green), if any.


setCurrentOrbit

protected void setCurrentOrbit(vmm.ode.ODE_3D.Orbit orbit)
Sets the current orbit (shown in green). When a new orbit is added to the exhibit, this method is called, so that the new orbit becomes the current orbit.


getConnectDotsOnOrbit

public boolean getConnectDotsOnOrbit()
Tells whether orbits should be drawn as dots or as solid lines.

See Also:
setConnectDotsOnOrbit(boolean)

setConnectDotsOnOrbit

public void setConnectDotsOnOrbit(boolean connectDotsOnOrbit)
Set the property that tells whether an orbit should be drawn simply as a sequence of dots, or the dots should be connected to make a solid curve. If there is a current (green) orbit when the property is changed, the new value is applied immediately to the current orbit. It also applies to new orbits created in the future. It does not change the appearance of old (red) orbits that exist when the value of the property is set.


getShowProjectedOrbits

public boolean getShowProjectedOrbits()

getOrbitType

public int getOrbitType()

setOrbitType

public void setOrbitType(int type)

getShowControlPanel

public boolean getShowControlPanel()

setShowControlPanel

public void setShowControlPanel(boolean showControlPanel)

setShowProjectedOrbits

public void setShowProjectedOrbits(boolean showProjectedOrbits)
When the showProjectedOrbits property is true, an auxiliary view is added to the bottom of the display where the x- and y-coordinates of the points on the current orbit are plotted. This property is false by default.


getActions

public ActionList getActions()
Description copied from class: View
Generates a list of "Action commands" that can be applied to this View. The commands must implement the ActionItem interface and will generally belong to one of the classes AbstractActionVMM, ToggleAction, ActionRadioGroup, or ActionList. Null items represent separators. The idea is that the list items will be added to a menu or otherwise presented to the user so that the user can invoke the commands (with ActionList items representing submenus). Null values can occur in the list; they are meant to become separaters in the menu.

Subclasses that override this method should generally call super.getActionss() and add their commands to the list retured by that method. This top-level View class does not define any Action commands; the return value is an empty non-null ArrayList.

Overrides:
getActions in class View

setDisplay

public void setDisplay(Display display)
Description copied from class: View3D
Set the display where this view draws its exhibit. This is overridden in this class to put the display into stereograpic view mode, if the view is currently set to use sterographic viewing.

Overrides:
setDisplay in class View3D
See Also:
Display.install(View, Exhibit)

setExhibit

public void setExhibit(Exhibit ex)
Description copied from class: View3D
Set the exhibit shown in this view. It is overridden in this class to set View3D.transform3D and to manage stereographic viewing if necessary.

Overrides:
setExhibit in class View3D
Parameters:
ex - The exhibit to be installed in this View. The value can be null. In that case, no Exhibit will be associated with the View after the method executes. If exhibit is already installed in this View, then no changes are made.
See Also:
Display.install(View, Exhibit)

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent evt)
Description copied from class: View3D
React to a change by rebuilding the offscreen bit map. This overrides the method in the View class for the following reason: If the state change comes from a Transform3D, it might be a change in the "orthographicProjection" property of a Transform3D that is shared with another view, so the setting of the projectionCommands is changed to match the setting in the Transform3D.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener
Overrides:
stateChanged in class View3D
See Also:
View.forceRedraw()

getDefaultMouseTask

public MouseTask getDefaultMouseTask()
Description copied from class: View3D
Returns a MouseTase of type BasicMouseTask3D, which is approriate for most 3D views.

Overrides:
getDefaultMouseTask in class View3D
Returns:
The value returned in the top-level View class is a BasicMouseTask2D, which allows dragging and zooming of the 2D window.
See Also:
MouseTask

getCurrentTimeFromControlPanel

public double getCurrentTimeFromControlPanel()

startOrbitAtPoint

public void startOrbitAtPoint(double[] initialPointData)

addExtraXML

public void addExtraXML(org.w3c.dom.Document containingDocument,
                        org.w3c.dom.Element viewElement)
Description copied from class: View3D
Overridden to add extra transform info.

Overrides:
addExtraXML in class View3D
Parameters:
containingDocument - The overall XML document that contains the view Element that is being created. This parameter is necessary because it is needed to create any nested subelements that are to be added to the view element.
viewElement - The XML element that is being constructed. This element already exists; the purpose of this method to add any extra information that would be needed to reconstruct this view object from the XML represenation.
See Also:
View.readExtraXML(Element)

readExtraXML

public void readExtraXML(org.w3c.dom.Element viewInfo)
                  throws java.io.IOException
Description copied from class: View3D
Overridden to read back the extra transform info.

Overrides:
readExtraXML in class View3D
Parameters:
viewInfo - The <view> element from the XML file that contains the information about this view. Some methods from the SaveAndRestore class might be useful for getting the data.
Throws:
java.io.IOException - If an error is found, an exception of type IOException should be thrown. This will abort the whole processing of the XML file.