View Javadoc

1   /*
2   
3       dsh-venn  Lightweight components for venn diagrams.
4       Copyright (c) 2009-2013 held jointly by the individual authors.
5   
6       This library is free software; you can redistribute it and/or modify it
7       under the terms of the GNU Lesser General Public License as published
8       by the Free Software Foundation; either version 3 of the License, or (at
9       your option) any later version.
10  
11      This library is distributed in the hope that it will be useful, but WITHOUT
12      ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or
13      FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14      License for more details.
15  
16      You should have received a copy of the GNU Lesser General Public License
17      along with this library;  if not, write to the Free Software Foundation,
18      Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
19  
20      > http://www.fsf.org/licensing/licenses/lgpl.html
21      > http://www.opensource.org/licenses/lgpl-license.php
22  
23  */
24  package org.dishevelled.venn;
25  
26  import java.awt.Shape;
27  
28  import java.awt.geom.Point2D;
29  
30  import java.awt.geom.Rectangle2D;
31  
32  /**
33   * Result of a venn diagram layout operation.
34   *
35   * @author  Michael Heuer
36   */
37  public interface VennLayout
38  {
39  
40      /**
41       * Return the number of shapes in this venn layout.
42       *
43       * @return the number of shapes in this venn layout
44       */
45      int size();
46  
47      /**
48       * Return the shape at the specified index in this venn layout.
49       *
50       * @param index index
51       * @return the shape at the specified index in this venn layout
52       * @throws IndexOutOfBoundsException if <code>index</code> is out of bounds
53       */
54      Shape get(int index);
55  
56      /**
57       * Return the lune center of the intersecting area defined by the specified indices.
58       *
59       * @param index first index
60       * @param additional variable number of additional indices, if any
61       * @return the lune center of the intersecting area defined by the specified indices
62       * @throws IndexOutOfBoundsException if <code>index</code> or any of <code>additional</code>
63       *    are out of bounds, or if too many indices are specified
64       */
65      Point2D luneCenter(int index, int... additional);
66  
67      /**
68       * Return the bounding rectangle of this venn layout.
69       *
70       * @return the bounding rectangle of this venn layout
71       */
72      Rectangle2D boundingRectangle();
73  }