Class AizawaDemoView

All Implemented Interfaces:
edu.cnu.mdi.feedback.IFeedbackProvider, edu.cnu.mdi.sim.ISimulationHost, edu.cnu.mdi.sim.SimulationListener, edu.cnu.mdi.transfer.IFileDropHandler, ActionListener, ComponentListener, FocusListener, MouseListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class AizawaDemoView extends SimulationView3D
3D MDI demo view for the Aizawa attractor.

The simulation thread owns the model and numerical integration. The EDT applies published snapshots to the 3D trajectory item and the phase plot.

See Also:
  • Constructor Details

    • AizawaDemoView

      public AizawaDemoView()
      Construct the Aizawa demo view using its canonical default properties.
    • AizawaDemoView

      public AizawaDemoView(Properties props)
      Construct the Aizawa demo view using the supplied properties.
      Parameters:
      props - the properties used to configure the view
    • AizawaDemoView

      public AizawaDemoView(Object... keyVals)
      Legacy compatibility constructor using alternating key/value pairs.

      Newer code should prefer AizawaDemoView() for the default demo view or AizawaDemoView(Properties) for customized construction.

      Parameters:
      keyVals - alternating property key/value pairs
  • Method Details

    • getConfiguration

      public static edu.cnu.mdi.view.ViewConfiguration<AizawaDemoView> getConfiguration()
      Get the lazy-creation configuration for this view.
      Returns:
      the view configuration for lazy creation
    • getViewInfo

      public edu.cnu.mdi.view.AbstractViewInfo getViewInfo()
      Overrides:
      getViewInfo in class edu.cnu.mdi.view.BaseView
    • make3DPanel

      protected Panel3D make3DPanel(float angleX, float angleY, float angleZ, float xDist, float yDist, float zDist)
      Description copied from class: PlainView3D
      Create the 3D panel for this view.
      Specified by:
      make3DPanel in class PlainView3D
      Parameters:
      angleX - initial x rotation angle
      angleY - initial y rotation angle
      angleZ - initial z rotation angle
      xDist - initial camera x offset
      yDist - initial camera y offset
      zDist - initial camera z offset
      Returns:
      the created 3D panel
    • createAizawaView

      public static AizawaDemoView createAizawaView()
      Compatibility factory method to create the demo view with its standard title and layout.

      Newer code should generally prefer new AizawaDemoView().

      Returns:
      a new default-configured Aizawa demo view
    • onSimulationReady

      protected void onSimulationReady(edu.cnu.mdi.sim.SimulationContext ctx)
      Description copied from class: SimulationView3D
      Called when the simulation becomes ready to run.
      Overrides:
      onSimulationReady in class SimulationView3D
      Parameters:
      ctx - simulation context
    • onSimulationRun

      protected void onSimulationRun(edu.cnu.mdi.sim.SimulationContext ctx)
      Description copied from class: SimulationView3D
      Called when the simulation starts or restarts running.
      Overrides:
      onSimulationRun in class SimulationView3D
      Parameters:
      ctx - simulation context
    • onSimulationRefresh

      protected void onSimulationRefresh(edu.cnu.mdi.sim.SimulationContext ctx)
      Description copied from class: SimulationView3D
      Called on every engine refresh request, immediately before this class repaints or refreshes the 3D panel in response.
      Overrides:
      onSimulationRefresh in class SimulationView3D
      Parameters:
      ctx - simulation context
    • onSimulationStateChange

      protected void onSimulationStateChange(edu.cnu.mdi.sim.SimulationContext ctx, edu.cnu.mdi.sim.SimulationState from, edu.cnu.mdi.sim.SimulationState to, String reason)
      Description copied from class: SimulationView3D
      Called whenever the simulation transitions between states, after any pending engine reset triggered by SimulationView3D.requestEngineReset(java.util.function.Supplier<edu.cnu.mdi.sim.Simulation>, java.util.function.Consumer<edu.cnu.mdi.sim.SimulationEngine>, boolean, boolean) has been applied.
      Overrides:
      onSimulationStateChange in class SimulationView3D
      Parameters:
      ctx - simulation context
      from - the state being left
      to - the state being entered
      reason - human-readable reason for the transition, or null
    • getSimulation

      public AizawaSimulation getSimulation()
      Get the simulation instance with the correct type.
      Returns:
      the Aizawa simulation
    • getModel

      public AizawaModel getModel()
      Get the model instance with the correct type.
      Returns:
      the Aizawa model
    • getPhasePanel

      public AizawaPhasePlotPanel getPhasePanel()
      Get the diagnostics phase plot panel with the correct type.
      Returns:
      the phase plot panel
    • requestReset

      public void requestReset()
      Request a reset of the demo back to its default state.

      This swaps in a newly created simulation and model using the standard engine reset mechanism.