Changeset 13
- Timestamp:
- 05/06/08 12:10:11 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/NavigationActions.java
r4 r13 124 124 Frame last = FrameIO.LoadLast(); 125 125 FrameUtils.DisplayFrame(last, true); 126 } 127 128 public static void ZeroFrame() { 129 Frame zeroFrame = FrameIO.LoadZero(); 130 FrameUtils.DisplayFrame(zeroFrame, true); 126 131 } 127 132 -
trunk/src/org/expeditee/gui/DisplayIO.java
r10 r13 59 59 * The title to display in the Title bar. 60 60 */ 61 public static final String TITLE = "Exp01May2008 A";61 public static final String TITLE = "Exp01May2008B"; 62 62 63 63 private DisplayIO() { -
trunk/src/org/expeditee/gui/Frame.java
r10 r13 476 476 } 477 477 _frameName = new Text(id); 478 _frameName.setParent(this); 478 479 _frameName.setMaxSize(FrameGraphics.getMaxFrameSize()); 479 480 _frameName.setText(getFramesetNameAdjusted() + _number); -
trunk/src/org/expeditee/gui/FrameGraphics.java
r10 r13 567 567 568 568 public static void DisplayMessageAlways(String message) { 569 _lastMessage = null;569 //_lastMessage = null; 570 570 displayMessage(message, null, Color.BLACK); 571 571 Misc.Beep(); … … 577 577 } 578 578 579 private static String _lastMessage = null;579 //private static String _lastMessage = null; 580 580 581 581 private static void displayMessage(String message, String link, Color color) { 582 582 // add timestamp to message 583 if (message.equals(_lastMessage))584 return;585 _lastMessage = message;583 //if (message.equals(_lastMessage)) 584 // return; 585 //_lastMessage = message; 586 586 587 587 // message += _formatter.format(Calendar.getInstance().getTime()); -
trunk/src/org/expeditee/gui/FrameIO.java
r12 r13 387 387 return null; 388 388 } 389 389 390 public static Frame LoadZero(String framesetName, String path) { 391 String adjustedName = FrameUtils.GetFramesetNameAdjusted(framesetName); 392 return LoadFrame(adjustedName + 0); 393 } 394 395 public static Frame LoadZero() { 396 Frame current = DisplayIO.getCurrentFrame(); 397 return LoadZero(current.getFramesetName(), current.path); 398 } 399 390 400 public static Frame LoadLast() { 391 401 Frame current = DisplayIO.getCurrentFrame(); … … 891 901 String conversion = frameset + " --> "; 892 902 893 // ensure the framename is valid 894 frameset = ConvertToValidFramesetName(frameset); 895 896 if (frameset == null) 903 if (! IsValidFramesetName(frameset)){ 897 904 throw new Exception("Invalid frameset name"); 898 905 } 906 899 907 if (!recreate && FrameIO.DoesFramesetExist(frameset)) { 900 908 throw new ExistingFramesetException(frameset); … … 957 965 958 966 return base; 959 } 967 }private static boolean IsValidFramesetName(String frameset) { 968 for (int i = 0; i < frameset.length(); i++) { 969 // capitalize all characters after spaces 970 if (!Character.isLetterOrDigit(frameset.charAt(i))) { 971 return false; 972 } 973 } 974 return true; 975 } 976 977 960 978 961 979 public static boolean DeleteFrameset(String framesetName) { -
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r12 r13 250 250 251 251 if (ip == null) { 252 Frame next = (direction == Text.RIGHT) ? FrameIO.LoadNext() 253 : FrameIO.LoadPrevious(); 254 FrameUtils.DisplayFrame(next, true); 252 navigateFrame(direction); 255 253 return; 256 254 } … … 261 259 // positions over the the frame name navigation occurs 262 260 if (on.isFrameName()) { 263 Frame next = (direction == Text.RIGHT) ? FrameIO.LoadNext() 264 : FrameIO.LoadPrevious(); 265 FrameUtils.DisplayFrame(next, true); 261 navigateFrame(direction); 266 262 return; 267 263 } else { … … 275 271 } 276 272 273 private void navigateFrame(int direction) { 274 Frame next = null; 275 switch(direction){ 276 case Text.RIGHT: 277 case Text.PAGE_UP: 278 next = FrameIO.LoadNext(); 279 break; 280 case Text.LEFT: 281 case Text.PAGE_DOWN: 282 next = FrameIO.LoadPrevious(); 283 break; 284 case Text.HOME: 285 next = FrameIO.LoadZero(); 286 break; 287 case Text.END: 288 next = FrameIO.LoadLast(); 289 break; 290 } 291 FrameUtils.DisplayFrame(next, true); 292 } 293 277 294 /** 278 295 * Receives and processes any Function, Control, and Escape key presses … … 314 331 case KeyEvent.VK_RIGHT: 315 332 move(Text.RIGHT); 333 break; 334 case KeyEvent.VK_PAGE_DOWN: 335 navigateFrame(Text.PAGE_DOWN); 336 break; 337 case KeyEvent.VK_PAGE_UP: 338 navigateFrame(Text.PAGE_UP); 316 339 break; 317 340 case KeyEvent.VK_UP: … … 784 807 if (Frame.itemAttachedToCursor()) { 785 808 DisplayIO.setCursorPosition(dummyItem.getX(), dummyItem.getY()); 786 Frame.getItemAttachedToCursor().setPosition(dummyItem.getX(), 787 dummyItem.getY()); 809 Item firstItem = Frame.getItemAttachedToCursor(); 810 int deltaX = firstItem.getX() - dummyItem.getX(); 811 int deltaY = firstItem.getY() - dummyItem.getY(); 812 813 for(Item i: Frame.FreeItems) { 814 i.setPosition(i.getX()-deltaX, 815 i.getY() - deltaY); 816 } 788 817 } else { 789 818 DisplayIO … … 1330 1359 // doing Tdfc while the cursor is set to the text cursor 1331 1360 DisplayIO.setCursor(Item.DEFAULT_CURSOR); 1332 } catch (ExistingFramesetException efe) {1333 FrameGraphics.ErrorMessage(efe.getMessage());1334 1361 } catch (Exception e) { 1335 FrameGraphics.ErrorMessage("Frameset could not be created: " 1336 + e.getMessage()); 1362 FrameGraphics.ErrorMessage(e.getMessage()); 1337 1363 } 1338 1364 } -
trunk/src/org/expeditee/items/Text.java
r7 r13 68 68 public static final int END = 5; 69 69 70 public static final int PAGE_DOWN = 6; 71 72 public static final int PAGE_UP = 7; 73 70 74 private int _maxWidth = -1; 71 75 … … 560 564 x, 561 565 (getX() - Item.MARGIN_RIGHT - (2 * getGravity()) + getBoundsWidth())); 562 return new Point(x, getY() + y 563 + (int) caret[1]); 566 return new Point(x, getY() + y + (int) caret[1]); 564 567 } 565 568 … … 1401 1404 return; 1402 1405 1403 // Remove 'a: ' from the begining if it is there 1404 if (_text.length() > 3 && _text.charAt(0) == 'a' 1405 && _text.charAt(1) == ':') { 1406 _text.delete(0, 2); 1407 while (_text.charAt(0) == ' ') 1408 _text.delete(0, 1); 1409 } 1406 /* 1407 * // Remove 'a: ' from the begining if it is there if 1408 * (_text.length() > 3 && _text.charAt(0) == 'a' && _text.charAt(1) == 1409 * ':') { _text.delete(0, 2); while (_text.charAt(0) == ' ') 1410 * _text.delete(0, 1); } 1411 */ 1410 1412 _text.insert(0, "@"); 1411 1413 … … 1558 1560 Rectangle textOutline = text.getLogicalHighlightShape(0, 1559 1561 text.getCharacterCount()).getBounds(); 1560 1562 1561 1563 // check if the cursor is within the top, bottom and within the 1562 1564 // gravity of right 1563 1565 if (y - textY > textOutline.y - NEAR_DISTANCE 1564 && y - textY < textOutline.y + textOutline.height + NEAR_DISTANCE 1566 && y - textY < textOutline.y + textOutline.height 1567 + NEAR_DISTANCE 1565 1568 && x - textX < textOutline.width + NEAR_DISTANCE) 1566 1569 return true; … … 1570 1573 return false; 1571 1574 } 1572 1575 1573 1576 @Override 1574 1577 public void delete() {
Note:
See TracChangeset
for help on using the changeset viewer.