 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.map.viewaction;
22 import java.awt.Container;
23 import java.util.Arrays;
24 import java.util.Comparator;
25 import java.util.LinkedList;
26 import java.util.List;
27 import javax.swing.Action;
38 import net.
sf.japi.swing.action.ActionMethod;
39 import org.jetbrains.annotations.NotNull;
40 import org.jetbrains.annotations.Nullable;
58 private final List<ViewAction>
viewActions =
new LinkedList<>();
73 public void mapCreated(@NotNull
final MapControl<G, A, R> mapControl,
final boolean interactive) {
97 public void gridVisibleChanged(
final boolean gridVisible) {
102 public void lightVisibleChanged(
final boolean lightVisible) {
107 public void smoothingChanged(
final boolean smoothing) {
112 public void tileStretchingChanged(
final boolean tileStretching) {
117 public void doubleFacesChanged(
final boolean doubleFaces) {
122 public void alphaTypeChanged(
final int alphaType) {
127 public void editTypeChanged(
final int editType) {
132 public void autojoinChanged(
final boolean autojoin) {
153 private static final Comparator<ViewAction>
ACTION_NAME_COMPARATOR = (o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getName(), o2.getName());
159 public void init(@NotNull
final Iterable<NamedGameObjectMatcher> gameObjectMatchers) {
169 public void setMenu(@Nullable
final Container viewActionsMenu) {
170 if (viewActionsMenu ==
null) {
178 viewActionsMenu.add(viewAction.getCheckBoxMenuItem(), index++);
196 viewAction.updateAction();
201 public void setAction(@NotNull
final Action action, @NotNull
final String
name) {
final MapManagerListener< G, A, R > mapManagerListener
The map manager listener which is attached to the current map if the current map is tracked.
Action to manage one edit type represented by one {}.
void init(@NotNull final Iterable< NamedGameObjectMatcher > gameObjectMatchers)
Creates the view actions.
A MapManager manages all opened maps.
ViewActions(@NotNull final MapViewSettings mapViewSettings, @NotNull final MapManager< G, A, R > mapManager)
Creates a new instance.
Base package of all Gridarta classes.
final MapViewSettings mapViewSettings
The map view settings instance.
void addMapViewSettingsListener(@NotNull MapViewSettingsListener listener)
Register a MapViewSettingsListener.
void setMenu(@Nullable final Container viewActionsMenu)
Sets the menu to add the actions to.
Interface for listeners listening to MapManager changes.
Reflects a game object (object on a map).
Container for settings that affect the rendering of maps.
final List< ViewAction > viewActions
The view actions.
final MapViewSettingsListener mapViewSettingsListener
The MapViewSettingsListener attached to mapViewSettings to detect edit types changes.
Decorates an arbitrary GameObjectMatcher with a localized name that is suitable for the user interfac...
GameObjects are the objects based on Archetypes found on maps.
void resetView()
Action method for "reset view".
Classes related to matching {GameObjects}, so called { net.sf.gridarta.model.match....
Interface for MapArchObjects.
void updateActions()
Updates the actions' state to the current edit mode.
static final Comparator< ViewAction > ACTION_NAME_COMPARATOR
The comparator for sorting menu entries.
void unsetEditType(int editType)
Set the map view to hide squares of the given type.
Interface for event listeners that are interested in changes on {}.
Currently nothing more than a marker interface for unification.
void setAction(@NotNull final Action action, @NotNull final String name)
Sets the Action instance for this editor action.
Manages edit type actions in "view" menu.