Gridarta Editor
NewMapDialogFactory.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.dialog.newmap;
21 
22 import java.awt.Component;
32 import org.jetbrains.annotations.NotNull;
33 import org.jetbrains.annotations.Nullable;
34 
39 public class NewMapDialogFactory<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> {
40 
44  @NotNull
46 
50  @NotNull
52 
56  private final int defaultMapWidth;
57 
61  private final int defaultMapHeight;
62 
66  private final int defaultMapDifficulty;
67 
71  private final boolean showMapDifficulty;
72 
76  private final boolean showMapSizeDefault;
77 
81  private final int defaultPickmapWidth;
82 
86  private final int defaultPickmapHeight;
87 
91  @NotNull
93 
97  @NotNull
99 
103  @NotNull
104  private final Component parent;
105 
121  public NewMapDialogFactory(@NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, final int defaultMapWidth, final int defaultMapHeight, final int defaultMapDifficulty, final boolean showMapDifficulty, final boolean showMapSizeDefault, final int defaultPickmapWidth, final int defaultPickmapHeight, @NotNull final PickmapChooserView<G, A, R> pickmapChooserView, @NotNull final Component parent) {
122  this.mapViewsManager = mapViewsManager;
123  this.mapArchObjectFactory = mapArchObjectFactory;
124  this.defaultMapWidth = defaultMapWidth;
125  this.defaultMapHeight = defaultMapHeight;
126  this.defaultMapDifficulty = defaultMapDifficulty;
127  this.showMapSizeDefault = showMapSizeDefault;
128  this.showMapDifficulty = showMapDifficulty;
129  this.defaultPickmapWidth = defaultPickmapWidth;
130  this.defaultPickmapHeight = defaultPickmapHeight;
131  this.pickmapChooserView = pickmapChooserView;
132  this.parent = parent;
133  }
134 
135  @Deprecated
136  public void setObjectChooser(@NotNull final ObjectChooser<G, A, R> objectChooser) {
137  this.objectChooser = objectChooser;
138  }
139 
143  public void showNewMapDialog() {
145  }
146 
150  public void showNewPickmapDialog() {
152  }
153 
159  public void showNewPickmapFolderDialog(@NotNull final MapFolderTree<G, A, R> mapFolderTree, @Nullable final MapFolder<G, A, R> parent) {
160  new NewPickmapFolderDialog<>(this.parent, mapFolderTree, parent, mapViewsManager);
161  }
162 
163 }
Graphical User Interface of Gridarta.
final int defaultMapHeight
The default height for new maps.
NewMapDialogFactory(@NotNull final MapViewsManager< G, A, R > mapViewsManager, @NotNull final MapArchObjectFactory< A > mapArchObjectFactory, final int defaultMapWidth, final int defaultMapHeight, final int defaultMapDifficulty, final boolean showMapDifficulty, final boolean showMapSizeDefault, final int defaultPickmapWidth, final int defaultPickmapHeight, @NotNull final PickmapChooserView< G, A, R > pickmapChooserView, @NotNull final Component parent)
Creates a new instance.
Factory for creating MapArchObject instances.
void showNewMapDialog()
Shows a dialog for creating a new map.
final PickmapChooserView< G, A, R > pickmapChooserView
The pickmap chooser control.
final int defaultMapDifficulty
The default difficulty for new maps.
void showNewPickmapDialog()
Shows a dialog for creating a new pickmap.
Base package of all Gridarta classes.
void showNewPickmapFolderDialog(@NotNull final MapFolderTree< G, A, R > mapFolderTree, @Nullable final MapFolder< G, A, R > parent)
Shows a dialog for creating a new pickmap folder.
Reflects a game object (object on a map).
Definition: GameObject.java:36
final MapArchObjectFactory< A > mapArchObjectFactory
The gridarta objects factory instance.
final boolean showMapSizeDefault
Whether to show the "mapDifficulty" field.
GameObjects are the objects based on Archetypes found on maps.
final int defaultPickmapWidth
The default width for new pickmaps.
Dialog to create a new map file.
final int defaultPickmapHeight
The default height for new pickmaps.
Base classes for rendering maps.
Classes implementing the pickmap chooser.
Utility class to create NewMapDialog instances.
final MapViewsManager< G, A, R > mapViewsManager
The MapViewsManager to use.
final boolean showMapDifficulty
Whether to show the "mapSizeDefault" checkbox.
Common base interface for ObjectChoosers.
ObjectChooser< G, A, R > objectChooser
The object chooser instance.
void setObjectChooser(@NotNull final ObjectChooser< G, A, R > objectChooser)
final int defaultMapWidth
The default width for new maps.
Model class representing a folder of MapFiles.
Definition: MapFolder.java:47
final Component parent
The parent component for dialog windows.