API ReferenceGE Extensionseditorflowgraph
Flowgraph Main Window
The primary flowgraph editor window: renders graph tabs, the node canvas, toolbar controls, context menus, and execution controls.
The primary flowgraph editor window: renders graph tabs, the node canvas, toolbar controls, context menus, and execution controls.
Overview
fg_main is the central flowgraph editor window. It draws the menu bar (File, Windows, Preferences), graph tabs for all open graphs, the node editing canvas via ui_flowgraph_editor, execution controls (play/pause/stop/step), breadcrumb navigation, view mode selection, and context menus for nodes/pins/links/background. Supports drag-drop for nodes, macros, and variables.
Class Fields
| Field | Type | Description |
|---|---|---|
C.windowName | string | 'fg_main' |
C.windowDescription | string | 'Main view' |
Class Methods
| Method | Description |
|---|---|
C:init() | Registers window, initializes editor IDs, dockspaces, context pointers |
C:attach(mgr) | Binds manager, sets border colors for running states |
C:draw() | Entry point - calls drawSelf() |
C:drawSelf() | Full render: menu, tabs, graph canvas, context menus |
C:drawMenu() | File menu (New/Load/Save/Recent), Focus, Preferences, Windows, FPS |
C:drawGraph(graph, builder, style) | Renders all nodes and links for one graph |
C:doContextMenus() | Node/Pin/Link/Background right-click menus |
C:showNewNodeContextMenu(menuPos) | Background context: node library search |
C:showQuickAccessSubmenu(menuPos, pin) | Quick Connect menu for pin linking |
C:resolveDragDropPayload() | Handles dropped nodes/macros/variables onto canvas |
C:isMouseHovering() | Check if mouse is over the main window |
Menu Actions
| Menu Item | Action |
|---|---|
| New Project | Creates new empty manager |
| Load Project | Opens file dialog for .flow.json |
| Save / Save as | Saves current project |
| Save as Scenario | Creates additional scenario .json |
| New Graph | Creates sub-graph |
| New Node | Opens file dialog to create node template |
| Load into current | Replaces current project contents |
| Encode/Decode Clipboard | Clipboard serialization for copy/paste |
View Modes
| Mode | Description |
|---|---|
default | Standard node rendering |
simple | Simplified view |
heatmap | Color-coded by activity |
geometry | Geometric layout view |
Usage Example
-- The main window is managed by the flowgraph editor extension
-- Graph tabs are auto-generated from mgr.graphs
-- Execution controls apply mission variables before starting:
missionVarHelper.applyMissionVariablesToManager(self.mgr, "flowgraphEditor")
self.mgr:setRunning(true)See Also
- Flowgraph Base Window - Related reference
- Flowgraph Events - Related reference
- Flowgraph Examples - Related reference
- World Editor Guide - Guide