-
Notifications
You must be signed in to change notification settings - Fork 109
Add About window #588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add About window #588
Changes from 12 commits
93f6507
bdea85f
aa2f7c1
fec2655
6433615
3add80e
662d1fb
5ef3bd6
1e25a05
e540e5a
e393211
0b4fd0b
ff56647
4547ce4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package edu.wpi.grip.core.operations.network; | ||
|
|
||
| import com.google.inject.AbstractModule; | ||
| import com.google.inject.name.Names; | ||
| import edu.wpi.grip.core.operations.network.ros.MockROSManager; | ||
| import edu.wpi.grip.core.operations.network.ros.ROSNetworkPublisherFactory; | ||
|
|
||
| /** | ||
| * A mock of {@Link GRIPNetworkModule} for testing. | ||
| */ | ||
| public final class MockGRIPNetworkModule extends AbstractModule { | ||
| @Override | ||
| protected void configure() { | ||
| bind(MapNetworkPublisherFactory.class) | ||
| .annotatedWith(Names.named("ntManager")) | ||
| .to(MockMapNetworkPublisher.class); | ||
| bind(ROSNetworkPublisherFactory.class) | ||
| .annotatedWith(Names.named("rosManager")) | ||
| .to(MockROSManager.class); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package edu.wpi.grip.core.operations.network.ros; | ||
|
|
||
| public class MockROSManager implements ROSNetworkPublisherFactory { | ||
|
|
||
| @Override | ||
| public <C extends JavaToMessageConverter> ROSMessagePublisher create(C converter) { | ||
| return null; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| package edu.wpi.grip.ui; | ||
|
|
||
| import javafx.fxml.FXML; | ||
| import javafx.scene.control.Label; | ||
| import javafx.scene.input.MouseEvent; | ||
|
|
||
| import javax.inject.Inject; | ||
|
|
||
| public class AboutDialogController { | ||
|
|
||
| @Inject | ||
| private Main main; | ||
|
|
||
| @FXML | ||
| private Label versionNumberLabel; | ||
|
|
||
| @FXML | ||
| void mousePressedDocumentationButton(MouseEvent event) { | ||
| main.getHostServices().showDocument("http://wpilib.screenstepslive.com/s/4485/m/50711"); | ||
| } | ||
|
|
||
| @FXML | ||
| void mousePressedGithubButton(MouseEvent event) { | ||
| main.getHostServices().showDocument("https://github.com/WPIRoboticsProjects/GRIP"); | ||
| } | ||
|
|
||
| @FXML | ||
| void initialize() { | ||
| assert versionNumberLabel != null : "fx:id=\"versionNumberText\" was not injected: check your FXML file 'AboutDialog.fxml'."; | ||
|
||
|
|
||
| versionNumberLabel.setText("Version " + edu.wpi.grip.core.Main.class.getPackage().getImplementationVersion()); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
|
|
||
| <?import java.net.URL?> | ||
| <?import javafx.geometry.Insets?> | ||
| <?import javafx.scene.control.Label?> | ||
| <?import javafx.scene.image.Image?> | ||
| <?import javafx.scene.image.ImageView?> | ||
| <?import javafx.scene.layout.HBox?> | ||
| <?import javafx.scene.layout.Pane?> | ||
| <?import javafx.scene.layout.StackPane?> | ||
| <?import javafx.scene.layout.VBox?> | ||
| <?import javafx.scene.text.Font?> | ||
|
|
||
| <VBox fx:id="root" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="330.0" prefWidth="600.0" styleClass="about-window" stylesheets="@GRIP.css" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="edu.wpi.grip.ui.AboutDialogController"> | ||
| <children> | ||
| <Pane VBox.vgrow="ALWAYS" /> | ||
| <HBox> | ||
| <children> | ||
| <Pane HBox.hgrow="ALWAYS" /> | ||
| <ImageView fitHeight="156.0" fitWidth="156.0" pickOnBounds="true" preserveRatio="true"> | ||
| <image> | ||
| <Image url="@icons/grip.png" /> | ||
| </image> | ||
| </ImageView> | ||
| <Pane HBox.hgrow="ALWAYS" /> | ||
| <VBox HBox.hgrow="ALWAYS"> | ||
| <children> | ||
| <Label style="-fx-font-size: 64; -fx-font-weight: BOLD;" text="GRIP" /> | ||
| <Label fx:id="versionNumberLabel" text="Version 0.0.0" /> | ||
| <Pane VBox.vgrow="ALWAYS" /> | ||
| <HBox> | ||
| <children> | ||
| <StackPane onMousePressed="#mousePressedGithubButton" styleClass="about-button"> | ||
| <children> | ||
| <Label text="➔ Github"> | ||
| <font> | ||
| <Font size="14.0" /> | ||
| </font></Label> | ||
| </children> | ||
| <opaqueInsets> | ||
| <Insets /> | ||
| </opaqueInsets> | ||
| <HBox.margin> | ||
| <Insets left="-3.0" /> | ||
| </HBox.margin> | ||
| <padding> | ||
| <Insets bottom="3.0" left="3.0" right="3.0" top="3.0" /> | ||
| </padding> | ||
| </StackPane> | ||
| </children> | ||
| </HBox> | ||
| <Pane VBox.vgrow="ALWAYS" /> | ||
| <HBox> | ||
| <children> | ||
| <StackPane onMousePressed="#mousePressedDocumentationButton" styleClass="about-button"> | ||
| <children> | ||
| <Label text="➔ ScreenSteps Documentation" /> | ||
| </children> | ||
| <HBox.margin> | ||
| <Insets left="-3.0" /> | ||
| </HBox.margin> | ||
| <padding> | ||
| <Insets bottom="3.0" left="3.0" right="3.0" top="3.0" /> | ||
| </padding> | ||
| </StackPane> | ||
| </children> | ||
| </HBox> | ||
| </children> | ||
| </VBox> | ||
| <Pane HBox.hgrow="ALWAYS" /> | ||
| </children> | ||
| </HBox> | ||
| <Pane VBox.vgrow="ALWAYS"> | ||
| <VBox.margin> | ||
| <Insets /> | ||
| </VBox.margin> | ||
| </Pane> | ||
| <HBox> | ||
| <children> | ||
| <Pane HBox.hgrow="ALWAYS" /> | ||
| <Label style="-fx-font-size: 12;" text="GRIP is licensed under a 3 Clause BSD License" textFill="#818181" /> | ||
| <Pane HBox.hgrow="ALWAYS" /> | ||
| </children> | ||
| <padding> | ||
| <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> | ||
| </padding> | ||
| </HBox> | ||
| </children> | ||
| <stylesheets> | ||
| <URL value="@roboto/Roboto.css" /> | ||
|
||
| <URL value="@GRIP.css" /> | ||
| </stylesheets> | ||
| </VBox> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.