Changeset 41
- Timestamp:
- 05/14/08 12:34:46 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Actions.java
r21 r41 244 244 */ 245 245 public static void PerformAction(Frame source, Item launcher, String command) { 246 FrameIO.SaveFrame(source, false); 246 if (!command.equalsIgnoreCase("Restore")) 247 FrameIO.SaveFrame(source, false); 247 248 248 249 // separate method name and parameter names … … 426 427 // while (_Agent.isRunning()) 427 428 // ; 428 429 429 // FrameGraphics.DisplayMessage("Agent Stopped."); 430 430 } … … 436 436 } 437 437 } 438 439 /**440 * Takes a list of Methods and finds one that accepts the given list of441 * objects as parameters442 *443 * @param possibleMethods444 * The list of Methods to search through445 * @param parameters446 * The array of parameters that the Method should accept447 * @return The Method found if one was found, otherwise null448 */449 /*450 * private static Method FindCompatibleMethods(List<Method>451 * possibleMethods, Object[] parameters){ Method toRun = null;452 *453 * for(Method m : possibleMethods){ //the number of parameters must be the454 * same if(parameters.length == m.getParameterTypes().length){ //if no455 * methods are required, there is nothing else to check if(parameters.length ==456 * 0) toRun = m; else //check that the list of parameters are of the right457 * types for(int i = 0; i < parameters.length; i++){458 * if(m.getParameterTypes()[i].isInstance(parameters[i])) toRun = m; else459 * toRun = null; }460 *461 * //if a method has been found already, there is no need to keep searching462 * if(toRun != null) break; } }463 *464 * return toRun; }465 */466 438 467 439 /** … … 527 499 528 500 return objects; 529 530 // strip off the first parameter531 532 /*533 * //the list of objects to return List<Object> returnParams = new534 * ArrayList<Object>(); if(launcher != null)535 * returnParams.add(launcher);536 *537 * while(param != null){ /* //the parameter is a String538 * if(param.charAt(0) == '"') returnParams.add(param.substring(1,539 * param.length() - 1)); else{ //try to parse an int try{ int val =540 * Integer.parseInt(param); returnParams.add(val);541 * }catch(NumberFormatException nfe){ System.out.println("Type not found542 * for: " + param); } }543 *544 * if(param.length() < values.length()) values =545 * values.substring(param.length() + 1); else values = "";546 */547 548 // returnParams.add(KMSConversion.Convert(type, value))549 // get the next value550 /*551 * param = ParseValue(values); }552 *553 * return returnParams.toArray();554 */555 501 } 556 502 -
trunk/src/org/expeditee/gui/FrameMouseActions.java
r26 r41 13 13 import java.util.List; 14 14 15 import javax.swing.SwingUtilities; 15 16 import javax.swing.Timer; 16 17 … … 32 33 public class FrameMouseActions implements MouseListener, MouseMotionListener, 33 34 MouseWheelListener { 35 36 private static int _lastMouseClickModifiers = 0; 34 37 35 38 private FrameMouseActions() { … … 211 214 212 215 public void ProccessMousePressedEvent(MouseEvent e, int modifiersEx) { 216 // System.out.println(modifiersEx); 213 217 214 218 _mouseDown += e.getButton(); … … 231 235 } 232 236 237 // Mike says... 238 // For somereason the modifiers for e are different from modifiersEx 239 // The SwingUtilities.convertMouseEvent method changes the modifiers 233 240 _lastMouseClick = e; 241 _lastMouseClickModifiers = modifiersEx; 234 242 235 243 // Only start the timer when in free space when the user double clicks … … 352 360 setPulse(false); 353 361 354 if (Actions.isAgentRunning()) {355 Actions.stopAgent();356 return;357 }358 359 362 // if the last action was a delete, then ignore the next mouseup 360 363 if (_wasDouble) { 361 364 _wasDouble = false; 365 return; 366 } 367 368 // This code must come after the _wasDouble code... 369 // Otherwise get Stopping Agent method after doing the left+right format 370 // shortcut 371 if (Actions.isAgentRunning()) { 372 Actions.stopAgent(); 362 373 return; 363 374 } … … 428 439 if (_isAttribute) { 429 440 if (clickedOn == null) { 430 new Format().process(DisplayIO.getCurrentFrame()); 441 // First look for the @NoFormat tag 442 Frame current = DisplayIO.getCurrentFrame(); 443 Actions.PerformAction(current, null, "Format"); 444 /* 445 * if (ItemUtils.ContainsTag(current.getItems(), "@NoFormat")) { 446 * FrameGraphics .DisplayMessage("Frame is protected by 447 * @NoFormat tag."); } else { new Format().process(current); } 448 */ 431 449 } else { 432 450 extractAttributes(clickedOn); … … 1879 1897 } 1880 1898 Frame.FreeItems.add(i); 1881 1899 1882 1900 if (i instanceof Dot) 1883 1901 ((Dot) i).setFloating(true); … … 2108 2126 if (_lastMouseClick == null) 2109 2127 return false; 2110 return isDelete(_lastMouseClick .getModifiersEx());2128 return isDelete(_lastMouseClickModifiers); 2111 2129 } 2112 2130 -
trunk/src/org/expeditee/gui/MouseEventRouter.java
r35 r41 110 110 .getCurrentFrame(), containerPoint.x, containerPoint.y) != null); 111 111 } 112 112 113 113 if (forwardToExpiditee) { 114 114 … … 125 125 MouseEvent expediteeEvent = SwingUtilities.convertMouseEvent(e 126 126 .getComponent(), e, _contentPane); 127 127 128 128 switch (e.getID()) { 129 129 case MouseEvent.MOUSE_MOVED: -
trunk/src/org/expeditee/items/Text.java
r24 r41 1222 1222 int red = 160; 1223 1223 int blue = 160; 1224 1224 1225 if (FrameMouseActions.wasDeleteClicked()) { 1225 1226 green = 235;
Note:
See TracChangeset
for help on using the changeset viewer.