Gridarta Editor
MapRenderer.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2023 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.gui.map.renderer;
21 
22 import java.awt.Point;
23 import java.awt.Rectangle;
24 import java.awt.event.MouseListener;
25 import java.awt.event.MouseMotionListener;
26 import java.awt.image.BufferedImage;
27 import java.io.File;
28 import java.io.IOException;
29 import net.sf.gridarta.utils.Size2D;
30 import org.jetbrains.annotations.NotNull;
31 
36 public interface MapRenderer {
37 
42  @NotNull
44 
49  @NotNull
50  BufferedImage getFullImage();
51 
58  boolean getSquareLocationAt(@NotNull Point point, @NotNull Point retPoint);
59 
63  void forceRepaint();
64 
70  void printFullImage(@NotNull File file) throws IOException;
71 
76  void addMouseMotionListener(@NotNull MouseMotionListener mouseMotionListener);
77 
82  void removeMouseMotionListener(@NotNull MouseMotionListener mouseMotionListener);
83 
84  void addMouseListener(@NotNull MouseListener l);
85 
86  void removeMouseListener(@NotNull MouseListener l);
87 
93  @NotNull
94  Rectangle getSquareBounds(@NotNull Point p);
95 
100  void scrollRectToVisible(@NotNull Rectangle aRect);
101 
106  void setLightVisible(boolean lightVisible);
107 
108 }
net.sf.gridarta.gui.map.renderer.MapRenderer.setLightVisible
void setLightVisible(boolean lightVisible)
If set, inverts the setting of net.sf.gridarta.model.mapviewsettings.MapViewSettings#isLightVisible()...
net.sf.gridarta.gui.map.renderer.MapRenderer.addMouseMotionListener
void addMouseMotionListener(@NotNull MouseMotionListener mouseMotionListener)
Adds a MouseMotionListener to be notified about mouse events.
net.sf.gridarta.gui.map.renderer.MapRenderer.getImageSize
Size2D getImageSize()
Returns the size of an image of the entire map view in pixels.
net.sf.gridarta
Base package of all Gridarta classes.
net.sf
net.sf.gridarta.gui.map.renderer.MapRenderer.scrollRectToVisible
void scrollRectToVisible(@NotNull Rectangle aRect)
Ensures that a rectangular area is visible.
net.sf.gridarta.gui.map.renderer.MapRenderer.addMouseListener
void addMouseListener(@NotNull MouseListener l)
net
net.sf.gridarta.gui.map.renderer.MapRenderer.forceRepaint
void forceRepaint()
Repaint the view because some view parameters may have changed.
net.sf.gridarta.gui.map.renderer.MapRenderer.removeMouseListener
void removeMouseListener(@NotNull MouseListener l)
net.sf.gridarta.gui.map.renderer.MapRenderer.getSquareBounds
Rectangle getSquareBounds(@NotNull Point p)
Returns coordinates, length and width of map square.
net.sf.gridarta.gui.map.renderer.MapRenderer.getFullImage
BufferedImage getFullImage()
Returns an image of the entire map view.
net.sf.gridarta.gui.map.renderer.MapRenderer
Common interface for renderers of map control instances.
Definition: MapRenderer.java:36
net.sf.gridarta.gui.map.renderer.MapRenderer.removeMouseMotionListener
void removeMouseMotionListener(@NotNull MouseMotionListener mouseMotionListener)
Removes a MouseMotionListener to be notified about mouse events.
net.sf.gridarta.utils.Size2D
The class Size2D represents a 2d rectangular area.
Definition: Size2D.java:30
net.sf.gridarta.gui.map.renderer.MapRenderer.printFullImage
void printFullImage(@NotNull File file)
Saves an image of the entire view to a file.
net.sf.gridarta.utils
Definition: ActionBuilderUtils.java:20
net.sf.gridarta.gui.map.renderer.MapRenderer.getSquareLocationAt
boolean getSquareLocationAt(@NotNull Point point, @NotNull Point retPoint)
Returns the map location at the given point.