|
Gridarta Editor
|
2D-Grid containing flags for selection, pre-selection, cursor, warnings and errors. More...
Collaboration diagram for net.sf.gridarta.model.mapgrid.MapGrid:Public Member Functions | |
| void | addMapGridListener (@NotNull final MapGridListener listener) |
| Registers a MapGridListener. More... | |
| void | beginTransaction () |
| Starts a new transaction. More... | |
| void | clearErrors () |
| Clears all error flags. More... | |
| void | endTransaction () |
| Ends a transaction. More... | |
| int | getFlags (final int x, final int y) |
| Returns the flags of a square. More... | |
| int | getFlags (@NotNull final Point p) |
| Returns the flags of a square. More... | |
| Size2D | getGridSize () |
| Returns a Size2D with the dimension of this grid. More... | |
| Rectangle | getRecChange () |
| Returns a rectangle where the grid was changed. More... | |
| Rectangle | getSelectedRec () |
| Returns the smallest rectangle containing selection. More... | |
| Point [] | getSelection () |
| Returns the selection. More... | |
| Size2D | getSize () |
| Returns size of grid. More... | |
| boolean | hasError (@NotNull final Point p) |
| Checks if a square has the error flag set. More... | |
| void | invertSelection () |
| Inverts all selected squares. More... | |
| MapGrid (@NotNull final Size2D gridSize) | |
| Creates a new instance. More... | |
| void | preSelect (@NotNull final Point start, @NotNull final Point end) |
| Rectangle defined by two points gets preselected. More... | |
| void | removeMapGridListener (@NotNull final MapGridListener listener) |
| Removes a MapGridListener. More... | |
| void | resize (@NotNull final Size2D newSize) |
| Resizes the MapGrid. More... | |
| void | select (@NotNull final Point pos, @NotNull final SelectionMode selectionMode) |
| Selects or deselects a single square. More... | |
| void | selectAll () |
| Marks all squares as selected. More... | |
| void | selectArea (@NotNull final Point pos1, @NotNull final Point pos2, @NotNull final SelectionMode selectionMode) |
| Selects or deselects all squares in an area. More... | |
| void | setCursor (@NotNull final Point pos) |
| Highlights the given cursor position. More... | |
| void | setError (final int x, final int y) |
| Sets the error flag at given coordinates. More... | |
| void | unPreSelect (@NotNull final Point start, @NotNull final Point end) |
| Pre-selection of rectangle defined by points gets deleted. More... | |
| void | unSelect () |
| Clears all selection and pre-selection flags from the grid. More... | |
| void | unSetCursor (@NotNull final Point pos) |
| Un-highlights the given cursor position. More... | |
| void | updatePreSelect (@NotNull final Point start, @NotNull final Point oldEnd, @NotNull final Point newEnd) |
| Update the pre-selection rectangle. More... | |
Static Public Attributes | |
| static final int | GRID_FLAG_CONNECTION = 1 << 6 |
| Flag to highlight as part of a connection group. More... | |
| static final int | GRID_FLAG_CURSOR = 1 << 7 |
| Flag to highlight cursor position. More... | |
| static final int | GRID_FLAG_ERROR = 1 << 4 |
| Flag to highlight as error. More... | |
| static final int | GRID_FLAG_FATAL = 1 << 5 |
| Flag to highlight as fatal. More... | |
| static final int | GRID_FLAG_INFORMATION = 1 << 2 |
| Flag to highlight as information. More... | |
| static final int | GRID_FLAG_SELECTING = 1 << 1 |
| Pre-selection - used to preselect squares. More... | |
| static final int | GRID_FLAG_SELECTION = 1 |
| Selection - marks all selected squares. More... | |
| static final int | GRID_FLAG_SELECTION_EAST = 1 << 9 |
| Selection - is set for squares at the east edge of the selected area. More... | |
| static final int | GRID_FLAG_SELECTION_NORTH = 1 << 8 |
| Selection - is set for squares at the north edge of the selected area. More... | |
| static final int | GRID_FLAG_SELECTION_SOUTH = 1 << 10 |
| Selection - is set for squares at the south edge of the selected area. More... | |
| static final int | GRID_FLAG_SELECTION_WEST = 1 << 11 |
| Selection - is set for squares at the west edge of the selected area. More... | |
| static final int | GRID_FLAG_WARNING = 1 << 3 |
| Flag to highlight as warning. More... | |
Private Member Functions | |
| void | beginRecChange () |
| Begins a set of changes. More... | |
| void | calculateCachedSelectedRec () |
| Makes sure the value of cachedSelectedRec if up-to-date. More... | |
| void | calculateRec (@NotNull final Point p1, @NotNull final Point p2) |
| boolean | endRecChange () |
| Ends the set of changes and store the bounding box for all recorded changes in recChange. More... | |
| void | fireMapGridChangedEvent () |
| Inform all registered listeners that the flags on MapGrid have changed. More... | |
| void | fireMapGridResizeEvent () |
| Informs all registered listeners that the size of MapGrid has changed. More... | |
| void | setFlags (final int minX, final int minY, final int maxX, final int maxY, final int flags) |
| Sets flags in a rectangle and generate a grid change event. More... | |
| void | toggleFlags (final int minX, final int minY, final int maxX, final int maxY, final int flags) |
| Flips flags in a rectangle and generate a grid change event. More... | |
| void | unsetFlags (final int minX, final int minY, final int maxX, final int maxY, final int flags) |
| Resets flags in a rectangle and generate a grid change event. More... | |
| void | updateRecChange (final int x, final int y) |
| Adds a point to the set of changes. More... | |
| void | updateSelectionFlag (final int x, final int y, final boolean newState) |
| Updates the border selection flags of a square and its adjacent squares. More... | |
| void | updateSelectionFlag (final int x, final int y, final boolean newState, final int dx, final int dy, final int flag, final int dFlag) |
| Updates the border selection flags of a square and one adjacent square. More... | |
Private Attributes | |
| Point | cachedCursorLoc |
| Cached location of the cursor. More... | |
| Rectangle | cachedSelectedRec |
| The return value for getSelectedRec(). More... | |
| boolean | cachedSelectedRecValid |
| If set, cachedSelectedRec is up-to-date. More... | |
| final Point | cornerMax = new Point() |
| Right lower coordinates of rectangle that is being processed. More... | |
| final Point | cornerMin = new Point() |
| Left upper coordinates of rectangle that is being processed. More... | |
| int [][] | gridFlags |
| 2D-array to store grid flags. More... | |
| Size2D | gridSize |
| Size of. More... | |
| final EventListenerList2< MapGridListener > | listenerList = new EventListenerList2<>(MapGridListener.class) |
| The MapGridListeners to inform of changes. More... | |
| final Rectangle | recChange = new Rectangle() |
| Rectangle to store location of last grid change. More... | |
| int | transactionDepth |
| The transaction depth. More... | |
| Thread | transactionThread |
| The thread that performs the current transaction. More... | |
2D-Grid containing flags for selection, pre-selection, cursor, warnings and errors.
This class provides methods to modify these flags. Normally a map cursor is used to access them. Selection flags are not changed directly. First pre-selection flags have to be set with Point), then selectArea(Point, Point, SelectionMode) will change the selection flags according to SelectionMode. This allows visualisation of the dragging process when selecting an area.
Every change of the grid size or flags fires a MapGridEvent and informs all registered MapGridListeners.
Definition at line 45 of file MapGrid.java.
| net.sf.gridarta.model.mapgrid.MapGrid.MapGrid | ( | @NotNull final Size2D | gridSize | ) |
Creates a new instance.
| gridSize | the size of the grid |
Definition at line 181 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.gridSize.
| void net.sf.gridarta.model.mapgrid.MapGrid.addMapGridListener | ( | @NotNull final MapGridListener | listener | ) |
Registers a MapGridListener.
| listener | the listener to register |
Definition at line 190 of file MapGrid.java.
References net.sf.gridarta.utils.EventListenerList2< T extends EventListener >.add().
Referenced by net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.init().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Begins a set of changes.
Definition at line 646 of file MapGrid.java.
References net.sf.gridarta.utils.Size2D.getHeight(), and net.sf.gridarta.utils.Size2D.getWidth().
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction | ( | ) |
Starts a new transaction.
Transactions may be nested. Transactions serve the purpose of firing events to the views when more changes are known to come before the view is really required to update. Each invocation of this function requires its own invocation of endTransaction().
Definition at line 756 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.beginRecChange().
Referenced by net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.beginTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.clearErrors(), net.sf.gridarta.mainactions.MainActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExpandEmptySelection(), net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doGrowSelection(), net.sf.gridarta.action.ShrinkSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doShrinkSelection(), net.sf.gridarta.gui.map.mapview.ErroneousMapSquares< G, A, R >.errorsChanged(), net.sf.gridarta.model.mapgrid.MapGrid.invertSelection(), net.sf.gridarta.model.mapgrid.MapGrid.preSelect(), net.sf.gridarta.model.mapgrid.MapGrid.selectAll(), net.sf.gridarta.model.mapgrid.MapGrid.selectArea(), net.sf.gridarta.model.mapgrid.MapGrid.setCursor(), net.sf.gridarta.model.mapgrid.MapGrid.setError(), net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.shift(), net.sf.gridarta.model.mapgrid.MapGrid.unPreSelect(), net.sf.gridarta.model.mapgrid.MapGrid.unSelect(), net.sf.gridarta.model.mapgrid.MapGrid.unSetCursor(), and net.sf.gridarta.model.mapgrid.MapGrid.updatePreSelect().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Makes sure the value of cachedSelectedRec if up-to-date.
Definition at line 528 of file MapGrid.java.
References net.sf.gridarta.utils.Size2D.getHeight(), and net.sf.gridarta.utils.Size2D.getWidth().
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.getSelectedRec(), and net.sf.gridarta.model.mapgrid.MapGrid.getSelection().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
are set according to the the points
and
.
| p1 | the coordinates of one corner of a rectangle |
| p2 | the coordinates of the opposite corner |
Definition at line 444 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.preSelect(), net.sf.gridarta.model.mapgrid.MapGrid.selectArea(), and net.sf.gridarta.model.mapgrid.MapGrid.unPreSelect().
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.clearErrors | ( | ) |
Clears all error flags.
Definition at line 631 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.endTransaction(), net.sf.gridarta.utils.Size2D.getHeight(), net.sf.gridarta.utils.Size2D.getWidth(), net.sf.gridarta.model.mapgrid.MapGrid.GRID_FLAG_ERROR, and net.sf.gridarta.model.mapgrid.MapGrid.unsetFlags().
Referenced by net.sf.gridarta.gui.map.mapview.ErroneousMapSquares< G, A, R >.errorsChanged().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Ends the set of changes and store the bounding box for all recorded changes in recChange.
Definition at line 678 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.endTransaction().
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.endTransaction | ( | ) |
Ends a transaction.
Invoking this method will reduce the transaction depth by 1.
If the last transaction is ended, the changes are committed.
Definition at line 776 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.endRecChange(), and net.sf.gridarta.model.mapgrid.MapGrid.fireMapGridChangedEvent().
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.clearErrors(), net.sf.gridarta.mainactions.MainActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExpandEmptySelection(), net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doGrowSelection(), net.sf.gridarta.action.ShrinkSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doShrinkSelection(), net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.endTransaction(), net.sf.gridarta.gui.map.mapview.ErroneousMapSquares< G, A, R >.errorsChanged(), net.sf.gridarta.model.mapgrid.MapGrid.invertSelection(), net.sf.gridarta.model.mapgrid.MapGrid.preSelect(), net.sf.gridarta.model.mapgrid.MapGrid.selectAll(), net.sf.gridarta.model.mapgrid.MapGrid.selectArea(), net.sf.gridarta.model.mapgrid.MapGrid.setCursor(), net.sf.gridarta.model.mapgrid.MapGrid.setError(), net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.shift(), net.sf.gridarta.model.mapgrid.MapGrid.unPreSelect(), net.sf.gridarta.model.mapgrid.MapGrid.unSelect(), net.sf.gridarta.model.mapgrid.MapGrid.unSetCursor(), and net.sf.gridarta.model.mapgrid.MapGrid.updatePreSelect().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Inform all registered listeners that the flags on MapGrid have changed.
Definition at line 243 of file MapGrid.java.
References net.sf.gridarta.utils.EventListenerList2< T extends EventListener >.getListeners().
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.endTransaction().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Informs all registered listeners that the size of MapGrid has changed.
Definition at line 253 of file MapGrid.java.
References net.sf.gridarta.utils.EventListenerList2< T extends EventListener >.getListeners().
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.resize().
Here is the call graph for this function:
Here is the caller graph for this function:| int net.sf.gridarta.model.mapgrid.MapGrid.getFlags | ( | final int | x, |
| final int | y | ||
| ) |
Returns the flags of a square.
| x | the x-coordinate of the square |
| y | the y-coordinate of the square |
Definition at line 476 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapgrid.MapGridTest.checkSelectionBorder(), net.sf.gridarta.action.ShrinkSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doShrinkSelection(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.paintMapSelection(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.paintSquareSelection(), and net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.shift().
Here is the caller graph for this function:| int net.sf.gridarta.model.mapgrid.MapGrid.getFlags | ( | @NotNull final Point | p | ) |
Returns the flags of a square.
| p | the coordinates of the square |
Definition at line 485 of file MapGrid.java.
| Size2D net.sf.gridarta.model.mapgrid.MapGrid.getGridSize | ( | ) |
Returns a Size2D with the dimension of this grid.
Definition at line 207 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.gridSize.
| Rectangle net.sf.gridarta.model.mapgrid.MapGrid.getRecChange | ( | ) |
Returns a rectangle where the grid was changed.
Width and height is 0 for single squares.
Definition at line 495 of file MapGrid.java.
| Rectangle net.sf.gridarta.model.mapgrid.MapGrid.getSelectedRec | ( | ) |
Returns the smallest rectangle containing selection.
Definition at line 514 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.calculateCachedSelectedRec().
Referenced by net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.canShift(), net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doGrowSelection(), net.sf.gridarta.mainactions.MainActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doPasteTiled(), and net.sf.gridarta.action.ShrinkSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doShrinkSelection().
Here is the call graph for this function:
Here is the caller graph for this function:| Point [] net.sf.gridarta.model.mapgrid.MapGrid.getSelection | ( | ) |
Returns the selection.
Definition at line 842 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.cachedSelectedRec, and net.sf.gridarta.model.mapgrid.MapGrid.calculateCachedSelectedRec().
Referenced by net.sf.gridarta.gui.map.mapview.AbstractMapView< TestGameObject, TestMapArchObject, TestArchetype >.getSelectedSquares().
Here is the call graph for this function:
Here is the caller graph for this function:| Size2D net.sf.gridarta.model.mapgrid.MapGrid.getSize | ( | ) |
Returns size of grid.
Definition at line 504 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.gridSize.
Referenced by net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.canShift(), net.sf.gridarta.model.mapgrid.MapGridTest.checkSelectionBorder(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.paintMap(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.paintMapGrid(), and net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.resizeMapGrid().
Here is the caller graph for this function:| boolean net.sf.gridarta.model.mapgrid.MapGrid.hasError | ( | @NotNull final Point | p | ) |
Checks if a square has the error flag set.
| p | the point to check |
Definition at line 466 of file MapGrid.java.
| void net.sf.gridarta.model.mapgrid.MapGrid.invertSelection | ( | ) |
Inverts all selected squares.
Definition at line 605 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.endTransaction(), net.sf.gridarta.utils.Size2D.getHeight(), net.sf.gridarta.utils.Size2D.getWidth(), net.sf.gridarta.model.mapgrid.MapGrid.GRID_FLAG_SELECTION, and net.sf.gridarta.model.mapgrid.MapGrid.toggleFlags().
Here is the call graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.preSelect | ( | @NotNull final Point | start, |
| @NotNull final Point | end | ||
| ) |
Rectangle defined by two points gets preselected.
The points can be on any corner as long as they are opposite to each other.
| start | any point on a corner of the rectangle |
| end | the point on the opposite corner |
Definition at line 313 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.calculateRec(), net.sf.gridarta.model.mapgrid.MapGrid.endTransaction(), and net.sf.gridarta.model.mapgrid.MapGrid.setFlags().
Referenced by net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.dragStart().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.removeMapGridListener | ( | @NotNull final MapGridListener | listener | ) |
Removes a MapGridListener.
| listener | the listener to remove |
Definition at line 198 of file MapGrid.java.
References net.sf.gridarta.utils.EventListenerList2< T extends EventListener >.remove().
Referenced by net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.closeNotify(), and net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.closeNotify().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.resize | ( | @NotNull final Size2D | newSize | ) |
Resizes the MapGrid.
Old flags will be copied to the new grid.
| newSize | the new grid size |
Definition at line 215 of file MapGrid.java.
References net.sf.gridarta.utils.Size2D.equals(), net.sf.gridarta.model.mapgrid.MapGrid.fireMapGridResizeEvent(), net.sf.gridarta.utils.Size2D.getHeight(), net.sf.gridarta.utils.Size2D.getWidth(), net.sf.gridarta.model.mapgrid.MapGrid.GRID_FLAG_SELECTION, and net.sf.gridarta.model.mapgrid.MapGrid.unsetFlags().
Referenced by net.sf.gridarta.model.mapgrid.MapGridTest.testSelectionBorderUpdates().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.select | ( | @NotNull final Point | pos, |
| @NotNull final SelectionMode | selectionMode | ||
| ) |
Selects or deselects a single square.
| pos | the square |
| selectionMode | the selection mode |
Definition at line 408 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.selectArea().
Referenced by net.sf.gridarta.mainactions.MainActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExpandEmptySelection(), net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doGrowSelection(), net.sf.gridarta.action.ShrinkSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doShrinkSelection(), net.sf.gridarta.gui.panel.connectionview.Control< Integer, G, A, R >.highlightSelectedEntries(), net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.selectMapSquares(), net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.shift(), and net.sf.gridarta.model.mapgrid.MapGridTest.testSelectionBorderUpdates().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.selectAll | ( | ) |
Marks all squares as selected.
Definition at line 593 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.endTransaction(), net.sf.gridarta.utils.Size2D.getHeight(), net.sf.gridarta.utils.Size2D.getWidth(), net.sf.gridarta.model.mapgrid.MapGrid.GRID_FLAG_SELECTION, and net.sf.gridarta.model.mapgrid.MapGrid.setFlags().
Here is the call graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.selectArea | ( | @NotNull final Point | pos1, |
| @NotNull final Point | pos2, | ||
| @NotNull final SelectionMode | selectionMode | ||
| ) |
Selects or deselects all squares in an area.
| pos1 | the first corner of rectangle |
| pos2 | the opposite corner of rectangle |
| selectionMode | the selection mode |
Definition at line 418 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.calculateRec(), net.sf.gridarta.model.mapgrid.MapGrid.endTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.setFlags(), net.sf.gridarta.model.mapgrid.MapGrid.toggleFlags(), and net.sf.gridarta.model.mapgrid.MapGrid.unsetFlags().
Referenced by net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.dragSelect(), net.sf.gridarta.model.mapgrid.MapGrid.select(), and net.sf.gridarta.model.mapgrid.MapGridTest.testSelectionBorderUpdates().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.setCursor | ( | @NotNull final Point | pos | ) |
Highlights the given cursor position.
| pos | the map coordinates of square to highlight |
Definition at line 296 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.endTransaction(), and net.sf.gridarta.model.mapgrid.MapGrid.setFlags().
Referenced by net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.endTransaction().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.setError | ( | final int | x, |
| final int | y | ||
| ) |
Sets the error flag at given coordinates.
| x | the x coordinate |
| y | the y coordinate |
Definition at line 619 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.endTransaction(), and net.sf.gridarta.model.mapgrid.MapGrid.setFlags().
Referenced by net.sf.gridarta.gui.map.mapview.ErroneousMapSquares< G, A, R >.errorsChanged().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Sets flags in a rectangle and generate a grid change event.
| minX | the left x-coordinate |
| minY | the left y-coordinate |
| maxX | the right x-coordinate |
| maxY | the right y-coordinate |
| flags | the flags to set |
Definition at line 692 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.updateRecChange(), and net.sf.gridarta.model.mapgrid.MapGrid.updateSelectionFlag().
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.preSelect(), net.sf.gridarta.model.mapgrid.MapGrid.selectAll(), net.sf.gridarta.model.mapgrid.MapGrid.selectArea(), net.sf.gridarta.model.mapgrid.MapGrid.setCursor(), net.sf.gridarta.model.mapgrid.MapGrid.setError(), and net.sf.gridarta.model.mapgrid.MapGrid.updatePreSelect().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Flips flags in a rectangle and generate a grid change event.
| minX | the left x-coordinate |
| minY | the left y-coordinate |
| maxX | the right x-coordinate |
| maxY | the right y-coordinate |
| flags | the flags to reset |
Definition at line 738 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.updateRecChange(), and net.sf.gridarta.model.mapgrid.MapGrid.updateSelectionFlag().
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.invertSelection(), and net.sf.gridarta.model.mapgrid.MapGrid.selectArea().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.unPreSelect | ( | @NotNull final Point | start, |
| @NotNull final Point | end | ||
| ) |
Pre-selection of rectangle defined by points gets deleted.
| start | the coordinates of the first corner |
| end | the coordinates of the opposite corner |
Definition at line 393 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.calculateRec(), net.sf.gridarta.model.mapgrid.MapGrid.endTransaction(), and net.sf.gridarta.model.mapgrid.MapGrid.unsetFlags().
Referenced by net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.dragRelease().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.unSelect | ( | ) |
Clears all selection and pre-selection flags from the grid.
Definition at line 263 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.endTransaction(), net.sf.gridarta.utils.Size2D.getHeight(), net.sf.gridarta.utils.Size2D.getWidth(), net.sf.gridarta.model.mapgrid.MapGrid.GRID_FLAG_SELECTING, and net.sf.gridarta.model.mapgrid.MapGrid.unsetFlags().
Referenced by net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.deactivate(), net.sf.gridarta.mainactions.MainActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExpandEmptySelection(), net.sf.gridarta.gui.panel.connectionview.Control< Integer, G, A, R >.highlightSelectedEntries(), and net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.selectMapSquares().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.unSetCursor | ( | @NotNull final Point | pos | ) |
Un-highlights the given cursor position.
| pos | the map coordinates of square to un-highlight |
Definition at line 276 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.endTransaction(), and net.sf.gridarta.model.mapgrid.MapGrid.unsetFlags().
Referenced by net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.endTransaction().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Resets flags in a rectangle and generate a grid change event.
| minX | the left x-coordinate |
| minY | the left y-coordinate |
| maxX | the right x-coordinate |
| maxY | the right y-coordinate |
| flags | the flags to reset |
Definition at line 715 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.updateRecChange(), and net.sf.gridarta.model.mapgrid.MapGrid.updateSelectionFlag().
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.clearErrors(), net.sf.gridarta.model.mapgrid.MapGrid.resize(), net.sf.gridarta.model.mapgrid.MapGrid.selectArea(), net.sf.gridarta.model.mapgrid.MapGrid.unPreSelect(), net.sf.gridarta.model.mapgrid.MapGrid.unSelect(), net.sf.gridarta.model.mapgrid.MapGrid.unSetCursor(), and net.sf.gridarta.model.mapgrid.MapGrid.updatePreSelect().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.model.mapgrid.MapGrid.updatePreSelect | ( | @NotNull final Point | start, |
| @NotNull final Point | oldEnd, | ||
| @NotNull final Point | newEnd | ||
| ) |
Update the pre-selection rectangle.
The effect is identical to calling
except that smaller change events are generated.
| start | the coordinate of the common first point |
| oldEnd | the coordinate of the end point for selection deletion |
| newEnd | the coordinate of the end point for selection addition |
Definition at line 334 of file MapGrid.java.
References net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.endTransaction(), net.sf.gridarta.model.mapgrid.MapGrid.setFlags(), and net.sf.gridarta.model.mapgrid.MapGrid.unsetFlags().
Referenced by net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.dragTo().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Adds a point to the set of changes.
| x | the x-coordinate |
| y | the y-coordinate |
Definition at line 658 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.setFlags(), net.sf.gridarta.model.mapgrid.MapGrid.toggleFlags(), net.sf.gridarta.model.mapgrid.MapGrid.unsetFlags(), and net.sf.gridarta.model.mapgrid.MapGrid.updateSelectionFlag().
Here is the caller graph for this function:
|
private |
Updates the border selection flags of a square and its adjacent squares.
This function assumes the the square's selection state has changed.
| x | the x-coordinate of the square |
| y | the y-coordinate of the square |
| newState | the new square's selection state |
Definition at line 798 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.setFlags(), net.sf.gridarta.model.mapgrid.MapGrid.toggleFlags(), and net.sf.gridarta.model.mapgrid.MapGrid.unsetFlags().
Here is the caller graph for this function:
|
private |
Updates the border selection flags of a square and one adjacent square.
This function assumes the the square's selection state has changed.
| x | the x-coordinate of the square |
| y | the y-coordinate of the square |
| newState | the new square's selection state |
| dx | the x-coordinate of the adjacent square |
| dy | the y-coordinate of the adjacent square |
| flag | the border selection flag for the square |
| dFlag | the border selection flag for the adjacent square |
Definition at line 816 of file MapGrid.java.
References net.sf.gridarta.utils.Size2D.getHeight(), net.sf.gridarta.utils.Size2D.getWidth(), net.sf.gridarta.model.mapgrid.MapGrid.GRID_FLAG_SELECTION, and net.sf.gridarta.model.mapgrid.MapGrid.updateRecChange().
Here is the call graph for this function:
|
private |
Cached location of the cursor.
Definition at line 93 of file MapGrid.java.
|
private |
The return value for getSelectedRec().
Only valid if cachedSelectedRecValid is set.
Definition at line 87 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.getSelection().
|
private |
If set, cachedSelectedRec is up-to-date.
Definition at line 80 of file MapGrid.java.
|
private |
Right lower coordinates of rectangle that is being processed.
Definition at line 63 of file MapGrid.java.
|
private |
Left upper coordinates of rectangle that is being processed.
Definition at line 57 of file MapGrid.java.
|
static |
|
static |
Flag to highlight cursor position.
Normally there will only be up to one square that has this flag set.
Definition at line 134 of file MapGrid.java.
Referenced by net.sf.gridarta.gui.map.renderer.GridMapSquarePainter.paint().
|
static |
Flag to highlight as error.
Definition at line 118 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.clearErrors(), and net.sf.gridarta.gui.map.renderer.GridMapSquarePainter.paint().
|
static |
|
static |
|
static |
Pre-selection - used to preselect squares.
Definition at line 103 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapcursor.MapCursorTest.assertPreSelection(), net.sf.gridarta.gui.map.renderer.GridMapSquarePainter.paint(), and net.sf.gridarta.model.mapgrid.MapGrid.unSelect().
|
static |
Selection - marks all selected squares.
Definition at line 98 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapcursor.MapCursorTest.assertSelection(), net.sf.gridarta.action.ShrinkSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doShrinkSelection(), net.sf.gridarta.model.mapgrid.MapGrid.invertSelection(), net.sf.gridarta.gui.map.renderer.GridMapSquarePainter.paint(), net.sf.gridarta.model.mapgrid.MapGrid.resize(), net.sf.gridarta.model.mapgrid.MapGrid.selectAll(), net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.shift(), and net.sf.gridarta.model.mapgrid.MapGrid.updateSelectionFlag().
|
static |
Selection - is set for squares at the east edge of the selected area.
Definition at line 144 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapgrid.MapGridTest.checkSelectionBorder(), and net.sf.gridarta.gui.map.renderer.GridMapSquarePainter.paint().
|
static |
Selection - is set for squares at the north edge of the selected area.
Definition at line 139 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapgrid.MapGridTest.checkSelectionBorder(), and net.sf.gridarta.gui.map.renderer.GridMapSquarePainter.paint().
|
static |
Selection - is set for squares at the south edge of the selected area.
Definition at line 149 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapgrid.MapGridTest.checkSelectionBorder(), and net.sf.gridarta.gui.map.renderer.GridMapSquarePainter.paint().
|
static |
Selection - is set for squares at the west edge of the selected area.
Definition at line 154 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapgrid.MapGridTest.checkSelectionBorder(), and net.sf.gridarta.gui.map.renderer.GridMapSquarePainter.paint().
|
static |
|
private |
2D-array to store grid flags.
Definition at line 51 of file MapGrid.java.
|
private |
Size of.
.
Definition at line 69 of file MapGrid.java.
Referenced by net.sf.gridarta.model.mapgrid.MapGrid.getGridSize(), net.sf.gridarta.model.mapgrid.MapGrid.getSize(), and net.sf.gridarta.model.mapgrid.MapGrid.MapGrid().
|
private |
The MapGridListeners to inform of changes.
Definition at line 160 of file MapGrid.java.
|
private |
Rectangle to store location of last grid change.
Definition at line 75 of file MapGrid.java.
|
private |
The transaction depth.
A value of 0 means there's no transaction going on. A value > 0 means there's a transaction going on and denotes the nesting level.
Definition at line 168 of file MapGrid.java.
|
private |
The thread that performs the current transaction.
Definition at line 175 of file MapGrid.java.