- found attribute is calculated at reading time from file, to avoid lazy loading of all the log entries from database
- kind of batch writing to database for better performance
This commit is contained in:
@@ -14,7 +14,7 @@ class BasicListStatisticsPlugin implements Plugin {
|
||||
private difficultyTerrainValues = ['1', '1.5', '2', '2.5', '3', '3.5', '4', '4.5', '5']
|
||||
|
||||
final String name = "Basic List Statistic"
|
||||
final String version = "0.0.1"
|
||||
final String version = "0.0.2"
|
||||
|
||||
@Override
|
||||
void run(final Map context) {
|
||||
@@ -56,27 +56,27 @@ class BasicListStatisticsPlugin implements Plugin {
|
||||
|
||||
// create javafx chart
|
||||
def typeData = FXCollections.observableArrayList()
|
||||
typeStats.each() { key, value -> typeData.add(new Data(key as String, value as double)) }
|
||||
typeStats.each() { key, value -> typeData.add(new Data(key.toString() + ' (' + value + ')', value as double)) }
|
||||
def typeChart = new PieChart(typeData);
|
||||
typeChart.setTitle("Number of cache types in list.");
|
||||
typeChart.setTitle("Spreading of cache types in list.");
|
||||
|
||||
// create javafx chart
|
||||
def difficultyData = FXCollections.observableArrayList()
|
||||
difficultyTerrainValues.each {
|
||||
def value = difficultyStats[it]
|
||||
if (value) difficultyData.add(new Data(it, value))
|
||||
if (value) difficultyData.add(new Data(it+ ' (' + value + ')', value))
|
||||
}
|
||||
def difficultyChart = new PieChart(difficultyData);
|
||||
difficultyChart.setTitle("Number of difficulties in list.");
|
||||
difficultyChart.setTitle("Spreading of difficulties in list.");
|
||||
|
||||
// create javafx chart
|
||||
def terrainData = FXCollections.observableArrayList()
|
||||
difficultyTerrainValues.each {
|
||||
def value = terrainStats[it]
|
||||
if (value) terrainData.add(new Data(it, value))
|
||||
if (value) terrainData.add(new Data(it+ ' (' + value + ')', value))
|
||||
}
|
||||
def terrainChart = new PieChart(terrainData);
|
||||
terrainChart.setTitle("Number of terrain in list.");
|
||||
terrainChart.setTitle("Spreading of terrain in list.");
|
||||
|
||||
// add charts to layout container
|
||||
contenPane.children.addAll(typeChart, difficultyChart, terrainChart)
|
||||
@@ -84,8 +84,6 @@ class BasicListStatisticsPlugin implements Plugin {
|
||||
// return the layout container
|
||||
def scrollPane = new ScrollPane(contenPane)
|
||||
scrollPane.minWidth = 600
|
||||
scrollPane.prefWidth = 600
|
||||
scrollPane.maxWidth = 600
|
||||
scrollPane.minHeight = 450
|
||||
scrollPane
|
||||
}
|
||||
@@ -95,7 +93,7 @@ class BasicListStatisticsPlugin implements Plugin {
|
||||
}
|
||||
|
||||
private void showDialog(header, content) {
|
||||
Dialog dialog = new Dialog(null, name+" ("+version+")")
|
||||
Dialog dialog = new Dialog(null, name+" ("+version+")", true)
|
||||
dialog.setMasthead(header)
|
||||
dialog.setContent(content)
|
||||
dialog.show()
|
||||
|
||||
Reference in New Issue
Block a user