 |
Gridarta Editor
|
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);
A MouseOpEvent is an event triggered for a MouseOpListener.
A MapModel reflects the data of a map.
G getLast(@NotNull final GameObjectMatcher gameObjectMatcher)
Returns the last occurrence of a matching game object.
Base package of all Gridarta classes.
G getFirst(@NotNull final GameObjectMatcher gameObjectMatcher)
Returns the first occurrence of a matching game object.
void endTransaction()
End a transaction.
void beginTransaction(@NotNull String name)
Starts a new transaction.
boolean isAutojoin()
Returns whether "autojoin" is enabled.
Interface for classes that match GameObjects.
Reflects a game object (object on a map).
Container for settings that affect the rendering of maps.
boolean isMatching(@NotNull G gameObject)
Returns whether the current selection matches a given game object.
boolean isMatching(@NotNull GameObject<?, ?, ?> gameObject)
Matches a GameObject.
Graphical User Interface of Gridarta.
boolean setLocationSafe(@Nullable final Point p)
Move cursor to a new location.
GameObjects are the objects based on Archetypes found on maps.
Classes related to matching {GameObjects}, so called { net.sf.gridarta.model.match....
Utility class for Swing related functions.
transient Iterable< G > reverse
Iterable implementation for reverse traversal.
G getBeforeFirst(@NotNull final GameObjectMatcher gameObjectMatcher)
Returns the game object before the first occurrence of a matching game object.
Interface for MapArchObjects.
boolean isEditType(int editType)
Get information on the current state of edit type.
void removeGameObject(@NotNull G gameObject, boolean join)
Delete an existing GameObject from the map.
boolean isLocked()
Returns whether pickmaps are immutable.
MapCursor provides methods to move and drag on map.
static String getString(@NotNull final ActionBuilder actionBuilder, @NotNull final String key, @NotNull final String defaultValue)
Returns the value of a key.
Common base interface for ObjectChoosers.
MapModel< G, A, R > getMapModel()
Returns the MapModel this map square is part of.
MapSquare< G, A, R > getMapSquare(@NotNull Point pos)
Get the square at a specified location.
G getAfterLast(@NotNull final GameObjectMatcher gameObjectMatcher)
Returns the game object after the last occurrence of a matching game object.
Base classes for rendering maps.
static Component createLabel(@NotNull final String key, @Nullable final Component component)
Creates a javax.swing.JLabel instance.
Currently nothing more than a marker interface for unification.
Utility class for ActionBuilder related functions.
Container for settings that affect pickmaps.