Skip to content
Snippets Groups Projects
Commit 589a13ed authored by Daniel Schramm's avatar Daniel Schramm
Browse files

Hausdorff distance recomputed when slider is released

parent eebac547
No related branches found
No related tags found
No related merge requests found
......@@ -149,7 +149,7 @@ public class DistancePanel extends ControlPanel {
public void actionPerformed(ActionEvent e) {
originalEnterAction.actionPerformed(e);
if (!checkBox.isSelected()) {
return;
return; // Recompute only if the feature point is selected
}
action.actionPerformed(new ActionEvent(
......@@ -160,6 +160,28 @@ public class DistancePanel extends ControlPanel {
}
}
);
// Add mouse listener of the slider
sliderInput.addMouseListener(new MouseAdapter() {
private double oldValue = DrawableFeaturePoints.DEFAULT_SIZE;
@Override
public void mousePressed(MouseEvent e) {
oldValue = Double.parseDouble(sliderInput.getText());
}
@Override
public void mouseReleased(MouseEvent e) {
if (!checkBox.isSelected() || oldValue == Double.parseDouble(sliderInput.getText())) {
return; // Recompute only if the feature point is selected and value changed
}
action.actionPerformed(new ActionEvent(
e.getSource(),
ActionEvent.ACTION_PERFORMED,
ACTION_COMMAND_DISTANCE_RECOMPUTE)
);
}
});
fpBuilder.addGap();
featurePointStats.put(featurePointType, fpBuilder.addLabelLine(null));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment