com.gmail.thejcwk.semantics.topicmaps
Class TopicMapLayout

java.lang.Object
  extended by com.gmail.thejcwk.semantics.topicmaps.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 the 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(java.lang.String name, 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(java.lang.String name,
                       int indexStart,
                       int indexEnd,
                       java.lang.Object[] someObjects)
Add a section to the map.

Parameters:
name - A String that uniquely identifies this section. (Precondition: name must be unique)
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.