It is currently 26 Apr 2024, 08:31
   
Text Size

(mostly nonfunctional) GUI changes

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

(mostly nonfunctional) GUI changes

Postby silly freak » 01 Aug 2009, 15:11

it's really not much:

-changed show() in Display to setVisible(boolean), so that no deprecated code is used
-changed the sizing code in the GuiDisplays to use the full screen (setExtendedState)
-reworked the downloading GUI. It now uses a progress bar, and is a little shorter
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: (mostly nonfunctional) GUI changes

Postby mtgrares » 01 Aug 2009, 15:24

Thanks.

-changed show() in Display to setVisible(boolean), so that no deprecated code is used
I had to name the method in Display that showed things on the screen so I named it show() but if an object extends JFrame and implements Display the compiler will incorrectly say that you are using a depreciated method, which you aren't. The old show() method in GuiDisplay2 and GuiDisplay3 will have to be updated unless I'm wrong.
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: (mostly nonfunctional) GUI changes

Postby Rob Cashwalker » 01 Aug 2009, 15:31

A rare Saturday appearance for rares....
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: (mostly nonfunctional) GUI changes

Postby mtgrares » 03 Aug 2009, 19:41

Yeah, I keep a pretty regular schedule, :lol:. I love the Monday night show The Big Bang Theory, I'm afraid I'm half Sheldon and half Leonard.
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: (mostly nonfunctional) GUI changes

Postby silly freak » 09 Aug 2009, 10:24

little update:

I added a standardized error reporting feature in the class ErrorViewer, which can save an error message to a file, including the stack trace.
I included it everywhere where it seemed meaningful - in existing catch blocks with explicit JOptionPane code, or just printStackTrace calls.
It's not included, for example, in the mana code, where a NumberFormatException is raised, intended to differentiate between colored and colorless mana.

the rar contains also all of my old changes, but it doesn't include the quick fix changes. I wouldn't mind to adapt them too if you point me to the source code
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: (mostly nonfunctional) GUI changes

Postby DennisBergkamp » 11 Aug 2009, 15:00

Thanks for these, silly freak :) No worries, I'm just merging your changes right now.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: (mostly nonfunctional) GUI changes

Postby DennisBergkamp » 11 Aug 2009, 15:51

After merging these changes, I'm getting two errors:

in Gui_NewGame, line 553:

Code: Select all
AllZone.Display.show();
(the method show is undefined for the type Display)


in ErrorViewer.java, line 90 :

Code: Select all
 public void actionPerformed(ActionEvent e) {
(the actionPerformed(ActionEvent) of type new ActionListener(){} must override a superclass method)

Help!
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: (mostly nonfunctional) GUI changes

Postby silly freak » 11 Aug 2009, 17:18

show() is replaced with setVisible(boolean) in my version, all classes using it are changed accordingly (that's the main reason why there are so many changed classes ;))

for ErrorViewer, i think this must be a missing import, though i don't get any errors. The @Override fails as long as the parameter classes aren't imported.

I hope this fixes the errors ;)
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: (mostly nonfunctional) GUI changes

Postby mtgrares » 11 Aug 2009, 17:41

I added a standardized error reporting feature in the class ErrorViewer, which can save an error message to a file, including the stack trace.
That sounds very good. Feel free to setup some sort of source code control like CVS or SVN. I know that manually making changes is very hard.
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: (mostly nonfunctional) GUI changes

Postby DennisBergkamp » 11 Aug 2009, 18:24

show() is replaced with setVisible(boolean) in my version, all classes using it are changed accordingly (that's the main reason why there are so many changed classes ;))

for ErrorViewer, i think this must be a missing import, though i don't get any errors. The @Override fails as long as the parameter classes aren't imported.

I hope this fixes the errors ;)
Oops, it seems I completely forgot to merge your changes in Gui_NewGame :roll: Either that, or I forgot to save the file.
But I'm still getting the @Override error in ErrorViewer.java... I just removed it for now, to prevent my eclipse from complaining.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: (mostly nonfunctional) GUI changes

Postby DennisBergkamp » 11 Aug 2009, 18:56

There's a few other things I've noticed:

- A lot of errors apparently get generated during my test matches, when getConvertedManaCost is called on manacosts that contain characters (try catch block with parseInt(cost) is called everytime). Anyway, it's always done this but the error was just never shown :) I've fixed this with a regular expression in CardUtil, it shouldn't try the parseInt anymore if there's a character in the manacost.
I do like the error viewer though, this should really help in the future and errors can just be saved + uploaded =D>
- The look and feel of the GUI has changed ? I'm not sure I like the changes... is there a way to use the previous look?
- I still had quite a few pictures to download (Chris had sent me a bunch which I hadn't downloaded yet), but I'm not seeing a progress bar as I'm downloading them...
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: (mostly nonfunctional) GUI changes

Postby silly freak » 11 Aug 2009, 20:02

DennisBergkamp wrote:- A lot of errors apparently get generated during my test matches, when getConvertedManaCost is called on manacosts that contain characters (try catch block with parseInt(cost) is called everytime). Anyway, it's always done this but the error was just never shown :) I've fixed this with a regular expression in CardUtil, it shouldn't try the parseInt anymore if there's a character in the manacost.
I do like the error viewer though, this should really help in the future and errors can just be saved + uploaded =D>
Sorry, i have overseen that. The catch block below was commented that it is acceptable for an exception to be thrown, and so I have thought i'm on the save side. well, so goes life.

DennisBergkamp wrote:- The look and feel of the GUI has changed ? I'm not sure I like the changes... is there a way to use the previous look?
that was a very stupid mistake of mine. it's
Gui_NewGame, line 85
Code: Select all
old: UIManager.put(properties, background);
new: UIManager.put(properties[i], background);
it happens more often to me than it should...

DennisBergkamp wrote:- I still had quite a few pictures to download (Chris had sent me a bunch which I hadn't downloaded yet), but I'm not seeing a progress bar as I'm downloading them...
i can't explain that... for me, it looks like this:
Download.png

is it just the progress bar, or the whole window?
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: (mostly nonfunctional) GUI changes

Postby DennisBergkamp » 11 Aug 2009, 21:54

Silly Freak,

That progress bar looks awesome!!!! No, for me it just looks like the regular window. I might have missed another thing from your merge #-o
Anyway, I'm flying back to the US tomorrow, I'll play around with this while I'm on the plane.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: (mostly nonfunctional) GUI changes

Postby silly freak » 12 Aug 2009, 16:46

i have an idea...
Gui_DownloadPictures has a main method in my version. it should work relatively independent from the rest of the application, so at least that should work. otherwise there is something very weird going on...
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: (mostly nonfunctional) GUI changes

Postby DennisBergkamp » 13 Aug 2009, 15:04

Ah, yes I messed up. It works now! Looks awesome, great great job silly freak =D>

I did also have to remove some of the @Override in that file though to shut up my Eclipse, but at least it's working now :)
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 96 guests


Who is online

In total there are 96 users online :: 0 registered, 0 hidden and 96 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 96 guests

Login Form