From: <aki...@us...> - 2011-10-23 21:15:13
|
Revision: 9069 http://gridarta.svn.sourceforge.net/gridarta/?rev=9069&view=rev Author: akirschbaum Date: 2011-10-23 21:15:06 +0000 (Sun, 23 Oct 2011) Log Message: ----------- Add nullable annotations. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java Modified: trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java 2011-10-22 19:28:57 UTC (rev 9068) +++ trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java 2011-10-23 21:15:06 UTC (rev 9069) @@ -45,16 +45,19 @@ * Current cursor position. When cursor is active it is highlighted on the * MapGrid. */ + @NotNull private final Point pos = new Point(); /** * Position where dragging has started. */ + @NotNull private final Point dragStart = new Point(); /** * Offset of dragging. (0, 0) when drag is on the starting position. */ + @NotNull private final Dimension dragOffset = new Dimension(); /** @@ -70,22 +73,26 @@ /** * Grid where cursor is bound to. */ + @NotNull private final MapGrid mapGrid; /** * Used to test if coordinates are on the map. Created by MapGrid. */ + @NotNull private final Rectangle mapRec; /** * Temporary point used in some methods. Placed as instance var to prevent * creation of temporary objects. */ + @NotNull private final Point tmpPoint = new Point(); /** * The MapCursorListeners to inform of changes. */ + @NotNull private final EventListenerList2<MapCursorListener> listenerList = new EventListenerList2<MapCursorListener>(MapCursorListener.class); /** @@ -93,7 +100,7 @@ * construction. * @param mapGrid Cursor is bound to this grid */ - public MapCursor(final MapGrid mapGrid) { + public MapCursor(@NotNull final MapGrid mapGrid) { this.mapGrid = mapGrid; mapRec = mapGrid.getMapRec(); final MapGridListener mapGridListener = new MapGridListener() { @@ -278,7 +285,7 @@ * @param selectionMode Mode how to change selection state * @see SelectionMode */ - public void dragSelect(final SelectionMode selectionMode) { + public void dragSelect(@NotNull final SelectionMode selectionMode) { if (dragging) { mapGrid.beginTransaction(); try { @@ -321,6 +328,7 @@ /** * Get offset from start position of dragging. * @return offset or <code>null</code> when not in drag mode + * @noinspection NullableProblems */ @Nullable public Dimension getDragOffset() { @@ -366,7 +374,7 @@ * Register a MapCursorListener. * @param listener MapCursorListener to register */ - public void addMapCursorListener(final MapCursorListener listener) { + public void addMapCursorListener(@NotNull final MapCursorListener listener) { listenerList.add(listener); } @@ -374,7 +382,7 @@ * Remove a MapCursorListener. * @param listener MapCursorListener to remove */ - public void removeMapCursorListener(final MapCursorListener listener) { + public void removeMapCursorListener(@NotNull final MapCursorListener listener) { listenerList.remove(listener); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |