001/*
002 * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
003 * Copyright (C) 2000-2011 The Gridarta Developers.
004 *
005 * This program is free software; you can redistribute it and/or modify
006 * it under the terms of the GNU General Public License as published by
007 * the Free Software Foundation; either version 2 of the License, or
008 * (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU General Public License for more details.
014 *
015 * You should have received a copy of the GNU General Public License along
016 * with this program; if not, write to the Free Software Foundation, Inc.,
017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
018 */
019
020package net.sf.gridarta.gui.map.mapview;
021
022import java.awt.Component;
023import javax.swing.JInternalFrame;
024import javax.swing.JScrollPane;
025import net.sf.gridarta.gui.map.renderer.MapRenderer;
026import net.sf.gridarta.model.archetype.TestArchetype;
027import net.sf.gridarta.model.gameobject.TestGameObject;
028import net.sf.gridarta.model.maparchobject.TestMapArchObject;
029import net.sf.gridarta.model.mapcontrol.MapControl;
030import net.sf.gridarta.model.mapcursor.MapCursor;
031import net.sf.gridarta.model.mapgrid.MapGrid;
032import org.jetbrains.annotations.NotNull;
033
034/**
035 * A {@link MapView} implementation for regression tests.
036 * @author Andreas Kirschbaum
037 */
038public class TestMapView extends AbstractMapView<TestGameObject, TestMapArchObject, TestArchetype> {
039
040    /**
041     * The controller of this view.
042     */
043    @NotNull
044    private final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl;
045
046    /**
047     * Creates a new instance.
048     * @param mapControl the controller of this view
049     * @param mapGrid the map grid for this map view
050     * @param mapCursor the map cursor for this map view
051     */
052    public TestMapView(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl, @NotNull final MapGrid mapGrid, @NotNull final MapCursor<TestGameObject, TestMapArchObject, TestArchetype> mapCursor) {
053        super(mapControl.getMapModel(), mapGrid, mapCursor);
054        this.mapControl = mapControl;
055    }
056
057    /**
058     * {@inheritDoc}
059     */
060    @Override
061    public void closeNotify() {
062    }
063
064    /**
065     * {@inheritDoc}
066     */
067    @NotNull
068    @Override
069    public String getWindowTitle() {
070        return "title";
071    }
072
073    /**
074     * {@inheritDoc}
075     */
076    @NotNull
077    @Override
078    public Component getComponent() {
079        throw new AssertionError();
080    }
081
082    /**
083     * {@inheritDoc}
084     */
085    @NotNull
086    @Override
087    public MapControl<TestGameObject, TestMapArchObject, TestArchetype> getMapControl() {
088        return mapControl;
089    }
090
091    /**
092     * {@inheritDoc}
093     */
094    @Override
095    public void activate() {
096    }
097
098    /**
099     * {@inheritDoc}
100     */
101    @NotNull
102    @Override
103    public JInternalFrame getInternalFrame() {
104        throw new AssertionError();
105    }
106
107    /**
108     * {@inheritDoc}
109     */
110    @NotNull
111    @Override
112    public MapRenderer getRenderer() {
113        throw new AssertionError();
114    }
115
116    /**
117     * {@inheritDoc}
118     */
119    @NotNull
120    @Override
121    public JScrollPane getScrollPane() {
122        throw new AssertionError();
123    }
124
125}