diff --git a/iped-app/src/main/java/iped/app/timelinegraph/IpedChartsPanel.java b/iped-app/src/main/java/iped/app/timelinegraph/IpedChartsPanel.java index e7230e69f3..89a23d6801 100644 --- a/iped-app/src/main/java/iped/app/timelinegraph/IpedChartsPanel.java +++ b/iped-app/src/main/java/iped/app/timelinegraph/IpedChartsPanel.java @@ -41,6 +41,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Predicate; +import javax.swing.BoxLayout; import javax.swing.DefaultListModel; import javax.swing.ImageIcon; import javax.swing.JComboBox; @@ -164,7 +165,9 @@ public class IpedChartsPanel extends JPanel implements ResultSetViewer, TableMod String metadataToBreakChart = null; ImageIcon loading = null; - JLabel loadingLabel; + JPanel loadingPanel = new JPanel(); + JLabel loadingLabelImage; + JLabel loadingLabelText; IpedSplitPane splitPane; @@ -377,8 +380,15 @@ public void check(MouseEvent e) { this.addComponentListener(this); loading = (ImageIcon) new ImageIcon(IconUtil.class.getResource(resPath + "loading.gif")); - loadingLabel = new JLabel("", loading, JLabel.CENTER); - this.add(loadingLabel); + loadingLabelImage = new JLabel("", loading, JLabel.CENTER); + loadingLabelText = new JLabel("", JLabel.CENTER); + loadingPanel.setAlignmentY(Component.CENTER_ALIGNMENT); + loadingPanel.setLayout(new BoxLayout(loadingPanel, BoxLayout.Y_AXIS)); + loadingLabelImage.setAlignmentX(Component.CENTER_ALIGNMENT); + loadingLabelText.setAlignmentX(Component.CENTER_ALIGNMENT); + loadingPanel.add(loadingLabelImage, BorderLayout.CENTER); + loadingPanel.add(loadingLabelText, BorderLayout.CENTER); + this.add(loadingPanel); domainAxis.setTickMarkPosition(DateTickMarkPosition.START); domainAxis.setLowerMargin(0.01); @@ -420,6 +430,7 @@ public HashMap createAlertDataSets() { } public HashMap createDataSets() { + HashMap result = new HashMap(); try { Set selectedBookmarks = guiProvider.getSelectedBookmarks(); @@ -482,8 +493,8 @@ public Future refreshChart(boolean resetDomainRange) { IpedChartsPanel self = this; self.remove(splitPane); - self.remove(loadingLabel); - self.add(loadingLabel); + self.remove(loadingPanel); + self.add(loadingPanel); self.repaint(); if (swRefresh != null) { @@ -548,7 +559,7 @@ public void run() { } if (chart != null && !isCancelled()) { - self.remove(loadingLabel); + self.remove(loadingPanel); self.remove(splitPane); self.add(splitPane); splitPane.setTopComponent(chartPanel); @@ -1060,7 +1071,7 @@ public void setLegendList(JList legendList) { @Override public void componentResized(ComponentEvent e) { - this.remove(loadingLabel); + this.remove(loadingPanel); this.remove(splitPane); this.add(splitPane); } @@ -1126,4 +1137,8 @@ public void actionPerformed(ActionEvent e) { } refreshChart(false); } + + public void info(String info) { + loadingLabelText.setText(info); + } } \ No newline at end of file diff --git a/iped-app/src/main/java/iped/app/timelinegraph/cache/IndexTimeStampCache.java b/iped-app/src/main/java/iped/app/timelinegraph/cache/IndexTimeStampCache.java index 5257e46756..be492b9ff2 100644 --- a/iped-app/src/main/java/iped/app/timelinegraph/cache/IndexTimeStampCache.java +++ b/iped-app/src/main/java/iped/app/timelinegraph/cache/IndexTimeStampCache.java @@ -89,6 +89,8 @@ public void run() { if (!cacheExists) { Date d1 = new Date(); logger.info("Starting to build time cache of [{}]...", periodClassesToCache.toString()); + ipedChartsPanel.info("Starting to build time cache of [" + periodClassesToCache.toString() + "] to " + + teGroup.getName() + " event type group"); ArrayList cacheLoaders = new ArrayList(); @@ -139,6 +141,9 @@ public void run() { } } else { + ipedChartsPanel.info("Starting to load time cache of [" + periodClassesToCache.toString() + "] to " + + teGroup.getName() + " event type group"); + CachePersistence cp = CachePersistence.getInstance(); for (Class periodClasses : periodClassesToCache) { newCache.setIndexFile(teGroup, periodClasses.getSimpleName(), cp.getBaseDir());