public abstract class RODelegatingDimension<T extends Tile> extends Dimension
Dimension which wraps another
 Dimension and delegates all read  calls to it. All write calls throw
 an UnsupportedOperationException.
 In addition the methods which return tiles wrap the returned tiles in
 RODelegatingTiles.
 
Intended to change the behaviour of one or more read calls by overriding them.
Dimension.Anchor, Dimension.Border, Dimension.LayerAnchor, Dimension.Listener, Dimension.Role, Dimension.TileVisitationBuilder, Dimension.TileVisitor, Dimension.WallTypeInstanceKeeper.InstantiationListener<T>| Modifier and Type | Field and Description | 
|---|---|
| protected Dimension | dimension | 
| protected java.util.Map<java.awt.Point,java.lang.ref.Reference<T>> | tileCache | 
POSSIBLE_AUTO_BIOMES| Constructor and Description | 
|---|
| RODelegatingDimension(Dimension dimension) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addDimensionListener(Dimension.Listener listener) | 
| int | addOverlay(Overlay overlay) | 
| void | addPropertyChangeListener(java.beans.PropertyChangeListener listener) | 
| void | addPropertyChangeListener(java.lang.String propertyName,
                         java.beans.PropertyChangeListener listener) | 
| void | addTile(Tile tile) | 
| void | allBitLayerDataChanged(Tile tile) | 
| void | allNonBitlayerDataChanged(Tile tile) | 
| void | applyTheme(int x,
          int y) | 
| void | applyTheme(java.awt.Point coords) | 
| void | armSavePoint() | 
| void | changed()Update the change number; for use when some aspect of a dimension changes
 which the  Dimensionclass itself does not track. | 
| void | clearLayerData(Layer layer) | 
| void | clearRedo() | 
| void | clearUndo() | 
| boolean | containsOneOf(Layer... layers) | 
| protected Tile | doGetTile(java.awt.Point coords) | 
| java.util.Set<Layer> | getAllLayers(boolean applyCombinedLayers)Returns the set of all layers currently in use on the world, optionally
 including layers that are included in combined layers. | 
| java.util.Map<Layer,ExporterSettings> | getAllLayerSettings() | 
| java.util.Set<Terrain> | getAllTerrains() | 
| Dimension.Anchor | getAnchor() | 
| boolean | getBitLayerValueAt(Layer layer,
                  int x,
                  int y) | 
| Dimension.Border | getBorder() | 
| int | getBorderLevel() | 
| int | getBorderSize() | 
| long | getChangeNo()Get the change number. | 
| int | getContourSeparation() | 
| java.util.List<CustomBiome> | getCustomBiomes() | 
| float | getDistanceToEdge(Layer layer,
                 int x,
                 int y,
                 float maxDistance)Get the distance from the specified coordinate to the nearest pixel where
 the specified layer is not set. | 
| int | getFloodedCount(int x,
               int y,
               int r,
               boolean lava)Count the number of blocks that are flooded in a square around a
 particular location | 
| Garden | getGarden() | 
| int | getGridSize() | 
| int | getHeight() | 
| float | getHeightAt(int x,
           int y)Get the terrain height at the specified coordinates, if a tile exists in the specified location. | 
| float | getHeightAt(java.awt.Point coords)Get the terrain height at the specified coordinates, if a tile exists in the specified location. | 
| int | getHighestX() | 
| int | getHighestY() | 
| int | getIntHeightAt(int x,
              int y)Get the terrain height at the specified coordinates, rounded to the nearest integer, if a tile exists in the
 specified location. | 
| int | getIntHeightAt(int x,
              int y,
              int defaultValue)Get the terrain height at the specified coordinates, rounded to the nearest integer, if a tile exists in the
 specified location. | 
| int | getIntHeightAt(java.awt.Point coords)Get the terrain height at the specified coordinates, rounded to the nearest integer, if a tile exists in the
 specified location. | 
| java.awt.Point | getLastViewPosition() | 
| ExporterSettings | getLayerSettings(Layer layer) | 
| int | getLayerValueAt(Layer layer,
               int x,
               int y) | 
| int | getLayerValueAt(Layer layer,
               java.awt.Point coords) | 
| int | getLowestX() | 
| int | getLowestY() | 
| int | getMaxHeight() | 
| long | getMinecraftSeed() | 
| java.util.Set<Layer> | getMinimumLayers()Get the set of layers that has been configured to be applied everywhere. | 
| java.lang.String | getName() | 
| java.util.List<Overlay> | getOverlays() | 
| int | getRawHeightAt(int x,
              int y)Get the raw height value. | 
| int | getRawHeightAt(java.awt.Point coords)Get the raw height value. | 
| Dimension.WallType | getRoofType() | 
| long | getSeed() | 
| float | getSlope(int x,
        int y) | 
| Dimension | getSnapshot()Get a snapshot of the current state of this dimension. | 
| Terrain | getSubsurfaceMaterial() | 
| Terrain | getTerrainAt(int x,
            int y) | 
| T | getTile(int x,
       int y)Get the tile for a particular set of world or absolute block coordinates. | 
| T | getTile(java.awt.Point coords)If any transformations (scaling and/or translating) needs to be applied to the underlying tiles, this method
 and  getTiles()must be overridden. | 
| java.util.Set<java.awt.Point> | getTileCoords() | 
| int | getTileCount() | 
| TileFactory | getTileFactory() | 
| java.util.Collection<T> | getTiles()If any transformations (scaling and/or translating) needs to be applied to the underlying tiles, this method
 and  getTile(Point)must be overridden. | 
| int | getTopLayerDepth(int x,
                int y,
                int z) | 
| int | getTopLayerMinDepth() | 
| int | getTopLayerVariation() | 
| Dimension.WallType | getWallType() | 
| int | getWaterLevelAt(int x,
               int y) | 
| int | getWaterLevelAt(java.awt.Point coords) | 
| int | getWidth() | 
| World2 | getWorld() | 
| void | heightMapChanged(Tile tile) | 
| boolean | isBottomless() | 
| boolean | isContoursEnabled() | 
| boolean | isEventsInhibited() | 
| boolean | isGridEnabled() | 
| boolean | isOverlaysEnabled() | 
| boolean | isPopulate() | 
| boolean | isTilePresent(int x,
             int y)Determines whether a tile is present in the dimension on specific coordinates. | 
| boolean | isUndoAvailable() | 
| void | layerDataChanged(Tile tile,
                java.util.Set<Layer> changedLayers) | 
| void | registerUndoManager(org.pepsoft.util.undo.UndoManager undoManager) | 
| void | removeDimensionListener(Dimension.Listener listener) | 
| void | removeOverlay(int index) | 
| void | removePropertyChangeListener(java.beans.PropertyChangeListener listener) | 
| void | removePropertyChangeListener(java.lang.String propertyName,
                            java.beans.PropertyChangeListener listener) | 
| void | removeTile(int tileX,
          int tileY) | 
| void | removeTile(java.awt.Point coords) | 
| void | removeTile(Tile tile) | 
| void | seedsChanged(Tile tile) | 
| void | setBitLayerValueAt(Layer layer,
                  int x,
                  int y,
                  boolean value) | 
| void | setBorder(Dimension.Border border) | 
| void | setBorderLevel(int borderLevel) | 
| void | setBorderSize(int borderSize) | 
| void | setBottomless(boolean bottomless) | 
| void | setContoursEnabled(boolean contoursEnabled) | 
| void | setContourSeparation(int contourSeparation) | 
| void | setCustomBiomes(java.util.List<CustomBiome> customBiomes) | 
| void | setEventsInhibited(boolean eventsInhibited) | 
| void | setGridEnabled(boolean gridEnabled) | 
| void | setGridSize(int gridSize) | 
| void | setHeightAt(int x,
           int y,
           float height) | 
| void | setHeightAt(java.awt.Point coords,
           float height) | 
| void | setLastViewPosition(java.awt.Point lastViewPosition) | 
| void | setLayerSettings(Layer layer,
                ExporterSettings settings) | 
| void | setLayerValueAt(Layer layer,
               int x,
               int y,
               int value) | 
| void | setMaxHeight(int maxHeight) | 
| void | setMinecraftSeed(long minecraftSeed) | 
| void | setOverlaysEnabled(boolean overlaysEnabled) | 
| void | setPopulate(boolean populate) | 
| void | setRawHeightAt(int x,
              int y,
              int rawHeight)Set the raw height value. | 
| void | setRawHeightAt(java.awt.Point coords,
              int rawHeight)Set the raw height value. | 
| void | setRoofType(Dimension.WallType roofType) | 
| void | setSubsurfaceMaterial(Terrain subsurfaceMaterial) | 
| void | setTerrainAt(int x,
            int y,
            Terrain terrain) | 
| void | setTerrainAt(java.awt.Point coords,
            Terrain terrain) | 
| void | setTopLayerMinDepth(int topLayerMinDepth) | 
| void | setTopLayerVariation(int topLayerVariation) | 
| void | setWallType(Dimension.WallType wallType) | 
| void | setWaterLevelAt(int x,
               int y,
               int waterLevel) | 
| void | terrainChanged(Tile tile) | 
| void | transform(CoordinateTransform transform,
         org.pepsoft.util.ProgressReceiver progressReceiver)Transform the tiles of this dimension horizontally, for instance
 translating and/or rotating them. | 
| boolean | undoChanges() | 
| void | unregisterUndoManager() | 
| void | waterLevelChanged(Tile tile) | 
| protected T | wrapTile(Tile tile) | 
clearLayerData, doGetDistanceToEdge, doGetFloodedCount, doGetSlope, getAttribute, getAutoBiome, getAutoBiome, getAutoBiome, getAutoBiome, getBitLayerCount, getCeilingHeight, getCustomLayers, getCustomLayers, getDistancesToEdge, getExportSettings, getExtent, getGenerator, getHeightRange, getHiddenPalettes, getHighestHeight, getHighestIntHeight, getHighestRawHeight, getId, getIntHeightRange, getLayersAt, getLowestHeight, getLowestIntHeight, getLowestRawHeight, getMinHeight, getMostPrevalentBiome, getRawHeightRange, getScale, getSoloedPalette, getSubsurfaceLayerAnchor, getTileForEditing, getTileForEditing, getTopLayerAnchor, getUndergroundBiome, isBorderTile, isCoverSteepTerrain, isFixOverlayCoords, rememberChanges, save, setAttribute, setCeilingHeight, setCoverSteepTerrain, setCustomLayers, setExportSettings, setFixOverlayCoords, setGenerator, setHiddenPalettes, setMinHeight, setName, setScale, setSoloedPalette, setSubsurfaceLayerAnchor, setTopLayerAnchor, setUndergroundBiome, setWorld, visitTiles, visitTilesForEditingsetInstantiationListenerprotected final Dimension dimension
public RODelegatingDimension(Dimension dimension)
public Dimension.Anchor getAnchor()
public long getChangeNo()
DimensiongetChangeNo in class Dimensionpublic Terrain getSubsurfaceMaterial()
getSubsurfaceMaterial in class Dimensionpublic boolean isPopulate()
isPopulate in class Dimensionpublic Dimension.Border getBorder()
public int getBorderLevel()
getBorderLevel in class Dimensionpublic int getBorderSize()
getBorderSize in class Dimensionpublic TileFactory getTileFactory()
getTileFactory in class Dimensionpublic boolean isTilePresent(int x,
                             int y)
DimensionisTilePresent in interface TileProviderisTilePresent in class Dimensionx - The tile X coordinate for which to determine whether a tile is present.y - The tile Y coordinate for which to determine whether a tile is present.true if the dimension contains a tile at the specified location.public int getTileCount()
getTileCount in class Dimensionpublic void removeTile(java.awt.Point coords)
removeTile in class Dimensionpublic void removeTile(int tileX,
                       int tileY)
removeTile in class Dimensionpublic int getIntHeightAt(int x,
                          int y)
DimensiongetIntHeightAt in class Dimensionx - The X coordinate to query.y - The Y coordinate to query.Integer.MIN_VALUE if there is no tile at the specified coordinates.public int getIntHeightAt(int x,
                          int y,
                          int defaultValue)
DimensiongetIntHeightAt in class Dimensionx - The X coordinate to query.y - The Y coordinate to query.defaultValue - The value to return if there is no tile at the specified coordinates.defaultHeight if there is no tile at the specified coordinates.public int getIntHeightAt(java.awt.Point coords)
DimensiongetIntHeightAt in class Dimensioncoords - The coordinates to query.Integer.MIN_VALUE if there is no tile at the specified coordinates.public float getHeightAt(int x,
                         int y)
DimensiongetHeightAt in class Dimensionx - The X coordinate to query.y - The Y coordinate to query.-Float.MAX_VALUE if there is
 no tile at the specified coordinates.public float getHeightAt(java.awt.Point coords)
DimensiongetHeightAt in class Dimensioncoords - The coordinates to query.-Float.MAX_VALUE if there is
 no tile at the specified coordinates.public int getRawHeightAt(int x,
                          int y)
DimensionminHeight.getRawHeightAt in class Dimensionpublic int getRawHeightAt(java.awt.Point coords)
DimensionminHeight.getRawHeightAt in class Dimensionpublic final void setRawHeightAt(int x,
                                 int y,
                                 int rawHeight)
DimensionminHeight.setRawHeightAt in class Dimensionpublic final void setRawHeightAt(java.awt.Point coords,
                                 int rawHeight)
DimensionminHeight.setRawHeightAt in class Dimensionpublic Terrain getTerrainAt(int x, int y)
getTerrainAt in class Dimensionpublic java.util.Set<Terrain> getAllTerrains()
getAllTerrains in class Dimensionpublic int getWaterLevelAt(int x,
                           int y)
getWaterLevelAt in class Dimensionpublic int getWaterLevelAt(java.awt.Point coords)
getWaterLevelAt in class Dimensionpublic int getLayerValueAt(Layer layer, int x, int y)
getLayerValueAt in class Dimensionpublic int getLayerValueAt(Layer layer, java.awt.Point coords)
getLayerValueAt in class Dimensionpublic boolean getBitLayerValueAt(Layer layer, int x, int y)
getBitLayerValueAt in class Dimensionpublic float getDistanceToEdge(Layer layer, int x, int y, float maxDistance)
DimensiongetDistanceToEdge in class Dimensionlayer - The layer for which to find the distance to the nearest
              edge.x - The X coordinate of the location towards which to determine the distance.y - The Y coordinate of the location towards which to determine the distance.maxDistance - The maximum distance to return. If the actual distance is further, this value will be returned.public final void clearLayerData(Layer layer)
clearLayerData in class Dimensionpublic long getMinecraftSeed()
getMinecraftSeed in class Dimensionpublic java.util.List<Overlay> getOverlays()
getOverlays in class Dimensionpublic int addOverlay(Overlay overlay)
addOverlay in class Dimensionpublic void removeOverlay(int index)
removeOverlay in class Dimensionpublic boolean isGridEnabled()
isGridEnabled in class Dimensionpublic final void setGridEnabled(boolean gridEnabled)
setGridEnabled in class Dimensionpublic int getGridSize()
getGridSize in class Dimensionpublic final void setGridSize(int gridSize)
setGridSize in class Dimensionpublic boolean isOverlaysEnabled()
isOverlaysEnabled in class Dimensionpublic final void setOverlaysEnabled(boolean overlaysEnabled)
setOverlaysEnabled in class Dimensionpublic int getMaxHeight()
getMaxHeight in class Dimensionpublic final void setMaxHeight(int maxHeight)
setMaxHeight in class Dimensionpublic int getContourSeparation()
getContourSeparation in class Dimensionpublic final void setContourSeparation(int contourSeparation)
setContourSeparation in class Dimensionpublic boolean isContoursEnabled()
isContoursEnabled in class Dimensionpublic final void setContoursEnabled(boolean contoursEnabled)
setContoursEnabled in class Dimensionpublic int getTopLayerMinDepth()
getTopLayerMinDepth in class Dimensionpublic final void setTopLayerMinDepth(int topLayerMinDepth)
setTopLayerMinDepth in class Dimensionpublic int getTopLayerVariation()
getTopLayerVariation in class Dimensionpublic final void setTopLayerVariation(int topLayerVariation)
setTopLayerVariation in class Dimensionpublic boolean isBottomless()
isBottomless in class Dimensionpublic final void setBottomless(boolean bottomless)
setBottomless in class Dimensionpublic java.awt.Point getLastViewPosition()
getLastViewPosition in class Dimensionpublic final void setLastViewPosition(java.awt.Point lastViewPosition)
setLastViewPosition in class Dimensionpublic java.util.List<CustomBiome> getCustomBiomes()
getCustomBiomes in class Dimensionpublic final void setCustomBiomes(java.util.List<CustomBiome> customBiomes)
setCustomBiomes in class Dimensionpublic java.util.Set<Layer> getAllLayers(boolean applyCombinedLayers)
DimensiongetAllLayers in class DimensionapplyCombinedLayers - Whether to include layers from combined layers
     which are not used independently in the dimension.public boolean containsOneOf(Layer... layers)
containsOneOf in class Dimensionpublic java.util.Set<Layer> getMinimumLayers()
DimensiongetMinimumLayers in class Dimensionpublic Dimension.WallType getWallType()
getWallType in class Dimensionpublic final void setWallType(Dimension.WallType wallType)
setWallType in class Dimensionpublic Dimension.WallType getRoofType()
getRoofType in class Dimensionpublic final void setRoofType(Dimension.WallType roofType)
setRoofType in class Dimensionpublic final boolean undoChanges()
undoChanges in class Dimensionpublic Dimension getSnapshot()
DimensiongetSnapshot in class Dimensionpublic int getTopLayerDepth(int x,
                            int y,
                            int z)
getTopLayerDepth in class Dimensionpublic void removeDimensionListener(Dimension.Listener listener)
removeDimensionListener in class Dimensionpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in class Dimensionpublic void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)
removePropertyChangeListener in class Dimensionpublic final void transform(CoordinateTransform transform, org.pepsoft.util.ProgressReceiver progressReceiver) throws org.pepsoft.util.ProgressReceiver.OperationCancelled
Dimensiontransform in class Dimensiontransform - The transform to apply to the tiles and their contents.progressReceiver - An optional progress receiver to which progress
                         of the operation will be reported.org.pepsoft.util.ProgressReceiver.OperationCancelled - If the progress receiver threw an
 OperationCancelled exception indicating that the user wished
 to cancel the operation.public void heightMapChanged(Tile tile)
heightMapChanged in interface Tile.ListenerheightMapChanged in class Dimensionpublic void terrainChanged(Tile tile)
terrainChanged in interface Tile.ListenerterrainChanged in class Dimensionpublic void waterLevelChanged(Tile tile)
waterLevelChanged in interface Tile.ListenerwaterLevelChanged in class Dimensionpublic void seedsChanged(Tile tile)
seedsChanged in interface Tile.ListenerseedsChanged in class Dimensionpublic void layerDataChanged(Tile tile, java.util.Set<Layer> changedLayers)
layerDataChanged in interface Tile.ListenerlayerDataChanged in class Dimensionpublic void allBitLayerDataChanged(Tile tile)
allBitLayerDataChanged in interface Tile.ListenerallBitLayerDataChanged in class Dimensionpublic void allNonBitlayerDataChanged(Tile tile)
allNonBitlayerDataChanged in interface Tile.ListenerallNonBitlayerDataChanged in class Dimensionpublic void addDimensionListener(Dimension.Listener listener)
addDimensionListener in class Dimensionpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in class Dimensionpublic void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)
addPropertyChangeListener in class Dimensionpublic final void applyTheme(int x,
                             int y)
applyTheme in class Dimensionpublic final void applyTheme(java.awt.Point coords)
applyTheme in class Dimensionpublic void unregisterUndoManager()
unregisterUndoManager in class Dimensionpublic void armSavePoint()
armSavePoint in class Dimensionpublic void registerUndoManager(org.pepsoft.util.undo.UndoManager undoManager)
registerUndoManager in class Dimensionpublic boolean isUndoAvailable()
isUndoAvailable in class Dimensionpublic int getHighestX()
getHighestX in class Dimensionpublic int getHighestY()
getHighestY in class Dimensionpublic ExporterSettings getLayerSettings(Layer layer)
getLayerSettings in class Dimensionpublic java.util.Map<Layer,ExporterSettings> getAllLayerSettings()
getAllLayerSettings in class Dimensionpublic int getLowestX()
getLowestX in class Dimensionpublic int getLowestY()
getLowestY in class Dimensionpublic int getFloodedCount(int x,
                           int y,
                           int r,
                           boolean lava)
DimensiongetFloodedCount in class Dimensionx - The global X coordinate of the location around which to count
     flooded blocks.y - The global Y coordinate of the location around which to count
     flooded blocks.r - The radius of the square.lava - Whether to check for lava (when true) or water
     (when false).public final T getTile(int x, int y)
DimensiongetTile in interface TileProvidergetTile in class Dimensionx - The tile X coordinate for which to get the tile.y - The tile Y coordinate for which to get the tile.null if there is no tile for those coordinatespublic T getTile(java.awt.Point coords)
getTiles() must be overridden. These implementations assume a 1:1 coordinate mapping.public java.util.Collection<T> getTiles()
getTile(Point) must be overridden. These implementations assume a 1:1 coordinate mapping.public java.util.Set<java.awt.Point> getTileCoords()
getTileCoords in class Dimensionpublic boolean isEventsInhibited()
isEventsInhibited in class Dimensionpublic final void removeTile(Tile tile)
removeTile in class Dimensionpublic final void setBitLayerValueAt(Layer layer, int x, int y, boolean value)
setBitLayerValueAt in class Dimensionpublic final void setBorder(Dimension.Border border)
public final void setBorderLevel(int borderLevel)
setBorderLevel in class Dimensionpublic final void setBorderSize(int borderSize)
setBorderSize in class Dimensionpublic void changed()
DimensionDimension class itself does not track.public void setEventsInhibited(boolean eventsInhibited)
setEventsInhibited in class Dimensionpublic final void setHeightAt(int x,
                              int y,
                              float height)
setHeightAt in class Dimensionpublic final void setHeightAt(java.awt.Point coords,
                              float height)
setHeightAt in class Dimensionpublic final void setLayerSettings(Layer layer, ExporterSettings settings)
setLayerSettings in class Dimensionpublic final void setLayerValueAt(Layer layer, int x, int y, int value)
setLayerValueAt in class Dimensionpublic final void setMinecraftSeed(long minecraftSeed)
setMinecraftSeed in class Dimensionpublic final void setPopulate(boolean populate)
setPopulate in class Dimensionpublic final void setSubsurfaceMaterial(Terrain subsurfaceMaterial)
setSubsurfaceMaterial in class Dimensionpublic final void setTerrainAt(int x,
                               int y,
                               Terrain terrain)
setTerrainAt in class Dimensionpublic final void setTerrainAt(java.awt.Point coords,
                               Terrain terrain)
setTerrainAt in class Dimensionpublic final void setWaterLevelAt(int x,
                                  int y,
                                  int waterLevel)
setWaterLevelAt in class Dimensionprotected Tile doGetTile(java.awt.Point coords)