View Javadoc

1   package org.molwind.view;
2   
3   /*
4    * This file is part of Molwind.
5    *
6    * Molwind is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU General Public License as published by
8    * the Free Software Foundation, either version 3 of the License, or
9    * (at your option) any later version.
10   *
11   * Molwind is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14   * GNU General Public License for more details.
15   *
16   * You should have received a copy of the GNU General Public License
17   * along with Molwind. If not, see <http://www.gnu.org/licenses/>.
18   */
19  import java.util.Iterator;
20  
21  import org.molwind.model.LayeredPosition;
22  import org.molwind.model.RelationshipResolver;
23  import org.molwind.view.TopologyManager;
24  
25  /**
26   * AbstractTopologyManager determines and places visible chemical structures.
27   *
28   * @author <a href="mailto:oliver.karch@molwind.org">Oliver Karch</a>
29   * @version 1.0
30   */
31  public abstract class AbstractTopologyManager implements TopologyManager {
32      private Iterator entityIterator;
33      private RelationshipResolver relationshipResolver;
34  
35      /**
36       * Creates a new topology manager to place chemical entities.
37       */
38      protected AbstractTopologyManager() {
39          entityIterator = null;
40          relationshipResolver = null;
41      }
42  
43      /**
44       * Get the EntityIterator value.
45       *
46       * @return
47       *      the EntityIterator value
48       */
49      public Iterator getEntityIterator() {
50          return entityIterator;
51      }
52  
53      /**
54       * Set the EntityIterator value.
55       *
56       * @param newEntityIterator
57       *      the new EntityIterator value
58       */
59      public void setEntityIterator(final Iterator newEntityIterator) {
60          this.entityIterator = newEntityIterator;
61      }
62  
63      /**
64       * Get the RelationshipResolver value.
65       *
66       * @return
67       *      the RelationshipResolver value
68       */
69      public RelationshipResolver getRelationshipResolver() {
70          return relationshipResolver;
71      }
72  
73      /**
74       * Set the RelationshipResolver value.
75       *
76       * @param newRelationshipResolver
77       *      the new RelationshipResolver value
78       */
79      public void setRelationshipResolver(
80              final RelationshipResolver newRelationshipResolver) {
81          this.relationshipResolver = newRelationshipResolver;
82      }
83  
84      /**
85       * Determines the visible entities for the given position.
86       *
87       * @param position
88       *      the position (longitude/latitude/level)
89       * @return
90       *      an (possibly empty) iterator of entities
91       */
92      public abstract Iterator getVisibleEntities(final LayeredPosition position);
93  
94  }