 |
Gridarta Editor
|
Go to the documentation of this file.
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;
final Icon unknownSquareIcon
The Icon drawn into squares without game objects.
A MapModel reflects the data of a map.
Default implementation for GameObject implementing classes.
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.
final MultiPositionData multiPositionData
The MultiPositionData instance to query for multi-part objects.
Base package of all Gridarta classes.
void clearBackground(@NotNull final Graphics g)
int[] tileStretchingOffsets( @NotNull final Point point, final boolean @NotNull[] foundSubLayers)
Calculates the tile stretching Y offset.
final MapGrid mapGrid
The MapGrid to render.
void paintSquare(@NotNull final Graphics2D g, final int x, final int y, @NotNull final MapSquare< G, A, R > square)
Provides information about isometric map squares.
Class with constants used in Gridarta and derivates.
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.
static final String SUB_LAYER
The name of the "sub_layer" attribute.
Container for settings that affect the rendering of maps.
final int spawnPointTypeNo
The game object type number of spawn points.
Paints overlays for map grids.
final MapViewSettings mapViewSettings
The MapViewSettings instance to use.
GameObjects are the objects based on Archetypes found on maps.
final MapModel< G, A, R > mapModel
The MapModel to render.
A AbstractIsoMapRenderer to render map files.
static final Color BG_COLOR
Background Color (for the Panels).
Interface for MapArchObjects.
static final String LAYER
The name of the "layer" attribute.
Reading and writing of maps, handling of paths.
2D-Grid containing flags for selection, pre-selection, cursor, warnings and errors.
int getYLen()
Returns the vertical size of a square.
final IsoMapSquareInfo isoMapSquareInfo
The IsoMapSquareInfo to use.
boolean isGameObjectVisible(@NotNull final G gameObject)
final boolean[] foundSubLayers
Boolean array for tileStretchingOffsets to avoid allocating lots of arrays.
static final long serialVersionUID
Serial Version UID.
final Point point
Used for calculations in paintSquare.
The MultiPositionData class stores an array of numbers which is required in order to calculate displa...
Interface for classes that read or write GameObject instances.
final GridMapSquarePainter gridMapSquarePainter
The GridMapSquarePainter to use.
A MapRenderer that renders isometric squares.