20 package net.sf.gridarta.gui.map.viewaction;
22 import java.awt.Component;
23 import java.awt.event.ActionEvent;
24 import javax.swing.AbstractAction;
25 import javax.swing.AbstractButton;
26 import javax.swing.JCheckBoxMenuItem;
29 import net.
sf.japi.swing.action.ActionBuilder;
30 import net.
sf.japi.swing.action.ActionBuilderFactory;
31 import org.jetbrains.annotations.NotNull;
49 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
80 super(ACTION_BUILDER.format(
"show.text", matcher.getName()));
82 name = matcher.getName();
100 checkBoxMenuItem.setSelected(mapViewSettings.
isEditType(editType));
123 public Object
clone() throws CloneNotSupportedException {
124 return super.clone();
int getEditType()
Returns the currently set edit type.
void toggleEditType(int editType)
Toggle an edit type.
final MapViewSettings mapViewSettings
The map view settings instance.
This package contains classes related to matching GameObjects, so called GameObjectMatchers.
void actionPerformed(@NotNull final ActionEvent e)
final int editType
The managed edit type.
boolean isEditType(int editType)
Get information on the current state of edit type.
Action to manage one edit type represented by one NamedGameObjectMatcher.
Decorates an arbitrary GameObjectMatcher with a localized name that is suitable for the user interfac...
final String name
The name for sorting the menu entries.
Base package of all Gridarta classes.
String getName()
Returns the name for sorting the menu entries.
static final long serialVersionUID
The serial version UID.
Container for settings that affect the rendering of maps.
ViewAction(@NotNull final MapViewSettings mapViewSettings, @NotNull final NamedGameObjectMatcher matcher)
Creates a new instance.
Component getCheckBoxMenuItem()
Returns the menu item for this action.
final AbstractButton checkBoxMenuItem
The menu item for this action.
final void updateAction()
Update the action's state to match the current edit type settings.
static final ActionBuilder ACTION_BUILDER
Action Builder to create Actions.