Closed KotzaBoss closed 3 years ago
hi @KotzaBoss
thank you very much for your work and explainations. I think it's a very good idea to refactor this code. There are two things I have to think about:
UIManager.getFont("Label.font");
hack has to be included. It's necessary for linux environments working with darcula.Currently I am not sure how to solve the second point. Do you have any ideas?
Great that you found it interesting!
With the current implementation the linux hack can simple be put in the OSNative options
Indeed i have coupled the theme with the options. My inexperience with swing doesnt let me be able to think of something immediately. Could you elaborate of the following:
abstract class UiBoosterOptions {
BasicLookAndFeel lookAndFeel; // There propably is good work already done and ready to be used
String iconPath;
String loadingPath;
ExtraOptions extraOptions; // Structured options to be "installed" in the basic theme passed
// Other constructors
UiBoosterOptions(BasicLookAndFeel blaf, String iconPath, String loadingPath, ExtraOptions extraOptions) { // "Install" extra options to instance of blaf passed }
In essence _with my current understanding_ it seems reasobable to "append" the desired options on the
look and feel instances passed. Assuming you can programmatically install extra options, that way you separate those options
that come with the theme and any extra which you will install on the fly
```java
class DarkOptions2 extends UiBoosterOptions {
// Super has been overloaded to do the necessary function calls to install the extra options
// on Darcula
DarkOptions2() {
super(new DarculaLaf(), "...", "...", new DarkExtraOptions());
}
}
Great work @KotzaBoss thank you very much for your work and your patience. Now I found some time to check your changes and integrate it into the repo. Your refactoring is very good and makes the code much more readable 👍
Thats awesome!! Your framework is exactly the type i enjoy working with because it gives you out-of-the-box functionality. My guis dont usually (ever) require design so this shaves hours of work.
Great work!
Extensibility provided through subclassing the now abstract
UiBoosterOption
class and polymorphically using its subclasses. Attempted to remove hardcoded values and move them into their logical unit (example default loadingImage or iconImage).Stayed as close as possible to previous
UiBoosterOptions
API inorder to stay backwards compatible. Attention was given to the construction ofUiBooster
through theTheme
enum.