removed system prints, replaced with logs

This commit is contained in:
aj 2019-05-03 20:44:42 +01:00
parent 1726d38f0c
commit 994b8e2e6b
2 changed files with 7 additions and 23 deletions

View File

@ -37,7 +37,6 @@ public class GenrePieChart extends PieChart{
for(i = 0; i < tagNames.size(); i++) {
FMObjList list = tagObjs.get(i);
System.out.println(list.getGroupName());
pieChartData.add(new PieChart.Data(
String.format("%s %d%%", list.getGroupName(),(int) list.getTotalUserScrobbles() * 100 / genreTotal), list.getTotalUserScrobbles()));
}

View File

@ -30,6 +30,8 @@ import sarsoo.fmframework.fx.tab.ScrobbleChartTab;
import sarsoo.fmframework.fx.tab.TrackTab;
import sarsoo.fmframework.log.Log;
import sarsoo.fmframework.log.Logger;
import sarsoo.fmframework.log.entry.InfoEntry;
import sarsoo.fmframework.log.entry.LogEntry;
import sarsoo.fmframework.fx.FmFramework;
import sarsoo.fmframework.music.Album;
import sarsoo.fmframework.music.Artist;
@ -206,12 +208,8 @@ public class RootController {
for (i = 0; i < hierarchyTagsJsonArray.length(); i++) {
hierarchyTagNameList.add(hierarchyTagsJsonArray.getString(i));
// allTags.add(hierarchyTagsJsonArray.getString(i));
System.out.println(hierarchyTagsJsonArray.getString(i));
}
System.out.println("hierarchy: " + hierarchyName);
System.out.println(hierarchyTagNameList);
// paneList.add(new GenrePieChartTitledPane(hierarchyName, hierarchyTagNameList));
MenuItem item = new MenuItem(hierarchyName);
@ -264,16 +262,9 @@ public class RootController {
}
public void refreshPieCharts(File file) {
// File file = null;
// String path = null;
// if (new File("./piechart.json").isFile()) {
// file = new File("./piechart.json");
// } else {
// FileChooser fileChooser = new FileChooser();
// fileChooser.setTitle("open pie chart json");
// fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("JSON", "*.json"));
// file = fileChooser.showOpenDialog(FmFramework.getStage());
// }
Logger.getLog().log(new LogEntry("refreshPieCharts"));
Service<Void> service = new Service<Void>() {
@Override
protected Task<Void> createTask() {
@ -282,7 +273,6 @@ public class RootController {
protected Void call() throws Exception {
String jsonString = null;
// System.out.println(file.getPath());
if (file != null) {
BufferedReader br = new BufferedReader(new FileReader(file));
@ -296,7 +286,7 @@ public class RootController {
br.close();
jsonString = sb.toString();
System.out.println("json read");
Logger.getLog().logInfo(new InfoEntry("refreshPieCharts").addArg("json read"));
}
JSONObject rootParsedJsonObj = new JSONObject(jsonString);
@ -305,7 +295,7 @@ public class RootController {
.getJSONArray("genres");
JSONObject pieJson = rootParsedJsonObj.getJSONObject("pie");
System.out.println("arrays parsed");
Logger.getLog().logInfo(new InfoEntry("refreshPieCharts").addArg("arrays parsed"));
int counter;
ArrayList<TitledPane> paneList = new ArrayList<TitledPane>();
@ -323,12 +313,8 @@ public class RootController {
for (i = 0; i < hierarchyTagsJsonArray.length(); i++) {
hierarchyTagNameList.add(hierarchyTagsJsonArray.getString(i));
allTags.add(hierarchyTagsJsonArray.getString(i));
System.out.println(hierarchyTagsJsonArray.getString(i));
}
System.out.println("hierarchy: " + hierarchyName);
System.out.println(hierarchyTagNameList);
paneList.add(new GenrePieChartTitledPane(hierarchyName, hierarchyTagNameList));
}
@ -337,7 +323,6 @@ public class RootController {
for (i = 0; i < totalPieTags.length(); i++) {
allTags.add((totalPieTags).getString(i));
}
System.out.println(allTags);
paneList.add(new PieChartTitledPane("total", allTags));
final CountDownLatch latch = new CountDownLatch(1);