-
Notifications
You must be signed in to change notification settings - Fork 176
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
Base Components #2440
Base Components #2440
Conversation
…s for itself. However, it is a good location to manage preferences between separate dialogs
Codecov Report
@@ Coverage Diff @@
## master #2440 +/- ##
============================================
+ Coverage 10.36% 10.41% +0.05%
- Complexity 3432 3441 +9
============================================
Files 675 669 -6
Lines 94574 94203 -371
Branches 15870 15816 -54
============================================
+ Hits 9799 9812 +13
+ Misses 83401 83025 -376
+ Partials 1374 1366 -8
Continue to review full report at Codecov.
|
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.
Not really much to say about this one.
* - "Cancel.text" -> text for the cancel button | ||
* - "Cancel.toolTipText" -> toolTipText for the cancel button | ||
*/ | ||
public abstract class AbstractMHQButtonDialog extends AbstractButtonDialog { |
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.
Gotta ask, what's different about a MekHQ button from a MegaMek button?
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.
Solely tracking on MHQ's preferencez instead of MM's.
Otherwise the dialogs are identical.
This PR is divided into two groupings, new Preferences and Abstract Components. The new Abstract Components are designed to be used as a basis for MekHQ GUI components. All base components for these are accessible component, with the abstraction being only light modifications from those bases. The primary functionality of these components is implementing preferences, handling resources, and handling the frame. Some implement initialization, while others have it as an abstract method that needs to be implemented by child classes. This information is provided in a JavaDoc comment at the top of each file.
Base Components: AbstractDialog, AbstractButtonDialog, AbstractScrollPane, AbstractSplitPane, and AbstractTabbedPane
New Preferences: JSplitPanePreference, JTabbedPanePreference, JListPreference, and JDoubleNumberSpinnerPreference
To Review: The first four commits are refactoring, organizing, and standardizing preferences, 5-7 are the primary logic changes, 8-10 are bugfixes and remove ScrollPanes, and 11 re-adds the removed AbstractScrollPane (I couldn't get the preferences working, but forgot about the other use of having it standardized as abstract, namely in being able to reuse the preferences between places it is used), while 12 is the change that moves the base components and preferences to MegaMek.
All have been tested, but are left largely unimplemented as part of this PR to minimize the footprint.