});
}
private JPopupMenu createPopup(final int colorsCount) {
JPopupMenu menu = new JPopupMenu();
menu.add(new JXTitledSeparator(NbBundle.getMessage(PartitionColorTransformerPanel.class, "PalettePopup.recent")));
Collection<Palette> recentPalettes = paletteManager.getRecentPalettes();
if (recentPalettes.isEmpty()) {
menu.add("<html><i>" + NbBundle.getMessage(PartitionColorTransformerPanel.class, "PalettePopup.norecent") + "</i></html>");
} else {
for (Palette pl : recentPalettes) {
menu.add(new PaletteMenuItem(pl, colorsCount));
}
}
menu.add(new JXTitledSeparator(NbBundle.getMessage(PartitionColorTransformerPanel.class, "PalettePopup.standard")));
JMenu lightPalette = new JMenu(NbBundle.getMessage(PartitionColorTransformerPanel.class, "PalettePopup.light"));
for (Palette pl : paletteManager.getWhiteBackgroudPalette(colorsCount)) {
lightPalette.add(new PaletteMenuItem(pl, colorsCount));
}
menu.add(lightPalette);