From: <aki...@us...> - 2008-03-02 15:08:05
|
Revision: 3640 http://gridarta.svn.sourceforge.net/gridarta/?rev=3640&view=rev Author: akirschbaum Date: 2008-03-02 07:07:07 -0800 (Sun, 02 Mar 2008) Log Message: ----------- Remove forwarding functions. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/MapActions.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/MapActions.java trunk/src/app/net/sf/gridarta/CopyBuffer.java trunk/src/app/net/sf/gridarta/gui/MainActions.java trunk/src/app/net/sf/gridarta/gui/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/map/MapViewBasic.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2008-03-02 14:54:59 UTC (rev 3639) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2008-03-02 15:07:07 UTC (rev 3640) @@ -146,7 +146,7 @@ /** {@inheritDoc} */ @Override @Nullable public MapSquare<GameObject, MapArchObject, Archetype> getCursorSquare() { try { - return mapModel.getMapSquare(getCursorPosition()); + return mapModel.getMapSquare(getMapCursor().getLocation()); } catch (final ArrayIndexOutOfBoundsException e) { return null; } Modified: trunk/crossfire/src/cfeditor/MapActions.java =================================================================== --- trunk/crossfire/src/cfeditor/MapActions.java 2008-03-02 14:54:59 UTC (rev 3639) +++ trunk/crossfire/src/cfeditor/MapActions.java 2008-03-02 15:07:07 UTC (rev 3640) @@ -428,7 +428,7 @@ return selectedExit.getHead(); } - final GameObject cursorExit = mapView.getMapControl().getMapModel().getExit(mapView.getView().getCursorPosition()); + final GameObject cursorExit = mapView.getMapControl().getMapModel().getExit(mapView.getView().getMapCursor().getLocation()); if (cursorExit != null && CFArchTypeList.isExitType(cursorExit.getHead()) && cursorExit.getHead().getAttributeString("slaying").length() > 0) { return cursorExit.getHead(); } Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2008-03-02 14:54:59 UTC (rev 3639) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2008-03-02 15:07:07 UTC (rev 3640) @@ -149,7 +149,7 @@ /** {@inheritDoc} */ @Override @Nullable public MapSquare<GameObject, MapArchObject, Archetype> getCursorSquare() { try { - return mapModel.getMapSquare(getCursorPosition()); + return mapModel.getMapSquare(getMapCursor().getLocation()); } catch (final ArrayIndexOutOfBoundsException e) { return null; } Modified: trunk/daimonin/src/daieditor/MapActions.java =================================================================== --- trunk/daimonin/src/daieditor/MapActions.java 2008-03-02 14:54:59 UTC (rev 3639) +++ trunk/daimonin/src/daieditor/MapActions.java 2008-03-02 15:07:07 UTC (rev 3640) @@ -417,7 +417,7 @@ return selectedExit.getHead(); } - final GameObject cursorExit = mapView.getMapControl().getMapModel().getExit(mapView.getView().getCursorPosition()); + final GameObject cursorExit = mapView.getMapControl().getMapModel().getExit(mapView.getView().getMapCursor().getLocation()); if (cursorExit != null && CFArchTypeList.isExitType(cursorExit.getHead()) && cursorExit.getHead().getAttributeString("slaying").length() > 0) { return cursorExit.getHead(); } Modified: trunk/src/app/net/sf/gridarta/CopyBuffer.java =================================================================== --- trunk/src/app/net/sf/gridarta/CopyBuffer.java 2008-03-02 14:54:59 UTC (rev 3639) +++ trunk/src/app/net/sf/gridarta/CopyBuffer.java 2008-03-02 15:07:07 UTC (rev 3640) @@ -230,7 +230,7 @@ * @param density the fill density in percent; -1 to disable */ public void fill(final MapView<G, A, R, C, V> mapView, final boolean fillBelow, final MapView<G, A, R, C, V> seed, final int density) { - if (!mapView.getView().hasSelection()) { + if (mapView.getView().getMapGrid().getSelectedRec() == null) { return; // should actually never happen } @@ -262,7 +262,7 @@ */ public void floodfill(@NotNull final MapView<G, A, R, C, V> mapView) { final V mapViewBasic = mapView.getView(); - final Point cursor = mapViewBasic.getCursorPosition(); + final Point cursor = mapViewBasic.getMapCursor().getLocation(); if (cursor == null) { return; } Modified: trunk/src/app/net/sf/gridarta/gui/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/MainActions.java 2008-03-02 14:54:59 UTC (rev 3639) +++ trunk/src/app/net/sf/gridarta/gui/MainActions.java 2008-03-02 15:07:07 UTC (rev 3640) @@ -677,7 +677,7 @@ * otherwise */ @Nullable private MapView<G, A, R, C, V> getSelection() { - return currentMapView != null && currentMapView.getView().hasSelection() ? currentMapView : null; + return currentMapView != null && currentMapView.getView().getMapGrid().getSelectedRec() != null ? currentMapView : null; } /** @@ -685,7 +685,7 @@ * @return the map view if a cursor exists, or <code>null</code> otherwise */ @Nullable private MapView<G, A, R, C, V> getCursor() { - return currentMapView != null && currentMapView.getView().hasCursor() ? currentMapView : null; + return currentMapView != null && currentMapView.getView().getMapCursor().isActive() ? currentMapView : null; } } // class MainActions Modified: trunk/src/app/net/sf/gridarta/gui/ReplaceDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/ReplaceDialog.java 2008-03-02 14:54:59 UTC (rev 3639) +++ trunk/src/app/net/sf/gridarta/gui/ReplaceDialog.java 2008-03-02 15:07:07 UTC (rev 3640) @@ -471,7 +471,7 @@ dialog.setVisible(false); ACTION_FACTORY.showMessageDialog(this, "replaceMapGone", mapView.getMapControl().getMapFileName()); return true; - } else if (!entireMap && !mapView.getView().hasSelection()) { + } else if (!entireMap && mapView.getView().getMapGrid().getSelectedRec() == null) { // user selected "replace highlighted" but nothing is highlighted ACTION_FACTORY.showMessageDialog(this, "replaceMapNoSelection", mapView.getMapControl().getMapFileName()); return false; Modified: trunk/src/app/net/sf/gridarta/gui/map/MapViewBasic.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapViewBasic.java 2008-03-02 14:54:59 UTC (rev 3639) +++ trunk/src/app/net/sf/gridarta/gui/map/MapViewBasic.java 2008-03-02 15:07:07 UTC (rev 3640) @@ -85,24 +85,6 @@ } /** - * Returns whether a selection exists. - * @return <code>true</code> if a selection exists, otherwise <code>false</code> - */ - public boolean hasSelection() { - return mapGrid.getSelectedRec() != null; - } - - /** - * Get the cursor position. - * The cursor position does not neccessarily mark a selection. - * Selection is independent of the cursor. - * @return cursor position - */ - @Nullable public Point getCursorPosition() { - return mapCursor.getLocation(); - } - - /** * Get the selection. * @return selection */ @@ -178,16 +160,6 @@ @Nullable public abstract MapSquare<G, A, R> getCursorSquare(); /** - * Determine if this map has an active cursor. - * - * @return <code>true</code> if this map has an active cursor, - * <code>false</code> otherwise - */ - public boolean hasCursor() { - return mapCursor.isActive(); - } - - /** * Register a MapCursorListener. * * @param listener MapCursorListener to register This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |