Skip to content

Commit

Permalink
Remove deprecated methods (#818)
Browse files Browse the repository at this point in the history
Removed deprecated methods from ViewActions and GenericStyledArea
  • Loading branch information
Jugen authored May 14, 2019
1 parent 836902e commit f41a629
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,14 @@ public final boolean removeSelection(Selection<PS, SEG, S> selection) {
@Override public final void setOnOutsideSelectionMousePressed(EventHandler<MouseEvent> handler) { onOutsideSelectionMousePressed.set( handler ); }
@Override public final ObjectProperty<EventHandler<MouseEvent>> onOutsideSelectionMousePressedProperty() { return onOutsideSelectionMousePressed; }
private final ObjectProperty<EventHandler<MouseEvent>> onOutsideSelectionMousePressed = new SimpleObjectProperty<>( e -> {
onOutsideSelectionMousePressProperty().get().accept(e);
moveTo( hit( e.getX(), e.getY() ).getInsertionIndex(), SelectionPolicy.CLEAR );
});

@Override public final EventHandler<MouseEvent> getOnInsideSelectionMousePressReleased() { return onInsideSelectionMousePressReleased.get(); }
@Override public final void setOnInsideSelectionMousePressReleased(EventHandler<MouseEvent> handler) { onInsideSelectionMousePressReleased.set( handler ); }
@Override public final ObjectProperty<EventHandler<MouseEvent>> onInsideSelectionMousePressReleasedProperty() { return onInsideSelectionMousePressReleased; }
private final ObjectProperty<EventHandler<MouseEvent>> onInsideSelectionMousePressReleased = new SimpleObjectProperty<>( e -> {
onInsideSelectionMousePressReleaseProperty().get().accept(e);
moveTo( hit( e.getX(), e.getY() ).getInsertionIndex(), SelectionPolicy.CLEAR );
});

private final ObjectProperty<Consumer<Point2D>> onNewSelectionDrag = new SimpleObjectProperty<>(p -> {
Expand All @@ -476,7 +476,7 @@ public final boolean removeSelection(Selection<PS, SEG, S> selection) {
@Override public final void setOnSelectionDropped(EventHandler<MouseEvent> handler) { onSelectionDropped.set( handler ); }
@Override public final ObjectProperty<EventHandler<MouseEvent>> onSelectionDroppedProperty() { return onSelectionDropped; }
private final ObjectProperty<EventHandler<MouseEvent>> onSelectionDropped = new SimpleObjectProperty<>( e -> {
onSelectionDropProperty().get().accept(e);
moveSelectedText( hit( e.getX(), e.getY() ).getInsertionIndex() );
});

// not a hook, but still plays a part in the default mouse behavior
Expand Down Expand Up @@ -1581,37 +1581,4 @@ private void suspendVisibleParsWhile(Runnable runnable) {
return CSS_META_DATA_LIST;
}


// Note: this code should be moved to `onOutsideSelectionMousePressed` property
// in the next major release before removing this deprecated field
@Deprecated private final ObjectProperty<Consumer<MouseEvent>> onOutsideSelectionMousePress = new SimpleObjectProperty<>( e -> {
CharacterHit hit = hit(e.getX(), e.getY());
moveTo(hit.getInsertionIndex(), SelectionPolicy.CLEAR);
});
@Deprecated
@Override public final ObjectProperty<Consumer<MouseEvent>> onOutsideSelectionMousePressProperty() {
return onOutsideSelectionMousePress;
}

// Note: this code should be moved to `onInsideSelectionMouseReleased` property
// in the next major release before removing this deprecated field
@Deprecated private final ObjectProperty<Consumer<MouseEvent>> onInsideSelectionMousePressRelease = new SimpleObjectProperty<>( e -> {
CharacterHit hit = hit(e.getX(), e.getY());
moveTo(hit.getInsertionIndex(), SelectionPolicy.CLEAR);
});
@Deprecated
@Override public final ObjectProperty<Consumer<MouseEvent>> onInsideSelectionMousePressReleaseProperty() {
return onInsideSelectionMousePressRelease;
}

// Note: this code should be moved to `onSelectionDropped` property
// in the next major release before removing this deprecated field
@Deprecated private final ObjectProperty<Consumer<MouseEvent>> onSelectionDrop = new SimpleObjectProperty<>( e -> {
CharacterHit hit = hit(e.getX(), e.getY());
moveSelectedText(hit.getInsertionIndex());
});
@Deprecated
@Override public final ObjectProperty<Consumer<MouseEvent>> onSelectionDropProperty() {
return onSelectionDrop;
}
}
21 changes: 0 additions & 21 deletions richtextfx/src/main/java/org/fxmisc/richtext/ViewActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,25 +463,4 @@ default void hideContextMenu() {
}
}

/** Use setOnOutsideSelectionMousePress<u>ed</u>(<i>EventHandler&gt;MouseEvent&lt;</i>) instead, which is FXML compatible */
@Deprecated default void setOnOutsideSelectionMousePress(Consumer<MouseEvent> consumer) { onOutsideSelectionMousePressProperty().set(consumer); }
/** Use getOnOutsideSelectionMousePress<u>ed</u>() instead */
@Deprecated default Consumer<MouseEvent> getOnOutsideSelectionMousePress() { return onOutsideSelectionMousePressProperty().get(); }
/** Use onOutsideSelectionMousePress<u>ed</u>Property() instead */
@Deprecated ObjectProperty<Consumer<MouseEvent>> onOutsideSelectionMousePressProperty();

/** Use getOnInsideSelectionMousePressRelease<u>d</u>() instead */
@Deprecated default Consumer<MouseEvent> getOnInsideSelectionMousePressRelease() { return onInsideSelectionMousePressReleaseProperty().get(); }
/** Use setOnInsideSelectionMousePressRelease<u>d</u>(<i>EventHandler&gt;MouseEvent&lt;</i>) instead, which is FXML compatible */
@Deprecated default void setOnInsideSelectionMousePressRelease(Consumer<MouseEvent> consumer) { onInsideSelectionMousePressReleaseProperty().set(consumer); }
/** Use onInsideSelectionMousePressRelease<u>d</u>Property() instead */
@Deprecated ObjectProperty<Consumer<MouseEvent>> onInsideSelectionMousePressReleaseProperty();

/** Use getOnSelectionDrop<u>ped</u>() instead */
@Deprecated default Consumer<MouseEvent> getOnSelectionDrop() { return onSelectionDropProperty().get(); }
/** Use setOnSelectionDrop<u>ped</u>(<i>EventHandler&gt;MouseEvent&lt;</i>) instead, which is FXML compatible */
@Deprecated default void setOnSelectionDrop(Consumer<MouseEvent> consumer) { onSelectionDropProperty().set(consumer); }
/** Use onSelectionDrop<u>ped</u>Property() instead */
@Deprecated ObjectProperty<Consumer<MouseEvent>> onSelectionDropProperty();

}

0 comments on commit f41a629

Please sign in to comment.