Class DemoApp

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class DemoApp extends BaseMDIApplication
Demo application for the MDI framework.

This class is intentionally "example-first": it demonstrates how a typical application:

  1. Creates the main application frame (BaseMDIApplication)
  2. Creates a few internal views (2D map, drawing, log, plot, demos)
  3. Optionally enables a VirtualView to simulate a virtual desktop
  4. Applies default view placement, then applies any persisted layout/config

The "virtual desktop" logic is driven by BaseMDIApplication's virtual desktop lifecycle hooks:

See Also:
  • Method Details

    • getVirtualDesktopColumns

      protected int getVirtualDesktopColumns()
      Description copied from class: BaseMDIApplication
      Override to opt in to a virtual desktop with the given column count. Return 0 to disable.
      Overrides:
      getVirtualDesktopColumns in class BaseMDIApplication
    • exitOnClose

      protected boolean exitOnClose()
      Description copied from class: BaseMDIApplication
      Whether the JVM should terminate once the main frame has actually been disposed — that is, after BaseMDIApplication.prepareForShutdown() has run and every open Window (including this one) has been disposed — regardless of whether that happened via the platform's native close button, a "Quit" menu item, or any other window-closing gesture.

      The default is false: disposing every window does not by itself call System.exit(...), matching this class's documented "Shutdown Policy." That default is correct for an MDI frame embedded inside a larger application, or for an application that intends to keep running with no windows open. A single-window "tool" style application — where the native close button and any "Quit" action should behave identically — should override this to return true.

      Overrides:
      exitOnClose in class BaseMDIApplication
      Returns:
      true to call System.exit(int) once the frame is disposed; false (the default) to leave JVM termination to something else (a "Quit" menu item, a shutdown hook, or simply letting the process keep running)
    • getInstance

      public static DemoApp getInstance()
      Public access to the singleton.
      Returns:
      the singleton main application frame
    • addInitialViews

      protected void addInitialViews()
      Create and register the initial set of views shown in the demo.

      This method only builds views; it should not depend on the outer frame being shown or on final geometry.

      Overrides:
      addInitialViews in class BaseMDIApplication
    • defaultViewLayout

      protected void defaultViewLayout()
      Place the views in the virtual desktop in a reasonable default layout.

      Note: this placements will be ignored if the user has a persisted layout/config.

      Overrides:
      defaultViewLayout in class BaseMDIApplication
    • main

      public static void main(String[] args)
      Entry point for the demo.
      Parameters:
      args - ignored