20 package net.sf.gridarta.model.match;
22 import java.awt.event.ActionEvent;
23 import java.util.ArrayList;
24 import java.util.Collections;
25 import java.util.List;
26 import javax.swing.AbstractAction;
27 import javax.swing.Action;
28 import org.jetbrains.annotations.NotNull;
47 private final List<GameObjectMatcherToggleAction>
actions =
new ArrayList<>();
82 return Collections.unmodifiableList(actions);
108 private final Iterable<? extends GameObjectMatcherToggleAction>
actions;
114 ResetAction(@NotNull
final Iterable<? extends GameObjectMatcherToggleAction> actions) {
121 action.setSelected(
false);
129 return super.clone();
130 }
catch (
final CloneNotSupportedException ex) {
131 throw new AssertionError(ex);
174 this.gameObjectMatcher = gameObjectMatcher;
175 this.mutableOrArchObjectMatcher = mutableOrArchObjectMatcher;
183 setSelected(!selected);
191 this.selected = selected;
213 return super.clone();
214 }
catch (
final CloneNotSupportedException ex) {
215 throw new AssertionError(ex);
void actionPerformed(@NotNull final ActionEvent e)
final MutableOrGameObjectMatcher mutableOrArchObjectMatcher
A MutableOrGameObjectMatcher to add / remove GameObjectMatcher to.
List<? extends Action > getAllActions()
Gets all actions.
Interface for classes that match GameObjects.
boolean isSelected()
Gets the selected state.
static final long serialVersionUID
The serial version UID.
final List< GameObjectMatcherToggleAction > actions
The actions.
An Action to toggle an GameObjectMatcher within an MutableOrGameObjectMatcher.
void actionPerformed(@NotNull final ActionEvent e)
Manages GameObjectMatchers.
void removeArchObjectMatcher(@NotNull final GameObjectMatcher gameObjectMatcher)
Removes an GameObjectMatcher.
void addArchObjectMatcher(@NotNull final GameObjectMatcher gameObjectMatcher)
Adds an GameObjectMatcher.
final Action resetAction
The reset action.
boolean selected
Selected state.
A GameObjectMatcher that delegates to other.
final Iterable<? extends GameObjectMatcherToggleAction > actions
The actions to reset.
Action getResetAction()
Gets the reset action.
final MutableOrGameObjectMatcher mutableOrGameObjectMatcher
The MutableOrGameObjectMatcher that is manipulated by the actions.
final GameObjectMatcher gameObjectMatcher
The GameObjectMatcher to add / remove.
ViewGameObjectMatcherManager(@NotNull final MutableOrGameObjectMatcher mutableOrGameObjectMatcher)
Creates a new instance.
void setSelected(final boolean selected)
Sets the selected state.
Action addArchObjectMatcher(@NotNull final GameObjectMatcher gameObjectMatcher)
Adds an GameObjectMatcher.