Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/src/chronographerfx/JavaFXApplication2/nbproject/private/
/src/chronographerfx/JavaFXApplication2/nbproject/private/
/JavaFXApplication8/nbproject/private/
/JavaFXApplication8/build/
/JavaFXApplication8/dist/
11 changes: 11 additions & 0 deletions JavaFXApplication8/src/chronographerfx/AtomicEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//Brian Williamson & Leanne Miller
//CS335, Project, Phase 1

package chronographerfx;

public class AtomicEvent extends Event {

public AtomicEvent(String n, String c, String s, String d) {
super(n,c,s,d);
}
}
44 changes: 44 additions & 0 deletions JavaFXApplication8/src/chronographerfx/CategoryList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//Brian Williamson & Leanne Miller
//CS335, Project, Phase 1

package chronographerfx;

import java.util.*;

/* A singleton class.
* Used http://howtodoinjava.com/2012/10/22/singleton-design-pattern-in-java/
* as a reference when creating it. */
public class CategoryList {
private static volatile CategoryList instance = null;

private LinkedList<String> list;
private CategoryList() {
list = new LinkedList<String>();
}

public static CategoryList getInstance(){
if(instance == null){
synchronized(CategoryList.class){
//Double check in case 2 threads perform the first check
//at the same time and both try to create an instance
if(instance == null){
instance = new CategoryList();
}
}
}
return instance;
}

public void addCategory(String s) {
list.add(s);
}

public void removeCategory(String s){
list.remove(s);
}

public LinkedList<String> getCategories(){
return list;
}

}
41 changes: 41 additions & 0 deletions JavaFXApplication8/src/chronographerfx/ChronographerFX.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

package chronographerfx;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

/**
*
* @author Brian
*/
public class ChronographerFX extends Application {

@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("TimelineMainMenu.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}

/**
* The main() method is ignored in correctly deployed JavaFX application.
* main() serves only as fallback in case the application can not be
* launched through deployment artifacts, e.g., in IDEs with limited FX
* support. NetBeans ignores main().
*
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}

}
19 changes: 19 additions & 0 deletions JavaFXApplication8/src/chronographerfx/DurativeEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package chronographerfx;

public class DurativeEvent extends Event {

String endDate;

public DurativeEvent(String n, String c, String s, String d, String e) {
super(n,c,s,d);
setEndDate(e);
}

public void setEndDate(String s){
this.endDate = s;
}

public String getEndDate(){
return this.endDate;
}
}
56 changes: 56 additions & 0 deletions JavaFXApplication8/src/chronographerfx/Event.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package chronographerfx;
//Brian Williamson & Leanne Miller
//CS335, Project, Phase 1

//Brian Williamson & Leanne Miller
//CS335, Project, Phase 1



public abstract class Event {

private String name;
private String category;
private String startDate;
private String description;

public Event(String n, String c, String s, String d){
setName(n);
setCategory(c);
setStartDate(s);
setDescription(d);
}

public void setName(String s){
this.name = s;
}

public void setCategory(String s){
this.category = s;
}

public void setStartDate(String s){
this.startDate = s;
}

public void setDescription(String s){
this.description = s;
}

public String getName(){
return this.name;
}

public String getCategory(){
return this.category;
}

public String getStartDate(){
return this.startDate;
}

public String getDescription(){
return this.description;
}

}
28 changes: 28 additions & 0 deletions JavaFXApplication8/src/chronographerfx/SaveEventTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package chronographerfx;

import static org.junit.Assert.*;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import org.junit.Test;

public class SaveEventTest {

@Test
public void test() {
String filename = "TestEvent";
Event toSave = new AtomicEvent("MyEvent","Category","Now","Stuffs");
//Create timeline directory to save to
String timeline = "TestTimeline";
File dir = new File(timeline);
dir.mkdir();
MainMenuController.saveEvent(toSave, filename, timeline);
Event savedEvent = MainMenuController.loadEvent(filename);
assert(toSave.equals(savedEvent));
//System.out.println(savedEvent.getName() + savedEvent.getDescription());
}

}
25 changes: 25 additions & 0 deletions JavaFXApplication8/src/chronographerfx/SaveTimelineTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package chronographerfx;

import static org.junit.Assert.*;

import org.junit.Test;

public class SaveTimelineTest {

@Test
public void test() {
String filename = "TestTimeline";
Timeline toSave = new Timeline(filename);
Event e1 = new AtomicEvent("Event 1", "Category1", "Now", "Stuffs");
Event e2 = new DurativeEvent("Event 2", "Category2", "Last Week", "Now", "Interesting things.");
toSave.addEvent(e1);
toSave.addEvent(e2);
//System.out.println(toSave.getEvents());

MainMenuController.saveTimeline(toSave);
Timeline saved = MainMenuController.loadTimeline(filename);
assert(toSave.equals(saved));
//System.out.println(saved.getEvents());
}

}
37 changes: 37 additions & 0 deletions JavaFXApplication8/src/chronographerfx/Timeline.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package chronographerfx;

import java.util.TreeMap;

public class Timeline {

private TreeMap<String, Event> events; //A map from event start dates to the events themselves
private String name;

public Timeline(String n){
name = n;
events = new TreeMap<String, Event>();
}

public Timeline(String n, TreeMap<String, Event> e){
name = n;
events = e;
}

//Return iterator instead?
public TreeMap<String, Event> getEvents(){
return events;
}

public String getName(){
return this.name;
}

public void changeName(String s){
this.name = s;
}

public void addEvent(Event e){
events.put(e.getStartDate(), e);
}

}
32 changes: 32 additions & 0 deletions JavaFXApplication8/src/chronographerfx/TimelineMainMenu.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.effect.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.text.*?>

<AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="chronographerfx.ChronographerMainMenuController">
<children>
<Text layoutX="237.0" layoutY="29.0" strokeType="OUTSIDE" strokeWidth="0.0" text="THE CHRONOGRAPHER" />
<Text layoutX="384.0" layoutY="29.0" strokeType="OUTSIDE" strokeWidth="0.0" text="By Leanne Miller and Brian Williamson" />
<Button fx:id="newTimeline" layoutX="14.0" layoutY="14.0" mnemonicParsing="false" onAction="#handleButtonActionNewTimeline" text="New" />
<Button fx:id="loadTimeline" layoutX="58.0" layoutY="14.0" mnemonicParsing="false" onAction="#handleButtonActionLoadTimeline" text="Load" />
<Button fx:id="viewTimeline" layoutX="105.0" layoutY="14.0" mnemonicParsing="false" onAction="#handleButtonActionViewTimeline" text="View" />
<Button fx:id="exit" layoutX="151.0" layoutY="14.0" mnemonicParsing="false" onAction="#handleButtonActionQuit" text="Exit" />
<TextField id="filenameField" fx:id="inputFilename" layoutX="15.0" layoutY="49.0" prefWidth="200.0" promptText="Put file name here" text="" />
<TextField id="filenameField" fx:id="inputEventName" layoutX="15.0" layoutY="101.0" prefWidth="200.0" promptText="Put event names here" text="" />
<TextField id="filenameField" fx:id="inputStartDate" layoutX="15.0" layoutY="123.0" prefWidth="200.0" promptText="Put start date here" text="" />
<CheckBox id="d" fx:id="durativeEvent" layoutX="221.0" layoutY="148.0" mnemonicParsing="false" text="Durative Event?" />
<TextField id="filenameField" fx:id="inputEndDate" layoutX="15.0" layoutY="145.0" prefWidth="200.0" promptText="Put end date here" text="" />
<TextField id="filenameField" fx:id="inputCategory" layoutX="15.0" layoutY="167.0" prefWidth="200.0" promptText="Put category here" text="" />
<Button id="newTimeline" fx:id="addEvent" layoutX="15.0" layoutY="211.0" mnemonicParsing="false" onAction="#handleButtonActionNewEvent" text="Add Event" />
<Text layoutX="15.0" layoutY="93.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Current Timeline:" />
<TextField fx:id="inputDescription" layoutX="15.0" layoutY="189.0" prefWidth="200.0" promptText="Put event description here" />
</children>
<effect>
<DropShadow color="#646464" offsetX="5.0" offsetY="5.0" />
</effect>
</AnchorPane>
6 changes: 0 additions & 6 deletions TestEvent

This file was deleted.

6 changes: 0 additions & 6 deletions TestEvent.xml

This file was deleted.

Binary file modified bin/chronographerfx/AtomicEvent.class
Binary file not shown.
Binary file modified bin/chronographerfx/CategoryList.class
Binary file not shown.
Binary file not shown.
Binary file modified bin/chronographerfx/DurativeEvent.class
Binary file not shown.
Binary file modified bin/chronographerfx/Event.class
Binary file not shown.
Binary file removed bin/chronographerfx/MainMenuController.class
Binary file not shown.
Binary file modified bin/chronographerfx/SaveEventTest.class
Binary file not shown.
Binary file modified bin/chronographerfx/SaveTimelineTest.class
Binary file not shown.
Binary file modified bin/chronographerfx/Timeline.class
Binary file not shown.
22 changes: 12 additions & 10 deletions bin/chronographerfx/TimelineMainMenu.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@
<AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="chronographerfx.ChronographerMainMenuController">
<children>
<Text layoutX="237.0" layoutY="29.0" strokeType="OUTSIDE" strokeWidth="0.0" text="THE CHRONOGRAPHER" />
<Text layoutX="376.0" layoutY="29.0" strokeType="OUTSIDE" strokeWidth="0.0" text="By Leanne Miller and Brian Williamson" />
<Text layoutX="384.0" layoutY="29.0" strokeType="OUTSIDE" strokeWidth="0.0" text="By Leanne Miller and Brian Williamson" />
<Button fx:id="newTimeline" layoutX="14.0" layoutY="14.0" mnemonicParsing="false" onAction="#handleButtonActionNewTimeline" text="New" />
<Button fx:id="loadTimeline" layoutX="58.0" layoutY="14.0" mnemonicParsing="false" onAction="#handleButtonActionLoadTimeline" text="Load" />
<Button fx:id="editTimeline" layoutX="104.0" layoutY="14.0" mnemonicParsing="false" onAction="#handleButtonActionEditTimeline" text="Edit" />
<Button fx:id="viewTimeline" layoutX="145.0" layoutY="14.0" mnemonicParsing="false" onAction="#handleButtonActionViewTimeline" text="View" />
<Button fx:id="exit" layoutX="191.0" layoutY="14.0" mnemonicParsing="false" onAction="#handleButtonActionQuit" text="Exit" />
<ScrollPane layoutX="14.0" layoutY="81.0" pannable="true" prefHeight="305.0" prefWidth="564.0">
<content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="309.0" prefWidth="563.0" />
</content>
</ScrollPane>
<TextField layoutX="15.0" layoutY="49.0" prefWidth="200.0" />
<Button fx:id="viewTimeline" layoutX="105.0" layoutY="14.0" mnemonicParsing="false" onAction="#handleButtonActionViewTimeline" text="View" />
<Button fx:id="exit" layoutX="151.0" layoutY="14.0" mnemonicParsing="false" onAction="#handleButtonActionQuit" text="Exit" />
<TextField id="filenameField" fx:id="inputFilename" layoutX="15.0" layoutY="49.0" prefWidth="200.0" promptText="Put file name here" text="" />
<TextField id="filenameField" fx:id="inputEventName" layoutX="15.0" layoutY="101.0" prefWidth="200.0" promptText="Put event names here" text="" />
<TextField id="filenameField" fx:id="inputStartDate" layoutX="15.0" layoutY="123.0" prefWidth="200.0" promptText="Put start date here" text="" />
<CheckBox id="d" fx:id="durativeEvent" layoutX="221.0" layoutY="148.0" mnemonicParsing="false" text="Durative Event?" />
<TextField id="filenameField" fx:id="inputEndDate" layoutX="15.0" layoutY="145.0" prefWidth="200.0" promptText="Put end date here" text="" />
<TextField id="filenameField" fx:id="inputCategory" layoutX="15.0" layoutY="167.0" prefWidth="200.0" promptText="Put category here" text="" />
<Button id="newTimeline" fx:id="addEvent" layoutX="15.0" layoutY="211.0" mnemonicParsing="false" onAction="#handleButtonActionNewEvent" text="Add Event" />
<Text layoutX="15.0" layoutY="93.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Current Timeline:" />
<TextField fx:id="inputDescription" layoutX="15.0" layoutY="189.0" prefWidth="200.0" promptText="Put event description here" />
</children>
<effect>
<DropShadow color="#646464" offsetX="5.0" offsetY="5.0" />
Expand Down
Loading