Changeset 8
- Timestamp:
- 05/01/08 15:12:45 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/agents/CopyTree.java
r7 r8 33 33 _nameFrom = init.getFramesetName().toLowerCase(); 34 34 35 // get the last used frame in the destination frameset 36 _lastNumber = FrameIO.getLastNumber(_nameTo); 35 // create the new frameset 36 try { 37 // get the last used frame in the destination frameset 38 _lastNumber = FrameIO.getLastNumber(_nameTo); 39 Frame one = FrameIO.CreateFrameset(_nameTo, init.path); 37 40 38 if (_lastNumber < 0) { 39 // create the new frameset 40 try { 41 Frame one = FrameIO.CreateFrameset(_nameTo, init.path); 41 _framePath = one.path; 42 _lastNumber = -1; 43 _firstNumber = 1; 42 44 43 _framePath = one.path; 44 _lastNumber = -1; 45 _firstNumber = 1; 46 47 // copy the original .0 frame 48 Frame zero = FrameIO.LoadFrame(init.getFramesetNameAdjusted() 49 + "0"); 50 processFrame(zero); 51 } catch (Exception e) { 52 // TODO fix this up later. 53 } 54 } else { 45 // copy the original .0 frame 46 Frame zero = FrameIO 47 .LoadFrame(init.getFramesetNameAdjusted() + "0"); 48 processFrame(zero); 49 } catch (ExistingFramesetException efe) { 55 50 // get the frame path 56 51 Frame zero = FrameIO.LoadFrame(_nameTo + "0"); 57 52 _framePath = zero.path; 58 53 _firstNumber = _lastNumber + 1; 54 } catch (Exception e) { 55 return false; 59 56 } 60 57 -
trunk/src/org/expeditee/gui/Browser.java
r7 r8 38 38 39 39 public static Browser _theBrowser; 40 40 41 41 /** 42 42 * Constructs a new Browser object, then launches it … … 51 51 // FrameGraphics.ForceRepaint(); 52 52 } 53 53 54 54 public void setSizes(Dimension size) { 55 55 setSize(size); … … 77 77 Frame profile = FrameIO.LoadProfile(UserSettings.Username); 78 78 if (profile == null) { 79 try{ 80 profile = FrameIO.CreateNewProfile(UserSettings.Username); 81 }catch(Exception e){ 82 //TODO fix this later 79 try { 80 profile = FrameIO.CreateNewProfile(UserSettings.Username); 81 } catch (Exception e) { 82 //TODO tell the user that there was a problem creating the profile frame and close nicely 83 assert(false); 83 84 } 84 85 } … … 128 129 // Create the action handler for the 129 130 FrameMouseActions mouse = new FrameMouseActions(); 130 131 131 132 this.getContentPane().addMouseListener(mouse); 132 133 this.getContentPane().addMouseMotionListener(mouse); … … 156 157 super.paint(g); 157 158 FrameGraphics.Repaint(); 158 // System.out.print('p');159 // System.out.print('p'); 159 160 } 160 161 … … 166 167 setupGraphics(); 167 168 repaint(); 168 // System.out.println("Resize");169 // System.out.println("Resize"); 169 170 } 170 171 … … 205 206 206 207 public void windowActivated(WindowEvent e) { 207 // System.out.println("Activated");208 // System.out.println("Activated"); 208 209 } 209 210 … … 217 218 */ 218 219 public void windowStateChanged(WindowEvent e) { 219 // FrameGraphics.Repaint();220 // System.out.println('C');220 // FrameGraphics.Repaint(); 221 // System.out.println('C'); 221 222 } 222 223 -
trunk/src/org/expeditee/gui/FrameIO.java
r7 r8 11 11 import java.util.HashMap; 12 12 13 import org.expeditee.agents.ExistingFramesetException; 13 14 import org.expeditee.io.Conversion; 14 15 import org.expeditee.io.ExpReader; … … 418 419 int lastNumber = FrameIO.getLastNumber(DELETED_FRAMES); 419 420 String framePath; 420 try {421 try { 421 422 // create the new frameset 422 423 Frame one = FrameIO.CreateFrameset(DELETED_FRAMES, toDelete.path); 423 424 framePath = one.path; 424 425 lastNumber = 0; 425 } catch (Exception e){426 } catch (Exception e) { 426 427 Frame zero = FrameIO.LoadFrame(DELETED_FRAMES + "0"); 427 428 framePath = zero.path; … … 565 566 * @return The first Frame of the new Frameset (Frame.1) 566 567 */ 567 public static Frame CreateFrameset(String frameset, String path) throws Exception{ 568 public static Frame CreateFrameset(String frameset, String path) 569 throws Exception { 568 570 return CreateFrameset(frameset, path, false); 569 571 } … … 585 587 586 588 // String must begin with a letter and end with a digit 587 if (!(Character.isLetter(frameName.charAt(0)) || Character.isDigit(frameName.charAt(0))) 589 if (!(Character.isLetter(frameName.charAt(0)) || Character 590 .isDigit(frameName.charAt(0))) 588 591 || !Character.isDigit(frameName.charAt(frameName.length() - 1))) 589 592 return false; … … 713 716 } 714 717 715 public static Frame CreateNewProfile(String username) throws Exception {718 public static Frame CreateNewProfile(String username) throws Exception { 716 719 Frame profile = CreateFrameset(username, PROFILE_PATH); 717 720 FrameUtils.CreateDefaultProfile(profile); … … 771 774 } 772 775 773 private static String NameValidation(String toValidate) throws Exception {776 private static String NameValidation(String toValidate) throws Exception { 774 777 String result = ""; 775 778 … … 780 783 // check for illegal characters 781 784 if (ILLEGAL_CHARS.contains("" + cur)) { 782 throw new Exception("Frameset name contains illegal character '" 783 + cur + "' at position " + (i + 1)); 785 throw new Exception( 786 "Frameset name contains illegal character '" + cur 787 + "' at position " + (i + 1)); 784 788 } 785 789 … … 796 800 if (result.length() >= MAX_NAME_LENGTH) { 797 801 throw new Exception("Frameset name is too long (Max " 798 802 + MAX_NAME_LENGTH + " characters)"); 799 803 } 800 804 } … … 835 839 * frame) 836 840 */ 837 public static Frame CreateNewFrameset(String name) throws Exception {841 public static Frame CreateNewFrameset(String name) throws Exception { 838 842 String path = DisplayIO.getCurrentFrame().path; 839 843 … … 887 891 888 892 public static Frame CreateFrameset(String frameset, String path, 889 boolean recreate) throws Exception {893 boolean recreate) throws Exception { 890 894 String conversion = frameset + " --> "; 891 895 … … 897 901 898 902 if (!recreate && FrameIO.DoesFramesetExist(frameset)) { 899 throw new Ex ception("A frameset called " + frameset + " already exists.");903 throw new ExistingFramesetException(frameset); 900 904 } 901 905 -
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r7 r8 8 8 import java.awt.event.KeyEvent; 9 9 import java.awt.event.KeyListener; 10 import java.io.IOException;11 10 import java.util.ArrayList; 12 11 import java.util.LinkedList; … … 16 15 import org.expeditee.actions.Actions; 17 16 import org.expeditee.actions.Simple; 17 import org.expeditee.agents.ExistingFramesetException; 18 18 import org.expeditee.io.Logger; 19 19 import org.expeditee.items.Dot; … … 1330 1330 linkTo.moveMouseToDefaultLocation(); 1331 1331 // this needs to be done if the user doesnt move the mouse before 1332 // doing 1333 // tdfc while the cursor is set to the text cursor 1332 // doing Tdfc while the cursor is set to the text cursor 1334 1333 DisplayIO.setCursor(Item.DEFAULT_CURSOR); 1335 } catch (IOException ioe) { 1336 FrameGraphics 1337 .ErrorMessage("An error occured when trying to create the new frameset"); 1334 } catch (ExistingFramesetException efe) { 1335 FrameGraphics.ErrorMessage(efe.getMessage()); 1338 1336 } catch (Exception e) { 1337 FrameGraphics.ErrorMessage("Frameset could not be created: " 1338 + e.getMessage()); 1339 1339 } 1340 1340 }
Note:
See TracChangeset
for help on using the changeset viewer.