Java Code Examples for javax.swing.event.CaretEvent#getMark()

The following examples show how to use javax.swing.event.CaretEvent#getMark() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
public void caretUpdate(CaretEvent e) {

    try {
        if (e.getDot() != e.getMark()) { // that is, mouse is dragged and text is selected
            addDraggedSelection(e.getDot(), e.getMark());
        } else if (mainController.getMode() == MaeMainController.MODE_MULTI_SPAN) {
            // MSPAN mode always ignore single click
        } else {
            if (mainController.getMode() == MaeMainController.MODE_NORMAL) {
                textPanelController.clearSelection(); // single click will clear out prev selection
            if (acceptingSingleClick()) {
                textPanelController.addSelection(new int[]{e.getDot(), e.getDot() + 1});
    } catch (MaeDBException ex) {
Example 2
Source Project: netbeans   File:    License: Apache License 2.0 5 votes vote down vote up
public void caretUpdate(CaretEvent evt) {
    if (evt.getDot() != evt.getMark()) {
    } else {
Example 3
Source Project: uima-uimaj   File:    License: Apache License 2.0 4 votes vote down vote up
public void caretUpdate(CaretEvent ce) {
  final int dot = ce.getDot();
  final int mark = ce.getMark();
  this.main.setCaretStatus(dot, mark);