-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
UITreeView (& test method conventions) #2338
Conversation
Hooray Jenkins reported success with all tests good! |
Hooray Jenkins reported success with all tests good! |
Hooray Jenkins reported success with all tests good! |
Hooray Jenkins reported success with all tests good! |
Hooray Jenkins reported success with all tests good! |
* @return The index of the specified {@code Tree}. | ||
*/ | ||
public int getIndex(Tree<T> node) { | ||
if (node == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use Preconditions.checkArgument()
here, if you like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed the notification for this comment. Fixed all the checks accordingly.
I looked over it briefly and didn't test all corner cases, but afaict, it looks good. Slightly offtopic: The behavior node editor currently uses |
@msteiger: thanks for the test! I've actually checked the BTE package before starting work on this PR - it's specifically meant for tree visualizations as opposed to tree views, so not a great fit. |
That's what I expected. Thanks for the clarification. |
Hooray Jenkins reported success with all tests good! |
@rzats got a IndexOutOfBoundException while testing it: |
The crash happens when you minimize a node near the end of the list while a child node is still selected. When it isn't near the end of the list, another item gets selected (which is also strange). |
Great work otherwise, the PR can be merged once the bug is fixed. |
Merged, thanks for the PR |
Hooray Jenkins reported success with all tests good! |
Contains
Tree
data structure that contains the widget's elements and aTreeModel
helper class.TreeViewTestScreen
- fairly self-explanatory 😜testMethodName
as opposed tomethodName
- this is a mostly unrelated change as suggested in a Slack discussion.This PR was previously located in my Terasology fork. In retrospect, this wasn't a great idea: local PRs have no @GooeyHub testing, no mergeability checks with the upstream repository and little to none community exposure: IMO, going for a base repository fork is a better idea for subsequent deliverables.
How to test
showScreen treeViewTestScreen
in the in-game console. Make sure you do so manually without using autocompletion - otherwise showScreen() autocompletion breaks screen initialization #2329 triggers, causing initialization issues.Controls