20 package net.sf.gridarta.gui.map.renderer;
22 import java.awt.Graphics;
23 import java.awt.Graphics2D;
24 import java.awt.Point;
25 import javax.swing.Icon;
37 import org.jetbrains.annotations.NotNull;
54 private final Point
point =
new Point();
70 public IsoPickmapRenderer(
final int spawnPointTypeNo, @NotNull
final MapViewSettings mapViewSettings, @NotNull
final MapModel<G, A, R> mapModel, @NotNull
final MapGrid mapGrid, @NotNull
final MultiPositionData multiPositionData, @NotNull
final IsoMapSquareInfo isoMapSquareInfo, @NotNull
final GridMapSquarePainter gridMapSquarePainter, @NotNull
final GameObjectParser<G, A, R> gameObjectParser, @NotNull
final Icon
unknownSquareIcon) {
71 super(spawnPointTypeNo, mapViewSettings, mapModel, mapGrid, 0, isoMapSquareInfo.getYLen(),
multiPositionData,
isoMapSquareInfo,
gridMapSquarePainter, gameObjectParser,
unknownSquareIcon);
77 g.setColor(getBackground());
78 g.fillRect(0, 0, getWidth(), getHeight());
83 point.setLocation(square.getMapX(), square.getMapY());
85 int highestSubLayer = 0;
86 for (
int subLayer = 0; subLayer < yOffsets.length; subLayer++) {
87 if (yOffsets[subLayer] < yOffsets[highestSubLayer]) {
88 highestSubLayer = subLayer;
91 for (
final G node : square) {
92 final G head = node.getHead();
95 subLayer = highestSubLayer;
int [] tileStretchingOffsets( @NotNull final Point point, final boolean[] foundSubLayers)
Calculates the tile stretching Y offset.
final MultiPositionData multiPositionData
The MultiPositionData instance to query for multi-part objects.
A MapRenderer that renders isometric squares.
A MapModel reflects the data of a map.
Reading and writing of maps, handling of paths.
static final String LAYER
The name of the "layer" attribute.
final MapGrid mapGrid
The MapGrid to render.
final MapModel< G, A, R > mapModel
The MapModel to render.
Interface for classes that read or write GameObject instances.
Class with constants used in Gridarta and derivates.
static final Color BG_COLOR
Background Color (for the Panels).
final int spawnPointTypeNo
The game object type number of spawn points.
Base package of all Gridarta classes.
final MapViewSettings mapViewSettings
The MapViewSettings instance to use.
void clearBackground(@NotNull final Graphics g)
final IsoMapSquareInfo isoMapSquareInfo
The IsoMapSquareInfo to use.
final Point point
Used for calculations in paintSquare.
Paints overlays for map grids.
static final String SUB_LAYER
The name of the "sub_layer" attribute.
Container for settings that affect the rendering of maps.
GameObjects are the objects based on Archetypes found on maps.
IsoPickmapRenderer(final int spawnPointTypeNo, @NotNull final MapViewSettings mapViewSettings, @NotNull final MapModel< G, A, R > mapModel, @NotNull final MapGrid mapGrid, @NotNull final MultiPositionData multiPositionData, @NotNull final IsoMapSquareInfo isoMapSquareInfo, @NotNull final GridMapSquarePainter gridMapSquarePainter, @NotNull final GameObjectParser< G, A, R > gameObjectParser, @NotNull final Icon unknownSquareIcon)
Creates a new instance.
void paintGameObjectIfVisible( @NotNull final Graphics2D g, final int xStart, final int yStart, @NotNull final G gameObject)
Paints a single game object if it is visible according to current editor settings.
The MultiPositionData class stores an array of numbers which is required in order to calculate displa...
2D-Grid containing flags for selection, pre-selection, cursor, warnings and errors.
final Icon unknownSquareIcon
The Icon drawn into squares without game objects.
Provides information about isometric map squares.
final boolean [] foundSubLayers
Boolean array for tileStretchingOffsets to avoid allocating lots of arrays.
void paintSquare(@NotNull final Graphics2D g, final int x, final int y, @NotNull final MapSquare< G, A, R > square)
boolean isGameObjectVisible(@NotNull final G gameObject)
Default implementation for GameObject implementing classes.
static final long serialVersionUID
Serial Version UID.
A AbstractIsoMapRenderer to render map files.
final GridMapSquarePainter gridMapSquarePainter
The GridMapSquarePainter to use.
Interface for MapArchObjects.