working through types summary tab

This commit is contained in:
Greg DiCristofaro 2020-09-04 13:41:21 -04:00
parent c0f40f5d23
commit 950b567d6f
2 changed files with 4 additions and 3 deletions

View File

@ -110,6 +110,7 @@ class TypesPanel extends BaseDataSourceSummaryPanel {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final DecimalFormat INTEGER_SIZE_FORMAT = new DecimalFormat("#"); private static final DecimalFormat INTEGER_SIZE_FORMAT = new DecimalFormat("#");
DecimalFormat COMMA_FORMATTER = new DecimalFormat("#,###");
// All file type categories. // All file type categories.
private static final List<Pair<String, FileTypeCategory>> FILE_MIME_TYPE_CATEGORIES = Arrays.asList( private static final List<Pair<String, FileTypeCategory>> FILE_MIME_TYPE_CATEGORIES = Arrays.asList(
@ -253,14 +254,14 @@ class TypesPanel extends BaseDataSourceSummaryPanel {
} }
/** /**
* Returns string value of long. If null returns a string of '0'. * Returns string value of long with comma separators. If null returns a string of '0'.
* *
* @param longVal The long value. * @param longVal The long value.
* *
* @return The string value of the long. * @return The string value of the long.
*/ */
private String getStringOrZero(Long longVal) { private String getStringOrZero(Long longVal) {
return String.valueOf(longVal == null ? 0 : longVal); return longVal == null ? "0" : COMMA_FORMATTER.format(longVal);
} }
/** /**

View File

@ -114,7 +114,7 @@ public class PieChartPanel extends AbstractLoadableComponent<List<PieChartPanel.
private static final Font DEFAULT_HEADER_FONT = new Font(DEFAULT_FONT.getName(), DEFAULT_FONT.getStyle(), (int) (DEFAULT_FONT.getSize() * 1.5)); private static final Font DEFAULT_HEADER_FONT = new Font(DEFAULT_FONT.getName(), DEFAULT_FONT.getStyle(), (int) (DEFAULT_FONT.getSize() * 1.5));
private static final PieSectionLabelGenerator DEFAULT_LABEL_GENERATOR private static final PieSectionLabelGenerator DEFAULT_LABEL_GENERATOR
= new StandardPieSectionLabelGenerator( = new StandardPieSectionLabelGenerator(
"{0}: {1} ({2})", new DecimalFormat("0"), new DecimalFormat("0.0%")); "{0}: {1} ({2})", new DecimalFormat("#,###"), new DecimalFormat("0.0%"));
private final MessageOverlay overlay = new MessageOverlay(); private final MessageOverlay overlay = new MessageOverlay();
private final DefaultPieDataset dataset = new DefaultPieDataset(); private final DefaultPieDataset dataset = new DefaultPieDataset();