public class CombinedLayer extends CustomLayer implements LayerContainer
Layer.DataSize
KEY_DIMENSION
Constructor and Description |
---|
CombinedLayer(java.lang.String name,
java.lang.String description,
java.lang.Object paint) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<Layer> |
apply(Dimension dimension) |
java.util.Set<Layer> |
apply(Dimension dimension,
java.util.Set<java.awt.Point> selectedTiles) |
java.util.Set<Layer> |
apply(Tile tile) |
CombinedLayer |
clone()
Create a deep copy of the custom layer, with a different ID and
independent settings.
|
java.util.List<javax.swing.Action> |
getActions()
Get any actions (in addition to the standard add, edit and remove
actions) for this custom layer.
|
LayerExporter |
getExporter(Dimension dimension,
Platform platform,
ExporterSettings settings)
Returns a dummy exporter, all methods of which throw an
UnsupportedOperationException , since combined
layers must be exported by applying them and then exporting its constituent
layers, if any. |
java.lang.Class<? extends LayerExporter> |
getExporterType()
Return the type of the exporter that
Layer.getExporter(Dimension, Platform, ExporterSettings) will return. |
java.util.Map<Layer,java.lang.Float> |
getFactors() |
java.util.List<Layer> |
getLayers() |
Terrain |
getTerrain() |
java.lang.String |
getType()
Get a short, human-readable description of the layer type.
|
boolean |
isApplyTerrainAndBiomeOnExport() |
boolean |
restoreCustomTerrain()
If this combined layer contains a custom terrain, make sure that it is
installed.
|
void |
setApplyTerrainAndBiomeOnExport(boolean applyTerrainAndBiomeOnExport) |
void |
setFactors(java.util.Map<Layer,java.lang.Float> factors) |
void |
setLayers(java.util.List<Layer> layers) |
void |
setName(java.lang.String name)
Custom layers have names independent of their ID, so changing the name
after creation is not a problem.
|
void |
setTerrain(Terrain terrain) |
getBiome, getExportIndex, getIcon, getOpacity, getPaint, getPalette, getPaletteIndex, getRenderer, isExport, isHide, setBiome, setExport, setExportIndex, setHide, setMinMaxHeight, setOpacity, setPaint, setPalette, setPaletteIndex
compareTo, equals, getDataSize, getDefaultValue, getDescription, getId, getMnemonic, getName, getPriority, hashCode, isExportableToFile, setDescription, toString
public CombinedLayer(java.lang.String name, java.lang.String description, java.lang.Object paint)
public java.util.Set<Layer> apply(Dimension dimension, java.util.Set<java.awt.Point> selectedTiles)
public void setName(java.lang.String name)
CustomLayer
setName
in class CustomLayer
name
- The new name of the layer.public java.lang.String getType()
CustomLayer
getType
in class CustomLayer
public Terrain getTerrain()
public void setTerrain(Terrain terrain)
public java.util.List<Layer> getLayers()
getLayers
in interface LayerContainer
public void setLayers(java.util.List<Layer> layers)
public java.util.Map<Layer,java.lang.Float> getFactors()
public void setFactors(java.util.Map<Layer,java.lang.Float> factors)
public boolean isApplyTerrainAndBiomeOnExport()
public void setApplyTerrainAndBiomeOnExport(boolean applyTerrainAndBiomeOnExport)
public java.lang.Class<? extends LayerExporter> getExporterType()
Layer
Layer.getExporter(Dimension, Platform, ExporterSettings)
will return.
If that method is implemented, this method must also be implemented. May be used to examine which phases the
exporter requires. May return null
for layers that cannot be exported.getExporterType
in class Layer
public LayerExporter getExporter(Dimension dimension, Platform platform, ExporterSettings settings)
UnsupportedOperationException
, since combined
layers must be exported by applying
them and then exporting its constituent
layers, if any.
The exporter does implement FirstPassLayerExporter
and SecondPassLayerExporter
though,
to signal the fact that it can contain layers for both phases.
getExporter
in class Layer
dimension
- The dimension that is being exported.platform
- The platform for which the dimension is being exported.settings
- The configured settings for the layer, if any. May be null
.UnsupportedOperationException
.public java.util.List<javax.swing.Action> getActions()
CustomLayer
The CustomLayer.KEY_DIMENSION
value of the action will be set to the
current dimension, if any, before the action is invoked.
getActions
in class CustomLayer
null
if there
aren't any.public boolean restoreCustomTerrain()
Returns false
if a custom terrain was present
but it could not be restored because all custom terrain slots are in use,
true
in all other circumstances.
Please note: if this returns true
a new
custom terrain may have been installed, so in that case the
invoker MUST check whether a button already exists for the custom terrain
used by this combined layer, and add one if not.
false
if a custom terrain was present but it could
not be restored because all custom terrain slots are in use,
true
otherwise.public CombinedLayer clone()
CustomLayer
clone
in class CustomLayer