|
4 | 4 | import edu.wpi.grip.core.Step;
|
5 | 5 | import edu.wpi.grip.core.sockets.InputSocket;
|
6 | 6 | import edu.wpi.grip.core.sockets.OutputSocket;
|
| 7 | +import edu.wpi.grip.core.sockets.Socket; |
| 8 | +import edu.wpi.grip.core.sockets.SocketHint; |
7 | 9 | import edu.wpi.grip.ui.Controller;
|
8 | 10 | import edu.wpi.grip.ui.annotations.ParametrizedController;
|
9 | 11 | import edu.wpi.grip.ui.components.ExceptionWitnessResponderButton;
|
|
22 | 24 |
|
23 | 25 | import javafx.fxml.FXML;
|
24 | 26 | import javafx.scene.Node;
|
| 27 | +import javafx.scene.control.Button; |
25 | 28 | import javafx.scene.control.Labeled;
|
26 | 29 | import javafx.scene.image.Image;
|
27 | 30 | import javafx.scene.image.ImageView;
|
@@ -59,6 +62,8 @@ public class StepController implements Controller {
|
59 | 62 | private VBox outputs;
|
60 | 63 | @FXML
|
61 | 64 | private ImageView expandIcon;
|
| 65 | + @FXML |
| 66 | + private Button expand; |
62 | 67 | private ControllerMap<InputSocketController, Node> inputSocketMapManager;
|
63 | 68 | private ControllerMap<OutputSocketController, Node> outputSocketMapManager;
|
64 | 69 |
|
@@ -89,12 +94,21 @@ private void initialize() {
|
89 | 94 | new Image(InputStream.class.cast(icon))));
|
90 | 95 | buttons.getChildren().add(0, exceptionWitnessResponderButtonFactory.create(step, "Step Error"));
|
91 | 96 |
|
92 |
| - expandIcon.setImage(new Image("/edu/wpi/grip/ui/icons/up.png")); |
| 97 | + if (step.getInputSockets().stream() |
| 98 | + .allMatch(inputSocket -> inputSocket.getSocketHint().getView() |
| 99 | + .equals(SocketHint.View.NONE))){ |
| 100 | + expand.setManaged(false); |
| 101 | + } else { |
| 102 | + expandIcon.setImage(new Image("/edu/wpi/grip/ui/icons/up.png")); |
| 103 | + } |
| 104 | + |
93 | 105 | // Add a SocketControlView for each input socket and output socket
|
94 | 106 | for (InputSocket<?> inputSocket : step.getInputSockets()) {
|
95 | 107 | InputSocketController tempSocket = inputSocketControllerFactory.create(inputSocket);
|
96 | 108 | inputSocketMapManager.add(tempSocket);
|
97 |
| - inputSockets.add(tempSocket); |
| 109 | + if(!inputSocket.getSocketHint().getView().equals(SocketHint.View.NONE)) { |
| 110 | + inputSockets.add(tempSocket); |
| 111 | + } |
98 | 112 | }
|
99 | 113 |
|
100 | 114 | for (OutputSocket<?> outputSocket : step.getOutputSockets()) {
|
|
0 commit comments