com.gmail.thejcwk.semantics.jgraph.topicmap
Class TopicMapLayout

java.lang.Object
  extended by com.gmail.thejcwk.semantics.jgraph.topicmap.TopicMapLayout

public class TopicMapLayout
extends java.lang.Object

A class describing the layout of a topic map. The client can change the dimensions of the topic map and divide it into equal horisontal slices. A client can then allocate a set of Objects to these slices. A position will be allocated to a cell for every Object in this collection. The corresponding Object will be used to index that cell.

Version:
2.0
Author:
Jan Kroeze
See Also:
SectionLayout

Constructor Summary
TopicMapLayout(double aWidth, double aHeight, int aSectionCount)
          Construct a new layout for a topic map.
 
Method Summary
 void addSection(int indexStart, int indexEnd, java.lang.Object[] someObjects)
          Add a section to the map.
 java.awt.geom.Rectangle2D.Double getCellBounds(java.lang.Object index)
          Returns the bounds of the cell associated with index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicMapLayout

public TopicMapLayout(double aWidth,
                      double aHeight,
                      int aSectionCount)
Construct a new layout for a topic map.

Parameters:
aWidth - Width of the topic map.
aHeight - Height of the topic map.
aSectionCount - Amount of sections that the map should have.
Method Detail

addSection

public void addSection(int indexStart,
                       int indexEnd,
                       java.lang.Object[] someObjects)
Add a section to the map.

Parameters:
indexStart - At which position to add the section. The section will start here. (Precondition: 0 <= indexStart < amount of sections) (Precondition: indexStart <= indexEnd)
indexEnd - Where to stop this section. (Precondition: 0 <= indexEnd < amount of sections) (Precondition: indexEnd >= indexStart)
someObjects - The objects used to index cells allocated in this section.

getCellBounds

public java.awt.geom.Rectangle2D.Double getCellBounds(java.lang.Object index)
Returns the bounds of the cell associated with index.

Parameters:
index - Any object.
Returns:
A Rectangle2D.Double object.