| Game database in Java |
I am saving money for a dictionary so read this with an open mind.
This program (applet) could be used on browser as suport Java 1.1
|
Licensing: If you make a new language file I would like it if you send it to me. I will put it in the zip file so that other can use it. |
List of files to copy to the Internet Server. (All other files in this pakkages is for documentation only.)
| Copying to application directory (codebase). | |
| sjkbase.jar | Appletfiles, used by the applet (application) |
| navbar.gif | Navigationbuttons in the applet |
| brikker40.gif | Pieces with size=40x40 pixel |
| brikker30.gif | Pieces with size=30x30 pixel |
| Messages.txt | Default language file. |
| Messages_XX.txt | Language files. see under |
| Copying to the html site. |
|
| sjkbase.html | Example of html file for showing games. |
| problem.html | Example of html file for showing combinations |
| pgnlist.txt | Example of gamelist file |
| test1.pgn | Example of a game library in pgn |
| test2.pgn | Another example of pgn file |
| comb1.txt | Example combination file in pgn format |
| comb2.txt | Example combination file in epd format |
| comb3.txt | Example combination file in (modified) fen format |
| Filename | Language | Date | Made by |
| Messages.txt | English | 24 dec. 98 | |
| Messages_DE.txt | German | 27 dec. 98 | Manfred Rosenboom |
| Messages_ES.txt | Spanish | 4 may 00 | Iván Carrasco |
| Messages_FR.txt | French | 11 jan. 00 | Max Thiercy |
| Messages_NL.txt | Dutch | 7 jan. 99 | Johan Voorberg |
| Messages_NO.txt | Norwegian | 24 dec. 98 |
The application and the html site don't need to be the same. If it's not the same, you must
add codebase="applicationsite" to the APPLET tag.
NB! It must be on the same Internet server.
If you do this and have more than one site showing the applet it will be mush faster the
second time.
Inserting in HTML file (APPLET Tag)
For showing game database
<APPLET CODE="Sjkbase.class" ARCHIVE="sjkbase.jar" WIDTH="" HEIGHT="">
<PARAM NAME="Headline" VALUE="">
<PARAM NAME="Filelist" VALUE="">
<PARAM NAME="Pieces" VALUE="">
<PARAM NAME="bgcolor" VALUE="">
<PARAM NAME="Coordinate" VALUE="">
<PARAM NAME="Quiz" VALUE="">
<PARAM NAME="Language" VALUE="">
<PARAM NAME="Country" VALUE="">
</APPLET>
For showing combinations
<APPLET CODE="Problem.class" ARCHIVE="sjkbase.jar" WIDTH="" HEIGHT="">
<PARAM NAME="Headline" VALUE="">
<PARAM NAME="Filelist" VALUE="">
<PARAM NAME="Pieces" VALUE="">
<PARAM NAME="bgcolor" VALUE="">
<PARAM NAME="Coordinate" VALUE="">
<PARAM NAME="Language" VALUE="">
<PARAM NAME="Country" VALUE="">
</APPLET>
Forklaringer:
Fileformat: Transparent gif.
Height: The same as the height of a square on the chessboard.
Width: 12*height
The layout must be each pieces side by side in one file. The order of the pieces must be:
White Pawn, White Knight, White Bishop, White Rook, White Queen, White King,
Black Pawn, Black Knight, Black Bishop, Black Rook, Black Queen and Black King.
Example:
Java has methodes to automatic finding the right language (ISO 639) and country (ISO 3166). For Norway it will be language=no and country=NO. Not all Country have just one language. Ex. the french area of Canada would have fr and CA.
Not all browsers are suporting the language code so you should try to just use country code.
When the applet starts it try to suport your country and language in this order:
The format of the Message_xx_YY.txt file are:
Key = TranslationMake a copy of "Messages.txt" and work with this file. You could use any ANSI text editor.
(The applet could also be using the java standard for language files (Messages.properies). This will speed it up a litle but give me some errors when testing it on the Internet. (No download, Netscape could not get it from the jar file etc.)
If you make a new language file please see the licensing in the top of this document.
This file are used by the Sjkbase to finding the right pgn-file.
Edit this to point to your own pgnfiles.
Format:
PGN, EPD and FEN format is a standard format for exchange games and position on the Internet.
You could download an explanation of this format from:
http://home.sol.no/~malin/sjakk/download/pgn.zip
This files are used by the combination viewer.
It is possible to use tree different format.
PGN Format: (Eks. comb1.txt)
The position must be in the FEN tag and the setup tag must be 1.
The title of the combination is White and/or Black tag.
The quiz text is the comment before move one.
The answer is the rest of the game (moves + comment).
EPD Format: (Eks. comb2.txt)
The title of the combination must be in c0.
The quiz text must be in c1.
The answer is c2 + pv.
Modified FEN format (Eks. comb3.txt)
Line 1 must be <Title> (Saying: the next line is the title of the combination)
Line 2 Title text.
Line 3 Must be: <FEN> (Saying: the next line is FEN position)
Line 4 FEN position.
Line 5 Must be: <Quiz> (Saying: the next line is combination text)
Line 6 Combination text. (Could be more than one line)
Line 7 Must be: <Answer> (Saying: the next line is the answer to the combination)
Line 8 Answer text. (Could be more than one line)
Line 9 is line 1 for the next combination.
PGN,EPD and FEN format is a standard format for exchange games and position on the Internet.
You could download an explanation of this format from:
http://home.sol.no/~malin/sjakk/download/pgn.zip
Example of helptext
You could make a helptext on the side with the applet.
Make hyperlink to the pgn-file for the browser who could not see the applet.
The button below the board are in the navbar.gif. This buttons are also in separate files
for use in helptext.
| To the start position. | |
| Five halfmove back. | |
| One halfmove back. | |
| Refresh the board. | |
| One halfmove forward. | |
| Five halfmove forward. | |
| To the end of the game. | |
| Black at bottom. (Toggle) | |
| Quiz mode. |
The file sjkbase.jar is a archive file with all class files.
The documentation for the class files is here.
You can also download the sourcefiles from here.