Gridarta Editor
FaceTab.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.gameobjectattributes;
21 
22 import java.awt.Component;
23 import java.awt.Container;
24 import java.awt.GridBagConstraints;
25 import java.awt.GridBagLayout;
26 import javax.swing.AbstractButton;
27 import javax.swing.ImageIcon;
28 import javax.swing.JCheckBox;
29 import javax.swing.JComponent;
30 import javax.swing.JPanel;
31 import javax.swing.JTextField;
32 import javax.swing.border.TitledBorder;
33 import javax.swing.text.JTextComponent;
49 import net.sf.japi.swing.action.ActionBuilder;
50 import net.sf.japi.swing.action.ActionBuilderFactory;
51 import org.jetbrains.annotations.NotNull;
52 import org.jetbrains.annotations.Nullable;
53 
59 public class FaceTab<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractGameObjectAttributesTab<G, A, R> {
60 
64  @NotNull
65  private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta");
66 
70  @NotNull
72 
76  @NotNull
78 
82  @NotNull
84 
88  @NotNull
90 
94  @NotNull
95  private final AbstractButton animatedCheckBox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "faceIsAnimated"));
96 
100  @NotNull
101  private final JTextComponent animSpeedTextField = new JTextField();
102 
106  @NotNull
107  private final JPanel panel = new JPanel();
108 
113  @NotNull
115 
119  private static final long serialVersionUID = 1L;
120 
121  @Override
122  protected void direction(@Nullable final Integer direction) {
123  final int dir = direction == null ? 0 : direction;
124  final GameObject<?, ?, ?> gameObject = getSelectedGameObject();
125  if (gameObject != null) {
126  final MapSquare<?, ?, ?> mapSquare = gameObject.getMapSquareOptional();
127  if (mapSquare != null) {
128  final MapModel<?, ?, ?> mapModel = mapSquare.getMapModel();
129  mapModel.beginTransaction("Change object attributes");
130  try {
131  gameObject.setAttributeInt(BaseObject.DIRECTION, dir);
132  } finally {
133  mapModel.endTransaction();
134  }
135  }
136  }
137  }
138 
139  };
140 
144  @NotNull
145  private String defaultFaceComponentValue = "";
146 
150  @NotNull
151  private String defaultAnimComponentValue = "";
152 
157 
161  @NotNull
162  private String defaultAnimSpeedTextFieldValue = "";
163 
173  public FaceTab(@NotNull final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon) {
174  super(gameObjectAttributesModel);
175  this.faceObjects = faceObjects;
176  this.animationObjects = animationObjects;
177  faceComponent = new FaceComponent("", faceObjects, faceObjectProviders, noFaceSquareIcon, unknownSquareIcon, "");
178  animationComponent = new AnimationComponent("", animationObjects, faceObjectProviders, noFaceSquareIcon, unknownSquareIcon);
179 
180  final GridBagLayout gridBagLayout = new GridBagLayout();
181  final GridBagConstraints gbc = new GridBagConstraints();
182 
183  panel.setLayout(gridBagLayout);
184  gbc.fill = GridBagConstraints.BOTH;
185  gbc.weightx = 1.0;
186  gbc.weighty = 1.0;
187  gbc.anchor = GridBagConstraints.NORTHWEST;
188 
189  gbc.gridx = 0;
190  gbc.gridy = 0;
191  gbc.gridwidth = 1;
192  gbc.gridheight = 1;
193  final Component facePanel = createFacePanel();
194  gridBagLayout.setConstraints(facePanel, gbc);
195  panel.add(facePanel);
196 
197  gbc.gridx = 1;
198  gbc.gridy = 0;
199  gbc.gridwidth = 1;
200  gbc.gridheight = 1;
201  final Component animationPanel = createAnimationPanel();
202  gridBagLayout.setConstraints(animationPanel, gbc);
203  panel.add(animationPanel);
204 
205  gbc.gridx = 2;
206  gbc.gridy = 0;
207  gbc.weightx = 0.0;
208  gbc.gridwidth = 1;
209  gbc.gridheight = 1;
210  final Component directionPanel = createDirectionPanel();
211  gridBagLayout.setConstraints(directionPanel, gbc);
212  panel.add(directionPanel);
213 
219  refresh(gameObjectAttributesModel.getSelectedGameObject());
220  }
221 
222  @Override
223  protected final void refresh(@Nullable final G gameObject) {
224  Severity severity = Severity.DEFAULT;
225 
226  final String faceName;
227  if (gameObject == null) {
228  faceName = "";
229  } else {
230  final String tmpFaceName = gameObject.getFaceName();
231  if (tmpFaceName == null) {
232  faceName = normalizeFace(gameObject.getArchetype().getFaceName());
233  } else {
234  faceName = normalizeFace(tmpFaceName);
235  if (severity == Severity.DEFAULT) {
236  severity = Severity.MODIFIED;
237  }
238  }
239  if (!faceName.equals("NONE") && !faceObjects.containsKey(faceName)) {
240  severity = Severity.ERROR;
241  }
242  }
243 
244  final String animName;
245  if (gameObject == null) {
246  animName = "";
247  } else {
248  final String tmpAnimName = gameObject.getAnimName();
249  if (tmpAnimName == null) {
250  animName = normalizeFace(gameObject.getArchetype().getAnimName());
251  } else {
252  animName = normalizeFace(tmpAnimName);
253  if (severity == Severity.DEFAULT) {
254  severity = Severity.MODIFIED;
255  }
256  }
257  if (!animName.equals("NONE") && !animationObjects.containsKey(animName)) {
258  severity = Severity.ERROR;
259  }
260  }
261 
262  final boolean animated;
263  if (gameObject == null) {
264  animated = false;
265  } else {
266  animated = gameObject.getAttributeInt(BaseObject.IS_ANIMATED) != 0;
267  //noinspection DoubleNegation
268  if (severity == Severity.DEFAULT && animated != (gameObject.getArchetype().getAttributeInt(BaseObject.IS_ANIMATED) != 0)) {
269  severity = Severity.MODIFIED;
270  }
271  }
272 
273  final String animSpeed;
274  if (gameObject == null) {
275  animSpeed = "";
276  } else {
277  animSpeed = gameObject.getAttributeString(BaseObject.ANIM_SPEED);
278  if (severity == Severity.DEFAULT && !gameObject.getArchetype().getAttributeString(BaseObject.ANIM_SPEED).equals(animSpeed)) {
279  severity = Severity.MODIFIED;
280  }
281  }
282 
283  final int direction;
284  if (gameObject == null || !gameObject.getArchetype().usesDirection()) {
285  direction = 0;
286  } else {
287  direction = gameObject.getDirection();
288  if (severity == Severity.DEFAULT && direction != gameObject.getArchetype().getDirection()) {
289  severity = Severity.MODIFIED;
290  }
291  }
292 
293  setTabSeverity(severity);
294  faceComponent.setEnabled(gameObject != null);
295  faceComponent.setFaceName(faceName);
296  defaultFaceComponentValue = faceName;
297  animationComponent.setEnabled(gameObject != null);
299  defaultAnimComponentValue = animName;
300  animatedCheckBox.setEnabled(gameObject != null);
301  animatedCheckBox.setSelected(animated);
302  defaultAnimatedCheckBoxValue = animated;
303  animSpeedTextField.setEnabled(gameObject != null);
304  animSpeedTextField.setText(animSpeed);
305  defaultAnimSpeedTextFieldValue = animSpeed;
306  directionComponent.setEnabled(gameObject != null);
308  }
309 
310  @Override
311  public boolean canApply() {
313  }
314 
315  @Override
316  public void activate() {
317  faceComponent.requestFocusInWindow();
318  }
319 
320  @Override
321  protected void apply(@NotNull final G gameObject) {
322  final String faceName = normalizeFace(faceComponent.getFaceName());
323  final String faceName2;
324  if (faceName.equals("NONE")) {
325  final String archFaceName = gameObject.getArchetype().getFaceName();
326  faceName2 = archFaceName == null || archFaceName.isEmpty() ? "" : "NONE";
327  } else {
328  faceName2 = faceName;
329  }
330  gameObject.setAttributeString(BaseObject.FACE, faceName2);
331 
332  final String animName = normalizeFace(animationComponent.getAnimName());
333  final String animName2;
334  if (animName.equals("NONE")) {
335  final String archAnimName = gameObject.getArchetype().getAnimName();
336  animName2 = archAnimName == null || archAnimName.isEmpty() ? "" : "NONE";
337  } else {
338  animName2 = animName;
339  }
340  gameObject.setAttributeString(BaseObject.ANIMATION, animName2);
341 
342  final boolean isAnimated = animatedCheckBox.isSelected();
343  if (isAnimated == (gameObject.getArchetype().getAttributeInt(BaseObject.IS_ANIMATED) != 0)) {
344  gameObject.removeAttribute(BaseObject.IS_ANIMATED);
345  } else {
346  gameObject.setAttributeInt(BaseObject.IS_ANIMATED, isAnimated ? 1 : 0);
347  }
348 
349  final String animSpeed = animSpeedTextField.getText().trim();
350  final String animSpeedAttribute = gameObject.getArchetype().getAttributeString(BaseObject.ANIM_SPEED);
351  if (animSpeed.isEmpty() || (animSpeed.equals("0") ? "" : animSpeed).equals(animSpeedAttribute)) {
352  gameObject.removeAttribute(BaseObject.ANIM_SPEED);
353  } else {
354  gameObject.setAttributeString(BaseObject.ANIM_SPEED, animSpeed);
355  }
356  }
357 
358  @NotNull
359  @Override
360  public JPanel getPanel() {
361  return panel;
362  }
363 
368  @NotNull
369  private Component createFacePanel() {
370  final GridBagLayout gridBagLayout = new GridBagLayout();
371 
372  final JComponent facePanel = new JPanel();
373  facePanel.setLayout(gridBagLayout);
374  facePanel.setBorder(new TitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, "faceFaceTitle")));
375 
376  final GridBagConstraints gbc = new GridBagConstraints();
377 
378  gbc.fill = GridBagConstraints.HORIZONTAL;
379  gbc.weightx = 1.0;
380  gbc.anchor = GridBagConstraints.NORTHWEST;
381  gbc.gridx = 0;
382  gbc.gridy = 0;
383  gridBagLayout.setConstraints(faceComponent, gbc);
384  facePanel.add(faceComponent);
385 
386  addFiller(gridBagLayout, facePanel, 1, 1);
387  return facePanel;
388  }
389 
394  @NotNull
395  private Component createAnimationPanel() {
396  final GridBagLayout gridBagLayout = new GridBagLayout();
397  final JComponent animationPanel = new JPanel();
398  animationPanel.setLayout(gridBagLayout);
399  animationPanel.setBorder(new TitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, "faceAnimationTitle")));
400 
401  final GridBagConstraints gbc = new GridBagConstraints();
402 
403  gbc.fill = GridBagConstraints.HORIZONTAL;
404  gbc.weightx = 1.0;
405  gbc.anchor = GridBagConstraints.NORTHWEST;
406  gbc.gridx = 0;
407  gbc.gridy = 0;
408  gbc.gridwidth = 2;
409  gridBagLayout.setConstraints(animationComponent, gbc);
410  animationPanel.add(animationComponent);
411 
412  gbc.gridy = 1;
413  gridBagLayout.setConstraints(animatedCheckBox, gbc);
414  animationPanel.add(animatedCheckBox);
415 
416  gbc.fill = GridBagConstraints.NONE;
417  gbc.weightx = 0.0;
418  gbc.gridx = 0;
419  gbc.gridy = 2;
420  gbc.gridwidth = 1;
421  final Component speedLabel = ActionBuilderUtils.newLabel(ACTION_BUILDER, "faceAnimationSpeed");
422  gridBagLayout.setConstraints(speedLabel, gbc);
423  animationPanel.add(speedLabel);
424 
425  gbc.fill = GridBagConstraints.HORIZONTAL;
426  gbc.weightx = 1.0;
427  gbc.gridx = 1;
428  gridBagLayout.setConstraints(animSpeedTextField, gbc);
429  animationPanel.add(animSpeedTextField);
430 
431  addFiller(gridBagLayout, animationPanel, 2, 3);
432  return animationPanel;
433  }
434 
439  @NotNull
440  private Component createDirectionPanel() {
441  final GridBagLayout gridBagLayout = new GridBagLayout();
442 
443  final JComponent directionPanel = new JPanel();
444  directionPanel.setLayout(gridBagLayout);
445  directionPanel.setBorder(new TitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, "faceAnimationDirection")));
446 
447  final GridBagConstraints gbc = new GridBagConstraints();
448 
449  gbc.fill = GridBagConstraints.NONE;
450  gbc.weightx = 1.0;
451  gbc.gridx = 0;
452  gbc.gridy = 0;
453  gridBagLayout.setConstraints(directionComponent, gbc);
454  directionPanel.add(directionComponent);
455 
456  addFiller(gridBagLayout, directionPanel, 1, 1);
457  return directionPanel;
458  }
459 
467  private static void addFiller(@NotNull final GridBagLayout gridBagLayout, @NotNull final Container container, final int gridWidth, final int gridY) {
468  final GridBagConstraints gbc = new GridBagConstraints();
469  gbc.fill = GridBagConstraints.BOTH;
470  gbc.weighty = 1.0;
471  gbc.gridwidth = gridWidth;
472  gbc.gridy = gridY;
473  final Component filler = new JPanel();
474  gridBagLayout.setConstraints(filler, gbc);
475  container.add(filler);
476  }
477 
484  @NotNull
485  private static String normalizeFace(@Nullable final String value) {
486  return value == null || value.isEmpty() ? "NONE" : value;
487  }
488 
489 }
net.sf.gridarta.model.mapmodel.MapModel
A MapModel reflects the data of a map.
Definition: MapModel.java:75
net.sf.gridarta.gui.utils.AnimationComponent.setEnabled
void setEnabled(final boolean enabled)
Definition: AnimationComponent.java:130
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.normalizeFace
static String normalizeFace(@Nullable final String value)
Normalizes a face or animation name.
Definition: FaceTab.java:485
net.sf.gridarta.gui.utils.FaceComponent
A JPanel that allows the user to select a face name.
Definition: FaceComponent.java:41
net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G, A, R >::getSelectedGameObject
GameObject< G, A, R > getSelectedGameObject()
Returns the currently selected GameObject.
Definition: AbstractGameObjectAttributesTab.java:170
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.directionComponent
final DirectionComponent directionComponent
The DirectionComponent for selecting the game object's direction.
Definition: FaceTab.java:114
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.refresh
final void refresh(@Nullable final G gameObject)
Definition: FaceTab.java:223
net.sf.gridarta.gui.utils.Severity.MODIFIED
MODIFIED
The tab contents are modified from defaults.
Definition: Severity.java:39
net.sf.gridarta
Base package of all Gridarta classes.
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.defaultFaceComponentValue
String defaultFaceComponentValue
The default value of faceComponent.
Definition: FaceTab.java:145
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.apply
void apply(@NotNull final G gameObject)
Definition: FaceTab.java:321
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.defaultAnimatedCheckBoxValue
boolean defaultAnimatedCheckBoxValue
The default value of animatedCheckBox.
Definition: FaceTab.java:156
net.sf.gridarta.model.mapmodel.MapSquare
A single Map Square.
Definition: MapSquare.java:45
net.sf.gridarta.model.mapmodel.MapModel.endTransaction
void endTransaction()
End a transaction.
net.sf.gridarta.model.anim.AnimationObjects
AnimationObjects is a container for AnimationObjects.
Definition: AnimationObjects.java:30
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab
The "Face" tab in the archetype chooser.
Definition: FaceTab.java:59
net.sf
net.sf.gridarta.model.mapmodel.MapModel.beginTransaction
void beginTransaction(@NotNull String name)
Starts a new transaction.
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.faceObjects
final NamedObjects<?> faceObjects
The FaceObjects for looking up faces.
Definition: FaceTab.java:71
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.addFiller
static void addFiller(@NotNull final GridBagLayout gridBagLayout, @NotNull final Container container, final int gridWidth, final int gridY)
Adds a filler component that fills the remaining space.
Definition: FaceTab.java:467
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.createDirectionPanel
Component createDirectionPanel()
Creates the "Direction" panel.
Definition: FaceTab.java:440
net.sf.gridarta.model.mapmodel
Definition: AboveFloorInsertionMode.java:20
net.sf.gridarta.model.archetype
Definition: AbstractArchetype.java:20
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.activate
void activate()
Definition: FaceTab.java:316
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.gui.panel.gameobjectattributes.FaceTab.animationObjects
final NamedObjects<?> animationObjects
The AnimationObjects for looking up animations.
Definition: FaceTab.java:77
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.defaultAnimComponentValue
String defaultAnimComponentValue
The default value of animationComponent.
Definition: FaceTab.java:151
net.sf.gridarta.utils.ActionBuilderUtils.newLabel
static JLabel newLabel(@NotNull final ActionBuilder actionBuilder, @NotNull final String key)
Creates a new JLabel from a resource key.
Definition: ActionBuilderUtils.java:117
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.animSpeedTextField
final JTextComponent animSpeedTextField
The JTextField for selecting the animation speed.
Definition: FaceTab.java:101
net.sf.gridarta.gui.utils.DirectionComponent.setEnabled
void setEnabled(final boolean enabled)
Definition: DirectionComponent.java:245
net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab
Base class for GameObjectAttributesTab implementations.
Definition: AbstractGameObjectAttributesTab.java:38
net.sf.gridarta.gui
Graphical User Interface of Gridarta.
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.animationComponent
final AnimationComponent animationComponent
The FaceComponent for selecting the game object's animation.
Definition: FaceTab.java:89
net.sf.gridarta.model.baseobject.BaseObject.IS_ANIMATED
String IS_ANIMATED
The attribute name of the "is_animated" flag.
Definition: BaseObject.java:78
net.sf.gridarta.gui.utils.AnimationComponent
A JPanel that allows the user to select an animation name.
Definition: AnimationComponent.java:41
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.animatedCheckBox
final AbstractButton animatedCheckBox
The JCheckBox for selecting whether the game object is animated.
Definition: FaceTab.java:95
net.sf.gridarta.gui.utils.FaceComponent.setEnabled
void setEnabled(final boolean enabled)
Definition: FaceComponent.java:137
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.createFacePanel
Component createFacePanel()
Creates the "Face" panel.
Definition: FaceTab.java:369
net.sf.gridarta.gui.utils.Severity
Severity levels for colors of tabs.
Definition: Severity.java:29
net.sf.gridarta.model.gameobject
GameObjects are the objects based on Archetypes found on maps.
Definition: AbstractGameObject.java:20
net
net.sf.gridarta.gui.utils.AnimationComponent.getAnimName
String getAnimName()
Returns the current animation name.
Definition: AnimationComponent.java:116
net.sf.gridarta.gui.utils.AnimationComponent.setAnimName
void setAnimName(@NotNull final String animName)
Sets the current animation name.
Definition: AnimationComponent.java:124
net.sf.gridarta.gui.utils.FaceComponent.setFaceName
void setFaceName(@NotNull final String faceName)
Sets the current face name.
Definition: FaceComponent.java:131
net.sf.gridarta.model.baseobject.BaseObject.FACE
String FACE
The attribute name of the object's face.
Definition: BaseObject.java:54
net.sf.gridarta.gui.utils.FaceComponent.getFaceName
String getFaceName()
Returns the current face name.
Definition: FaceComponent.java:123
net.sf.gridarta.model.maparchobject.MapArchObject
Interface for MapArchObjects.
Definition: MapArchObject.java:40
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.defaultAnimSpeedTextFieldValue
String defaultAnimSpeedTextFieldValue
The default value of animSpeedTextField.
Definition: FaceTab.java:162
net.sf.gridarta.gui.utils.DirectionComponent
A GUI component for selecting a direction.
Definition: DirectionComponent.java:48
net.sf.gridarta.gui.panel.gameobjectattributes.GameObjectAttributesModel< G, A, R >
net.sf.gridarta.model.face.FaceObjects
FaceObjects is a container for FaceObjects.
Definition: FaceObjects.java:31
net.sf.gridarta.model.data
Classes for handling data that is organized in a tree.
Definition: AbstractNamedObject.java:20
net.sf.gridarta.utils.ActionBuilderUtils.getString
static String getString(@NotNull final ActionBuilder actionBuilder, @NotNull final String key, @NotNull final String defaultValue)
Returns the value of a key.
Definition: ActionBuilderUtils.java:71
net.sf.gridarta.gui.utils.Severity.ERROR
ERROR
The tab contents are invalid.
Definition: Severity.java:44
net.sf.gridarta.model.baseobject.BaseObject
Definition: BaseObject.java:34
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.faceComponent
final FaceComponent faceComponent
The FaceComponent for selecting the game object's face.
Definition: FaceTab.java:83
net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G, A, R >::addAutoApply
void addAutoApply( @NotNull final Component component)
Registers a component that auto-applies when the focus is lost.
Definition: AbstractGameObjectAttributesTab.java:161
net.sf.gridarta.model.mapmodel.MapSquare.getMapModel
MapModel< G, A, R > getMapModel()
Returns the MapModel this map square is part of.
Definition: MapSquare.java:99
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.createAnimationPanel
Component createAnimationPanel()
Creates the "Animation" panel.
Definition: FaceTab.java:395
net.sf.gridarta.gui.utils.DirectionComponent.updateDirection
final void updateDirection(@Nullable final Integer direction)
Sets the selected direction.
Definition: DirectionComponent.java:130
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.FaceTab
FaceTab(@NotNull final GameObjectAttributesModel< G, A, R > gameObjectAttributesModel, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon)
Creates a new instance.
Definition: FaceTab.java:173
net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G, A, R >::setTabSeverity
void setTabSeverity( @NotNull final Severity tabSeverity)
Sets the tab severity.
Definition: AbstractGameObjectAttributesTab.java:102
net.sf.gridarta.model
net.sf.gridarta.model.archetype.Archetype
Reflects an Archetype.
Definition: Archetype.java:41
net.sf.gridarta.model.baseobject
Definition: AbstractBaseObject.java:20
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.canApply
boolean canApply()
Definition: FaceTab.java:311
net.sf.gridarta.model.face
The face is the appearance of an object.
Definition: AbstractFaceObjects.java:20
net.sf.gridarta.model.anim
Gridarta can handle frame information of animations and allow the selection of an animation using a t...
Definition: AbstractAnimationObjects.java:20
net.sf.gridarta.var.crossfire.model.gameobject.GameObject<?, ?, ?>
net.sf.gridarta.gui.utils.FaceComponent.getInputComponent
Component getInputComponent()
Returns the input field component.
Definition: FaceComponent.java:148
net.sf.gridarta.utils.ActionBuilderUtils
Utility class for ActionBuilder related functions.
Definition: ActionBuilderUtils.java:31
net.sf.gridarta.model.maparchobject
Definition: AbstractMapArchObject.java:20
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.panel
final JPanel panel
The content panel.
Definition: FaceTab.java:107
net.sf.gridarta.gui.utils.AnimationComponent.getInputComponent
Component getInputComponent()
Returns the input field component.
Definition: AnimationComponent.java:141
net.sf.gridarta.gui.utils
Definition: AnimationComponent.java:20
net.sf.gridarta.model.baseobject.BaseObject.ANIM_SPEED
String ANIM_SPEED
The name of the "anim_speed" attribute.
Definition: BaseObject.java:138
net.sf.gridarta.gui.utils.Severity.DEFAULT
DEFAULT
The tab contents are unchanged from defaults.
Definition: Severity.java:34
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.getPanel
JPanel getPanel()
Definition: FaceTab.java:360
net.sf.gridarta.utils
Definition: ActionBuilderUtils.java:20
net.sf.gridarta.model.data.NamedObjects
This class manages NamedObjects, managing their tree as well as providing a method for showing a dial...
Definition: NamedObjects.java:33
net.sf.gridarta.model.baseobject.BaseObject.ANIMATION
String ANIMATION
The attribute name of the object's animation.
Definition: BaseObject.java:42
net.sf.gridarta.gui.panel.gameobjectattributes.FaceTab.ACTION_BUILDER
static final ActionBuilder ACTION_BUILDER
The action builder.
Definition: FaceTab.java:65
net.sf.gridarta.model.baseobject.BaseObject.DIRECTION
String DIRECTION
The attribute name of the object's direction.
Definition: BaseObject.java:48
net.sf.gridarta.model.data.NamedObjects.containsKey
boolean containsKey(@NotNull String name)
Check whether an object is defined.