|
@@ -10,37 +10,30 @@ import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardInputCallback;
|
|
|
import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardInputFactory;
|
|
|
import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardNumberInput;
|
|
|
|
|
|
-public class GripperNodeContribution implements ProgramNodeContribution {
|
|
|
- private final String POSITION="POSITION";
|
|
|
- private final String SPEED="SPEED";
|
|
|
-
|
|
|
+public class GripperBlowoutNodeContribution implements ProgramNodeContribution {
|
|
|
+ private static final String KEY_DELAY = "KEY_DELAY";
|
|
|
private final ProgramAPI programAPI;
|
|
|
private final UndoRedoManager undoRedoManager;
|
|
|
private final KeyboardInputFactory keyboardFactory;
|
|
|
-
|
|
|
- private final GripperNodeView view;
|
|
|
+ private final GripperBlowoutNodeView view;
|
|
|
private final DataModel model;
|
|
|
|
|
|
-
|
|
|
- public GripperNodeContribution(ProgramAPIProvider apiProvider, GripperNodeView view, DataModel model) {
|
|
|
+ public GripperBlowoutNodeContribution(ProgramAPIProvider apiProvider, GripperBlowoutNodeView view, DataModel model) {
|
|
|
this.programAPI = apiProvider.getProgramAPI();
|
|
|
this.undoRedoManager = apiProvider.getProgramAPI().getUndoRedoManager();
|
|
|
this.keyboardFactory = apiProvider.getUserInterfaceAPI().getUserInteraction().getKeyboardInputFactory();
|
|
|
-
|
|
|
this.view = view;
|
|
|
this.model = model;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void openView() {
|
|
|
- view.setPosition(model.get(POSITION, 0));
|
|
|
- view.setSpeed(model.get(SPEED, 20));
|
|
|
+ view.setSpeed(model.get(KEY_DELAY, 20));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void closeView() {
|
|
|
- model.set(POSITION, view.getPosition());
|
|
|
- model.set(SPEED, view.getSpeed());
|
|
|
+ model.set(KEY_DELAY, view.getSpeed());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -56,7 +49,7 @@ public class GripperNodeContribution implements ProgramNodeContribution {
|
|
|
|
|
|
public KeyboardNumberInput getKeyboardForPositionField() {
|
|
|
KeyboardNumberInput<Integer> keyboardInput = keyboardFactory.createIntegerKeypadInput();
|
|
|
- keyboardInput.setInitialValue(model.get(POSITION, 0));
|
|
|
+ keyboardInput.setInitialValue(model.get(KEY_DELAY, 0));
|
|
|
return keyboardInput;
|
|
|
}
|
|
|
|
|
@@ -64,7 +57,7 @@ public class GripperNodeContribution implements ProgramNodeContribution {
|
|
|
return new KeyboardInputCallback<Integer>() {
|
|
|
@Override
|
|
|
public void onOk(Integer value) {
|
|
|
- model.set(POSITION, value);
|
|
|
+ model.set(KEY_DELAY, value);
|
|
|
view.setPosition(value);
|
|
|
}
|
|
|
};
|
|
@@ -72,7 +65,7 @@ public class GripperNodeContribution implements ProgramNodeContribution {
|
|
|
|
|
|
public KeyboardNumberInput getKeyboardForSpeedField() {
|
|
|
KeyboardNumberInput<Integer> keyboardInput = keyboardFactory.createIntegerKeypadInput();
|
|
|
- keyboardInput.setInitialValue(model.get(SPEED, 0));
|
|
|
+ keyboardInput.setInitialValue(model.get(KEY_DELAY, 0));
|
|
|
return keyboardInput;
|
|
|
}
|
|
|
|
|
@@ -80,7 +73,7 @@ public class GripperNodeContribution implements ProgramNodeContribution {
|
|
|
return new KeyboardInputCallback<Integer>() {
|
|
|
@Override
|
|
|
public void onOk(Integer value) {
|
|
|
- model.set(SPEED, value);
|
|
|
+ model.set(KEY_DELAY, value);
|
|
|
view.setSpeed(value);
|
|
|
}
|
|
|
};
|