mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
begin using annotations to generate Bundle.properties, cleanup
This commit is contained in:
parent
d5e40a7e87
commit
6cd6ee7862
@ -26,12 +26,6 @@ Timeline.ui.countsview.menuItem.selectTimeRange=Select Time Range
|
|||||||
Timeline.ui.countsview.menuItem.selectEventType=Select Event Type
|
Timeline.ui.countsview.menuItem.selectEventType=Select Event Type
|
||||||
Timeline.ui.countsview.menuItem.selectTimeandType=Select Time and Type
|
Timeline.ui.countsview.menuItem.selectTimeandType=Select Time and Type
|
||||||
Timeline.ui.countsview.menuItem.zoomIntoTimeRange=Zoom into Time Range
|
Timeline.ui.countsview.menuItem.zoomIntoTimeRange=Zoom into Time Range
|
||||||
CountsViewPane.loggedTask.name=Updating Counts Graph
|
|
||||||
CountsViewPane.loggedTask.prepUpdate=preparing update
|
|
||||||
CountsViewPane.loggedTask.resetUI=resetting ui
|
|
||||||
CountsViewPane.tooltip.text={0} {1} events\nbetween {2}\nand {3}
|
|
||||||
CountsViewPane.loggedTask.updatingCounts=updating counts
|
|
||||||
CountsViewPane.loggedTask.wrappingUp=wrapping up
|
|
||||||
CountsViewPane.scaleLabel.text=Scale\:
|
CountsViewPane.scaleLabel.text=Scale\:
|
||||||
CountsViewPane.logRadio.text=Logarithmic
|
CountsViewPane.logRadio.text=Logarithmic
|
||||||
CountsViewPane.linearRadio.text=Linear
|
CountsViewPane.linearRadio.text=Linear
|
||||||
|
@ -69,6 +69,11 @@ import org.sleuthkit.autopsy.timeline.datamodel.FilteredEventsModel;
|
|||||||
import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType;
|
import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType;
|
||||||
import org.sleuthkit.autopsy.timeline.datamodel.eventtype.RootEventType;
|
import org.sleuthkit.autopsy.timeline.datamodel.eventtype.RootEventType;
|
||||||
import org.sleuthkit.autopsy.timeline.ui.AbstractVisualizationPane;
|
import org.sleuthkit.autopsy.timeline.ui.AbstractVisualizationPane;
|
||||||
|
import static org.sleuthkit.autopsy.timeline.ui.countsview.Bundle.CountsViewPane_loggedTask_name;
|
||||||
|
import static org.sleuthkit.autopsy.timeline.ui.countsview.Bundle.CountsViewPane_loggedTask_prepUpdate;
|
||||||
|
import static org.sleuthkit.autopsy.timeline.ui.countsview.Bundle.CountsViewPane_loggedTask_resetUI;
|
||||||
|
import static org.sleuthkit.autopsy.timeline.ui.countsview.Bundle.CountsViewPane_loggedTask_updatingCounts;
|
||||||
|
import static org.sleuthkit.autopsy.timeline.ui.countsview.Bundle.CountsViewPane_tooltip_text;
|
||||||
import org.sleuthkit.autopsy.timeline.utils.RangeDivisionInfo;
|
import org.sleuthkit.autopsy.timeline.utils.RangeDivisionInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -117,8 +122,18 @@ public class CountsViewPane extends AbstractVisualizationPane<String, Number, No
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@NbBundle.Messages({"CountsViewPane.loggedTask.name=Updating Counts Graph",
|
||||||
|
"CountsViewPane.loggedTask.prepUpdate=preparing update",
|
||||||
|
"CountsViewPane.loggedTask.resetUI=resetting ui",
|
||||||
|
"# {0} - count",
|
||||||
|
"# {1} - event type displayname",
|
||||||
|
"# {2} - start date time",
|
||||||
|
"# {3} - end date time",
|
||||||
|
"CountsViewPane.tooltip.text={0} {1} events\nbetween {2}\nand {3}",
|
||||||
|
"CountsViewPane.loggedTask.updatingCounts=updating counts",
|
||||||
|
"CountsViewPane.loggedTask.wrappingUp=wrapping up"})
|
||||||
protected Task<Boolean> getUpdateTask() {
|
protected Task<Boolean> getUpdateTask() {
|
||||||
return new LoggedTask<Boolean>(NbBundle.getMessage(this.getClass(), "CountsViewPane.loggedTask.name"), true) {
|
return new LoggedTask<Boolean>(CountsViewPane_loggedTask_name(), true) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean call() throws Exception {
|
protected Boolean call() throws Exception {
|
||||||
@ -126,13 +141,11 @@ public class CountsViewPane extends AbstractVisualizationPane<String, Number, No
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
updateProgress(-1, 1);
|
updateProgress(-1, 1);
|
||||||
updateMessage(NbBundle.getMessage(this.getClass(), "CountsViewPane.loggedTask.prepUpdate"));
|
updateMessage(CountsViewPane_loggedTask_prepUpdate());
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> setCursor(Cursor.WAIT));
|
||||||
setCursor(Cursor.WAIT);
|
|
||||||
});
|
|
||||||
|
|
||||||
final RangeDivisionInfo rangeInfo = RangeDivisionInfo.getRangeDivisionInfo(filteredEvents.timeRangeProperty().get());
|
final RangeDivisionInfo rangeInfo = RangeDivisionInfo.getRangeDivisionInfo(filteredEvents.timeRangeProperty().get());
|
||||||
chart.setRangeInfo(rangeInfo);
|
chart.setRangeInfo(rangeInfo); //do we need this. It seems like a hack.
|
||||||
//extend range to block bounderies (ie day, month, year)
|
//extend range to block bounderies (ie day, month, year)
|
||||||
final long lowerBound = rangeInfo.getLowerBound();
|
final long lowerBound = rangeInfo.getLowerBound();
|
||||||
final long upperBound = rangeInfo.getUpperBound();
|
final long upperBound = rangeInfo.getUpperBound();
|
||||||
@ -140,29 +153,30 @@ public class CountsViewPane extends AbstractVisualizationPane<String, Number, No
|
|||||||
|
|
||||||
int max = 0;
|
int max = 0;
|
||||||
int p = 0; // progress counter
|
int p = 0; // progress counter
|
||||||
|
updateMessage(CountsViewPane_loggedTask_resetUI());
|
||||||
//clear old data, and reset ranges and series
|
//clear old data, and reset ranges and series
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
updateMessage(NbBundle.getMessage(this.getClass(), "CountsViewPane.loggedTask.resetUI"));
|
|
||||||
eventTypeMap.clear();
|
eventTypeMap.clear();
|
||||||
dataSeries.clear();
|
dataSeries.clear();
|
||||||
dateAxis.getCategories().clear();
|
dateAxis.getCategories().clear();
|
||||||
|
|
||||||
DateTime start = timeRange.getStart();
|
|
||||||
while (timeRange.contains(start)) {
|
|
||||||
//add bar/'category' label for the current interval
|
|
||||||
final String dateString = start.toString(rangeInfo.getTickFormatter());
|
|
||||||
dateAxis.getCategories().add(dateString);
|
|
||||||
|
|
||||||
//increment for next iteration
|
|
||||||
start = start.plus(rangeInfo.getPeriodSize().getPeriod());
|
|
||||||
}
|
|
||||||
|
|
||||||
//make all series to ensure they get created in consistent order
|
|
||||||
EventType.allTypes.forEach(CountsViewPane.this::getSeries);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
DateTime start = timeRange.getStart();
|
DateTime start = timeRange.getStart();
|
||||||
|
while (timeRange.contains(start)) {
|
||||||
|
//add bar/'category' label for the current interval
|
||||||
|
final String dateString = start.toString(rangeInfo.getTickFormatter());
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
|
||||||
|
dateAxis.getCategories().add(dateString);
|
||||||
|
});
|
||||||
|
//increment for next iteration
|
||||||
|
start = start.plus(rangeInfo.getPeriodSize().getPeriod());
|
||||||
|
}
|
||||||
|
|
||||||
|
//make all series to ensure they get created in consistent order
|
||||||
|
EventType.allTypes.forEach(CountsViewPane.this::getSeries);
|
||||||
|
|
||||||
|
start = timeRange.getStart();
|
||||||
while (timeRange.contains(start)) {
|
while (timeRange.contains(start)) {
|
||||||
|
|
||||||
final String startString = start.toString(rangeInfo.getTickFormatter());
|
final String startString = start.toString(rangeInfo.getTickFormatter());
|
||||||
@ -197,8 +211,7 @@ public class CountsViewPane extends AbstractVisualizationPane<String, Number, No
|
|||||||
node.setCursor(Cursor.HAND);
|
node.setCursor(Cursor.HAND);
|
||||||
|
|
||||||
final Tooltip tooltip = new Tooltip(
|
final Tooltip tooltip = new Tooltip(
|
||||||
NbBundle.getMessage(this.getClass(), "CountsViewPane.tooltip.text",
|
CountsViewPane_tooltip_text(count,
|
||||||
count,
|
|
||||||
et.getDisplayName(),
|
et.getDisplayName(),
|
||||||
startString,
|
startString,
|
||||||
interval.getEnd().toString(rangeInfo.getTickFormatter())));
|
interval.getEnd().toString(rangeInfo.getTickFormatter())));
|
||||||
@ -223,10 +236,9 @@ public class CountsViewPane extends AbstractVisualizationPane<String, Number, No
|
|||||||
max = Math.max(max, dateMax);
|
max = Math.max(max, dateMax);
|
||||||
|
|
||||||
final double fmax = max;
|
final double fmax = max;
|
||||||
|
updateMessage(CountsViewPane_loggedTask_updatingCounts());
|
||||||
|
updateProgress(fp, rangeInfo.getPeriodsInRange());
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
updateMessage(
|
|
||||||
NbBundle.getMessage(this.getClass(), "CountsViewPane.loggedTask.updatingCounts"));
|
|
||||||
getSeries(et).getData().add(xyData);
|
getSeries(et).getData().add(xyData);
|
||||||
if (scale.get().equals(ScaleType.LINEAR)) {
|
if (scale.get().equals(ScaleType.LINEAR)) {
|
||||||
countAxis.setTickUnit(Math.pow(10, Math.max(0, Math.floor(Math.log10(fmax)) - 1)));
|
countAxis.setTickUnit(Math.pow(10, Math.max(0, Math.floor(Math.log10(fmax)) - 1)));
|
||||||
@ -235,29 +247,26 @@ public class CountsViewPane extends AbstractVisualizationPane<String, Number, No
|
|||||||
}
|
}
|
||||||
countAxis.setUpperBound(1 + fmax * 1.2);
|
countAxis.setUpperBound(1 + fmax * 1.2);
|
||||||
layoutDateLabels();
|
layoutDateLabels();
|
||||||
updateProgress(fp, rangeInfo.getPeriodsInRange());
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
final double fmax = max;
|
final double fmax = max;
|
||||||
|
updateMessage(CountsViewPane_loggedTask_updatingCounts());
|
||||||
Platform.runLater(() -> {
|
updateProgress(fp, rangeInfo.getPeriodsInRange());
|
||||||
updateMessage(
|
|
||||||
NbBundle.getMessage(this.getClass(), "CountsViewPane.loggedTask.updatingCounts"));
|
|
||||||
updateProgress(fp, rangeInfo.getPeriodsInRange());
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
updateProgress(1, 1);
|
||||||
Platform.runLater(() -> {
|
|
||||||
updateMessage(NbBundle.getMessage(this.getClass(), "CountsViewPane.loggedTask.wrappingUp"));
|
|
||||||
updateProgress(1, 1);
|
|
||||||
layoutDateLabels();
|
|
||||||
setCursor(Cursor.NONE);
|
|
||||||
});
|
|
||||||
|
|
||||||
return max > 0;
|
return max > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
|
||||||
|
protected void succeeded() {
|
||||||
|
super.succeeded();
|
||||||
|
layoutDateLabels();
|
||||||
|
setCursor(Cursor.DEFAULT);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,16 +346,15 @@ public class CountsViewPane extends AbstractVisualizationPane<String, Number, No
|
|||||||
return eventTypeMap.computeIfAbsent(et, (EventType t) -> {
|
return eventTypeMap.computeIfAbsent(et, (EventType t) -> {
|
||||||
XYChart.Series<String, Number> series = new XYChart.Series<>();
|
XYChart.Series<String, Number> series = new XYChart.Series<>();
|
||||||
series.setName(et.getDisplayName());
|
series.setName(et.getDisplayName());
|
||||||
dataSeries.add(series);
|
dataSeries.add(series);
|
||||||
return series;
|
return series;
|
||||||
});
|
});
|
||||||
|
|
||||||
// XYChart.Series<String, Number> series = eventTypeMap.get(et);
|
// XYChart.Series<String, Number> series = eventTypeMap.get(et);
|
||||||
// if (series == null) {
|
// if (series == null) {
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
// return series;
|
// return series;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -393,7 +401,7 @@ public class CountsViewPane extends AbstractVisualizationPane<String, Number, No
|
|||||||
barContextMenu = new ContextMenu();
|
barContextMenu = new ContextMenu();
|
||||||
barContextMenu.setAutoHide(true);
|
barContextMenu.setAutoHide(true);
|
||||||
barContextMenu.getItems().addAll(
|
barContextMenu.getItems().addAll(
|
||||||
new MenuItem(NbBundle.getMessage(this.getClass(),
|
new MenuItem(NbBundle.getMessage(CountsViewPane.class,
|
||||||
"Timeline.ui.countsview.menuItem.selectTimeRange")) {
|
"Timeline.ui.countsview.menuItem.selectTimeRange")) {
|
||||||
{
|
{
|
||||||
setOnAction((ActionEvent t) -> {
|
setOnAction((ActionEvent t) -> {
|
||||||
@ -410,7 +418,7 @@ public class CountsViewPane extends AbstractVisualizationPane<String, Number, No
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new MenuItem(NbBundle.getMessage(this.getClass(),
|
new MenuItem(NbBundle.getMessage(CountsViewPane.class,
|
||||||
"Timeline.ui.countsview.menuItem.selectEventType")) {
|
"Timeline.ui.countsview.menuItem.selectEventType")) {
|
||||||
{
|
{
|
||||||
setOnAction((ActionEvent t) -> {
|
setOnAction((ActionEvent t) -> {
|
||||||
@ -424,7 +432,7 @@ public class CountsViewPane extends AbstractVisualizationPane<String, Number, No
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new MenuItem(NbBundle.getMessage(this.getClass(),
|
new MenuItem(NbBundle.getMessage(CountsViewPane.class,
|
||||||
"Timeline.ui.countsview.menuItem.selectTimeandType")) {
|
"Timeline.ui.countsview.menuItem.selectTimeandType")) {
|
||||||
{
|
{
|
||||||
setOnAction((ActionEvent t) -> {
|
setOnAction((ActionEvent t) -> {
|
||||||
@ -434,7 +442,7 @@ public class CountsViewPane extends AbstractVisualizationPane<String, Number, No
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
new SeparatorMenuItem(),
|
new SeparatorMenuItem(),
|
||||||
new MenuItem(NbBundle.getMessage(this.getClass(),
|
new MenuItem(NbBundle.getMessage(CountsViewPane.class,
|
||||||
"Timeline.ui.countsview.menuItem.zoomIntoTimeRange")) {
|
"Timeline.ui.countsview.menuItem.zoomIntoTimeRange")) {
|
||||||
{
|
{
|
||||||
setOnAction((ActionEvent t) -> {
|
setOnAction((ActionEvent t) -> {
|
||||||
@ -514,9 +522,9 @@ public class CountsViewPane extends AbstractVisualizationPane<String, Number, No
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
logRadio.setText(NbBundle.getMessage(this.getClass(), "CountsViewPane.logRadio.text"));
|
logRadio.setText(NbBundle.getMessage(CountsViewPane.class, "CountsViewPane.logRadio.text"));
|
||||||
linearRadio.setText(NbBundle.getMessage(this.getClass(), "CountsViewPane.linearRadio.text"));
|
linearRadio.setText(NbBundle.getMessage(CountsViewPane.class, "CountsViewPane.linearRadio.text"));
|
||||||
scaleLabel.setText(NbBundle.getMessage(this.getClass(), "CountsViewPane.scaleLabel.text"));
|
scaleLabel.setText(NbBundle.getMessage(CountsViewPane.class, "CountsViewPane.scaleLabel.text"));
|
||||||
}
|
}
|
||||||
|
|
||||||
CountsViewSettingsPane() {
|
CountsViewSettingsPane() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user