Class MapViewInfo

java.lang.Object
edu.cnu.mdi.view.AbstractViewInfo
edu.cnu.mdi.mapping.MapViewInfo

public class MapViewInfo extends AbstractViewInfo
Provides metadata and help text for the MapView2D "Info" dialog.

This object is constructed by MapView2D.getViewInfo() and passed to the framework's info-dialog machinery. It supplies the dialog title, purpose description, usage bullets, keyboard shortcuts, and technical notes.

Dynamic city count

Previously getTechnicalNotes() hardcoded the string "Currently loading 1251 cities", which would silently become wrong whenever the GeoJSON dataset changed. The count is now obtained from the live static field via MapView2D.getCityCount() so the displayed number always reflects reality.

  • Constructor Details

    • MapViewInfo

      public MapViewInfo(MapView2D mapView)
      Creates a view-info object for the given map view.
      Parameters:
      mapView - the owning view; must not be null
  • Method Details

    • getTitle

      public String getTitle()
      Specified by:
      getTitle in class AbstractViewInfo
      Returns:
      "Sample 2D Map View"
    • getPurpose

      public String getPurpose()
      Specified by:
      getPurpose in class AbstractViewInfo
      Returns:
      a short paragraph describing the purpose of this view
    • getUsageBullets

      public List<String> getUsageBullets()
      Usage bullets (preferred). Each bullet should be plain text (not HTML). The framework will escape it.
      Overrides:
      getUsageBullets in class AbstractViewInfo
      Returns:
      a list of usage hints displayed as bullet points in the dialog
    • getKeyboardShortcuts

      public Map<String,String> getKeyboardShortcuts()
      A map of Key Combo -> Action (e.g., "Ctrl+S" -> "Save"). Keys and actions are treated as plain text.
      Overrides:
      getKeyboardShortcuts in class AbstractViewInfo
      Returns:
      an ordered map of keyboard shortcut labels to descriptions
    • getTechnicalNotes

      public String getTechnicalNotes()

      Returns a dynamically computed string that includes the actual number of cities and countries currently loaded, rather than a hardcoded value that would become stale if the dataset changes.

      Overrides:
      getTechnicalNotes in class AbstractViewInfo
      Returns:
      technical notes including live dataset sizes