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-2015 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 org.jetbrains.annotations.NotNull;
30 
35 public interface MapRenderer {
36 
41  @NotNull
42  BufferedImage getFullImage();
43 
50  boolean getSquareLocationAt(@NotNull Point point, @NotNull Point retPoint);
51 
55  void forceRepaint();
56 
62  void printFullImage(@NotNull File file) throws IOException;
63 
68  void addMouseMotionListener(@NotNull MouseMotionListener mouseMotionListener);
69 
74  void removeMouseMotionListener(@NotNull MouseMotionListener mouseMotionListener);
75 
76  void addMouseListener(@NotNull MouseListener l);
77 
78  void removeMouseListener(@NotNull MouseListener l);
79 
85  @NotNull
86  Rectangle getSquareBounds(@NotNull Point p);
87 
92  void scrollRectToVisible(@NotNull Rectangle aRect);
93 
98  void setLightVisible(boolean lightVisible);
99 
100 }
void printFullImage(@NotNull File file)
Saves an image of the entire view to a file.
Rectangle getSquareBounds(@NotNull Point p)
Returns coordinates, length and width of map square.
BufferedImage getFullImage()
Returns an image of the entire map view.
void removeMouseMotionListener(@NotNull MouseMotionListener mouseMotionListener)
Removes a MouseMotionListener to be notified about mouse events.
void removeMouseListener(@NotNull MouseListener l)
void addMouseListener(@NotNull MouseListener l)
boolean getSquareLocationAt(@NotNull Point point, @NotNull Point retPoint)
Returns the map location at the given point.
Common interface for renderers of map control instances.
void setLightVisible(boolean lightVisible)
If set, inverts the setting of net.sf.gridarta.model.mapviewsettings.MapViewSettings#isLightVisible()...
void forceRepaint()
Repaint the view because some view parameters may have changed.
void addMouseMotionListener(@NotNull MouseMotionListener mouseMotionListener)
Adds a MouseMotionListener to be notified about mouse events.
void scrollRectToVisible(@NotNull Rectangle aRect)
Ensures that a rectangular area is visible.