Class PlainView3D

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JInternalFrame
edu.cnu.mdi.view.BaseView
edu.cnu.mdi.mdi3D.view3D.PlainView3D
All Implemented Interfaces:
edu.cnu.mdi.feedback.IFeedbackProvider, edu.cnu.mdi.transfer.IFileDropHandler, ActionListener, ComponentListener, FocusListener, MouseListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
GeometrySlice3DView, GlobeView3D, ScatterPlot3DDemo, SimulationView3D

public abstract class PlainView3D extends edu.cnu.mdi.view.BaseView implements ActionListener
Base class for simple 3D MDI views backed by a Panel3D.

This class supports both the legacy Object... keyVals construction pattern and the cleaner Properties-based pattern used by BaseView. The legacy constructor is retained as a compatibility shim.

See Also:
  • Field Details

    • _panel3D

      protected final Panel3D _panel3D
      The hosted 3D panel.
  • Constructor Details

    • PlainView3D

      public PlainView3D(Object... keyVals)
      Construct a 3D view from legacy alternating key/value pairs.

      This constructor is retained for backward compatibility and simply converts the key/value pairs into Properties before delegating to PlainView3D(Properties).

      Parameters:
      keyVals - alternating property key/value pairs
    • PlainView3D

      public PlainView3D(Properties props)
      Construct a 3D view from a properties object.
      Parameters:
      props - the properties used to configure the view; may be null
  • Method Details

    • make3DPanel

      protected abstract Panel3D make3DPanel(float angleX, float angleY, float angleZ, float xDist, float yDist, float zDist)
      Create the 3D panel for this view.
      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
    • addMenus

      protected void addMenus()
      Hook for subclasses to add menus to the view's menu bar.
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • focusGained

      public void focusGained(FocusEvent e)
      Specified by:
      focusGained in interface FocusListener
      Overrides:
      focusGained in class edu.cnu.mdi.view.BaseView
    • refresh

      public void refresh()
      Overrides:
      refresh in class edu.cnu.mdi.view.BaseView
    • componentShown

      public void componentShown(ComponentEvent e)
      When a 3D internal frame becomes visible, schedule a refresh. This is especially important for lazily created views.
      Specified by:
      componentShown in interface ComponentListener
      Overrides:
      componentShown in class edu.cnu.mdi.view.BaseView
    • componentResized

      public void componentResized(ComponentEvent e)
      When a 3D internal frame is resized, re-flow this view's own BorderLayout before scheduling a 3D refresh.

      Subclasses that add extra components at other BorderLayout regions (e.g. a control strip at SOUTH) may contain a FlowLayout bar that wraps to a different number of rows as the view gets narrower or wider. Without an explicit layout pass here, a resize driven programmatically by the MDI virtual desktop (rather than a native window-manager drag) does not reliably trigger Swing's normal invalidate/validate cascade, so a newly-wrapped row's extra height is never accounted for and gets clipped at the view's bottom edge.

      Specified by:
      componentResized in interface ComponentListener
      Overrides:
      componentResized in class edu.cnu.mdi.view.BaseView
      Parameters:
      e - the resize event
    • componentMoved

      public void componentMoved(ComponentEvent e)
      When a 3D internal frame is moved, schedule a refresh. This is a likely trigger in virtual-desktop activation.
      Specified by:
      componentMoved in interface ComponentListener
      Overrides:
      componentMoved in class edu.cnu.mdi.view.BaseView
    • resolveContainer

      protected edu.cnu.mdi.container.IContainer resolveContainer(Rectangle2D.Double worldSystem)
      Overrides:
      resolveContainer in class edu.cnu.mdi.view.BaseView
    • getImageComponent

      public Component getImageComponent()

      With no container, BaseView's default would fall back to this — the whole view, menu bar and any north/south control panels included. What a 3D view's image should actually be is just the rendered frame, so this returns the GLJPanel directly.

      Overrides:
      getImageComponent in class edu.cnu.mdi.view.BaseView
    • request3DRefresh

      protected void request3DRefresh()
      Schedule a best-effort refresh of the 3D panel after Swing has processed the current event.