use of org.pepsoft.worldpainter.BiomeListCellRenderer in project WorldPainter by Captain-Chaos.
the class CombinedLayerEditor method setContext.
@Override
public void setContext(LayerEditorContext context) {
super.setContext(context);
CustomBiomeManager customBiomeManager = context.getCustomBiomeManager();
ColourScheme colourScheme = context.getColourScheme();
comboBoxTerrain.setRenderer(new TerrainListCellRenderer(colourScheme, "none"));
comboBoxBiome.setRenderer(new BiomeListCellRenderer(colourScheme, customBiomeManager, "none"));
List<Integer> allBiomes = new ArrayList<>();
allBiomes.add(-1);
for (int i = 0; i < Minecraft1_7Biomes.BIOME_NAMES.length; i++) {
if (Minecraft1_7Biomes.BIOME_NAMES[i] != null) {
allBiomes.add(i);
}
}
List<CustomBiome> customBiomes = customBiomeManager.getCustomBiomes();
if (customBiomes != null) {
allBiomes.addAll(customBiomes.stream().map(CustomBiome::getId).collect(Collectors.toList()));
}
comboBoxBiome.setModel(new DefaultComboBoxModel(allBiomes.toArray()));
allLayers = context.getAllLayers();
}
Aggregations