Changeset 22
- Timestamp:
- 05/09/08 09:31:42 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Simple.java
r21 r22 4 4 import java.awt.Point; 5 5 import java.awt.event.InputEvent; 6 import java.io.BufferedReader; 7 import java.io.InputStreamReader; 6 8 import java.util.ArrayList; 7 9 import java.util.LinkedList; 8 10 import java.util.List; 9 11 12 import org.expeditee.agents.WriteTree; 10 13 import org.expeditee.gui.AttributeUtils; 11 14 import org.expeditee.gui.DisplayIO; … … 880 883 String log = SessionStats.getFrameEventList(); 881 884 Text t; 882 try {883 884 885 886 } catch (Exception e) {887 888 889 }885 // try { 886 t = (Text) context.getPointers().getVariable(tokens[1]) 887 .getValue(); 888 t.setText(log); 889 // } catch (Exception e) { 890 // t = new Text(-1, log); 891 // context.getPointers().setObject(tokens[1], t); 892 // } 890 893 891 894 return Status.OK; … … 1028 1031 String stats = SessionStats.getCurrentStats(); 1029 1032 Text t; 1030 try {1031 1032 1033 1034 } catch (Exception e) {1035 1036 1037 }1033 // try { 1034 t = (Text) context.getPointers().getVariable(tokens[1]) 1035 .getValue(); 1036 t.setText(stats); 1037 // } catch (Exception e) { 1038 // t = new Text(-1, stats); 1039 // context.getPointers().setObject(tokens[1], t); 1040 // } 1038 1041 1039 1042 return Status.OK; … … 1123 1126 Text dynamicCode = new Text(1, codeText); 1124 1127 RunItem(dynamicCode, context, Status.OK); 1128 return Status.OK; 1129 } else if (tokens[0].equals("runoscommand")) { 1130 String command = getMessage(tokens, context, code.toString(), " ", 1131 1); 1132 Runtime.getRuntime().exec(command); 1133 return Status.OK; 1134 } else if (tokens[0].equals("executeoscommand")) { 1135 String command = getMessage(tokens, context, code.toString(), " ", 1136 1); 1137 Process p = Runtime.getRuntime().exec(command); 1138 FrameGraphics.DisplayMessage(command, Color.darkGray); 1139 1140 BufferedReader stdInput = new BufferedReader(new InputStreamReader( 1141 p.getInputStream())); 1142 BufferedReader stdError = new BufferedReader(new InputStreamReader( 1143 p.getErrorStream())); 1144 String message = ""; 1145 while ((message = stdInput.readLine()) != null) { 1146 FrameGraphics.DisplayMessage(message); 1147 } 1148 while ((message = stdError.readLine()) != null) { 1149 FrameGraphics.ErrorMessage(message); 1150 } 1125 1151 return Status.OK; 1126 1152 } else if (tokens[0].startsWith("else")) { … … 1279 1305 Item item = (Item) context.getPointers().getVariable(itemVar) 1280 1306 .getValue(); 1307 item 1308 .setPosition(FrameMouseActions.MouseX, 1309 FrameMouseActions.MouseY); 1281 1310 FrameMouseActions.pickup(item); 1282 1311 return Status.OK; … … 1291 1320 Frame frame = DisplayIO.getCurrentFrame(); 1292 1321 Text item = frame.createNewText(s); 1322 item 1323 .setPosition(FrameMouseActions.MouseX, 1324 FrameMouseActions.MouseY); 1293 1325 FrameMouseActions.pickup(item); 1294 1326 // DisplayIO.repaint(); … … 1333 1365 frame.addItem(new Line(dot1, dot2, frame.getNextItemID())); 1334 1366 return Status.OK; 1335 } else if (tokens[0].equals("createitem")) { 1367 } else if (tokens[0].equals("createitem") 1368 || tokens[0].equals("createtext")) { 1336 1369 assertMinParametreCount(tokens, 4); 1337 1370 assertVariableType(tokens[1], 1, SPointer.framePrefix); … … 1352 1385 } 1353 1386 newItem = frame.addText(x, y, newText, newAction); 1354 } else 1355 // create a point if the optional params are not provided 1356 newItem = frame.addDot(x, y); 1387 } else { 1388 if (tokens[0].equals("createtext")) { 1389 newItem = frame.createNewText(); 1390 newItem.setPosition(x, y); 1391 } else { 1392 // create a point if the optional params are not provided 1393 newItem = frame.addDot(x, y); 1394 } 1395 } 1357 1396 context.getPointers().setObject(tokens[4], newItem); 1358 1397 … … 1639 1678 } 1640 1679 context.createFrameset(framesetName, successVar); 1680 return Status.OK; 1681 } else if (tokens[0].equals("writetree")) { 1682 assertMinParametreCount(tokens, 3); 1683 assertVariableType(tokens[1], 1, SPointer.framePrefix); 1684 Frame source = (Frame) context.getPointers().getVariable(tokens[1]) 1685 .getValue(); 1686 String format = context.getPrimitives().getStringValue(tokens[2]); 1687 String fileName = context.getPrimitives().getStringValue(tokens[3]); 1688 WriteTree wt = new WriteTree(format, fileName); 1689 if (wt.initialise(source)){ 1690 wt.setStartFrame(source); 1691 wt.run(); 1692 } 1641 1693 return Status.OK; 1642 1694 } else if (tokens[0].equals("concatstr")) { -
trunk/src/org/expeditee/agents/WriteTree.java
r4 r22 45 45 int ind = params.indexOf(" "); 46 46 if (ind > 0) { 47 String param = params.substring(ind + 1);47 String lastParam = params.substring(ind + 1); 48 48 _format = params.substring(0, ind).toLowerCase(); 49 49 50 if ( param.equals("clipboard"))50 if (lastParam.equals("clipboard")) 51 51 _clipboard = true; 52 52 else 53 _outFile = param; 54 } 53 _outFile = lastParam; 54 } 55 } 56 57 public WriteTree(String format, String outFile) { 58 _format = format; 59 _outFile = outFile; 55 60 } 56 61 … … 62 67 @Override 63 68 public boolean initialise(Frame start) { 64 _outFile = start.getExportFileName(); 69 if (_outFile == null) 70 _outFile = start.getExportFileName(); 65 71 66 72 try { -
trunk/src/org/expeditee/gui/Browser.java
r15 r22 100 100 this.getGlassPane().setVisible(true); 101 101 this.getContentPane().setBackground(Color.white); 102 this.getContentPane().setFocusTraversalKeysEnabled(false); 102 103 103 104 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); -
trunk/src/org/expeditee/gui/DisplayIO.java
r21 r22 59 59 * The title to display in the Title bar. 60 60 */ 61 public static final String TITLE = "Exp08May2008 B";61 public static final String TITLE = "Exp08May2008D"; 62 62 63 63 private DisplayIO() { -
trunk/src/org/expeditee/gui/FrameGraphics.java
r21 r22 546 546 547 547 // if we have not returned, then there are no messages yet 548 DisplayMessage(message );548 DisplayMessage(message, Color.darkGray); 549 549 } 550 550 -
trunk/src/org/expeditee/gui/FrameIO.java
r13 r22 711 711 if (toSave.getFramesetName().toLowerCase().equals( 712 712 UserSettings.Username.toLowerCase())) { 713 FrameUtils.ParseProfile( toSave);713 FrameUtils.ParseProfile(FrameIO.LoadFrame(toSave.getFramesetNameAdjusted() + "1")); 714 714 } 715 715 } catch (IOException ioe) { -
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r21 r22 562 562 functionKey(key, 1); 563 563 } 564 564 565 565 /** 566 566 * Called when a Function key has been pressed, and performs the specific … … 743 743 } 744 744 dummyItem = createText(); 745 if (Frame.textItemAttachedToCursor()) { 746 Text t = (Text)Frame.getItemAttachedToCursor(); 747 dummyItem.setSize(t.getSize()); 748 for (int i = 0; i < t.getText().size(); i++) { 749 newItemText += '\n'; 750 } 751 } 752 745 753 dummyItem.setText(newItemText); 754 746 755 // If the only item on the frame is the title and the frame name just 747 756 // drop a specified distance below the title -
trunk/src/org/expeditee/gui/FrameUtils.java
r21 r22 580 580 UserSettings.Threading = getBoolean(item, 581 581 UserSettings.Threading); 582 } else if (ItemUtils.isTag(item, "@ColorWheel")) { 583 Item.COLOR_WHEEL = getColorWheel(item); 584 } else if (ItemUtils.isTag(item, "@BackgroundColorWheel")) { 585 Item.FILL_COLOR_WHEEL = getColorWheel(item); 582 586 } 583 587 } … … 586 590 UserSettings.FirstFrame = profile.getFrameName(); 587 591 592 } 593 594 private static Color[] getColorWheel(Item item) { 595 String childName = item.getAbsoluteLink(); 596 if (childName != null) { 597 Frame child = FrameIO.LoadFrame(childName); 598 if (child != null) { 599 List<Text> textItems = child.getBodyTextItems(true); 600 Color[] colorList = new Color[textItems.size()]; 601 for (int i = 0; i < textItems.size(); i++) { 602 colorList[i] = textItems.get(i).getColor(); 603 } 604 return colorList; 605 } 606 } 607 return new Color[]{Color.black, Color.white}; 588 608 } 589 609 -
trunk/src/org/expeditee/gui/MouseEventRouter.java
r21 r22 9 9 import java.awt.event.MouseEvent; 10 10 import java.awt.event.MouseWheelEvent; 11 import java.awt.event.MouseWheelListener;12 11 13 12 import javax.swing.JComponent; -
trunk/src/org/expeditee/items/Item.java
r21 r22 81 81 * this Item. 82 82 */ 83 public static finalColor[] COLOR_WHEEL = { Color.BLACK, Color.RED,83 public static Color[] COLOR_WHEEL = { Color.BLACK, Color.RED, 84 84 Color.BLUE, Item.GREEN, Color.MAGENTA, Color.YELLOW.darker(), 85 85 DisplayIO.DEFAULT_BACKGROUND }; 86 86 87 public static finalColor[] FILL_COLOR_WHEEL = { Color.BLACK, new Color(255,150,150),87 public static Color[] FILL_COLOR_WHEEL = { Color.BLACK, new Color(255,150,150), 88 88 new Color(150,150,255), new Color(150,255,150), new Color(255,150,255), new Color(255,255,100), 89 89 DisplayIO.DEFAULT_BACKGROUND }; -
trunk/src/org/expeditee/items/Text.java
r21 r22 316 316 if (ch != '\t') 317 317 return insertText("" + ch, mouseX, mouseY); 318 319 return new Point(mouseX, mouseY);318 return insertText(" " + ch, mouseX, mouseY); 319 //return new Point(mouseX, mouseY); 320 320 } 321 321 -
trunk/src/org/expeditee/stats/SessionStats.java
r21 r22 259 259 for (String s : _FrameEvents) 260 260 eventList.append(s + '\n'); 261 261 eventList.deleteCharAt(eventList.length() - 1); 262 262 return eventList.toString(); 263 263 }
Note:
See TracChangeset
for help on using the changeset viewer.