@@ -442,14 +442,14 @@ public final boolean removeSelection(Selection<PS, SEG, S> selection) {
442442 @ Override public final void setOnOutsideSelectionMousePressed (EventHandler <MouseEvent > handler ) { onOutsideSelectionMousePressed .set ( handler ); }
443443 @ Override public final ObjectProperty <EventHandler <MouseEvent >> onOutsideSelectionMousePressedProperty () { return onOutsideSelectionMousePressed ; }
444444 private final ObjectProperty <EventHandler <MouseEvent >> onOutsideSelectionMousePressed = new SimpleObjectProperty <>( e -> {
445- onOutsideSelectionMousePressProperty (). get (). accept ( e );
445+ moveTo ( hit ( e . getX (), e . getY () ). getInsertionIndex (), SelectionPolicy . CLEAR );
446446 });
447447
448448 @ Override public final EventHandler <MouseEvent > getOnInsideSelectionMousePressReleased () { return onInsideSelectionMousePressReleased .get (); }
449449 @ Override public final void setOnInsideSelectionMousePressReleased (EventHandler <MouseEvent > handler ) { onInsideSelectionMousePressReleased .set ( handler ); }
450450 @ Override public final ObjectProperty <EventHandler <MouseEvent >> onInsideSelectionMousePressReleasedProperty () { return onInsideSelectionMousePressReleased ; }
451451 private final ObjectProperty <EventHandler <MouseEvent >> onInsideSelectionMousePressReleased = new SimpleObjectProperty <>( e -> {
452- onInsideSelectionMousePressReleaseProperty (). get (). accept ( e );
452+ moveTo ( hit ( e . getX (), e . getY () ). getInsertionIndex (), SelectionPolicy . CLEAR );
453453 });
454454
455455 private final ObjectProperty <Consumer <Point2D >> onNewSelectionDrag = new SimpleObjectProperty <>(p -> {
@@ -476,7 +476,7 @@ public final boolean removeSelection(Selection<PS, SEG, S> selection) {
476476 @ Override public final void setOnSelectionDropped (EventHandler <MouseEvent > handler ) { onSelectionDropped .set ( handler ); }
477477 @ Override public final ObjectProperty <EventHandler <MouseEvent >> onSelectionDroppedProperty () { return onSelectionDropped ; }
478478 private final ObjectProperty <EventHandler <MouseEvent >> onSelectionDropped = new SimpleObjectProperty <>( e -> {
479- onSelectionDropProperty (). get (). accept ( e );
479+ moveSelectedText ( hit ( e . getX (), e . getY () ). getInsertionIndex () );
480480 });
481481
482482 // not a hook, but still plays a part in the default mouse behavior
@@ -1581,37 +1581,4 @@ private void suspendVisibleParsWhile(Runnable runnable) {
15811581 return CSS_META_DATA_LIST ;
15821582 }
15831583
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- }
16171584}
0 commit comments