Skip to content

Commit

Permalink
Update API
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBigSasha committed Oct 24, 2020
1 parent c12bc69 commit 6c66252
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
16 changes: 5 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ plugins {
id 'java'
id "com.github.johnrengelman.shadow" version "6.1.0"
id("maven-publish")

}

group 'org.example'
version '1.0-SNAPSHOT'
group 'ca.sashaphoto'
version '1.2'

repositories {
mavenCentral()
Expand All @@ -35,17 +34,12 @@ sourceSets {
}


mainClassName = "RuntimeTester.MainWindow"
mainClassName = "RuntimeTester.Visualizer"

jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'MainWindow'
}
}

jar {
manifest {
attributes 'Main-Class': 'RuntimeTester.MainWindow'
name = 'Visualizer'
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/RuntimeTester/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ public void addBenchmarksFromPackages(List<Package> packages){
*/
public void addBenchmarks(List<Class<?>> testClasses) {
System.out.println("Classes passed : " + testClasses.toString());

try {
for(String s : this.getClass().getModule().getPackages()){
//System.out.println("package named " + s + " was found in module");
Expand Down Expand Up @@ -292,7 +293,7 @@ private void addReflexiveBenchmarks() {
if (!item.getCategory().equals(curCat)) {
curCat = item.getCategory();
Label l = new Label(curCat);
reflexiveButtonArea.getChildren().add(l);
reflexiveButtonArea.getChildren().add(l);
}
reflexiveButtonArea.getChildren().add(item.getCheckbox());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,27 @@
import javafx.scene.Scene;
import javafx.stage.Stage;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.*;

/**
* The frontend and API for the Runtime Efficiency Tester
* @author Sasha Aleshchenko - [email protected]
* Documentation available at RuntimeTester.github.io
*/
public class MainWindow extends Application {
private static Controller c;
public class Visualizer extends Application {
private static final List<String> messages = new ArrayList<>();
final double versionNumber = 1.2;
static {
final String[] hardMessages = new String[]{"made with <3 by sashaphoto.ca", "we are, we are, we are, we are the engineers", "stay safe out there", "always believe in yourself", "you can accomplish anything if you set your mind to it",
"chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken", "exeunt", "\uD83D\uDC1D", "also try Minecraft - server: McGill.world", "I believe in you!", "try using a hashmap",
"at least it isn't O(N!)", "do you ever feel like a paper bag?", "hello from Montreal", "look at McGill Robotics :)", "sashaphoto.ca for all your photo/video needs", "check out COMP250 @ McGill",};
messages.addAll(Arrays.asList(hardMessages));
//TODO: query API for more messages

}
private static List<Class<?>> startupClasses = new ArrayList<>();
private static Controller c;


/**
* Start the application with arguments
Expand All @@ -27,14 +36,8 @@ public static void main(String[] args) {
launch(args);
}

/**
* Start up the GUI.
*/
public static void launchGrapher(){
launch();
}

public static void launchGrapher(Class<?> extraTests){
public static void launch(Class<?> extraTests){
startupClasses.add(extraTests);
launch();
}
Expand All @@ -53,7 +56,9 @@ public void start(Stage primaryStage) throws Exception {
c = (Controller) fxmlLoader.getController();
if(!startupClasses.isEmpty()) c.addBenchmarks(startupClasses);
//c.addBenchmarksFromPackageNames(Collections.singletonList("Tutorial7"));
primaryStage.setTitle("Runtime Efficiency Wizard - COMP250");
Random r = new Random(System.currentTimeMillis());
String extraTitle = messages.get(r.nextInt(messages.size()-1));
primaryStage.setTitle("Runtime Efficiency Wizard " + versionNumber + " - " + extraTitle);
Scene s = new Scene(root);
primaryStage.setScene(s);
primaryStage.setResizable(true);
Expand Down

0 comments on commit 6c66252

Please sign in to comment.