How to open an agent' view area on startup? - anylogic

how can I open an agent specific view area when enter in some agent during model execution? Alternatively setup a specific zoom level that will contains all the blocks?

Either you use the "onStartup" code field for Main using myViewArea.navigateTo(). You can set zoom levels in the view-area properties.
If you want to set a specific agent's view, you should do that in the button that navigates to that agent, using the code above (i.e. the default AnyLogic view controls at the top of your sim window will always take you to the 0,0-position).
PS: Some more useful info in my blog post on view areas.

Related

How can i make main menu in unreal engine 4 blueprints

I created a fps shooter game and i want to make ui for my game (main menu) . I know i will create using widget blueprint hud's but i have an issue . I created a hud for my character it display's health , ammo, minimap , etc.
and give access to FirstPersonCharacter blueprint in event begin play node but whenever i create a main menu hud and give access to the level blueprint class . Now the problem is that whenever i play it. It shows both hud's at the same time. So how can i display the menu hud first and when i play the game using a button to load a level and then it will display the second hud . Thanks in Advance
The way I have approached this is to have a separate Level for my Main Menu.
I have a level called 'MainMenu' and a level called 'MainGame'
My MainMenu level has one set of Widgets visible which contains a Start Game button. On the 'On Clicked' event for this button, it calls the 'Open Level' function node which takes the Level Name. You have to type in the level name you want to load, which is case-sensitive (very important).
Because I have two levels, they each have their own Level Blueprint - I use these two separate level blueprints to load Widgets that are consistent only for each level.
I also have blueprint widgets showing and hiding within a single level, for example an in-game pause menu, with an options screen. I use a button that is always visible to be able to bring up the pause menu. In my pause menu, I have an options button.
I use various button's 'On Clicked' events in order to use the 'Set Visibility' function node. You can target a widget, and set it's Visibility to Visible or Hidden. This way, I can get several widgets to show/hide as I traverse an in-game menu.

Create popover that can overpass window area

There is a small window application (50x50px) with only one image inside of it. When you click the image, a popover(GtkPopover) appears, but it cannot overpass the window borders and only part of it is shown.
How could I solve this issue without resizing the window?
Popovers in GTK under X11 cannot extend outside of the top-level window they belong to, because they do not use a separate windowing system surface; if they did, like menus, they would not be able to remain open even when clicking outside of them.
This cannot be fixed in GTK3, see:
https://bugzilla.gnome.org/show_bug.cgi?id=747509
https://gitlab.gnome.org/GNOME/gtk/issues/543
You must use Wayland, or you must ensure that your window is big enough to display your popover.
You also probably want to use gtk_popover_set_position(), gtk_popover_set_pointing_to(), or gtk_popover_set_constrain_to() to ensure that your popover always opens within the window surface, instead of outside.

Build some sort of workflow in JavaFX

I'm trying to build some sort of visual workflow in JavaFX. I want my application to have one main screen with the next and previous buttons, something like an installer. When a user clicks next, all the elements of the next screen appear in the same element. All previous choices of the user have to be saved. So when a user clicks on the previous button that all of his choices are still there.
How would I go on to do this?
I found these links on Google, but they don't seem to help me. Something like this is a bit the direction that I want to go, but the code in this tutorial isnt't really that good for scene's with a lot of elements.
The DataFX Framework provides a Flow API that can be used to define workflows. By doing so you can simply navigate between MVC Groups by only using annotations or configurations. You can find some examples of the API here:
http://www.guigarage.com/2014/06/datafx-tutorial-5/
http://www.guigarage.com/2015/02/quick-overview-datafx-mvc-flow-api/
http://www.guigarage.com/2015/01/datafx-tutorial-6/
I haven't worked with JavaFX in a while, but I'll start by saying I really hope you are using the JavaFX scene builder.
The way I would do it off the top of my head without going back and relearning JavaFX is to create a main window in the scene builder, and have a sort of central content display area, which holds another custom JavaFX container that contains the content you want to display, of which you can then create several of and swap out which one is being displayed programmatically.
Basically, create several smaller components representing each step or screen and display them programmatically in an owning container.

View visible across perspectives

I have an Eclipse RCP application that defines multiple perspectives. The default perspective allows opening views (through the showView method) that are not defined in the IPerspectiveLayout class.
When switching to another perspective, these views disappear as they belong to the default one.
Is there a way of making these views persistable through perspective changes?
AFAIK there is no way to do that in RCP other than to declare a view as "sticky". But the sticky views have their limitations, use it with great care.
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_ui_views.html
A sticky view is a view that will appear by default across all
perspectives in a window once it is opened. Its initial placement is
governemed by the location attribute, but nothing prevents it from
being moved or closed by the user. Use of this element will only cause
a placeholder for the view to be created, it will not show the view.
Please note that usage of this element should be done with great care
and should only be applied to views that truely have a need to live
across perspectives.
The view won't appear in the perspective, unless you define, that the view belongs to this perspective, while creating perspective layout or unless user opens it in the, using some action. So, you have to consider adding view placeholders to the perspective layout, see org.eclipse.ui.IFolderLayout.addPlaceholder(String viewId) method.

Positioning ListViews in WinJS Metro apps using scrollIntoView

I am building a jscript-based Windows 8 Metro app. The main screen of this application is a scrolling "panorama" view with several list views showing various aspects of the app's state. In some cases the user will select something on the page which results in a navigation to another page (using the WinJS.Navigation.navigate method.
When the user hits the back arrow on the other page, it returns to the main screen, and I use "scrollIntoView" on to position the screen to the section that the user was working on before the navigation occurred.
Unfortunately this hardly ever results in correctly positioning the view. It seems random. I suspect that the page isn't finished being built yet and that the scroll values are set based on the state at some snapshot in time.
Now the question:
Is there some what to be notified by WinJS ListView objects that they are completely rendered and layed out? Or is this the job of the page's ready function?
Thanks for any insight!
Putting multiple list views side by side is Not A Good Idea(TM). I would recommend putting one list view, and placing your content in a grouped data source to get the groups. If the items have different templates, then you can use a custom item Template selector to dynamically select a template.
Additionally, to ensure that the list view is scrolled to the right position, you need to use the indexOfFirstVisible to set the items the name suggests.