Skip to content

Commit

Permalink
Fix animation bug. Fix icon not loading. Refactor application folders
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinWoodring committed Jun 22, 2022
1 parent 3438598 commit 3ed774b
Show file tree
Hide file tree
Showing 26 changed files with 53 additions and 52 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">

![The Logo](https://raw.githubusercontent.com/Booglejr/DFAify/main/src/main/resources/com/booglejr/dfaify/dfaify.png)
![The Logo](https://raw.githubusercontent.com/justinwoodring/DFAify/main/src/main/resources/com/justinwoodring/dfaify/dfaify.png)

<h1>DFAify</h1>
</div>
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ javafx {

application {
// Define the main class for the application.
mainClass = 'com.booglejr.dfaify.DFAify'
mainModule = 'com.booglejr.dfaify'
mainClass = 'com.justinwoodring.dfaify.DFAify'
mainModule = 'com.justinwoodring.dfaify'
}

ext.os = org.gradle.internal.os.OperatingSystem.current()
Expand All @@ -53,21 +53,21 @@ jlink{
'--vendor', 'Justin Woodring',
'--copyright', 'Copyright 2022. Justin Woodring',
'--description', 'DFAify is a diagramming and graphical analysis tool supporting playback and stepping logic for DFAs.',
'--about-url', 'https://github.com/Booglejr/DFAify',
'--about-url', 'https://github.com/justinwoodring/DFAify',
'--license-file', 'LICENSE'
]
if(os.macOsX) {
jvmArgs = ["-Duser.dir=/tmp"]
} else if(os.windows) {
installerType = 'exe'
installerOptions += [
'--icon', 'src/main/resources/com/booglejr/dfaify/icons/dfaify.ico',
'--icon', 'src/main/resources/com/justinwoodring/dfaify/icons/dfaify.ico',
'--win-per-user-install',
'--win-dir-chooser',
'--win-menu',
'--win-shortcut'
]
imageOptions += ['--icon', 'src/main/resources/com/booglejr/dfaify/icons/dfaify.ico']
imageOptions += ['--icon', 'src/main/resources/com/justinwoodring/dfaify/icons/dfaify.ico']
} else {
installerType = 'deb' // 'rpm'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.booglejr.dfaify;
package com.justinwoodring.dfaify;

import java.io.File;
import java.io.FileOutputStream;
Expand All @@ -8,10 +8,10 @@

import javax.xml.parsers.ParserConfigurationException;

import com.booglejr.dfaify.controllers.AppController;
import com.booglejr.dfaify.models.AppModel;
import com.booglejr.dfaify.models.dfa.DFA;
import com.booglejr.dfaify.views.AppView;
import com.justinwoodring.dfaify.controllers.AppController;
import com.justinwoodring.dfaify.models.AppModel;
import com.justinwoodring.dfaify.models.dfa.DFA;
import com.justinwoodring.dfaify.views.AppView;

import org.apache.commons.io.IOUtils;
import org.xml.sax.SAXException;
Expand All @@ -36,16 +36,17 @@ public void start(Stage stage) throws ParserConfigurationException, SAXException

stage.setTitle("DFAify");

InputStream is = DFAify.class.getResourceAsStream("/com/booglejr/dfaify/dfaify.png");
InputStream is = DFAify.class.getResourceAsStream("/com/justinwoodring/dfaify/dfaify.png");
final File tempFile = File.createTempFile("tempImage", ".png");
tempFile.deleteOnExit();
try (FileOutputStream out = new FileOutputStream(tempFile)) {
IOUtils.copy(is, out);
}

stage.getIcons().add(new Image(tempFile.toString()));
Image icon = new Image("file:"+tempFile.toString());
stage.getIcons().add(icon);

AppModel appModel = new AppModel(DFAify.class.getResourceAsStream("/com/booglejr/dfaify/examples/one-bit-adder.xml"));
AppModel appModel = new AppModel(DFAify.class.getResourceAsStream("/com/justinwoodring/dfaify/examples/one-bit-adder.xml"));
AppController appController = new AppController(appModel, stage);
AppView appView = new AppView(appModel, appController);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.booglejr.dfaify.controllers;
package com.justinwoodring.dfaify.controllers;
import java.io.File;

import com.booglejr.dfaify.models.AppModel;
import com.booglejr.dfaify.models.dfa.Connection;
import com.booglejr.dfaify.models.dfa.error.StringContainsLettersNotInAlphabetError;
import com.booglejr.dfaify.models.dfa.error.UnindexedStateError;
import com.booglejr.dfaify.views.AppView;
import com.justinwoodring.dfaify.models.AppModel;
import com.justinwoodring.dfaify.models.dfa.Connection;
import com.justinwoodring.dfaify.models.dfa.error.StringContainsLettersNotInAlphabetError;
import com.justinwoodring.dfaify.models.dfa.error.UnindexedStateError;
import com.justinwoodring.dfaify.views.AppView;

import javafx.animation.Animation.Status;
import javafx.stage.Stage;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.booglejr.dfaify.models;
package com.justinwoodring.dfaify.models;

import java.io.File;
import java.io.FileNotFoundException;
Expand All @@ -8,9 +8,9 @@

import javax.xml.parsers.ParserConfigurationException;

import com.booglejr.dfaify.models.dfa.DFA;
import com.booglejr.dfaify.models.dfa.DFAReader;
import com.booglejr.dfaify.models.dfa.error.TooManyConnectionsTakingSameCharError;
import com.justinwoodring.dfaify.models.dfa.DFA;
import com.justinwoodring.dfaify.models.dfa.DFAReader;
import com.justinwoodring.dfaify.models.dfa.error.TooManyConnectionsTakingSameCharError;

import org.apache.commons.io.IOUtils;
import org.xml.sax.SAXException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.booglejr.dfaify.models.dfa;
package com.justinwoodring.dfaify.models.dfa;

public class Connection {
private State toState;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.booglejr.dfaify.models.dfa;
package com.justinwoodring.dfaify.models.dfa;

import java.util.ArrayList;

import com.booglejr.dfaify.models.dfa.error.StringContainsLettersNotInAlphabetError;
import com.booglejr.dfaify.models.dfa.error.UnindexedStateError;
import com.justinwoodring.dfaify.models.dfa.error.StringContainsLettersNotInAlphabetError;
import com.justinwoodring.dfaify.models.dfa.error.UnindexedStateError;

public class DFA {
public String currentString;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.booglejr.dfaify.models.dfa;
package com.justinwoodring.dfaify.models.dfa;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.booglejr.dfaify.models.dfa;
package com.justinwoodring.dfaify.models.dfa;

import java.util.ArrayList;

import com.booglejr.dfaify.models.dfa.error.TooManyConnectionsTakingSameCharError;
import com.booglejr.dfaify.models.dfa.error.UnindexedStateError;
import com.justinwoodring.dfaify.models.dfa.error.TooManyConnectionsTakingSameCharError;
import com.justinwoodring.dfaify.models.dfa.error.UnindexedStateError;

public class State {
private Integer id;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.booglejr.dfaify.models.dfa.error;
package com.justinwoodring.dfaify.models.dfa.error;

public class StringContainsLettersNotInAlphabetError extends Error{

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.booglejr.dfaify.models.dfa.error;
package com.justinwoodring.dfaify.models.dfa.error;

public class TooManyConnectionsTakingSameCharError extends Error{

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.booglejr.dfaify.models.dfa.error;
package com.justinwoodring.dfaify.models.dfa.error;

public class UnindexedStateError extends Error{

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.booglejr.dfaify.views;
package com.justinwoodring.dfaify.views;

import java.net.URL;

import com.booglejr.dfaify.DFAify;
import com.booglejr.dfaify.DFAify.JavaApp;
import com.justinwoodring.dfaify.DFAify;
import com.justinwoodring.dfaify.DFAify.JavaApp;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
Expand Down Expand Up @@ -73,7 +73,7 @@ public void changed(ObservableValue<? extends State> ov, State t, State t1) {
});


URL url = this.getClass().getResource("/com/booglejr/dfaify/webView/about.html");
URL url = this.getClass().getResource("/com/justinwoodring/dfaify/webView/about.html");
webEngine.load(url.toString());

Button hide = new Button("Hide");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.booglejr.dfaify.views;
package com.justinwoodring.dfaify.views;

import java.io.File;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Base64;

import com.booglejr.dfaify.controllers.AppController;
import com.booglejr.dfaify.models.AppModel;
import com.justinwoodring.dfaify.controllers.AppController;
import com.justinwoodring.dfaify.models.AppModel;

import org.w3c.dom.Document;

Expand Down Expand Up @@ -88,13 +88,13 @@ public void changed(ObservableValue ov, javafx.concurrent.Worker.State oldState,
timeline = new Timeline(new KeyFrame(Duration.seconds(2), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
controller.stepDfa();
Document doc = webEngine.getDocument();
doc.getElementById("mermaiddivinput").setTextContent(
Base64.getEncoder().encodeToString(
model.dfa.getMermaidMd().getBytes()
)
);
controller.stepDfa();
}
}));

Expand All @@ -103,7 +103,7 @@ public void handle(ActionEvent event) {
}
);

URL url = this.getClass().getResource("/com/booglejr/dfaify/webView/gui.html");
URL url = this.getClass().getResource("/com/justinwoodring/dfaify/webView/gui.html");
webEngine.load(url.toString());

//Scene Declaration
Expand Down Expand Up @@ -196,7 +196,7 @@ public void handle(ActionEvent event) {
textArea.setEditable(false);
textArea.setWrapText(true);
try {
textArea.setFont(Font.loadFont(this.getClass().getResource("/com/booglejr/dfaify/fonts/DejaVuSansMono.ttf").toURI().toString(), 12));
textArea.setFont(Font.loadFont(this.getClass().getResource("/com/justinwoodring/dfaify/fonts/DejaVuSansMono.ttf").toURI().toString(), 12));
} catch (URISyntaxException e) {
e.printStackTrace();
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module com.booglejr.dfaify {
module com.justinwoodring.dfaify {
requires java.base;
requires java.logging;
requires javafx.base;
Expand All @@ -8,5 +8,5 @@
requires jdk.jsobject;
requires org.apache.commons.io;

exports com.booglejr.dfaify;
exports com.justinwoodring.dfaify;
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
<img src="../dfaify.png"/>
<h1>DFAify</h1>
<h4 id="version"></h4>
<h4><a onclick="app.loadHttpAddr('https://github.com/Booglejr/DFAify')" href="">Website</a></h4>
<h4><a onclick="app.loadHttpAddr('https://github.com/JustinWoodring/DFAify')" href="">Website</a></h4>
<h4>MIT License</h4>
<h4>Copyright &#169; 2022<br/> Justin 'Booglejr' Woodring</h4>
<h4>Copyright &#169; 2022<br/> Justin Woodring</h4>
</header>
<article>
<h2>About</h2>
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/booglejr/dfaify/models/dfa/AppTest.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package com.booglejr.dfaify.models.dfa;
package com.justinwoodring.dfaify.models.dfa;

import org.junit.Test;
import static org.junit.Assert.*;

import com.booglejr.dfaify.models.dfa.error.StringContainsLettersNotInAlphabetError;
import com.booglejr.dfaify.models.dfa.error.TooManyConnectionsTakingSameCharError;
import com.justinwoodring.dfaify.models.dfa.error.StringContainsLettersNotInAlphabetError;
import com.justinwoodring.dfaify.models.dfa.error.TooManyConnectionsTakingSameCharError;

public class AppTest {
@Test public void TestStringAlphabetCheck() {
Expand Down

0 comments on commit 3ed774b

Please sign in to comment.