List<String> resLst = Arrays.asList(ressources);
Collections.sort(resLst);
ressources = (String[]) resLst.toArray();
// for the base path inside the jar file
RGBPaletteReader reader = new Flam3GradientReader();
DefaultMutableTreeNode defaultFolderNode = null;
for (String ressource : ressources) {
try {
InputStream is = reader.getClass().getResourceAsStream(ressource);
if (is != null) {
List<RGBPalette> palettes = reader.readPalettes(is);
if (palettes.size() > 0) {
GradientInternalNode node = new GradientInternalNode(ressource);
node.getGradientLibraryList().addAll(palettes);
if (defaultFolderNode == null) {
defaultFolderNode = new DefaultMutableTreeNode("Built-in gradients (read-only)", true);