Gridarta Editor
SetEnabledAction.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.model.match;
21 
22 import java.awt.event.ActionEvent;
23 import javax.swing.AbstractAction;
24 import org.jetbrains.annotations.NotNull;
25 
31 public class SetEnabledAction extends AbstractAction {
32 
36  private static final long serialVersionUID = 1L;
37 
42  @NotNull
44 
49  @NotNull
51 
60  this.mutableOrGameObjectMatcher = mutableOrGameObjectMatcher;
61  this.gameObjectMatcher = gameObjectMatcher;
62  }
63 
64  @Override
65  public void actionPerformed(@NotNull final ActionEvent e) {
66  if (!isEnabled()) {
67  return;
68  }
70  }
71 
76  private void setSelected(final boolean selected) {
77  if (selected) {
79  } else {
81  }
82  }
83 
88  private boolean isSelected() {
90  }
91 
92  @NotNull
93  @Override
95  try {
96  return (SetEnabledAction) super.clone();
97  } catch (final CloneNotSupportedException ex) {
98  throw new AssertionError(ex);
99  }
100  }
101 
102 }
net.sf.gridarta.model.match.SetEnabledAction
Action for adding / removing a GameObjectMatcher from this a.
Definition: SetEnabledAction.java:31
net.sf.gridarta.model.match.SetEnabledAction.gameObjectMatcher
final GameObjectMatcher gameObjectMatcher
The GameObjectMatcher to be added / removed.
Definition: SetEnabledAction.java:50
net.sf.gridarta.model.match.MutableOrGameObjectMatcher.containsArchObjectMatcher
boolean containsArchObjectMatcher(@NotNull final GameObjectMatcher gameObjectMatcher)
Checks whether a certain GameObjectMatcher is contained in this matcher.
Definition: MutableOrGameObjectMatcher.java:102
net.sf.gridarta.model.match.SetEnabledAction.mutableOrGameObjectMatcher
final MutableOrGameObjectMatcher mutableOrGameObjectMatcher
The MutableOrGameObjectMatcher to add to / remove from.
Definition: SetEnabledAction.java:43
net.sf.gridarta.model.match.SetEnabledAction.clone
SetEnabledAction clone()
Definition: SetEnabledAction.java:94
net.sf.gridarta.model.match.GameObjectMatcher
Interface for classes that match GameObjects.
Definition: GameObjectMatcher.java:30
net.sf.gridarta.model.match.MutableOrGameObjectMatcher
A GameObjectMatcher that delegates to other.
Definition: MutableOrGameObjectMatcher.java:33
net.sf.gridarta.model.match.SetEnabledAction.SetEnabledAction
SetEnabledAction(@NotNull final MutableOrGameObjectMatcher mutableOrGameObjectMatcher, @NotNull final GameObjectMatcher gameObjectMatcher)
Creates a new instance.
Definition: SetEnabledAction.java:59
net.sf.gridarta.model.match.MutableOrGameObjectMatcher.removeArchObjectMatcher
void removeArchObjectMatcher(@NotNull final GameObjectMatcher gameObjectMatcher)
Removes a GameObjectMatcher.
Definition: MutableOrGameObjectMatcher.java:91
net.sf.gridarta.model.match.MutableOrGameObjectMatcher.addArchObjectMatcher
void addArchObjectMatcher(@NotNull final GameObjectMatcher gameObjectMatcher)
Adds a GameObjectMatcher.
Definition: MutableOrGameObjectMatcher.java:81
net.sf.gridarta.model.match.SetEnabledAction.setSelected
void setSelected(final boolean selected)
Adds / removes the gameObjectMatcher.
Definition: SetEnabledAction.java:76
net.sf.gridarta.model.match.SetEnabledAction.actionPerformed
void actionPerformed(@NotNull final ActionEvent e)
Definition: SetEnabledAction.java:65
net.sf.gridarta.model.match.SetEnabledAction.isSelected
boolean isSelected()
Returns whether gameObjectMatcher is currently enabled.
Definition: SetEnabledAction.java:88
net.sf.gridarta.model.match.SetEnabledAction.serialVersionUID
static final long serialVersionUID
The serial version UID.
Definition: SetEnabledAction.java:36