diff --git a/README.adoc b/README.md similarity index 62% rename from README.adoc rename to README.md index 3ad16f3..88b2088 100644 --- a/README.adoc +++ b/README.md @@ -1,9 +1,9 @@ -= Guitare Theory Helper (GTH) +# Guitar Theory Helper (GTH) GTH is lightweight, cross-platform and easy-to-use desktop application designed to help the comprehension of the guitar theory, including gammas, chords but also degrees. -[link=https://github.com/gamarcad/gth/blob/master/images/gth-screenshot.png?raw=true] +![Alt Guitar Theory Helper](https://github.com/gamarcad/gth/blob/master/images/gth-screenshot.png?raw=true) In practice, this application allows to: @@ -13,7 +13,12 @@ In practice, this application allows to: - Modify the desired gamma depending on a given degree. -== Contribution +## Installing from sources + +It is possible to package GTH easily by using Maven, by taping `mvn package` in your terminal. +After that, launch the executable with `java -jar target/guitar-theory-helper-1.0-SNAPSHOT.jar`. + +## Contribution Please, notice that this application has been developed in few hours, so still under development. To contribute, please refer to the `CONTRIBUTE.adoc` file. \ No newline at end of file diff --git a/images/gth-screenshot.png b/images/gth-screenshot.png index 828315b..c564dc1 100644 Binary files a/images/gth-screenshot.png and b/images/gth-screenshot.png differ diff --git a/pom.xml b/pom.xml index 12aa6fb..62c7aca 100644 --- a/pom.xml +++ b/pom.xml @@ -13,6 +13,7 @@ 15 UTF-8 16 + main.Main @@ -34,6 +35,25 @@ javafx-fxml ${javafx.version} + + + org.openjfx + javafx-graphics + ${javafx.version} + win + + + org.openjfx + javafx-graphics + ${javafx.version} + linux + + + org.openjfx + javafx-graphics + ${javafx.version} + mac + @@ -43,9 +63,29 @@ javafx-maven-plugin 0.0.6 - view.Main + ${project.mainClass} + + + maven-shade-plugin + 3.2.1 + + + package + + shade + + + + + ${project.mainClass} + + + + + + diff --git a/src/main/java/main.java b/src/main/java/main.java deleted file mode 100644 index 0eeefa5..0000000 --- a/src/main/java/main.java +++ /dev/null @@ -1,13 +0,0 @@ -import model.*; - -public class main { - public static void main(String[] args) { - Gamma gamme = new Gamma( Note.C, Interval.MAJOR ); - for ( Note note : gamme.getNotes() ) { - System.out.println(note); - } - - AccordFactory accordFactory = AccordFactory.buildFactory(gamme); - System.out.println( accordFactory.getPowerChord() ); - } -} diff --git a/src/main/java/main/Main.java b/src/main/java/main/Main.java new file mode 100644 index 0000000..db69f39 --- /dev/null +++ b/src/main/java/main/Main.java @@ -0,0 +1,9 @@ +package main; + +import view.GuitarTheoryHelperApplication; + +public class Main { + public static void main(String[] args) { + GuitarTheoryHelperApplication.main(args); + } +} diff --git a/src/main/java/view/MainController.java b/src/main/java/view/GTHController.java similarity index 86% rename from src/main/java/view/MainController.java rename to src/main/java/view/GTHController.java index 8ea2887..c18989f 100644 --- a/src/main/java/view/MainController.java +++ b/src/main/java/view/GTHController.java @@ -1,8 +1,10 @@ package view; import javafx.fxml.FXML; +import javafx.fxml.Initializable; import javafx.scene.Group; import javafx.scene.control.ChoiceBox; +import javafx.scene.text.Text; import model.*; import view.converters.AccordStringConverter; import view.converters.IntervalStringConverter; @@ -11,9 +13,10 @@ import view.wrappers.GammaDescriptionGroupWrapper; import view.wrappers.GuitarNeckGroupWrapper; +import java.net.URL; import java.util.*; -public class MainController { +public class GTHController implements Initializable { @FXML private Group guitarGroup; @@ -34,6 +37,22 @@ public class MainController { private Group groupGammaDescription; + @FXML + private Text textChordsTitle; + + @FXML + private Text textFundamental; + + @FXML + private Text textInterval; + + @FXML + private Text textMode; + + @FXML + private Text textChord; + + private GuitarNeckGroupWrapper guitarNeckGroupWrapper; private GammaDescriptionGroupWrapper gammaDescriptionGroupWrapper; @@ -44,8 +63,15 @@ public class MainController { private Optional selectedAccordType; - @FXML - public void initialize() { + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + // initialize strings depending on the seleceted bundle + textChordsTitle.setText(resourceBundle.getString("nav.chords")); + textFundamental.setText(resourceBundle.getString("chords.fundamental")); + textInterval.setText(resourceBundle.getString("chords.interval")); + textMode.setText(resourceBundle.getString("chords.mode")); + textChord.setText(resourceBundle.getString("chords.chord")); + // initialize fundamental choice box choiceBoxFundamental.getItems().addAll(Note.values()); choiceBoxFundamental.getSelectionModel().selectFirst(); diff --git a/src/main/java/view/Main.java b/src/main/java/view/GuitarTheoryHelperApplication.java similarity index 68% rename from src/main/java/view/Main.java rename to src/main/java/view/GuitarTheoryHelperApplication.java index 5ebeaed..d2624d4 100644 --- a/src/main/java/view/Main.java +++ b/src/main/java/view/GuitarTheoryHelperApplication.java @@ -7,11 +7,19 @@ import javafx.scene.image.Image; import javafx.stage.Stage; -public class Main extends Application { +import java.util.Locale; +import java.util.ResourceBundle; + +public class GuitarTheoryHelperApplication extends Application { @Override public void start(Stage primaryStage) throws Exception{ - Parent root = FXMLLoader.load(getClass().getResource("/main.fxml")); + // get the local defined by the user + Locale locale = Locale.getDefault(); + ResourceBundle bundle = ResourceBundle.getBundle("strings", locale); + + + Parent root = FXMLLoader.load(getClass().getResource("/main.fxml"), bundle); root.getStylesheets().add("/global.css"); primaryStage.setTitle("Guitar Theory Helper"); primaryStage.getIcons().add(new Image("/gth-logo.png")); diff --git a/src/main/resources/global.css b/src/main/resources/global.css index 33f8264..fc8bbc3 100644 --- a/src/main/resources/global.css +++ b/src/main/resources/global.css @@ -4,4 +4,19 @@ } .text { -fx-fill: rgb(.8, .8, .8); +} + +.fundamentalChoiceBox { + -fx-background-color: #9701FF; + -fx-text-color: #ffff; + + +} + +#leftPanel { + -fx-background-color: #9701FF; +} + +#leftPanel text { + -fx-color: white; } \ No newline at end of file diff --git a/src/main/resources/main.fxml b/src/main/resources/main.fxml index 9bcda57..854e80f 100644 --- a/src/main/resources/main.fxml +++ b/src/main/resources/main.fxml @@ -3,66 +3,219 @@ - - + + + + + + - - - + + + + + +
+ + + + + + + + +
+ + + + + + +
+ +
+ + + + + + + + +
+ + + +
+ + + + + +
+ + + + + + +
+
+
+ + + +
- -
- - - - - - - - - - - + + +
- - - - - - - - - - - - - - + + + + +
- -
- -
-
-
-
-
- - - + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + +
+ +
+ +
+ + + +
+
+ + +
+ +
+
+
+
+ +
+ +
+ +
+ + + +
+
+ + +
+ +
+
+
+
+ +
+ +
+ +
+ + + +
+
+ + +
+ +
+
+
+
+ +
+ +
+ +
+ + + +
+
+ + +
+ +
+
+
+
+
+
+
+
+ + + +
+ +
+
+
+
+ +
+ +
+
+
+
+
+ + + +
+
+ + + + + + +
-
-
+ + diff --git a/src/main/resources/strings_en.properties b/src/main/resources/strings_en.properties new file mode 100644 index 0000000..6143a34 --- /dev/null +++ b/src/main/resources/strings_en.properties @@ -0,0 +1,5 @@ +nav.chords=Chords +chords.fundamental=Fundamental +chords.chord=Chord +chords.mode=Mode +chords.interval=Interval \ No newline at end of file diff --git a/src/main/resources/strings_fr.properties b/src/main/resources/strings_fr.properties new file mode 100644 index 0000000..d3ba8d1 --- /dev/null +++ b/src/main/resources/strings_fr.properties @@ -0,0 +1,5 @@ +nav.chords=Accords +chords.fundamental=Fondamental +chords.chord=Accord +chords.mode=Mode +chords.interval=Interval \ No newline at end of file