source: other-projects/GlamED/trunk/src/org/honours/agents/CollectionSpaceAgent.java@ 26609

Last change on this file since 26609 was 26609, checked in by davidb, 11 years ago

Added in action and agent code for GlamED's Collection Space feature.

File size: 1001 bytes
Line 
1package org.honours.agents;
2
3import org.expeditee.agents.DefaultAgent;
4import org.expeditee.gui.Frame;
5import org.expeditee.gui.FrameIO;
6import org.honours.Main;
7import org.honours.collection.Collection;
8import org.honours.CollectionSpace.CollectionSpace;
9
10public class CollectionSpaceAgent extends DefaultAgent {
11
12
13 private Collection _collection;
14 private CollectionSpace _collectionSpace;
15
16 public Frame process(Frame frame) {
17
18 _collection = Collection.findCollection(frame);
19
20 if(_collection.getCollectionSpace() == null){
21 //create a new collection space.
22 _collectionSpace = new CollectionSpace(_collection);
23 _collection.setCollectionSpace(_collectionSpace);
24 _collectionSpace.generate();
25
26 int index = Collection.getCollectionPosition(_collection);
27 Main._collections.remove(index);
28 Main._collections.add(index, _collection);
29
30 return FrameIO.LoadFrame(_collectionSpace.getName() + "1");
31 }
32
33
34 return null;
35 }
36
37
38
39}
Note: See TracBrowser for help on using the repository browser.