Skip to content

Commit

Permalink
[fix] Sprache (#45)
Browse files Browse the repository at this point in the history
* [fix] language in doc

* [fix] typo DataPoit

Co-authored-by: Joshua Jeschek <64850647+joshuajeschek@users.noreply.github.com>

* [fix] typo DataPoint agane

Co-authored-by: Joshua Jeschek <64850647+joshuajeschek@users.noreply.github.com>

* [fix] typo Datapoint copy paste

Co-authored-by: Joshua Jeschek <64850647+joshuajeschek@users.noreply.github.com>

* [fix] typo DataPoint copy paste II

Co-authored-by: Joshua Jeschek <64850647+joshuajeschek@users.noreply.github.com>

Co-authored-by: Joshua Jeschek <64850647+joshuajeschek@users.noreply.github.com>
  • Loading branch information
philipkbh and joshuajeschek authored Feb 1, 2022
1 parent 5d06151 commit e5c252a
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 99 deletions.
6 changes: 3 additions & 3 deletions src/main/java/github/weichware10/util/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ public class Logger {
public static final PrintStream PRINSTREAM = new PrintStream(logStream, true);

/**
* Cannot be instantiated.
* Kann nicht instanziiert werden.
*/
private Logger() {
throw new IllegalStateException("Cannot be instantiated");
}

/**
* sets logfile.
* setzt log-Datei.
*
* @param filename - the file
* @param filename - die Datei
*/
public static void setLogfile(String filename) {
if (filename == null) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/github/weichware10/util/ToolType.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package github.weichware10.util;

/**
* Tools of the Toolbox.
* Tools der Toolbox.
*/
public enum ToolType {
ZOOMMAPS, EYETRACKING, CODECHARTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ public CodeChartsConfiguration(String stringId, List<String> strings, int[] init
this.defaultVertical = defaultVertical;
}

// --- GETTERS ---

public String getStringId() {
return stringId;
}
Expand Down Expand Up @@ -148,8 +146,6 @@ public int getDefaultVertical() {
return defaultVertical;
}

// --- OVERRIDES ---

@Override
public boolean equals(Object obj) {
if (this == obj) {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/github/weichware10/util/config/ConfigLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public final class ConfigLoader {

/**
* Cannot be instantiated.
* Kann nicht instanziiert werden.
*/
private ConfigLoader() {
throw new IllegalStateException("Cannot be instantiated");
Expand All @@ -31,7 +31,7 @@ public static Configuration fromJson(String location) {
try {
ObjectMapper mapper = new ObjectMapper();
Configuration configuration;
// read from file
// aus Datei lesen
configuration = mapper.readValue(new File(location), Configuration.class);
return configuration;
} catch (StreamReadException e) {
Expand All @@ -54,14 +54,14 @@ public static Configuration fromJson(String location) {
* @since v1.0
*/
public static Configuration fromDataBase(String trialId, DataBaseClient dataBaseClient) {
// get configId from database
// configId von Datenbank abrufen
final String configId = dataBaseClient.trials.getConfigId(trialId);
// trial not found or error
// trial nicht gefunden oder Fehler
if (configId == null) {
return null;
}

// get config from database
// Konfiguration von Datenbank abrufen
Configuration configuration = dataBaseClient.configurations.get(configId);
configuration.trialId = trialId;
return configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public final class ConfigWriter {

/**
* Cannot be instantiated.
* Kann nicht instanziiert werden.
*/
private ConfigWriter() {
throw new IllegalStateException("Cannot be instantiated");
Expand All @@ -34,7 +34,7 @@ private ConfigWriter() {
* @since v0.2
*/
public static boolean toJson(String location, Configuration configuration) {
// only write to JSON files
// nur als JSON schreiben
if (!location.endsWith(".json")) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ public Configuration(String configId, String question, String imageUrl,
this.zoomMapsConfiguration = zoomMapsConfiguration;
}

// --- GETTERS ---

public ToolType getToolType() {
return toolType;
}
Expand Down Expand Up @@ -109,8 +107,6 @@ public ZoomMapsConfiguration getZoomMapsConfiguration() {
return zoomMapsConfiguration;
}

// --- OVERRIDES ---

@Override
public boolean equals(Object obj) {
if (this == obj) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
public class EyeTrackingConfiguration {
protected float pollIntervall = 4.20f;

// GETTER

public float getPollIntervall() {
return pollIntervall;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ public class ZoomMapsConfiguration {
protected double imageViewHeight = 400;

/**
* leerer Konstruktor. Wird für Jackson gebraucht (json writer)
* smooth criminal.
* leerer Konstruktor der für Jackson benötigt wird (json writer).
*/
public ZoomMapsConfiguration() {
// leer
Expand All @@ -29,8 +28,6 @@ public ZoomMapsConfiguration(double speed, double imageViewWidth, double imageVi
this.imageViewHeight = imageViewHeight;
}

// --- GETTER ---

public double getSpeed() {
return speed;
}
Expand All @@ -43,8 +40,6 @@ public double getImageViewHeight() {
return imageViewHeight;
}

// --- OVERRIDES ---

@Override
public boolean equals(Object obj) {
if (this == obj) {
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/github/weichware10/util/data/DataPoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import javafx.geometry.Rectangle2D;

/**
* Stores a single DataPoint.
* Speichert einen einzelnen Datenpunkt.
*
* @since v0.2
*/
Expand All @@ -19,8 +19,8 @@ public class DataPoint {
/**
* Konstruktor für Jackson.
*
* @param dataId - the id of the dataPoint
* @param timeOffset - the time since the trial started
* @param dataId - die ID des dataPoints
* @param timeOffset - die Zeit seit Versuchstart
* @param viewport - aktueller Ausschnitt beim ZoomBild
*
* @since v1.0
Expand All @@ -42,10 +42,10 @@ public DataPoint(@JsonProperty("dataId") int dataId,
}

/**
* Stores a single DataPoint without depth. (ZOOMMAPS)
* Speichert einen einzelnen Datenpunkt ohne Tiefe (ZOOMMAPS).
*
* @param dataId - the id of the dataPoint
* @param timeOffset - the time since the trial started
* @param dataId - die ID des dataPoints
* @param timeOffset - die Zeit seit Versuchstart
* @param viewport - aktueller Ausschnitt beim ZoomBild
*
* @since v0.2
Expand All @@ -58,11 +58,11 @@ public DataPoint(int dataId, int timeOffset, Rectangle2D viewport) {
}

/**
* Stores a single DataPoint with depth (CODECHARTS).
* Speichert einen einzelnen Datenpunkt mit Tiefe (CODECHARTS).
*
* @param dataId - the id of the dataPoint
* @param timeOffset - the time since the trial started
* @param viewport - aktuell angeschautes Raster.
* @param dataId - die ID des dataPoints
* @param timeOffset - die Zeit seit Versuchstart
* @param viewport - aktuell angeschautes Raster
* @param depth - Rastertiefe
*
* @since v0.3
Expand Down
52 changes: 13 additions & 39 deletions src/main/java/github/weichware10/util/data/TrialData.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import org.joda.time.DateTime;

/**
* Stores the TrialData for the different tools internally.
* Speichert die TrialData für die verschiedenen Tools intern.
*
* <p>also used to transfer Data
* <p>auch für die Datenübertragung genutzt
*
* @since v0.2
*/
Expand All @@ -40,9 +40,9 @@ public class TrialData {
/**
* Konstruktor für Jackson.
*
* @param toolType - the tooltype of the stored data
* @param trialId - the id of the trial
* @param configId - the configuration of the stored data
* @param toolType - Tool-Typ des Versuchs
* @param trialId - ID des Versuchs
* @param configId - Konfiguration des Versuchs
* @param startTime - Startzeitpunkt des Versuchs
*
* @since v1.0
Expand All @@ -61,11 +61,11 @@ public TrialData(@JsonProperty("toolType") ToolType toolType,
}

/**
* Stores the TrialData for the different tools internally.
* Speichert die TrialData für die verschiedenen Tools intern.
*
* @param toolType - the tooltype of the stored data
* @param trialId - the id of the trial
* @param configId - the configuration of the stored data
* @param toolType - Tool-Typ des Versuchs
* @param trialId - ID des Versuchs
* @param configId - Konfiguration des Versuchs
*
* @since v0.2
*/
Expand All @@ -77,37 +77,14 @@ public TrialData(ToolType toolType, String trialId, String configId) {
this.dataPoints = new ArrayList<DataPoint>();
}

// --- GETTERS ---

/**
* get the stored dataPoints.
*
* @return the stored dataPoints
*
* @since v0.2
*/
public List<DataPoint> getData() {
return dataPoints;
}

/**
* get the answer.
*
* @return the answer
*
* @since v0.3
*/
public String getAnswer() {
return answer;
}

// --- SETTERS ---

/**
* set the answer.
*
* @param answer - the answer
*/
public void setAnswer(String answer) {
this.answer = answer;
}
Expand All @@ -129,8 +106,7 @@ public DateTime getStartTime() {
}

/**
* Add a DataPoint for CodeCharts.
*
* Fügt ein Datenpunkt hinzu (CodeCharts).
*
* @since v0.2
*/
Expand All @@ -148,7 +124,7 @@ public void addDataPoint(Rectangle2D viewport, int depth) {
}

/**
* Add a DataPoint for ZoomMaps.
* Fügt ein Datenpunkt hinzu (ZoomMaps).
*
* @param viewport - aktueller Ausschnitt beim ZoomBild
*
Expand Down Expand Up @@ -179,7 +155,7 @@ public static TrialData fromJson(String location) {
try {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JodaModule());
// read from file
// aus Datei lesen
trialData = mapper.readValue(new File(location), TrialData.class);
} catch (StreamReadException e) {
Logger.info("An error occured while loading a trial", e, true);
Expand All @@ -201,7 +177,7 @@ public static TrialData fromJson(String location) {
* @since v1.0
*/
public static boolean toJson(String location, TrialData trialData) {
// only write to JSON files
// nur als JSON schreiben
if (!location.endsWith(".json")) {
return false;
}
Expand Down Expand Up @@ -230,8 +206,6 @@ public static boolean toJson(String location, TrialData trialData) {
return false; // Schreiben war nicht erfolgreich
}

// --- OVERRIDES ---

@Override
public String toString() {
return String.format("""
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/github/weichware10/util/db/Configurations.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Configurations {
/**
* Erstellt eine neue Verbindung zur Configurations-Tabelle.
*
* @param dataBaseClient - übergeordneter DataBadeClient
* @param dataBaseClient - übergeordneter DataBaseClient
*/
protected Configurations(DataBaseClient dataBaseClient) {
this.dataBaseClient = dataBaseClient;
Expand All @@ -44,7 +44,7 @@ public Configuration get(String configId) {
Statement st = null;
ResultSet rs = null;

// get resultset
// ResultSet bekommen
try {
conn = DriverManager.getConnection(dataBaseClient.url, dataBaseClient.props);
st = conn.createStatement();
Expand Down Expand Up @@ -161,7 +161,7 @@ public String set(Configuration configuration) {
if (configuration.getToolType() == ToolType.CODECHARTS) {
CodeChartsConfiguration ccConfig = configuration.getCodeChartsConfiguration();

// strings setzen
// Strings setzen
if (dataBaseClient.strings.sizeOf(ccConfig.getStringId()) == 0) {
dataBaseClient.strings.set(ccConfig.getStringId(), ccConfig.getStrings());
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/github/weichware10/util/db/DataBaseClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ public DataBaseClient(String url, String user, String password, String schema) {
* @return Existenzboolean
*/
private boolean tableExists(String table) {
// query
// Abfrage
final String queryFormat = """
SELECT table_schema, table_name FROM information_schema.tables
WHERE table_schema='%s' AND table_name='%s';
""";
final String query = String.format(queryFormat, schema, table);

// result
// Resultate
boolean exists = false;

// database objects
// Datenbank Objekte
Connection conn = null;
Statement st = null;
ResultSet rs = null;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/github/weichware10/util/db/Datapoints.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public List<DataPoint> get(String trialId) {
st = conn.createStatement();
rs = st.executeQuery(query);
while (rs.next()) {
// bei zoommaps versuchen
// bei ZoomMaps versuchen
Map<String, Double> viewport = new HashMap<>();
viewport.put("minX", rs.getDouble("viewportmin_x"));
viewport.put("minY", rs.getDouble("viewportmin_y"));
Expand Down Expand Up @@ -109,7 +109,7 @@ public void set(List<DataPoint> dataPoints, String trialId) {
pst.setInt(2, dp.dataId);
pst.setInt(3, dp.timeOffset);

// nur codecharts hat depth
// nur CodeCharts hat depth
if (dp.depth == null) {
pst.setNull(8, java.sql.Types.INTEGER);
} else {
Expand Down
Loading

0 comments on commit e5c252a

Please sign in to comment.