If you want to open an NED file, just double-click its icon in the Project Explorer. If the NED file can be parsed without an error, the graphical representation of the file will be opened; otherwise, the text view will be opened and the text will be annotated with error markers.
You can switch between graphical and source editing mode by clicking the tabs at the bottom of the editor, or by using the Alt+PGUP/PGDN key combinations. The editor will try to keep the selection during the switch. Selecting an element in a graphical view and then switching to text view will move the cursor to the related element in the NED file. When switching back to graphical view, the graphical editor will try to select the element that corresponds to the cursor location in the NED source. This allows you to keep the context, even when switching back and forth.
The graphical editor displays the visible elements of the loaded NED file. Simple modules, compound modules and networks are represented by figures or icons. Each NED file can contain more than one module or network. If it does, the corresponding figures will appear in the same order as they are found in the NED file.
Simple modules and submodules are represented as icons while compound modules and networks are displayed as rectangles where other submodules can be dropped. Connections between submodules are represented either by lines or arrows depending on whether the connection was uni- or bi-directional. Submodules can be dragged or resized using the mouse and connected by using the Connection Tool in the palette.
The palette is normally to the right of the editor area. The upper part of the palette contains the basic tools: selector, connection selector, and the connection creator tool. To use a palette item, simply click on it. Then, click in the module where you want to place/activate it. The mouse pointer will give you feedback as to whether the requested operation is allowed. The middle part of the toolbox contains the basic elements that can be placed at the top level in a NED file (simple module, compound module, interface, channel, etc.) and a "generic" submodule. Click on any of these and then click into the editor area to create an instance. The bottom part of the palette contains all module types that can be instantiated as a submodule. They are shortcuts for creating a generic submodule and then modifying its type. They will display the default icon (if any) and a short description if you hover the mouse over them. You may configure the palette by right-clicking on a button and selecting Settings... or filter its content by selecting Select Packages...
Right-clicking any element in the edited NED file will bring up a context menu that allows several actions like changing the icon, pinning/unpinning a submodule, re-layouting a compound module, or deleting/renaming the element. There are also items to activate various views. For example, the Properties View allows you to edit properties of the element.
Hovering over an element will display its documentation (the comment in the NED source above the definition) as a tooltip. Pressing F2 will make the tooltip window persistent, so it can be resized and scrolled for more convenient reading.
To create a module or a submodule, click on the appropriate palette item and then click where you want to place the new element. Submodules can be placed only inside compound modules or networks.
To create a type, or an inner type inside a compound module, click on the appropriate palette item in the "Types" drawer, and then click where you want to place the new element. If you click on the background, a new top-level type will be created. Clicking on an existing compound module or network creates an inner type inside that module.
Select the connection tool (if there are channels defined in the project, you can use the dropdown to select the connection channel type). First, click the source module and then, the destination. A popup menu will appear, asking which gates should be connected on the two selected modules. The tool will offer only valid connections (e.g. it will not offer to connect two output gates).
Clicking and dragging a connection end point to another module will reconnect it (optionally, asking which gate should be connected). If you want to change only the gate, drag the connection end point and drop it over the original module. A popup will appear asking for the source or destination gate.
Selecting an element is done by clicking on it or by dragging a rectangle over the target modules. A compound module can be selected by clicking on its border or title. If you want to select only connections within a selection rectangle, use the connection selector tool in the dropdown menu of the connection tool. The Ctrl and Shift keys can be used to add/remove to/from the current selection. Note that the keyboard (arrow keys) can also be used to navigate between submodules. You can also select using a selection rectangle by dragging the mouse around the modules.
Use Ctrl+Z and Ctrl+Y for undo and redo, respectively, and the DEL key for deletion. These functions are also available in the Edit menu and in the context menu of the selected element.
You can move/resize the selected elements with the mouse. Holding down Shift during move will perform a constrained (horizontal, diagonal or vertical) move operation. Shift + resize will keep the aspect ratio of the element.
If you turn on Snap to Geometry in the View menu, helper lines will appear to help you align with other modules. Selecting more than one submodule activates the Alignment menu (found both in the View menu and in the context menu).
Holding down Ctrl while dragging will clone the module(s). Copy/Paste can also be used both on single modules and with group selection.
Zooming in and out is possible from the View menu, or using Ctrl+-, Ctrl+=, or holding down Ctrl and using the mouse wheel.
A submodule display string may or may not contain explicit coordinates for the submodule; if it does not, then the location of the submodule will be determined by the layouting algorithm. A submodule with explicit coordinates is pinned; one without is unpinned. The Pin action inserts the current coordinates into the display string and the Unpin action removes them. Moving a submodule also automatically pins it. The position of an unpinned module is undetermined and may change every time the layouting algorithm runs. For convenience, the layouter does not run when a submodule gets unpinned (so that the submodule does not jump away on unpinning), but this also means that unpinned submodules may appear at different locations next time the same NED file is opened.
To change a module property, right-click on it and select the Properties... menu item from the context menu or select the module and modify that property in the Properties View. Alternatively, you can press Ctrl+Enter when the module is selected. NED properties like name, type and vector size are available on General tab. Visual properties like icon, size, color, border etc. can be set on the Appearance tab. You may check how your module will look like in the preview panel at the bottom of the dialog.
To change a module parameter, right-click on it and select the Parameters... menu item from the context menu. The dialog allows you to add or remove module parameters or assign value to them.
To rename an existing module select its context menu and choose Rename or click on an already selected module a second time. You can specify a new name for the module or even turn a submodule into a vector by adding [vectorsize] after its name. Alternatively the name of a module can be set in the Properties dialog or can be edited by pressing F6 when the module is selected.
A module can be exported using several image formats by selecting Export Image... from the module's context menu.
Double-clicking a submodule will open the corresponding module type in a NED editor. Selecting an element in the graphical editor and then switching to text mode will place the cursor near the previously selected element in the text editor.
Navigating inside a longer NED file is easier if you open the Outline View to see the structure of the file. Selecting an element in the outline will select the same element in the graphical editor.
If you want to see the selected element in a different view, select the element and right-click on it. Choose Show In from the context menu, and select the desired view.
If you know only the name of a module type or other NED element, you can use the Open NED Type dialog by pressing Ctrl+Shift+N. Type the name, or search with wildcards. The requested type will be opened in an editor. This feature is not tied to the graphical editor: the Open NED Type dialog is available from anywhere in the IDE.
Elements of the display string and other properties associated with the selected elements can be edited in the Properties View. The Property View is grouped and hierarchically organized; however, you can switch off this behavior on the view toolbar. Most properties can be edited directly in the Properties View, but some also have specific editors that can be activated by pressing the ellipsis button at the end of the field. Fields marked with a small light bulb support content assist. Use the Ctrl+SPACE key combination to get a list of possible values.
The NED source editor supports all functionality that one can expect from an Eclipse-based text editor, such as syntax highlighting, clipboard cut/copy/paste, unlimited undo/redo, folding, find/replace and incremental search.
The NED source is continually parsed as you type, and errors and warnings are displayed as markers on the editor rulers. At times when the NED text is syntactically correct, the editor has full knowledge of "what is what" in the text buffer.
Undo (Ctrl+Z), Redo (Ctrl+Y)
Indent/unindent code blocks (TAB/Shift+TAB)
Correct indentation (NED syntax aware) (Ctrl+I)
Find (Ctrl+F), incremental search (Ctrl+J)
Move lines (Alt+UP/DOWN)
The following functions can help you explore the IDE:
Ctrl+Shift+L pops up a window that lists all keyboard bindings, and
Ctrl+3 brings up a filtered list of all available commands.
If you have an NED file with older syntax, you can still open it. A context menu item allows you to convert it to the new syntax. If the NED file is already using the new syntax, the Convert to 4.x Format menu item is disabled.
Hovering the mouse over a NED type name will display the documentation in a "tooltip" window, which can be made persistent by hitting F2.
If you need help, just press Ctrl+SPACE. The editor will offer possible words or templates. This is context sensitive, so it will offer only valid suggestions. Content assist is also a good way of exploring the new NED syntax and features.
Selecting a text or moving the cursor over a word and pressing Ctrl+Shift+G searches for the selection in all NED files in the open projects. This function lets you quickly find references to the word or type currently under the cursor. The results are shown in the standard Search View.
Sometimes, it is very inconvenient to add the necessary import statements to the beginning of the NED file by hand. The IDE can do it for you (almost) automatically. Pressing Ctrl+Shift+O will cause the IDE to try to insert all necessary import statements. You will be prompted to specify the used packages in case of ambiguity.
This function does a general repair on all selected NED files by throwing out or adding import statements as needed, checking (and fixing) the file's package declaration, and reformatting the source code. It can be activated by clicking on the Project | Clean Up NED Files menu item from the main menu.
To comment out the selected lines, press Ctrl+/. To remove the comment, press Ctrl+/ again.
It is possible to reformat the whole NED file according to the recommended coding guidelines by activating the Format Source context menu item or by pressing the Ctrl+Shift+F key combination.
Holding the Ctrl key and clicking any identifier type will jump to the definition. Alternatively, move the cursor into the identifier and hit F3 to achieve the same effect.
If you switch to graphical mode from text mode, the editor will try to locate the NED element under the cursor and select it in the graphical editor.
The Eclipse platform's bookmarking and navigation history facilities also work in the NED editor.