Changeset 185
- Timestamp:
- 08/04/08 12:42:11 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Actions.java
r181 r185 470 470 } 471 471 } 472 473 472 } catch (ClassNotFoundException cnf) { 474 473 _Agent = null; -
trunk/src/org/expeditee/actions/Simple.java
r181 r185 325 325 } 326 326 327 private static void RunFrame( Text current, boolean acceptKeyboardInput,327 private static void RunFrame(Frame frame, Text current, boolean acceptKeyboardInput, 328 328 boolean step, int pause, Color color) { 329 329 try { … … 336 336 _step = step; 337 337 _consumeKeyboardInput = acceptKeyboardInput; 338 FrameIO.SaveFrame( DisplayIO.getCurrentFrame(), true);338 FrameIO.SaveFrame(frame, true); 339 339 340 340 // an item without a link signals to run the current frame … … 342 342 // Make a copy but hide it 343 343 current = current.copy(); 344 current.setLink( DisplayIO.getCurrentFrame().getName());344 current.setLink(frame.getName()); 345 345 } 346 346 … … 354 354 } 355 355 356 public static void RunFrame( Text current, boolean acceptKeyboardInput) {357 RunFrame( current, acceptKeyboardInput, false, 0, null);358 } 359 360 public static void RunFrame( Text current) {361 RunFrame( current, false);356 public static void RunFrame(Frame frame, Text current, boolean acceptKeyboardInput) { 357 RunFrame(frame, current, acceptKeyboardInput, false, 0, null); 358 } 359 360 public static void RunFrame(Frame frame, Text current) { 361 RunFrame(frame, current, false); 362 362 } 363 363 … … 368 368 * @param pause 369 369 */ 370 public static void DebugFrame( Text current, float pause, Color color) {370 public static void DebugFrame(Frame frame, Text current, float pause, Color color) { 371 371 if (isProgramRunning()) { 372 372 stop(); 373 373 } 374 RunFrame( current, false, true, Math.round(pause * 1000), color);374 RunFrame(frame, current, false, true, Math.round(pause * 1000), color); 375 375 } 376 376 … … 382 382 * the time to pause between 383 383 */ 384 public static void DebugFrame( Text current, float pause) {385 DebugFrame( current, pause, null);386 } 387 388 public static void DebugFrame( Text current) {389 DebugFrame( current, -1.0F, null);384 public static void DebugFrame(Frame frame, Text current, float pause) { 385 DebugFrame(frame, current, pause, null); 386 } 387 388 public static void DebugFrame(Frame frame, Text current) { 389 DebugFrame(frame, current, -1.0F, null); 390 390 } 391 391 -
trunk/src/org/expeditee/agents/Format.java
r156 r185 44 44 @Override 45 45 public Frame process(Frame start) { 46 //TODO What will happen if user runs the SIMPLE form of this... 47 //Does format box need to be disabled?!?! 46 48 //Check the position of the cursor and only format stuff inside the same box as the cursor 47 49 Collection<Text> itemsToFormat = FrameUtils.getCurrentTextItems(); 48 50 if(itemsToFormat.size() < 1){ 49 itemsToFormat = start.getBodyTextItems( true);51 itemsToFormat = start.getBodyTextItems(false); 50 52 } 51 53 -
trunk/src/org/expeditee/agents/Sort.java
r130 r185 3 3 import java.awt.Point; 4 4 import java.util.ArrayList; 5 import java.util.Collection; 5 6 import java.util.Collections; 6 7 import java.util.Comparator; … … 8 9 import org.expeditee.gui.Frame; 9 10 import org.expeditee.gui.FrameGraphics; 10 import org.expeditee. items.Item;11 import org.expeditee.gui.FrameUtils; 11 12 import org.expeditee.items.Text; 12 13 … … 18 19 */ 19 20 public Frame process(Frame start) { 21 // Check the position of the cursor and only format stuff inside the 22 // same box as the cursor 23 Collection<Text> itemsToSort = FrameUtils.getCurrentTextItems(); 24 if (itemsToSort.size() < 1) { 25 itemsToSort = start.getBodyTextItems(false); 26 } 27 20 28 ArrayList<Text> textItems = new ArrayList<Text>(); 21 22 for (Item i : start.getItems()) 23 if (i instanceof Text) 24 // do not sort title and framename 25 if (i.getID() > -1 && i != start.getTitleItem() 26 && !i.isAnnotation()) { 27 textItems.add((Text) i); 28 } 29 textItems.addAll(itemsToSort); 29 30 30 31 // copy current positions of items … … 37 38 Collections.sort(textItems, new Comparator<Text>() { 38 39 public int compare(Text a, Text b) { 39 return String.CASE_INSENSITIVE_ORDER.compare(a.getText(), 40 b.getText());40 return String.CASE_INSENSITIVE_ORDER.compare(a.getText(), b 41 .getText()); 41 42 } 42 43 }); -
trunk/src/org/expeditee/gui/Frame.java
r176 r185 1553 1553 if (t.getText().toLowerCase().startsWith("@start") 1554 1554 || t.getText().toLowerCase().equals("@start:")) { 1555 t.stripFirstWord(); 1555 //Used to allow users the option of putting an initial bullet after the @start 1556 //This was replaced by width 1557 //t.stripFirstWord(); 1558 t.setText(""); 1556 1559 1557 1560 if (t.getText().equals("")) -
trunk/src/org/expeditee/gui/FrameMouseActions.java
r184 r185 506 506 507 507 // if the user is ranging-out text 508 if (lastRanged != null) { 509 if (e.getButton() == MouseEvent.BUTTON1) { 510 return; 511 } 508 if (lastRanged != null && e.getButton() != MouseEvent.BUTTON1) { 512 509 513 510 Text ranged = lastRanged.copy(); -
trunk/src/org/expeditee/items/Item.java
r184 r185 1029 1029 // action 1030 1030 if (sourceFrame == null) { 1031 sourceFrame = getParentOrCurrentFrame(); 1031 //For actions like format they rely on this being set to the current frame incase the item being activated is on an overlay 1032 sourceFrame = DisplayIO.getCurrentFrame(); 1032 1033 } 1033 1034 -
trunk/src/org/expeditee/items/Text.java
r176 r185 176 176 @Override 177 177 public void setWidth(int width) { 178 invalidateAll(); 178 179 // 0 is the default 179 180 if (width == 0) … … 182 183 _maxWidth = width; 183 184 rebuild(true); 185 invalidateAll(); 184 186 } 185 187
Note:
See TracChangeset
for help on using the changeset viewer.