Class LogoDemoView

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 LogoDemoView extends SimulationView3D
3D MDI demo view: a lit, continuously rotating recreation of the MDI logo.

The logo itself is three overlapping rectangular "window" panes — this view recreates that motif directly in 3D as three lit Quad3D panels, arranged like stacked cards and rotated as a rigid group. As the group turns, each panel's diffuse and specular shading sweeps visibly, which is exactly what a flat, unlit scene cannot show — this view exists primarily to exercise the Phong lighting path added to Quad3D (and, via the same mechanism, Sphere, Cube, and Cylinder).

Architecturally this is the simplest possible SimulationView3D: the simulation thread has no numerical model to integrate, so LogoSimulation.step does nothing but advance an animation angle at a self-paced rate. All scene mutation happens in onSimulationRefresh(edu.cnu.mdi.sim.SimulationContext), on the EDT, exactly like the Aizawa and Kinetics demos. The view uses that angle to rotate about a slowly precessing axis, giving the lit pane normals a much richer set of orientations than a simple turntable spin.

See Also:
  • Constructor Details

    • LogoDemoView

      public LogoDemoView()
      Construct the logo demo view using its canonical default properties.
    • LogoDemoView

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

      public LogoDemoView(Object... keyVals)
      Legacy compatibility constructor using alternating key/value pairs.
      Parameters:
      keyVals - alternating property key/value pairs
  • Method Details

    • getConfiguration

      public static edu.cnu.mdi.view.ViewConfiguration<LogoDemoView> 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
    • createLogoView

      public static LogoDemoView createLogoView()
      Compatibility factory method to create the demo view with its standard title and layout.
      Returns:
      a new default-configured logo demo view
    • 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
    • getSimulation

      public LogoSimulation getSimulation()
      Get the simulation instance with the correct type.
      Returns:
      the logo simulation