- Timestamp:
- 06/06/08 16:42:37 (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.classpath
r86 r95 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <classpath> 3 <classpathentry kind="src" output="bin/tests"path="tests"/>4 <classpathentry kind="src" output="bin/src"path="src"/>3 <classpathentry kind="src" path="tests"/> 4 <classpathentry kind="src" path="src"/> 5 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 6 6 <classpathentry exported="true" kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3.8.1"/> -
trunk/src/org/expeditee/agents/ComputeTree.java
r80 r95 96 96 97 97 if (value == null) { 98 value = AttributeUtils.getDoubleValue(((Text) i) 99 .getText()); 98 value = AttributeUtils.getDoubleValue(((Text) i).getFirstLine()); 100 99 } 101 100 -
trunk/src/org/expeditee/gui/AttributeUtils.java
r88 r95 625 625 return ""; 626 626 627 int lineSeparator = toStrip.indexOf(Character.LINE_SEPARATOR); 628 if(lineSeparator > 0){ 629 toStrip = toStrip.substring(0,lineSeparator); 630 } 631 627 632 int ind = toStrip.lastIndexOf(SEPARATOR_CHAR); 628 633 … … 634 639 } 635 640 // It is a value with no attribute. 636 return toStrip ;641 return toStrip.trim(); 637 642 } 638 643 … … 663 668 } 664 669 670 /** 671 * 672 * @param text 673 * @param value 674 */ 665 675 public static void setSingleValue(Text text, String value) { 666 676 assert (value != null); -
trunk/src/org/expeditee/gui/Frame.java
r90 r95 39 39 public class Frame implements ImageObserver { 40 40 41 public static Color[] COLOR_WHEEL = { Color.BLACK, Color.WHITE, Color.GRAY,41 public static Color[] COLOR_WHEEL = { 42 42 new Color(235, 235, 235), new Color(225, 225, 255), 43 43 new Color(195, 255, 255), new Color(225, 255, 225), 44 44 new Color(255, 255, 195), new Color(255, 225, 225), 45 new Color(255, 195, 255), null }; 45 new Color(255, 195, 255), Color.WHITE, 46 Color.GRAY, Color.DARK_GRAY,Color.BLACK, null }; 46 47 47 48 // The various attributes of this Frame -
trunk/src/org/expeditee/gui/FrameIO.java
r90 r95 764 764 // check if this was the profile frame (and thus needs 765 765 // re-parsing) 766 if (toSave.getFramesetName().toLowerCase().equals( 767 UserSettings.Username.toLowerCase())) { 768 FrameUtils.ParseProfile(FrameIO.LoadFrame(toSave 769 .getFramesetName() 770 + "1")); 766 if (isProfileFrame(toSave)) { 767 Frame profile = FrameIO.LoadFrame(toSave.getFramesetName()+ "1"); 768 assert(profile != null); 769 FrameUtils.ParseProfile(profile); 771 770 } 772 771 } catch (IOException ioe) { 773 // ioe.printStackTrace();772 ioe.getStackTrace(); 774 773 Logger.Log(ioe); 775 774 return null; … … 777 776 778 777 return writer.getFileContents(); 778 } 779 780 /** 781 * Checks if a frame is in the current user profile frameset. 782 * @param toCheck the frame to check 783 * @return true if the frame is in the current user profile frameset 784 */ 785 public static boolean isProfileFrame(Frame toCheck) { 786 if(toCheck.getNumber() == 0) 787 return false; 788 return toCheck.getFramesetName() 789 .equalsIgnoreCase(UserSettings.Username); 779 790 } 780 791 -
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r88 r95 489 489 Item current = FrameUtils.getCurrentItem(); 490 490 Frame currentFrame = DisplayIO.getCurrentFrame(); 491 // Link or delink an item492 if (ch.charAt(0) == 491 // Link or delink an item 492 if (ch.charAt(0) == KeyEvent.VK_L) { 493 493 // If its not linked then link it to its self 494 494 if (current instanceof Text && current.getLink() == null) { … … 503 503 current.setLink(null); 504 504 } 505 } else if (ch.charAt(0) == 505 } else if (ch.charAt(0) == KeyEvent.VK_G) { 506 506 // If its not linked then link it to its self 507 507 if (current instanceof Text) { … … 513 513 } 514 514 } 515 if (current.getLink() != null) {515 if (current.getLink() != null) { 516 516 NavigationActions.Goto(current.getAbsoluteLink()); 517 517 return; 518 518 } 519 } else if (ch.charAt(0) == 519 } else if (ch.charAt(0) == KeyEvent.VK_A) { 520 520 // If its not linked then link it to its self 521 521 if (current instanceof Text && current.getAction() == null) { 522 522 String text = ((Text) current).getText().trim(); 523 // first trim the annotation523 // first trim the annotation 524 524 if (text.startsWith("@")) { 525 525 text = text.substring(1).trim(); 526 526 } 527 // then trim the action527 // then trim the action 528 528 String lowerCaseText = text.toLowerCase(); 529 529 if (lowerCaseText.startsWith("a:")) { … … 531 531 } else if (lowerCaseText.startsWith("action:")) { 532 532 text = text.substring("action:".length()).trim(); 533 533 534 534 } 535 535 current.setAction(text); … … 624 624 processChar((char) KeyEvent.VK_DELETE, e.isShiftDown()); 625 625 FrameMouseActions.delete(current); 626 } else if (ch.charAt(0) == KeyEvent.VK_F) {626 } else if (ch.charAt(0) == KeyEvent.VK_F) { 627 627 // perform a delete operation 628 628 Actions.PerformAction(currentFrame, null, "Format"); … … 662 662 } 663 663 } 664 664 FrameGraphics.Repaint(); 665 665 } 666 666 … … 814 814 break; 815 815 case Refresh: 816 Re paint(on);816 Refresh(on); 817 817 break; 818 818 } … … 1582 1582 * This Item is currently ignored 1583 1583 */ 1584 private static void Repaint(Item ignored) { 1585 FrameUtils.Parse(DisplayIO.getCurrentFrame()); 1584 private static void Refresh(Item ignored) { 1585 Frame currentFrame = DisplayIO.getCurrentFrame(); 1586 if (FrameIO.isProfileFrame(currentFrame)) { 1587 //TODO ensure that users can not delete the first frame in a frameset... 1588 //TODO handle the case when users manually delete the first frame in a frameset from the filesystem 1589 Frame profile = FrameIO.LoadFrame(currentFrame.getFramesetName() 1590 + "1"); 1591 assert (profile != null); 1592 FrameUtils.ParseProfile(profile); 1593 } else { 1594 FrameUtils.Parse(currentFrame); 1595 } 1586 1596 // Need to update the cursor for when text items change to @b pictures 1587 1597 // etc and the text cursor is showing -
trunk/src/org/expeditee/gui/FrameUtils.java
r90 r95 577 577 // check for all tags setting user values 578 578 for (Item item : items) { 579 if (!item.isAnnotation()) 580 continue; 581 579 582 if (ItemUtils.startsWithTag(item, "@HomeFrame")) { 580 583 String first = getLink(item, UserSettings.FirstFrame); … … 585 588 // warn the user 586 589 else { 587 FrameGraphics.WarningMessage("Home frame: " + first588 + " is not a valid frame.");590 //FrameGraphics.WarningMessage("Home frame: " + first 591 // + " is not a valid frame."); 589 592 UserSettings.FirstFrame = profile.getName(); 590 593 } … … 638 641 } else if (ItemUtils.startsWithTag(item, "@FramesetDir")) { 639 642 String dir = getDir(item, null); 640 if (dir != null) 643 if (dir != null){ 641 644 UserSettings.FrameDirs.add(dir); 645 } 642 646 } else if (ItemUtils.startsWithTag(item, "@LogDir")) { 643 647 org.expeditee.gui.FrameIO.LOGS_DIR = getDir(item, … … 658 662 } else if (ItemUtils.startsWithTag(item, "@FramesetDirs")) { 659 663 UserSettings.FrameDirs.addAll(getDirs(item)); 664 } else { 665 660 666 } 661 667 } … … 750 756 else 751 757 return name + File.separator; 752 } 753 } 754 758 }else{ 759 FrameGraphics.ErrorMessage("Directory not found: " + name); 760 } 761 }else{ 762 FrameGraphics.WarningMessage("Missing value for profile attribute" + name); 763 } 755 764 return alt; 756 765 } … … 1404 1413 for (File helpFrameset : helpFramesets) { 1405 1414 String framesetName = helpFrameset.getName(); 1415 if(!FrameIO.isValidFramesetName(framesetName)) 1416 continue; 1406 1417 Frame indexFrame = FrameIO.LoadFrame(framesetName + '1'); 1407 1418 // Look through the folder for help index pages -
trunk/src/org/expeditee/items/Item.java
r88 r95 98 98 * this Item. 99 99 */ 100 public static Color[] COLOR_WHEEL = { Color.BLACK, Color.RED, Color.BLUE, 101 Item.GREEN, Color.MAGENTA, Color.YELLOW.darker(), Color.WHITE, null }; 102 103 public static Color[] FILL_COLOR_WHEEL = { Color.BLACK, 104 new Color(255, 150, 150), new Color(150, 150, 255), 105 new Color(150, 255, 150), new Color(255, 150, 255), 106 new Color(255, 255, 100), Color.WHITE, null }; 100 public static Color[] COLOR_WHEEL = { Color.RED, Color.BLUE, Item.GREEN, 101 Color.MAGENTA, Color.YELLOW.darker(), Color.BLACK, Color.DARK_GRAY, 102 Color.GRAY, Color.WHITE, null }; 103 104 public static Color[] FILL_COLOR_WHEEL = { new Color(255, 150, 150), 105 new Color(150, 150, 255), new Color(150, 255, 150), 106 new Color(255, 150, 255), new Color(255, 255, 100), Color.WHITE, 107 Color.GRAY, Color.DARK_GRAY, Color.BLACK, null }; 107 108 108 109 public static final int UNCHANGED_CURSOR = -100; … … 116 117 public static final int CROP_CURSOR = Cursor.CROSSHAIR_CURSOR; 117 118 118 // The default value for integer attributes119 // The default value for integer attributes 119 120 public static final int DEFAULT_INTEGER = -1; 120 121 … … 173 174 dest._mode = SelectedMode.None; 174 175 dest._lastMode = source._mode; 175 176 176 177 Frame parent = source.getParentOrCurrentFrame(); 177 178 // TODO MIKE says maybe we could tighten up and only give items ID's if … … 1325 1326 // only set position if the other dot is still fixed to the 1326 1327 // frame 1327 if (/* this.isFloating() &&*/!other.isFloating()) {1328 if (/* this.isFloating() && */!other.isFloating()) { 1328 1329 if (c.getType() == Constraint.HORIZONTAL) { 1329 1330 if (other.getY() != y) -
trunk/src/org/expeditee/items/ItemUtils.java
r90 r95 1 1 package org.expeditee.items; 2 2 3 import java.awt.Font;4 import java.awt.FontMetrics;5 import java.awt.Image;6 3 import java.awt.image.ImageObserver; 7 4 import java.io.File; … … 17 14 import java.util.Map; 18 15 19 import javax.swing.JFrame;20 21 16 import org.expeditee.gui.AttributeUtils; 22 17 import org.expeditee.gui.DisplayIO; … … 30 25 */ 31 26 public class ItemUtils { 32 private static JFrame _jf = new JFrame();33 34 27 // Tag constants 35 28 public static final int TAG_SORT = 0; … … 321 314 322 315 /** 323 * Returns a FontMetrics object that corresponds to the given Font.324 *325 * @param font326 * The Font to derive the FontMetrics from327 * @return FontMetrics that correspond to the given Font328 */329 public static FontMetrics getFontMetrics(Font font) {330 return _jf.getFontMetrics(font);331 }332 333 public static Image CreateImage(int x, int y) {334 return _jf.createImage(x, y);335 }336 337 /**338 316 * Creates a picture object from the information stored in the given Text 339 317 * object. <br>
Note:
See TracChangeset
for help on using the changeset viewer.