Aug 2011 GUI Overhaul
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
50 posts
• Page 3 of 4 • 1, 2, 3, 4
Re: Aug 2011 GUI Overhaul
by Chris H. » 22 Aug 2011, 22:55
I have not had a chance to link about it but I like the idea with the list of cards that you can select with the picture and the card detail panel.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Aug 2011 GUI Overhaul
by Doublestrike » 23 Aug 2011, 10:00
How do I assign myself to an issue on Mantis? I'd like to take a stab at http://cardforge.org/bugz/view.php?id=155 but I can't seem to find where to volunteer. (Access level? Still a 'reporter')
@Braids - I know this is your pet, hopefully you don't mind a little hand-holding since I'm still learning the ropes?
I'd like my Jeweled Torque to remain un-kicked.
Alternatively, since there's a very real possibility of my taking more than 48 hours to finish this change, perhaps there's a way I could duplicate or complete the work for whoever takes on this task...
@Braids - I know this is your pet, hopefully you don't mind a little hand-holding since I'm still learning the ropes?

Alternatively, since there's a very real possibility of my taking more than 48 hours to finish this change, perhaps there's a way I could duplicate or complete the work for whoever takes on this task...
---
A joke is a very serious thing.
A joke is a very serious thing.
-
Doublestrike - UI Programmer
- Posts: 715
- Joined: 08 Aug 2011, 09:07
- Location: Bali
- Has thanked: 183 times
- Been thanked: 161 times
Re: Aug 2011 GUI Overhaul
by Braids » 23 Aug 2011, 22:56
nobody has really said whether we're going through with it. please see http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=5204&start=15#p68526Doublestrike wrote:How do I assign myself to an issue on Mantis? I'd like to take a stab at http://cardforge.org/bugz/view.php?id=155 but I can't seem to find where to volunteer. (Access level? Still a 'reporter')
@Braids - I know this is your pet, hopefully you don't mind a little hand-holding since I'm still learning the ropes?I'd like my Jeweled Torque to remain un-kicked.
Alternatively, since there's a very real possibility of my taking more than 48 hours to finish this change, perhaps there's a way I could duplicate or complete the work for whoever takes on this task...
i guess you could take a shot at it. i would hope it to be {extend?} a JComponent or such that fills up as much space horizontally as its container will allow. maybe it could have a getModel() method that returns another class that extends net.slightlymagic.braids.util.progress_monitor.BaseProgressMonitor, which is how external forces could increment the units processed.
mind your threads. only code running in an event dispatch thread is allowed to update the GUI. other code should run in a different thread if possible.
i don't think you're under a 48 hour time limit.
you {Doublestrike} now have developer access in Mantis. below the item's main description, you can use the Edit button or the Assign To buttons to assign yourself the action . . .
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Aug 2011 GUI Overhaul
by friarsol » 23 Aug 2011, 23:38
Definitely not. Code takes as much time as it takes. As long as it's clear that you are handling that portion of the code, noone else should be stepping on your toes.Braids wrote:i don't think you're under a 48 hour time limit.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Aug 2011 GUI Overhaul
by Doublestrike » 24 Aug 2011, 07:15
Was thinking the same re: JComponent. Dispatcher threads noted. Even if the splash screen isn't used, it'll be a good place to have my first go. Will do my best, thanks for the tips.Braids wrote:i would hope it to be {extend?} a JComponent or such that fills up as much space horizontally as its container will allow. maybe it could have a getModel() method that returns another class that extends net.slightlymagic.braids.util.progress_monitor.BaseProgressMonitor, which is how external forces could increment the units processed.
mind your threads. only code running in an event dispatch thread is allowed to update the GUI. other code should run in a different thread if possible.
---
A joke is a very serious thing.
A joke is a very serious thing.
-
Doublestrike - UI Programmer
- Posts: 715
- Joined: 08 Aug 2011, 09:07
- Location: Bali
- Has thanked: 183 times
- Been thanked: 161 times
Re: Aug 2011 GUI Overhaul
by Braids » 25 Aug 2011, 02:34
well, i should have rephrased that. the progress bar should take up the entire width granted by the container. it shouldn't demand more than it needs. its minimum width? i'll leave that an exercise to you.Doublestrike wrote:Was thinking the same re: JComponent. Dispatcher threads noted. Even if the splash screen isn't used, it'll be a good place to have my first go. Will do my best, thanks for the tips.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Aug 2011 GUI Overhaul
by friarsol » 25 Aug 2011, 03:27
I just played a few quest games and it seems like the Card Picture in the new Quest Won Card screen isn't displayed (but the CardDetailPanel is). Is this not completed yet? I have all the LQ Set pictures downloaded. I've been grabbing Legacy packs if that makes a difference.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Aug 2011 GUI Overhaul
by Doublestrike » 27 Aug 2011, 10:20
I've finished integrating the progress bar into the splash screen, but having some temporary stupidity with SVN (see my post in "How to Get Started" thread). Once that's figured out, will test and release.
@Braids - the interfaces and base class for the progress bar are great tools for future GUI work. I'd like to put them in a forge.view.util package for all progress bars required in the project. Proposed structure:
Update
Have put in the splash frame change using an embedded progress bar. If is OK will move on to update the dialog-based progress bars (and the stderr also). For now, I'm off to learn PMD, Checkstyle, TestNG, and FindBugs.
@Braids - the interfaces and base class for the progress bar are great tools for future GUI work. I'd like to put them in a forge.view.util package for all progress bars required in the project. Proposed structure:
- Code: Select all
forge.view.util
|- ProgressBar_Base.java
|- ProgressBar_DialogsMultiple.java
|- ProgressBar_DialogsSingle.java
|- ProgressBar_Embedded.java
|- ProgressBar_Interface.java
|- ProgressBar_StdErr.java
Update
Have put in the splash frame change using an embedded progress bar. If is OK will move on to update the dialog-based progress bars (and the stderr also). For now, I'm off to learn PMD, Checkstyle, TestNG, and FindBugs.
---
A joke is a very serious thing.
A joke is a very serious thing.
-
Doublestrike - UI Programmer
- Posts: 715
- Joined: 08 Aug 2011, 09:07
- Location: Bali
- Has thanked: 183 times
- Been thanked: 161 times
Re: Aug 2011 GUI Overhaul
by Max mtg » 27 Aug 2011, 13:39
I've commited a fix for it. Please check if it started working.friarsol wrote:I just played a few quest games and it seems like the Card Picture in the new Quest Won Card screen isn't displayed (but the CardDetailPanel is). Is this not completed yet? I have all the LQ Set pictures downloaded. I've been grabbing Legacy packs if that makes a difference.
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: Aug 2011 GUI Overhaul
by friarsol » 27 Aug 2011, 13:51
Yep it worked, although you should probably be using the Card.getMostRecentSet() not Card.getRandomSet() since if you grab a Standard pack but it shows a Revised Plains it might look weird.Max mtg wrote:I've commited a fix for it. Please check if it started working.friarsol wrote:I just played a few quest games and it seems like the Card Picture in the new Quest Won Card screen isn't displayed (but the CardDetailPanel is). Is this not completed yet? I have all the LQ Set pictures downloaded. I've been grabbing Legacy packs if that makes a difference.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Aug 2011 GUI Overhaul
by Braids » 27 Aug 2011, 17:19
1. class names should not have underscores in them. both CheckStyle and PMD will complain about this.Doublestrike wrote:@Braids - the interfaces and base class for the progress bar are great tools for future GUI work. I'd like to put them in a forge.view.util package for all progress bars required in the project. Proposed structure:
- Code: Select all
forge.view.util
|- ProgressBar_Base.java
|- ProgressBar_DialogsMultiple.java
. . .
2. were you not able to reuse any code in net.slightlymagic.braids.progress_monitor via composition {having a member which is a BaseProgressMonitor} or inheritance {extends}? it looks like you copied and pasted a lot, which you shouldn't have needed to do. was there a problem in extending BaseProgressMonitor and/or adding a setModel method to your class that extends JComponent?
3. if your class is specific to swing, it should now go somewhere in the forge.view.swing package hierarchy.
integrated? braids.util.progress_monitor? are you talking about moving the package's contents? i fail to see what you mean by {evolved/integrated}. i am concerned you are trying to change or move something that should be neither.Much of this comes from ...braids.util.progress_monitor which looks pretty much ready to be evolved/integrated.
edit: the main reason the net.slightlymagic.braids package heirarchy exists is because all code in that hierarchy is dual licensed, GPL and Apache 2.0. this allows me (or anyone else) to use that code in a commercial app.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Aug 2011 GUI Overhaul
by Max mtg » 27 Aug 2011, 17:36
I'm actually busy at a different area of forge.friarsol wrote:Yep it worked, although you should probably be using the Card.getMostRecentSet() not Card.getRandomSet() since if you grab a Standard pack but it shows a Revised Plains it might look weird.
If you make that change by yourself, I would mot mind at all

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: Aug 2011 GUI Overhaul
by Doublestrike » 28 Aug 2011, 00:13
Thanks for the feedback, Braids.
The base class is extended as you said, to four instances of progress bar utility: stderr, embedded, single dialog, and multiple dialog (each phase opens a new dialog). The splash frame code was modified to include an instance of the embedded progress bar utility. (Currently that's the only child class written.)
The old folder hierarchy has not been changed.
Changed. Am getting into CheckStyle and PMD today.Braids wrote: 1. class names should not have underscores in them. both CheckStyle and PMD will complain about this.
Yes, it's the same code, with a less specific name. The BraidsProgressMonitor and BaseProgressMonitor are now ProgressBarInterface and ProgressBarBase (base class implements interface, extended as described below).Braids wrote:were you not able to reuse any code in net.slightlymagic.braids.progress_monitor
The base class is extended as you said, to four instances of progress bar utility: stderr, embedded, single dialog, and multiple dialog (each phase opens a new dialog). The splash frame code was modified to include an instance of the embedded progress bar utility. (Currently that's the only child class written.)
The old folder hierarchy has not been changed.
It looks like the interface and base progress bars could be used as utilities for the new GUI in various places - splash, download, update check, etc - under a naming structure consistent with the project. This is why I moved them into a "view.util" area to go with other GUI utilities that will come later.Braids wrote:i fail to see what you mean by {evolved/integrated}.
Renamed to forge.view.swing.utils.Braids wrote:if your class is specific to swing, it should now go somewhere in the forge.view.swing package hierarchy.
---
A joke is a very serious thing.
A joke is a very serious thing.
-
Doublestrike - UI Programmer
- Posts: 715
- Joined: 08 Aug 2011, 09:07
- Location: Bali
- Has thanked: 183 times
- Been thanked: 161 times
Re: Aug 2011 GUI Overhaul
by Braids » 28 Aug 2011, 01:24
ok, important fact. you created something that works quite well. from the user perspective, it looks really nice.
but looking at ProgressBarEmbedded, i can see that you made some of the same mistakes i myself made with MultiPhaseProgressMonitorWithETA.
we can accomplish two important objectives by changing your implementation: first, separate the model from the view. have the view observe the model {somehow} and be notified when the model changes so that the view can change. second, reuse code from net.slightlymagic.braids.progress_monitor instead of copying and pasting {copypasta} into classes with poor model-view separation. i think you can do this with 2 major classes, and possibly 1 or 2 minor ones for observation and/or a Runnable. it would be best to create a class, say, MultiPhaseProgressBar, which extends JProgressBar. Add to MultiPhaseProgressBar a field of type BraidsProgressMonitor called model, and add a getter and setter method for the model. Create a new subclass of BaseProgressMonitor which is likewise associated by a field with a MultiPhaseProgressBar. When one of the model's mutative {state changing} methods gets called, call the same method on super, then have it notify its associated MultiPhaseProgressBar on the event dispatch thread. you can do this with SwingUtilities.invokeLater, or possibly with an observer relationship, or something involving an ActionListener. {I'm not really sure which of the 3 to use.} The MultiPhaseProgressBar can then read the new values from the model and update itself accordingly from inside the event dispatch thread.
this accomplishes your goals with a lot less code, and a lot less copypasta. it's cleaner and much easier to maintain.
i know it may be difficult for you to rewrite something that works just fine, but i think these changes are important. we need to minimize our technical debt and avoid code bloat. i hope you understand.
but looking at ProgressBarEmbedded, i can see that you made some of the same mistakes i myself made with MultiPhaseProgressMonitorWithETA.
we can accomplish two important objectives by changing your implementation: first, separate the model from the view. have the view observe the model {somehow} and be notified when the model changes so that the view can change. second, reuse code from net.slightlymagic.braids.progress_monitor instead of copying and pasting {copypasta} into classes with poor model-view separation. i think you can do this with 2 major classes, and possibly 1 or 2 minor ones for observation and/or a Runnable. it would be best to create a class, say, MultiPhaseProgressBar, which extends JProgressBar. Add to MultiPhaseProgressBar a field of type BraidsProgressMonitor called model, and add a getter and setter method for the model. Create a new subclass of BaseProgressMonitor which is likewise associated by a field with a MultiPhaseProgressBar. When one of the model's mutative {state changing} methods gets called, call the same method on super, then have it notify its associated MultiPhaseProgressBar on the event dispatch thread. you can do this with SwingUtilities.invokeLater, or possibly with an observer relationship, or something involving an ActionListener. {I'm not really sure which of the 3 to use.} The MultiPhaseProgressBar can then read the new values from the model and update itself accordingly from inside the event dispatch thread.
this accomplishes your goals with a lot less code, and a lot less copypasta. it's cleaner and much easier to maintain.
i know it may be difficult for you to rewrite something that works just fine, but i think these changes are important. we need to minimize our technical debt and avoid code bloat. i hope you understand.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Aug 2011 GUI Overhaul
by Doublestrike » 28 Aug 2011, 01:50
Great - thanks for the feedback.
I have no problem at all with rewriting if you are OK with having a look and telling me what I'm doing wrong. I'll have a look at what you said and update accordingly with special attention to MVC.
(There's a few hiccups in my implementation anyway so I'd be rewriting regardless.)
I have no problem at all with rewriting if you are OK with having a look and telling me what I'm doing wrong. I'll have a look at what you said and update accordingly with special attention to MVC.
(There's a few hiccups in my implementation anyway so I'd be rewriting regardless.)
---
A joke is a very serious thing.
A joke is a very serious thing.
-
Doublestrike - UI Programmer
- Posts: 715
- Joined: 08 Aug 2011, 09:07
- Location: Bali
- Has thanked: 183 times
- Been thanked: 161 times
50 posts
• Page 3 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: No registered users and 35 guests