Skip to content

Commit

Permalink
Removed redundant references to Author and SourceFile classes from Ma…
Browse files Browse the repository at this point in the history
…inApp.
  • Loading branch information
sebastianquek committed Jul 26, 2015
1 parent 751b056 commit 3239dc3
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/main/java/gui/MainApp.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package main.java.gui;

import java.io.IOException;
import java.util.HashMap;

import javafx.application.Application;
import javafx.collections.ObservableList;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.input.KeyCode;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import main.java.backend.Author;
import main.java.backend.Logic;
import main.java.backend.SourceFile;

/**
* MainApp is the entry point for JavaFX applications.
Expand Down Expand Up @@ -78,22 +74,19 @@ private void addCommandBar(MainApp mainApp) {
}

private void addSummary(MainApp mainApp) {
rootLayout.setCenter(new SummaryController(mainApp, getSummaryData()));
rootLayout.setCenter(new SummaryController(mainApp,
logic.getSummaryData()));
}

private void addFileStats(String authorName,
HashMap<SourceFile, Integer> statistics) {
rootLayout.setCenter(new FileStatsController(authorName, statistics));
private void addFileStats(String authorName) {
rootLayout.setCenter(new FileStatsController(authorName,
logic.getTargetAuthorStatistics()));
}


// ================================================================
// Methods which refer to Logic directly
// ================================================================

public ObservableList<Author> getSummaryData() {
return logic.getSummaryData();
}

public void handleKeyPress(CommandBarController commandBarController,
KeyCode key,
Expand All @@ -113,7 +106,7 @@ private void handleEnterPress(CommandBarController commandBarController,
case VIEW :
String authorName = logic.getTargetAuthorName();
if (authorName != null) {
addFileStats(authorName, logic.getTargetAuthorStatistics());
addFileStats(authorName);
}
break;
case EXIT :
Expand Down

0 comments on commit 3239dc3

Please sign in to comment.