- Timestamp:
- 04/02/19 15:19:35 (5 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/agents/SearchAgent.java
r1102 r1276 98 98 + "]"+getResultsTitleSuffix(); 99 99 _results = new FrameCreator(resultsFrameset, FrameIO.FRAME_PATH, title, 100 false, true);100 FrameCreator.ExistingFramesetOptions.CreateNewFramesOnly, true); 101 101 // Set the frame to be displayed after running the agent 102 102 _end = _results.getFirstFrame(); -
trunk/src/org/expeditee/agents/mail/MailSession.java
r1142 r1276 527 527 final FrameCreator frames = new FrameCreator(frame 528 528 .getFramesetName(), frame.getPath(), subject, 529 false, false);529 FrameCreator.ExistingFramesetOptions.CreateNewFramesOnly, false); 530 530 531 531 frames.addText("@date: " + message.getSentDate(), null, -
trunk/src/org/expeditee/auth/gui/MailBay.java
r1275 r1276 1 1 package org.expeditee.auth.gui; 2 2 3 import java.io.File;4 3 import java.util.LinkedList; 5 4 import java.util.List; … … 23 22 24 23 public class MailBay { 25 public static final String EXPEDITEE_MAIL_FRAMESET_NAME = " ExpediteeMail";24 public static final String EXPEDITEE_MAIL_FRAMESET_NAME = "expediteemail"; 26 25 27 26 /** The y position of the header to the mail bay. */ … … 35 34 private static final int OFFSET_X = 20; 36 35 37 38 36 /** Buffer image of the mail window. */ 39 37 private static Image _mailBuffer; … … 95 93 if (_creator == null || currentUser != UserSettings.UserName.get()) { 96 94 currentUser = UserSettings.UserName.get(); 97 _creator = new FrameCreator(EXPEDITEE_MAIL_FRAMESET_NAME, FrameIO.MAIL_PATH, EXPEDITEE_MAIL_FRAMESET_NAME, true, false); 98 _creator.setTitle("Expeditee Mail"); 95 _creator = new FrameCreator(EXPEDITEE_MAIL_FRAMESET_NAME, FrameIO.MAIL_PATH, EXPEDITEE_MAIL_FRAMESET_NAME, FrameCreator.ExistingFramesetOptions.ReobtainStateFromExistingFrames, false); 99 96 } 100 97 -
trunk/src/org/expeditee/gui/FrameCreator.java
r1258 r1276 50 50 private Item _Mfirst; 51 51 52 // Next and previous links for the current frame53 // private Item _next;54 55 // private Item _prev;56 57 52 private Frame _firstFrame; 58 53 59 54 private boolean _multiColumn; 55 56 public enum ExistingFramesetOptions { 57 /** 58 * Do not attempt to use any existing frames in specified framesets. 59 */ 60 CreateNewFramesOnly, 61 /** 62 * Override any existing frames in specified framesets. 63 */ 64 OverrideExistingFrames, 65 /** 66 * Use the existing frames in the framesets to reobtain what the state of the FrameCreator should be. 67 */ 68 ReobtainStateFromExistingFrames 69 } 60 70 61 71 private final List<Frame> framesCreated = new LinkedList<Frame>(); … … 63 73 public FrameCreator(String frameTitle) { 64 74 this(DisplayController.getCurrentFrame().getFramesetName(), DisplayController 65 .getCurrentFrame().getPath(), frameTitle, false, false); 75 .getCurrentFrame().getPath(), frameTitle, ExistingFramesetOptions.CreateNewFramesOnly, false); 76 } 77 78 public FrameCreator(String framesetName, String path, String frameTitle, ExistingFramesetOptions establishState, boolean multiColumn) { 79 if (establishState == ExistingFramesetOptions.ReobtainStateFromExistingFrames) { 80 initialiseReobtainState(framesetName, path, frameTitle, establishState, multiColumn); 81 } else { 82 initialiseStandard(framesetName, path, frameTitle, establishState, multiColumn); 83 } 84 } 85 86 private void initialiseReobtainState(String framesetName, String path, String frameTitle, ExistingFramesetOptions establishState, boolean multiColumn) { 87 _multiColumn = multiColumn; 88 _Mnext = createButton("@Next", null, null, 10, 15); 89 _Mprev = createButton("@Previous", null, null, _Mnext.getBoundsWidth() + _Mnext.getAnchorRight() + 20, 15); 90 _Mfirst = createButton("@First", null, null, _Mprev.getBoundsWidth() + _Mprev.getAnchorRight() + 20, 15); 91 92 int lastNumber = FrameIO.getLastNumber(framesetName); 93 for (int i = 1; i <= lastNumber; i++) { 94 Frame frame = FrameIO.LoadFrame(framesetName + i, path); 95 this.framesCreated.add(frame); 96 } 97 if (this.framesCreated.isEmpty()) { 98 initialiseStandard(framesetName, path, frameTitle, ExistingFramesetOptions.CreateNewFramesOnly, multiColumn); 99 return; 100 } 101 _firstFrame = this.framesCreated.get(0); 102 _current = this.framesCreated.get(this.framesCreated.size() - 1); 103 104 createNextFrame(); 105 } 106 107 private void initialiseStandard(String framesetName, String path, String frameTitle, ExistingFramesetOptions establishState, 108 boolean multiColumn) { 109 _multiColumn = multiColumn; 110 _Mnext = createButton("@Next", null, null, 10, 15); 111 112 _Mprev = createButton("@Previous", null, null, _Mnext.getBoundsWidth() 113 + _Mnext.getAnchorRight() + 20, 15); 114 115 _Mfirst = createButton("@First", null, null, _Mprev.getBoundsWidth() 116 + _Mprev.getAnchorRight() + 20, 15); 117 118 Frame toUse = null; 119 try { 120 toUse = FrameIO.CreateFrameset(framesetName, path, establishState == ExistingFramesetOptions.CreateNewFramesOnly ? false : true); 121 } catch (ExistingFramesetException efe) { 122 // Need a comment here to explain why this catch() clause is empty 123 // (or else it should be throwing an exception) 124 } catch (Exception e) { 125 e.printStackTrace(); 126 } 127 128 if (toUse == null) { 129 toUse = FrameIO.CreateFrame(framesetName, frameTitle, null); 130 this.framesCreated.add(toUse); 131 } 132 133 resetGlobals(toUse); 134 _firstFrame = toUse; 66 135 } 67 136 … … 106 175 } 107 176 108 public FrameCreator(String name, String path, String frameTitle, boolean recreate, boolean multiColumn)109 {110 _multiColumn = multiColumn;111 _Mnext = createButton("@Next", null, null, 10, 15);112 113 _Mprev = createButton("@Previous", null, null, _Mnext.getBoundsWidth()114 + _Mnext.getAnchorRight() + 20, 15);115 116 _Mfirst = createButton("@First", null, null, _Mprev.getBoundsWidth()117 + _Mprev.getAnchorRight() + 20, 15);118 119 Frame toUse = null;120 try {121 toUse = FrameIO.CreateFrameset(name, path, recreate);122 } catch (ExistingFramesetException efe) {123 // Need a comment here to explain why this catch() clause is empty124 // (or else it should be throwing an exception)125 } catch (Exception e) {126 e.printStackTrace();127 }128 129 if (toUse == null) {130 toUse = FrameIO.CreateFrame(name, frameTitle, null);131 this.framesCreated.add(toUse);132 }133 134 resetGlobals(toUse);135 _firstFrame = toUse;136 137 // set positions of next\prev frame links138 // _Mnext.setPosition(FrameGraphics.getMaxSize().width - 100,139 // FrameGraphics.getMaxSize().height - 15);140 // _Mprev.setPosition(50, FrameGraphics.getMaxSize().height - 15);141 }142 143 177 public String getName() { 144 178 return _firstFrame.getName(); -
trunk/src/org/expeditee/gui/MessageBay.java
r1258 r1276 258 258 259 259 if (_creator == null) { 260 _creator = new FrameCreator(MESSAGES_FRAMESET_NAME, FrameIO.MESSAGES_PATH, MESSAGES_FRAMESET_NAME, true,260 _creator = new FrameCreator(MESSAGES_FRAMESET_NAME, FrameIO.MESSAGES_PATH, MESSAGES_FRAMESET_NAME, FrameCreator.ExistingFramesetOptions.OverrideExistingFrames, 261 261 false); 262 262 } -
trunk/src/org/expeditee/settings/Settings.java
r1269 r1276 230 230 private static void generateSettingsTree(String page, Text text) { 231 231 Frame parent = text.getParentOrCurrentFrame(); 232 FrameCreator frames = new FrameCreator(parent.getFramesetName(), parent.getPath(), page, false, false);232 FrameCreator frames = new FrameCreator(parent.getFramesetName(), parent.getPath(), page, FrameCreator.ExistingFramesetOptions.CreateNewFramesOnly, false); 233 233 text.setLink(frames.getName()); 234 234
Note:
See TracChangeset
for help on using the changeset viewer.