Skip to content

Commit

Permalink
EditDataSet: update selected point markers on data or axis changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wirew0rm committed Sep 27, 2023
1 parent 9a4c2df commit 56b964d
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Predicate;

import javafx.application.Platform;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.ObjectProperty;
Expand Down Expand Up @@ -53,6 +54,7 @@
import io.fair_acc.dataset.DataSet;
import io.fair_acc.dataset.EditConstraints;
import io.fair_acc.dataset.EditableDataSet;
import io.fair_acc.dataset.events.ChartBits;

/**
*
Expand Down Expand Up @@ -151,6 +153,14 @@ public class EditDataSet extends TableViewer {
}
};

@Override
public void runPostLayout() {
super.runPostLayout();
if (getChart().getBitState().isDirty(ChartBits.AxisMask | ChartBits.DataSetMask)) {
updateMarker();
}
}

/**
* Creates an event handler that handles a mouse drag on the node.
*/
Expand Down Expand Up @@ -967,11 +977,6 @@ protected class SelectedDataPoint extends Circle {
setOnMouseReleased(dragOver);
setOnMouseDragOver(dragOver);
// this.setOnMouseExited(dragOver);

// TODO: what are these?
// xAxis.addListener(evt -> FXUtils.runFX(() -> this.setCenterX(getX())));
// yAxis.addListener(evt -> FXUtils.runFX(() -> this.setCenterY(getY())));
// dataSet.addListener(e -> FXUtils.runFX(this::update));
}

public void applyDrag(final double deltaX, final double deltaY) {
Expand Down

0 comments on commit 56b964d

Please sign in to comment.