20 package net.sf.gridarta.gui.panel.connectionview;
22 import java.awt.Point;
23 import java.awt.event.MouseAdapter;
24 import java.awt.event.MouseEvent;
25 import java.util.Iterator;
26 import javax.swing.JPanel;
27 import javax.swing.event.ListSelectionEvent;
28 import javax.swing.event.ListSelectionListener;
36 import org.jetbrains.annotations.NotNull;
60 public void valueChanged(
final ListSelectionEvent e) {
66 view.addListMouseListener(
new MouseAdapter() {
69 public void mousePressed(
final MouseEvent e) {
71 if (e.getClickCount() == 2) {
72 final Iterator<Connection<K>> it = view.getSelectedConnections().iterator();
101 if (mapView == null) {
108 final Point point =
new Point();
Abstract controller base class for map view controls.
Iterable< Connection< K > > getSelectedConnections()
Return a list of all selected connections.
Graphical User Interface of Gridarta.
MapGrid getMapGrid()
Returns the MapGrid of this view.
void highlightSelectedEntries()
Sets the map selection to the currently selected entries.
Stores GameObjects related to key values.
JPanel getView()
Returns the view for this controller.
void unSelect()
Clears all selection and pre-selection flags from the grid.
abstract void doubleClick(@NotNull Connection< K > connection)
Called if an entry is double-clicked.
int getMapX()
Returns the X coordinate of this GameObject on its map.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
int getMapY()
Returns the Y coordinate of this GameObject on its map.
GameObjects are the objects based on Archetypes found on maps.
final View< K, G, A, R > view
The view of this controller.
2D-Grid containing flags for selection, pre-selection, cursor, warnings and errors.
Base classes for rendering maps.
MapView< G, A, R > getMapView()
Return the current map view.
void addListSelectionListener(@NotNull final ListSelectionListener listener)
Register a ListSelectionListener for the connection list.
void select(@NotNull final Point pos, @NotNull final SelectionMode selectionMode)
Selects or deselects a single square.
A map view consists of a map grid and a map cursor, and is attached to a map control.
ADD
All squares that are preselected get selected.
Control(@NotNull final View< K, G, A, R > view)
Creates a new instance.
Modes that describe how squares get selected.
Interface for MapArchObjects.