Changeset 410
- Timestamp:
- 11/19/08 16:43:35 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Navigation.java
r408 r410 8 8 import org.expeditee.gui.FrameUtils; 9 9 import org.expeditee.gui.MessageBay; 10 import org.expeditee.gui.UserSettings; 10 11 import org.expeditee.items.Item; 11 12 … … 41 42 */ 42 43 public static void GotoHome() { 43 FrameUtils.DisplayHomeFrame(); 44 FrameUtils.DisplayFrame(UserSettings.HomeFrame); 45 } 46 47 public static void GotoZero() { 48 FrameUtils.DisplayFrame(DisplayIO.getCurrentFrame().getFramesetName() + 0); 44 49 } 45 50 … … 48 53 */ 49 54 public static void GotoProfile() { 50 FrameUtils.DisplayProfileFrame(); 51 } 52 55 FrameUtils.DisplayFrame(UserSettings.ProfileName + '1'); 56 } 57 58 /** 59 * Loads the Frame in the current frameset with the given number and 60 * displays it 61 * 62 * @param value 63 * The number of the Frame to load 64 */ 65 public static void Goto(Integer value) { 66 FrameUtils.DisplayFrame(DisplayIO.getCurrentFrame().getFramesetName() + value); 67 } 68 53 69 /** 54 70 * Loads the Frame with the given FrameName and displays it … … 59 75 public static void Goto(String frameName) { 60 76 FrameUtils.DisplayFrame(frameName); 61 }62 63 /**64 * Loads the Frame in the current frameset with the given number and65 * displays it66 *67 * @param value68 * The number of the Frame to load69 */70 public static void Goto(Integer value) {71 FrameUtils.DisplayFrame(value.toString());72 77 } 73 78 -
trunk/src/org/expeditee/actions/Simple.java
r409 r410 499 499 } catch (ArrayIndexOutOfBoundsException e) { 500 500 FlagError(item); 501 throw new Exception("Too few parametres: " + item.toString());501 throw new IncorrectUseOfStatementException("Too few parametres: " + item.toString(), item.getStatement()); 502 502 } catch (NullPointerException e) { 503 503 FlagError(item); … … 506 506 } catch (RuntimeException e) { 507 507 FlagError(item); 508 throw new Exception(e.getMessage() + " " + item.toString());508 throw new IncorrectUseOfStatementException(e.getMessage() + " " + item.toString(), item.getStatement()); 509 509 } catch (Exception e) { 510 510 throw new Exception(e.getMessage()); … … 1007 1007 } else if (tokens[0].startsWith("set")) { 1008 1008 if (tokens[0].equals("set")) { 1009 assertExactParametreCount(tokens, 2); 1009 1010 try { 1010 1011 // Check if we are setting variable to variable -
trunk/src/org/expeditee/agents/wordprocessing/JSpellChecker.java
r389 r410 1 1 package org.expeditee.agents.wordprocessing; 2 2 3 import java.awt.Color;4 3 import java.io.File; 5 4 import java.io.FileNotFoundException; … … 11 10 import org.expeditee.gui.Frame; 12 11 import org.expeditee.gui.FrameIO; 13 import org.expeditee.gui.MessageBay;14 12 import org.expeditee.items.Text; 15 13 … … 98 96 public void init() throws FileNotFoundException, IOException { 99 97 log(this.hashCode() + ": JSpellChecker.init"); 100 MessageBay.displayMessage("Loading spell checker...");98 //MessageBay.displayMessage("Loading spell checker..."); 101 99 102 100 checker = new SpellChecker(); … … 113 111 initialized = true; 114 112 115 MessageBay.displayMessage("Spell checker Loaded", Color.green.darker());113 //MessageBay.displayMessage("Spell checker Loaded", Color.green.darker()); 116 114 } 117 115 -
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r408 r410 950 950 // - UserSettings.Gravity); 951 951 text.justify(true); 952 break; 953 954 case KeyEvent.VK_R: 955 Text textCurrent = getCurrentTextItem(); 956 if (textCurrent == null) { 957 for (Text t : currentFrame.getBodyTextItems(false)) { 958 t.setWidth(null); 959 t.justify(true); 960 } 961 962 return; 963 } 964 textCurrent.setWidth(null); 965 textCurrent.justify(true); 952 966 break; 953 967 case KeyEvent.VK_S: … … 1072 1086 break; 1073 1087 case SizeUp: 1074 SetSize(firstConnected, repeat, false, true );1088 SetSize(firstConnected, repeat, false, true, isControlDown); 1075 1089 break; 1076 1090 case SizeDown: 1077 SetSize(firstConnected, -repeat, false, true );1091 SetSize(firstConnected, -repeat, false, true, isControlDown); 1078 1092 break; 1079 1093 case ChangeColor: … … 1148 1162 return; 1149 1163 case SizeUp: 1150 SetSize(on, repeat, true, false );1164 SetSize(on, repeat, true, false, isControlDown); 1151 1165 if (on instanceof Text) { 1152 1166 DisplayIO.setTextCursor((Text) on, Text.NONE, true, false, … … 1155 1169 break; 1156 1170 case SizeDown: 1157 SetSize(on, -repeat, true, false );1171 SetSize(on, -repeat, true, false, isControlDown); 1158 1172 if (on instanceof Text) { 1159 1173 DisplayIO.setTextCursor((Text) on, Text.NONE, true, false, … … 1438 1452 */ 1439 1453 public static void moveCursorAndFreeItems(int x, int y) { 1454 int oldX = FrameMouseActions.getX(); 1455 int oldY = FrameMouseActions.getY(); 1456 1457 if(oldX == x && oldY == y) 1458 return; 1459 1440 1460 DisplayIO.setCursorPosition(x, y); 1441 1461 Item firstItem = FreeItems.getItemAttachedToCursor(); … … 1620 1640 */ 1621 1641 public static void SetSize(Item item, int diff, boolean moveCursor, 1622 boolean insideEnclosure ) {1642 boolean insideEnclosure, boolean isControlDown) { 1623 1643 Collection<Item> toSize = new HashSet<Item>(); 1624 1644 // the mouse is only moved when the Item is on the frame, not free … … 1796 1816 i.setSize(newSize); 1797 1817 if (i instanceof Text && i.getSize() != oldSize) { 1798 i.translate(origin, resizeRatio); 1799 if (i.isLineEnd()) { 1800 i.setPosition(i.getPosition()); 1818 if (toSize.size() == 1 && !isControlDown) { 1819 moveCursorAndFreeItems(i.getX(), i.getY()); 1820 } else { 1821 i.translate(origin, resizeRatio); 1822 if (i.isLineEnd()) { 1823 i.setPosition(i.getPosition()); 1824 } 1801 1825 } 1802 1826 } -
trunk/src/org/expeditee/gui/FrameMouseActions.java
r408 r410 775 775 tdfc(clickedOn); 776 776 } catch (RuntimeException e) { 777 e.printStackTrace(); 777 778 MessageBay.errorMessage("TDFC error: " + e.getMessage()); 778 779 } -
trunk/src/org/expeditee/gui/FrameUtils.java
r409 r410 472 472 DisplayFrame(framename, true, true); 473 473 } 474 475 public static void DisplayHomeFrame() { 476 DisplayFrame(UserSettings.HomeFrame); 477 } 478 479 public static void DisplayProfileFrame() { 480 DisplayFrame(UserSettings.ProfileName + '1'); 481 } 482 474 483 475 public static Frame getFrame(String frameName) { 484 476 // if the new frame does not exist then tell the user -
trunk/src/org/expeditee/io/KMSReader.java
r400 r410 87 87 _ItemTags.put("u", Item.class.getMethod("setHighlight", pBool)); 88 88 _ItemTags.put("e", Item.class.getMethod("setFillColor", pColor)); 89 _ItemTags.put("E", Item.class.getMethod("setGradientColor", pColor)); 90 _ItemTags.put("Q", Item.class.getMethod("setGradientAngle", pInt)); 91 89 92 _ItemTags.put("i", Item.class.getMethod("setFillPattern", pString)); 90 93 _ItemTags.put("o", Item.class.getMethod("setOwner", pString)); -
trunk/src/org/expeditee/items/FrameBitmap.java
r108 r410 37 37 width = s.length(); 38 38 } 39 40 if(width == 0) 41 return false; 42 39 43 BufferedImage bi = new BufferedImage(width, height, 40 44 BufferedImage.TYPE_INT_ARGB); -
trunk/src/org/expeditee/items/Item.java
r400 r410 24 24 25 25 import org.expeditee.actions.Actions; 26 import org.expeditee.actions.IncorrectUseOfStatementException; 26 27 import org.expeditee.actions.Misc; 27 28 import org.expeditee.actions.Simple; … … 191 192 * the user uses backspace to delete a text line end 192 193 */ 193 //dest._anchorBottom = source._anchorBottom; 194 //dest._anchorRight = source._anchorRight; 195 194 // dest._anchorBottom = source._anchorBottom; 195 // dest._anchorRight = source._anchorRight; 196 196 dest.setFormula(source.getFormula()); 197 197 dest.setParent(source.getParent()); … … 770 770 return _formula != null; 771 771 } 772 772 773 773 public boolean hasAttributeValuePair() { 774 774 return _attributeValuePair != null && _attributeValuePair.hasPair(); … … 949 949 return getWidth(); 950 950 } 951 951 952 952 public Integer getWidth() { 953 953 return null; … … 1241 1241 Simple.ProgramStarted(); 1242 1242 Simple.RunFrameAndReportError(this, new Context()); 1243 Simple.ProgramFinished();1244 1243 MessageBay.displayMessage(AgentStats.getStats(), GREEN); 1245 1244 } catch (ConcurrentModificationException ce) { 1246 Simple.ProgramFinished();1247 1245 ce.printStackTrace(); 1246 } catch (IncorrectUseOfStatementException ise) { 1247 MessageBay.linkedErrorMessage(ise.getMessage()); 1248 MessageBay.displayMessage("See SIMPLE doc for [" 1249 + ise.getStatement() + "] statement", ise.getStatement() + "1", Color.CYAN.darker(), 1250 true, null); 1248 1251 } catch (Exception e) { 1249 1252 MessageBay.linkedErrorMessage(e.getMessage()); 1250 Simple.ProgramFinished();1251 }1253 } 1254 Simple.ProgramFinished(); 1252 1255 // Need to repaint any highlights etc 1253 1256 FrameGraphics.requestRefresh(true); … … 1873 1876 public void setRightMargin(int i, boolean fixWidth) { 1874 1877 int newWidth = i - getX() - Item.MARGIN_LEFT; 1875 if (!fixWidth){1878 if (!fixWidth) { 1876 1879 newWidth *= -1; 1877 1880 } 1878 1881 1879 1882 setWidth(newWidth); 1880 1883 } … … 2799 2802 2800 2803 public AttributeValuePair getAttributeValuePair() { 2801 if (_attributeValuePair == null){2804 if (_attributeValuePair == null) { 2802 2805 _attributeValuePair = new AttributeValuePair(getText()); 2803 2806 } … … 2805 2808 } 2806 2809 2807 /*private static Set<Object> _locks = new HashSet<Object>(); 2808 2809 public static void lock(Object itemToLock) { 2810 _locks.add(itemToLock); 2811 } 2812 2813 public static void unlock(Object itemToUnlock) { 2814 _locks.remove(itemToUnlock); 2815 } 2816 2817 public static boolean isLocked(Object item) { 2818 return _locks.contains(item); 2819 }*/ 2820 2821 2810 /* 2811 * private static Set<Object> _locks = new HashSet<Object>(); 2812 * 2813 * public static void lock(Object itemToLock) { _locks.add(itemToLock); } 2814 * 2815 * public static void unlock(Object itemToUnlock) { 2816 * _locks.remove(itemToUnlock); } 2817 * 2818 * public static boolean isLocked(Object item) { return 2819 * _locks.contains(item); } 2820 */ 2821 2822 2822 } -
trunk/src/org/expeditee/items/Text.java
r404 r410 100 100 public static final int PAGE_UP = 8; 101 101 102 private Integer _maxWidth = null; 102 /* 103 * Set the width to be IMPLICIT, but as wide as possible, a negative width 104 * value is one that is implicitly set by the system... a positive value is 105 * one explicitly set by the user. 106 */ 107 private Integer _maxWidth = Integer.MIN_VALUE + 1; 103 108 104 109 private Justification _justification = Justification.left; … … 575 580 _text.insert(left, newText); 576 581 rebuild(true); 582 583 clearCache(); 577 584 578 585 invalidateAll(); … … 1126 1133 List<String> list = new LinkedList<String>(); 1127 1134 1135 // Rebuilding prevents errors when displaying frame bitmaps 1136 if (_lineOffsets.size() == 0) { 1137 rebuild(false); 1138 } 1139 1128 1140 int last = 0; 1129 1141 for (int offset : _lineOffsets) { … … 1534 1546 if (_textLayouts.size() < 1) { 1535 1547 rebuild(true); 1536 // System.out.println("Error: " + _text);1537 // return;1548 // System.out.println("Error: " + _text); 1549 // return; 1538 1550 } 1539 1551 … … 1684 1696 copy.setInitialSpacing(getInitialSpacing()); 1685 1697 1686 copy.setWidth(getWidth ());1698 copy.setWidth(getWidthToSave()); 1687 1699 copy.setJustification(getJustification()); 1688 1700 copy.setLetterSpacing(getLetterSpacing()); 1689 1701 copy.setWordSpacing(getWordSpacing()); 1690 copy.setWidth(getWidth ());1702 copy.setWidth(getWidthToSave()); 1691 1703 copy.setFont(getFont()); 1692 1704 if (hasFormula()) { … … 1980 1992 // setRightMargin(frameWidth, false); 1981 1993 } 1994 } 1995 String text = _text.toString(); 1996 1997 // Show the overlay stuff immediately if this is an overlay item 1998 if (hasLink() && (text.startsWith("@ao") || text.startsWith("@o"))) { 1999 FrameKeyboardActions.Refresh(); 1982 2000 } 1983 2001 } … … 2285 2303 rebuild(true); 2286 2304 } 2305 2306 /* 2307 * Returns the SIMPLE statement contained by this text item. 2308 * 2309 */ 2310 public String getStatement() { 2311 return getText().split("\\s+")[0]; 2312 } 2287 2313 } -
trunk/src/org/expeditee/items/widgets/charts/AbstractChart.java
r376 r410 86 86 invalidateLink(); 87 87 FrameKeyboardActions.SetSize(getFirstCorner(), 1, false, 88 true );88 true, false); 89 89 invalidateSelf(); 90 90 FrameGraphics.refresh(true); … … 94 94 invalidateLink(); 95 95 FrameKeyboardActions.SetSize(getFirstCorner(), -1, false, 96 true );96 true, false); 97 97 invalidateSelf(); 98 98 FrameGraphics.refresh(true);
Note:
See TracChangeset
for help on using the changeset viewer.