Complete.Org: Mailing Lists: Archives: freeciv-java: August 2000:
[FreeCiv-Java] Re: CivLog modifications
Home

[FreeCiv-Java] Re: CivLog modifications

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Michael Grundel" <michael42@xxxxxxxxxx>
Cc: "Freeciv-Java" <freeciv-java@xxxxxxxxxxx>, "Raimar Falke" <rf13@xxxxxxxxxxxxxxxxx>
Subject: [FreeCiv-Java] Re: CivLog modifications
From: "Wong TM (Huang Deming)" <lookmeow@xxxxxxxxxxxx>
Date: Sun, 27 Aug 2000 15:53:56 +0800

Hi! Thanks for spending your time on the program(Great multiple displays!).

I decided to send you mine latest version of Civlog 0.04. I did a diff(using
DJGPP http://www.delorie.com/djgpp/) on the files your sent to me to see the
changes. Raimar Falke <mailto:rf13@xxxxxxxxxxxxxxxxxxxxxxxx> had send me a
patch(Civlog-hash.diff as in the zip file) earlier to change the data structure
to implement Hashtable as opposed to your HashMap. I timed (using a stop watch)
both yours and his implementation on a 500k log and found both to be similar in
speed(2+ sec). And since I had not learn Java Collection set yet, I couldn't 
know
which is better(Please enlightens me).

* So I hope that you could implement your changes again on the newer 
Civlog-0.04.
(Sorry, as I'am currently lazy/busy ;-) )

* Please change static to non-static, public to private where appropriated
(basically change all the stupid mistakes I make). Add your @author(make 
yourself
more involved? :) ).

* Send me the files you change (as *.java, same as before. I got quite a big
bandwidth, so don't worry about the size of the files)

* I will make a diff and see what's the changes. Than I will make some final
changes and release it to the public.(Do allow me the honor. Distribution 
through
Freeciv-mailing list and the FreeCiv.org server)

> -----Original Message-----
> From: Michael Grundel [mailto:michael42@xxxxxxxxxx]
>
-snip-
>
> Since my Java-skills are much better than my C-skills I tried to improve it

Gee! Just to let you know more about me so that we can communicate more
effectively.

I know C(a little rusty), C++(very rusty) and Java(base from C++) and some misc
scipting languages. I use win98/forte to program CivLog. What's your work
environment?

-snip-
> - You can now select more than one data-attribute and the display is then
>   split. This makes it easier to compare different strengths/weaknesses.
>   Just try it and see.

great!!!!!!

> - some small changes (e.g. each player has the same color all the time,
>   before he changed color when selecting more players)

Raimar Falke done it too. Sorry I didn't upload the newer version earlier.

>
> I have tried not to interfere with the generated parts, but I currently don't
> have Forte, so I cannot be sure - let me know if I broke anything.
>

Well, feel free to change the code. I will modified it as necessary if it's
broken.

> The changes I made often had implications on other parts of the code, so
> there are changes all over the place (but commented).
> Before changing more of your program, I'd like to get some feedback about
> what features you intend to add (I could help), what you think of
> my additions, etc.

Your additions/help is great. The only problem I see is how can we coordinate 
our
efforts.

* Currently I thinking of adding a label to the left(no yet after you added the
split display) and bottom(years) on the graph.

* Change Polyline class to have more functionalities and made more modular.

* Change the mouse event in Players' list, so that no need for holding down
<ctrl> key to select multiple players.(would you do it?)

* Add a Civlog properties class to store user settings.(would you kickstart it?)

What you current idea?

-snip-
>
> To make it easier to iterate though the years in CivLogDraw, I also added
> an ArrayList which contains the years and is sorted once when all data is
> read in.

Please change Vector to ArrayList as you find yourself time.

-snip-
>
> If you have questions about my code (or Java) please let me know. It seems
> you use static and non-static a little randomly :-)

:-) I used static so that the data is global(no good, I don't know how to pass
data and back without pointer). Well I hope the you could explain to me how Java
pass values in methods. How to distinguish between pass by copy and reference?(I
still had the C pointer mindset).

> I dont yet understand how you draw the lines (it needs some fixing
> on the scale, etc.).

I added some comment in CivLogDraw.rescale().

>
> Some ideas I have for further development:
> scaling:
> when you change the start/end dates the scale is not recomputed, this
> makes it almost impossible to compare the graph of the first turns
> (because it is so small) -> fix: recompute scale when changing the sliders?)

I did try to change it. Looking at CivLogFrame.jsldrStartYearStateChanged():-

private void jsldrStartYearStateChanged (javax.swing.event.ChangeEvent evt) {

//-cut short-
jsldrEndYear.setMinimum (value);
/** TODO: the label spacing isn't working as expected */
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/** display 50 major ticks, 10 minor ticks */
                ^^              ^^
/** The slider did not change to reflect the values */
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jsldrEndYear.setMajorTickSpacing((int)((jsldrEndYear.getMaximum()-value )/10));
                                                                          ^^
jsldrEndYear.setMinorTickSpacing((int)((jsldrEndYear.getMaximum()-value )/50));
                                                                          ^^
//-cut short-
}

>
> show Player-Names in Scroll-List in same color as lines in graph
>
> Add display the number of
> - units lost
> - units killed
> - money in bank
> - money used to buy stuff
> - science/tax/happy rates
> I guess this needs to be added to the logfile in FreeCiv?
>

I thinking of hacking the FreeCiv logging function. I know where is the code but
.....(time/lazy/busy)

And since FreeCiv didn't append the the ScoreLog files everytime you continue a
game, I was thinking of either hacking the FreeCiv logging function or add some
utilities in CivLog to merge those files together.

In the zip file:- contain civlog0.2-0.4.diff so that you can get a rough idea of
what had change since 0.02ME. The Changelog does help a little.

>
> Regards,
>   Michael
>
> --
> eMail: michael42@xxxxxxxxxx
> PGP key available on request

Attachment: Civlog-0.04.zip
Description: Zip compressed data


[Prev in Thread] Current Thread [Next in Thread]
  • [FreeCiv-Java] Re: CivLog modifications, Wong TM (Huang Deming) <=