>
>
>
> Another, secondary thought on the games code I had was to
> slowly/continuously cut down on circular dependencies, near empty
> forwarding methods and getting it a bit more in line with SOLID, to make
> it easier to understand going forward.
>
>
This is clearly a very good idea. When I worked back in the code the idea
was exactly to break those dependencies and arrive to a good state for the
GUI part.
The first important point was to hide the GUI from the rest of the code.
This has required to create a facade object (GUI class) that was hiding
most of the details of the job behind.
Clearly, this required writing forwarding methods, but at least it gave us
a first rough separation of what was GUI code and what was controller.
To move forward, we need to solve the circular dependencies between various
Canvas, MapViewer and GUI class. To do that, I have done a number of
experiments.
The result for me are clear, but the path is going to be a bit slow. We
need to make sure that:
- every event is forwarded to the InGameController (including repaint
events that are handled now by canvas via repaint, events from the
EventHandler, events coming from actions and events on the Mouse)
- the InGameController updates the status of the MapViewer variables
(activeUnit, selectedTile and so on)
- the InGameController asks the relevant part of the GUI to update and
repaint.
And so on and so fort. Eventually MapViewer will have to be split into:
- a part that is in charge of the state of the GUI (MapState or GUIState)
and it will take all the pure setters-getters for the state variables, plus
some specific code for manipulating those variables
-a part that is in charge of repainting (MapDrawer). It will take all the
chain of methods in charge of painting the various parts of the GUI itself.
Unfortunately, there are lots of places in the GUI code where MapViewer
calls Canvas and Canvas calls MapViewer, so it is not that easy.
Eventually, InGameController will grow a little too big, and it will have
to be split, but that is for later.
My two cents, naturally.
Paolo
>
> Greetings
>
> wintertime
>
> *Gesendet:* Montag, 09. MÀrz 2015 um 08:02 Uhr
> *Von:* "Caleb Williams" <***@gmail.com>
> *An:* "FreeCol Developers" <freecol-***@lists.sourceforge.net>
> *Betreff:* Re: [Freecol-developers] The size of dialogs
> Mike,
>
> Personally, I would be in favor of non-resizable panels and dialog boxes
> for pretty much every popup within FreeCol. For instance, the Advisor
> panels should be non-resizable.
>
> In a related note, the biggest related issue to me is the need for an
> overhaul of the Colony panel:
>
> [image: Inline image 1]
>
> I realize that the GUI and MigLayout are not your specialty within the
> FreeCol project, but the amount of horizontal space between each building
> is prohibitive to condensing the panel horizontally (and to a far lesser
> extent vertically). The screenshot above also shows the the fact that each
> building graphic is clipped (the container appears to be about 120px with
> some buildings extending further).
>
> That said, unlike many of the panels within FreeCol, the Colony panel at
> least responds to some changes with the horizontal size, as demonstrated in
> the following:
>
> [image: Inline image 2]
>
> Thanks,
>
> On Mon, Mar 9, 2015 at 1:18 AM, Michael T. Pope <***@computer.org>
> wrote:
>>
>> Now that 0.11.3 is out I am looking through the list of issues I had put
>> aside. One of them is the question of whether dialogs/panels/whatever
>> should be resizable or not. What do people think? What we have ATM is
>> not consistent, and does not seem to be guided by any underlying
>> principles. Any suggestions for what these should be?
>>
>> Cheers,
>> Mike Pope
>>
>
> --
> *Caleb R. Williams*
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs
> to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Freecol-developers mailing list
> Freecol-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freecol-developers
>
>