source: other-projects/GlamED/trunk/src/org/honours/actions/CollectionSpaceActions.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: 1.7 KB
Line 
1package org.honours.actions;
2
3import org.expeditee.actions.Navigation;
4import org.expeditee.gui.DisplayIO;
5import org.expeditee.gui.Frame;
6import org.expeditee.gui.FrameIO;
7import org.expeditee.gui.MessageBay;
8import org.honours.agents.CollectionSpaceAgent;
9import org.honours.collection.Collection;
10import org.honours.CollectionSpace.CollectionSpace;
11
12public class CollectionSpaceActions {
13
14 public static void RotateNext()
15 {
16 CollectionNavigation.Next(DisplayIO.getCurrentFrame());
17 }
18
19 public static void RotateBack()
20 {
21 CollectionNavigation.Previous(DisplayIO.getCurrentFrame());
22 }
23
24 public static void GoToCollectionSpace(String name){
25 try{
26 String cs = "collectionspace-" + name;
27 MessageBay.displayMessage("cs = " + cs);
28 Navigation.Goto(cs + "1");
29 }catch(Exception e){
30 e.printStackTrace();
31 }
32 }
33
34 public static void GenerateCollectionSpace(){
35 GenerateCollectionSpace(DisplayIO.getCurrentFrame());
36 }
37
38 public static void GenerateCollectionSpace(String frameName){
39 GenerateCollectionSpace(FrameIO.LoadFrame(frameName+1));
40 }
41
42 public static void GenerateCollectionSpace(Frame frame){
43 CollectionSpaceAgent csa = new CollectionSpaceAgent();
44 csa.process(frame);
45 }
46
47 public static void GoToCollectionSpace(){
48 GoToCollectionSpace(DisplayIO.getCurrentFrame());
49 }
50
51 public static void GoToCollectionSpace(Frame frame){
52 Collection collect = Collection.findCollection(frame);
53 if(collect != null){
54 CollectionSpace findCS = collect.getCollectionSpace();
55
56 if(findCS != null){
57 Navigation.Goto(findCS.getName() + "1");
58 }else{
59 GenerateCollectionSpace(frame);
60 Navigation.Goto("collectionspace-" + collect.getName() + "1");
61 }
62 }
63 }
64
65
66}
Note: See TracBrowser for help on using the repository browser.