Skip to content

Commit bc96cbe

Browse files
committed
initial commit, very rough and with many errors
0 parents  commit bc96cbe

File tree

138 files changed

+4578
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+4578
-0
lines changed

.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# These are explicitly windows files and should use crlf
5+
*.bat text eol=crlf
6+

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build
6+
7+
# Ignore vscode stuff
8+
.vscode
9+
.settings
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.root {
2+
3+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

app/build.gradle

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* This file was generated by the Gradle 'init' task.
3+
*
4+
* This generated file contains a sample Java application project to get you started.
5+
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
6+
* User Manual available at https://docs.gradle.org/7.2/userguide/building_java_projects.html
7+
*/
8+
9+
plugins {
10+
// Apply the application plugin to add support for building a CLI application in Java.
11+
id 'application'
12+
id 'org.openjfx.javafxplugin' version '0.0.10'
13+
}
14+
15+
repositories {
16+
// Use Maven Central for resolving dependencies.
17+
mavenCentral()
18+
maven { url 'https://jitpack.io' }
19+
}
20+
21+
dependencies {
22+
// Use JUnit Jupiter for testing.
23+
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.2'
24+
25+
// This dependency is used by the application.
26+
implementation 'com.google.guava:guava:30.1.1-jre'
27+
28+
implementation 'com.github.jlbabilino:json:v0.1.0'
29+
}
30+
31+
application {
32+
// Define the main class for the application.
33+
mainClass = 'com.team2363.helixnavigator.App'
34+
}
35+
36+
// javafx {
37+
// version = "17"
38+
// modules = [ 'javafx.controls' ]
39+
// }
40+
41+
tasks.named('test') {
42+
// Use JUnit Platform for unit tests.
43+
useJUnitPlatform()
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*
2+
* Copyright (C) 2021 Triple Helix Robotics - FRC Team 2363
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
package com.team2363.helixnavigator;
18+
19+
import java.util.Collection;
20+
21+
import com.team2363.helixnavigator.document.CurrentDocument;
22+
import com.team2363.helixnavigator.ui.MainScene;
23+
import com.team2363.helixnavigator.ui.console.Console;
24+
import com.team2363.helixnavigator.ui.console.ConsoleGraphic;
25+
26+
import javafx.application.Application;
27+
import javafx.event.ActionEvent;
28+
import javafx.stage.Stage;
29+
import javafx.stage.WindowEvent;
30+
31+
/**
32+
* This class is the base application, i.e. the main class. It lauches the Helix
33+
* Navigator program.
34+
*
35+
* @author Justin Babilino
36+
*/
37+
public class App extends Application {
38+
39+
/**
40+
* Main stage of the application.
41+
*/
42+
private static Stage mainStage;
43+
44+
/**
45+
* Main scene of the application.
46+
*/
47+
private MainScene mainScene;
48+
49+
/**
50+
* Main method that launches the program with arguments.
51+
*
52+
* @param args arguments
53+
*/
54+
public static void main(String[] args) {
55+
launch(args);
56+
}
57+
58+
@Override
59+
public void start(Stage primaryStage) {
60+
mainStage = primaryStage;
61+
62+
mainStage.setTitle("Helix Navigator");
63+
mainStage.setHeight(600);
64+
mainStage.setWidth(800);
65+
mainStage.setOnCloseRequest(this::onWindowCloseRequest);
66+
67+
mainScene = new MainScene();
68+
mainStage.setScene(mainScene.getScene());
69+
70+
Console.out.set("Welcome to Helix Navigator!");
71+
Console.graphic.set(ConsoleGraphic.INFO);
72+
73+
mainStage.show();
74+
}
75+
76+
@Override
77+
public void stop() {
78+
}
79+
80+
private void onWindowCloseRequest(WindowEvent event) {
81+
// if (CurrentDocument.documentProperty().isSaved())
82+
}
83+
84+
public static Stage getMainStage() {
85+
return mainStage;
86+
}
87+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* Copyright (C) 2021 Justin Babilino
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
package com.team2363.helixnavigator.document;
18+
19+
import java.util.Optional;
20+
21+
import com.team2363.helixnavigator.ui.prompts.SavePrompt;
22+
23+
import javafx.beans.property.ObjectProperty;
24+
import javafx.beans.property.SimpleObjectProperty;
25+
import javafx.scene.control.ButtonType;
26+
27+
/**
28+
*
29+
* @author Justin Babilino
30+
*/
31+
public class CurrentDocument {
32+
private static final ObjectProperty<HDocument> document = new SimpleObjectProperty<HDocument>();
33+
34+
public static ObjectProperty<HDocument> documentProperty() {
35+
return document;
36+
}
37+
38+
public static void setDocument(HDocument value) {
39+
document.set(value);
40+
}
41+
42+
public static HDocument getDocument() {
43+
return document.get();
44+
}
45+
46+
public static void closeDocument() {
47+
setDocument(null);
48+
}
49+
50+
public static boolean isDocumentOpen() {
51+
return getDocument() != null;
52+
}
53+
54+
/**
55+
* Attempts to close the document by prompting the user. The user can decide to
56+
* close and save, close without saving, or keep the current document open.
57+
*
58+
* @return <code>true</code> if document was closed or no document was open,
59+
* <code>false</code> if document was not closed
60+
*/
61+
public static boolean requestDocumentClose() {
62+
if (!isDocumentOpen() || getDocument().isSaved()) {
63+
closeDocument();
64+
return true;
65+
} else {
66+
SavePrompt prompt = new SavePrompt();
67+
Optional<ButtonType> response = prompt.showAndWait();
68+
if (response.get() == ButtonType.YES) {
69+
getDocument().save();
70+
closeDocument();
71+
return true;
72+
} else if (response.get() == ButtonType.NO) {
73+
closeDocument();
74+
return true;
75+
} else {
76+
return false;
77+
}
78+
}
79+
}
80+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.team2363.helixnavigator.document;
2+
3+
import com.team2363.lib.json.SerializedJSONObjectValue;
4+
5+
import javafx.beans.property.BooleanProperty;
6+
import javafx.beans.property.SimpleBooleanProperty;
7+
8+
public abstract class HBasePathElement extends HPathElement {
9+
10+
private final BooleanProperty shown = new SimpleBooleanProperty(this, "shown", true);
11+
public HBasePathElement() {
12+
13+
}
14+
15+
public final BooleanProperty shownProperty() {
16+
return shown;
17+
}
18+
19+
public final void setShown(boolean value) {
20+
shown.set(value);
21+
}
22+
23+
@SerializedJSONObjectValue(key = "shown")
24+
public final boolean getShown() {
25+
return shown.get();
26+
}
27+
}

0 commit comments

Comments
 (0)