Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

090620_0415PM_addingChangesFromCn1 #36

Merged
merged 243 commits into from
Jun 19, 2020
Merged

Conversation

DurankGts
Copy link
Owner

No description provided.

kutoman and others added 30 commits January 7, 2020 17:43
With these anchors percent insets can also refer to other points than the default one (e.g. center of a Component) .
…ith differnt topLeft,topRight,bottomLeft,bottomRight modes as being unequal. This fixes issues where you change the border of a style but it has no effect, because the style does an equality test inside setBorder() to only change the border if it isn't the same as the existing border.
…ixed topOnlyMode/bottomOnlyMode not being loaded form XML for RoundRectBorder.
…ethods can be used safely. The default implementation of setPreferredW() will implicitly set the preferred height of the component as well, and will prevent calcPreferredHeight from being called. With SpanLabel we may want to specify a desired width and have the height automatically calculated based on that width. Now we are able to do that via the setPreferredW() method.
…e when the user clicks outside of its bounds. Setting allowClose=false will also cause the close button to not appear. If you navigate to sub-sheets, the back buttons will still appear - just not the top-level close button. This allows you to create semi-modal dialogs using Sheet.
…orm.getSafeArea(Rectangle). Also added flag to force a container to render its children inside the safe area. Container.setSafeArea(boolean). Also set the tabs container of the Tabs component to be a safe area so that the tab buttons don't get covered by the iPhone X task bar.. Content pane of Sheet is also set as safe area.

Added SafeAreaSample to demonstrate how this works.
Also fixed some issues related to recent change to setAllowEnableLayoutOnPaint() that caused form to not be laid out sometimes.
#2946
TextArea was not painting while editing.  It would just show blank while user editiing, but would start showing again when editing completed on the field.  The problem was that sizing was being applied to the TextArea itself rather than the wrapping JScrollPane.  When resizing (to match cn1 text area size and position) was instead applied to the JScrollPane, the problem was fixed.
2nd regression:  Painting was not being performed while editing *any* text fields if they were tabbed into.  It would work if clicking in.
Did some refactoring of resizing behaviour on native text fields to reduce code duplication between textfields, password fields, and textareas.  This should make it easier to maintain going forward.
…() can be defined in a parent class rather than directly in the app's main class? This will make it easier to create reusable main classes that be be reused from project to project.
…feature.

Merged layout unit tests into a single class.  So far just BoxLayout, FlowLayout, and LayeredLayout.  Future tests for other Layout managers will be added to this test class.
I added a link to a blog article of Steve that clarify the externalizable interface in a way deeper than the Javadoc.
I added a link to a blog article that explains the ComponentSelector in a way deeper and clearer than the Javadoc.
…ing more flexible. Calling setPreferredW() will now cause the preferred height to be calculated accordingly, and vice versa. Previously setting preferred width or height would result in the orthogonal dimension being calculated based on the full-size image.
…will be called even if the text area was not currently editing.

Added support for tabbing to previous field from textfields in JavaSE port.
…hat support addActionListener/removeActionListener methods. This makes it much easier to bind event listeners to components in a more generic way.
Francesco Galgani and others added 29 commits June 3, 2020 05:02
…n app-wide BrowserComponent for executing javascript. When running in the Javascript port, this javascript environment is the same as the one that the app is running it so this provides a simpler way to interact with the underlying browser environment. When running in other platforms, it just uses an off-screen browser component.
… to ensure that a BrowserComponent is ready.
…es to unit test for getComponentAt().

getComponentAt() has been a challenge because it is crucial to the functioning of apps (event delivery) yet its behaviour is not well defined.   These new modifications fix the following cases:
1. getComponentAt(x,y) where x,y falls outside the proper bounds.  Previously this would return null, however this was causing intermittend NPEs due to the menubar overriding its contains(x,y) method to delegagte to the Toolbar, so contains(x,y) might be true even if (x,y) was outside the bounds of the menu bar.  Now getComponent(x,y) will always return the container itself if x,y is outside of its bounds.
2. Focusable containers.  Given a container C that is focusable.  if getComponentAt(x,y) is called on an ancestor of C and (x,y) is inside the bounds of C, then it will return C, unless C there exists another component D such that either D is a descendent of C and is focusable - OR - D is a descendent of an ancestor of C, D is rendered in front of C, and D has an ancestor E that is rendered in front of C and E.respondsToPointerEvents() is true.
…ntForm() may return null but this was not tested for (many other components make this test)
…minimal, simply changing the hash for a shape from a String into a long because creating the string hashes for shapes ended up being very memory intensive. The long hash may need to be refined as is is possible that there may be collisions as I haven't rigorously analyzed the distribution of the hashing algorithm. This mostly corrects the memory issue. Memory will still grow slightly, mostly due to allocations of rectangles used for obtaining the bounds of shapes during painting.

This is the *minimal* change resulting from 3 days of attempting a far more ambition refactor that involved immutable paths, and lots of smart caching.  But all those things didn't make much of a difference on performance (if at all), and made the code much more complex, so I reverted and only changed the shape hashing algorithm, which was the main source of memory growth.
…bscure pointer events from underlying labels. Added unit test.
…that are required to build in some environments
…nput stream not being cleaned up in ConnectionRequest.
…ame() will return empty Vector instead of null if there are no results found.
…iew. Added flag which is hard-coded as true to disable UI webview, so that even if you specify the BrowserComponent.useWKWebView property to false, it will still use WKWebView, but will print a warning to the console.
Added a theme constant to indicate a theme derives from the dark mode representation
@DurankGts DurankGts merged commit d2d7515 into DurankGts:master Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants