In AnyLogic, how do you keep consistency when switching between ViewAreas of different sizes? - simulation

When we make ViewAreas of different sizes, we see inconsistencies in the menu bar and extra space while running the medal.
The problem in displayed in the images below.
Normal size viewArea
Big viewArea show inconsistency.
How do I make different-sized ViewAreas look consistent while running? 
It is implemented in the Wholesale Warehouse example model, but how?
Attaching the screenshots of the example model below.
Different view area sizes
No inconsistency while running the model

You don't. You keep the view areas at the same size and adjust the other elements

Related

How to find the largest size of a view that does not make window larger than screen size?

I'm working on a MacOS application that needs to display large images. if I naively set the ImageView to be the full size image, the application's window can be forced to become larger than the screen size. What I'd like to be able to do is work out how large I can make the image while keeping the entire window (which also contains other UI elements) on screen.
I know I can query the amount of available screen space using NSScreen:visibleFrame() but that does not seem to be much help since unless I make a whole load of assumptions about how much space the rest of the UI will take up which then defeats the point of having constraint based UI layout.
The other approach could be to find a way to constrain the window size and then let Cocoa work out the sizes of the views. However, it looks like the UI editors in Xcode only allows static sizes to be specified which is not much help.
It looks like this is possible in SwiftUI (https://www.hackingwithswift.com/quick-start/swiftui/how-to-adjust-the-way-an-image-is-fitted-to-its-space)
Image("example-image")
.resizable()
.aspectRatio(contentMode: .fit)
However, the application I'm working on needs to run on older versions of MacOS than supported by SwiftUI so I need to know how to do this in swift but using plain Cocoa.
The first thing I would try is to modify the priority of the constraints that make the image view large enough to accommodate the image. That would be its content compression resistance priority. I think if you set it to .dragThatCanResizeWindow then you might get the behavior you want for free. That's because the system already constrains a window to the screen size when you drag its edges. So, presumably, that implicit constraint has a higher priority than .dragThatCanResizeWindow.
If that doesn't do it, you can programmatically set a window's maximum frame size by setting its maxSize property. You'll want to set that each time the screen configuration changes or the window moves to a different screen. For the former, you can observe NSApplication.didChangeScreenParametersNotification. For the latter, your window delegate can implement windowDidChangeScreen(_:) or you can observe NSWindow.didChangeScreenNotification.

Automata view in ispin

I'm new to ispin and promela coding. I managed to get the automata to view working in ispin but the problem I am having at the moment is that when the automata are bit complex the labels texts(transition label, state name) get really small that I can't read. Even if I click the zoom in button, it only enlarges the state diagram but the texts remain the same. Is there any way to increase the font size of the automata view texts?

Page Flashing On Scroll

Any ideas why this page: http://mpdteam.net/projects.html is flashing when it scrolls? I've determined it's due to the background of the main content container, but why? is it a eye-trick, an image flaw, a browser flaw, or a code flaw? The code is easily viewable with view source or dev tools.
Let me know if you need anymore info. thanks.
(also, feel free to re-tag. i'm having a mind-blank for good tags)
It's because it uses finely spaced grey and white lines.
It is perhaps an example of the Moiré pattern, although this is more typically reserved for two overlapping grids at different angles.
I always assumed on a PC this occurred because of the redraw time between the two colours, and how finely spaced the lines are. The lines not perfectly aligning with pixels (e.g. anti-aliasing) would further enhance the flickering effect.
To fix it, try changing the size of the bands (e.g. try zooming out or in on the current page, and moving the browser, and note how you get reduced and even none of the described flickering effect).
Alternatively, you may want to apply a blur such that the difference between bands was softened (not sure if this would necessarily help).
Another suggestion that research yields is that it is due to background redrawing/scaling. However, a fixed background (as compared to a repeating one) isn't particularly applicable to your page.
In any case, for an in-depth discussion of some of the concepts involved, check out this awesome page (http://www.techmind.org/lcd/)

How can I maintain relative sizing in Perl/Tk PanedWindows

I'm working on a Perl/Tk GUI. It will have three main areas. Two of them side by side on top and then another one below the two.
I could just use grid geometry management. The upper two would have a row weight of 2. The lower one would have a weight of 1.
This would be good for the starting position, but the user needs the ability to adjust the sizes.
Looking at the Tk documentation, PanedWindows can also have a weight, but I can't figure out how to access it.
As I have it now, with my Paned frames, the upper and left children are minimum size, everthing else fills the area below and to the right. If I adjust the main window. only the lower and right windows are resize. Worst of all, I can resize the window and make some of the children disappear.
I want to maintain the current relative sizes.
How do I do this? I'm not tied to paned, grid, pack. Whatever works.
Sounds like you are using frames in Tk. While I have never used Perl/Tk, I am kind of savy html which Tk is probably based on html. So, you might want to look into frames and framesets at Frames in HTML documents on the W3C site.
It sounds like you need 1 frameset with 2 frames for the top and another frame for the bottom.
I hope that this helps.

Possible to reuse UILabels on a scrollview?

I'm trying to implement a view that shows a grid of information without using a UITableView, however, since I'm displaying about 36 different statistics, with its label I will have to initialize and use 72 UILabels. Does having so many UILabels mean that my iPhone app's performance will be significantly negatively affected? Is there a way to reuse some of the UILabels to decrease the number of UILabels that must be loaded at one time, or should I just resort to drawing everything on a surface instead?
First of all you should test the interface your thinking of and see if it takes a performance hit. Having a lot of labels all loaded at once will increase your memory footprint but depending on what else is going on in the app, it might not matter.
Secondly, you can't easily reuse the labels but it is possible. However, you would have to constantly monitor the displayed area of the scrollview and move the labels frames around as the view scrolled. I doubt you could do that efficiently. It would take a lot of coding in any case.
Thirdly, any grid like layout can be easily displayed in a table without making it look like a table. For example, the photopicker layout is a table but it looks like a bunch of icons on a white background. Another app I saw used a table to display paragraphs of text but it looked like an ordinary scrolling textview. Every row in a table can be customized to display exactly what you want. In principle, you could use a different cell for every row and they could all be unique in their height and contents.
The advantage of the table is the the table manages what is and is not on screen for you. It does reuse cells and their contents which makes them more efficient. The table also makes it easier to manage a lot of data.