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

Deck Editor GUI

Post MTG Forge Related Programming Questions Here

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

Deck Editor GUI

Postby Chris H. » 12 Aug 2009, 13:29

In an effort to learn more about Java and Eclipse I am studying the "Gui_DeckEditor.java file". There are a couple of suggestions that were made in topic:
http://www.slightlymagic.net/forum/viewtopic.php?f=26&t=876&start=0

Included below you will find a couple of pictures of the deck editor, one on a windows computer and the other on an Apple Mac OS X computer.

http://www.slightlymagic.net/forum/download/file.php?id=299&mode=view

http://www.slightlymagic.net/forum/download/file.php?id=389&mode=view

Several of the informational text strings will truncate with an ellipse and I have already figured out how to fix this problem.

I will try to move the Card Detail panel and the Card Picture panel over to the right. This in turn will allow the two tables to have their width increased. It might be nice to be able to then increase the width of the Cost column. This would give more room to display the costs for the newer hybrid mana cost cards.

I can not predict at this time how far I will be able to take this on my own. I am learning and I am having fun. 8)

Once I have finished with my changes to the "Gui_DeckEditor.java" file I will make similar changes to the "Gui_Quest_DeckEditor.java" file. I think at that point it may be easiest for me to pm the two java files to Dennis.
User avatar
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: Deck Editor GUI

Postby silly freak » 12 Aug 2009, 16:21

i have also though about changing the deck editor. if I could request something, then that the two lists should be put into a JSplitPane.

Thanks a lot!
___

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: Deck Editor GUI

Postby Chris H. » 12 Aug 2009, 16:47

silly freak wrote:i have also though about changing the deck editor. if I could request something, then that the two lists should be put into a JSplitPane.

Thanks a lot!
Thank you for the url, I will try to look at the material, not sure if I will be able to understand and implement SplitPane in the near future. :)

I'm now 55 and I have not written any code since my college days. We were using cards and keypunch machines back then. :lol: I may well be one of the oldest greybeards we have here on our forum. :wink:
User avatar
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: Deck Editor GUI

Postby Chris H. » 13 Aug 2009, 01:17

Dennis or anyone else in the know, where do I find the code which sets the spacing for the columns for the jScrollPane1 (All Cards table) and jScrollPane2 (Deck table).

I have had some success today. You can view the new layout for the unfinished deck editor below:


EDIT:

The pic has been replaced with a more recent update in a later message. :)
Last edited by Chris H. on 13 Aug 2009, 21:17, edited 1 time in total.
User avatar
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: Deck Editor GUI

Postby Chris H. » 13 Aug 2009, 10:46

Chris H. wrote:Dennis or anyone else in the know, where do I find the code which sets the spacing for the columns for the jScrollPane1 (All Cards table) and jScrollPane2 (Deck table).
I think that I may have found the code in the "TableModel.java" file. :)
User avatar
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: Deck Editor GUI

Postby DennisBergkamp » 13 Aug 2009, 14:52

That last screenshot looks awesome Chris, great job!! Much more space, I've always disliked the amount of space wasted on the right.
Yes, exactly it should be in TableModel.java, it's a little bit hacky, but you should be able to change the (max, min, or preferred or something like that, I'm not exactly sure) widths of the columns.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Deck Editor GUI

Postby Chris H. » 13 Aug 2009, 16:33

DennisBergkamp wrote:That last screenshot looks awesome Chris, great job!! Much more space, I've always disliked the amount of space wasted on the right.
Yes, exactly it should be in TableModel.java, it's a little bit hacky, but you should be able to change the (max, min, or preferred or something like that, I'm not exactly sure) widths of the columns.
Thank you, Dennis.

I found the code in TableModel.java to be far easier to understand than some of the code in Gui_DeckEditor.java.

When I hover my pointer over some of the statements, Eclipse is giving me a chance to highlight the command and then a javadoc will give me some info.

Of course, I discovered this long after I did most of my initial work. :lol:
User avatar
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: Deck Editor GUI

Postby Chris H. » 13 Aug 2009, 21:20

I have increased the MaxWidth for the Cost and Type columns. You can now adjust the width of these columns, there are several cards whose data would not be fully displayed.

You can now see the full cost and the full P/T stats for Progenitus.

I added two rows to the Deck table and is now set for 11 rather than 9 rows of cards.

I increased the point size of the text string for the Add Card and Remove Card buttons.

I applied the changes that I made to the "Gui_Quest_DeckEditor.java" file.

The archive below contains updated versions of the Gui_DeckEditor.java, Gui_Quest_DeckEditor.java and TableModel.java files.

.
Attachments
DeckEditor_Update1.zip
Source code
(10.59 KiB) Downloaded 315 times
DeckEditor.jpg
User avatar
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: Deck Editor GUI

Postby DennisBergkamp » 14 Aug 2009, 02:32

Again, good stuff! Is this the same update you PMed me?
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Deck Editor GUI

Postby Chris H. » 14 Aug 2009, 02:47

DennisBergkamp wrote:Again, good stuff! Is this the same update you PMed me?
Yes, the copy here is for anyone else to try if they choose. :)
User avatar
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: Deck Editor GUI

Postby Rob Cashwalker » 14 Aug 2009, 03:46

Yeah, pretty good stuff for a rusty old punch card man... 8)
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: Deck Editor GUI

Postby Chris H. » 15 Aug 2009, 19:13

I had a thought which has turned into one of those Oh No, Oh My type of moments. #-o I believe that I remember that Forge is designed to be viewable on a minimum screen resolution/size of 1024x768.

I set my monitor to this resolution and I think that I discovered why there was so much blank space at the bottom of the Deck Editor window.

I do not think that Dennis is ready to release the next version over the next several days. I should be able to go back into the code and make a few changes to resolve this problem.

When finished, I will release "DeckEditor_Update2.zip" and will pm these latest files to Dennis.

I set my monitor to 1024x768 and took this screenshot:

.
Attachments
DeckEditor_OhNo.jpg
User avatar
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: Deck Editor GUI

Postby silly freak » 15 Aug 2009, 21:25

do you use layout managers? i think GuiDisplay is the only window in forge currently using a layout manager. ;)

the benefit would be to match the constraint of the minimum-, but still being able to use the maximum resolution.
My hint would be to use a BorderLayout with the card details in the east region and the rest in the center. for the center, i would use a JSplitPane.

Nesting layouts and specialized components such as JSplitPane is a powerful tool to realize flexible GUIs.

Another GREAT ressource is the Java tutorials ;)
___

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: Deck Editor GUI

Postby Chris H. » 15 Aug 2009, 23:45

silly freak wrote:do you use layout managers? i think GuiDisplay is the only window in forge currently using a layout manager. ;)

the benefit would be to match the constraint of the minimum-, but still being able to use the maximum resolution.
My hint would be to use a BorderLayout with the card details in the east region and the rest in the center. for the center, i would use a JSplitPane.

Nesting layouts and specialized components such as JSplitPane is a powerful tool to realize flexible GUIs.

Another GREAT ressource is the Java tutorials ;)
I have not yet used a layout manager. I have given some thought to having sizable Deck Editor tables. I think we would need a maximum table width. Imagine not having a maximum width if displayed on a giant screen TV/monitor. :shock:

I have taken a look at the SplitPane web page. It looks interesting. Starting off with a small deck pane and then being able to increase the hight of the deck pane while adding cards to our deck. I tried to merge your GuiDisplay changes into my code and ran into some beginner type obstacles. I had hoped that I could study your changes and learn something.

I also have visited the Sun online tutorials web site. I found two large 500+ page pdf files on the eclipse site. One is a java basic tutorial and the other is an Eclipse basic tutorial.

I have a wealth of information to absorb. I think I will have to take this one small step at a time.

I am presently studying the code associated with the card detail panel. I have an idea for a small modification that would prevent the card name, cost and types from truncating with an ellipses. [-o<

I am slowly learning and having a lot of fun while I do so. As Rob said "Yeah, pretty good stuff for a rusty old punch card man" :mrgreen:
User avatar
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: Deck Editor GUI

Postby Chris H. » 16 Aug 2009, 00:32

Chris H. wrote:I had a thought which has turned into one of those Oh No, Oh My type of moments. #-o I believe that I remember that Forge is designed to be viewable on a minimum screen resolution/size of 1024x768.
This is the second Deck Editor version 2 update, Date 08-15-2009.

I only changed the Gui_DeckEditor.java and Gui_Quest_DeckEditor.java files.

I did not change the TableModel.java file.

.
Attachments
DeckEditor_Update2_Date08-15-2009.zip
(8.06 KiB) Downloaded 281 times
User avatar
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

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 85 guests

cron

Who is online

In total there are 85 users online :: 0 registered, 0 hidden and 85 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 85 guests

Login Form