At the root of the resource file is the definition file. This
file tells Jin the basic information about the board pattern. It is a
properties file and should contain the following
properties:
classname - This property tells Jin what kind of a resource
sits in the file. For board patterns, the value is
free.jin.board.BoardPattern
id - A short string identifying the board pattern. This will
not be visible to the user and must be unique between all board patterns.
name - The name of the board pattern. This is the name that
will be shown to the user.
boardPainter.classname - The name of the Java class that will
draw the board pattern. For regular, image based board patterns, use
free.chess.ImageBoardPainter as the value of this property.
If you wish to make a special, non image based board pattern, you will
need to implement the free.chess.BoardPainter interface
(look in Jin's source code) and put the class file of
your class in the resource file (and set the
boardPainter.classname property accordingly, of course).
minJavaVersion - This is an optional property which tells Jin
the minimum required version of Java that this board pattern can be used
in. For example, PNG based board patterns can't be used in Java 1.1, so if
you use PNG images, set this property to 1.2
free.chess.ImageBoardPainterIf you are using free.chess.ImageBoardPainter (which is
currently your only choice, unless you're writing your own board painter), the
following properties must also be set in the definition file:
ext - The type/extension of the image(s) you will use. If
this property is not specified, it will default to gif. Also,
note that Java 1.1 (the one Jin uses under windows, if a different version
isn't available, or when run with jin_ms.exe) only understands gif files,
so if you want to create a board pattern to be used by everyone, you will
need to stick with gifs.
type - Specifies the type of the board pattern. There are two
options:
single - With this option you provide a single, big
image which will be drawn over the entire board, after scaling to
the appropriate size. The image file must be named
board.[ext] and placed at the root of the resource
file.
It will be assumed that the image is divided evenly to an 8x8 grid,
so it's a good idea for the image size to be divisible by 8.
light-dark - With this option you provide two images -
for the dark and light squares. The images must be named
dark.[ext] and light.[ext]; they must
also be of the same size. How these images are used depends on
the value of another property: scaleSquares. If the
value of scaleSquares is true, each of the
images will be scaled to fill an entire square. If it is
false, the image will be sliced and tiled so that it is
used as a pattern. In the latter case, if you provide a small image,
it will be tiled identically for each square and the squares will
look identical; if you provide a big image, it will be sliced in a
way that tries to avoid repeating the same look for two squares
(I suggest providing an approximately 150x150 image, but the best
size depends heavily on how repetitive the image itself is). The
value of scaleSquares defaults to false.
type property, it will default to
light-dark.
For an example of all of the above, unzip slate.jar from
$JIN/resources/pieces/ and examine its structure.
If you have any questions or suggestions, email me at