source: other-projects/GlamED/trunk/src/org/honours/actions/ApplyDisplayToCollection.java@ 26588

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

Initial import of Korii's 520 project for managing digital cultural collections from Greenstone in Expeditee.

File size: 2.3 KB
Line 
1package org.honours.actions;
2
3import java.util.ArrayList;
4import java.util.List;
5
6import org.expeditee.gui.*;
7import org.expeditee.items.Dot;
8import org.expeditee.items.Item;
9import org.expeditee.items.ItemParentStateChangedEvent;
10import org.expeditee.items.Line;
11import org.expeditee.items.Picture;
12import org.expeditee.items.Text;
13import org.honours.collection.Collection;
14import org.honours.collection.CollectionItem;
15import org.honours.items.Data;
16
17/**
18 * When editing the display of the current frame in
19 * a collection set, change all the other frames so they
20 * look the same.
21 * @author Korii
22 */
23public class ApplyDisplayToCollection {
24
25 /*the manually changed frame which we compare
26 with all the other frames in the frameset.*/
27 private static Frame _comparisonFrame;
28 private static List<Item> _comparisonFrameItems; //items on the comparison frame.
29
30 private static Collection _collection;
31
32 /**
33 * Updates all frames based on the current frame being viewed.
34 */
35 public static void updateAllFrames(){
36 updateAllFrames(DisplayIO.getCurrentFrame());
37 }
38
39 /**
40 * Updates all frames based on the passed frame.
41 * @param frame - the frame used to change the display of
42 * the other frames in the same frameset.
43 */
44 public static void updateAllFrames(Frame frame){
45
46 if(frame == null){
47 MessageBay.errorMessage("ERROR: Can't update display. Item cannot be found.");
48 return;
49 }
50
51 _comparisonFrame = frame;
52
53 _comparisonFrameItems = _comparisonFrame.getItems();
54
55 //Find matching collection.
56 _collection = Collection.findCollection(_comparisonFrame);
57
58 for(CollectionItem ci : _collection.getItems()){
59 Frame currCiFrame = ci.getFrame();
60 if(currCiFrame == DisplayIO.getCurrentFrame())
61 continue;
62
63 MessageBay.displayMessage("Updating display of: " + currCiFrame.getName());
64 changeItemDisplay(ci,currCiFrame);
65 }
66
67 }
68
69 /**
70 * Change the passed Collection Item's display.
71 * @param ci - the collection item, whose display we want to change.
72 * @param frame - the collection item's frame representation.
73 */
74 private static void changeItemDisplay(CollectionItem ci, Frame frame){
75
76 List<Item> list = frame.getItems(true);
77 List<Item> saved = new ArrayList<Item>();
78 }
79
80}
Note: See TracBrowser for help on using the repository browser.