19 package org.sleuthkit.autopsy.guiutils;
21 import java.awt.Component;
22 import java.time.Duration;
23 import javax.swing.JTable;
36 setHorizontalAlignment(LEFT);
41 if (value instanceof Long) {
61 Duration d = Duration.ofMillis(duration);
63 d = Duration.ofMillis(0);
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();
81 StringBuilder results =
new StringBuilder(12);
83 results.append(String.format(
"%02d", days));
87 results.append(UNIT_SEPARATOR_CHAR);
88 results.append(String.format(
"%02d", hours));
89 results.append(UNIT_SEPARATOR_CHAR);
90 results.append(String.format(
"%02d", minutes));
91 results.append(UNIT_SEPARATOR_CHAR);
92 results.append(String.format(
"%02d", seconds));
93 return results.toString();
static final char UNIT_SEPARATOR_CHAR
static final long serialVersionUID
Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
static String longToDurationString(long duration)
static char getUnitSeperator()
void grayCellIfTableNotEnabled(JTable table, boolean isSelected)