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++) { for(i = 0; i < tagNames.size(); i++) {
FMObjList list = tagObjs.get(i); FMObjList list = tagObjs.get(i);
System.out.println(list.getGroupName());
pieChartData.add(new PieChart.Data( pieChartData.add(new PieChart.Data(
String.format("%s %d%%", list.getGroupName(),(int) list.getTotalUserScrobbles() * 100 / genreTotal), list.getTotalUserScrobbles())); 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.fx.tab.TrackTab;
import sarsoo.fmframework.log.Log; import sarsoo.fmframework.log.Log;
import sarsoo.fmframework.log.Logger; 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.fx.FmFramework;
import sarsoo.fmframework.music.Album; import sarsoo.fmframework.music.Album;
import sarsoo.fmframework.music.Artist; import sarsoo.fmframework.music.Artist;
@ -206,12 +208,8 @@ public class RootController {
for (i = 0; i < hierarchyTagsJsonArray.length(); i++) { for (i = 0; i < hierarchyTagsJsonArray.length(); i++) {
hierarchyTagNameList.add(hierarchyTagsJsonArray.getString(i)); hierarchyTagNameList.add(hierarchyTagsJsonArray.getString(i));
// allTags.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)); // paneList.add(new GenrePieChartTitledPane(hierarchyName, hierarchyTagNameList));
MenuItem item = new MenuItem(hierarchyName); MenuItem item = new MenuItem(hierarchyName);
@ -264,16 +262,9 @@ public class RootController {
} }
public void refreshPieCharts(File file) { public void refreshPieCharts(File file) {
// File file = null;
// String path = null; Logger.getLog().log(new LogEntry("refreshPieCharts"));
// 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());
// }
Service<Void> service = new Service<Void>() { Service<Void> service = new Service<Void>() {
@Override @Override
protected Task<Void> createTask() { protected Task<Void> createTask() {
@ -282,7 +273,6 @@ public class RootController {
protected Void call() throws Exception { protected Void call() throws Exception {
String jsonString = null; String jsonString = null;
// System.out.println(file.getPath());
if (file != null) { if (file != null) {
BufferedReader br = new BufferedReader(new FileReader(file)); BufferedReader br = new BufferedReader(new FileReader(file));
@ -296,7 +286,7 @@ public class RootController {
br.close(); br.close();
jsonString = sb.toString(); jsonString = sb.toString();
System.out.println("json read"); Logger.getLog().logInfo(new InfoEntry("refreshPieCharts").addArg("json read"));
} }
JSONObject rootParsedJsonObj = new JSONObject(jsonString); JSONObject rootParsedJsonObj = new JSONObject(jsonString);
@ -305,7 +295,7 @@ public class RootController {
.getJSONArray("genres"); .getJSONArray("genres");
JSONObject pieJson = rootParsedJsonObj.getJSONObject("pie"); JSONObject pieJson = rootParsedJsonObj.getJSONObject("pie");
System.out.println("arrays parsed"); Logger.getLog().logInfo(new InfoEntry("refreshPieCharts").addArg("arrays parsed"));
int counter; int counter;
ArrayList<TitledPane> paneList = new ArrayList<TitledPane>(); ArrayList<TitledPane> paneList = new ArrayList<TitledPane>();
@ -323,12 +313,8 @@ public class RootController {
for (i = 0; i < hierarchyTagsJsonArray.length(); i++) { for (i = 0; i < hierarchyTagsJsonArray.length(); i++) {
hierarchyTagNameList.add(hierarchyTagsJsonArray.getString(i)); hierarchyTagNameList.add(hierarchyTagsJsonArray.getString(i));
allTags.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)); paneList.add(new GenrePieChartTitledPane(hierarchyName, hierarchyTagNameList));
} }
@ -337,7 +323,6 @@ public class RootController {
for (i = 0; i < totalPieTags.length(); i++) { for (i = 0; i < totalPieTags.length(); i++) {
allTags.add((totalPieTags).getString(i)); allTags.add((totalPieTags).getString(i));
} }
System.out.println(allTags);
paneList.add(new PieChartTitledPane("total", allTags)); paneList.add(new PieChartTitledPane("total", allTags));
final CountDownLatch latch = new CountDownLatch(1); final CountDownLatch latch = new CountDownLatch(1);