Changeset 41


Ignore:
Timestamp:
05/14/08 12:34:46 (16 years ago)
Author:
ra33
Message:

Yellow highlighting for deleting text ranges wasnt working.

Fixed a couple things for the left and right mouse button shortcut for formatting

Location:
trunk/src/org/expeditee
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/actions/Actions.java

    r21 r41  
    244244         */
    245245        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);
    247248               
    248249                // separate method name and parameter names
     
    426427                        // while (_Agent.isRunning())
    427428                        // ;
    428 
    429429                        // FrameGraphics.DisplayMessage("Agent Stopped.");
    430430                }
     
    436436                }
    437437        }
    438 
    439         /**
    440          * Takes a list of Methods and finds one that accepts the given list of
    441          * objects as parameters
    442          *
    443          * @param possibleMethods
    444          *            The list of Methods to search through
    445          * @param parameters
    446          *            The array of parameters that the Method should accept
    447          * @return The Method found if one was found, otherwise null
    448          */
    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 the
    454          * same if(parameters.length == m.getParameterTypes().length){ //if no
    455          * 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 right
    457          * types for(int i = 0; i < parameters.length; i++){
    458          * if(m.getParameterTypes()[i].isInstance(parameters[i])) toRun = m; else
    459          * toRun = null; }
    460          *
    461          * //if a method has been found already, there is no need to keep searching
    462          * if(toRun != null) break; } }
    463          *
    464          * return toRun; }
    465          */
    466438
    467439        /**
     
    527499
    528500                return objects;
    529 
    530                 // strip off the first parameter
    531 
    532                 /*
    533                  * //the list of objects to return List<Object> returnParams = new
    534                  * ArrayList<Object>(); if(launcher != null)
    535                  * returnParams.add(launcher);
    536                  *
    537                  * while(param != null){ /* //the parameter is a String
    538                  * 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 found
    542                  * 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 value
    550                 /*
    551                  * param = ParseValue(values); }
    552                  *
    553                  * return returnParams.toArray();
    554                  */
    555501        }
    556502
  • trunk/src/org/expeditee/gui/FrameMouseActions.java

    r26 r41  
    1313import java.util.List;
    1414
     15import javax.swing.SwingUtilities;
    1516import javax.swing.Timer;
    1617
     
    3233public class FrameMouseActions implements MouseListener, MouseMotionListener,
    3334                MouseWheelListener {
     35
     36        private static int _lastMouseClickModifiers = 0;
    3437
    3538        private FrameMouseActions() {
     
    211214
    212215        public void ProccessMousePressedEvent(MouseEvent e, int modifiersEx) {
     216                // System.out.println(modifiersEx);
    213217
    214218                _mouseDown += e.getButton();
     
    231235                }
    232236
     237                // Mike says...
     238                // For somereason the modifiers for e are different from modifiersEx
     239                // The SwingUtilities.convertMouseEvent method changes the modifiers
    233240                _lastMouseClick = e;
     241                _lastMouseClickModifiers = modifiersEx;
    234242
    235243                // Only start the timer when in free space when the user double clicks
     
    352360                setPulse(false);
    353361
    354                 if (Actions.isAgentRunning()) {
    355                         Actions.stopAgent();
    356                         return;
    357                 }
    358 
    359362                // if the last action was a delete, then ignore the next mouseup
    360363                if (_wasDouble) {
    361364                        _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();
    362373                        return;
    363374                }
     
    428439                if (_isAttribute) {
    429440                        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                                 */
    431449                        } else {
    432450                                extractAttributes(clickedOn);
     
    18791897                        }
    18801898                        Frame.FreeItems.add(i);
    1881                        
     1899
    18821900                        if (i instanceof Dot)
    18831901                                ((Dot) i).setFloating(true);
     
    21082126                if (_lastMouseClick == null)
    21092127                        return false;
    2110                 return isDelete(_lastMouseClick.getModifiersEx());
     2128                return isDelete(_lastMouseClickModifiers);
    21112129        }
    21122130
  • trunk/src/org/expeditee/gui/MouseEventRouter.java

    r35 r41  
    110110                                                .getCurrentFrame(), containerPoint.x, containerPoint.y) != null);
    111111                        }
    112 
     112                       
    113113                        if (forwardToExpiditee) {
    114114
     
    125125                                MouseEvent expediteeEvent = SwingUtilities.convertMouseEvent(e
    126126                                                .getComponent(), e, _contentPane);
    127 
     127                               
    128128                                switch (e.getID()) {
    129129                                case MouseEvent.MOUSE_MOVED:
  • trunk/src/org/expeditee/items/Text.java

    r24 r41  
    12221222                int red = 160;
    12231223                int blue = 160;
     1224               
    12241225                if (FrameMouseActions.wasDeleteClicked()) {
    12251226                        green = 235;
Note: See TracChangeset for help on using the changeset viewer.