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

Buttons added to the feature point sliders

parent 96eaaee7
No related branches found
No related tags found
No related merge requests found
...@@ -138,9 +138,19 @@ public class DistancePanel extends ControlPanel { ...@@ -138,9 +138,19 @@ public class DistancePanel extends ControlPanel {
}); });
featurePointCheckBoxes.add(checkBox); featurePointCheckBoxes.add(checkBox);
final JTextField sliderInput = fpBuilder.addSliderOptionLine(null, null, 100, null); final JTextField sliderInput = fpBuilder.addSliderButtonedOptionLine(null, null, 100, 1, null);
sliderInput.setText(ControlPanelBuilder.doubleToStringLocale(DrawableFeaturePoints.DEFAULT_SIZE)); sliderInput.setText(ControlPanelBuilder.doubleToStringLocale(DrawableFeaturePoints.DEFAULT_SIZE));
sliderInput.postActionEvent(); // Set correct position of slider sliderInput.postActionEvent(); // Set correct position of slider
sliderInput.addActionListener((ActionEvent ae) -> {
if (ControlPanelBuilder.TEXT_FIELD_BUTTON_PRESSED_MINUS.equals(ae.getActionCommand())
|| ControlPanelBuilder.TEXT_FIELD_BUTTON_PRESSED_PLUS.equals(ae.getActionCommand())) {
action.actionPerformed(new ActionEvent(
ae.getSource(),
ActionEvent.ACTION_PERFORMED,
ACTION_COMMAND_DISTANCE_RECOMPUTE
));
}
});
sliderInput.addActionListener(createListener(action, ACTION_COMMAND_FEATURE_POINT_RESIZE, i)); sliderInput.addActionListener(createListener(action, ACTION_COMMAND_FEATURE_POINT_RESIZE, i));
// Modify listener of the ENTER key press // Modify listener of the ENTER key press
final Object enterKeyAction = sliderInput.getInputMap() final Object enterKeyAction = sliderInput.getInputMap()
......
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