Source code: com/eireneh/bible/control/map/Rule.java
1
2 package com.eireneh.bible.control.map;
3
4 /**
5 * A Rule has the ability to specify where it would like a node to be
6 * positioned in space.
7 *
8 * <table border='1' cellPadding='3' cellSpacing='0' width="100%">
9 * <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
10 * Distribution Licence:<br />
11 * Project B is free software; you can redistribute it
12 * and/or modify it under the terms of the GNU General Public License,
13 * version 2 as published by the Free Software Foundation.<br />
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.<br />
18 * The License is available on the internet
19 * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
20 * <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21 * MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
22 * The copyright to this program is held by it's authors.
23 * </font></td></tr></table>
24 * @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
25 * @see docs.Licence
26 * @author Joe Walker
27 * @version D0.I0.T0
28 */
29 public interface Rule
30 {
31 /**
32 * Specify where it would like a node to be positioned in space.
33 * Rules return an array of positions where the average of them
34 * specifies the real desired position. So to specify a single place
35 * simply return an array of one position. The positions are added
36 * to the results from all Rules so to specify a single position
37 * more strongly, return an array conataining that position many
38 * times.
39 * <br />
40 * I expect that any Rule will not return more than 30 positions.
41 * This expectation may be useful in colouring how many times to
42 * include your Position(s) in the array.
43 * @param map The Map to select a node from
44 * @param ord The ordinal number (1 - 31104) of the verse
45 * @return An array of desired positions.
46 */
47 public Position[] getDesiredPosition(Map map, int ord);
48
49 /**
50 * Each call to getDesiredPosition() returns an array of Positions,
51 * this method sets the preferred length of that returned array.
52 * It is only a preferred length, so non-perfect Rules are free to
53 * miss by one or 2.
54 * @param scale The preferred length of the desired position array
55 * @see getDesiredPosition(Map, int)
56 */
57 public void setScale(int scale);
58
59 /**
60 * Each call to getDesiredPosition() returns an array of Positions,
61 * this method gets the preferred length of that returned array.
62 * @return The preferred length of the desired position array
63 * @see getDesiredPosition(Map, int)
64 */
65 public int getScale();
66 }