Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

imit_model / AnyLogic / UsersManual(AnyLogic)

.pdf
Скачиваний:
141
Добавлен:
06.06.2015
Размер:
4.28 Mб
Скачать

AnyLogic V User’s Manual

To create a custom toolbar

1.Click New button.

The Toolbar Name dialog box is displayed.

2.Type the name of the new toolbar in the Toolbar Name edit box.

3.Click OK.

To rename a custom toolbar

1.Select the toolbar in the Toolbars list.

2.Click the Rename button.

To delete a custom toolbar

1.Select the toolbar in the Toolbars list.

2.Click the Delete button.

To reset a toolbar to the default state

1.Select the toolbar in the Toolbars list.

2.Click the Reset button.

To reset all toolbars to default states

1.Select the toolbar in the Toolbars list.

2.Click the Reset All button.

21.1.2Commands page

The Commands page (see Figure 180) enables you to add, delete, and change the layout of toolbar buttons.

© 1992-2004 XJ Technologies http://www.xjtek.com

417

Chapter 21. Customizing AnyLogic UI

Figure 180. Customize dialog box. Commands page

To add a button to a toolbar

1.Select the category of buttons in the Categories list.

2.Select the command in the Commands list.

The Description box displays the description of the selected command.

3.Drag the command button from the Commands box onto the toolbar.

To remove a button from a toolbar

1.Drag the button from the toolbar onto the Customize dialog box.

To add or remove a separator to the left/right of a toolbar button

1.Drag the button in the toolbar a little right/left.

418

© 1992-2004 XJ Technologies http://www.xjtek.com

AnyLogic V User’s Manual

21.1.3Keyboard page

The Keyboard page (see Figure 181) enables you to change the shortcut keys for the commands.

Figure 181. Customize dialog box. Keyboard page

To set new shortcut key for a command

1.Select the category from the Category drop-down list.

2.Select the command from the Command drop-down list.

The Description box displays the description of the selected command.

The Current Keys list displays the current shortcut keys for the selected command.

3.Click inside the Press New Shortcut Key box and press the combination of keys that you want to make shortcut keys.

4.Click the Assign button.

5.Click the Close button.

© 1992-2004 XJ Technologies http://www.xjtek.com

419

Chapter 21. Customizing AnyLogic UI

You cannot assign the combination of keys to the command if it is already assigned to other command. The line below the Press New Shortcut Key box displays, whether this key combination is assigned to any other command or not.

To remove command shortcut key

1.Select the category from the Category drop-down list.

2.Select the command from the Command drop-down list.

The Current Keys list displays the current shortcut keys for the selected command.

3.In the Current Keys list, select the shortcut key you want to remove.

4.Click the Remove button.

5.Click the Close button.

To reset all shortcut keys to default

1.Click the Reset All button.

21.1.4Menu page

The Menu page (see Figure 182) enables you to customize the AnyLogic menu appearance; namely, to choose how to display menus and how to animate opening menus.

420

© 1992-2004 XJ Technologies http://www.xjtek.com

AnyLogic V User’s Manual

Figure 182. Customize dialog box. Menu page

To choose the animation effect for opening menus

1.Choose the animation effect from the Menu animations drop-down list. You may choose from None, Unfold, Slide, Fade, where None means no effect applied, Unfold – that menus are animated unfolded, Slide – that menus are animated sliding down, Fade – that menus are animated fading in.

To display menus with/without shadows

1.Select/clear the Menu shadows check box.

21.1.5Options page

The Options page (see Figure 183) enables you to customize the toolbar buttons appearance, namely to choose whether to display tooltips or not (with shortcut keys or not) and whether to display buttons with standard or large icons.

© 1992-2004 XJ Technologies http://www.xjtek.com

421

Chapter 21. Customizing AnyLogic UI

Figure 183. Customize dialog box. Options page

To show/hide tooltips for toolbar buttons

1.Select/clear the Show ScreenTips on toolbars check box.

To show/hide shortcut keys in the tooltips

1.Select/clear the Show shortcut keys in ScreenTips check box.

To display buttons with large/standard icons

1.Select/clear the Large Icons check box.

21.2 Customizing colors

Colors of the model elements on AnyLogic diagram editor windows are customizable. To customize colors, you use the Colors page of the Options dialog box.

422

© 1992-2004 XJ Technologies http://www.xjtek.com

AnyLogic V User’s Manual

Figure 184. Options dialog box. Colors page

To set the color of an item

1.Choose Tools|Options… from the main menu. The Options dialog box is displayed.

2.Click the Colors tab.

3.Select the item in the list.

The Color button has the color of the currently selected item.

4.Click the Color button.

The Color dialog box is displayed.

5.Choose color you want to set.

6.Click OK.

© 1992-2004 XJ Technologies http://www.xjtek.com

423

Chapter 22. Project building. Model initialization and termination order

22. Project building. Model initialization and termination order

The information presented in this chapter might be useful for better understanding of how an AnyLogic project is built (see section 22.1, “Building a project”) and how a model initializes and terminates in terms of ordering of various operations (see section 22.2, “Model initialization and termination order”).

22.1 Building a project

22.1.1Project building stages

AnyLogic builds the project in three stages: code generation, compilation, and archiving (the latter is optional).

On the first stage, AnyLogic generates Java code for all classes defined in the project. The code is put into .java files. Files are placed into temporary folders whose structure mimics the structure of packages of the project. External files included into the project are also copied to those folders. You can examine the generated code each time you want to see how the visual representation of the model is mapped into source code. To specify the folder the generated files should be stored in instead of temporary folders, use the Folder for generated files property of the project. To set the project property, select the project item in the workspace tree.

On the second stage, a Java compiler is invoked. The compiler produces .class files containing bytecode to be executed on Java virtual machine. The .class files are placed into the same folder as .java files. The execution of the byte-code is the execution of the model.

In case the Target file property of the project is specified, the third stage – archiving – takes place. On the third stage, AnyLogic builds an archive by packing bytecode into the file specified in the Target file property of the project. For that purpose, a packager is used. The resulting file contains the complete bytecode of the model and usually has .jar (Java

424

© 1992-2004 XJ Technologies http://www.xjtek.com

AnyLogic V User’s Manual

archive) extension. Note that in most cases you do not have to generate an archive. The rationale for creating an archive is that it is smaller than unpacked bytecode. So, if you put the model on a Web site as an applet, the archive is preferable. However, if the project being developed is a library, it must be packed into an archive; otherwise it will be unusable.

You can customize the process of compiling and archiving the model. You can tell AnyLogic which Java compiler and packager to use and specify compiler options (see section 22.1.3, “Project building options”).

The files involved in the process of building depend on each other. The example of dependencies is shown in Figure 185.

Editing the model

MyModel.alp

Generating code

Root.java Client.java Server.java

Compiling code

Root.class Client.class Server.class

Archiving

MyModel.jar

Figure 185. Example of file dependencies

A file is considered out-of-date if it is older than any of the files it depends on. To build the project, you either bring it up to date by building out-of-date and missing files, or you rebuild the whole project, starting with code generation for all classes.

© 1992-2004 XJ Technologies http://www.xjtek.com

425

Chapter 22. Project building. Model initialization and termination order

22.1.2Building a project

To bring the project up to date

1.Click the Build toolbar button, or Choose Model|Build from the main menu, or Press F7.

To regenerate code for all classes and rebuild the project

1.Click the Rebuild toolbar button, or Choose Model|Rebuild from the main menu.

To bring the project up to date and create the model (without starting it)

1.Click the Step toolbar button, or Choose Model|Step from the main menu, or Press F10.

To bring the project up to date and run the model

1.Click the Run toolbar button, or Choose Model|Run from the main menu, or Press F5.

22.1.3Project building options

Project building options are set on the Build page of the Options dialog box, see Figure 186.

To open the Build page of the Options dialog box

1.Choose Tools|Options… from the main menu. The Options dialog box is displayed.

2.Click the Build tab.

426

© 1992-2004 XJ Technologies http://www.xjtek.com

Соседние файлы в папке AnyLogic