From: <aki...@us...> - 2008-07-28 20:40:37
|
Revision: 4549 http://gridarta.svn.sourceforge.net/gridarta/?rev=4549&view=rev Author: akirschbaum Date: 2008-07-28 20:40:45 +0000 (Mon, 28 Jul 2008) Log Message: ----------- Remove dependency MapRenderer -> StatusBar. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/MapRenderer.java trunk/daimonin/src/daieditor/gui/map/MapRenderer.java trunk/src/app/net/sf/gridarta/gui/StatusBar.java trunk/src/app/net/sf/gridarta/gui/map/LevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/MapRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapRenderer.java 2008-07-28 19:55:59 UTC (rev 4548) +++ trunk/crossfire/src/cfeditor/gui/map/MapRenderer.java 2008-07-28 20:40:45 UTC (rev 4549) @@ -87,19 +87,11 @@ filter = mainControl.getFilterControl(); this.mainControl = mainControl; this.editTypes = editTypes; - addMouseMotionListener(mainControl.getMainView().getStatusBar()); init(); } /** {@inheritDoc} */ @Override - public void closeNotify() { - removeMouseMotionListener(mainControl.getMainView().getStatusBar()); - super.closeNotify(); - } - - /** {@inheritDoc} */ - @Override protected void updateTile(final Point point) { final BufferedImage backBuffer = getBackBufferImage(); if (backBuffer == null) { Modified: trunk/daimonin/src/daieditor/gui/map/MapRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapRenderer.java 2008-07-28 19:55:59 UTC (rev 4548) +++ trunk/daimonin/src/daieditor/gui/map/MapRenderer.java 2008-07-28 20:40:45 UTC (rev 4549) @@ -63,18 +63,10 @@ super(mainControl, mapControl, mapGrid, IGUIConstants.TILE_ISO_XLEN, 2 * IGUIConstants.TILE_ISO_YLEN, faceObjects); this.mainControl = mainControl; this.editTypes = editTypes; - addMouseMotionListener(mainControl.getMainView().getStatusBar()); } /** {@inheritDoc} */ @Override - public void closeNotify() { - removeMouseMotionListener(mainControl.getMainView().getStatusBar()); - super.closeNotify(); - } - - /** {@inheritDoc} */ - @Override protected void clearBackground(@NotNull final Graphics grfx) { } Modified: trunk/src/app/net/sf/gridarta/gui/StatusBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/StatusBar.java 2008-07-28 19:55:59 UTC (rev 4548) +++ trunk/src/app/net/sf/gridarta/gui/StatusBar.java 2008-07-28 20:40:45 UTC (rev 4549) @@ -132,7 +132,7 @@ /** {@inheritDoc} */ public void mapViewCreated(@NotNull final MapView<G, A, R, V> mapView) { - // ignore + mapView.getMapViewBasic().getRenderer().addMouseMotionListener(StatusBar.this); } /** {@inheritDoc} */ @@ -142,7 +142,7 @@ /** {@inheritDoc} */ public void mapViewClosing(@NotNull final MapView<G, A, R, V> mapView) { - // ignore + mapView.getMapViewBasic().getRenderer().removeMouseMotionListener(StatusBar.this); } }; Modified: trunk/src/app/net/sf/gridarta/gui/map/LevelRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/LevelRenderer.java 2008-07-28 19:55:59 UTC (rev 4548) +++ trunk/src/app/net/sf/gridarta/gui/map/LevelRenderer.java 2008-07-28 20:40:45 UTC (rev 4549) @@ -20,6 +20,7 @@ package net.sf.gridarta.gui.map; import java.awt.Point; +import java.awt.event.MouseMotionListener; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; @@ -75,4 +76,16 @@ */ void printFullImage(File file) throws IOException; + /** + * Adds a {@link MouseMotionListener} to be notified about mouse events. + * @param mouseMotionListener the listener to add + */ + void addMouseMotionListener(@NotNull final MouseMotionListener mouseMotionListener); + + /** + * Removes a {@link MouseMotionListener} to be notified about mouse events. + * @param mouseMotionListener the listener to remove + */ + void removeMouseMotionListener(@NotNull final MouseMotionListener mouseMotionListener); + } // interface LevelRenderer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |