Gridarta Editor
SelectedSquareView.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2023 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.panel.selectedsquare;
21 
22 import java.awt.BorderLayout;
23 import java.awt.Color;
24 import java.awt.Container;
25 import java.awt.FlowLayout;
26 import java.awt.GridLayout;
27 import java.awt.Insets;
28 import java.awt.Point;
29 import java.awt.event.InputEvent;
30 import java.awt.event.MouseAdapter;
31 import java.awt.event.MouseEvent;
32 import java.awt.event.MouseListener;
33 import java.awt.geom.RectangularShape;
34 import java.util.Set;
35 import javax.swing.AbstractButton;
36 import javax.swing.Action;
37 import javax.swing.DefaultListModel;
38 import javax.swing.Icon;
39 import javax.swing.ImageIcon;
40 import javax.swing.JButton;
41 import javax.swing.JLabel;
42 import javax.swing.JList;
43 import javax.swing.JPanel;
44 import javax.swing.JScrollPane;
45 import javax.swing.JViewport;
46 import javax.swing.ListSelectionModel;
47 import javax.swing.ScrollPaneConstants;
48 import javax.swing.event.ListSelectionListener;
67 import net.sf.gridarta.utils.Size2D;
68 import org.jetbrains.annotations.NotNull;
69 import org.jetbrains.annotations.Nullable;
70 
80 public class SelectedSquareView<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends JPanel {
81 
85  private static final long serialVersionUID = 1L;
86 
90  @NotNull
92 
96  @NotNull
98 
102  @NotNull
104 
108  @NotNull
110 
114  @NotNull
116 
120  @NotNull
121  private final DefaultListModel<G> model = new DefaultListModel<>();
122 
126  @NotNull
127  private final JList<G> list = new JList<>(model);
128 
132  @NotNull
133  private final Container arrows = new JPanel();
134 
138  @Nullable
140 
145  @Nullable
147 
151  @NotNull
153 
154  @Override
155  public void mapSizeChanged(@NotNull final Size2D newSize) {
156  refresh();
157  }
158 
159  @Override
160  public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) {
161  if (selectedSquareModel.isSelectedMapSquares(mapSquares)) {
162  refresh();
163  }
164  }
165 
166  @Override
167  public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) {
168  if (selectedSquareModel.isSelectedGameObjects(gameObjects) || selectedSquareModel.isSelectedGameObjects(transientGameObjects)) {
169  refresh();
170  }
171  }
172 
173  @Override
174  public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) {
175  // ignore
176  }
177 
178  @Override
179  public void mapFileChanged(@Nullable final MapFile oldMapFile) {
180  // ignore
181  }
182 
183  @Override
184  public void modifiedChanged() {
185  // ignore
186  }
187 
188  };
189 
193  @NotNull
195 
196  @Override
197  public void activeMapViewChanged(@Nullable final MapView<G, A, R> mapView) {
198  @Nullable final MapModel<G, A, R> mapModel;
199  @Nullable final MapCursor<G, A, R> mapCursor;
200  if (mapView == null) {
201  mapModel = null;
202  mapCursor = null;
203  } else {
204  mapModel = mapView.getMapControl().getMapModel();
205  mapCursor = mapView.getMapCursor();
206  }
208  }
209 
210  @Override
211  public void mapViewCreated(@NotNull final MapView<G, A, R> mapView) {
212  // ignore
213  }
214 
215  @Override
216  public void mapViewClosing(@NotNull final MapView<G, A, R> mapView) {
217  // ignore
218  }
219 
220  };
221 
226  @NotNull
227  private final SelectedSquareModelListener<G, A, R> selectedSquareModelListener = (mapSquare, gameObject) -> refresh();
228 
233  @NotNull
234  private final ListSelectionListener listSelectionListener = e -> setSelectedIndex(list.getSelectedIndex());
235 
239  @NotNull
241 
242  @Override
243  public void mapCursorChangedPos(@NotNull final Point location) {
244  // ignore
245  }
246 
247  @Override
248  public void mapCursorChangedMode() {
249  // ignore
250  }
251 
252  @Override
253  public void mapCursorChangedGameObject(@Nullable final MapSquare<G, A, R> mapSquare, @Nullable final G gameObject) {
254  if (selectedSquareModel.setSelectedMapSquare(mapSquare, gameObject)) {
255  refresh();
256  }
257  }
258 
259  @Override
260  public void mapCursorChangedSize() {
261  // ignore
262  }
263 
264  };
265 
270  @NotNull
271  private final MouseListener mouseListener = new MouseAdapter() {
272 
273  @Override
274  public void mousePressed(final MouseEvent e) {
275  if (isSelect(e)) {
276  if (e.getClickCount() > 1) { // LMB Double click
277  final G gameObject = selectedSquareModel.getSelectedGameObject();
278  if (gameObject != null) {
280  }
281  }
282  } else if (isInsert(e)) {
284  } else if (isDelete(e)) {
286  }
287  }
288 
289  };
290 
306  public SelectedSquareView(@NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final MapViewSettings mapViewSettings, @Nullable final ImageIcon compassIcon, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final Icon unknownSquareIcon, @NotNull final Action... actions) {
307  this.selectedSquareModel = selectedSquareModel;
308  this.gameObjectAttributesDialogFactory = gameObjectAttributesDialogFactory;
309  this.objectChooser = objectChooser;
310  this.mapViewSettings = mapViewSettings;
311 
312  setLayout(new BorderLayout());
313 
315  list.setCellRenderer(new CellRenderer<G, A, R>(faceObjectProviders, unknownSquareIcon));
316  list.setBackground(Color.lightGray);
317  list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
318  final JScrollPane scrollPane = new JScrollPane(list);
319  scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
320  scrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE);
321  add(scrollPane, BorderLayout.CENTER);
322 
323  for (final Action tmpAction : actions) {
324  final AbstractButton button = new JButton(tmpAction);
325  button.setMargin(new Insets(0, 0, 0, 0));
326  arrows.add(button);
327  }
328 
329  updateArrows(false);
330  if (compassIcon != null) {
331  final Container compass = new JPanel();
332  compass.add(new JLabel(compassIcon));
333  add(compass, BorderLayout.NORTH);
334  }
335  list.addListSelectionListener(listSelectionListener);
336  list.addMouseListener(mouseListener);
337  list.setFocusable(false); // XXX Workaround for Mantis #0000154 This is not clean and should be removed as soon as cut/copy/paste of arches is possible
338 
339  mapViewManager.addMapViewManagerListener(mapViewManagerListener);
341 
342  refresh();
343  }
344 
350  private void updateArrows(final boolean mapSquareListBottom) {
351  if (mapSquareListBottom) {
352  arrows.setLayout(new GridLayout(4, 1));
353  add(arrows, BorderLayout.WEST); // put up/down buttons west
354  } else {
355  arrows.setLayout(new FlowLayout());
356  add(arrows, BorderLayout.SOUTH); // put up/down buttons south
357  }
358  }
359 
368  private int getListIndex(@NotNull final MouseEvent e) {
369  final int lastIndex = model.getSize() - 1;
370  if (lastIndex < 0) {
371  return 0;
372  }
373 
374  final RectangularShape bounds = list.getCellBounds(lastIndex, lastIndex);
375  final int lowestY = (int) (bounds.getY() + bounds.getHeight());
376  if ((int) e.getPoint().getY() >= lowestY) {
377  return lastIndex + 1;
378  }
379 
380  final int listIndex = list.locationToIndex(e.getPoint());
381  assert listIndex >= 0; // -1 is returned only if the list is empty, but this was already checked
382  return listIndex;
383  }
384 
390  private void refresh() {
391  list.setEnabled(false);
392  try {
394  } finally {
395  list.setEnabled(true);
396  }
397  }
398 
404  @Nullable
405  private G getListGameObject(final int index) {
406  final int actualIndex = getValidIndex(index);
407  return actualIndex >= model.getSize() ? null : model.getElementAt(actualIndex);
408  }
409 
415  private void setSelectedIndex(final int index) {
416  final int actualIndex = getValidIndex(index);
417  if (list.getSelectedIndex() != actualIndex) {
418  list.setSelectedIndex(actualIndex);
419  }
420 
421  if (mapCursor != null) {
422  mapCursor.setGameObject(list.getSelectedValue());
423  }
424  }
425 
431  private int getValidIndex(final int index) {
432  if (index < 0) {
433  return 0;
434  }
435  final int size = model.getSize();
436  return index < size ? index : Math.max(0, size - 1);
437  }
438 
443  private void deleteGameObject(final int index) {
445  if (mapCursor != null && index < model.getSize()) {
446  setSelectedIndex(index);
448  }
449  }
450 
455  private void insertGameObject(final int index) {
457  if (gameObject != null) {
459  if (mapCursor != null) {
460  mapCursor.insertGameObject(true, gameObject, index >= model.getSize(), mapViewSettings.isAutojoin());
461  }
462  }
463  setSelectedIndex(index);
464  }
465 
471  private static boolean isSelect(@NotNull final InputEvent e) {
472  return (e.getModifiers() & InputEvent.BUTTON1_MASK) != 0;
473  }
474 
480  private static boolean isInsert(@NotNull final InputEvent e) {
481  return (e.getModifiers() & (InputEvent.BUTTON3_MASK | InputEvent.CTRL_MASK)) == InputEvent.BUTTON3_MASK;
482  }
483 
489  private static boolean isDelete(@NotNull final InputEvent e) {
490  return (e.getModifiers() & InputEvent.BUTTON2_MASK) != 0 || (e.getModifiers() & (InputEvent.BUTTON3_MASK | InputEvent.CTRL_MASK)) == (InputEvent.BUTTON3_MASK | InputEvent.CTRL_MASK);
491  }
492 
493  private void setMapCursor(@Nullable final MapModel<G, A, R> mapModel, @Nullable final MapCursor<G, A, R> mapCursor) {
494  if (this.mapModel != null) {
495  this.mapModel.removeMapModelListener(mapModelListener);
496  }
497  this.mapModel = mapModel;
498  if (this.mapModel != null) {
499  this.mapModel.addMapModelListener(mapModelListener);
500  }
501 
502  if (this.mapCursor != null) {
503  this.mapCursor.removeMapCursorListener(mapCursorListener);
504  }
505  this.mapCursor = mapCursor;
506  if (this.mapCursor != null) {
507  this.mapCursor.addMapCursorListener(mapCursorListener);
508  }
509 
510  final G gameObject = mapCursor == null ? null : mapCursor.getGameObject();
511  final MapSquare<G, A, R> mapSquare = gameObject == null ? null : gameObject.getMapSquareOptional();
512  if (selectedSquareModel.setSelectedMapSquare(mapSquare, gameObject)) {
513  refresh();
514  }
515  }
516 
517 }
net.sf.gridarta.model.mapmodel.MapModel
A MapModel reflects the data of a map.
Definition: MapModel.java:75
net.sf.gridarta.gui.panel
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.refresh
void refresh()
Re-displays the map square panel for SelectedSquareModel#getSelectedMapSquare().
Definition: SelectedSquareView.java:390
net.sf.gridarta.model.mapmodel.MapSquare.getMapSquareOptional
MapSquare< G, A, R > getMapSquareOptional()
Returns the MapSquare this game object is part of.
Definition: MapSquare.java:156
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.list
final JList< G > list
The list of game objects.
Definition: SelectedSquareView.java:127
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.deleteGameObject
void deleteGameObject(final int index)
Deletes a GameObject with a specific list index.
Definition: SelectedSquareView.java:443
net.sf.gridarta
Base package of all Gridarta classes.
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.updateArrows
void updateArrows(final boolean mapSquareListBottom)
Updates the parameters of the arrows buttons.
Definition: SelectedSquareView.java:350
net.sf.gridarta.model.mapmodel.MapSquare
A single Map Square.
Definition: MapSquare.java:45
net.sf.gridarta.gui.dialog.gameobjectattributes.GameObjectAttributesDialogFactory.showAttributeDialog
void showAttributeDialog(@NotNull final G gameObject)
Shows the game object attributes dialog for a given GameObject instance.
Definition: GameObjectAttributesDialogFactory.java:217
net.sf.gridarta.model.mapviewsettings
Definition: AbstractMapViewSettings.java:20
net.sf.gridarta.gui.map.mapview.MapViewManager
Maintains all map views.
Definition: MapViewManager.java:38
net.sf
net.sf.gridarta.model.mapcursor.MapCursor.getGameObject
G getGameObject()
Returns the selected GameObject.
Definition: MapCursor.java:437
net.sf.gridarta.model.mapviewsettings.MapViewSettings.isAutojoin
boolean isAutojoin()
Returns whether "autojoin" is enabled.
net.sf.gridarta.model.mapmodel
Definition: AboveFloorInsertionMode.java:20
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.mapViewManagerListener
final MapViewManagerListener< G, A, R > mapViewManagerListener
The map view manager listener.
Definition: SelectedSquareView.java:194
net.sf.gridarta.gui.map.mapview.MapViewManagerListener
Interface for listeners interested in events related to {} instances.
Definition: MapViewManagerListener.java:33
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.insertGameObject
void insertGameObject(final int index)
Inserts a new game object.
Definition: SelectedSquareView.java:455
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.selectedSquareModelListener
final SelectedSquareModelListener< G, A, R > selectedSquareModelListener
The SelectedSquareModelListener attached to {}.
Definition: SelectedSquareView.java:227
net.sf.gridarta.model.archetype
Definition: AbstractArchetype.java:20
net.sf.gridarta.model.face.FaceObjectProviders
Provider for faces of GameObjects and Archetypes.
Definition: FaceObjectProviders.java:46
net.sf.gridarta.model.gameobject.GameObject
Reflects a game object (object on a map).
Definition: GameObject.java:36
net.sf.gridarta.model.mapviewsettings.MapViewSettings
Container for settings that affect the rendering of maps.
Definition: MapViewSettings.java:30
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.mapCursorListener
final MapCursorListener< G, A, R > mapCursorListener
The MapCursorListener attached to mapCursor.
Definition: SelectedSquareView.java:240
net.sf.gridarta.model.mapmodel.MapModel.addMapModelListener
void addMapModelListener(@NotNull MapModelListener< G, A, R > listener)
Register a map listener.
net.sf.gridarta.model.mapcursor.MapCursorListener
Interface for listeners listening to MapCursor related events.
Definition: MapCursorListener.java:36
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.getListGameObject
G getListGameObject(final int index)
Returns a game object from the list.
Definition: SelectedSquareView.java:405
net.sf.gridarta.model.mapcursor.MapCursor.setGameObject
void setGameObject(@Nullable final G gameObject)
Sets the selected GameObject.
Definition: MapCursor.java:446
net.sf.gridarta.model.mapcursor.MapCursor.deleteSelectedGameObject
boolean deleteSelectedGameObject(final boolean performAction, final boolean autoJoin)
Deletes the selected game object.
Definition: MapCursor.java:658
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareModel.isSelectedGameObjects
boolean isSelectedGameObjects(@NotNull final Iterable< G > gameObjects)
Definition: SelectedSquareModel.java:117
net.sf.gridarta.gui.panel.selectedsquare.ModelUpdater.update
int update(@Nullable final GameObjectContainer< G, A, R > mapSquare, @Nullable final G gameObject)
Updates the model to reflect a net.sf.gridarta.model.mapmodel.MapSquare.
Definition: ModelUpdater.java:74
net.sf.gridarta.gui
Graphical User Interface of Gridarta.
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.selectedSquareModel
final SelectedSquareModel< G, A, R > selectedSquareModel
The model for this view.
Definition: SelectedSquareView.java:91
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.isSelect
static boolean isSelect(@NotNull final InputEvent e)
Determines if "select" was selected.
Definition: SelectedSquareView.java:471
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.setSelectedIndex
void setSelectedIndex(final int index)
Sets the currently selected list index.
Definition: SelectedSquareView.java:415
net.sf.gridarta.gui.panel.objectchooser
Definition: DefaultObjectChooser.java:20
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView
The panel that displays the game objects of the currently selected map square.
Definition: SelectedSquareView.java:80
net.sf.gridarta.model.gameobject
GameObjects are the objects based on Archetypes found on maps.
Definition: AbstractGameObject.java:20
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareModel.setSelectedMapSquare
boolean setSelectedMapSquare(@Nullable final MapSquare< G, A, R > mapSquare, @Nullable final G gameObject)
Sets the currently selected map square.
Definition: SelectedSquareModel.java:141
net
errors
errors
Definition: ArchetypeTypeSetParserTest-ignoreDefaultAttribute1-result.txt:1
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareModelListener< G, A, R >
net.sf.gridarta.model.maparchobject.MapArchObject
Interface for MapArchObjects.
Definition: MapArchObject.java:40
net.sf.gridarta.model.mapcursor.MapCursor.insertGameObject
boolean insertGameObject(final boolean performAction, @NotNull final BaseObject< G, A, R, ?> gameObject, final boolean insertAtEnd, final boolean join)
Inserts a GameObject before the selected game object.
Definition: MapCursor.java:631
net.sf.gridarta.gui.map.mapview
Definition: AbstractMapView.java:20
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareModel< G, A, R >
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.getListIndex
int getListIndex(@NotNull final MouseEvent e)
Determines the list index for a given mouse event.
Definition: SelectedSquareView.java:368
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.gameObjectAttributesDialogFactory
final GameObjectAttributesDialogFactory< G, A, R > gameObjectAttributesDialogFactory
The factory for creating game object attributes dialog instances.
Definition: SelectedSquareView.java:103
net.sf.gridarta.model.validation.ErrorCollector
An interface for classes that collect errors.
Definition: ErrorCollector.java:33
net.sf.gridarta.gui.map.mapview.MapView
A map view consists of a map grid and a map cursor, and is attached to a map control.
Definition: MapView.java:43
net.sf.gridarta.gui.panel.objectchooser.ObjectChooser.getSelection
BaseObject< G, A, R, ?> getSelection()
Returns the active arch in the left-side panel.
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.SelectedSquareView
SelectedSquareView(@NotNull final SelectedSquareModel< G, A, R > selectedSquareModel, @NotNull final GameObjectAttributesDialogFactory< G, A, R > gameObjectAttributesDialogFactory, @NotNull final ObjectChooser< G, A, R > objectChooser, @NotNull final MapViewManager< G, A, R > mapViewManager, @NotNull final MapViewSettings mapViewSettings, @Nullable final ImageIcon compassIcon, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final Icon unknownSquareIcon, @NotNull final Action... actions)
Creates a new instance.
Definition: SelectedSquareView.java:306
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.listSelectionListener
final ListSelectionListener listSelectionListener
The listener attached to list to be informed about selection changes.
Definition: SelectedSquareView.java:234
net.sf.gridarta.model.validation
This package contains the framework for validating maps.
Definition: AbstractValidator.java:20
net.sf.gridarta.model.mapcursor.MapCursor
MapCursor provides methods to move and drag on map.
Definition: MapCursor.java:58
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.mapCursor
MapCursor< G, A, R > mapCursor
The currently tracked MapCursor.
Definition: SelectedSquareView.java:146
net.sf.gridarta.model.baseobject.BaseObject
Definition: BaseObject.java:34
net.sf.gridarta.gui.dialog.gameobjectattributes
Definition: ArchetypeTypeListCellRenderer.java:20
net.sf.gridarta.gui.dialog
net.sf.gridarta.model.mapmodel.MapFile
The location of a map file with a map directory.
Definition: MapFile.java:31
net.sf.gridarta.gui.panel.objectchooser.ObjectChooser
Common base interface for ObjectChoosers.
Definition: ObjectChooser.java:34
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.arrows
final Container arrows
The arrow buttons.
Definition: SelectedSquareView.java:133
net.sf.gridarta.gui.dialog.gameobjectattributes.GameObjectAttributesDialogFactory
A factory that creates dialogs for editing game object attributes.
Definition: GameObjectAttributesDialogFactory.java:54
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.getValidIndex
int getValidIndex(final int index)
Determines a valid list index near a given index.
Definition: SelectedSquareView.java:431
net.sf.gridarta.model.mapcursor.MapCursor.addMapCursorListener
void addMapCursorListener(@NotNull final MapCursorListener< G, A, R > listener)
Register a MapCursorListener.
Definition: MapCursor.java:419
net.sf.gridarta.model.mapmodel.MapModelListener
Interface for listeners listening on MapModel events.
Definition: MapModelListener.java:36
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareModel.addSelectedSquareListener
void addSelectedSquareListener(@NotNull final SelectedSquareModelListener< G, A, R > listener)
Adds a SelectedSquareModelListener to be notified.
Definition: SelectedSquareModel.java:79
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.mapModel
MapModel< G, A, R > mapModel
The currently active MapModel.
Definition: SelectedSquareView.java:139
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.mapViewSettings
final MapViewSettings mapViewSettings
The MapViewSettings instance.
Definition: SelectedSquareView.java:115
net.sf.gridarta.model
net.sf.gridarta.model.archetype.Archetype
Reflects an Archetype.
Definition: Archetype.java:41
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.model
final DefaultListModel< G > model
The DefaultListModel of list.
Definition: SelectedSquareView.java:121
net.sf.gridarta.gui.panel.selectedsquare.CellRenderer
CellRenderer for rendering ArchObjects on a certain map square in a list.
Definition: CellRenderer.java:37
net.sf.gridarta.model.baseobject
Definition: AbstractBaseObject.java:20
net.sf.gridarta.gui.map
Base classes for rendering maps.
Definition: AbstractPerMapDialogManager.java:20
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.mouseListener
final MouseListener mouseListener
The MouseListener attached to the view to process mouse actions.
Definition: SelectedSquareView.java:271
net.sf.gridarta.model.face
The face is the appearance of an object.
Definition: AbstractFaceObjects.java:20
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareModel.isSelectedMapSquares
boolean isSelectedMapSquares(@NotNull final Iterable< MapSquare< G, A, R >> mapSquares)
Definition: SelectedSquareModel.java:102
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.mapModelListener
final MapModelListener< G, A, R > mapModelListener
The MapModelListener attached to mapModel.
Definition: SelectedSquareView.java:152
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareModel.getSelectedGameObject
G getSelectedGameObject()
Returns the currently selected GameObject within this list (currently selected MapSquare).
Definition: SelectedSquareModel.java:71
net.sf.gridarta.model.maparchobject
Definition: AbstractMapArchObject.java:20
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.serialVersionUID
static final long serialVersionUID
Serial Version UID.
Definition: SelectedSquareView.java:85
net.sf.gridarta.model.mapcursor
Definition: MapCursor.java:20
net.sf.gridarta.utils.Size2D
The class Size2D represents a 2d rectangular area.
Definition: Size2D.java:30
net.sf.gridarta.gui.panel.selectedsquare.ModelUpdater< G, A, R >
net.sf.gridarta.utils
Definition: ActionBuilderUtils.java:20
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareModel.getSelectedMapSquare
MapSquare< G, A, R > getSelectedMapSquare()
Returns the currently selected map square.
Definition: SelectedSquareModel.java:61
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.isDelete
static boolean isDelete(@NotNull final InputEvent e)
Determines if "delete" was selected.
Definition: SelectedSquareView.java:489
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.modelUpdater
final ModelUpdater< G, A, R > modelUpdater
The ModelUpdater used for updating model.
Definition: SelectedSquareView.java:97
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.objectChooser
final ObjectChooser< G, A, R > objectChooser
The object chooser.
Definition: SelectedSquareView.java:109
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.isInsert
static boolean isInsert(@NotNull final InputEvent e)
Determines if "insert" was selected.
Definition: SelectedSquareView.java:480
net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView.setMapCursor
void setMapCursor(@Nullable final MapModel< G, A, R > mapModel, @Nullable final MapCursor< G, A, R > mapCursor)
Definition: SelectedSquareView.java:493