Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.eireneh.bible.control.map
Class Map  view Map download Map.java

java.lang.Object
  extended bycom.eireneh.bible.control.map.Map
All Implemented Interfaces:
java.io.Serializable

public class Map
extends java.lang.Object
implements java.io.Serializable

A map is an array of Nodes (verses with position).
Distribution Licence:
Project B is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, by writing to Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, Or locally at the Licence link below.
The copyright to this program is held by it's authors.

Version:
D0.I0.T0

Field Summary
private  Position cog
          The current center of gravity
private  int dimensions
          The number of dimensions in the display
static int LINKS_PER_NODE
          The number of links that we track for a node
protected  com.eireneh.util.EventListenerList listeners
          The list of listeners
private static int MAX_REPLIES
          What is the maximum calculations between re-calcing the CoG
private  Position[] nodes
          The array of verse nodes
private  int replies
          How long until we next calculate the center of gravity
(package private) static long serialVersionUID
          Serialization ID - a serialization of nodes and dimensions
 
Constructor Summary
Map(int dimensions)
          Basic constructor
 
Method Summary
 void addMapListener(MapListener li)
          Add a map listener to the list of things wanting to know whenever we make some changes to the map
 void applyRules(Rule[] rules)
          Apply the rules to the map.
static Position average(Position[] array)
          Find the avaerage position of an array of Positions
static Position[] cat(Position[][] dar)
          Take an array of Position arrays can cat them all together to make a single array containing all of them.
protected  void fireMapChanged(int ord)
          Called to fire a MapEvent to all the Listeners, when a single node has changed position.
protected  void fireMapRewritten()
          Called to fire a MapEvent to all the Listeners, when a single node has changed position.
 Position getCenterOfGravity()
          What is the average position of all the nodes in this map
 int getDimensions()
          Get the number of dimensions in the nodes in this map
 com.eireneh.util.EventListenerList getEventListenerList()
          Before we save/load something to/from disk we want to ensure that we don't loose the list of things that have registered to recieve map change events.
 float[] getPosition(int ord)
          Get the position (as a float array) of a node by the ordinal number of the verse that it contains
 float getPositionDimension(int ord, int idx)
          Get the position (as a float array) of a node by the ordinal number of the verse that it contains
private  void readObject(java.io.ObjectInputStream in)
          Initialize the transient fields
 void removeMapListener(MapListener li)
          Remove a progress listener from the list of things wanting to know whenever we make some progress
 void setEventListenerList(com.eireneh.util.EventListenerList listeners)
          Before we save/load something to/from disk we want to ensure that we don't loose the list of things that have registered to recieve map change events.
 void setLayoutRandom()
          Fix the layout to a fairly random one
 void setLayoutSimple()
          Fix the layout to a simple book/chapter line default
 void setPosition(int ord, float[] pos)
          Get the position of a node by the ordinal number of the verse that it contains
 void setPositionDimension(int ord, int idx, float f)
          Get the position of a node by the ordinal number of the verse that it contains
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_REPLIES

private static final int MAX_REPLIES
What is the maximum calculations between re-calcing the CoG

See Also:
Constant Field Values

cog

private Position cog
The current center of gravity


replies

private int replies
How long until we next calculate the center of gravity


nodes

private Position[] nodes
The array of verse nodes


dimensions

private int dimensions
The number of dimensions in the display


LINKS_PER_NODE

public static final int LINKS_PER_NODE
The number of links that we track for a node

See Also:
Constant Field Values

listeners

protected transient com.eireneh.util.EventListenerList listeners
The list of listeners


serialVersionUID

static final long serialVersionUID
Serialization ID - a serialization of nodes and dimensions

See Also:
Constant Field Values
Constructor Detail

Map

public Map(int dimensions)
Basic constructor

Method Detail

getDimensions

public int getDimensions()
Get the number of dimensions in the nodes in this map


getPosition

public float[] getPosition(int ord)
Get the position (as a float array) of a node by the ordinal number of the verse that it contains


getPositionDimension

public float getPositionDimension(int ord,
                                  int idx)
Get the position (as a float array) of a node by the ordinal number of the verse that it contains


setPosition

public void setPosition(int ord,
                        float[] pos)
Get the position of a node by the ordinal number of the verse that it contains


setPositionDimension

public void setPositionDimension(int ord,
                                 int idx,
                                 float f)
Get the position of a node by the ordinal number of the verse that it contains


setLayoutRandom

public void setLayoutRandom()
Fix the layout to a fairly random one


setLayoutSimple

public void setLayoutSimple()
Fix the layout to a simple book/chapter line default


applyRules

public void applyRules(Rule[] rules)
Apply the rules to the map.


addMapListener

public void addMapListener(MapListener li)
Add a map listener to the list of things wanting to know whenever we make some changes to the map


removeMapListener

public void removeMapListener(MapListener li)
Remove a progress listener from the list of things wanting to know whenever we make some progress


getEventListenerList

public com.eireneh.util.EventListenerList getEventListenerList()
Before we save/load something to/from disk we want to ensure that we don't loose the list of things that have registered to recieve map change events.


setEventListenerList

public void setEventListenerList(com.eireneh.util.EventListenerList listeners)
Before we save/load something to/from disk we want to ensure that we don't loose the list of things that have registered to recieve map change events.


getCenterOfGravity

public Position getCenterOfGravity()
What is the average position of all the nodes in this map


fireMapChanged

protected void fireMapChanged(int ord)
Called to fire a MapEvent to all the Listeners, when a single node has changed position.


fireMapRewritten

protected void fireMapRewritten()
Called to fire a MapEvent to all the Listeners, when a single node has changed position.


cat

public static Position[] cat(Position[][] dar)
Take an array of Position arrays can cat them all together to make a single array containing all of them.


average

public static Position average(Position[] array)
Find the avaerage position of an array of Positions


readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Initialize the transient fields