-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c12bc69
commit 6c66252
Showing
3 changed files
with
25 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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(); | ||
} | ||
|
@@ -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); | ||
|