News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: .  (Read 3225 times)

creeperton

  • Hero Member
  • *****
  • Posts: 604
    • View Profile
.
« on: May 17, 2015, 03:51:31 am »
.
« Last Edit: November 16, 2015, 01:46:17 am by creeperton »

Dashman

  • Full Member
  • ***
  • Posts: 212
    • View Profile
Quote
Every time a user selects a different item int the top-left combo box, the rest of the GUI in this tab needs to be updated to reflect the entry in the item data table for that item.  What should I google to learn more about this?
If I understood this right, it's a matter of creating an event for the top-left combo box (most probably actionPerformed) in which you send messages to all the objects you want to be affected (setSelected = true for example).

How you decide what to assign to each object will depend on how you're storing the data of each item ID, of course.

Quote
I think I'll have a dictionary/map that where the key is the item name (a string) and the value another dictionary/map that is all of the bytes for that item's entry in the item data table.  That way when I need to read from it, I input the item name and then the index of the byte I want to get, and I have a bunch of switch case statements and whatnot for updating the gui elements that represent the state of that item's entry.  When I want to write to it it's the same, except when I'm only writing a single bit in which case I need to do a bit of math.
This sounds like only one dictionary/map to me. The key would be the item name / number and the value would be the byte array (or even just an int or a long, if you store the data as bits).

Quote
Does this sound sane?  I could also do it with an array (or an array of arrays) but I want to do it in the easiest possible way to maintain and focus on performance once I have all the features I want.
I would advise to get rid of the bunch of switch-case statements. Most of your options are radiobuttons, which only need a 0 or 1 value you can get via bitwise operations.

I would also recommend finishing the GUI before going into functionality. Most GUI editors for Java are a bit of a bitch if you decide to change something later.

FAST6191

  • Hero Member
  • *****
  • Posts: 3013
    • View Profile
On the copyright thing you will have to read the guidelines for your course and/or university. For a first year project and in general any university with a course worth a damn will appreciate the power of a portfolio so as soon as the assignment closes (and possibly if they allow late submissions then you may wish to wait for the end of that) just to save the minute chance of having to speak on the matter of plagiarism.
For final projects and whatever else you might be troubled (you tend to be taking a small aspect of your professor's/mentor's research which may well be a commercial research project or otherwise guided/funded project) but you would tend to be given some kind of NDA at the start of that.

As for the code quality thing I am not a great Java programmer but nothing sets off alarms. What I will say is you may be risking the problem with passion projects as coursework -- if they have taught you arrays, strongly hinted at the use of arrays or otherwise like certain things in the resulting code (and code that does the task at hand in a reasonable run time/for the resources and has source you can read counts for quite a bit) then you can struggle to play to their requirements for the top marks.

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
If you didn't have to sign anything, then you can assume that you retain all rights.

creeperton

  • Hero Member
  • *****
  • Posts: 604
    • View Profile
.
« Reply #4 on: May 19, 2015, 11:13:42 pm »
.
« Last Edit: November 16, 2015, 01:46:08 am by creeperton »

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
I hope that you aren't being graded on the visual design of that.

Anyway, I think that you might want to try the MVC design pattern. Or perhaps the Mediator design pattern.

creeperton

  • Hero Member
  • *****
  • Posts: 604
    • View Profile
.
« Reply #6 on: May 21, 2015, 02:26:34 am »
.
« Last Edit: November 16, 2015, 01:46:55 am by creeperton »

SunGodPortal

  • Hero Member
  • *****
  • Posts: 2919
  • 2 + 2 = 5
    • View Profile
I like the look of it. Has the feel of an industrial control panel where you have all of the switches and knobs and levers right there in front of you. Seeing everything out in the open like that is cool. Anyone here ever worked with an Alesis Micron? Exact opposite: Menu Hell.
Cigarettes, ice-cream, figurines of the Virgin Mary...

creeperton

  • Hero Member
  • *****
  • Posts: 604
    • View Profile
.
« Reply #8 on: May 21, 2015, 10:14:41 pm »
.
« Last Edit: November 16, 2015, 01:42:59 am by creeperton »