 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.map.mapview;
22 import java.awt.Point;
23 import javax.swing.JScrollPane;
24 import javax.swing.JViewport;
25 import javax.swing.ScrollPaneConstants;
34 import org.jetbrains.annotations.NotNull;
35 import org.jetbrains.annotations.Nullable;
70 public void mapCursorChangedPos(@NotNull
final Point location) {
75 public void mapCursorChangedMode() {
80 public void mapCursorChangedGameObject(@Nullable
final MapSquare<G, A, R> mapSquare, @Nullable
final G gameObject) {
85 public void mapCursorChangedSize() {
103 scrollPane =
new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
109 scrollPane.getVerticalScrollBar().setUnitIncrement(yScrollDistance);
110 scrollPane.getHorizontalScrollBar().setUnitIncrement(xScrollDistance);
111 scrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE);
122 scrollPane.getViewport().setViewPosition(viewPosition);
void ensureVisibleMapCursor()
Makes sure the mapCursor is visible.
Base package of all Gridarta classes.
final MapCursorListener< G, A, R > mapCursorListener
The MapCursorListener attached to mapCursor.
Class with constants used in Gridarta and derivates.
MapCursorTracker(final boolean isPickmap, final int xScrollDistance, final int yScrollDistance, @NotNull final MapCursor< G, A, R > mapCursor, @NotNull final AbstractMapRenderer< G, A, R > renderer)
Creates a new instance.
Reflects a game object (object on a map).
Interface for listeners listening to MapCursor related events.
Graphical User Interface of Gridarta.
Abstract base class for classes implementing MapRenderer.
GameObjects are the objects based on Archetypes found on maps.
static final Color BG_COLOR
Background Color (for the Panels).
Interface for MapArchObjects.
void closeNotify()
Must be called when this instance is not used anymore.
Point getLocation()
Get position of cursor.
void removeMapCursorListener(@NotNull final MapCursorListener< G, A, R > listener)
Remove a MapCursorListener.
MapCursor provides methods to move and drag on map.
JScrollPane getScrollPane()
Returns the JScrollPane of the renderer.
Base classes for rendering maps.
final JScrollPane scrollPane
The JScrollPane for this instance.
final AbstractMapRenderer< G, A, R > renderer
The AbstractMapRenderer to update.
Tracks the MapCursor of map and scrolls the {} so that the map cursor remains visible.
final MapCursor< G, A, R > mapCursor
The MapCursor to track.
void setViewPosition(@NotNull final Point viewPosition)
Sets the view position.