1. /*
  2. * @(#)CaretEvent.java 1.8 01/11/29
  3. *
  4. * Copyright 2002 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 appropriate
  16. * for short term storage or RMI between applications running the same
  17. * version of Swing. A future release of Swing will provide support for
  18. * long term persistence.
  19. *
  20. * @version 1.8 11/29/01
  21. * @author Timothy Prinzing
  22. */
  23. public abstract class CaretEvent extends EventObject {
  24. /**
  25. * Creates a new CaretEvent object.
  26. *
  27. * @param source the object responsible for the event
  28. */
  29. public CaretEvent(Object source) {
  30. super(source);
  31. }
  32. /**
  33. * Fetches the location of the caret.
  34. *
  35. * @return the dot >= 0
  36. */
  37. public abstract int getDot();
  38. /**
  39. * Fetches the location of other end of a logical
  40. * selection. If there is no selection, this
  41. * will be the same as dot.
  42. *
  43. * @return the mark >= 0
  44. */
  45. public abstract int getMark();
  46. }