Package edu.cnu.mdi.mapping
Class MapViewInfo
java.lang.Object
edu.cnu.mdi.view.AbstractViewInfo
edu.cnu.mdi.mapping.MapViewInfo
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 Summary
ConstructorsConstructorDescriptionMapViewInfo(MapView2D mapView) Creates a view-info object for the given map view. -
Method Summary
Modifier and TypeMethodDescriptionA map of Key Combo -> Action (e.g., "Ctrl+S" -> "Save").getTitle()Usage bullets (preferred).Methods inherited from class edu.cnu.mdi.view.AbstractViewInfo
getAccentColorHex, getAsHTML, getFooter, getTextColorHex, getTitleColorHex, getUsageHtml, getUsageSteps, isPurposeHtml
-
Constructor Details
-
MapViewInfo
Creates a view-info object for the given map view.- Parameters:
mapView- the owning view; must not benull
-
-
Method Details
-
getTitle
- Specified by:
getTitlein classAbstractViewInfo- Returns:
"Sample 2D Map View"
-
getPurpose
- Specified by:
getPurposein classAbstractViewInfo- Returns:
- a short paragraph describing the purpose of this view
-
getUsageBullets
Usage bullets (preferred). Each bullet should be plain text (not HTML). The framework will escape it.- Overrides:
getUsageBulletsin classAbstractViewInfo- Returns:
- a list of usage hints displayed as bullet points in the dialog
-
getKeyboardShortcuts
A map of Key Combo -> Action (e.g., "Ctrl+S" -> "Save"). Keys and actions are treated as plain text.- Overrides:
getKeyboardShortcutsin classAbstractViewInfo- Returns:
- an ordered map of keyboard shortcut labels to descriptions
-
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:
getTechnicalNotesin classAbstractViewInfo- Returns:
- technical notes including live dataset sizes
-