summaryrefslogtreecommitdiffstats
path: root/src/de
diff options
context:
space:
mode:
Diffstat (limited to 'src/de')
-rw-r--r--src/de/fhswf/in/inf/se/notepadMinusMinus/Main.java38
-rw-r--r--src/de/fhswf/in/inf/se/notepadMinusMinus/model/Grade.java74
-rw-r--r--src/de/fhswf/in/inf/se/notepadMinusMinus/model/Grades.java40
-rw-r--r--src/de/fhswf/in/inf/se/notepadMinusMinus/util/OverLimitIntegerStringConverter.java10
-rw-r--r--src/de/fhswf/in/inf/se/notepadMinusMinus/view/MainViewController.java26
5 files changed, 105 insertions, 83 deletions
diff --git a/src/de/fhswf/in/inf/se/notepadMinusMinus/Main.java b/src/de/fhswf/in/inf/se/notepadMinusMinus/Main.java
index d579e0d..c154f3f 100644
--- a/src/de/fhswf/in/inf/se/notepadMinusMinus/Main.java
+++ b/src/de/fhswf/in/inf/se/notepadMinusMinus/Main.java
@@ -18,10 +18,10 @@ import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
/**
- * TODO Add comment here
+ * The main {@link File} and {@link Stage} handling class.
*
- * @author $Author: $
- * @version $Revision: $, $Date: $ UTC
+ * @author Stefan Suhren
+ * @version 1.0
*/
public class Main extends Application
{
@@ -63,9 +63,10 @@ public class Main extends Application
}
/**
- * TODO Add method comment here
+ * Start the JavaFX {@link Application}.
*
* @param args
+ * The command line arguments.
*/
public static void main(String[] args)
{
@@ -73,9 +74,9 @@ public class Main extends Application
}
/**
- * TODO Add method comment here
+ * Get the global data class.
*
- * @return
+ * @return The global {@link Grades} object.
*/
public Grades getGradesObject()
{
@@ -83,9 +84,9 @@ public class Main extends Application
}
/**
- * TODO Add method comment here
+ * Get primary {@link Stage} for various things.
*
- * @return
+ * @return The primary {@link Stage} of the {@link Application}.
*/
public Stage getPrimaryStage()
{
@@ -93,9 +94,9 @@ public class Main extends Application
}
/**
- * TODO Add method comment here
+ * Get the {@link File} that is opened right now.
*
- * @return
+ * @return The open {@link File} or null if no {@link File} is open.
*/
public File getOpenFile()
{
@@ -103,9 +104,11 @@ public class Main extends Application
}
/**
- * TODO Add method comment here
+ * Set the {@link File} that is open right now.
*
* @param openFile
+ * The open {@link File} or null if the {@link File} is not
+ * opened.
*/
public void setOpenFile(File openFile)
{
@@ -113,9 +116,9 @@ public class Main extends Application
}
/**
- * TODO Add method comment here
+ * Get the last opened {@link File}.
*
- * @return
+ * @return The last location as a {@link File}.
*/
public File getGradesFilePath()
{
@@ -132,9 +135,10 @@ public class Main extends Application
}
/**
- * TODO Add method comment here
+ * Set the last opened {@link File} location.
*
* @param file
+ * The last location as a {@link File}.
*/
public void setGradesFilePath(File file)
{
@@ -156,9 +160,10 @@ public class Main extends Application
}
/**
- * TODO Add method comment here
+ * Load data from {@link File}.
*
* @param file
+ * The {@link File} to open and read.
*/
public void loadGradesFromFile(File file)
{
@@ -195,9 +200,10 @@ public class Main extends Application
}
/**
- * TODO Add method comment here
+ * Save data to {@link File}.
*
* @param file
+ * The {@link File} to open and write to.
*/
public void saveGradesToFile(File file)
{
diff --git a/src/de/fhswf/in/inf/se/notepadMinusMinus/model/Grade.java b/src/de/fhswf/in/inf/se/notepadMinusMinus/model/Grade.java
index 9758e6a..4c8a406 100644
--- a/src/de/fhswf/in/inf/se/notepadMinusMinus/model/Grade.java
+++ b/src/de/fhswf/in/inf/se/notepadMinusMinus/model/Grade.java
@@ -12,6 +12,7 @@ import javax.xml.bind.annotation.XmlValue;
import javafx.beans.Observable;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ObjectProperty;
+import javafx.beans.property.Property;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
@@ -21,10 +22,10 @@ import javafx.collections.ObservableList;
import javafx.util.Callback;
/**
- * TODO Add comment here
+ * A grade with module information.
*
- * @author $Author: $
- * @version $Revision: $, $Date: $ UTC
+ * @author Stefan Suhren
+ * @version 1.0
*/
@XmlRootElement(name = "grade")
public class Grade
@@ -44,9 +45,10 @@ public class Grade
private IntegerProperty attempt = new SimpleIntegerProperty(1);
/**
- * TODO Add method comment here
+ * Generates an extractor that fires when a property of a list value
+ * changes.
*
- * @return
+ * @return The extractor.
*/
public static Callback<Grade, Observable[]> extractor()
{
@@ -56,9 +58,9 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Get the semester {@link Property}.
*
- * @return
+ * @return The semester {@link Property}.
*/
public final IntegerProperty semesterProperty()
{
@@ -66,9 +68,9 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Get the semester.
*
- * @return
+ * @return The semester.
*/
@XmlAttribute(name = "semester")
public final int getSemester()
@@ -77,9 +79,10 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Set the semester.
*
* @param semester
+ * The new semester.
*/
public final void setSemester(final int semester)
{
@@ -87,9 +90,9 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Get the modulename {@link Property}.
*
- * @return
+ * @return The modulename {@link Property}.
*/
public final StringProperty modulenameProperty()
{
@@ -97,9 +100,9 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Get the modulename.
*
- * @return
+ * @return The modulename.
*/
@XmlAttribute(name = "modulename", required = true)
public final String getModulename()
@@ -108,19 +111,20 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Set the modulename.
*
* @param modulename
+ * The new modulename.
*/
- public final void setModulename(final java.lang.String modulename)
+ public final void setModulename(final String modulename)
{
this.modulenameProperty().set(modulename);
}
/**
- * TODO Add method comment here
+ * Get the ects {@link Property}.
*
- * @return
+ * @return The ects {@link Property}.
*/
public final IntegerProperty ectsProperty()
{
@@ -128,9 +132,9 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Get the ects.
*
- * @return
+ * @return The ects.
*/
@XmlAttribute(name = "ects")
public final int getEcts()
@@ -139,9 +143,10 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Set the ects.
*
* @param ects
+ * The new ects.
*/
public final void setEcts(final int ects)
{
@@ -149,9 +154,9 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Get the grade {@link Property}.
*
- * @return
+ * @return The grade {@link Property}.
*/
public final ObjectProperty<BigDecimal> gradeProperty()
{
@@ -159,9 +164,9 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Get the grade.
*
- * @return
+ * @return The grade.
*/
@XmlValue
public final BigDecimal getGrade()
@@ -170,9 +175,10 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Set the grade.
*
* @param grade
+ * The new grade.
*/
public final void setGrade(final BigDecimal grade)
{
@@ -180,9 +186,9 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Get the attempt {@link Property}.
*
- * @return
+ * @return The attempt {@link Property}.
*/
public final IntegerProperty attemptProperty()
{
@@ -190,9 +196,9 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Get the attempt.
*
- * @return
+ * @return The attempt.
*/
@XmlAttribute(name = "attempt")
public final int getAttempt()
@@ -201,9 +207,10 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Set the attempt.
*
* @param attempt
+ * The new attempt.
*/
public final void setAttempt(final int attempt)
{
@@ -211,9 +218,10 @@ public class Grade
}
/**
- * TODO Add method comment here
+ * Returns an unmodifiable {@link ObservableList} that contains all valid
+ * grades.
*
- * @return
+ * @return The unmodifiable {@link ObservableList}.
*/
public static final ObservableList<BigDecimal> gradeValuesProperty()
{
diff --git a/src/de/fhswf/in/inf/se/notepadMinusMinus/model/Grades.java b/src/de/fhswf/in/inf/se/notepadMinusMinus/model/Grades.java
index aafc1e6..18622cd 100644
--- a/src/de/fhswf/in/inf/se/notepadMinusMinus/model/Grades.java
+++ b/src/de/fhswf/in/inf/se/notepadMinusMinus/model/Grades.java
@@ -8,15 +8,16 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javafx.beans.property.ObjectProperty;
+import javafx.beans.property.Property;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
/**
- * TODO Add comment here
+ * The wrapper for the gradeList.
*
- * @author $Author: $
- * @version $Revision: $, $Date: $ UTC
+ * @author Stefan Suhren
+ * @version 1.0
*/
@XmlRootElement(name = "grades")
public class Grades
@@ -31,9 +32,9 @@ public class Grades
new BigDecimal("0.0"));
/**
- * TODO Add method comment here
+ * Get the {@link Grades} as a {@link List}.
*
- * @return
+ * @return The {@link List} of {@link Grade}s.
*/
@XmlElement(name = "grade", required = true)
public List<Grade> getGrades()
@@ -42,9 +43,10 @@ public class Grades
}
/**
- * TODO Add method comment here
+ * Set the {@link Grades} as {@link List}.
*
* @param grades
+ * The {@link List} of {@link Grade}s to set.
*/
public void setGrades(List<Grade> grades)
{
@@ -53,9 +55,9 @@ public class Grades
}
/**
- * TODO Add method comment here
+ * Get the {@link ObservableList} of {@link Grade}s.
*
- * @return
+ * @return The {@link ObservableList}
*/
public ObservableList<Grade> gradesProperty()
{
@@ -63,9 +65,9 @@ public class Grades
}
/**
- * TODO Add method comment here
+ * Get the thesis grade {@link Property}.
*
- * @return
+ * @return The {@link Property} grade of the thesis.
*/
public final ObjectProperty<BigDecimal> thesisProperty()
{
@@ -73,9 +75,9 @@ public class Grades
}
/**
- * TODO Add method comment here
+ * Set the grade of the thesis.
*
- * @return
+ * @return The grade of the thesis.
*/
@XmlAttribute(name = "thesis")
public final BigDecimal getThesis()
@@ -84,9 +86,10 @@ public class Grades
}
/**
- * TODO Add method comment here
+ * Set the grade of the thesis.
*
* @param thesis
+ * The new grade of the thesis.
*/
public final void setThesis(final BigDecimal thesis)
{
@@ -94,9 +97,9 @@ public class Grades
}
/**
- * TODO Add method comment here
+ * Get the colloquium grade {@link Property}.
*
- * @return
+ * @return The colloquium grade {@link Property}.
*/
public final ObjectProperty<BigDecimal> colloquiumProperty()
{
@@ -104,9 +107,9 @@ public class Grades
}
/**
- * TODO Add method comment here
+ * Get the colloquium grade.
*
- * @return
+ * @return The colloquium grade.
*/
@XmlAttribute(name = "colloquium")
public final BigDecimal getColloquium()
@@ -115,9 +118,10 @@ public class Grades
}
/**
- * TODO Add method comment here
+ * Set the colloquium grade.
*
* @param colloquium
+ * The new colloquium grade.
*/
public final void setColloquium(final BigDecimal colloquium)
{
diff --git a/src/de/fhswf/in/inf/se/notepadMinusMinus/util/OverLimitIntegerStringConverter.java b/src/de/fhswf/in/inf/se/notepadMinusMinus/util/OverLimitIntegerStringConverter.java
index edc1975..30e3f8d 100644
--- a/src/de/fhswf/in/inf/se/notepadMinusMinus/util/OverLimitIntegerStringConverter.java
+++ b/src/de/fhswf/in/inf/se/notepadMinusMinus/util/OverLimitIntegerStringConverter.java
@@ -6,19 +6,21 @@ package de.fhswf.in.inf.se.notepadMinusMinus.util;
import javafx.util.StringConverter;
/**
- * TODO Add comment here
+ * An {@link Integer} converter that checks the boundaries.
*
- * @author $Author: $
- * @version $Revision: $, $Date: $ UTC
+ * @author Stefan Suhren
+ * @version 1.0
*/
public class OverLimitIntegerStringConverter extends StringConverter<Integer>
{
private int minAllowedValue;
/**
- * TODO Add constructor comment here
+ * Create and {@link OverLimitIntegerStringConverter} that uses the given
+ * limit.
*
* @param minAllowedValue
+ * The smallest values that is still valid.
*/
public OverLimitIntegerStringConverter(int minAllowedValue)
{
diff --git a/src/de/fhswf/in/inf/se/notepadMinusMinus/view/MainViewController.java b/src/de/fhswf/in/inf/se/notepadMinusMinus/view/MainViewController.java
index da786bb..115a06f 100644
--- a/src/de/fhswf/in/inf/se/notepadMinusMinus/view/MainViewController.java
+++ b/src/de/fhswf/in/inf/se/notepadMinusMinus/view/MainViewController.java
@@ -21,7 +21,7 @@ import javafx.scene.control.cell.TextFieldTableCell;
import javafx.stage.FileChooser;
/**
- * TODO Add comment here
+ * The controller for the MainView.fxml.
*
* @author $Author: $
* @version $Revision: $, $Date: $ UTC
@@ -68,7 +68,7 @@ public class MainViewController
private final int ectsColloquium = 3;
/**
- * TODO Add method comment here
+ * Initializes the generated MainView.
*
*/
@FXML
@@ -129,9 +129,10 @@ public class MainViewController
}
/**
- * TODO Add method comment here
+ * Gives access to the {@link Main} for {@link File} and data handling.
*
* @param main
+ * The {@link Main} to get access to.
*/
public void setMain(Main main)
{
@@ -152,7 +153,7 @@ public class MainViewController
}
/**
- * TODO Add method comment here
+ * Handle adding a new {@link Grade} to the gradeTable.
*
*/
@FXML
@@ -163,7 +164,7 @@ public class MainViewController
}
/**
- * TODO Add method comment here
+ * Handle deleting the selected value from the gradeTable.
*
*/
@FXML
@@ -178,7 +179,7 @@ public class MainViewController
}
/**
- * TODO Add method comment here
+ * Handle resetting everything to the initial state.
*
*/
@FXML
@@ -187,12 +188,14 @@ public class MainViewController
if (main != null)
{
gradeTable.getItems().clear();
+ colloquiumComboBox.setValue(new BigDecimal(0.0));
+ thesisComboBox.setValue(new BigDecimal(0.0));
main.setOpenFile(null);
}
}
/**
- * TODO Add method comment here
+ * Handle opening a {@link File}.
*
*/
@FXML
@@ -228,7 +231,7 @@ public class MainViewController
}
/**
- * TODO Add method comment here
+ * Handle saving of an open {@link File} or let the user choose a location.
*
*/
@FXML
@@ -248,7 +251,7 @@ public class MainViewController
}
/**
- * TODO Add method comment here
+ * Save to a user chosen location and set as new open {@link File}.
*
*/
@FXML
@@ -288,7 +291,7 @@ public class MainViewController
}
/**
- * TODO Add method comment here
+ * Handle exiting the application.
*
*/
@FXML
@@ -298,9 +301,8 @@ public class MainViewController
}
/**
- * TODO Add method comment here
+ * Calculate the total ects and the average grade.
*
- * @param main
*/
private void calculateEctsAndAverageGrade()
{