/[classpath]/classpath/java/awt/event/MouseEvent.java
ViewVC logotype

Diff of /classpath/java/awt/event/MouseEvent.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by ericb, Sat Mar 30 12:02:30 2002 UTC revision 1.6 by ericb, Wed May 8 07:53:54 2002 UTC
# Line 42  import java.awt.Component; Line 42  import java.awt.Component;
42  import java.awt.Point;  import java.awt.Point;
43  import java.io.IOException;  import java.io.IOException;
44  import java.io.ObjectInputStream;  import java.io.ObjectInputStream;
45    import gnu.java.awt.EventModifier;
46    
47  /**  /**
48   * This event is generated for a mouse event. There are three main categories   * This event is generated for a mouse event. There are three main categories
# Line 216  public class MouseEvent extends InputEve Line 217  public class MouseEvent extends InputEve
217      this.button = button;      this.button = button;
218      if (button < NOBUTTON || button > BUTTON3)      if (button < NOBUTTON || button > BUTTON3)
219        throw new IllegalArgumentException();        throw new IllegalArgumentException();
220      if ((modifiers & OLD_MASK) != 0)      if ((modifiers & EventModifier.OLD_MASK) != 0)
221        {        {
222          if ((modifiers & BUTTON1_MASK) != 0)          if ((modifiers & BUTTON1_MASK) != 0)
223            button = BUTTON1;            button = BUTTON1;
# Line 342  public class MouseEvent extends InputEve Line 343  public class MouseEvent extends InputEve
343     */     */
344    public static String getMouseModifiersText(int modifiers)    public static String getMouseModifiersText(int modifiers)
345    {    {
346      modifiers &= OLD_MASK;      modifiers &= EventModifier.OLD_MASK;
347      if ((modifiers & BUTTON2_MASK) != 0)      if ((modifiers & BUTTON2_MASK) != 0)
348        modifiers |= BUTTON2_DOWN_MASK;        modifiers |= BUTTON2_DOWN_MASK;
349      if ((modifiers & BUTTON3_MASK) != 0)      if ((modifiers & BUTTON3_MASK) != 0)
350        modifiers |= BUTTON3_DOWN_MASK;        modifiers |= BUTTON3_DOWN_MASK;
351      return getModifiersExText(extend(modifiers));      return getModifiersExText(EventModifier.extend(modifiers));
352    }    }
353    
354    /**    /**
# Line 390  public class MouseEvent extends InputEve Line 391  public class MouseEvent extends InputEve
391          s.append("unknown type,(");          s.append("unknown type,(");
392        }        }
393      s.append(x).append(',').append(y).append("),button=").append(button);      s.append(x).append(',').append(y).append("),button=").append(button);
394      if ((modifiers & NEW_MASK) != 0)      if ((modifiers & EventModifier.NEW_MASK) != 0)
395        {        {
396          int mod = modifiers;          int mod = modifiers;
397          if ((mod & (ALT_DOWN_MASK | BUTTON2_DOWN_MASK)) != 0)          if ((mod & (ALT_DOWN_MASK | BUTTON2_DOWN_MASK)) != 0)
# Line 416  public class MouseEvent extends InputEve Line 417  public class MouseEvent extends InputEve
417      throws IOException, ClassNotFoundException      throws IOException, ClassNotFoundException
418    {    {
419      s.defaultReadObject();      s.defaultReadObject();
420      if ((modifiers & OLD_MASK) != 0)      if ((modifiers & EventModifier.OLD_MASK) != 0)
421        {        {
422          if ((modifiers & BUTTON1_MASK) != 0)          if ((modifiers & BUTTON1_MASK) != 0)
423            button = BUTTON1;            button = BUTTON1;
# Line 424  public class MouseEvent extends InputEve Line 425  public class MouseEvent extends InputEve
425            button = BUTTON2;            button = BUTTON2;
426          else if ((modifiers & BUTTON3_MASK) != 0)          else if ((modifiers & BUTTON3_MASK) != 0)
427            button = BUTTON3;            button = BUTTON3;
428          modifiers = extend(modifiers);          modifiers = EventModifier.extend(modifiers);
429        }        }
430    }    }
431  } // class MouseEvent  } // class MouseEvent

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26