Skip to content

Commit 1268062

Browse files
committed
Fix unintentional layout changes
1 parent faba815 commit 1268062

File tree

4 files changed

+83
-83
lines changed

4 files changed

+83
-83
lines changed

core/src/main/java/edu/wpi/grip/core/http/GripServer.java

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,36 @@ public class GripServer {
7979
*/
8080
private State state = State.PRE_RUN;
8181

82+
/**
83+
* Possible lifecycle states of the server.
84+
*/
85+
public enum State {
86+
/**
87+
* The server has not been started yet.
88+
*/
89+
PRE_RUN,
90+
/**
91+
* The server is currently running.
92+
*/
93+
RUNNING,
94+
/**
95+
* The server was running and has been stopped.
96+
*/
97+
STOPPED
98+
}
99+
100+
public interface JettyServerFactory {
101+
Server create(int port);
102+
}
103+
104+
public static class JettyServerFactoryImpl implements JettyServerFactory {
105+
106+
@Override
107+
public Server create(int port) {
108+
return new Server(port);
109+
}
110+
}
111+
82112
@Inject
83113
GripServer(ContextStore contextStore,
84114
JettyServerFactory serverFactory,
@@ -202,34 +232,4 @@ public void settingsChanged(ProjectSettingsChangedEvent event) {
202232
}
203233
}
204234

205-
/**
206-
* Possible lifecycle states of the server.
207-
*/
208-
public enum State {
209-
/**
210-
* The server has not been started yet.
211-
*/
212-
PRE_RUN,
213-
/**
214-
* The server is currently running.
215-
*/
216-
RUNNING,
217-
/**
218-
* The server was running and has been stopped.
219-
*/
220-
STOPPED
221-
}
222-
223-
public interface JettyServerFactory {
224-
Server create(int port);
225-
}
226-
227-
public static class JettyServerFactoryImpl implements JettyServerFactory {
228-
229-
@Override
230-
public Server create(int port) {
231-
return new Server(port);
232-
}
233-
}
234-
235235
}

core/src/main/java/edu/wpi/grip/core/operations/Operations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ ImmutableList<OperationMetaData> operations() {
189189
}
190190

191191
/**
192-
* Adds operations and posts an {@link OperationAddedEvent} for each one.
192+
* Submits all operations for addition on the {@link EventBus}.
193193
*/
194194
public void addOperations() {
195195
operations.stream()

core/src/test/java/edu/wpi/grip/core/PipelineRunnerTest.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,31 @@
3737
@RunWith(Enclosed.class)
3838
public class PipelineRunnerTest {
3939

40+
interface SimpleOperation extends Operation {
41+
OperationDescription DESCRIPTION = OperationDescription.builder()
42+
.name("Simple Operation")
43+
.summary("A simple operation for testing")
44+
.build();
45+
46+
@Override
47+
default List<InputSocket> getInputSockets() {
48+
return ImmutableList.of(
49+
new MockInputSocket("Test Socket") {
50+
@Override
51+
public boolean dirtied() {
52+
return true;
53+
}
54+
}
55+
);
56+
}
57+
58+
59+
@Override
60+
default List<OutputSocket> getOutputSockets() {
61+
return ImmutableList.of();
62+
}
63+
}
64+
4065
public static class SimpleTests {
4166
private FailureListener failureListener;
4267

@@ -350,31 +375,6 @@ public void cleanUp() {
350375
}
351376
}
352377

353-
interface SimpleOperation extends Operation {
354-
OperationDescription DESCRIPTION = OperationDescription.builder()
355-
.name("Simple Operation")
356-
.summary("A simple operation for testing")
357-
.build();
358-
359-
@Override
360-
default List<InputSocket> getInputSockets() {
361-
return ImmutableList.of(
362-
new MockInputSocket("Test Socket") {
363-
@Override
364-
public boolean dirtied() {
365-
return true;
366-
}
367-
}
368-
);
369-
}
370-
371-
372-
@Override
373-
default List<OutputSocket> getOutputSockets() {
374-
return ImmutableList.of();
375-
}
376-
}
377-
378378
static class FailureListener extends Service.Listener {
379379
private Service.State failedFrom = null;
380380
private Throwable failure = null;

ui/src/main/java/edu/wpi/grip/ui/pipeline/AddSourceView.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -65,33 +65,6 @@ public class AddSourceView extends HBox {
6565
private final Button ipcamButton;
6666
private Optional<Dialog> activeDialog = Optional.empty();
6767

68-
private static class SourceDialog extends Dialog<ButtonType> {
69-
private final Text errorText = new Text();
70-
71-
private SourceDialog(final Parent root, Control inputField) {
72-
super();
73-
74-
this.getDialogPane().getStyleClass().add(SOURCE_DIALOG_STYLE_CLASS);
75-
76-
final GridPane gridContent = new GridPane();
77-
gridContent.setMaxWidth(Double.MAX_VALUE);
78-
GridPane.setHgrow(inputField, Priority.ALWAYS);
79-
GridPane.setHgrow(errorText, Priority.NEVER);
80-
errorText.wrappingWidthProperty().bind(inputField.widthProperty());
81-
gridContent.add(errorText, 0, 0);
82-
gridContent.add(inputField, 0, 1);
83-
84-
getDialogPane().setContent(gridContent);
85-
getDialogPane().setStyle(root.getStyle());
86-
getDialogPane().getStylesheets().addAll(root.getStylesheets());
87-
getDialogPane().getButtonTypes().addAll(ButtonType.CANCEL, ButtonType.OK);
88-
}
89-
}
90-
91-
public interface Factory {
92-
AddSourceView create();
93-
}
94-
9568
@Inject
9669
AddSourceView(EventBus eventBus,
9770
MultiImageFileSource.Factory multiImageSourceFactory,
@@ -322,4 +295,31 @@ void closeDialogs() {
322295
}
323296
});
324297
}
298+
299+
public interface Factory {
300+
AddSourceView create();
301+
}
302+
303+
private static class SourceDialog extends Dialog<ButtonType> {
304+
private final Text errorText = new Text();
305+
306+
private SourceDialog(final Parent root, Control inputField) {
307+
super();
308+
309+
this.getDialogPane().getStyleClass().add(SOURCE_DIALOG_STYLE_CLASS);
310+
311+
final GridPane gridContent = new GridPane();
312+
gridContent.setMaxWidth(Double.MAX_VALUE);
313+
GridPane.setHgrow(inputField, Priority.ALWAYS);
314+
GridPane.setHgrow(errorText, Priority.NEVER);
315+
errorText.wrappingWidthProperty().bind(inputField.widthProperty());
316+
gridContent.add(errorText, 0, 0);
317+
gridContent.add(inputField, 0, 1);
318+
319+
getDialogPane().setContent(gridContent);
320+
getDialogPane().setStyle(root.getStyle());
321+
getDialogPane().getStylesheets().addAll(root.getStylesheets());
322+
getDialogPane().getButtonTypes().addAll(ButtonType.CANCEL, ButtonType.OK);
323+
}
324+
}
325325
}

0 commit comments

Comments
 (0)