19 package org.sleuthkit.autopsy.guiutils;
21 import java.awt.Component;
22 import java.time.Duration;
23 import javax.swing.JTable;
24 import static javax.swing.SwingConstants.CENTER;
36 setHorizontalAlignment(CENTER);
41 if (value instanceof Long) {
59 Duration d = Duration.ofMillis(duration);
61 d = Duration.ofMillis(-duration);
65 long days = d.toDays();
66 long hours = d.minusDays(days).toHours();
67 long minutes = d.minusDays(days).minusHours(hours).toMinutes();
68 long seconds = d.minusDays(days).minusHours(hours).minusMinutes(minutes).getSeconds();
73 result = days +
" d " + hours +
" h " + minutes +
" m " + seconds +
" s";
75 result = hours +
" h " + minutes +
" m " + seconds +
" s";
78 result = minutes +
" m " + seconds +
" s";
81 result = seconds +
" s";
static final long serialVersionUID
Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
static String longToDurationString(long duration)
void grayCellIfTableNotEnabled(JTable table, boolean isSelected)