@@ -442,14 +442,14 @@ public final boolean removeSelection(Selection<PS, SEG, S> selection) {
442
442
@ Override public final void setOnOutsideSelectionMousePressed (EventHandler <MouseEvent > handler ) { onOutsideSelectionMousePressed .set ( handler ); }
443
443
@ Override public final ObjectProperty <EventHandler <MouseEvent >> onOutsideSelectionMousePressedProperty () { return onOutsideSelectionMousePressed ; }
444
444
private final ObjectProperty <EventHandler <MouseEvent >> onOutsideSelectionMousePressed = new SimpleObjectProperty <>( e -> {
445
- onOutsideSelectionMousePressProperty (). get (). accept ( e );
445
+ moveTo ( hit ( e . getX (), e . getY () ). getInsertionIndex (), SelectionPolicy . CLEAR );
446
446
});
447
447
448
448
@ Override public final EventHandler <MouseEvent > getOnInsideSelectionMousePressReleased () { return onInsideSelectionMousePressReleased .get (); }
449
449
@ Override public final void setOnInsideSelectionMousePressReleased (EventHandler <MouseEvent > handler ) { onInsideSelectionMousePressReleased .set ( handler ); }
450
450
@ Override public final ObjectProperty <EventHandler <MouseEvent >> onInsideSelectionMousePressReleasedProperty () { return onInsideSelectionMousePressReleased ; }
451
451
private final ObjectProperty <EventHandler <MouseEvent >> onInsideSelectionMousePressReleased = new SimpleObjectProperty <>( e -> {
452
- onInsideSelectionMousePressReleaseProperty (). get (). accept ( e );
452
+ moveTo ( hit ( e . getX (), e . getY () ). getInsertionIndex (), SelectionPolicy . CLEAR );
453
453
});
454
454
455
455
private final ObjectProperty <Consumer <Point2D >> onNewSelectionDrag = new SimpleObjectProperty <>(p -> {
@@ -476,7 +476,7 @@ public final boolean removeSelection(Selection<PS, SEG, S> selection) {
476
476
@ Override public final void setOnSelectionDropped (EventHandler <MouseEvent > handler ) { onSelectionDropped .set ( handler ); }
477
477
@ Override public final ObjectProperty <EventHandler <MouseEvent >> onSelectionDroppedProperty () { return onSelectionDropped ; }
478
478
private final ObjectProperty <EventHandler <MouseEvent >> onSelectionDropped = new SimpleObjectProperty <>( e -> {
479
- onSelectionDropProperty (). get (). accept ( e );
479
+ moveSelectedText ( hit ( e . getX (), e . getY () ). getInsertionIndex () );
480
480
});
481
481
482
482
// not a hook, but still plays a part in the default mouse behavior
@@ -1581,37 +1581,4 @@ private void suspendVisibleParsWhile(Runnable runnable) {
1581
1581
return CSS_META_DATA_LIST ;
1582
1582
}
1583
1583
1584
-
1585
- // Note: this code should be moved to `onOutsideSelectionMousePressed` property
1586
- // in the next major release before removing this deprecated field
1587
- @ Deprecated private final ObjectProperty <Consumer <MouseEvent >> onOutsideSelectionMousePress = new SimpleObjectProperty <>( e -> {
1588
- CharacterHit hit = hit (e .getX (), e .getY ());
1589
- moveTo (hit .getInsertionIndex (), SelectionPolicy .CLEAR );
1590
- });
1591
- @ Deprecated
1592
- @ Override public final ObjectProperty <Consumer <MouseEvent >> onOutsideSelectionMousePressProperty () {
1593
- return onOutsideSelectionMousePress ;
1594
- }
1595
-
1596
- // Note: this code should be moved to `onInsideSelectionMouseReleased` property
1597
- // in the next major release before removing this deprecated field
1598
- @ Deprecated private final ObjectProperty <Consumer <MouseEvent >> onInsideSelectionMousePressRelease = new SimpleObjectProperty <>( e -> {
1599
- CharacterHit hit = hit (e .getX (), e .getY ());
1600
- moveTo (hit .getInsertionIndex (), SelectionPolicy .CLEAR );
1601
- });
1602
- @ Deprecated
1603
- @ Override public final ObjectProperty <Consumer <MouseEvent >> onInsideSelectionMousePressReleaseProperty () {
1604
- return onInsideSelectionMousePressRelease ;
1605
- }
1606
-
1607
- // Note: this code should be moved to `onSelectionDropped` property
1608
- // in the next major release before removing this deprecated field
1609
- @ Deprecated private final ObjectProperty <Consumer <MouseEvent >> onSelectionDrop = new SimpleObjectProperty <>( e -> {
1610
- CharacterHit hit = hit (e .getX (), e .getY ());
1611
- moveSelectedText (hit .getInsertionIndex ());
1612
- });
1613
- @ Deprecated
1614
- @ Override public final ObjectProperty <Consumer <MouseEvent >> onSelectionDropProperty () {
1615
- return onSelectionDrop ;
1616
- }
1617
1584
}
0 commit comments