Commit 6adb0c77 authored by Daniel Schramm's avatar Daniel Schramm
Browse files

Buttons added to the feature point sliders

parent 96eaaee7
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -138,9 +138,19 @@ public class DistancePanel extends ControlPanel {
            });
            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.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));
            // Modify listener of the ENTER key press
            final Object enterKeyAction = sliderInput.getInputMap()