1 | package org.honours.actions;
|
---|
2 |
|
---|
3 | import org.expeditee.actions.Navigation;
|
---|
4 | import org.expeditee.gui.DisplayIO;
|
---|
5 | import org.expeditee.gui.Frame;
|
---|
6 | import org.expeditee.gui.FrameIO;
|
---|
7 | import org.expeditee.gui.MessageBay;
|
---|
8 | import org.honours.agents.CollectionSpaceAgent;
|
---|
9 | import org.honours.collection.Collection;
|
---|
10 | import org.honours.CollectionSpace.CollectionSpace;
|
---|
11 |
|
---|
12 | public 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 | } |
---|