1. /*
  2. * @(#)CaretEvent.java 1.13 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.event;
  8. import java.util.EventObject;
  9. /**
  10. * CaretEvent is used to notify interested parties that
  11. * the text caret has changed in the event source.
  12. * <p>
  13. * <strong>Warning:</strong>
  14. * Serialized objects of this class will not be compatible with
  15. * future Swing releases. The current serialization support is
  16. * appropriate for short term storage or RMI between applications running
  17. * the same version of Swing. As of 1.4, support for long term storage
  18. * of all JavaBeans<sup><font size="-2">TM</font></sup>
  19. * has been added to the <code>java.beans</code> package.
  20. * Please see {@link java.beans.XMLEncoder}.
  21. *
  22. * @version 1.13 12/19/03
  23. * @author Timothy Prinzing
  24. */
  25. public abstract class CaretEvent extends EventObject {
  26. /**
  27. * Creates a new CaretEvent object.
  28. *
  29. * @param source the object responsible for the event
  30. */
  31. public CaretEvent(Object source) {
  32. super(source);
  33. }
  34. /**
  35. * Fetches the location of the caret.
  36. *
  37. * @return the dot >= 0
  38. */
  39. public abstract int getDot();
  40. /**
  41. * Fetches the location of other end of a logical
  42. * selection. If there is no selection, this
  43. * will be the same as dot.
  44. *
  45. * @return the mark >= 0
  46. */
  47. public abstract int getMark();
  48. }