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

Base Components #2440

Merged
merged 18 commits into from
Mar 13, 2021
Merged

Conversation

Windchild292
Copy link
Contributor

@Windchild292 Windchild292 commented Feb 24, 2021

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.

@Windchild292 Windchild292 added (RFE) Enhancement Requests for Enhancement, new features or implementations GUI labels Feb 24, 2021
@Windchild292 Windchild292 added this to the 0.49-dev milestone Feb 24, 2021
@Windchild292 Windchild292 self-assigned this Feb 24, 2021
@codecov
Copy link

codecov bot commented Feb 24, 2021

Codecov Report

Merging #2440 (c2e484a) into master (8edd806) will increase coverage by 0.05%.
The diff coverage is 1.96%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ Complexity Δ
MekHQ/src/mekhq/gui/CampaignGUI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
MekHQ/src/mekhq/gui/HangarTab.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
MekHQ/src/mekhq/gui/MekHqColors.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
MekHQ/src/mekhq/gui/PersonnelTab.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
MekHQ/src/mekhq/gui/RepairTab.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
MekHQ/src/mekhq/gui/WarehouseTab.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...hq/gui/baseComponents/AbstractMHQButtonDialog.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...rc/mekhq/gui/baseComponents/AbstractMHQDialog.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...ekhq/gui/baseComponents/AbstractMHQScrollPane.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...mekhq/gui/baseComponents/AbstractMHQSplitPane.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
... and 83 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8edd806...c2e484a. Read the comment docs.

Copy link
Member

@NickAragua NickAragua left a 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 {
Copy link
Member

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?

Copy link
Contributor Author

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.

@Windchild292 Windchild292 merged commit 4b5f180 into MegaMek:master Mar 13, 2021
@Windchild292 Windchild292 deleted the dev_Windchild_BaseComponents branch March 13, 2021 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI (RFE) Enhancement Requests for Enhancement, new features or implementations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants