11package edu .wpi .grip .ui ;
22
3- import javafx .event .ActionEvent ;
43import javafx .fxml .FXML ;
4+ import javafx .scene .input .MouseEvent ;
5+ import javafx .scene .paint .Color ;
6+ import javafx .scene .shape .Rectangle ;
57import javafx .scene .text .Text ;
68
79import javax .inject .Inject ;
@@ -15,18 +17,61 @@ public class AboutDialogController {
1517 private Text versionNumberText ;
1618
1719 @ FXML
18- void githubButtonAction (ActionEvent event ) {
19- main .getHostServices ().showDocument ("https://github.com/WPIRoboticsProjects/GRIP" );
20+ private Rectangle githubRectangle ;
21+
22+ @ FXML
23+ private Text githubText ;
24+
25+ @ FXML
26+ private Rectangle documentationRectangle ;
27+
28+ @ FXML
29+ private Text documentationText ;
30+
31+ private static final Color CLEAR_COLOR = new Color (0.0 , 0.0 , 0.0 , 0.0 );
32+
33+ @ FXML
34+ void mouseEnteredDocumentationButton (MouseEvent event ) {
35+ documentationRectangle .setFill (Color .GRAY );
36+ documentationText .setFill (Color .WHITE );
37+ }
38+
39+ @ FXML
40+ void mouseEnteredGithubButton (MouseEvent event ) {
41+ githubRectangle .setFill (Color .GRAY );
42+ githubText .setFill (Color .WHITE );
43+ }
44+
45+ @ FXML
46+ void mouseExitedDocumentationButton (MouseEvent event ) {
47+ documentationRectangle .setFill (CLEAR_COLOR );
48+ documentationText .setFill (Color .BLACK );
49+ }
50+
51+ @ FXML
52+ void mouseExitedGithubButton (MouseEvent event ) {
53+ githubRectangle .setFill (CLEAR_COLOR );
54+ githubText .setFill (Color .BLACK );
2055 }
2156
2257 @ FXML
23- void screenstepsButtonAction ( ActionEvent event ) {
58+ void mousePressedDocumentationButton ( MouseEvent event ) {
2459 main .getHostServices ().showDocument ("http://wpilib.screenstepslive.com/s/4485/m/50711" );
2560 }
2661
62+ @ FXML
63+ void mousePressedGithubButton (MouseEvent event ) {
64+ main .getHostServices ().showDocument ("https://github.com/WPIRoboticsProjects/GRIP" );
65+ }
66+
2767 @ FXML
2868 void initialize () {
2969 assert versionNumberText != null : "fx:id=\" versionNumberText\" was not injected: check your FXML file 'AboutDialog.fxml'." ;
70+ assert githubRectangle != null : "fx:id=\" githubRectangle\" was not injected: check your FXML file 'AboutDialog.fxml'." ;
71+ assert githubText != null : "fx:id=\" githubText\" was not injected: check your FXML file 'AboutDialog.fxml'." ;
72+ assert documentationRectangle != null : "fx:id=\" documentationRectangle\" was not injected: check your FXML file 'AboutDialog.fxml'." ;
73+ assert documentationText != null : "fx:id=\" documentationText\" was not injected: check your FXML file 'AboutDialog.fxml'." ;
74+
3075
3176 versionNumberText .setText ("Version " + edu .wpi .grip .core .Main .class .getPackage ().getImplementationVersion ());
3277 }
0 commit comments