DeckImport - some new features
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
5 posts
• Page 1 of 1
DeckImport - some new features
by Max mtg » 30 Sep 2013, 07:04
I have added date filter to deck importer to allow players specify the year when that deck was playing. This will prevent any newer reprints from appearing among recognized cards and reduce the need for external tools.
I have also tried to skin that dialog, but reached only a partial success, since JDialog instances are not supported at FSkin class level. Managed to drop a panel on root level of the dialog and put all the skinnable components inside.
The import dialog can be further improved by adding a preview of recoginzed cards (I still don't know how to catch mouse events from inside JEditorPane)
I also got very surprised by the code in FComboBoxWrapper
Guess that code can be improved if weak references are applied here.
I have also tried to skin that dialog, but reached only a partial success, since JDialog instances are not supported at FSkin class level. Managed to drop a panel on root level of the dialog and put all the skinnable components inside.
The import dialog can be further improved by adding a preview of recoginzed cards (I still don't know how to catch mouse events from inside JEditorPane)
I also got very surprised by the code in FComboBoxWrapper
- Code: Select all
private static ArrayList<FComboBoxWrapper<?>> allWrappers = new ArrayList<FComboBoxWrapper<?>>();
public static void refreshAllSkins() {
for (FComboBoxWrapper<?> wrapper : allWrappers) {
wrapper.refreshSkin();
}
}
Guess that code can be improved if weak references are applied here.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: DeckImport - some new features
by drdev » 30 Sep 2013, 12:25
Sadly, I had a lot of trouble getting combo boxes to update their skin properly, and this was the only solution I found that worked. I'm definitely open to improving it if anyone knows how.Max mtg wrote:I also got very surprised by the code in FComboBoxWrapperthat is to say that once created a ComboBoxWrapper will be held in that list forever.
- Code: Select all
private static ArrayList<FComboBoxWrapper<?>> allWrappers = new ArrayList<FComboBoxWrapper<?>>();
public static void refreshAllSkins() {
for (FComboBoxWrapper<?> wrapper : allWrappers) {
wrapper.refreshSkin();
}
}
Guess that code can be improved if weak references are applied here.
As for skinning JDialog, what were you trying to skin exactly? The ComponentSkin class and derived classes, along with their corresponding FSkin.get functions, can certainly be expanded if needed.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: DeckImport - some new features
by Max mtg » 30 Sep 2013, 14:23
I was trying to skin the dialog represented by the DeckImport class. Just didn't know which method to call to make it look like the rest of application. The panel I added to the dialog is semitransparent (by skin definition) but the default form background is visible behind the panel - it looks ugly.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: DeckImport - some new features
by drdev » 30 Sep 2013, 14:31
That's doesn't sound like a problem with FSkin, but rather just a result of frames not supporting transparency easily. You'll need to research how to make a transparent dialog.Max mtg wrote:I was trying to skin the dialog represented by the DeckImport class. Just didn't know which method to call to make it look like the rest of application. The panel I added to the dialog is semitransparent (by skin definition) but the default form background is visible behind the panel - it looks ugly.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: DeckImport - some new features
by spr » 30 Sep 2013, 15:18
You could try using "setOpaque(true)" on the panel or use CLR_THEME2 instead of CLR_THEME. Utimately though, using UIManager calls should be used to make all dialogs consistent via the setForgeLookAndFeel() method in the FSkin.ForgeLookAndFeel class.Max mtg wrote:I was trying to skin the dialog represented by the DeckImport class. Just didn't know which method to call to make it look like the rest of application. The panel I added to the dialog is semitransparent (by skin definition) but the default form background is visible behind the panel - it looks ugly.
Cheers,
Steve
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 48 guests