Gridarta Editor
PluginParameterViewFactory.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.plugin.parameter;
21 
22 import java.awt.Component;
43 import org.jetbrains.annotations.NotNull;
44 
49 public class PluginParameterViewFactory<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> {
50 
51  @NotNull
53 
54  @NotNull
56 
57  @NotNull
59 
60  @NotNull
62 
66  @NotNull
68 
72  @NotNull
73  private final PathManager pathManager;
74 
81  public PluginParameterViewFactory(@NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final MapManager<G, A, R> mapManager, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager) {
82  this.archetypeSet = archetypeSet;
83  this.gameObjectAttributesModel = gameObjectAttributesModel;
84  this.objectChooser = objectChooser;
85  this.mapManager = mapManager;
86  this.faceObjectProviders = faceObjectProviders;
87  this.pathManager = pathManager;
88  }
89 
93  @NotNull
94  public PluginParameterView newPluginParameterView(@NotNull final Component parent, @NotNull final PluginParameter<G, A, R, ?> parameter) {
96 
97  @NotNull
98  @Override
99  public PluginParameterView visit(@NotNull final ArchetypeParameter<G, A, R> parameter) {
101  }
102 
103  @NotNull
104  @Override
105  public PluginParameterView visit(@NotNull final BooleanParameter<G, A, R> parameter) {
106  return new BooleanParameterView<>(parent, parameter);
107  }
108 
109  @NotNull
110  @Override
111  public PluginParameterView visit(@NotNull final DoubleParameter<G, A, R> parameter) {
112  return new DoubleParameterView<>(parent, parameter);
113  }
114 
115  @NotNull
116  @Override
117  public PluginParameterView visit(@NotNull final IntegerParameter<G, A, R> parameter) {
118  return new IntegerParameterView<>(parent, parameter);
119  }
120 
121  @NotNull
122  @Override
123  public PluginParameterView visit(@NotNull final MapParameter<G, A, R> parameter) {
124  return new MapParameterView<>(parameter, mapManager);
125  }
126 
127  @NotNull
128  @Override
129  public PluginParameterView visit(@NotNull final MapPathParameter<G, A, R> parameter) {
130  return new MapPathParameterView<>(parent, parameter, pathManager);
131  }
132 
133  @NotNull
134  @Override
135  public PluginParameterView visit(@NotNull final StringParameter<G, A, R> parameter) {
136  return new StringParameterView<>(parameter);
137  }
138 
139  };
140  return parameter.visit(visitor);
141  }
142 
143 }
A PluginParameter that holds a MapControl value.
PluginParameterView newPluginParameterView(@NotNull final Component parent, @NotNull final PluginParameter< G, A, R, ?> parameter)
final PathManager pathManager
The PathManager instance for converting map files.
This class contains methods for converting relative map paths to absolute map paths and vice versa...
A MapManager manages all opened maps.
Definition: MapManager.java:37
Graphical User Interface of Gridarta.
Reading and writing of maps, handling of paths.
A PluginParameter that holds an integer value and a range of valid values.
Interface for views that display plugin parameters.
PluginParameterViewFactory(@NotNull final ArchetypeSet< G, A, R > archetypeSet, @NotNull final GameObjectAttributesModel< G, A, R > gameObjectAttributesModel, @NotNull final ObjectChooser< G, A, R > objectChooser, @NotNull final MapManager< G, A, R > mapManager, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager)
Creates a new instance.
Base package of all Gridarta classes.
A PluginParameter that holds a boolean value.
Reflects a game object (object on a map).
Definition: GameObject.java:36
GameObjects are the objects based on Archetypes found on maps.
A PluginParameter that holds an Archetype value.
Interface for visitors of PluginParameter instances.
A PluginParameter that holds a double value.
Provider for faces of GameObjects and Archetypes.
The face is the appearance of an object.
final FaceObjectProviders faceObjectProviders
The FaceObjectProviders for looking up faces.
A PluginParameterView that displays a MapPathParameter.
Interface that captures similarities between different ArchetypeSet implementations.
Common base interface for ObjectChoosers.
A PluginParameter that holds a path with in the maps directory.
A PluginParameter that holds a string value.