Go to the documentation of this file.
20 package net.sf.gridarta.gui.panel.tools;
22 import java.awt.Component;
23 import java.awt.Container;
24 import java.awt.GridBagConstraints;
25 import java.awt.GridBagLayout;
26 import java.awt.Point;
27 import java.util.Collection;
28 import java.util.HashSet;
29 import javax.swing.JComboBox;
30 import javax.swing.JPanel;
45 import net.
sf.japi.swing.action.ActionBuilder;
46 import net.
sf.japi.swing.action.ActionBuilderFactory;
47 import net.
sf.japi.swing.action.ActionMethod;
48 import net.
sf.japi.swing.action.ToggleAction;
49 import org.jetbrains.annotations.NotNull;
50 import org.jetbrains.annotations.Nullable;
108 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta.gui.panel.tools");
212 final Point mapLoc = e.getMapLocation();
216 if (mapLoc !=
null) {
233 final Point mapLoc = e.getMapLocation();
284 if (start ==
null || end ==
null) {
287 final Collection<G> gameObjectsToDelete =
new HashSet<>();
288 boolean foundFirst =
false;
292 if (gameObject == start2) {
296 final G head = gameObject.getHead();
298 boolean insert =
false;
332 gameObjectsToDelete.add(head);
339 if (gameObject == end2) {
344 if (!gameObjectsToDelete.isEmpty()) {
348 for (
final G gameObjectToDelete : gameObjectsToDelete) {
360 final Container panel =
new JPanel();
361 panel.setLayout(
new GridBagLayout());
363 final GridBagConstraints gbcLabel =
new GridBagConstraints();
364 gbcLabel.anchor = GridBagConstraints.EAST;
366 final GridBagConstraints gbcComboBox =
new GridBagConstraints();
367 gbcComboBox.fill = GridBagConstraints.HORIZONTAL;
368 gbcComboBox.weightx = 1.0;
369 gbcComboBox.gridwidth = GridBagConstraints.REMAINDER;
371 final GridBagConstraints gbcCheckBox =
new GridBagConstraints();
372 gbcCheckBox.fill = GridBagConstraints.HORIZONTAL;
373 gbcCheckBox.gridwidth = GridBagConstraints.REMAINDER;
394 final JComboBox<?> comboBox =
new JComboBox<>(options);
405 final String[] options = {
ActionBuilderUtils.
getString(
ACTION_BUILDER,
"deletionTool.scope.square"),
ActionBuilderUtils.
getString(
ACTION_BUILDER,
"deletionTool.scope.aboveFloor"),
ActionBuilderUtils.
getString(
ACTION_BUILDER,
"deletionTool.scope.belowFloor"),
ActionBuilderUtils.
getString(
ACTION_BUILDER,
"deletionTool.scope.selectedObject"),
ActionBuilderUtils.
getString(
ACTION_BUILDER,
"deletionTool.scope.wall"),
ActionBuilderUtils.
getString(
ACTION_BUILDER,
"deletionTool.scope.floor"), };
406 final JComboBox<?> comboBox =
new JComboBox<>(options);
G getFirst(@NotNull final GameObjectMatcher gameObjectMatcher)
G getLast(@NotNull final GameObjectMatcher gameObjectMatcher)
G getBeforeFirst(@NotNull final GameObjectMatcher gameObjectMatcher)
MapModel< G, A, R > getMapModel()
boolean setLocationSafe(@Nullable final Point p)
void beginTransaction(@NotNull String name)
MapSquare< G, A, R > getMapSquare(@NotNull Point pos)
transient Iterable< G > reverse
void removeGameObject(@NotNull G gameObject, boolean join)
boolean isMatching(@NotNull G gameObject)
static Component createLabel(@NotNull final String key, @Nullable final Component component)
static String getString(@NotNull final ActionBuilder actionBuilder, @NotNull final String key, @NotNull final String defaultValue)
G getAfterLast(@NotNull final GameObjectMatcher gameObjectMatcher)
boolean isEditType(int editType)
boolean isMatching(@NotNull GameObject<?, ?, ?> gameObject)