Using Java editor, you can:
- View and edit the code of Java classes.
- View and edit the code of Java interfaces.
- View the code AnyLogic generates for your agent types (in read-only mode).
To open code of Java class/interface in Java editor
- Double-click the Java class/interface in the Projects view.
To open the code of agent type in Java editor in read-only mode
- You can examine the code of the agent type only after the model was built at least once. To build the model, select any model element and click the Build model toolbar button, or press F7.
- Now AnyLogic have compiled code for all classes defined in the model. In the Projects view, right-click (macOS: Ctrl + click) the agent type, which code you want to view, and choose Open with > Java Editor from the popup menu.
- Java editor is opened.
Notice the syntax highlighting. Different kinds of elements in the Java source are rendered in unique colors. Examples of Java source elements that are rendered differently are:
- Regular comments
- Javadoc comments
- Keywords
- Strings
There is one more way of opening source code of agent type. Moreover, this approach brings you to the place of the source code, that corresponds to some particular property you are interested in.
To open source code for a property
- In the Properties view, click in the code property, which source code you want to examine.
- Press Ctrl + J (macOS: Cmd + J). This will open Java editor. The whole code snippet generated for the selected property will be selected.
-
How can we improve this article?
-