vmm.latticemodel
Class LatticeModel

java.lang.Object
  extended by vmm.core.Exhibit
      extended by vmm.core3D.Exhibit3D
          extended by vmm.latticemodel.LatticeModel
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ChangeListener, Decorateable, Parameterizable
Direct Known Subclasses:
FermiPastaUlam, Toda

public abstract class LatticeModel
extends Exhibit3D


Nested Class Summary
protected  class LatticeModel.LatticeData
           
protected  class LatticeModel.LMTransform
           
 class LatticeModel.LMView
           
 
Field Summary
static int BOUNDARY_CONDITION_PERIODIC
           
static int BOUNDARY_CONDITION_ZERO
           
protected  boolean canShowNormalModeDisplay
           
protected  double defaultAmplitude
           
protected  int defaultBoundaryCondition
           
protected  int defaultDisplayStyle
           
protected  int defaultInitialMode
           
protected  int defaultInitialShape
           
protected  double defaultLatticeDensity
           
protected  double defaultLatticeLength
           
protected  int defaultNumberOfNodes
           
protected  double defaultScaleFactor
           
protected  double defaultStepSize
           
static int DISPLAY_BRIDGE
           
static int DISPLAY_CIRCILAR
           
static int DISPLAY_FPU_GRAPH
           
static int DISPLAY_LONGITUDINAL
           
static int DISPLAY_PENDULUM
           
static int DISPLAY_TRANSVERSE
           
static int INITIAL_MODE_EIGHTH
           
static int INITIAL_MODE_FIRST
           
static int INITIAL_MODE_FOURTH
           
static int INITIAL_MODE_SECOND
           
static int INITIAL_MODE_SIXTEENTH
           
static int INITIAL_SHAPE_BREATHER
           
static int INITIAL_SHAPE_GAUSSIAN
           
static int INITIAL_SHAPE_KINK
           
static int INITIAL_SHAPE_SINUSOIDAL
           
static int INITIAL_SHAPE_THERMAL
           
static int MAX_NUMBER_OF_NODES
           
protected  boolean MaxPermittedDisplacementExceeded
           
protected  int numIterations
           
 
Fields inherited from class vmm.core3D.Exhibit3D
defaultViewpoint, defaultViewUp, previousTransform3D
 
Fields inherited from class vmm.core.Exhibit
decorations, exhibitNeedsRedraw, isMorphing, morphingView, parameters, previousTransform
 
Constructor Summary
LatticeModel()
           
 
Method Summary
protected  void doDraw3D(java.awt.Graphics2D g, View3D view, Transform3D transform)
          Draws this Exhibit in a 3D view.
protected  void drawTransverse(View3D view)
           
protected abstract  double externalForceLaw(double x, double theLatticeSpacing)
           
 Animation getCreateAnimation(View view)
          This method is called to "create" the Exhibit.
 Transform getDefaultTransform(View view)
          Returns the default transform for use in the specified View.
 View getDefaultView()
          Returns the default View of this Exhibit.
 ActionList getSettingsCommandsForView(View view)
          Returns a list of "settings commands" that can be applied to this Exibit, when displayed in the specified View.
protected abstract  double internalForceLaw(double x, double theLatticeSpacing)
           
protected abstract  double potentialEnergy(double x, double theLatticeSpacing)
           
 
Methods inherited from class vmm.core3D.Exhibit3D
computeDrawData3D, computeDrawDataHook, doDrawHook, getDefaultViewpoint, getDefaultViewUp, setDefaultViewpoint, setDefaultViewUp
 
Methods inherited from class vmm.core.Exhibit
addChangeListener, addDecoration, addExtraXML, addParameter, addView, clearDecorations, computeDrawData, doDraw, fireExhibitChangeEvent, forceRedraw, getActionsForView, getAdditionalAnimationsForView, getAlternativeViews, getBuildAnimation, getDecorations, getDefaultBackground, getDefaultForeground, getDefaultWindow, getFramesForMorphing, getMorphingAnimation, getName, getParameterByName, getParameters, getTitle, getUseFilmstripForMorphing, getViews, parameterChanged, readExtraXML, removeChangeListener, removeDecoration, removeParameter, removeView, render, setDefaultBackground, setDefaultForeground, setDefaultWindow, setDefaultWindow, setFramesForMorphing, setName, setUseFilmstripForMorphing, stateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_NUMBER_OF_NODES

public static final int MAX_NUMBER_OF_NODES
See Also:
Constant Field Values

DISPLAY_TRANSVERSE

public static final int DISPLAY_TRANSVERSE
See Also:
Constant Field Values

DISPLAY_LONGITUDINAL

public static final int DISPLAY_LONGITUDINAL
See Also:
Constant Field Values

DISPLAY_CIRCILAR

public static final int DISPLAY_CIRCILAR
See Also:
Constant Field Values

DISPLAY_PENDULUM

public static final int DISPLAY_PENDULUM
See Also:
Constant Field Values

DISPLAY_BRIDGE

public static final int DISPLAY_BRIDGE
See Also:
Constant Field Values

DISPLAY_FPU_GRAPH

public static final int DISPLAY_FPU_GRAPH
See Also:
Constant Field Values

BOUNDARY_CONDITION_ZERO

public static final int BOUNDARY_CONDITION_ZERO
See Also:
Constant Field Values

BOUNDARY_CONDITION_PERIODIC

public static final int BOUNDARY_CONDITION_PERIODIC
See Also:
Constant Field Values

INITIAL_SHAPE_SINUSOIDAL

public static final int INITIAL_SHAPE_SINUSOIDAL
See Also:
Constant Field Values

INITIAL_SHAPE_GAUSSIAN

public static final int INITIAL_SHAPE_GAUSSIAN
See Also:
Constant Field Values

INITIAL_SHAPE_THERMAL

public static final int INITIAL_SHAPE_THERMAL
See Also:
Constant Field Values

INITIAL_SHAPE_KINK

public static final int INITIAL_SHAPE_KINK
See Also:
Constant Field Values

INITIAL_SHAPE_BREATHER

public static final int INITIAL_SHAPE_BREATHER
See Also:
Constant Field Values

INITIAL_MODE_FIRST

public static final int INITIAL_MODE_FIRST
See Also:
Constant Field Values

INITIAL_MODE_SECOND

public static final int INITIAL_MODE_SECOND
See Also:
Constant Field Values

INITIAL_MODE_FOURTH

public static final int INITIAL_MODE_FOURTH
See Also:
Constant Field Values

INITIAL_MODE_EIGHTH

public static final int INITIAL_MODE_EIGHTH
See Also:
Constant Field Values

INITIAL_MODE_SIXTEENTH

public static final int INITIAL_MODE_SIXTEENTH
See Also:
Constant Field Values

numIterations

protected int numIterations

defaultStepSize

protected double defaultStepSize

defaultBoundaryCondition

protected int defaultBoundaryCondition

defaultInitialShape

protected int defaultInitialShape

defaultInitialMode

protected int defaultInitialMode

defaultDisplayStyle

protected int defaultDisplayStyle

canShowNormalModeDisplay

protected boolean canShowNormalModeDisplay

defaultLatticeLength

protected double defaultLatticeLength

defaultLatticeDensity

protected double defaultLatticeDensity

defaultAmplitude

protected double defaultAmplitude

defaultNumberOfNodes

protected int defaultNumberOfNodes

defaultScaleFactor

protected double defaultScaleFactor

MaxPermittedDisplacementExceeded

protected boolean MaxPermittedDisplacementExceeded
Constructor Detail

LatticeModel

public LatticeModel()
Method Detail

potentialEnergy

protected abstract double potentialEnergy(double x,
                                          double theLatticeSpacing)

internalForceLaw

protected abstract double internalForceLaw(double x,
                                           double theLatticeSpacing)

externalForceLaw

protected abstract double externalForceLaw(double x,
                                           double theLatticeSpacing)

drawTransverse

protected void drawTransverse(View3D view)

doDraw3D

protected void doDraw3D(java.awt.Graphics2D g,
                        View3D view,
                        Transform3D transform)
Description copied from class: Exhibit3D
Draws this Exhibit in a 3D view. The method in the Exhibit3D class does nothing. Subclasses should override this method to do the actual drawing. When this method is called, Exhibit3D.computeDrawData3D(View3D, boolean, Transform3D, Transform3D) has already been called, so that any cached data should be correct. Note that this method is called only if the Exhibit is being drawn in a View3D. Exhibits that have both two and three dimensional renderings should also override Exhibit.doDraw(Graphics2D, View, Transform).

When drawing a 3D exhibit, you are strongly advised to use the drawing routines supplied by the View3D and View3DLit classes. These routines will automatically produce the correct results in stereo views -- the same is not true about direct drawing to the graphics context.

Overrides:
doDraw3D in class Exhibit3D
Parameters:
g - the graphics context where the exhibit is being drawn.
view - The View3D in which the exhibit is being drawn. In general, it is advisable to use the view for all drawing operations.
transform - The transform that is being used to draw the exhibit.

getDefaultView

public View getDefaultView()
Description copied from class: Exhibit3D
Returns the default View of this Exhibit. In the Exhibit3D class, the return value is a basic View3D.

Overrides:
getDefaultView in class Exhibit3D

getCreateAnimation

public Animation getCreateAnimation(View view)
Description copied from class: Exhibit
This method is called to "create" the Exhibit. It should return an animation that will show the process of creating the Exhibit, whatever that means. The animation is run when the Exhibit is first shown on the screen (in the 3dxm shell program) and when the "Create" action command is invoked. If the return value is null, then there is no creation animation for this exhibit. If the return value is non-null, then it can be expected that the animation will be installed in the View's Display.

Overrides:
getCreateAnimation in class Exhibit
Parameters:
view - A View that is displaying this Exhibit. The animation, if any, that is returned by this method will be installed in the View's display. If the view is null, than a creation animation that can run independently of a view could be returned.
Returns:
A creation animation for the given View of this Exhibit. The return value can be null to indicate that no creation animation is to be run.

getSettingsCommandsForView

public ActionList getSettingsCommandsForView(View view)
Description copied from class: Exhibit
Returns a list of "settings commands" that can be applied to this Exibit, when displayed in the specified View.

The items in the returned list must implement the ActionItem interface and 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).

In this top-level Exhibit class, the list contains several commands that call up dialogs where the user can change various settings. (These include: "Set Parameters", "Set Morphing", "Set Number of Frames", and "Set Visible Ranges".) Note that for these commands, the View parameter is used simply to get the View's Display, which is used as the parent of the dialog.

In general, when overriding this method, subclasses should call "super.getSettingsCommandsForView()" to obtain a list of commands from the superclass. It can then add additional commands or remove or disable commands that are in the list from the superclass.

Overrides:
getSettingsCommandsForView in class Exhibit

getDefaultTransform

public Transform getDefaultTransform(View view)
Description copied from class: Exhibit3D
Returns the default transform for use in the specified View. If the View is an instance of the View3D class, then a Transform3D object is returned; this object is constructed from the exhibit's default viewpoint and default window. If the view is not a View3D, then a 2D Transform is returned that is constructed using the exhibit's default window only.

Overrides:
getDefaultTransform in class Exhibit3D
Parameters:
view - The View is provided as a parameter since there might be several types of View appropriate for a given exhibit, and they might require different Transforms. In particular, for example, a 3D View will require a 3D Transform.
Returns:
In this top-level Exhibit class, the Transform that is returned is a 2D Transform created by calling "new Transform(xmin,xmax,ymin,ymax)" where the values of xmin, xmax, ymin, and ymax are taken from the array returned by getDefaultWindow.
See Also:
Exhibit3D.setDefaultViewpoint(Vector3D), Exhibit.setDefaultWindow(double, double, double, double)