From: <aki...@us...> - 2010-05-07 21:30:10
|
Revision: 7697 http://gridarta.svn.sourceforge.net/gridarta/?rev=7697&view=rev Author: akirschbaum Date: 2010-05-07 21:30:03 +0000 (Fri, 07 May 2010) Log Message: ----------- Update comments. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-05-07 19:24:03 UTC (rev 7696) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-05-07 21:30:03 UTC (rev 7697) @@ -60,10 +60,14 @@ */ public abstract class AbstractFlatMapRenderer extends AbstractMapRenderer<GameObject, MapArchObject, Archetype> { - /** Serial Version UID. */ + /** + * The serial version UID. + */ private static final long serialVersionUID = 1L; - /** offset to map borders (32 for std. rect. maps, 0 for pickmaps). */ + /** + * The offset to map borders (32 for std. rect. maps, 0 for pickmaps). + */ @NotNull protected final Point borderOffset = new Point(); @@ -79,13 +83,21 @@ @NotNull private final GridMapSquarePainter gridMapSquarePainter; + /** + * The map size in squares. + */ @NotNull private Size2D mapSize; + /** + * The {@link MapGrid} to render. + */ @NotNull private final MapGrid mapGrid; - /** Used to avoid creation millions of points. */ + /** + * Temporary point. Used to avoid creating millions of points. + */ @NotNull private final Point tmpPoint = new Point(); @@ -95,11 +107,15 @@ @NotNull private final MapViewSettings mapViewSettings; + /** + * Temporary rectangle. Used to avoid creating millions of rectangles. + */ @NotNull private final Rectangle tmpRec = new Rectangle(); /** - * The {@link MapViewSettingsListener} attached to {@link #mapViewSettings}. + * The {@link MapViewSettingsListener} attached to {@link + * #mapViewSettings}. */ @NotNull private final MapViewSettingsListener mapViewSettingsListener = new MapViewSettingsListener() { @@ -142,7 +158,9 @@ }; - /** The map model listener to track changes in {@link #mapModel}. */ + /** + * The {@link MapModelListener} to track changes in {@link #mapModel}. + */ @NotNull private final MapModelListener<GameObject, MapArchObject, Archetype> mapModelListener = new MapModelListener<GameObject, MapArchObject, Archetype>() { @@ -164,7 +182,9 @@ } } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapObjectsChanged(@NotNull final Set<GameObject> gameObjects, @NotNull final Set<GameObject> transientGameObjects) { final Collection<MapSquare<GameObject, MapArchObject, Archetype>> toRepaint = new HashSet<MapSquare<GameObject, MapArchObject, Archetype>>(); @@ -210,31 +230,41 @@ } } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapMetaChanged() { // ignore } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void errorsChanged(@NotNull final ErrorCollector<GameObject, MapArchObject, Archetype> errors) { // ignore } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapFileChanged(@Nullable final File oldMapFile) { // ignore } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void modifiedChanged(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel) { // ignore } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapClosed() { // ignore @@ -242,11 +272,15 @@ }; - /** The map grid listener to track changes in {@link #mapGrid}. */ + /** + * The {@link MapGridListener} to track changes in {@link #mapGrid}. + */ @NotNull private final MapGridListener mapGridListener = new MapGridListener() { - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapGridChanged(@NotNull final MapGridEvent e) { final Rectangle recChange = mapGrid.getRecChange(); @@ -254,7 +288,9 @@ repaint(0L, borderOffset.x + recChange.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + recChange.y * IGUIConstants.SQUARE_HEIGHT, recChange.width * IGUIConstants.SQUARE_WIDTH, recChange.height * IGUIConstants.SQUARE_HEIGHT); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapGridResized(@NotNull final MapGridEvent e) { resizeMapGrid(); @@ -287,14 +323,18 @@ borderOffset.setLocation(borderSize, borderSize); } - /** Finish initialization of this instance. */ + /** + * Finishes initialization of this instance. + */ protected void init() { resizeMapGrid(); mapModel.addMapModelListener(mapModelListener); mapGrid.addMapGridListener(mapGridListener); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void closeNotify() { mapModel.removeMapModelListener(mapModelListener); @@ -302,7 +342,9 @@ mapViewSettings.removeMapViewSettingsListener(mapViewSettingsListener); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public BufferedImage getFullImage() { @@ -326,18 +368,24 @@ return bufImage; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public abstract void paintComponent(@NotNull final Graphics g); - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void forceRepaint() { updateAll(); repaint(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public Rectangle getSquareBounds(@NotNull final Point p) { @@ -349,8 +397,8 @@ } /** - * Paint one square. - * @param square The square to paint. + * Paints one square. + * @param square the square to paint */ private void paintSquare(@NotNull final MapSquare<GameObject, MapArchObject, Archetype> square) { final int x = square.getMapX(); @@ -378,7 +426,7 @@ } /** - * Paint the grid for one square. The grid is not painted if it is + * Paints the grid for one square. The grid is not painted if it is * disabled. * @param grfx the graphics context to draw in * @param point the map coordinates of the square to draw @@ -391,7 +439,7 @@ } /** - * Paint the selection for one square. + * Paints the selection for one square. * @param grfx the graphics context to draw in * @param point map coordinates of the square to highlight */ @@ -401,7 +449,7 @@ } /** - * Paint the whole map. + * Paints the whole map. * @param grfx the graphics context to draw in * @param checkClip if set, omit squares outside <code>grfx</code>'s clip * area @@ -419,7 +467,7 @@ } /** - * Paint the selection for the whole map. It's recommended to paint the + * Paints the selection for the whole map. It's recommended to paint the * complete selection after the map itself, otherwise map elements actually * might hide selections. * @param grfx Graphics for painting @@ -437,10 +485,10 @@ } /** - * Paint the grid of the whole map. The grid is not painted if it is + * Paints the grid of the whole map. The grid is not painted if it is * disabled. It's recommended to paint the complete grid after the map * itself, otherwise map elements actually might hide parts of the grid. - * @param grfx Graphics for painting + * @param grfx the graphics for painting */ private void paintMapGrid(@NotNull final Graphics grfx) { if (mapViewSettings.isGridVisible()) { @@ -456,7 +504,9 @@ } } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Nullable @Override public Point getSquareLocationAt(@NotNull final Point point, @Nullable final Point retPoint) { @@ -484,22 +534,24 @@ } /** - * Resize the backing buffer to the new grid size. It will only be resized + * Resizes the backing buffer to the new grid size. It will only be resized * if the map is not a pickmap. * @param size the new map size */ protected abstract void resizeBackBuffer(@NotNull final Dimension size); /** - * Paint one square. + * Paints one square. * @param grfx the graphics context to draw to - * @param x The square coordinate to paint to. - * @param y The square coordinate to paint to. - * @param square The square to paint. + * @param x the square coordinate to paint to + * @param y the square coordinate to paint to + * @param square the square to paint */ protected abstract void paintSquare(@NotNull final Graphics grfx, final int x, final int y, @NotNull final MapSquare<GameObject, MapArchObject, Archetype> square); - /** Update cached information to new map grid size. */ + /** + * Updats cached information to new map grid size. + */ private void resizeMapGrid() { // define how much drawing space we need for the map mapSize = mapGrid.getSize(); @@ -523,10 +575,14 @@ */ protected abstract void updateSquares(@NotNull final Rectangle rectangle); - /** Callback function that is called when any square may have changed. */ + /** + * Callback function that is called when any square may have changed. + */ protected abstract void updateAll(); - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setErroneousArchObjects(@NotNull final Map<GameObject, ValidationError<GameObject, MapArchObject, Archetype>> erroneousArchObjects) { //XXX: save erroneousArchObjects Modified: trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java 2010-05-07 19:24:03 UTC (rev 7696) +++ trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java 2010-05-07 21:30:03 UTC (rev 7697) @@ -185,6 +185,11 @@ return tilePanels; } + /** + * Builds all {@link TilePanel TilePanels} for all directions. + * @param directionMapping the directions + * @return the tile panels + */ @NotNull private TilePanel[] createTilePanels(@NotNull final DirectionLayout.Direction[] directionMapping) { final TilePanel[] tilePanels = new TilePanel[directionMapping.length]; @@ -196,7 +201,8 @@ /** * Builds the tile panel. - * @return The newly built tile panel. + * @param tilePaths the tile panels + * @return the newly built tile panel */ @NotNull private static Component buildTilePanels(@NotNull final TilePanel[] tilePaths) { @@ -209,9 +215,9 @@ } /** - * Creates the subPanel that holds the buttons to attach maps or clear all + * Creates the sub-panel that holds the buttons to attach maps or clear all * paths. - * @return The newly built subPanel. + * @return the newly built sub-panel */ @NotNull private Component buildSubPanel() { @@ -231,12 +237,16 @@ return subPanel; } - /** Action method for tiles attaching automatically. */ + /** + * Action method for tiles attaching automatically. + */ public void mapTilesAttach() { attachTiledMap(); } - /** Action method for tiles clearing paths. */ + /** + * Action method for tiles clearing paths. + */ public void mapTilesClear() { for (final TilePanel tilePath : tilePaths) { tilePath.setText("", true); @@ -244,8 +254,8 @@ } /** - * This method looks for all maps surrounding the current map and tries to - * perform the reverse attachment. + * Looks for all maps surrounding the current map and tries to perform the + * reverse attachment. * @fixme If you think this method sucks for it's complexity, you're right. * This method needs refactoring badly. * @fixme I think this method might fail in case one of the other maps this @@ -401,6 +411,13 @@ return mapManager.openMapFile(file, false); } + /** + * Returns the map path for a tile of a map and a tile path. + * @param base the map path of the map + * @param link the tile path of the map; may be relative to + * <code>base</code> + * @return the map path + */ @Nullable private String getTilePath(@NotNull final String base, @NotNull final String link) { final int pos = getLastSlashIndex(base); @@ -436,6 +453,12 @@ return link.substring(mapdir.length()).trim().replaceAll(sep, "/"); } + /** + * Returns the index of the last '/' or {@link File#separator} within a + * string. + * @param base the string + * @return the index or <code>-1</code> if not found + */ private static int getLastSlashIndex(@NotNull final String base) { final int slashIndex1 = base.lastIndexOf('/'); final int separatorIndex1 = base.lastIndexOf(File.separator); @@ -456,11 +479,13 @@ } } - /** Restore settings from the map. */ + /** + * Restores the settings from the map. + */ public void restoreMapProperties() { for (final TilePanel tilePath : tilePaths) { tilePath.mapTileRevert(); } } -} // class MapTilePane +} // class AbstractMapTilePane Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-07 19:24:03 UTC (rev 7696) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-07 21:30:03 UTC (rev 7697) @@ -60,7 +60,9 @@ */ public abstract class AbstractIsoMapRenderer<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractMapRenderer<G, A, R> { - /** Serial Version UID. */ + /** + * The serial version UID. + */ private static final long serialVersionUID = 1L; /** @@ -68,27 +70,46 @@ */ private final int spawnPointTypeNo; - /** offset to map borders (32 for std. rect. maps, 0 for pickmaps). */ + /** + * The offset to map borders (32 for std. rect. maps, 0 for pickmaps). + */ @NotNull private final Point borderOffset; - /** The origin is the point in the north-west corner. */ + /** + * The origin is the point in the north-west corner. + */ @NotNull private final Point origin = new Point(); + /** + * The {@link MapModel} to render. + */ @NotNull private final MapModel<G, A, R> mapModel; + /** + * The size of the map to render. + */ @NotNull private Size2D mapSize; + /** + * The {@link MapGrid} to render. + */ @NotNull private final MapGrid mapGrid; + /** + * The {@link Icon} drawn into squares without {@link GameObject + * GameObjects}. + */ @NotNull private final Icon unknownSquareIcon; - /** Used to avoid creation millions of points. */ + /** + * Temporary point. Used to avoid creating millions of points. + */ @NotNull private final Point tmpPoint = new Point(); @@ -117,42 +138,55 @@ private final GridMapSquarePainter gridMapSquarePainter; /** - * The {@link MapViewSettingsListener} attached to {@link #mapViewSettings}. + * The {@link MapViewSettingsListener} attached to {@link + * #mapViewSettings}. */ @NotNull private final MapViewSettingsListener mapViewSettingsListener = new MapViewSettingsListener() { - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void gridVisibleChanged(final boolean gridVisible) { forceRepaint(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void smoothingChanged(final boolean smoothing) { // does not render smoothed faces } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void doubleFacesChanged(final boolean doubleFaces) { forceRepaint(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void alphaTypeChanged(final int alphaType) { forceRepaint(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void editTypeChanged(final int editType) { // changed game objects will be rendered } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void autojoinChanged(final boolean autojoin) { // ignore @@ -160,53 +194,71 @@ }; - /** The map model listener to track changes in {@link #mapModel}. */ + /** + * The {@link MapModelListener} to track changes in {@link #mapModel}. + */ @NotNull private final MapModelListener<G, A, R> mapModelListener = new MapModelListener<G, A, R>() { - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { // ignore: will trigger an mapGridChanged() callback } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) { repaint(); // TODO: only repaint a specific region } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) { repaint(); // TODO: only repaint a specific region } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapMetaChanged() { // ignore } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) { // ignore } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapFileChanged(@Nullable final File oldMapFile) { // ignore } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { // ignore } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapClosed() { // ignore @@ -214,17 +266,23 @@ }; - /** The map grid listener to track changes in {@link #mapGrid}. */ + /** + * The {@link MapGridListener} to track changes in {@link #mapGrid}. + */ @NotNull private final MapGridListener mapGridListener = new MapGridListener() { - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapGridChanged(@NotNull final MapGridEvent e) { repaint(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void mapGridResized(@NotNull final MapGridEvent e) { mapSize = e.getSource().getSize(); @@ -274,7 +332,9 @@ mapGrid.addMapGridListener(mapGridListener); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void closeNotify() { mapModel.removeMapModelListener(mapModelListener); @@ -283,15 +343,15 @@ } /** - * The origin which is located in the NORTH_WEST-corner of the map is - * calculated. On non-pickmaps there is an extra border. + * Calculates the origin which is located in the NORTH_WEST-corner of the + * map. On non-pickmaps there is an extra border. */ private void calculateOrigin() { origin.setLocation(borderOffset.x + mapSize.getHeight() * isoMapSquareInfo.getXlen2(), borderOffset.y); } /** - * Sets offset to map borders (32 for std. rect. maps, 0 for pickmaps). + * Sets the offset to map borders (32 for std. rect. maps, 0 for pickmaps). * @param x x offset to map borders (32 for std. rect. maps, 0 for * pickmaps) * @param y y offset to map borders (32 for std. rect. maps, 0 for @@ -302,7 +362,9 @@ calculateOrigin(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public BufferedImage getFullImage() { @@ -342,21 +404,30 @@ return image; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void paintComponent(@NotNull final Graphics g) { paintComponent2((Graphics2D) g); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void forceRepaint() { repaint(); } + /** + * Temporary rectangle. Used to avoid creating millions of rectangles. + */ private final Rectangle tmpRec = new Rectangle(); - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public Rectangle getSquareBounds(@NotNull final Point p) { @@ -368,17 +439,17 @@ } /** - * Clear the window to background color if necessary. + * Clears the window to background color if necessary. * @param grfx Graphics to use for clearing. */ protected abstract void clearBackground(@NotNull final Graphics grfx); /** - * Paint one square. - * @param grfx The graphics context to paint to. - * @param x The square coordinate to paint to. - * @param y The square coordinate to paint to. - * @param square The square to paint. + * Paints one square. + * @param grfx the graphics context to paint to + * @param x the square coordinate to paint to + * @param y the square coordinate to paint to + * @param square the square to paint */ protected abstract void paintSquare(@NotNull final Graphics2D grfx, final int x, final int y, @NotNull final MapSquare<G, A, R> square); @@ -411,9 +482,9 @@ } /** - * Get smallest Rectangle on map that needs to be repaint. - * @param visRec visible Rectangle - * @return rectangle on the map. + * Returns smallest {@link Rectangle} on the map that needs to be repaint. + * @param visRec the visible rectangle + * @return the rectangle to repaint */ private Rectangle getRepaintRec(@NotNull final Rectangle visRec) { // This Rectangle will be returned @@ -441,10 +512,10 @@ protected abstract boolean isGameObjectVisible(@NotNull final G gameObject); /** - * Paints a single GameObject. - * @param grfx Graphics to paint to - * @param xstart x offset for painting - * @param ystart y offset for painting + * Paints a single {@link GameObject}. + * @param grfx the graphics to paint to + * @param xstart the x offset for painting + * @param ystart the y offset for painting * @param gameObject the game object to paint */ protected void paintGameObject(@NotNull final Graphics2D grfx, final int xstart, final int ystart, @NotNull final G gameObject) { @@ -491,10 +562,10 @@ } /** - * Paint the selection for the whole map. It's recommended to paint the + * Paints the selection for the whole map. It's recommended to paint the * complete selection after the map itself, otherwise map elements actually * might hide selections. - * @param grfx Graphics for painting + * @param grfx the graphics for painting */ private void paintMapSelection(@NotNull final Graphics grfx) { for (int y = 0; y < mapSize.getHeight(); y++) { @@ -516,10 +587,10 @@ } /** - * Paint the grid of the whole map. The grid is not painted if it is + * Paints the grid of the whole map. The grid is not painted if it is * disabled. It's recommended to paint the complete grid after the map * itself, otherwise map elements actually might hide parts of the grid. - * @param grfx Graphics for painting + * @param grfx the graphics for painting */ private void paintMapGrid(@NotNull final Graphics grfx) { if (mapViewSettings.isGridVisible()) { @@ -543,7 +614,9 @@ } } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Nullable @Override public Point getSquareLocationAt(@NotNull final Point point, @Nullable final Point retPoint) { @@ -564,13 +637,17 @@ return new Point(xm, ym); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setErroneousArchObjects(@NotNull final Map<G, ValidationError<G, A, R>> erroneousArchObjects) { //XXX: save erroneousArchObjects } - /** Refreshes the data in the view from the model. */ + /** + * Refreshes the data in the view from the model. + */ private void resizeFromModel() { // define how much drawing space we need for the map final int sum = mapSize.getWidth() + mapSize.getHeight(); Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-07 19:24:03 UTC (rev 7696) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-07 21:30:03 UTC (rev 7697) @@ -30,16 +30,26 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +/** + * Abstract base class for {@link Archetype} implementations. + * @author Andreas Kirschbaum + */ public abstract class AbstractArchetype<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractBaseObject<G, A, R, R> implements Archetype<G, A, R> { /** - * The name of the Archetype associated with this GameObject or the - * Archetypes name itself if this GameObject is an Archetype. + * The name of this archetype. * @serial */ @NotNull private String archetypeName; + /** + * Creates a new instance. + * @param archetypeName the name of the archetype + * @param faceObjectProviders the face object providers for looking up + * faces + * @param animationObjects the animation objects for looking up animations + */ protected AbstractArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { super(faceObjectProviders, animationObjects); this.archetypeName = archetypeName.intern(); Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java 2010-05-07 19:24:03 UTC (rev 7696) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java 2010-05-07 21:30:03 UTC (rev 7697) @@ -249,16 +249,55 @@ } } + /** + * Called whan a new archetype starts. + */ protected abstract void initParseArchetype(); + /** + * Returns whether a give input line denotes the start of a new archetype. + * @param line the input line + * @return whether the line is a start line + */ protected abstract boolean isStartLine(@NotNull final String line); + /** + * Called for each processed line. + * @param in the reader reading the archetype definition + * @param line the input line + * @param line2 the tripped input line + * @param archetypeBuilder the archetype builder for the current archetype + * @param errorViewCollector the error view collector for reporting errors + * @param invObjects the inventory objects of the current archetype + * @return whether the line has been consumed + * @throws IOException if an I/O error occurs + */ protected abstract boolean processLine(@NotNull final BufferedReader in, @NotNull final String line, @NotNull final String line2, @NotNull final B archetypeBuilder, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final List<G> invObjects) throws IOException; + /** + * Called after the "end" line of a tail part has been read. + * @param firstArch the head part + * @param archetype the tail part + * @param errorViewCollector the error view collector for reporting errors + */ protected abstract void finishParseArchetypePart(@NotNull final R firstArch, @NotNull final R archetype, @NotNull final ErrorViewCollector errorViewCollector); + /** + * Called after the "end" line. For tail parts {@link + * #finishParseArchetypePart(Archetype, Archetype, ErrorViewCollector)} is + * called first. + * @param archetype the archetype + * @param archmore whether another part follows + */ protected abstract void finishParseArchetype(@NotNull final R archetype, final boolean archmore); + /** + * Returns whether an archetype should be added to the archetype chooser. + * @param isInternPath whether the archetype's path contains "/intern/" + * @param editorFolder the editor_folder attribute + * @param archetype the archetype to add + * @return whether the archetype should be added + */ protected abstract boolean addToPanel(final boolean isInternPath, @Nullable final String editorFolder, @NotNull final R archetype); } // class AbstractArchetypeParser Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2010-05-07 19:24:03 UTC (rev 7696) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2010-05-07 21:30:03 UTC (rev 7697) @@ -188,6 +188,9 @@ listenerList.remove(listener); } + /** + * Notifies all listeners that {@link #isLoadedFromArchive()} has changed. + */ private void fireLoadedFromArchiveChangedEvent() { for (final ArchetypeSetListener<G, A, R> listener : listenerList.getListeners()) { listener.loadedFromArchiveChanged(); @@ -259,6 +262,12 @@ } } + /** + * Processes the special archetype {@link ArchetypeParser#STARTARCH_NAME}. + * @param arch the archetype + * @param out the writer collecting into + * @throws IOException if an I/O error occurs + */ private static void collectStartArch(@NotNull final BaseObject<?, ?, ?, ?> arch, @NotNull final Writer out) throws IOException { out.append("Object ").append(arch.getArchetypeName()).append('\n'); @@ -275,6 +284,13 @@ out.append("end\n"); } + /** + * Collects an {@link Archetype}: writes its definition into a writer. + * @param arch the archetype + * @param out the writer + * @return the number of archetype parts written + * @throws IOException if an I/O error occurs + */ protected abstract int collectArch(@NotNull final R arch, @NotNull final Writer out) throws IOException; } // class AbstractArchetypeSet Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-07 19:24:03 UTC (rev 7696) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-07 21:30:03 UTC (rev 7697) @@ -1086,7 +1086,10 @@ this.multi = multi; } - // face name + /** + * Sets the effective face name. + * @param faceObjName the face name + */ private void setFaceObjName(@Nullable final String faceObjName) { final String newFaceObjName = faceObjName != null ? faceObjName.intern() : null; // Using == on these Strings is okay, they are both interned. Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-05-07 19:24:03 UTC (rev 7696) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-05-07 21:30:03 UTC (rev 7697) @@ -30,38 +30,50 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +/** + * Abstract base class of {@link GameObject} implementations. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author Andreas Kirschbaum + */ public abstract class AbstractGameObject<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractBaseObject<G, A, R, G> implements GameObject<G, A, R> { /** - * The name of the Archetype associated with this GameObject or the - * Archetypes name itself if this GameObject is an Archetype. + * The name of the {@link Archetype} associated with this game object. * @serial */ @NotNull private String archetypeName; /** - * The {@link Archetype} of this game object. Set to <code>null</code> for - * archetypes. + * The {@link Archetype} of this game object. Set to <code>null</code> if + * not yet known. * @serial */ @Nullable private R archetype; /** - * Container of this GameObject. There are two possibilities for the - * container: + * Container of this {@link GameObject}. There are two possibilities for + * the container: * <ul> - * <li>Another GameObject, which means this object is in the inventory of - * that GameObject.</li> - * <li>A MapSquare, which means that this GameObject is top level on that - * MapSquare.</li> + * <li>Another game object, which means this object is in the inventory of + * that game object.</li> + * <li>A {@link MapSquare}, which means that this game object is top level + * on that map square.</li> * </ul> * @serial */ @Nullable private GameObjectContainer<G, A, R> container = null; + /** + * Creates a new instance. + * @param archetypeName the name of the archetype associated with this game + * object + * @param faceObjectProviders the face object providers for looking up + * faces + * @param animationObjects the animation objects for looking up animations + */ protected AbstractGameObject(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { super(faceObjectProviders, animationObjects); this.archetypeName = archetypeName.intern(); @@ -69,6 +81,13 @@ updateArchetype(); } + /** + * Creates a new instance. + * @param archetype the archetype associated with with game object + * @param faceObjectProviders the face object providers for looking up + * faces + * @param animationObjects the animation objects for looking up animations + */ protected AbstractGameObject(@NotNull final R archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { super(faceObjectProviders, animationObjects); archetypeName = archetype.getArchetypeName(); Modified: trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java 2010-05-07 19:24:03 UTC (rev 7696) +++ trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java 2010-05-07 21:30:03 UTC (rev 7697) @@ -44,45 +44,69 @@ */ private static final long serialVersionUID = 1; - /** Name of an unnamed map. */ + /** + * The name of an unnamed map. + */ @NotNull public static final String MAP_NAME_UNNAMED = "<unnamed>"; + /** + * The prefix for the map attribute that is updated with the last + * modification timestamp. + */ private static final String MODIFIED_ATTRIBUTE = "Modified:"; - /** The pattern to find the "Modified:" attribute in the message text. */ + /** + * The pattern to find the {@link #MODIFIED_ATTRIBUTE} in the message text. + */ private static final Pattern MODIFIED_ATTRIBUTE_PATTERN = Pattern.compile("^" + MODIFIED_ATTRIBUTE + " *(.*)$", Pattern.MULTILINE); - /** The map text. */ + /** + * The map text. + */ private StringBuilder msgText = new StringBuilder(); - /** The size of the map reflected by this MapArchObject. */ + /** + * The size of the map reflected by this map arch object. + */ @NotNull private Size2D mapSize = Size2D.ONE; - /** The name of this map. */ + /** + * The name of this map. + */ @NotNull private String mapName = MAP_NAME_UNNAMED; - /** The x coordinate for entering the map. */ + /** + * The x coordinate for entering the map. + */ private int enterX; - /** The y coordinate for entering the map. */ + /** + * The y coordinate for entering the map. + */ private int enterY; - /** If set, this is an outdoor map. */ + /** + * If set, this is an outdoor map. + */ private boolean outdoor = false; - /** Number of seconds that need to elapse before this map will be reset. */ + /** + * The number of ticks that need to elapse before this map will be reset. + */ private int resetTimeout; /** - * Number of ticks that must elapse after tha map has not been used before - * it gets swapped out. + * The number of ticks that must elapse after tha map has not been used + * before it gets swapped out. */ private int swapTime; - /** Map difficulty. If zero, server calculates something. */ + /** + * The map difficulty. If zero, server calculates something. + */ private int difficulty; /** @@ -91,16 +115,20 @@ */ private boolean fixedReset; - /** Light / darkness of map (overall). Zero means fully bright. */ + /** + * The light / darkness of map (overall). Zero means fully bright. + */ private int darkness; /** - * The map tile paths used for map tiling. 0 = north, 1 = east, 2 = south, 3 - * = west. 4 = northeast, 5 = southeast, 6 = southwest, 7 = northwest + * The map tile paths used for map tiling. 0 = north, 1 = east, 2 = south, + * 3 = west. 4 = northeast, 5 = southeast, 6 = southwest, 7 = northwest */ private String[] tilePaths = new String[8]; - /** The registered event listeners. */ + /** + * The registered event listeners. + */ private final EventListenerList2<MapArchObjectListener<A>> listenerList = new EventListenerList2<MapArchObjectListener<A>>(MapArchObjectListener.class); /** @@ -118,7 +146,9 @@ @Nullable private transient Thread transactionThread; - /** Set if any attribute has changed inside the current transaction. */ + /** + * Set if any attribute has changed inside the current transaction. + */ private boolean attributeHasChanged = false; /** @@ -128,14 +158,18 @@ Arrays.fill(tilePaths, ""); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public Size2D getMapSize() { return mapSize; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setMapSize(@NotNull final Size2D mapSize) { if (this.mapSize.equals(mapSize)) { @@ -146,14 +180,18 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public String getMapName() { return mapName; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setMapName(@NotNull final String name) { final String trimmedName = name.trim(); @@ -165,13 +203,17 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public int getEnterX() { return enterX; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setEnterX(final int enterX) { if (this.enterX == enterX) { @@ -182,13 +224,17 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public int getEnterY() { return enterY; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setEnterY(final int enterY) { if (this.enterY == enterY) { @@ -199,20 +245,26 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public Point getEnter() { return new Point(enterX, enterY); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean isOutdoor() { return outdoor; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setOutdoor(final boolean outdoor) { if (this.outdoor == outdoor) { @@ -223,13 +275,17 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public int getResetTimeout() { return resetTimeout; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setResetTimeout(final int resetTimeout) { if (this.resetTimeout == resetTimeout) { @@ -240,13 +296,17 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public int getSwapTime() { return swapTime; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setSwapTime(final int swapTime) { if (this.swapTime == swapTime) { @@ -257,13 +317,17 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public int getDifficulty() { return difficulty; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setDifficulty(final int difficulty) { if (this.difficulty == difficulty) { @@ -274,13 +338,17 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean isFixedReset() { return fixedReset; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setFixedReset(final boolean fixedReset) { if (this.fixedReset == fixedReset) { @@ -291,13 +359,17 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public int getDarkness() { return darkness; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setDarkness(final int darkness) { if (this.darkness == darkness) { @@ -308,20 +380,26 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public int getTilePaths() { return tilePaths.length; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public String getTilePath(final int direction) { return tilePaths[direction]; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setTilePath(final int direction, @NotNull final String tilePath) { if (tilePaths[direction].equals(tilePath)) { @@ -332,7 +410,9 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setState(@NotNull final A mapArchObject) { final AbstractMapArchObject<A> abstractMapArchObject = (AbstractMapArchObject<A>) mapArchObject; @@ -352,7 +432,9 @@ } } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean equals(@Nullable final Object obj) { if (obj == this) { @@ -376,7 +458,9 @@ && Arrays.equals(mapArchObject.tilePaths, tilePaths); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public int hashCode() { return msgText.hashCode() @@ -393,28 +477,33 @@ + Arrays.hashCode(tilePaths); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void addMapArchObjectListener(@NotNull final MapArchObjectListener<A> listener) { listenerList.add(listener); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void removeMapArchObjectListener(@NotNull final MapArchObjectListener<A> listener) { listenerList.remove(listener); } /** - * Method to notify the map arch object that it has changed. The map arch - * object then notifies the registered listeners of the change at the end of - * the transaction. + * Marks this map arch object as changed. The map arch object then notifies + * the registered listeners of the change at the end of the transaction. */ protected void setModified() { attributeHasChanged = true; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void beginTransaction() { if (transactionDepth == 0) { @@ -430,13 +519,17 @@ transactionDepth++; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void endTransaction() { endTransaction(false); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void endTransaction(final boolean fireEvent) { if (transactionDepth <= 0) { @@ -454,8 +547,8 @@ } /** - * Performs ending a transaction. Resets all transaction states and fires an - * event. + * Performs ending a transaction. Resets all transaction states and fires + * an event. */ private void commitTransaction() { transactionDepth = 0; @@ -466,14 +559,18 @@ } } - /** Fire a MapMetaChangedEvent. */ + /** + * Fires a MapMetaChangedEvent. + */ private void fireMetaChangedEvent() { for (final MapArchObjectListener<A> listener : listenerList.getListeners()) { listener.mapMetaChanged(); } } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void addText(@NotNull final String text) { if (text.length() == 0) { @@ -484,7 +581,9 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setText(final String text) { if (msgText.toString().equals(text)) { @@ -496,14 +595,18 @@ setModified(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public String getText() { return msgText.toString(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void updateModifiedAttribute(@NotNull final String username) { final String modifiedAttribute = MODIFIED_ATTRIBUTE + " " + String.format("%tF", System.currentTimeMillis()) + " " + username; @@ -521,7 +624,9 @@ } } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public A clone() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-07 21:45:34
|
Revision: 7700 http://gridarta.svn.sourceforge.net/gridarta/?rev=7700&view=rev Author: akirschbaum Date: 2010-05-07 21:45:28 +0000 (Fri, 07 May 2010) Log Message: ----------- Rewrite MapArchObject.clone(). Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java trunk/src/app/net/sf/gridarta/model/map/maparchobject/MapArchObject.java trunk/src/test/net/sf/gridarta/model/map/maparchobject/TestMapArchObject.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2010-05-07 21:38:28 UTC (rev 7699) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2010-05-07 21:45:28 UTC (rev 7700) @@ -393,7 +393,7 @@ /** {@inheritDoc} */ @NotNull @Override - public MapArchObject clone() { + public Object clone() { return super.clone(); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java 2010-05-07 21:38:28 UTC (rev 7699) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java 2010-05-07 21:45:28 UTC (rev 7700) @@ -445,8 +445,8 @@ /** {@inheritDoc} */ @NotNull @Override - public MapArchObject clone() { - final MapArchObject clone = super.clone(); + public Object clone() { + final MapArchObject clone = (MapArchObject) super.clone(); clone.loreText = new StringBuilder(loreText.toString()); return clone; } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java 2010-05-07 21:38:28 UTC (rev 7699) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java 2010-05-07 21:45:28 UTC (rev 7700) @@ -355,7 +355,7 @@ /** {@inheritDoc} */ @NotNull @Override - public MapArchObject clone() { + public Object clone() { return super.clone(); } Modified: trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java 2010-05-07 21:38:28 UTC (rev 7699) +++ trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java 2010-05-07 21:45:28 UTC (rev 7700) @@ -108,7 +108,7 @@ @Override public void beginTransaction(@NotNull final MapModel<G, A, R> mapModel, @NotNull final String name) { undoModel = undoModels.get(mapModel); - undoState = new UndoState<G, A, R>(name, mapModel.getMapArchObject().clone()); + undoState = new UndoState<G, A, R>(name, (A) mapModel.getMapArchObject().clone()); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java 2010-05-07 21:38:28 UTC (rev 7699) +++ trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java 2010-05-07 21:45:28 UTC (rev 7700) @@ -629,16 +629,16 @@ */ @NotNull @Override - public A clone() { - final AbstractMapArchObject<A> clone; + public Object clone() { + final AbstractMapArchObject<?> clone; try { - clone = (AbstractMapArchObject<A>) super.clone(); + clone = (AbstractMapArchObject<?>) super.clone(); } catch (final CloneNotSupportedException ex) { throw new AssertionError(); } clone.msgText = new StringBuilder(msgText.toString()); clone.tilePaths = tilePaths.clone(); - return (A) clone; + return clone; } } // class AbstractMapArchObject Modified: trunk/src/app/net/sf/gridarta/model/map/maparchobject/MapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/maparchobject/MapArchObject.java 2010-05-07 21:38:28 UTC (rev 7699) +++ trunk/src/app/net/sf/gridarta/model/map/maparchobject/MapArchObject.java 2010-05-07 21:45:28 UTC (rev 7700) @@ -32,7 +32,7 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @author Andreas Kirschbaum */ -public interface MapArchObject<A extends MapArchObject<A>> extends Serializable { +public interface MapArchObject<A extends MapArchObject<A>> extends Cloneable, Serializable { /** * Reset the state of this object to the state of the given map arch @@ -198,7 +198,7 @@ * @return Newly created clone of this object. */ @NotNull - A clone(); + Object clone(); /** * Register an event listener. Modified: trunk/src/test/net/sf/gridarta/model/map/maparchobject/TestMapArchObject.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/map/maparchobject/TestMapArchObject.java 2010-05-07 21:38:28 UTC (rev 7699) +++ trunk/src/test/net/sf/gridarta/model/map/maparchobject/TestMapArchObject.java 2010-05-07 21:45:28 UTC (rev 7700) @@ -27,7 +27,7 @@ * A {@link MapArchObject} implementation for testing purposes. * @author Andreas Kirschbaum */ -public class TestMapArchObject implements Cloneable, MapArchObject<TestMapArchObject> { +public class TestMapArchObject implements MapArchObject<TestMapArchObject> { /** * The serial version UID. @@ -201,9 +201,9 @@ /** {@inheritDoc} */ @NotNull @Override - public TestMapArchObject clone() { + public Object clone() { try { - return (TestMapArchObject) super.clone(); + return super.clone(); } catch (final CloneNotSupportedException ex) { throw new AssertionError(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-08 13:24:31
|
Revision: 7705 http://gridarta.svn.sourceforge.net/gridarta/?rev=7705&view=rev Author: akirschbaum Date: 2010-05-08 13:24:24 +0000 (Sat, 08 May 2010) Log Message: ----------- CTRL-ALT-E now toggles the game object text editor: activate it if inactive; restore previous state otherwise. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTab.java trunk/src/app/net/sf/gridarta/gui/misc/MainView.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/ButtonList.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-08 12:32:10 UTC (rev 7704) +++ trunk/atrinik/ChangeLog 2010-05-08 13:24:24 UTC (rev 7705) @@ -1,3 +1,8 @@ +2010-05-08 Andreas Kirschbaum + + * CTRL-ALT-E now toggles the game object text editor: activate it + if inactive; restore previous state otherwise. + 2010-05-07 Andreas Kirschbaum * Add keyboard shortcut (CTRL-ALT-E) to activate the game object Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-08 12:32:10 UTC (rev 7704) +++ trunk/crossfire/ChangeLog 2010-05-08 13:24:24 UTC (rev 7705) @@ -1,3 +1,8 @@ +2010-05-08 Andreas Kirschbaum + + * CTRL-ALT-E now toggles the game object text editor: activate it + if inactive; restore previous state otherwise. + 2010-05-07 Andreas Kirschbaum * Add keyboard shortcut (CTRL-ALT-E) to activate the game object Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-08 12:32:10 UTC (rev 7704) +++ trunk/daimonin/ChangeLog 2010-05-08 13:24:24 UTC (rev 7705) @@ -1,3 +1,8 @@ +2010-05-08 Andreas Kirschbaum + + * CTRL-ALT-E now toggles the game object text editor: activate it + if inactive; restore previous state otherwise. + 2010-05-07 Andreas Kirschbaum * Add keyboard shortcut (CTRL-ALT-E) to activate the game object Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-05-08 12:32:10 UTC (rev 7704) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-05-08 13:24:24 UTC (rev 7705) @@ -20,6 +20,7 @@ package net.sf.gridarta.gui.gameobjectattributespanel; import java.awt.BorderLayout; +import java.awt.Component; import java.awt.Container; import java.awt.GridLayout; import java.awt.Point; @@ -149,8 +150,7 @@ private final Action aMapArchAttrib = ACTION_BUILDER.createAction(false, "mapArchAttrib", this); /** - * All active tabs. Tabs not currently visible are missing. The game object - * text editor tab is included. + * All active tabs. Tabs not currently visible are missing. */ private final Collection<GameObjectAttributesTab<G, A, R>> tabs = new HashSet<GameObjectAttributesTab<G, A, R>>(); @@ -160,6 +160,11 @@ private final Map<GameObjectAttributesTab<G, A, R>, Integer> tabIndex = new IdentityHashMap<GameObjectAttributesTab<G, A, R>, Integer>(); /** + * Maps tab's component to tab. + */ + private final Map<Component, GameObjectAttributesTab<G, A, R>> componentTabs = new IdentityHashMap<Component, GameObjectAttributesTab<G, A, R>>(); + + /** * The currently selected game object. */ @Nullable @@ -447,6 +452,7 @@ */ private void addTabInt(final GameObjectAttributesTab<G, A, R> tab) { tabs.add(tab); + componentTabs.put(tab.getPanel(), tab); tab.addGameObjectAttributesTabListener(gameObjectAttributesTabListener); } @@ -463,6 +469,18 @@ } /** + * Returns the selected tab. + * @return tab the selected tab + */ + @NotNull + public GameObjectAttributesTab<G, A, R> getSelectedTab() { + final Component component = panelDesktop.getSelectedComponent(); + final GameObjectAttributesTab<G, A, R> tab = componentTabs.get(component); + assert tab != null; + return tab; + } + + /** * Sets the tab color of a tab. * @param tab the tab * @param tabSeverity the tab severity Modified: trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTab.java 2010-05-08 12:32:10 UTC (rev 7704) +++ trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTab.java 2010-05-08 13:24:24 UTC (rev 7705) @@ -21,14 +21,12 @@ import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesControl; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesControlListener; -import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesTab; import net.sf.gridarta.gui.utils.Severity; import net.sf.gridarta.gui.utils.borderpanel.Location; import net.sf.gridarta.gui.utils.tabbedpanel.Tab; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import net.sf.japi.swing.action.ActionMethod; import org.jetbrains.annotations.NotNull; /** @@ -38,19 +36,6 @@ public class GameObjectTab<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends Tab { /** - * The {@link GameObjectAttributesControl} to display. - */ - @NotNull - private final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl; - - /** - * The {@link GameObjectAttributesTab} that displays the game object text - * editor. - */ - @NotNull - private final GameObjectAttributesTab<G, A, R> textEditorTab; - - /** * Creates a new instance. * @param ident the tab's identication string * @param gameObjectAttributesControl the game object attributes control to @@ -58,13 +43,9 @@ * @param location the tab's location * @param index the tab's index for ordering * @param defaultOpen the tab's default opened status - * @param textEditorTab the game object attributes tab that displays the - * game object text editor */ - public GameObjectTab(@NotNull final String ident, @NotNull final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl, @NotNull final Location location, final int index, final boolean defaultOpen, @NotNull final GameObjectAttributesTab<G, A, R> textEditorTab) { + public GameObjectTab(@NotNull final String ident, @NotNull final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl, @NotNull final Location location, final int index, final boolean defaultOpen) { super(ident, gameObjectAttributesControl, location, index, defaultOpen); - this.gameObjectAttributesControl = gameObjectAttributesControl; - this.textEditorTab = textEditorTab; final GameObjectAttributesControlListener gameObjectAttributesControlListener = new GameObjectAttributesControlListener() { /** @@ -80,14 +61,4 @@ setSeverity(gameObjectAttributesControl.getSeverity()); } - /** - * Action method to open the game object text editor. - */ - @ActionMethod - public void gameObjectTextEditor() { - getButton().setSelected(true); - gameObjectAttributesControl.selectTab(textEditorTab); - textEditorTab.requestFocus(); - } - } // class WarningsTab Modified: trunk/src/app/net/sf/gridarta/gui/misc/MainView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MainView.java 2010-05-08 12:32:10 UTC (rev 7704) +++ trunk/src/app/net/sf/gridarta/gui/misc/MainView.java 2010-05-08 13:24:24 UTC (rev 7705) @@ -35,6 +35,7 @@ import javax.swing.WindowConstants; import net.sf.gridarta.MainControl; import net.sf.gridarta.gui.utils.Severity; +import net.sf.gridarta.gui.utils.borderpanel.Location; import net.sf.gridarta.gui.utils.tabbedpanel.Tab; import net.sf.gridarta.gui.utils.tabbedpanel.TabListener; import net.sf.gridarta.gui.utils.tabbedpanel.TabbedPanel; @@ -173,6 +174,17 @@ } /** + * Returns the active {@link Tab} on a given {@link Location} of the main + * view. + * @param location the location + * @return the tab or <code>null</code> if no active tab exists + */ + @Nullable + public Tab getActiveTab(@NotNull final Location location) { + return tabbedPanel.getActiveTab(location); + } + + /** * Sets a {@link Tab}'s {@link Severity}. The severity affects the tab's * button's color. * @param tab the tab Added: trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java 2010-05-08 13:24:24 UTC (rev 7705) @@ -0,0 +1,125 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.misc; + +import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesControl; +import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesTab; +import net.sf.gridarta.gui.utils.tabbedpanel.Tab; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.japi.swing.action.ActionMethod; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Implements actions related to the {@link MainView}. + * @author Andreas Kirschbaum + */ +public class MainViewActions<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { + + /** + * The {@link MainView} instance. + */ + @NotNull + private final MainView mainView; + + /** + * The {@link GameObjectAttributesControl} to display. + */ + @NotNull + private final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl; + + /** + * The game object {@link Tab} to display. + */ + @NotNull + private final Tab gameObjectTab; + + /** + * The {@link GameObjectAttributesTab} that displays the game object text + * editor. + */ + @NotNull + private final GameObjectAttributesTab<G, A, R> textEditorTab; + + /** + * The previously active {@link Tab} before the last switch to {@link + * #gameObjectTab}. Set to <code>null</code> if not yet switched or if no + * other tab was active. + */ + @Nullable + private Tab prevTab = null; + + /** + * The previously active {@link GameObjectAttributesTab} in {@link + * #gameObjectTab} before the last switch to {@link #textEditorTab}. Set to + * <code>null</code> if not yet switched or if no other ta was active. + */ + @Nullable + private GameObjectAttributesTab<G, A, R> prevTab2 = null; + + /** + * Creates a new instance. + * @param mainView the main view instance + * @param gameObjectAttributesControl the game object attributes control to + * display + * @param gameObjectTab the game object tab to display + * @param textEditorTab the game object attributes tab that displays the + * game object text editor + */ + public MainViewActions(@NotNull final MainView mainView, @NotNull final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl, @NotNull final Tab gameObjectTab, @NotNull final GameObjectAttributesTab<G, A, R> textEditorTab) { + this.mainView = mainView; + this.gameObjectAttributesControl = gameObjectAttributesControl; + this.gameObjectTab = gameObjectTab; + this.textEditorTab = textEditorTab; + } + + /** + * Action method to open the game object text editor. + */ + @ActionMethod + public void gameObjectTextEditor() { + final Tab activeTab = mainView.getActiveTab(gameObjectTab.getLocation()); + final GameObjectAttributesTab<G, A, R> activeTab2 = gameObjectAttributesControl.getSelectedTab(); + if (activeTab != null && activeTab == gameObjectTab && activeTab2 == textEditorTab) { + // game object text editor is active ==> restore saved state + if (prevTab != null) { + prevTab.getButton().setSelected(true); + prevTab = null; + } else { + gameObjectTab.getButton().setSelected(false); + } + if (prevTab2 != null) { + gameObjectAttributesControl.selectTab(prevTab2); + prevTab2 = null; + } + } else { + // game object text editor is inactive ==> save state and activate it + prevTab = activeTab; + prevTab2 = activeTab2; + + gameObjectTab.getButton().setSelected(true); + gameObjectAttributesControl.selectTab(textEditorTab); + textEditorTab.requestFocus(); + } + } + +} // class MainViewActions Property changes on: trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/ButtonList.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/ButtonList.java 2010-05-08 12:32:10 UTC (rev 7704) +++ trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/ButtonList.java 2010-05-08 13:24:24 UTC (rev 7705) @@ -183,7 +183,7 @@ * @return the selected button or <code>null</code> if no button exists */ @Nullable - private AbstractButton getSelectedButton() { + public AbstractButton getSelectedButton() { return selectedButtons.isEmpty() ? null : selectedButtons.get(0); } Modified: trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java 2010-05-08 12:32:10 UTC (rev 7704) +++ trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java 2010-05-08 13:24:24 UTC (rev 7705) @@ -155,6 +155,25 @@ } /** + * Returns the active {@link Tab} on a given {@link Location} of the main + * view. + * @param location the location + * @return the tab or <code>null</code> if no active tab exists + */ + @Nullable + public Tab getActiveTab(@NotNull final Location location) { + final ButtonList buttonList = buttonLists[location.ordinal()]; + final AbstractButton selectedButton = buttonList.getSelectedButton(); + if (selectedButton == null) { + return null; + } + + final Tab tab = tabs.get(selectedButton); + assert tab != null; + return tab; + } + + /** * Moves the tab to the given location. * @param tab the tab * @param location the location Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-08 12:32:10 UTC (rev 7704) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-08 13:24:24 UTC (rev 7705) @@ -84,6 +84,7 @@ import net.sf.gridarta.gui.misc.HelpActions; import net.sf.gridarta.gui.misc.MainToolbar; import net.sf.gridarta.gui.misc.MainView; +import net.sf.gridarta.gui.misc.MainViewActions; import net.sf.gridarta.gui.misc.MapPreview; import net.sf.gridarta.gui.misc.RecentManager; import net.sf.gridarta.gui.misc.StatusBar; @@ -447,12 +448,14 @@ updaterManager.startup(); final GameObjectAttributesTab<G, A, R> textEditorTab = new TextEditorTab<G, A, R>(gameObjectAttributesModel); - final Tab gameObjectTab = new GameObjectTab<G, A, R>("gameObject", gameObjectAttributesControl, Location.BOTTOM, 0, true, textEditorTab); - ACTION_BUILDER.createAction(true, "gameObjectTextEditor", gameObjectTab); + final GameObjectTab<G, A, R> gameObjectTab = new GameObjectTab<G, A, R>("gameObject", gameObjectAttributesControl, Location.BOTTOM, 0, true); + mainView = new MainView(mainViewFrame, exitAction, mapDesktop, icon, exiter); + final Object mainViewActions = new MainViewActions<G, A, R>(mainView, gameObjectAttributesControl, gameObjectTab, textEditorTab); + ACTION_BUILDER.createAction(true, "gameObjectTextEditor", mainViewActions); + final JMenuBar menuBar = ACTION_BUILDER.createMenuBar(true, "main"); final MainToolbar mainToolbar = new MainToolbar(globalSettings); - mainView = new MainView(mainViewFrame, exitAction, mapDesktop, icon, exiter); mainViewFrame.setJMenuBar(menuBar); mainViewFrame.add(mainToolbar.getComponent(), BorderLayout.NORTH); mainViewFrame.add(statusBar, BorderLayout.SOUTH); Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-05-08 12:32:10 UTC (rev 7704) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-05-08 13:24:24 UTC (rev 7705) @@ -175,7 +175,7 @@ deleteUnknownObjects.text=Delete unknown objects -gameObjectTextEditor.text=Open Game Object Text Editor +gameObjectTextEditor.text=Toggle Game Object Text Editor gameObjectTextEditor.accel=ctrl alt pressed E Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-05-08 12:32:10 UTC (rev 7704) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-05-08 13:24:24 UTC (rev 7705) @@ -157,7 +157,7 @@ deleteUnknownObjects.text=Undefinierte Objekte l\xF6schen -gameObjectTextEditor.text=\xD6ffne Objekttext-Editor +gameObjectTextEditor.text=Objekttext-Editor umschalten # Plugins This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-08 17:25:15
|
Revision: 7706 http://gridarta.svn.sourceforge.net/gridarta/?rev=7706&view=rev Author: akirschbaum Date: 2010-05-08 17:24:55 +0000 (Sat, 08 May 2010) Log Message: ----------- Consistently format source code. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/IGUIConstants.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/DefaultScriptArchUtils.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/AtrinikEditor.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultMapArchObjectParserFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/MapArchObjectParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/DefaultMapArchObjectFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEvent.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEventFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/AbstractResourcesReader.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObjectTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/IGUIConstants.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatPickmapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/DefaultScriptArchUtils.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/CrossfireEditor.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultMapArchObjectParserFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/DefaultMapArchObjectFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEvent.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEventFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/smoothface/SmoothFaces.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/smoothface/SmoothFacesLoader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/AbstractResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/IGUIConstants.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/map/renderer/DefaultRendererFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/DefaultScriptArchUtils.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DaimoninEditor.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetypeFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParserFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultMapArchObjectParserFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/MapArchObjectParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/DefaultMapArchObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEvent.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEventFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/AbstractResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java trunk/daimonin/src/test/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObjectTest.java trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/commands/BatchPngCommand.java trunk/src/app/net/sf/gridarta/commands/CollectArchesCommand.java trunk/src/app/net/sf/gridarta/commands/Collector.java trunk/src/app/net/sf/gridarta/commands/CreateThumbsCommand.java trunk/src/app/net/sf/gridarta/commands/ScriptCommand.java trunk/src/app/net/sf/gridarta/commands/SinglePngCommand.java trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserView.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeIconCellRenderer.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeNameCellRenderer.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypePanel.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/DirectionPane.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/DisplayMode.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/DisplayNameCellRenderer.java trunk/src/app/net/sf/gridarta/gui/autovalidator/AutoValidator.java trunk/src/app/net/sf/gridarta/gui/connectionview/CellRenderer.java trunk/src/app/net/sf/gridarta/gui/connectionview/Connection.java trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionView.java trunk/src/app/net/sf/gridarta/gui/connectionview/LockedItemsView.java trunk/src/app/net/sf/gridarta/gui/connectionview/MonsterView.java trunk/src/app/net/sf/gridarta/gui/connectionview/View.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java trunk/src/app/net/sf/gridarta/gui/data/NamedNodeTreeCellRenderer.java trunk/src/app/net/sf/gridarta/gui/data/NamedObjectsUtils.java trunk/src/app/net/sf/gridarta/gui/errorview/ConsoleErrorView.java trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java trunk/src/app/net/sf/gridarta/gui/filter/FilterMenuEntry.java trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialogManager.java trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/ConfirmErrorsAL.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttrib.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribAnimName.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBitmask.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBool.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBoolSpec.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFaceName.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFloat.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInt.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInvSpell.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribList.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribLong.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribMapPath.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribScriptFile.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribSpell.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribString.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribText.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribTreasure.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribZSpell.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GuiInfo.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/HelpActionListener.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/MaskChangeAL.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/ScrollToVisibleFocusListener.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/StringKeyManager.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/ViewTreasurelistAL.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/AbstractGameObjectAttributesTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesTabListener.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/MsgTextTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/ScrollingTextPane.java trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialogManager.java trunk/src/app/net/sf/gridarta/gui/help/Help.java trunk/src/app/net/sf/gridarta/gui/help/HtmlPane.java trunk/src/app/net/sf/gridarta/gui/io/FileFilters.java trunk/src/app/net/sf/gridarta/gui/map/AbstractPerMapDialogManager.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/MapPreviewAccessory.java trunk/src/app/net/sf/gridarta/gui/map/cursor/MapCursor.java trunk/src/app/net/sf/gridarta/gui/map/cursor/MapCursorActions.java trunk/src/app/net/sf/gridarta/gui/map/cursor/MapCursorEvent.java trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpAdapter.java trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpEvent.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/DefaultMapActions.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapLocation.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/FlatMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/IsoMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/MapTilePanel.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/TileLink.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/TilePanel.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewFactory.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewManager.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViews.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsListener.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/GridMapSquarePainter.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/MapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/tools/AbstractTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/BasicAbstractTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java trunk/src/app/net/sf/gridarta/gui/map/tools/VoidTool.java trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewAction.java trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewActions.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowMenuManager.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeAction.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/ImageType.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListener.java trunk/src/app/net/sf/gridarta/gui/misc/About.java trunk/src/app/net/sf/gridarta/gui/misc/MainToolbar.java trunk/src/app/net/sf/gridarta/gui/misc/MainView.java trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java trunk/src/app/net/sf/gridarta/gui/misc/SplashScreen.java trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialogFactory.java trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapFolderDialog.java trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java trunk/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java trunk/src/app/net/sf/gridarta/gui/objectchooser/ObjectChooser.java trunk/src/app/net/sf/gridarta/gui/objectchooser/ObjectChooserTab.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserView.java trunk/src/app/net/sf/gridarta/gui/prefs/AppPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/AppPrefsModel.java trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/GUIPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/MiscPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePrefs.java trunk/src/app/net/sf/gridarta/gui/replacedialog/ArchetypeNameMatchCriteria.java trunk/src/app/net/sf/gridarta/gui/replacedialog/ObjectNameMatchCriteria.java trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialogManager.java trunk/src/app/net/sf/gridarta/gui/script/ClosingIcon.java trunk/src/app/net/sf/gridarta/gui/script/ScriptController.java trunk/src/app/net/sf/gridarta/gui/script/ScriptEditor.java trunk/src/app/net/sf/gridarta/gui/script/ScriptManagerFactory.java trunk/src/app/net/sf/gridarta/gui/script/ScriptView.java trunk/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java trunk/src/app/net/sf/gridarta/gui/script/StackLayout.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBox.java trunk/src/app/net/sf/gridarta/gui/script/parameter/FilterParameterView.java trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterCellRenderer.java trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterComboBoxModel.java trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterView.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ParameterTypeEditor.java trunk/src/app/net/sf/gridarta/gui/scripts/AbstractScriptArchUtils.java trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java trunk/src/app/net/sf/gridarta/gui/scripts/PathButtonListener.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptedEventEditor.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/MapSquareSelection.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/MapSquareSelectionCache.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareModel.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialogManager.java trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeUtils.java trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java trunk/src/app/net/sf/gridarta/gui/treasurelist/TreasureCellRenderer.java trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java trunk/src/app/net/sf/gridarta/gui/utils/AbstractDialogManager.java trunk/src/app/net/sf/gridarta/gui/utils/AnimComponent.java trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/ArchetypeToolTipProvider.java trunk/src/app/net/sf/gridarta/gui/utils/AsynchonousProgress.java trunk/src/app/net/sf/gridarta/gui/utils/DirectionComponent.java trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.java trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/GList.java trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/GUIConstants.java trunk/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java trunk/src/app/net/sf/gridarta/gui/utils/MapFileFilter.java trunk/src/app/net/sf/gridarta/gui/utils/MenuUtils.java trunk/src/app/net/sf/gridarta/gui/utils/SwingUtils.java trunk/src/app/net/sf/gridarta/gui/utils/ToggleTristateCheckBox.java trunk/src/app/net/sf/gridarta/gui/utils/TreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/VerticalToggleButton.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/ButtonListListener.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/package-info.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/src/app/net/sf/gridarta/mapfiles/DuplicateMapFolderException.java trunk/src/app/net/sf/gridarta/mapfiles/DuplicatePickmapException.java trunk/src/app/net/sf/gridarta/mapfiles/InvalidNameException.java trunk/src/app/net/sf/gridarta/mapfiles/Loader.java trunk/src/app/net/sf/gridarta/mapfiles/MapFile.java trunk/src/app/net/sf/gridarta/mapfiles/MapFileNameComparator.java trunk/src/app/net/sf/gridarta/mapfiles/MapFolder.java trunk/src/app/net/sf/gridarta/mapfiles/MapFolderNotEmptyException.java trunk/src/app/net/sf/gridarta/mapfiles/MapFolderTree.java trunk/src/app/net/sf/gridarta/mapfiles/MapFolderTreeListener.java trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultPickmapManager.java trunk/src/app/net/sf/gridarta/mapmanager/FileControl.java trunk/src/app/net/sf/gridarta/mapmanager/MapManagerActions.java trunk/src/app/net/sf/gridarta/mapmanager/MapManagerListener.java trunk/src/app/net/sf/gridarta/model/anim/AnimationParseException.java trunk/src/app/net/sf/gridarta/model/anim/DefaultAnimationObject.java trunk/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java trunk/src/app/net/sf/gridarta/model/anim/DuplicateAnimationException.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/src/app/net/sf/gridarta/model/archetype/ArchetypeParser.java trunk/src/app/net/sf/gridarta/model/archetype/ArchetypeSet.java trunk/src/app/net/sf/gridarta/model/archetype/AttributeListUtils.java trunk/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserFolder.java trunk/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserPanel.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttribute.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeAnimName.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeBitmask.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeBool.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeBoolSpec.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeDefinition.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeFaceName.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeFixed.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeFloat.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeInt.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeInvSpell.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeList.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeLong.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeMapPath.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeScriptFile.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeSpell.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeString.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeText.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeTreasure.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeZSpell.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeList.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java trunk/src/app/net/sf/gridarta/model/archetypetype/CAttribBitmask.java trunk/src/app/net/sf/gridarta/model/archetypetype/DefaultArchetypeAttributeFactory.java trunk/src/app/net/sf/gridarta/model/artifact/ArtifactParser.java trunk/src/app/net/sf/gridarta/model/autojoin/AutojoinList.java trunk/src/app/net/sf/gridarta/model/autojoin/AutojoinLists.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectText.java trunk/src/app/net/sf/gridarta/model/baseobject/RecursiveGameObjectIterator.java trunk/src/app/net/sf/gridarta/model/connectionview/Connections.java trunk/src/app/net/sf/gridarta/model/data/AbstractNamedObject.java trunk/src/app/net/sf/gridarta/model/data/AbstractNamedObjects.java trunk/src/app/net/sf/gridarta/model/data/NamedObject.java trunk/src/app/net/sf/gridarta/model/data/NamedTreeNode.java trunk/src/app/net/sf/gridarta/model/errorview/ErrorViewCategory.java trunk/src/app/net/sf/gridarta/model/errorview/ErrorViewCollector.java trunk/src/app/net/sf/gridarta/model/exitconnector/ExitConnectorModel.java trunk/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java trunk/src/app/net/sf/gridarta/model/exitconnector/ExitMatcher.java trunk/src/app/net/sf/gridarta/model/face/AbstractFaceProvider.java trunk/src/app/net/sf/gridarta/model/face/ArchFaceProvider.java trunk/src/app/net/sf/gridarta/model/face/CollectedFaceProvider.java trunk/src/app/net/sf/gridarta/model/face/ColourFilter.java trunk/src/app/net/sf/gridarta/model/face/DefaultFaceObject.java trunk/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java trunk/src/app/net/sf/gridarta/model/face/DoubleImageFilter.java trunk/src/app/net/sf/gridarta/model/face/EmptyFaceProvider.java trunk/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java trunk/src/app/net/sf/gridarta/model/face/FilterFaceProvider.java trunk/src/app/net/sf/gridarta/model/filter/BasicFilterConfig.java trunk/src/app/net/sf/gridarta/model/filter/Filter.java trunk/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java trunk/src/app/net/sf/gridarta/model/filter/NamedFilterList.java trunk/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilter.java trunk/src/app/net/sf/gridarta/model/floodfill/Floodfill.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java trunk/src/app/net/sf/gridarta/model/gameobject/FaceSource.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectUtils.java trunk/src/app/net/sf/gridarta/model/gameobject/IsArchetypeException.java trunk/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java trunk/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java trunk/src/app/net/sf/gridarta/model/gameobject/NotInsideContainerException.java trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java trunk/src/app/net/sf/gridarta/model/io/DefaultMapReader.java trunk/src/app/net/sf/gridarta/model/io/DefaultMapReaderFactory.java trunk/src/app/net/sf/gridarta/model/io/DefaultMapWriter.java trunk/src/app/net/sf/gridarta/model/io/DirectoryCacheFiles.java trunk/src/app/net/sf/gridarta/model/io/FlatFileIterator.java trunk/src/app/net/sf/gridarta/model/io/InvalidMapFormatException.java trunk/src/app/net/sf/gridarta/model/io/PathManager.java trunk/src/app/net/sf/gridarta/model/io/RecursiveFileIterator.java trunk/src/app/net/sf/gridarta/model/map/grid/MapGrid.java trunk/src/app/net/sf/gridarta/model/map/grid/MapGridEvent.java trunk/src/app/net/sf/gridarta/model/map/grid/SelectionMode.java trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java trunk/src/app/net/sf/gridarta/model/map/maparchobject/MapArchObject.java trunk/src/app/net/sf/gridarta/model/map/mapcontrol/DefaultMapControl.java trunk/src/app/net/sf/gridarta/model/map/mapcontrol/MapControl.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/AboveFloorInsertionMode.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/AutoInsertionMode.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/BelowFloorInsertionMode.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/BottommostInsertionMode.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/InsertionMode.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/InsertionModeSet.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapSquare.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/SavedSquares.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/TopmostInsertionMode.java trunk/src/app/net/sf/gridarta/model/map/normalizer/MapPathNormalizer.java trunk/src/app/net/sf/gridarta/model/map/validation/DefaultErrorCollector.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/AttributeRangeError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/BlockedMobOrSpawnPointError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/BlockedSquareError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ConnectedInsideContainerError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ConnectedPickableError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ConnectionError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/CustomTypeError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/DoubleLayerError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/DoubleTypeError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/EmptySpawnPointError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/EnvironmentSensorSlayingError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ExitError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/MapDifficultyError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/MobOutsideSpawnPointError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ShopSquareError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/SlayingError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/SquareWithoutFloorError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/SysObjectNotOnLayerZeroError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/TilePathsError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/UndefinedAnimError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/UndefinedFaceError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ValidationError.java trunk/src/app/net/sf/gridarta/model/mapviewsettings/MapViewSettings.java trunk/src/app/net/sf/gridarta/model/mapviewsettings/MapViewSettingsListener.java trunk/src/app/net/sf/gridarta/model/match/AndGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/AttribGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java trunk/src/app/net/sf/gridarta/model/match/GameObjectMatchers.java trunk/src/app/net/sf/gridarta/model/match/GameObjectMatchersParser.java trunk/src/app/net/sf/gridarta/model/match/MutableNameGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/MutableOrGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/NamedGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/NotGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/OrGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/SetEnabledAction.java trunk/src/app/net/sf/gridarta/model/match/TypeNrsGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/ViewGameObjectMatcherManager.java trunk/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEvent.java trunk/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEventFactory.java trunk/src/app/net/sf/gridarta/model/scripts/DefaultScriptArchData.java trunk/src/app/net/sf/gridarta/model/scripts/ScriptUtils.java trunk/src/app/net/sf/gridarta/model/scripts/UndefinedEventArchetypeException.java trunk/src/app/net/sf/gridarta/model/scripts/UndefinedEventArchetypeTypeException.java trunk/src/app/net/sf/gridarta/model/settings/AbstractConfigSource.java trunk/src/app/net/sf/gridarta/model/settings/ConfigSourceFactory.java trunk/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java trunk/src/app/net/sf/gridarta/model/spells/ArchetypeSetSpellLoader.java trunk/src/app/net/sf/gridarta/model/spells/GameObjectSpell.java trunk/src/app/net/sf/gridarta/model/spells/NumberSpell.java trunk/src/app/net/sf/gridarta/model/spells/Spell.java trunk/src/app/net/sf/gridarta/model/spells/Spells.java trunk/src/app/net/sf/gridarta/model/spells/XMLSpellLoader.java trunk/src/app/net/sf/gridarta/model/treasurelist/ArchTreasureObj.java trunk/src/app/net/sf/gridarta/model/treasurelist/FolderTreasureObj.java trunk/src/app/net/sf/gridarta/model/treasurelist/NoTreasureObj.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureListTreasureObj.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureListsParser.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureTreeNode.java trunk/src/app/net/sf/gridarta/model/treasurelist/YesTreasureObj.java trunk/src/app/net/sf/gridarta/model/undo/UndoModel.java trunk/src/app/net/sf/gridarta/model/undo/UndoState.java trunk/src/app/net/sf/gridarta/preferences/Codec.java trunk/src/app/net/sf/gridarta/preferences/FilePreferences.java trunk/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java trunk/src/app/net/sf/gridarta/preferences/NodeType.java trunk/src/app/net/sf/gridarta/preferences/Storage.java trunk/src/app/net/sf/gridarta/resource/AbstractResources.java trunk/src/app/net/sf/gridarta/resource/AbstractResourcesReader.java trunk/src/app/net/sf/gridarta/script/BshThread.java trunk/src/app/net/sf/gridarta/script/Script.java trunk/src/app/net/sf/gridarta/script/ScriptModel.java trunk/src/app/net/sf/gridarta/script/ScriptModelLoader.java trunk/src/app/net/sf/gridarta/script/ScriptModelParser.java trunk/src/app/net/sf/gridarta/script/parameter/ArchParameter.java trunk/src/app/net/sf/gridarta/script/parameter/BooleanParameter.java trunk/src/app/net/sf/gridarta/script/parameter/DoubleParameter.java trunk/src/app/net/sf/gridarta/script/parameter/FilterParameter.java trunk/src/app/net/sf/gridarta/script/parameter/IntegerParameter.java trunk/src/app/net/sf/gridarta/script/parameter/MapParameter.java trunk/src/app/net/sf/gridarta/script/parameter/NoSuchParameterException.java trunk/src/app/net/sf/gridarta/script/parameter/PluginParameterFactory.java trunk/src/app/net/sf/gridarta/script/parameter/StringParameter.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/Actions.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditUndoActions.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java trunk/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java trunk/src/app/net/sf/gridarta/textedit/textarea/ScrollLayout.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxStyle.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaDefaults.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextUtilities.java trunk/src/app/net/sf/gridarta/textedit/textarea/Token.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Backspace.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/BackspaceWord.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Copy.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Delete.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/DeleteWord.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/DocumentEnd.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/DocumentHome.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/End.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Find.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/FindAgain.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Home.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/InsertChar.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/InsertTab.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/NextChar.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/NextLine.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/NextPage.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/NextWord.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Overwrite.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Paste.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/PrevChar.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/PrevLine.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/PrevPage.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/PrevWord.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Repeat.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Replace.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Save.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/ToggleRect.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/CTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/CrossfireDialogTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/DaimoninAITokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/EmptyTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/KeywordMap.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/LuaTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/PythonTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/TokenMarker.java trunk/src/app/net/sf/gridarta/updater/Updater.java trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java trunk/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java trunk/src/app/net/sf/gridarta/utils/AlphaImageFilter.java trunk/src/app/net/sf/gridarta/utils/ArrayUtils.java trunk/src/app/net/sf/gridarta/utils/CommonConstants.java trunk/src/app/net/sf/gridarta/utils/ConfigFileUtils.java trunk/src/app/net/sf/gridarta/utils/EventListenerList2.java trunk/src/app/net/sf/gridarta/utils/FileChooserUtils.java trunk/src/app/net/sf/gridarta/utils/GUIUtils.java trunk/src/app/net/sf/gridarta/utils/IOUtils.java trunk/src/app/net/sf/gridarta/utils/ProcessRunner.java trunk/src/app/net/sf/gridarta/utils/RandomUtils.java trunk/src/app/net/sf/gridarta/utils/Size2D.java trunk/src/app/net/sf/gridarta/utils/StringUtils.java trunk/src/app/net/sf/gridarta/utils/SystemIcons.java trunk/src/app/net/sf/gridarta/utils/WrappingStringBuilder.java trunk/src/app/net/sf/gridarta/utils/XmlHelper.java trunk/src/app/net/sf/gridarta/validation/AbstractValidator.java trunk/src/app/net/sf/gridarta/validation/DelegatingMapValidator.java trunk/src/app/net/sf/gridarta/validation/checks/AttributeRangeChecker.java trunk/src/app/net/sf/gridarta/validation/checks/BlockedMatrix.java trunk/src/app/net/sf/gridarta/validation/checks/BlockedMobOrSpawnPointChecker.java trunk/src/app/net/sf/gridarta/validation/checks/BlockedSpawnPointChecker.java trunk/src/app/net/sf/gridarta/validation/checks/BlockedSquareChecker.java trunk/src/app/net/sf/gridarta/validation/checks/ConnectedInsideContainerChecker.java trunk/src/app/net/sf/gridarta/validation/checks/ConnectedPickableChecker.java trunk/src/app/net/sf/gridarta/validation/checks/ConnectionChecker.java trunk/src/app/net/sf/gridarta/validation/checks/CustomTypeChecker.java trunk/src/app/net/sf/gridarta/validation/checks/DoubleLayerChecker.java trunk/src/app/net/sf/gridarta/validation/checks/DoubleTypeChecker.java trunk/src/app/net/sf/gridarta/validation/checks/EmptySpawnPointChecker.java trunk/src/app/net/sf/gridarta/validation/checks/ExitChecker.java trunk/src/app/net/sf/gridarta/validation/checks/MapDifficultyChecker.java trunk/src/app/net/sf/gridarta/validation/checks/MobOutsideSpawnPointChecker.java trunk/src/app/net/sf/gridarta/validation/checks/ShopSquareChecker.java trunk/src/app/net/sf/gridarta/validation/checks/SlayingChecker.java trunk/src/app/net/sf/gridarta/validation/checks/SquareWithoutFloorChecker.java trunk/src/app/net/sf/gridarta/validation/checks/SysObjectNotOnLayerZeroChecker.java trunk/src/app/net/sf/gridarta/validation/checks/TilePathsChecker.java trunk/src/app/net/sf/gridarta/validation/checks/UndefinedArchetypeChecker.java trunk/src/app/net/sf/gridarta/validation/checks/UndefinedFaceChecker.java trunk/src/app/net/sf/gridarta/validation/checks/UnsetSlayingChecker.java trunk/src/doc/sitestyle.css trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java trunk/src/test/net/sf/gridarta/gui/filter/TestFilterControl.java trunk/src/test/net/sf/gridarta/gui/map/mapview/TestMapViewFactory.java trunk/src/test/net/sf/gridarta/gui/map/renderer/TestMapRenderer.java trunk/src/test/net/sf/gridarta/gui/map/renderer/TestRendererFactory.java trunk/src/test/net/sf/gridarta/gui/utils/GSplitPaneTestApplication.java trunk/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java trunk/src/test/net/sf/gridarta/mapmanager/TestFileControl.java trunk/src/test/net/sf/gridarta/model/archetype/AttributeListUtilsTest.java trunk/src/test/net/sf/gridarta/model/archetype/TestArchetype.java trunk/src/test/net/sf/gridarta/model/archetype/TestArchetypeFactory.java trunk/src/test/net/sf/gridarta/model/archetype/TestArchetypeParser.java trunk/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java trunk/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java trunk/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java trunk/src/test/net/sf/gridarta/model/errorview/TestErrorView.java trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java trunk/src/test/net/sf/gridarta/model/io/PathManagerTest.java trunk/src/test/net/sf/gridarta/model/io/TestMapReaderFactory.java trunk/src/test/net/sf/gridarta/model/io/TestMapWriter.java trunk/src/test/net/sf/gridarta/model/map/grid/MapGridTest.java trunk/src/test/net/sf/gridarta/model/map/maparchobject/TestMapArchObject.java trunk/src/test/net/sf/gridarta/model/map/mapcontrol/TestMapControlFactory.java trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java trunk/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java trunk/src/test/net/sf/gridarta/model/scripts/TestScriptArchData.java trunk/src/test/net/sf/gridarta/utils/Size2DTest.java trunk/src/test/net/sf/gridarta/utils/StringUtilsTest.java trunk/src/test/net/sf/gridarta/utils/WrappingStringBuilderTest.java trunk/src/test/net/sf/gridarta/validation/AbstractValidatorTest.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/IGUIConstants.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/IGUIConstants.java 2010-05-08 13:24:24 UTC (rev 7705) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/IGUIConstants.java 2010-05-08 17:24:55 UTC (rev 7706) @@ -30,7 +30,9 @@ */ public interface IGUIConstants extends GUIConstants { - /** Default difficulty for newly created maps. */ + /** + * Default difficulty for newly created maps. + */ int DEF_MAPDIFFICULTY = 1; /** @@ -38,21 +40,31 @@ * at first sight, but this way iterating code is independent of the * definition of the tile path values. */ - int[] ALL_TILE_PATHS = {CommonConstants.NORTH, CommonConstants.EAST, CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH_EAST, CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST}; + int[] ALL_TILE_PATHS = { CommonConstants.NORTH, CommonConstants.EAST, CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH_EAST, CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST }; - /** Default map size (both height and width). */ + /** + * Default map size (both height and width). + */ int DEF_MAPSIZE = 24; - /** Default width for pickmaps. */ + /** + * Default width for pickmaps. + */ int DEF_PICKMAP_WIDTH = 7; - /** Default height for pickmaps. */ + /** + * Default height for pickmaps. + */ int DEF_PICKMAP_HEIGHT = 7; - /** The directory that contains all scripts. */ + /** + * The directory that contains all scripts. + */ String SCRIPTS_DIR = "dev/editor/scripts"; - /** The directory that contains all pickmaps. */ + /** + * The directory that contains all pickmaps. + */ String PICKMAP_DIR = "dev/editor/pickmaps"; String ARCHDEF_FILE = "archdef.dat"; // position-data of multiparts @@ -62,17 +74,23 @@ String PNG_FILE = "atrinik.0"; // file with all pngs - /** File to store the face tree information after arch collection. */ + /** + * File to store the face tree information after arch collection. + */ String FACETREE_FILE = "facetree"; - /** File to store the animation tree information after arch collection. */ + /** + * File to store the animation tree information after arch collection. + */ String ANIMTREE_FILE = "animtree"; String ARTIFACTS_FILE = "artifacts"; // file with artifact definitions String TILE_NORTH = "north.png"; - /** Name of the files the spell information (names and numbers). */ + /** + * Name of the files the spell information (names and numbers). + */ String SPELL_FILE = "spells.xml"; } // interface IGUIConstants Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java 2010-05-08 13:24:24 UTC (rev 7705) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java 2010-05-08 17:24:55 UTC (rev 7706) @@ -108,21 +108,27 @@ this.systemIcons = systemIcons; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public SimpleIsoMapRenderer<GameObject, MapArchObject, Archetype> newSimpleMapRenderer(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel) { return new SimpleIsoMapRenderer<GameObject, MapArchObject, Archetype>(Archetype.TYPE_SPAWN_POINT, mapModel, multiPositionData, isoMapSquareInfo, systemIcons.getUnknownSquareIcon()); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public IsoMapRenderer<GameObject, MapArchObject, Archetype> newMapRenderer(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final MapGrid mapGrid) { return new IsoMapRenderer<GameObject, MapArchObject, Archetype>(Archetype.TYPE_SPAWN_POINT, mapViewSettings, filterControl, mapModel, mapGrid, multiPositionData, isoMapSquareInfo, gridMapSquarePainter, gameObjectParser, systemIcons); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @NotNull @Override public IsoPickmapRenderer<GameObject, MapArchObject, Archetype> newPickmapRenderer(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final MapGrid mapGrid) { Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-05-08 13:24:24 UTC (rev 7705) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-05-08 17:24:55 UTC (rev 7706) @@ -42,7 +42,9 @@ */ public class DefaultMapPropertiesDialogFactory implements MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype> { - /** Action Builder. */ + /** + * Action Builder. + */ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** @@ -74,8 +76,8 @@ * Creates a new instance. * @param mapManager the map manager to use * @param globalSettings the global settings instance - * @param mapPathNormalizer the map path normalize for converting map - * paths to files + * @param mapPathNormalizer the map path normalize for converting map paths + * to files * @param mapViewsManager the map views */ public DefaultMapPropertiesDialogFactory(@NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager) { @@ -85,7 +87,9 @@ this.mapViewsManager = mapViewsManager; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void showDialog(@NotNull final Component parent, @NotNull final JFrame helpParent, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter) { final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer, mapViewsManager); Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-08 13:24:24 UTC (rev 7705) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-08 17:24:55 UTC (rev 7706) @@ -75,10 +75,14 @@ */ public class MapPropertiesDialog extends JOptionPane { - /** Serial version UID. */ + /** + * Serial version UID. + */ private static final long serialVersionUID = 1L; - /** Action Builder. */ + /** + * Action Builder. + */ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** @@ -141,16 +145,24 @@ private final AbstractButton checkboxPlugins = new JCheckBox(); - /** JButton for ok. */ + /** + * JButton for ok. + */ private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this)); - /** JButton for cancel. */ + /** + * JButton for cancel. + */ private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "mapCancel", this)); - /** The MapTilePane. */ + /** + * The MapTilePane. + */ private final AbstractMapTilePane<GameObject, MapArchObject, Archetype> mapTilePane; - /** Whether the map tile pane was enabled. */ + /** + * Whether the map tile pane was enabled. + */ private final boolean mapTilePaneEnabled; /** @@ -160,15 +172,15 @@ * @param globalSettings the global settings instance * @param mapModel the map model whose properties are shown/edited. * @param mapFileFilter the Swing file filter to use - * @param mapPathNormalizer the map path normalizer for converting map - * paths to files + * @param mapPathNormalizer the map path normalizer for converting map paths + * to files * @param mapViewsManager the map views */ public MapPropertiesDialog(@NotNull final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager) { okButton.setDefaultCapable(true); final JButton helpButton = new JButton(ACTION_BUILDER.createAction(false, "mapHelp", this)); final JButton restoreButton = new JButton(ACTION_BUILDER.createAction(false, "mapRestore", this)); - setOptions(new Object[] { helpButton, okButton, restoreButton, cancelButton}); + setOptions(new Object[] { helpButton, okButton, restoreButton, cancelButton }); this.helpParent = helpParent; this.mapModel = mapModel; @@ -348,29 +360,39 @@ return panel; } - /** Action method for help. */ + /** + * Action method for help. + */ public void mapHelp() { new Help(helpParent, "tut_mapattr.html").setVisible(true); } - /** Action method for okay. */ + /** + * Action method for oka... [truncated message content] |
From: <aki...@us...> - 2010-05-09 08:34:17
|
Revision: 7716 http://gridarta.svn.sourceforge.net/gridarta/?rev=7716&view=rev Author: akirschbaum Date: 2010-05-09 08:34:10 +0000 (Sun, 09 May 2010) Log Message: ----------- Insert complete multi-part game objects in "Edd Env" when using the archetype chooser. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-08 22:58:20 UTC (rev 7715) +++ trunk/atrinik/ChangeLog 2010-05-09 08:34:10 UTC (rev 7716) @@ -1,3 +1,8 @@ +2010-05-09 Andreas Kirschbaum + + * Insert complete multi-part game objects in "Edd Env" when using + the archetype chooser. + 2010-05-08 Andreas Kirschbaum * CTRL-ALT-E now toggles the game object text editor: activate it Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-08 22:58:20 UTC (rev 7715) +++ trunk/crossfire/ChangeLog 2010-05-09 08:34:10 UTC (rev 7716) @@ -1,3 +1,8 @@ +2010-05-09 Andreas Kirschbaum + + * Insert complete multi-part game objects in "Edd Env" when using + the archetype chooser. + 2010-05-08 Andreas Kirschbaum * CTRL-ALT-E now toggles the game object text editor: activate it Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-08 22:58:20 UTC (rev 7715) +++ trunk/daimonin/ChangeLog 2010-05-09 08:34:10 UTC (rev 7716) @@ -1,3 +1,8 @@ +2010-05-09 Andreas Kirschbaum + + * Insert complete multi-part game objects in "Edd Env" when using + the archetype chooser. + 2010-05-08 Andreas Kirschbaum * CTRL-ALT-E now toggles the game object text editor: activate it Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-05-08 22:58:20 UTC (rev 7715) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-05-09 08:34:10 UTC (rev 7716) @@ -615,14 +615,12 @@ return; } - final BaseObject<G, A, R, ?> envnew = arch.newInstance(gameObjectFactory); - final MapSquare<G, A, R> mapSquare = gameObject.getMapSquare(); assert mapSquare != null; final MapModel<G, A, R> mapModel = mapSquare.getMapModel(); mapModel.beginTransaction("Add to environment"); // TODO; I18N/L10N try { - final G insertedGameObject = mapModel.insertArchToMap(envnew, gameObject, new Point(mapSquare.getMapX(), mapSquare.getMapY()), true); + final G insertedGameObject = mapModel.insertArchToMap(arch, gameObject, new Point(mapSquare.getMapX(), mapSquare.getMapY()), true); if (insertedGameObject != null) { mapModel.removeGameObject(gameObject, true); gameObject.setMapX(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-09 09:20:25
|
Revision: 7717 http://gridarta.svn.sourceforge.net/gridarta/?rev=7717&view=rev Author: akirschbaum Date: 2010-05-09 09:20:19 +0000 (Sun, 09 May 2010) Log Message: ----------- Implement "Add Env" when using the pickmap chooser. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-09 08:34:10 UTC (rev 7716) +++ trunk/atrinik/ChangeLog 2010-05-09 09:20:19 UTC (rev 7717) @@ -1,5 +1,7 @@ 2010-05-09 Andreas Kirschbaum + * Implement "Add Env" when using the pickmap chooser. + * Insert complete multi-part game objects in "Edd Env" when using the archetype chooser. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-09 08:34:10 UTC (rev 7716) +++ trunk/crossfire/ChangeLog 2010-05-09 09:20:19 UTC (rev 7717) @@ -1,5 +1,7 @@ 2010-05-09 Andreas Kirschbaum + * Implement "Add Env" when using the pickmap chooser. + * Insert complete multi-part game objects in "Edd Env" when using the archetype chooser. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-09 08:34:10 UTC (rev 7716) +++ trunk/daimonin/ChangeLog 2010-05-09 09:20:19 UTC (rev 7717) @@ -1,6 +1,8 @@ 2010-05-09 Andreas Kirschbaum - * Insert complete multi-part game objects in "Edd Env" when using + * Implement "Add Env" when using the pickmap chooser. + + * Insert complete multi-part game objects in "Add Env" when using the archetype chooser. 2010-05-08 Andreas Kirschbaum Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-09 08:34:10 UTC (rev 7716) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-09 09:20:19 UTC (rev 7717) @@ -870,21 +870,9 @@ if (nextGameObject == null || nextGameObjectEnv == null) { // put arch on the map - if (templateGameObject.isArchetype()) { - newGameObject = insertBaseObject(templateGameObject, pos, true, join, topmostInsertionMode); - if (newGameObject == null) { - return null; - } - } else { - // insert the given 'templateGameObject' (multis not allowed here yet - sorry) - if (templateGameObject.isMulti()) { - return null; // tried to insert multi (probably from pickmap) - } - - newGameObject = templateGameObject.newInstance(gameObjectFactory); - newGameObject.setMapX(pos.x); - newGameObject.setMapY(pos.y); - addGameObjectToMap(newGameObject, topmostInsertionMode); + newGameObject = insertBaseObject(templateGameObject, pos, true, join, topmostInsertionMode); + if (newGameObject == null) { + return null; } int position = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-09 11:22:55
|
Revision: 7720 http://gridarta.svn.sourceforge.net/gridarta/?rev=7720&view=rev Author: akirschbaum Date: 2010-05-09 11:22:48 +0000 (Sun, 09 May 2010) Log Message: ----------- Remove MapModelListener.mapClosed(). Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -262,14 +262,6 @@ // ignore } - /** - * {@inheritDoc} - */ - @Override - public void mapClosed() { - // ignore - } - }; /** Modified: trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -368,14 +368,6 @@ * {@inheritDoc} */ @Override - public void mapClosed() { - // ignore - } - - /** - * {@inheritDoc} - */ - @Override public void mapMetaChanged() { scheduleMapModel(mapModel); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -81,6 +81,8 @@ import net.sf.gridarta.gui.utils.AnimComponent; import net.sf.gridarta.gui.utils.DirectionLayout; import net.sf.gridarta.gui.utils.FaceComponent; +import net.sf.gridarta.mapmanager.MapManager; +import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetypetype.AbstractArchetypeAttributeSpell; @@ -114,6 +116,7 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectUtils; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.model.map.mapcontrol.MapControl; import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapModelListener; import net.sf.gridarta.model.map.mapmodel.MapSquare; @@ -264,7 +267,13 @@ @NotNull private final TextAreaDefaults textAreaDefaults; + /** + * The {@link MapManager} instance. + */ @NotNull + private final MapManager<G, A, R> mapManager; + + @NotNull private final Collection<DialogAttrib<G, A, R, ?>> dialogAttribs = new ArrayList<DialogAttrib<G, A, R, ?>>(); /** @@ -693,16 +702,52 @@ /** {@inheritDoc} */ @Override - public void mapClosed() { - setValue(cancelButton); + public void mapMetaChanged() { + // ignore } - /** {@inheritDoc} */ + }; + + /** + * The {@link MapManagerListener} to detect closed maps. + */ + @NotNull + private final MapManagerListener<G, A, R> mapManagerListener = new MapManagerListener<G, A, R>() { + + /** + * {@inheritDoc} + */ @Override - public void mapMetaChanged() { + public void currentMapChanged(@Nullable final MapControl<G, A, R> mapControl) { // ignore } + /** + * {@inheritDoc} + */ + @Override + public void mapCreated(@NotNull final MapControl<G, A, R> mapControl, final boolean interactive) { + // ignore + } + + /** + * {@inheritDoc} + */ + @Override + public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + + /** + * {@inheritDoc} + */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { + if (mapControl.getMapModel() == mapModel) { + setValue(cancelButton); + } + } + }; /** @@ -728,8 +773,9 @@ * @param systemIcons the system icons for creating icons * @param gameObjectMatchers the game object matchers to use * @param textAreaDefaults the text area defaults for text fields + * @param mapManager the map manager instance */ - public GameObjectAttributesDialog(@NotNull final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory, final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final G gameObject, @NotNull final JFrame parent, @NotNull final CFTreasureListTree<G, A, R> treasureListTree, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final GlobalSettings globalSettings, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final FaceObjects faceObjects, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, final int undefinedSpellIndex, @NotNull final TreasureTree treasureTree, @NotNull final SystemIcons systemIcons, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final TextAreaDefaults textAreaDefaults) { + public GameObjectAttributesDialog(@NotNull final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory, final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final G gameObject, @NotNull final JFrame parent, @NotNull final CFTreasureListTree<G, A, R> treasureListTree, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final GlobalSettings globalSettings, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final FaceObjects faceObjects, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, final int undefinedSpellIndex, @NotNull final TreasureTree treasureTree, @NotNull final SystemIcons systemIcons, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final TextAreaDefaults textAreaDefaults, @NotNull final MapManager<G, A, R> mapManager) { this.gameObjectAttributesDialogFactory = gameObjectAttributesDialogFactory; this.archetypeTypeSet = archetypeTypeSet; this.gameObject = gameObject; @@ -748,6 +794,7 @@ this.systemIcons = systemIcons; this.gameObjectMatchers = gameObjectMatchers; this.textAreaDefaults = textAreaDefaults; + this.mapManager = mapManager; archetype = gameObject.getArchetype(); final MapSquare<G, A, R> mapSquare = gameObject.getMapSquare(); @@ -757,6 +804,7 @@ mapModel = mapSquare.getMapModel(); mapPos = new Point(mapSquare.getMapX(), mapSquare.getMapY()); mapModel.addMapModelListener(mapModelListener); + mapManager.addMapManagerListener(mapManagerListener); archetypeType = archetypeTypeSet.getArchetypeType(gameObject); type = archetypeTypeSet.getArchetypeTypeIndex(archetypeType); @@ -822,6 +870,7 @@ if (newValue != UNINITIALIZED_VALUE) { gameObjectAttributesDialogFactory.hideAttribDialog(gameObject); mapModel.removeMapModelListener(mapModelListener); + mapManager.removeMapManagerListener(mapManagerListener); } } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -26,6 +26,7 @@ import javax.swing.JFrame; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.treasurelist.CFTreasureListTree; +import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; @@ -154,6 +155,12 @@ private TextAreaDefaults textAreaDefaults; /** + * The {@link MapManager} instance. + */ + @NotNull + private final MapManager<G, A, R> mapManager; + + /** * Creates a new instance. * @param archetypeTypeSet the list of CF type-data * @param parent the parent frame for dialog boxes @@ -172,8 +179,9 @@ * @param treasureTree the treasure tree to use * @param systemIcons the system icons for creating icons * @param gameObjectMatchers the game object matchers to use + * @param mapManager the map manager instance */ - public GameObjectAttributesDialogFactory(@NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final JFrame parent, @NotNull final CFTreasureListTree<G, A, R> treasureListTree, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final GlobalSettings globalSettings, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final FaceObjects faceObjects, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, final int undefinedSpellIndex, @NotNull final TreasureTree treasureTree, @NotNull final SystemIcons systemIcons, @NotNull final GameObjectMatchers gameObjectMatchers) { + public GameObjectAttributesDialogFactory(@NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final JFrame parent, @NotNull final CFTreasureListTree<G, A, R> treasureListTree, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final GlobalSettings globalSettings, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final FaceObjects faceObjects, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, final int undefinedSpellIndex, @NotNull final TreasureTree treasureTree, @NotNull final SystemIcons systemIcons, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final MapManager<G, A, R> mapManager) { this.archetypeTypeSet = archetypeTypeSet; this.parent = parent; this.treasureListTree = treasureListTree; @@ -189,6 +197,7 @@ this.treasureTree = treasureTree; this.systemIcons = systemIcons; this.gameObjectMatchers = gameObjectMatchers; + this.mapManager = mapManager; } @Deprecated @@ -219,7 +228,7 @@ if (dialogs.containsKey(head)) { dialogs.get(head).toFront(); } else { - final GameObjectAttributesDialog<G, A, R> pane = new GameObjectAttributesDialog<G, A, R>(this, archetypeTypeSet, head, parent, treasureListTree, faceObjectProviders, animationObjects, globalSettings, mapFileFilter, scriptFileFilter, faceObjects, gameObjectSpells, numberSpells, undefinedSpellIndex, treasureTree, systemIcons, gameObjectMatchers, textAreaDefaults); + final GameObjectAttributesDialog<G, A, R> pane = new GameObjectAttributesDialog<G, A, R>(this, archetypeTypeSet, head, parent, treasureListTree, faceObjectProviders, animationObjects, globalSettings, mapFileFilter, scriptFileFilter, faceObjects, gameObjectSpells, numberSpells, undefinedSpellIndex, treasureTree, systemIcons, gameObjectMatchers, textAreaDefaults, mapManager); final JDialog dialog = pane.createDialog(); dialogs.put(head, dialog); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -223,12 +223,6 @@ // ignore } - /** {@inheritDoc} */ - @Override - public void mapClosed() { - // ignore - } - }; /** Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -295,12 +295,6 @@ // ignore } - /** {@inheritDoc} */ - @Override - public void mapClosed() { - // ignore - } - }; /** Modified: trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -170,12 +170,6 @@ /** {@inheritDoc} */ @Override - public void mapClosed() { - // ignore - } - - /** {@inheritDoc} */ - @Override public void mapMetaChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -135,12 +135,6 @@ updateTitle(); } - /** {@inheritDoc} */ - @Override - public void mapClosed() { - // ignore - } - }; /** Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -167,12 +167,6 @@ /** {@inheritDoc} */ @Override - public void mapClosed() { - // ignore - } - - /** {@inheritDoc} */ - @Override public void mapMetaChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -267,14 +267,6 @@ // ignore } - /** - * {@inheritDoc} - */ - @Override - public void mapClosed() { - // ignore - } - }; /** Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -150,12 +150,6 @@ /** {@inheritDoc} */ @Override - public void mapClosed() { - // ignore - } - - /** {@inheritDoc} */ - @Override public void mapMetaChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -321,14 +321,6 @@ * {@inheritDoc} */ @Override - public void mapClosed() { - // ignore - } - - /** - * {@inheritDoc} - */ - @Override public void saved(@NotNull final DefaultMapControl<G, A, R> mapControl) { assert mapModel == mapControl.getMapModel(); addRecent(mapModel, null); Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -263,12 +263,6 @@ /** {@inheritDoc} */ @Override - public void mapClosed() { - // ignore - } - - /** {@inheritDoc} */ - @Override public void mapMetaChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -111,12 +111,6 @@ /** {@inheritDoc} */ @Override - public void mapClosed() { - // ignore - } - - /** {@inheritDoc} */ - @Override public void mapMetaChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -168,12 +168,6 @@ // ignore } - /** {@inheritDoc} */ - @Override - public void mapClosed() { - // ignore - } - }; /** Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -450,12 +450,6 @@ // ignore } - /** {@inheritDoc} */ - @Override - public void mapClosed() { - // ignore - } - }; /** Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -414,7 +414,7 @@ pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, newMapDialogFactory, mapArchObjectFactory, mapReaderFactory, mapFolderTree, mapManager, mainViewFrame, pickmapManager, mapViewsManager); newMapDialogFactory.setPickmapChooserControl(pickmapChooserControl); final CFTreasureListTree<G, A, R> treasureListTree = new CFTreasureListTree<G, A, R>(treasureTree, mainViewFrame, archetypeSet, faceObjectProviders, systemIcons); - final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory = new GameObjectAttributesDialogFactory<G, A, R>(archetypeTypeSet, mainViewFrame, treasureListTree, faceObjectProviders, animationObjects, globalSettings, mapFileFilter, scriptFileFilter, faceObjects, gameObjectSpells, numberSpells, undefinedSpellIndex, treasureTree, systemIcons, gameObjectMatchers); + final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory = new GameObjectAttributesDialogFactory<G, A, R>(archetypeTypeSet, mainViewFrame, treasureListTree, faceObjectProviders, animationObjects, globalSettings, mapFileFilter, scriptFileFilter, faceObjects, gameObjectSpells, numberSpells, undefinedSpellIndex, treasureTree, systemIcons, gameObjectMatchers, mapManager); final DefaultObjectChooser<G, A, R> objectChooser = new DefaultObjectChooser<G, A, R>(archetypeChooserControl, pickmapChooserControl, archetypeChooserModel, pickmapChooserModel, archetypeTypeSet); newMapDialogFactory.setObjectChooser(objectChooser); final SelectedSquareModel<G, A, R> selectedSquareModel = new SelectedSquareModel<G, A, R>(); Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -242,9 +242,6 @@ @Override public void mapClosed() { mapArchObject.removeMapArchObjectListener(mapArchObjectListener); - for (final MapModelListener<G, A, R> listener : mapModelListeners.getListeners()) { - listener.mapClosed(); - } } /** Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -84,9 +84,4 @@ */ void modifiedChanged(@NotNull MapModel<G, A, R> mapModel); - /** - * This map has been closed. - */ - void mapClosed(); - } // interface MapModelListener Modified: trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-05-09 09:30:06 UTC (rev 7719) +++ trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-05-09 11:22:48 UTC (rev 7720) @@ -130,14 +130,6 @@ * {@inheritDoc} */ @Override - public void mapClosed() { - // ignore - } - - /** - * {@inheritDoc} - */ - @Override public void mapMetaChanged() { result.append("mapMetaChanged"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-09 13:05:37
|
Revision: 7721 http://gridarta.svn.sourceforge.net/gridarta/?rev=7721&view=rev Author: akirschbaum Date: 2010-05-09 13:05:30 +0000 (Sun, 09 May 2010) Log Message: ----------- Rewrite GUIUtils.getResourceIcon() to prefer built-in resources over files and to complain about missing resources. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/IGUIConstants.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/IGUIConstants.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/src/app/net/sf/gridarta/utils/GUIUtils.java trunk/src/app/net/sf/gridarta/utils/SystemIcons.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/IGUIConstants.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/IGUIConstants.java 2010-05-09 11:22:48 UTC (rev 7720) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/IGUIConstants.java 2010-05-09 13:05:30 UTC (rev 7721) @@ -21,6 +21,7 @@ import net.sf.gridarta.gui.utils.GUIConstants; import net.sf.gridarta.utils.CommonConstants; +import net.sf.gridarta.utils.SystemIcons; /** * Defines common UI constants used in different dialogs and all used icon @@ -86,7 +87,7 @@ String ARTIFACTS_FILE = "artifacts"; // file with artifact definitions - String TILE_NORTH = "north.png"; + String TILE_NORTH = SystemIcons.SYSTEM_DIR + "north.png"; /** * Name of the files the spell information (names and numbers). Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-05-09 11:22:48 UTC (rev 7720) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-05-09 13:05:30 UTC (rev 7721) @@ -539,7 +539,7 @@ @NotNull @Override public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { - return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getSysIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, CommonConstants.EAST, CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); + return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, CommonConstants.EAST, CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/IGUIConstants.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/IGUIConstants.java 2010-05-09 11:22:48 UTC (rev 7720) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/IGUIConstants.java 2010-05-09 13:05:30 UTC (rev 7721) @@ -21,6 +21,7 @@ import net.sf.gridarta.gui.utils.GUIConstants; import net.sf.gridarta.utils.CommonConstants; +import net.sf.gridarta.utils.SystemIcons; /** * Defines common UI constants used in different dialogs and all used icon @@ -86,7 +87,7 @@ String ARTIFACTS_FILE = "artifacts"; // file with artifact definitions - String TILE_NORTH = "north.png"; + String TILE_NORTH = SystemIcons.SYSTEM_DIR + "north.png"; /** * Name of the files the spell information (names and numbers). Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-05-09 11:22:48 UTC (rev 7720) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-05-09 13:05:30 UTC (rev 7721) @@ -540,7 +540,7 @@ @NotNull @Override public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { - return mainControl.createGUIMainControl(FileFilters.luaFileFilter, ".lua", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getSysIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, CommonConstants.EAST, CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); + return mainControl.createGUIMainControl(FileFilters.luaFileFilter, ".lua", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, CommonConstants.EAST, CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } /** Modified: trunk/src/app/net/sf/gridarta/utils/GUIUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/utils/GUIUtils.java 2010-05-09 11:22:48 UTC (rev 7720) +++ trunk/src/app/net/sf/gridarta/utils/GUIUtils.java 2010-05-09 13:05:30 UTC (rev 7721) @@ -23,11 +23,11 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; +import java.util.MissingResourceException; import javax.swing.ImageIcon; import org.apache.log4j.Category; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * <code>CGUtils</code> is a collection of GUI utility methods. Mainly focusing @@ -39,16 +39,6 @@ public class GUIUtils { /** - * The directory that contains the common-use icons. - */ - private static final String ICON_DIR = "resource/icons"; - - /** - * The directory that contains the system icons. - */ - private static final String SYSTEM_DIR = "resource/system"; - - /** * The Logger for printing log messages. */ private static final Category log = Logger.getLogger(GUIUtils.class); @@ -64,81 +54,46 @@ * once and uses hashtable to return the same instance if same icon name is * given. Note: There must not be conflicting icon names from different * directorys. - * @param dirUri uri of the directory the icon is in - * @param strIconName the icon name (propably one of the constants defined - * in IGUIConstants). - * @return The image icon for the given icon name. + * @param iconName the icon name + * @return the image icon for the given icon name + * @throws MissingResourceException if the icon cannot be loaded */ - @Nullable - private ImageIcon getResourceIcon(@NotNull final String dirUri, @NotNull final String strIconName) { - if (dirUri.contains("\\")) { - throw new IllegalArgumentException("dirUri must be a URI but was: " + dirUri); + @NotNull + public ImageIcon getResourceIcon(@NotNull final String iconName) throws MissingResourceException { + // check cache + if (imageCache.containsKey(iconName)) { + if (log.isDebugEnabled()) { + log.debug("getResourceIcon(" + iconName + "): return cached"); + } + return imageCache.get(iconName); } - // first, look if this icon is already available in the Hashtable - if (imageCache.containsKey(strIconName)) { - return imageCache.get(strIconName); - } - // Look for the file, replacing '/' with File.separatorChar when necessary. - final File imageFile = new File(File.separatorChar == '/' ? dirUri : dirUri.replace('/', File.separatorChar), strIconName); - @Nullable final ImageIcon icon; - if (imageFile.exists()) { - // image file exists in expected directory - icon = new ImageIcon(imageFile.getAbsolutePath()); - } else { - // image file is missing, so let's try to load it from jar - final URL fullImageResource = GUIUtils.class.getClassLoader().getResource(dirUri + '/' + strIconName); + @NotNull final ImageIcon icon; - if (fullImageResource != null) { - icon = new ImageIcon(fullImageResource); - } else { - final int slashIndex = dirUri.indexOf('/'); - if (slashIndex == -1) { - icon = null; - } else { - // let's try it again without first directory (okay, this may look - // a bit weird, but usually this is the correct icon path in the jar) - final URL strippedImageResource = GUIUtils.class.getClassLoader().getResource(dirUri.substring(slashIndex + 1) + '/' + strIconName); - if (strippedImageResource != null) { - icon = new ImageIcon(strippedImageResource); - } else { - icon = null; - } + final URL iconURL = GUIUtils.class.getClassLoader().getResource(iconName); + if (iconURL != null) { + if (log.isDebugEnabled()) { + log.debug("getResourceIcon(" + iconName + "): loading from resource: " + iconURL); + } + icon = new ImageIcon(iconURL); + } else { + final File iconFile = new File(iconName); + if (iconFile.exists()) { + if (log.isDebugEnabled()) { + log.debug("getResourceIcon(" + iconName + "): loading from file: " + iconFile); } + icon = new ImageIcon(iconFile.getAbsolutePath()); + } else { + log.warn("Cannot find icon '" + iconName + "'"); + throw new MissingResourceException("missing resource", GUIUtils.class.getName(), iconName); } } - // put this icon into the Hashtable - if (icon != null) { - imageCache.put(strIconName, icon); - } else { - log.warn("Failed to load icon '" + strIconName + "'!"); - } - + imageCache.put(iconName, icon); return icon; } /** - * Returns the specified icon as a normal icon resource. - * @param strIconName Name of the icon to return. - * @return The icon or <code>null</code> if the icon couldn't be loaded. - */ - @Nullable - public ImageIcon getIcon(@NotNull final String strIconName) { - return getResourceIcon(ICON_DIR, strIconName); - } - - /** - * Returns the specified icon as a system icon resource. - * @param strIconName Name of the icon to return. - * @return The icon or <code>null</code> if the icon couldn't be loaded. - */ - @Nullable - public ImageIcon getSysIcon(@NotNull final String strIconName) { - return getResourceIcon(SYSTEM_DIR, strIconName); - } - - /** * Add an image to the cache. * @param name the name * @param imageIcon the image icon Modified: trunk/src/app/net/sf/gridarta/utils/SystemIcons.java =================================================================== --- trunk/src/app/net/sf/gridarta/utils/SystemIcons.java 2010-05-09 11:22:48 UTC (rev 7720) +++ trunk/src/app/net/sf/gridarta/utils/SystemIcons.java 2010-05-09 13:05:30 UTC (rev 7721) @@ -35,60 +35,64 @@ */ public class SystemIcons { - public static final String SQUARE_SEL_SQUARE = "seltile.png"; + /** The directory that contains the common-use icons. */ + private static final String ICON_DIR = "icons/"; - public static final String SQUARE_SEL_SQUARE_NORTH = "seltile_n.png"; + /** The directory that contains the system icons. */ + public static final String SYSTEM_DIR = "resource/system/"; - public static final String SQUARE_SEL_SQUARE_EAST = "seltile_e.png"; + public static final String SQUARE_SEL_SQUARE = SYSTEM_DIR + "seltile.png"; - public static final String SQUARE_SEL_SQUARE_SOUTH = "seltile_s.png"; + public static final String SQUARE_SEL_SQUARE_NORTH = SYSTEM_DIR + "seltile_n.png"; - public static final String SQUARE_SEL_SQUARE_WEST = "seltile_w.png"; + public static final String SQUARE_SEL_SQUARE_EAST = SYSTEM_DIR + "seltile_e.png"; - public static final String SQUARE_PRESEL_SQUARE = "preseltile.png"; + public static final String SQUARE_SEL_SQUARE_SOUTH = SYSTEM_DIR + "seltile_s.png"; - public static final String SQUARE_CURSOR = "cursor.png"; + public static final String SQUARE_SEL_SQUARE_WEST = SYSTEM_DIR + "seltile_w.png"; - public static final String SQUARE_EMPTY = "empty.png"; + public static final String SQUARE_PRESEL_SQUARE = SYSTEM_DIR + "preseltile.png"; - public static final String SQUARE_UNKNOWN = "unknown.png"; + public static final String SQUARE_CURSOR = SYSTEM_DIR + "cursor.png"; - public static final String SQUARE_WARNING = "warning.png"; + public static final String SQUARE_EMPTY = SYSTEM_DIR + "empty.png"; - public static final String SQUARE_NOFACE = "noface.png"; + public static final String SQUARE_UNKNOWN = SYSTEM_DIR + "unknown.png"; - public static final String SQUARE_NOARCH = "noarch.png"; + public static final String SQUARE_WARNING = SYSTEM_DIR + "warning.png"; - public static final String TREASURE_LIST = "treasure_list.png"; + public static final String SQUARE_NOFACE = SYSTEM_DIR + "noface.png"; - public static final String TREASUREONE_LIST = "treasureone_list.png"; + public static final String SQUARE_NOARCH = SYSTEM_DIR + "noarch.png"; - public static final String TREASURE_YES = "treasure_yes.png"; + public static final String TREASURE_LIST = SYSTEM_DIR + "treasure_list.png"; - public static final String TREASURE_NO = "treasure_no.png"; + public static final String TREASUREONE_LIST = SYSTEM_DIR + "treasureone_list.png"; - /** - * The default map icon to use if no icon can be created. - */ - public static final String DEFAULT_ICON = "default_icon.png"; + public static final String TREASURE_YES = SYSTEM_DIR + "treasure_yes.png"; + public static final String TREASURE_NO = SYSTEM_DIR + "treasure_no.png"; + + /** The default map icon to use if no icon can be created. */ + public static final String DEFAULT_ICON = SYSTEM_DIR + "default_icon.png"; + /** * The default map preview to use if no icon can be created. */ - public static final String DEFAULT_PREVIEW = "default_preview.png"; + public static final String DEFAULT_PREVIEW = SYSTEM_DIR + "default_preview.png"; - private static final String CLOSE_TAB_SMALLICON = "CloseTabSmallIcon.gif"; + private static final String CLOSE_TAB_SMALLICON = ICON_DIR + "CloseTabSmallIcon.gif"; - public static final String AUTORUN_SMALLICON = "AutorunSmallIcon.gif"; + public static final String AUTORUN_SMALLICON = SYSTEM_DIR + "AutorunSmallIcon.gif"; - public static final String FILTER_SMALLICON = "FilterSmallIcon.gif"; + public static final String FILTER_SMALLICON = SYSTEM_DIR + "FilterSmallIcon.gif"; - public static final String RUN_PLUGIN_SMALLICON = "RunPluginSmallIcon.gif"; + public static final String RUN_PLUGIN_SMALLICON = SYSTEM_DIR + "RunPluginSmallIcon.gif"; /** * Application icon definitions (icon-dir). */ - private static final String APP_ICON = "CFIcon.gif"; + private static final String APP_ICON = ICON_DIR + "CFIcon.gif"; /** * The {@link GUIUtils} for creating icons. @@ -185,7 +189,7 @@ @NotNull public ImageIcon getMapCursorIcon() { if (mapCursorIcon == null) { - mapCursorIcon = guiUtils.getSysIcon(SQUARE_CURSOR); + mapCursorIcon = guiUtils.getResourceIcon(SQUARE_CURSOR); } return mapCursorIcon; } @@ -193,7 +197,7 @@ @NotNull public Icon getEmptySquareIcon() { if (emptySquareIcon == null) { - emptySquareIcon = guiUtils.getSysIcon(SQUARE_EMPTY); + emptySquareIcon = guiUtils.getResourceIcon(SQUARE_EMPTY); } return emptySquareIcon; } @@ -201,7 +205,7 @@ @NotNull public ImageIcon getUnknownSquareIcon() { if (unknownSquareIcon == null) { - unknownSquareIcon = guiUtils.getSysIcon(SQUARE_UNKNOWN); + unknownSquareIcon = guiUtils.getResourceIcon(SQUARE_UNKNOWN); } return unknownSquareIcon; } @@ -210,7 +214,7 @@ public ImageIcon getWarningSquareIcon() { if (warningSquareIcon == null) { final ImageFilter alphaFilter = AlphaImageFilterInstance.ALPHA_FILTER; - final ImageIcon sysIcon = guiUtils.getSysIcon(SQUARE_WARNING); + final ImageIcon sysIcon = guiUtils.getResourceIcon(SQUARE_WARNING); final Image image = sysIcon.getImage(); final ImageProducer source = image.getSource(); final ImageProducer producer = new FilteredImageSource(source, alphaFilter); @@ -223,21 +227,21 @@ @NotNull public ImageIcon getNofaceSquareIcon() { if (nofaceSquareIcon == null) { - nofaceSquareIcon = guiUtils.getSysIcon(SQUARE_NOFACE); + nofaceSquareIcon = guiUtils.getResourceIcon(SQUARE_NOFACE); } return nofaceSquareIcon; } @NotNull public ImageIcon getNoarchSquareIcon() { - noarchSquareIcon = guiUtils.getSysIcon(SQUARE_NOARCH); + noarchSquareIcon = guiUtils.getResourceIcon(SQUARE_NOARCH); return noarchSquareIcon; } @NotNull public ImageIcon getMapSelIcon() { if (mapSelIcon == null) { - mapSelIcon = guiUtils.getSysIcon(SQUARE_SEL_SQUARE); + mapSelIcon = guiUtils.getResourceIcon(SQUARE_SEL_SQUARE); } return mapSelIcon; } @@ -245,7 +249,7 @@ @NotNull public ImageIcon getMapSelIconNorth() { if (mapSelIconNorth == null) { - mapSelIconNorth = guiUtils.getSysIcon(SQUARE_SEL_SQUARE_NORTH); + mapSelIconNorth = guiUtils.getResourceIcon(SQUARE_SEL_SQUARE_NORTH); } return mapSelIconNorth; } @@ -253,7 +257,7 @@ @NotNull public ImageIcon getMapSelIconEast() { if (mapSelIconEast == null) { - mapSelIconEast = guiUtils.getSysIcon(SQUARE_SEL_SQUARE_EAST); + mapSelIconEast = guiUtils.getResourceIcon(SQUARE_SEL_SQUARE_EAST); } return mapSelIconEast; } @@ -261,7 +265,7 @@ @NotNull public ImageIcon getMapSelIconSouth() { if (mapSelIconSouth == null) { - mapSelIconSouth = guiUtils.getSysIcon(SQUARE_SEL_SQUARE_SOUTH); + mapSelIconSouth = guiUtils.getResourceIcon(SQUARE_SEL_SQUARE_SOUTH); } return mapSelIconSouth; } @@ -269,7 +273,7 @@ @NotNull public ImageIcon getMapSelIconWest() { if (mapSelIconWest == null) { - mapSelIconWest = guiUtils.getSysIcon(SQUARE_SEL_SQUARE_WEST); + mapSelIconWest = guiUtils.getResourceIcon(SQUARE_SEL_SQUARE_WEST); } return mapSelIconWest; } @@ -277,7 +281,7 @@ @NotNull public ImageIcon getMapPreSelIcon() { if (mapPreSelIcon == null) { - mapPreSelIcon = guiUtils.getSysIcon(SQUARE_PRESEL_SQUARE); + mapPreSelIcon = guiUtils.getResourceIcon(SQUARE_PRESEL_SQUARE); } return mapPreSelIcon; } @@ -289,11 +293,10 @@ @NotNull public Image getDefaultIcon() { if (defaultIcon == null) { - final ImageIcon icon = guiUtils.getSysIcon(DEFAULT_ICON); - if (icon != null) { - defaultIcon = icon.getImage(); - } + final ImageIcon icon = guiUtils.getResourceIcon(DEFAULT_ICON); + defaultIcon = icon.getImage(); } + assert defaultIcon != null; return defaultIcon; } @@ -304,18 +307,17 @@ @NotNull public Image getDefaultPreview() { if (defaultPreview == null) { - final ImageIcon icon = guiUtils.getSysIcon(DEFAULT_PREVIEW); - if (icon != null) { - defaultPreview = icon.getImage(); - } + final ImageIcon icon = guiUtils.getResourceIcon(DEFAULT_PREVIEW); + defaultPreview = icon.getImage(); } + assert defaultPreview != null; return defaultPreview; } @NotNull public Icon getTreasureListIcon() { if (treasureListIcon == null) { - treasureListIcon = guiUtils.getSysIcon(TREASURE_LIST); + treasureListIcon = guiUtils.getResourceIcon(TREASURE_LIST); } return treasureListIcon; } @@ -323,7 +325,7 @@ @NotNull public Icon getTreasureOneListIcon() { if (treasureOneListIcon == null) { - treasureOneListIcon = guiUtils.getSysIcon(TREASUREONE_LIST); + treasureOneListIcon = guiUtils.getResourceIcon(TREASUREONE_LIST); } return treasureOneListIcon; } @@ -331,7 +333,7 @@ @NotNull public Icon getTreasureYesIcon() { if (treasureYesIcon == null) { - treasureYesIcon = guiUtils.getSysIcon(TREASURE_YES); + treasureYesIcon = guiUtils.getResourceIcon(TREASURE_YES); } return treasureYesIcon; } @@ -339,7 +341,7 @@ @NotNull public Icon getTreasureNoIcon() { if (treasureNoIcon == null) { - treasureNoIcon = guiUtils.getSysIcon(TREASURE_NO); + treasureNoIcon = guiUtils.getResourceIcon(TREASURE_NO); } return treasureNoIcon; } @@ -347,7 +349,7 @@ @NotNull public ImageIcon getCloseTabSmallIcon() { if (closeTabSmallIcon == null) { - closeTabSmallIcon = guiUtils.getSysIcon(CLOSE_TAB_SMALLICON); + closeTabSmallIcon = guiUtils.getResourceIcon(CLOSE_TAB_SMALLICON); } return closeTabSmallIcon; } @@ -355,7 +357,7 @@ @NotNull public Icon getAutoRunSmallIcon() { if (autoRunSmallIcon == null) { - autoRunSmallIcon = guiUtils.getSysIcon(AUTORUN_SMALLICON); + autoRunSmallIcon = guiUtils.getResourceIcon(AUTORUN_SMALLICON); } return autoRunSmallIcon; } @@ -363,7 +365,7 @@ @NotNull public Icon getFilterSmallIcon() { if (filterSmallIcon == null) { - filterSmallIcon = guiUtils.getSysIcon(FILTER_SMALLICON); + filterSmallIcon = guiUtils.getResourceIcon(FILTER_SMALLICON); } return filterSmallIcon; } @@ -371,7 +373,7 @@ @NotNull public Icon getRunPluginSmallIcon() { if (runPluginSmallIcon == null) { - runPluginSmallIcon = guiUtils.getSysIcon(RUN_PLUGIN_SMALLICON); + runPluginSmallIcon = guiUtils.getResourceIcon(RUN_PLUGIN_SMALLICON); } return runPluginSmallIcon; } @@ -383,7 +385,7 @@ @Nullable public ImageIcon getAppIcon() { if (appIcon == null) { - appIcon = guiUtils.getIcon(APP_ICON); + appIcon = guiUtils.getResourceIcon(APP_ICON); } return appIcon; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-11 22:03:22
|
Revision: 7722 http://gridarta.svn.sourceforge.net/gridarta/?rev=7722&view=rev Author: akirschbaum Date: 2010-05-11 22:03:16 +0000 (Tue, 11 May 2010) Log Message: ----------- Fix incorrect resource paths. Modified Paths: -------------- trunk/crossfire/build.xml trunk/src/app/net/sf/gridarta/utils/SystemIcons.java Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2010-05-09 13:05:30 UTC (rev 7721) +++ trunk/crossfire/build.xml 2010-05-11 22:03:16 UTC (rev 7722) @@ -131,11 +131,11 @@ </fileset> <fileset dir="${resource.dir}"> <include name="icons/**"/> + <include name="system/**"/> </fileset> <fileset dir="."> <include name="${resource.dir}/HelpFiles/**"/> <include name="${resource.dir}/conf/**"/> - <include name="${resource.dir}/system/**"/> </fileset> <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html" /> <fileset dir="../resource"> Modified: trunk/src/app/net/sf/gridarta/utils/SystemIcons.java =================================================================== --- trunk/src/app/net/sf/gridarta/utils/SystemIcons.java 2010-05-09 13:05:30 UTC (rev 7721) +++ trunk/src/app/net/sf/gridarta/utils/SystemIcons.java 2010-05-11 22:03:16 UTC (rev 7722) @@ -39,7 +39,7 @@ private static final String ICON_DIR = "icons/"; /** The directory that contains the system icons. */ - public static final String SYSTEM_DIR = "resource/system/"; + public static final String SYSTEM_DIR = "system/"; public static final String SQUARE_SEL_SQUARE = SYSTEM_DIR + "seltile.png"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-12 20:39:39
|
Revision: 7724 http://gridarta.svn.sourceforge.net/gridarta/?rev=7724&view=rev Author: akirschbaum Date: 2010-05-12 20:39:32 +0000 (Wed, 12 May 2010) Log Message: ----------- Implement #2951536 (Different color for unknown fields): use red text for incorrect attributes in game object text editor. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/GameObjectTextEditor.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-12 20:23:27 UTC (rev 7723) +++ trunk/atrinik/ChangeLog 2010-05-12 20:39:32 UTC (rev 7724) @@ -1,3 +1,8 @@ +2010-05-12 Andreas Kirschbaum + + * Implement #2951536 (Different color for unknown fields): use red + text for incorrect attributes in game object text editor. + 2010-05-09 Andreas Kirschbaum * Implement "Add Env" when using the pickmap chooser. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-12 20:23:27 UTC (rev 7723) +++ trunk/crossfire/ChangeLog 2010-05-12 20:39:32 UTC (rev 7724) @@ -1,3 +1,8 @@ +2010-05-12 Andreas Kirschbaum + + * Implement #2951536 (Different color for unknown fields): use red + text for incorrect attributes in game object text editor. + 2010-05-09 Andreas Kirschbaum * Implement "Add Env" when using the pickmap chooser. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-12 20:23:27 UTC (rev 7723) +++ trunk/daimonin/ChangeLog 2010-05-12 20:39:32 UTC (rev 7724) @@ -1,3 +1,8 @@ +2010-05-12 Andreas Kirschbaum + + * Implement #2951536 (Different color for unknown fields): use red + text for incorrect attributes in game object text editor. + 2010-05-09 Andreas Kirschbaum * Implement "Add Env" when using the pickmap chooser. Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java 2010-05-12 20:23:27 UTC (rev 7723) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java 2010-05-12 20:39:32 UTC (rev 7724) @@ -23,6 +23,7 @@ import net.sf.gridarta.gui.gameobjecttexteditor.GameObjectTextEditor; import net.sf.gridarta.gui.utils.Severity; import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; @@ -38,14 +39,16 @@ * The displayed {@link GameObjectTextEditor} instance. */ @NotNull - private final GameObjectTextEditor gameObjectTextEditor = new GameObjectTextEditor(); + private final GameObjectTextEditor<G, A, R> gameObjectTextEditor; /** * Creates a new instance. * @param gameObjectAttributesModel the model to track + * @param archetypeTypeSet the archetype type set */ - public TextEditorTab(@NotNull final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel) { + public TextEditorTab(@NotNull final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet) { super(gameObjectAttributesModel); + gameObjectTextEditor = new GameObjectTextEditor<G, A, R>(archetypeTypeSet); addAutoApply(gameObjectTextEditor.getTextPane()); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/GameObjectTextEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/GameObjectTextEditor.java 2010-05-12 20:23:27 UTC (rev 7723) +++ trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/GameObjectTextEditor.java 2010-05-12 20:39:32 UTC (rev 7724) @@ -22,6 +22,9 @@ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextPane; @@ -32,8 +35,14 @@ import javax.swing.text.MutableAttributeSet; import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; +import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.AttributeListUtils; +import net.sf.gridarta.model.archetypetype.ArchetypeAttribute; +import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.gameobject.GameObjectUtils; +import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.StringUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -42,7 +51,7 @@ * currently selected game object as a text document. * @author Andreas Kirschbaum */ -public class GameObjectTextEditor extends JPanel { +public class GameObjectTextEditor<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends JPanel { /** * The serial version UID. @@ -50,6 +59,12 @@ private static final long serialVersionUID = 1L; /** + * The {@link ArchetypeTypeSet}. + */ + @NotNull + private final ArchetypeTypeSet<G, A, R> archetypeTypeSet; + + /** * The {@link JTextPane} that contains the attributes of the game object. */ private final JTextPane archEdit = new ScrollingTextPane(); @@ -62,9 +77,11 @@ /** * Creates a new instance. + * @param archetypeTypeSet the archetype type set */ - public GameObjectTextEditor() { + public GameObjectTextEditor(@NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet) { super(new BorderLayout()); + this.archetypeTypeSet = archetypeTypeSet; final JScrollPane scrollPane = new JScrollPane(); add(scrollPane, BorderLayout.CENTER); scrollPane.setViewportView(archEdit); @@ -96,19 +113,34 @@ * GameObject}. * @param gameObject the game object to set the contents from */ - public void refreshDisplay(@Nullable final GameObject<?, ?, ?> gameObject) { + public void refreshDisplay(@Nullable final GameObject<G, A, R> gameObject) { archEdit.setEnabled(gameObject != null); archEdit.setText(""); if (gameObject != null) { final MutableAttributeSet currentAttributes = archEdit.getStyle(StyleContext.DEFAULT_STYLE); try { - // Color.blue: the "special" attributes, differ from the archetype - StyleConstants.setForeground(currentAttributes, Color.blue); - final Document document = archEdit.getDocument(); - document.insertString(document.getLength(), gameObject.getObjectText(), currentAttributes); - // Color.black: the game object attributes that differ from the archetype + final Iterable<ArchetypeAttribute<G, A, R>> typeStruct = archetypeTypeSet.getTypeOfArch(gameObject); + final String errorText = GameObjectUtils.getSyntaxErrors(gameObject, typeStruct); + + if (errorText == null) { + StyleConstants.setForeground(currentAttributes, Color.blue); + document.insertString(document.getLength(), gameObject.getObjectText(), currentAttributes); + } else { + StyleConstants.setForeground(currentAttributes, Color.red); + document.insertString(document.getLength(), errorText, currentAttributes); + + final Collection<String> errors = new HashSet<String>(); + errors.addAll(Arrays.asList(StringUtils.PATTERN_END_OF_LINE.split(errorText))); + StyleConstants.setForeground(currentAttributes, Color.blue); + for (final String line : StringUtils.PATTERN_END_OF_LINE.split(gameObject.getObjectText())) { + if (!errors.contains(line)) { + document.insertString(document.getLength(), line + '\n', currentAttributes); + } + } + } + StyleConstants.setForeground(currentAttributes, Color.black); document.insertString(document.getLength(), AttributeListUtils.diffArchTextKeys(gameObject, gameObject.getArchetype()), currentAttributes); } catch (final BadLocationException e) { Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-12 20:23:27 UTC (rev 7723) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-12 20:39:32 UTC (rev 7724) @@ -469,7 +469,7 @@ final UpdaterManager updaterManager = new UpdaterManager(exiter, mapManager, mainViewFrame, gridartaJarFilename); updaterManager.startup(); - final GameObjectAttributesTab<G, A, R> textEditorTab = new TextEditorTab<G, A, R>(gameObjectAttributesModel); + final GameObjectAttributesTab<G, A, R> textEditorTab = new TextEditorTab<G, A, R>(gameObjectAttributesModel, archetypeTypeSet); final GameObjectTab<G, A, R> gameObjectTab = new GameObjectTab<G, A, R>("gameObject", gameObjectAttributesControl, Location.BOTTOM, 0, true); mainView = new MainView(mainViewFrame, exitAction, mapDesktop, icon, exiter); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-13 18:53:13
|
Revision: 7738 http://gridarta.svn.sourceforge.net/gridarta/?rev=7738&view=rev Author: akirschbaum Date: 2010-05-13 18:53:07 +0000 (Thu, 13 May 2010) Log Message: ----------- Fix missing "Analyze" menu entries. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-13 13:51:09 UTC (rev 7737) +++ trunk/atrinik/ChangeLog 2010-05-13 18:53:07 UTC (rev 7738) @@ -1,3 +1,7 @@ +2010-05-13 Andreas Kirschbaum + + * Fix missing "Analyze" menu entries. + 2010-05-12 Andreas Kirschbaum * Implement #2951536 (Different color for unknown fields): use red Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-13 13:51:09 UTC (rev 7737) +++ trunk/crossfire/ChangeLog 2010-05-13 18:53:07 UTC (rev 7738) @@ -1,3 +1,7 @@ +2010-05-13 Andreas Kirschbaum + + * Fix missing "Analyze" menu entries. + 2010-05-12 Andreas Kirschbaum * Implement #2951536 (Different color for unknown fields): use red Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-13 13:51:09 UTC (rev 7737) +++ trunk/daimonin/ChangeLog 2010-05-13 18:53:07 UTC (rev 7738) @@ -1,3 +1,7 @@ +2010-05-13 Andreas Kirschbaum + + * Fix missing "Analyze" menu entries. + 2010-05-12 Andreas Kirschbaum * Implement #2951536 (Different color for unknown fields): use red Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-05-13 13:51:09 UTC (rev 7737) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-05-13 18:53:07 UTC (rev 7738) @@ -224,7 +224,6 @@ final GlobalSettings globalSettings = editorFactory.newGlobalSettings(configSourceFactory); final PathManager pathManager = new PathManager(globalSettings); final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(); - final NamedFilterList defaultNamedFilterList = new NamedFilterList(gameObjectMatchers.getFilters()); final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); final FaceObjects faceObjects = editorFactory.createFaceObjects(archFaceProvider); editorFactory.initSmoothFaces(faceObjects); @@ -235,8 +234,6 @@ final GameObjectFactory<G, A, R> gameObjectFactory = editorFactory.newGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, gameObjectMatchers); final GameObjectParser<G, A, R> gameObjectParser = gameObjectParserFactory.newGameObjectParser(); - final FilterControl<G, A, R> filterControl = new DefaultFilterControl<G, A, R>(defaultNamedFilterList); - final RendererFactory<G, A, R> rendererFactory = editorFactory.newRendererFactory(mapViewSettings, filterControl, gameObjectParser, faceObjectProviders, systemIcons); final ArchetypeFactory<G, A, R> archetypeFactory = editorFactory.newArchetypeFactory(faceObjectProviders, animationObjects); final ArchetypeSet<G, A, R> archetypeSet = editorFactory.newArchetypeSet(globalSettings, archetypeFactory, gameObjectParser); final MapArchObjectFactory<A> mapArchObjectFactory = editorFactory.newMapArchObjectFactory(globalSettings); @@ -272,6 +269,10 @@ } } + final NamedFilterList defaultNamedFilterList = new NamedFilterList(gameObjectMatchers.getFilters()); + final FilterControl<G, A, R> filterControl = new DefaultFilterControl<G, A, R>(defaultNamedFilterList); + final RendererFactory<G, A, R> rendererFactory = editorFactory.newRendererFactory(mapViewSettings, filterControl, gameObjectParser, faceObjectProviders, systemIcons); + final ScriptParameters scriptParameters = new ScriptParameters(); scriptParameters.addScriptParameter("archetypeSet", archetypeSet); scriptParameters.addScriptParameter("globalSettings", globalSettings); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-13 21:57:44
|
Revision: 7742 http://gridarta.svn.sourceforge.net/gridarta/?rev=7742&view=rev Author: akirschbaum Date: 2010-05-13 21:57:37 +0000 (Thu, 13 May 2010) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/FlatMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/IsoMapTilePane.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -22,7 +22,6 @@ import java.awt.Component; import javax.swing.JFrame; import javax.swing.filechooser.FileFilter; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.map.mapmodel.MapModel; @@ -31,8 +30,6 @@ import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; -import net.sf.japi.swing.action.ActionBuilder; -import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; /** @@ -43,11 +40,6 @@ public class DefaultMapPropertiesDialogFactory implements MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype> { /** - * Action Builder. - */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - - /** * The {@link MapManager} to use. */ @NotNull @@ -67,24 +59,16 @@ private final MapPathNormalizer mapPathNormalizer; /** - * The {@link MapViewsManager}. - */ - @NotNull - private final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager; - - /** * Creates a new instance. * @param mapManager the map manager to use * @param globalSettings the global settings instance * @param mapPathNormalizer the map path normalize for converting map paths * to files - * @param mapViewsManager the map views */ - public DefaultMapPropertiesDialogFactory(@NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager) { + public DefaultMapPropertiesDialogFactory(@NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapPathNormalizer mapPathNormalizer) { this.mapManager = mapManager; this.globalSettings = globalSettings; this.mapPathNormalizer = mapPathNormalizer; - this.mapViewsManager = mapViewsManager; } /** @@ -92,7 +76,7 @@ */ @Override public void showDialog(@NotNull final Component parent, @NotNull final JFrame helpParent, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter) { - final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer, mapViewsManager); + final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); pane.showDialog(parent); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -51,7 +51,6 @@ import net.sf.gridarta.gui.help.Help; import net.sf.gridarta.gui.map.maptilepane.AbstractMapTilePane; import net.sf.gridarta.gui.map.maptilepane.IsoMapTilePane; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.utils.GUIConstants; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.map.mapmodel.MapModel; @@ -174,9 +173,8 @@ * @param mapFileFilter the Swing file filter to use * @param mapPathNormalizer the map path normalizer for converting map paths * to files - * @param mapViewsManager the map views */ - public MapPropertiesDialog(@NotNull final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager) { + public MapPropertiesDialog(@NotNull final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { okButton.setDefaultCapable(true); final JButton helpButton = new JButton(ACTION_BUILDER.createAction(false, "mapHelp", this)); final JButton restoreButton = new JButton(ACTION_BUILDER.createAction(false, "mapRestore", this)); @@ -192,7 +190,7 @@ final Component mainPanel = createMainPanel(map); tabs.add(ACTION_BUILDER.getString("mapMapTabTitle"), mainPanel); - mapTilePane = new IsoMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer, mapViewsManager); + mapTilePane = new IsoMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); final Component tilePanel = createTilePathPanel(mapTilePane); tabs.add(ACTION_BUILDER.getString("mapTilesTabTitle"), tilePanel); Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -481,8 +481,8 @@ */ @NotNull @Override - public MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype> newMapPropertiesDialogFactory(@NotNull final GlobalSettings globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager) { - return new DefaultMapPropertiesDialogFactory(mapManager, globalSettings, mapPathNormalizer, mapViewsManager); + public MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype> newMapPropertiesDialogFactory(@NotNull final GlobalSettings globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapPathNormalizer mapPathNormalizer) { + return new DefaultMapPropertiesDialogFactory(mapManager, globalSettings, mapPathNormalizer); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -22,7 +22,6 @@ import java.awt.Component; import javax.swing.JFrame; import javax.swing.filechooser.FileFilter; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.map.mapmodel.MapModel; @@ -31,8 +30,6 @@ import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import net.sf.japi.swing.action.ActionBuilder; -import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; /** @@ -43,11 +40,6 @@ public class DefaultMapPropertiesDialogFactory implements MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype> { /** - * Action Builder. - */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - - /** * The {@link MapManager} to use. */ @NotNull @@ -67,24 +59,16 @@ private final MapPathNormalizer mapPathNormalizer; /** - * The {@link MapViewsManager}. - */ - @NotNull - private final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager; - - /** * Creates a new instance. * @param mapManager the map manager to use * @param globalSettings the global settings instance * @param mapPathNormalizer the map path normalizer for converting map paths * to files - * @param mapViewsManager the map views */ - public DefaultMapPropertiesDialogFactory(@NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager) { + public DefaultMapPropertiesDialogFactory(@NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapPathNormalizer mapPathNormalizer) { this.mapManager = mapManager; this.globalSettings = globalSettings; this.mapPathNormalizer = mapPathNormalizer; - this.mapViewsManager = mapViewsManager; } /** @@ -92,7 +76,7 @@ */ @Override public void showDialog(@NotNull final Component parent, @NotNull final JFrame helpParent, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter) { - final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer, mapViewsManager); + final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); pane.showDialog(parent); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -44,7 +44,6 @@ import net.sf.gridarta.gui.help.Help; import net.sf.gridarta.gui.map.maptilepane.AbstractMapTilePane; import net.sf.gridarta.gui.map.maptilepane.FlatMapTilePane; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.normalizer.MapPathNormalizer; @@ -194,9 +193,8 @@ * @param mapFileFilter the Swing file filter to use * @param mapPathNormalizer the map path normalizer for converting map paths * to files - * @param mapViewsManager the map views */ - public MapPropertiesDialog(final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager) { + public MapPropertiesDialog(final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { okButton.setDefaultCapable(true); final JButton helpButton = new JButton(ACTION_BUILDER.createAction(false, "mapHelp", this)); final JButton restoreButton = new JButton(ACTION_BUILDER.createAction(false, "mapRestore", this)); @@ -242,7 +240,7 @@ final Component weatherPanel = createWeatherPanel(map); tabs.add(ACTION_BUILDER.getString("mapWeatherTabTitle"), weatherPanel); - mapTilePane = new FlatMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer, mapViewsManager); + mapTilePane = new FlatMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); final Component tilePanel = createTilePathPanel(mapTilePane); tabs.add(ACTION_BUILDER.getString("mapTilesTabTitle"), tilePanel); Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -366,8 +366,8 @@ */ @NotNull @Override - public MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype> newMapPropertiesDialogFactory(@NotNull final GlobalSettings globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager) { - return new DefaultMapPropertiesDialogFactory(mapManager, globalSettings, mapPathNormalizer, mapViewsManager); + public MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype> newMapPropertiesDialogFactory(@NotNull final GlobalSettings globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapPathNormalizer mapPathNormalizer) { + return new DefaultMapPropertiesDialogFactory(mapManager, globalSettings, mapPathNormalizer); } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -22,7 +22,6 @@ import java.awt.Component; import javax.swing.JFrame; import javax.swing.filechooser.FileFilter; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.map.mapmodel.MapModel; @@ -31,8 +30,6 @@ import net.sf.gridarta.var.daimonin.model.archetype.Archetype; import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; import net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject; -import net.sf.japi.swing.action.ActionBuilder; -import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; /** @@ -43,11 +40,6 @@ public class DefaultMapPropertiesDialogFactory implements MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype> { /** - * Action Builder. - */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - - /** * The {@link MapManager} to use. */ @NotNull @@ -67,24 +59,16 @@ private final MapPathNormalizer mapPathNormalizer; /** - * The {@link MapViewsManager}. - */ - @NotNull - private final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager; - - /** * Creates a new instance. * @param mapManager the map manager to use * @param globalSettings the global settings instance * @param mapPathNormalizer the map path normalize for converting map paths * to files - * @param mapViewsManager the map views */ - public DefaultMapPropertiesDialogFactory(@NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager) { + public DefaultMapPropertiesDialogFactory(@NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapPathNormalizer mapPathNormalizer) { this.mapManager = mapManager; this.globalSettings = globalSettings; this.mapPathNormalizer = mapPathNormalizer; - this.mapViewsManager = mapViewsManager; } /** @@ -92,7 +76,7 @@ */ @Override public void showDialog(@NotNull final Component parent, @NotNull final JFrame helpParent, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter) { - final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer, mapViewsManager); + final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); pane.showDialog(parent); } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -52,7 +52,6 @@ import net.sf.gridarta.gui.help.Help; import net.sf.gridarta.gui.map.maptilepane.AbstractMapTilePane; import net.sf.gridarta.gui.map.maptilepane.IsoMapTilePane; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.utils.GUIConstants; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.map.mapmodel.MapModel; @@ -178,9 +177,8 @@ * @param mapFileFilter the Swing file filter to use * @param mapPathNormalizer the map path normalizer for converting map paths * to files - * @param mapViewsManager the map views */ - public MapPropertiesDialog(@NotNull final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager) { + public MapPropertiesDialog(@NotNull final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { okButton.setDefaultCapable(true); final JButton helpButton = new JButton(ACTION_BUILDER.createAction(false, "mapHelp", this)); final JButton restoreButton = new JButton(ACTION_BUILDER.createAction(false, "mapRestore", this)); @@ -197,7 +195,7 @@ final Component mainPanel = createMainPanel(map); tabs.add(ACTION_BUILDER.getString("mapMapTabTitle"), mainPanel); - mapTilePane = new IsoMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer, mapViewsManager); + mapTilePane = new IsoMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); final Component tilePanel = createTilePathPanel(mapTilePane); tabs.add(ACTION_BUILDER.getString("mapTilesTabTitle"), tilePanel); Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -482,8 +482,8 @@ */ @NotNull @Override - public MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype> newMapPropertiesDialogFactory(@NotNull final GlobalSettings globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager) { - return new DefaultMapPropertiesDialogFactory(mapManager, globalSettings, mapPathNormalizer, mapViewsManager); + public MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype> newMapPropertiesDialogFactory(@NotNull final GlobalSettings globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapPathNormalizer mapPathNormalizer) { + return new DefaultMapPropertiesDialogFactory(mapManager, globalSettings, mapPathNormalizer); } /** Modified: trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -34,7 +34,6 @@ import net.sf.gridarta.actions.CannotSaveMapFileException; import net.sf.gridarta.actions.InvalidPathNameException; import net.sf.gridarta.actions.MapSizeMismatchException; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.utils.DirectionLayout; import net.sf.gridarta.gui.utils.GUIConstants; import net.sf.gridarta.mapmanager.MapManager; @@ -110,12 +109,6 @@ private final FileFilter mapFileFilter; /** - * The {@link MapViewsManager}. - */ - @NotNull - private final MapViewsManager<G, A, R> mapViewsManager; - - /** * The JTextFields with the tile paths. */ @NotNull @@ -140,14 +133,12 @@ * @param mapFileFilter the file filter for map files * @param mapPathNormalizer the map path normalizer for converting map paths * to files - * @param mapViewsManager the map views */ - protected AbstractMapTilePane(@NotNull final MapManager<G, A, R> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapModel<G, A, R> mapModel, @NotNull final MapLink[][] tileLink, @NotNull final DirectionLayout.Direction[] directionMapping, @NotNull final int[] nextFocus, @NotNull final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { + protected AbstractMapTilePane(@NotNull final MapManager<G, A, R> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapModel<G, A, R> mapModel, @NotNull final MapLink[][] tileLink, @NotNull final DirectionLayout.Direction[] directionMapping, @NotNull final int[] nextFocus, @NotNull final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { this.globalSettings = globalSettings; this.mapModel = mapModel; this.nextFocus = nextFocus; this.mapFileFilter = mapFileFilter; - this.mapViewsManager = mapViewsManager; assert tileLink.length == 8; tileLinks = new TileLink[] { newTileLink("mapNorth", tileLink[0], CommonConstants.SOUTH), newTileLink("mapEast", tileLink[1], CommonConstants.WEST), newTileLink("mapSouth", tileLink[2], CommonConstants.NORTH), newTileLink("mapWest", tileLink[3], CommonConstants.EAST), newTileLink("mapNorthEast", tileLink[4], CommonConstants.SOUTH_WEST), newTileLink("mapSouthEast", tileLink[5], CommonConstants.NORTH_WEST), newTileLink("mapSouthWest", tileLink[6], CommonConstants.NORTH_EAST), newTileLink("mapNorthWest", tileLink[7], CommonConstants.SOUTH_EAST), }; attachTiledMaps = new AttachTiledMaps<G, A, R>(mapManager, tileLinks, mapPathNormalizer); Modified: trunk/src/app/net/sf/gridarta/gui/map/maptilepane/FlatMapTilePane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/FlatMapTilePane.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/src/app/net/sf/gridarta/gui/map/maptilepane/FlatMapTilePane.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -20,7 +20,6 @@ package net.sf.gridarta.gui.map.maptilepane; import javax.swing.filechooser.FileFilter; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.utils.DirectionLayout; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; @@ -67,10 +66,9 @@ * @param mapFileFilter the Swing file filter to use * @param mapPathNormalizer the map path normalizer for converting map paths * to files - * @param mapViewsManager the map views */ - public FlatMapTilePane(final MapManager<G, A, R> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<G, A, R> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { - super(mapManager, globalSettings, mapModel, tileLink, directionMapping, nextFocus, mapFileFilter, mapPathNormalizer, mapViewsManager); + public FlatMapTilePane(final MapManager<G, A, R> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<G, A, R> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { + super(mapManager, globalSettings, mapModel, tileLink, directionMapping, nextFocus, mapFileFilter, mapPathNormalizer); } } // class FlatMapTilePane Modified: trunk/src/app/net/sf/gridarta/gui/map/maptilepane/IsoMapTilePane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/IsoMapTilePane.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/src/app/net/sf/gridarta/gui/map/maptilepane/IsoMapTilePane.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -20,7 +20,6 @@ package net.sf.gridarta.gui.map.maptilepane; import javax.swing.filechooser.FileFilter; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.utils.DirectionLayout; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; @@ -95,10 +94,9 @@ * @param mapFileFilter the Swing file filter to use * @param mapPathNormalizer the map path normalizer for converting map paths * to files - * @param mapViewsManager the map views */ - public IsoMapTilePane(final MapManager<G, A, R> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<G, A, R> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { - super(mapManager, globalSettings, mapModel, tileLink, directionMapping, nextFocus, mapFileFilter, mapPathNormalizer, mapViewsManager); + public IsoMapTilePane(final MapManager<G, A, R> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<G, A, R> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { + super(mapManager, globalSettings, mapModel, tileLink, directionMapping, nextFocus, mapFileFilter, mapPathNormalizer); } } // class IsoMapTilePane Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -311,11 +311,10 @@ * @param mapManager the map manager to use * @param mapPathNormalizer the map path normalizer for converting map paths * to files - * @param mapViewsManager the map views * @return the new instance */ @NotNull - MapPropertiesDialogFactory<G, A, R> newMapPropertiesDialogFactory(@NotNull GlobalSettings globalSettings, @NotNull MapManager<G, A, R> mapManager, @NotNull MapPathNormalizer mapPathNormalizer, @NotNull MapViewsManager<G, A, R> mapViewsManager); + MapPropertiesDialogFactory<G, A, R> newMapPropertiesDialogFactory(@NotNull GlobalSettings globalSettings, @NotNull MapManager<G, A, R> mapManager, @NotNull MapPathNormalizer mapPathNormalizer); /** * @param parent the parent component for dialogs Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-13 21:40:12 UTC (rev 7741) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-13 21:57:37 UTC (rev 7742) @@ -453,7 +453,7 @@ final GameObjectMatcher exitGameObjectMatcher = exitGameObjectMatcherTmp == null ? new TypeNrsGameObjectMatcher() : exitGameObjectMatcherTmp; final ExitMatcher<G, A, R> exitMatcher = new ExitMatcher<G, A, R>(exitGameObjectMatcher); final MapPathNormalizer mapPathNormalizer = new MapPathNormalizer(globalSettings); - final MapPropertiesDialogFactory<G, A, R> mapPropertiesDialogFactory = editorFactory.newMapPropertiesDialogFactory(globalSettings, mapManager, mapPathNormalizer, mapViewsManager); + final MapPropertiesDialogFactory<G, A, R> mapPropertiesDialogFactory = editorFactory.newMapPropertiesDialogFactory(globalSettings, mapManager, mapPathNormalizer); new DefaultMapActions<G, A, R>(mainViewFrame, mainViewFrame, mapManager, mapViewManager, exitMatcher, FileFilters.mapFileFilter, selectedSquareModel, directionMap, allowRandomMapParameters, mapPropertiesDialogFactory, mapViewSettings, mapPathNormalizer, mapViewsManager, fileControl); ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker); final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager = new DelayedMapModelListenerManager<G, A, R>(mapManager, exiter); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-14 18:47:21
|
Revision: 7754 http://gridarta.svn.sourceforge.net/gridarta/?rev=7754&view=rev Author: akirschbaum Date: 2010-05-14 18:47:14 +0000 (Fri, 14 May 2010) Log Message: ----------- Implement #2385930 (Alert when adding items in to a shop). Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/crossfire/resource/conf/GameObjectMatchers.xml trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties trunk/src/app/net/sf/gridarta/validation/checks/AbstractShopSquareChecker.java trunk/src/app/net/sf/gridarta/validation/checks/ShopSquareChecker.java trunk/src/doc/ref/GameObjectMatcher.xhtml Added Paths: ----------- trunk/src/app/net/sf/gridarta/model/map/validation/errors/PaidItemShopSquareError.java trunk/src/app/net/sf/gridarta/validation/checks/PaidItemShopSquareChecker.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-14 17:56:25 UTC (rev 7753) +++ trunk/atrinik/ChangeLog 2010-05-14 18:47:14 UTC (rev 7754) @@ -1,3 +1,9 @@ +2010-05-14 Andreas Kirschbaum + + * Implement #2385930 (Alert when adding items in to a shop): add + new map validator "Shop square contains paid item" that checks for + shop sqaures that contain at least one paid item. + 2010-05-13 Andreas Kirschbaum * Fix missing "Analyze" menu entries. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-14 17:56:25 UTC (rev 7753) +++ trunk/crossfire/ChangeLog 2010-05-14 18:47:14 UTC (rev 7754) @@ -1,3 +1,9 @@ +2010-05-14 Andreas Kirschbaum + + * Implement #2385930 (Alert when adding items in to a shop): add + new map validator "Shop square contains paid item" that checks for + shop sqaures that contain at least one paid item. + 2010-05-13 Andreas Kirschbaum * Fix error message about missing cfpython_menu.def file. Modified: trunk/crossfire/resource/conf/GameObjectMatchers.xml =================================================================== --- trunk/crossfire/resource/conf/GameObjectMatchers.xml 2010-05-14 17:56:25 UTC (rev 7753) +++ trunk/crossfire/resource/conf/GameObjectMatchers.xml 2010-05-14 18:47:14 UTC (rev 7754) @@ -245,4 +245,17 @@ </And> </GameObjectMatcher> + <!-- Objects checked by the "Shop square contains paid item" map validator: + objects matching this matcher are paid items. --> + <GameObjectMatcher id="system_paid_item" system="true"> + <title xml:lang="en">Paid items</title> + <title xml:lang="en">Bezahlte Gegenstände</title> + <And> + <Attrib name="no_pick" value="" /> + <Attrib name="unpaid" value="" /> + <Attrib name="monster" value="" /> + <Attrib name="generator" value="" /> + </And> + </GameObjectMatcher> + </GameObjectMatchers> Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-14 17:56:25 UTC (rev 7753) +++ trunk/daimonin/ChangeLog 2010-05-14 18:47:14 UTC (rev 7754) @@ -1,3 +1,9 @@ +2010-05-14 Andreas Kirschbaum + + * Implement #2385930 (Alert when adding items in to a shop): add + new map validator "Shop square contains paid item" that checks for + shop sqaures that contain at least one paid item. + 2010-05-13 Andreas Kirschbaum * Fix missing "Analyze" menu entries. Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-05-14 17:56:25 UTC (rev 7753) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-05-14 18:47:14 UTC (rev 7754) @@ -100,6 +100,7 @@ import net.sf.gridarta.validation.DelegatingMapValidator; import net.sf.gridarta.validation.checks.AttributeRangeChecker; import net.sf.gridarta.validation.checks.ConnectionChecker; +import net.sf.gridarta.validation.checks.PaidItemShopSquareChecker; import net.sf.gridarta.validation.checks.ShopSquareChecker; import org.apache.log4j.Category; import org.apache.log4j.Logger; @@ -205,6 +206,11 @@ if (noSpellsMatcher != null) { validators.addValidator(new ShopSquareChecker<G, A, R>(shopSquareMatcher, noSpellsMatcher)); } + + final GameObjectMatcher paidItemMatcher = gameObjectMatchers.getMatcher("system_paid_item"); + if (paidItemMatcher != null) { + validators.addValidator(new PaidItemShopSquareChecker<G, A, R>(shopSquareMatcher, paidItemMatcher)); + } } Map<String, TreasureTreeNode> specialTreasureLists; try { Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-05-14 17:56:25 UTC (rev 7753) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-05-14 18:47:14 UTC (rev 7754) @@ -946,6 +946,7 @@ prefs.Validator.Exit=Whether this map validator check is is enabled. prefs.Validator.MapDifficulty=Whether this map validator check is is enabled. prefs.Validator.MobOutsideSpawnPoint=Whether this map validator check is is enabled. +prefs.Validator.PaidItemShopSquare=Whether this map validator check is is enabled. prefs.Validator.ShopSquare=Whether this map validator check is is enabled. prefs.Validator.Slaying=Whether this map validator check is is enabled. prefs.Validator.SquareWithoutFloor=Whether this map validator check is is enabled. @@ -1110,6 +1111,10 @@ Validator.MobOutsideSpawnPoint.title=Mob outside spawn point Validator.MobOutsideSpawnPoint.msg=<html><h3>{0}</h3><p>On this square there is a mob outside a spawn point.<br>Mobs outside spawn points are okay, but you should perhaps still put the mob inside a spawn point.</p><p>You could:</p><ul><li>Ignore this</li><li>Create a spawn point for this mob</li></ul> +Validator.PaidItemShopSquare.default=true +Validator.PaidItemShopSquare.title=Shop square contains paid item +Validator.PaidItemShopSquare.msg=<html><h3>{0}</h3><p>On this square there is a shop square while contains a paid item. Usually items on shop squares should be unpaid by default. + Validator.ShopSquare.default=true Validator.ShopSquare.title=Shop square allows magic and/or prayers Validator.ShopSquare.msg=<html><h3>{0}</h3><p>On this square there is a shop square which allows magic and/or prayers.</p> Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-05-14 17:56:25 UTC (rev 7753) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-05-14 18:47:14 UTC (rev 7754) @@ -953,6 +953,9 @@ Validator.MobOutsideSpawnPoint.title=Mob au\xDFerhalb Spawn Point Validator.MobOutsideSpawnPoint.msg=<html><h3>{0}</h3><p>Dieses Feld beinhaltete einen Mob au\xDFerhalb eines Spawn Points.<br>Dies ist erlaubt, aber Sie sollten den Mobs trotzdem in einen Spawn Point einf\xFCgen.</p><p>Sie k\xF6nnen:</p><ul><li>Dieses Problem ignorieren</li><li>Einen Spawn Point f\xFCr diesen Mob erzeugen</li></ul> +Validator.PaidItemShopSquare.title=Gesch\xE4ftsfl\xE4che mit bezahltem Gegenstand +Validator.PaidItemShopSquare.msg=<html><h3>{0}</h3><p>Dieses Feld ist eine Gesch\xE4ftsfl\xE4che und enth\xE4lt einen bereits bezahlten Gegenstand. In der Regel sollten diese Gegenst\xE4nde unbezahlt sein. + Validator.ShopSquare.title=Gesch\xE4ftsfl\xE4che erlaubt Magie Validator.ShopSquare.msg=<html><h3>{0}</h3><p>Dieses Feld is eine Gesch\xE4ftsfl\xE4che und erlaubt Magic.</p> Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-05-14 17:56:25 UTC (rev 7753) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-05-14 18:47:14 UTC (rev 7754) @@ -946,6 +946,9 @@ #Validator.MobOutsideSpawnPoint.title= #Validator.MobOutsideSpawnPoint.msg= +#Validator.PaidItemShopSquare.title= +#Validator.PaidItemShopSquare.msg= + #Validator.ShopSquare.title= #Validator.ShopSquare.msg= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-05-14 17:56:25 UTC (rev 7753) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-05-14 18:47:14 UTC (rev 7754) @@ -950,6 +950,9 @@ #Validator.MapDifficulty.title= #Validator.MapDifficulty.msg= +#Validator.PaidItemShopSquare.title= +#Validator.PaidItemShopSquare.msg= + #Validator.ShopSquare.title= #Validator.ShopSquare.msg= Added: trunk/src/app/net/sf/gridarta/model/map/validation/errors/PaidItemShopSquareError.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/validation/errors/PaidItemShopSquareError.java (rev 0) +++ trunk/src/app/net/sf/gridarta/model/map/validation/errors/PaidItemShopSquareError.java 2010-05-14 18:47:14 UTC (rev 7754) @@ -0,0 +1,47 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.map.validation.errors; + +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.model.map.mapmodel.MapSquare; +import org.jetbrains.annotations.NotNull; + +/** + * A map square that is a shop tile and contains paid items. + * @author Andreas Kirschbaum + */ +public class PaidItemShopSquareError<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends SquareValidationError<G, A, R> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * Creates a new instance. + * @param mapSquare the square on which the error occurred + */ + public PaidItemShopSquareError(@NotNull final MapSquare<G, A, R> mapSquare) { + super(mapSquare); + } + +} // class PaidItemShopSquareError Property changes on: trunk/src/app/net/sf/gridarta/model/map/validation/errors/PaidItemShopSquareError.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/validation/checks/AbstractShopSquareChecker.java =================================================================== --- trunk/src/app/net/sf/gridarta/validation/checks/AbstractShopSquareChecker.java 2010-05-14 17:56:25 UTC (rev 7753) +++ trunk/src/app/net/sf/gridarta/validation/checks/AbstractShopSquareChecker.java 2010-05-14 18:47:14 UTC (rev 7754) @@ -24,8 +24,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.mapmodel.MapModel; -import net.sf.gridarta.model.map.validation.ErrorCollector; -import net.sf.gridarta.model.map.validation.errors.ShopSquareError; import net.sf.gridarta.model.match.GameObjectMatcher; import net.sf.gridarta.utils.Size2D; import net.sf.gridarta.validation.AbstractValidator; @@ -41,53 +39,13 @@ public abstract class AbstractShopSquareChecker<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractValidator implements MapValidator<G, A, R> { /** - * The {@link GameObjectMatcher} for finding shop squares. - */ - @NotNull - private final GameObjectMatcher shopMatcher; - - /** - * The {@link GameObjectMatcher} for finding no-spell squares. - */ - @NotNull - private final GameObjectMatcher noSpellsMatcher; - - /** - * Creates a new instance. - * @param shopMatcher the game object matcher for finding shop squares - * @param noSpellsMatcher the game object matcher for finding no-spell - * squares - */ - protected AbstractShopSquareChecker(@NotNull final GameObjectMatcher shopMatcher, @NotNull final GameObjectMatcher noSpellsMatcher) { - this.shopMatcher = shopMatcher; - this.noSpellsMatcher = noSpellsMatcher; - } - - /** - * {@inheritDoc} - */ - @Override - public void validate(@NotNull final MapModel<G, A, R> mapModel, @NotNull final ErrorCollector<G, A, R> errorCollector) { - final boolean[][] shopSquares = findMatchingSquares(mapModel, shopMatcher); - final boolean[][] noSpellsSquares = findMatchingSquares(mapModel, noSpellsMatcher); - final Point point = new Point(); - for (point.x = 0; point.x < shopSquares.length && point.x < noSpellsSquares.length; point.x++) { - for (point.y = 0; point.y < shopSquares[point.x].length && point.y < noSpellsSquares[point.x].length; point.y++) { - if (shopSquares[point.x][point.y] && !noSpellsSquares[point.x][point.y]) { - errorCollector.collect(new ShopSquareError<G, A, R>(mapModel.getMapSquare(point))); - } - } - } - } - - /** * Returns a <code>boolean</code> array of the map size that marks squares * that contain game objects matching a given {@link GameObjectMatcher}. * @param mapModel the map to check * @param matcher the matcher to use * @return the array */ - private boolean[][] findMatchingSquares(@NotNull final MapModel<G, A, R> mapModel, @NotNull final GameObjectMatcher matcher) { + protected boolean[][] findMatchingSquares(@NotNull final MapModel<G, A, R> mapModel, @NotNull final GameObjectMatcher matcher) { final Size2D mapSize = mapModel.getMapSize(); final int mapWidth = mapSize.getWidth(); final int mapHeight = mapSize.getHeight(); Added: trunk/src/app/net/sf/gridarta/validation/checks/PaidItemShopSquareChecker.java =================================================================== --- trunk/src/app/net/sf/gridarta/validation/checks/PaidItemShopSquareChecker.java (rev 0) +++ trunk/src/app/net/sf/gridarta/validation/checks/PaidItemShopSquareChecker.java 2010-05-14 18:47:14 UTC (rev 7754) @@ -0,0 +1,78 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.validation.checks; + +import java.awt.Point; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.model.map.mapmodel.MapModel; +import net.sf.gridarta.model.map.validation.ErrorCollector; +import net.sf.gridarta.model.map.validation.errors.PaidItemShopSquareError; +import net.sf.gridarta.model.match.GameObjectMatcher; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link net.sf.gridarta.validation.MapValidator} to detect shop squares + * that contain paid items. + * @author Andreas Kirschbaum + */ +public class PaidItemShopSquareChecker<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractShopSquareChecker<G, A, R> { + + /** + * The {@link GameObjectMatcher} for finding shop squares. + */ + @NotNull + private final GameObjectMatcher shopMatcher; + + /** + * The {@link GameObjectMatcher} for finding paid items. + */ + @NotNull + private final GameObjectMatcher paidItemMatcher; + + /** + * Creates a new instance. + * @param shopMatcher the game object matcher for finding shop squares + * @param paidItemMatcher the game object matcher for finding paid items + */ + public PaidItemShopSquareChecker(@NotNull final GameObjectMatcher shopMatcher, @NotNull final GameObjectMatcher paidItemMatcher) { + this.shopMatcher = shopMatcher; + this.paidItemMatcher = paidItemMatcher; + } + + /** + * {@inheritDoc} + */ + @Override + public void validate(@NotNull final MapModel<G, A, R> mapModel, @NotNull final ErrorCollector<G, A, R> errorCollector) { + final boolean[][] shopSquares = findMatchingSquares(mapModel, shopMatcher); + final boolean[][] noSpellsSquares = findMatchingSquares(mapModel, paidItemMatcher); + final Point point = new Point(); + for (point.x = 0; point.x < shopSquares.length && point.x < noSpellsSquares.length; point.x++) { + for (point.y = 0; point.y < shopSquares[point.x].length && point.y < noSpellsSquares[point.x].length; point.y++) { + if (shopSquares[point.x][point.y] && noSpellsSquares[point.x][point.y]) { + errorCollector.collect(new PaidItemShopSquareError<G, A, R>(mapModel.getMapSquare(point))); + } + } + } + } + +} // class PaidItemShopSquareChecker Property changes on: trunk/src/app/net/sf/gridarta/validation/checks/PaidItemShopSquareChecker.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/validation/checks/ShopSquareChecker.java =================================================================== --- trunk/src/app/net/sf/gridarta/validation/checks/ShopSquareChecker.java 2010-05-14 17:56:25 UTC (rev 7753) +++ trunk/src/app/net/sf/gridarta/validation/checks/ShopSquareChecker.java 2010-05-14 18:47:14 UTC (rev 7754) @@ -19,9 +19,13 @@ package net.sf.gridarta.validation.checks; +import java.awt.Point; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.model.map.mapmodel.MapModel; +import net.sf.gridarta.model.map.validation.ErrorCollector; +import net.sf.gridarta.model.map.validation.errors.ShopSquareError; import net.sf.gridarta.model.match.GameObjectMatcher; import org.jetbrains.annotations.NotNull; @@ -34,12 +38,42 @@ public class ShopSquareChecker<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractShopSquareChecker<G, A, R> { /** + * The {@link GameObjectMatcher} for finding shop squares. + */ + @NotNull + private final GameObjectMatcher shopMatcher; + + /** + * The {@link GameObjectMatcher} for finding no-spell squares. + */ + @NotNull + private final GameObjectMatcher noSpellsMatcher; + + /** * Creates a new instance. * @param shopMatcher the game object matcher for finding shop squares * @param noSpellsMatcher the game object matcher for finding no-spell squares */ public ShopSquareChecker(@NotNull final GameObjectMatcher shopMatcher, @NotNull final GameObjectMatcher noSpellsMatcher) { - super(shopMatcher, noSpellsMatcher); + this.shopMatcher = shopMatcher; + this.noSpellsMatcher = noSpellsMatcher; } + /** + * {@inheritDoc} + */ + @Override + public void validate(@NotNull final MapModel<G, A, R> mapModel, @NotNull final ErrorCollector<G, A, R> errorCollector) { + final boolean[][] shopSquares = findMatchingSquares(mapModel, shopMatcher); + final boolean[][] noSpellsSquares = findMatchingSquares(mapModel, noSpellsMatcher); + final Point point = new Point(); + for (point.x = 0; point.x < shopSquares.length && point.x < noSpellsSquares.length; point.x++) { + for (point.y = 0; point.y < shopSquares[point.x].length && point.y < noSpellsSquares[point.x].length; point.y++) { + if (shopSquares[point.x][point.y] && !noSpellsSquares[point.x][point.y]) { + errorCollector.collect(new ShopSquareError<G, A, R>(mapModel.getMapSquare(point))); + } + } + } + } + } // class ShopSquareChecker Modified: trunk/src/doc/ref/GameObjectMatcher.xhtml =================================================================== --- trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-05-14 17:56:25 UTC (rev 7753) +++ trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-05-14 18:47:14 UTC (rev 7754) @@ -53,6 +53,12 @@ 'system_no_spells' (or fallback 'no_spells'). Not checked if either matcher is not defined. </li> + <li>Checks for shop tiles that contain paid items. Shop + tiles are selected by matcher 'system_shop_tile' (or + fallback 'shop_tile'); paid items are selected by + matcher 'system_paid_item'. Not checked if either + matcher is not defined. + </li> <li>Checks for connected objects without sources or sinks. Sources are selected by matcher 'system_connection_source'; sinks are selected by This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-14 22:29:43
|
Revision: 7760 http://gridarta.svn.sourceforge.net/gridarta/?rev=7760&view=rev Author: akirschbaum Date: 2010-05-14 22:29:37 +0000 (Fri, 14 May 2010) Log Message: ----------- Do not report spurious changes in Paths & Resources tab in settings dialog. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-14 21:58:57 UTC (rev 7759) +++ trunk/atrinik/ChangeLog 2010-05-14 22:29:37 UTC (rev 7760) @@ -1,3 +1,8 @@ +2010-05-15 Andreas Kirschbaum + + * Do not report spurious changes in Paths & Resources tab in + settings dialog. + 2010-05-14 Andreas Kirschbaum * Implement #2385930 (Alert when adding items in to a shop): add Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-14 21:58:57 UTC (rev 7759) +++ trunk/daimonin/ChangeLog 2010-05-14 22:29:37 UTC (rev 7760) @@ -1,3 +1,8 @@ +2010-05-15 Andreas Kirschbaum + + * Do not report spurious changes in Paths & Resources tab in + settings dialog. + 2010-05-14 Andreas Kirschbaum * Implement #2385930 (Alert when adding items in to a shop): add Modified: trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java 2010-05-14 21:58:57 UTC (rev 7759) +++ trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java 2010-05-14 22:29:37 UTC (rev 7760) @@ -287,7 +287,7 @@ */ @NotNull private static String convertImageSet(@Nullable final String imageSet) { - return imageSet == null || imageSet.equals("none") ? "disabled" : imageSet; + return imageSet == null || imageSet.isEmpty() || imageSet.equals("none") ? "disabled" : imageSet; } } // class ResPrefs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-15 09:48:06
|
Revision: 7761 http://gridarta.svn.sourceforge.net/gridarta/?rev=7761&view=rev Author: akirschbaum Date: 2010-05-15 09:48:00 +0000 (Sat, 15 May 2010) Log Message: ----------- In game object attributes dialog, improve formatting of bitmask values. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/model/archetypetype/CAttribBitmask.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-14 22:29:37 UTC (rev 7760) +++ trunk/atrinik/ChangeLog 2010-05-15 09:48:00 UTC (rev 7761) @@ -1,5 +1,9 @@ 2010-05-15 Andreas Kirschbaum + * In game object attributes dialog, improve formatting of bitmask + values: display "all -abc" only if there are more than three + alternatives; with less alternatives always use the positive form. + * Do not report spurious changes in Paths & Resources tab in settings dialog. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-14 22:29:37 UTC (rev 7760) +++ trunk/crossfire/ChangeLog 2010-05-15 09:48:00 UTC (rev 7761) @@ -1,5 +1,9 @@ 2010-05-14 Andreas Kirschbaum + * In game object attributes dialog, improve formatting of bitmask + values: display "all -abc" only if there are more than three + alternatives; with less alternatives always use the positive form. + * Implement #2385930 (Alert when adding items in to a shop): add new map validator "Shop square contains paid item" that checks for shop sqaures that contain at least one paid item. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-14 22:29:37 UTC (rev 7760) +++ trunk/daimonin/ChangeLog 2010-05-15 09:48:00 UTC (rev 7761) @@ -1,5 +1,9 @@ 2010-05-15 Andreas Kirschbaum + * In game object attributes dialog, improve formatting of bitmask + values: display "all -abc" only if there are more than three + alternatives; with less alternatives always use the positive form. + * Do not report spurious changes in Paths & Resources tab in settings dialog. Modified: trunk/src/app/net/sf/gridarta/model/archetypetype/CAttribBitmask.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetypetype/CAttribBitmask.java 2010-05-14 22:29:37 UTC (rev 7760) +++ trunk/src/app/net/sf/gridarta/model/archetypetype/CAttribBitmask.java 2010-05-15 09:48:00 UTC (rev 7761) @@ -262,7 +262,8 @@ * at mt, we couldn't get that. */ int allCount = 0; - for (int i = moveAll, count = 0; i != 0; i >>= 1, count++) { + int count = 0; + for (int i = moveAll; i != 0; i >>= 1) { final String strNull = strings.get(1 << count); final String str = strNull == null ? Integer.toString(1 << count) : strNull; if ((value & (1 << count)) == 0) { @@ -271,6 +272,7 @@ } else { result.add(str); } + count++; } if ((value & ~moveAll) != 0) { result.add(Integer.toString(value & ~moveAll)); @@ -281,7 +283,7 @@ * make sense to return 'all -walk -fly_low' - it is shorter to return * 'fly_high swim' */ - return allCount <= 1 ? negResult : result; + return count >= 4 && allCount <= 1 ? negResult : result; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-15 10:05:11
|
Revision: 7762 http://gridarta.svn.sourceforge.net/gridarta/?rev=7762&view=rev Author: akirschbaum Date: 2010-05-15 10:05:03 +0000 (Sat, 15 May 2010) Log Message: ----------- Rename variable names. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFloat.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInt.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribLong.java trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java trunk/src/app/net/sf/gridarta/model/archetypetype/CAttribBitmask.java trunk/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java trunk/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java trunk/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java trunk/src/app/net/sf/gridarta/model/spells/XMLSpellLoader.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java trunk/src/app/net/sf/gridarta/script/parameter/DoubleParameter.java trunk/src/app/net/sf/gridarta/script/parameter/IntegerParameter.java trunk/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -103,7 +103,7 @@ if (multiShapeID <= 0 || multiShapeID >= MultiPositionData.Y_DIM) { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Arch " + archetypeBuilder.getArchetypeName() + " mpart_id number is '" + line.substring(9) + '\''); } - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Arch " + archetypeBuilder.getArchetypeName() + " has a invalid mpart_id (" + line.substring(9) + ')'); archetypeBuilder.addObjectText(line); } @@ -115,7 +115,7 @@ try { final int i = Integer.parseInt(line.substring(9).trim()); archetypeBuilder.setMultiPartNr(i); - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Arch " + archetypeBuilder.getArchetypeName() + " has a invalid mpart_nr (" + line.substring(9) + ')'); archetypeBuilder.addObjectText(line); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -579,7 +579,7 @@ final int r; // return value try { r = Integer.parseInt(s); // trying to parse - } catch (final NumberFormatException illegalNumbers) { + } catch (final NumberFormatException ignored) { // 's' is not a number throw new IllegalArgumentException(label + ": '" + s + "' is not a numerical integer value."); } @@ -608,7 +608,7 @@ final double r; // return value try { r = Double.parseDouble(s); // trying to parse - } catch (final NumberFormatException illegalNumbers) { + } catch (final NumberFormatException ignored) { // 's' is not a number throw new IllegalArgumentException(label + ": '" + s + "' is not a numerical double value."); } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -103,7 +103,7 @@ if (multiShapeID <= 0 || multiShapeID >= MultiPositionData.Y_DIM) { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Arch " + archetypeBuilder.getArchetypeName() + " mpart_id number is '" + line.substring(9) + '\''); } - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Arch " + archetypeBuilder.getArchetypeName() + " has a invalid mpart_id (" + line.substring(9) + ')'); archetypeBuilder.addObjectText(line); } @@ -115,7 +115,7 @@ try { final int i = Integer.parseInt(line.substring(9).trim()); archetypeBuilder.setMultiPartNr(i); - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Arch " + archetypeBuilder.getArchetypeName() + " has a invalid mpart_nr (" + line.substring(9) + ')'); archetypeBuilder.addObjectText(line); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFloat.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFloat.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFloat.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -69,7 +69,7 @@ if (archetype.getAttributeDouble(archetypeAttributeName) != value) { return archetypeAttributeName + " " + value; } - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { // parsing failed: wrong entry!! JOptionPane.showMessageDialog(parent, "Attribute '" + getRef().getAttributeName() + "' must be a number!", "Input Error", JOptionPane.ERROR_MESSAGE); return null; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInt.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInt.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInt.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -71,7 +71,7 @@ } else { try { value = ((Number) input.getValue()).intValue(); - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { // parsing failed: wrong entry!! JOptionPane.showMessageDialog(parent, "Attribute '" + ref.getAttributeName() + "' must be a number!", "Input Error", JOptionPane.ERROR_MESSAGE); return null; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribLong.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribLong.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribLong.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -67,7 +67,7 @@ if (archetype.getAttributeLong(archetypeAttributeName) != value) { return archetypeAttributeName + " " + value; } - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { // parsing failed: wrong entry!! JOptionPane.showMessageDialog(parent, "Attribute '" + getRef().getAttributeName() + "' must be a number!", "Input Error", JOptionPane.ERROR_MESSAGE); return null; Modified: trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -238,7 +238,7 @@ final int width; try { width = Integer.parseInt(text); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { return -1; } if (width < 1) { @@ -257,7 +257,7 @@ final int height; try { height = Integer.parseInt(text); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { return -1; } if (height < 1) { Modified: trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -212,7 +212,7 @@ final int difficulty; try { difficulty = Integer.parseInt(text); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { return -1; } return difficulty >= 1 ? difficulty : -1; Modified: trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -597,7 +597,7 @@ final int replaceDensity; try { replaceDensity = Integer.parseInt(replaceDensityInput.getText()); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { ACTION_BUILDER.showMessageDialog(this, "replaceInvalidDensity"); return false; } Modified: trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -112,7 +112,7 @@ } else { try { setDividerLocation(Integer.parseInt(defaultDividerLocation)); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { // ignore } } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -814,7 +814,7 @@ int rand; try { rand = Integer.parseInt(input); - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { rand = -1; } if (rand < 1 || rand > 100) { Modified: trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -245,7 +245,7 @@ try { return Integer.parseInt(value); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has attribute '" + attributeKey + "' with invalid value '" + value + "' (must be a number)."); } Modified: trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -254,7 +254,7 @@ try { return Integer.parseInt(root.getAttribute("number").trim()); - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has invalid type number '" + root.getAttribute("number") + "'."); return -1; } Modified: trunk/src/app/net/sf/gridarta/model/archetypetype/CAttribBitmask.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetypetype/CAttribBitmask.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/model/archetypetype/CAttribBitmask.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -129,7 +129,7 @@ } try { value = Integer.parseInt(valueAttr); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmasksElement.getAttribute("name") + ": invalid 'value' value: " + valueAttr); continue; } @@ -137,7 +137,7 @@ final int bitValue; try { bitValue = Integer.parseInt(bitAttr); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmasksElement.getAttribute("name") + ": invalid 'bit' value: " + bitAttr); continue; } @@ -295,7 +295,7 @@ if (!isNamed) { try { return Integer.parseInt(encodedValue); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { return 0; } } @@ -322,7 +322,7 @@ } else { try { value = Integer.parseInt(name); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { log.warn("Ignoring unknown bitmask value: " + name); value = 0; } Modified: trunk/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -123,7 +123,7 @@ try { // parse and store it as integer d.width = Integer.parseInt(numbers[0]); - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { errorViewCollector.addError(ErrorViewCategory.ARCHDEF_ENTRY_INVALID, lnr.getLineNumber(), "invalid number: " + numbers[0]); hasErrors = true; continue; @@ -131,7 +131,7 @@ try { // parse and store it as integer d.height = Integer.parseInt(numbers[1]); - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { errorViewCollector.addError(ErrorViewCategory.ARCHDEF_ENTRY_INVALID, lnr.getLineNumber(), "invalid number: " + numbers[1]); hasErrors = true; continue; Modified: trunk/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -109,7 +109,7 @@ } else { throw new InvalidMapFormatException("unexpected map attribute: '" + line + "'"); } - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { throw new InvalidMapFormatException("unexpected map attribute: '" + line + "'"); } } else { @@ -137,7 +137,7 @@ protected static int parseInteger(@NotNull final String s) { try { return Integer.parseInt(s); - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { return 0; } } @@ -150,7 +150,7 @@ protected static double parseDouble(@NotNull final String s) { try { return Double.parseDouble(s); - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { return 0.0; } } Modified: trunk/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -197,7 +197,7 @@ for (int i = 0; i < types.length; i++) { try { types[i] = Integer.parseInt(typeNrs[i]); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { throw new ParsingException("invalid number: " + typeNrs[i]); } } Modified: trunk/src/app/net/sf/gridarta/model/spells/XMLSpellLoader.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/spells/XMLSpellLoader.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/model/spells/XMLSpellLoader.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -89,7 +89,7 @@ // parse spell number and -name spells.add(new NumberSpell(spellElem.getAttribute("name").trim(), Integer.parseInt(spellElem.getAttribute("id")))); numSpells++; - } catch (final NumberFormatException de) { + } catch (final NumberFormatException ignored) { errorViewCollector.addWarning(ErrorViewCategory.SPELLS_ENTRY_INVALID, "parsing error: spell id '" + spellElem.getAttribute("id") + "' is not an integer."); } } Modified: trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -308,19 +308,19 @@ } else if (line.startsWith("chance")) { try { node.getTreasureObj().setChance(Integer.parseInt(line.substring(line.indexOf(' ') + 1).trim())); - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { errorViewCollector.addWarning(ErrorViewCategory.TREASURES_ENTRY_INVALID, "list " + parentNode.getTreasureObj().getName() + ": arch " + node.getTreasureObj().getName() + " chance is not a number."); } } else if (line.startsWith("nrof")) { try { node.getTreasureObj().setNrof(Integer.parseInt(line.substring(line.indexOf(' ') + 1).trim())); - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { errorViewCollector.addWarning(ErrorViewCategory.TREASURES_ENTRY_INVALID, "list " + parentNode.getTreasureObj().getName() + ": arch " + node.getTreasureObj().getName() + " nrof value is not a number."); } } else if (line.startsWith("magic")) { try { node.getTreasureObj().setMagic(Integer.parseInt(line.substring(line.indexOf(' ') + 1).trim())); - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { errorViewCollector.addWarning(ErrorViewCategory.TREASURES_ENTRY_INVALID, "list " + parentNode.getTreasureObj().getName() + ": arch " + node.getTreasureObj().getName() + " magic value is not a number."); } } else if (line.startsWith("artifact_chance")) { Modified: trunk/src/app/net/sf/gridarta/script/parameter/DoubleParameter.java =================================================================== --- trunk/src/app/net/sf/gridarta/script/parameter/DoubleParameter.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/script/parameter/DoubleParameter.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -45,17 +45,17 @@ try { final Double iVal = Double.parseDouble(val); setValue(iVal); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { setValue(0.0); } final DoubleConfig o = new DoubleConfig(); try { o.setMin(Double.parseDouble(e.getChildTextTrim("minimum"))); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { } try { o.setMax(Double.parseDouble(e.getChildTextTrim("maximum"))); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { } setConfig(o); } @@ -68,7 +68,7 @@ final double doubleValue; try { doubleValue = Double.parseDouble(value); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { return false; } setValue(doubleValue); Modified: trunk/src/app/net/sf/gridarta/script/parameter/IntegerParameter.java =================================================================== --- trunk/src/app/net/sf/gridarta/script/parameter/IntegerParameter.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/script/parameter/IntegerParameter.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -68,7 +68,7 @@ final int intValue; try { intValue = Integer.parseInt(value); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { return false; } setValue(intValue); Modified: trunk/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java 2010-05-15 09:48:00 UTC (rev 7761) +++ trunk/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java 2010-05-15 10:05:03 UTC (rev 7762) @@ -60,7 +60,7 @@ try { return Integer.parseInt(value); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { return defaultValue; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-15 10:37:23
|
Revision: 7763 http://gridarta.svn.sourceforge.net/gridarta/?rev=7763&view=rev Author: akirschbaum Date: 2010-05-15 10:37:15 +0000 (Sat, 15 May 2010) Log Message: ----------- Add @NotNull/@Nullable annotations. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapFolderDialog.java trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java trunk/src/app/net/sf/gridarta/model/archetypetype/CAttribBitmask.java trunk/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java trunk/src/app/net/sf/gridarta/model/spells/XMLSpellLoader.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-15 10:05:03 UTC (rev 7762) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-15 10:37:15 UTC (rev 7763) @@ -63,6 +63,7 @@ import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * A dialog to change the properties of a map, like several flags and settings @@ -82,81 +83,113 @@ /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** * The parent frame for help windows. */ + @NotNull private final JFrame helpParent; + @NotNull private final MapModel<GameObject, MapArchObject, Archetype> mapModel; + @Nullable private Window dialog = null; // input components, see MapArchObject for expl. of purpose + @NotNull private final JTextArea mapDescription = new JTextArea(4, 4); // the msg text/arch text + @NotNull private final JTextField mapName = new JTextField(); // name of arch + @NotNull private final JTextField mapRegion = new JTextField(); // map's region + @NotNull private final JTextField mapBackgroundMusic = new JTextField(); // name of soundfile + @NotNull private final JFormattedTextField mapWidthField = new JFormattedTextField(); // len x + @NotNull private final JFormattedTextField mapHeightField = new JFormattedTextField(); // len y + @NotNull private final AbstractButton checkboxOutdoor = new JCheckBox(); // map outdoor + @NotNull private final JFormattedTextField fieldEnterX = new JFormattedTextField(); // enter x + @NotNull private final JFormattedTextField fieldEnterY = new JFormattedTextField(); // enter y + @NotNull private final JFormattedTextField fieldSwapTime = new JFormattedTextField(); // swap time + @NotNull private final JFormattedTextField fieldResetTimeout = new JFormattedTextField(); // reset timeout + @NotNull private final JFormattedTextField fieldDifficulty = new JFormattedTextField(); // map difficulty + @NotNull private final JFormattedTextField fieldDarkness = new JFormattedTextField(); // darkness + @NotNull private final AbstractButton checkboxFixedReset = new JCheckBox(); // fixed reset + @NotNull private final AbstractButton checkboxNoSave = new JCheckBox(); + @NotNull private final AbstractButton checkboxNoMagic = new JCheckBox(); + @NotNull private final AbstractButton checkboxNoPriest = new JCheckBox(); + @NotNull private final AbstractButton checkboxNoSummon = new JCheckBox(); + @NotNull private final AbstractButton checkboxNoHarm = new JCheckBox(); + @NotNull private final AbstractButton checkboxNoFixedLogin = new JCheckBox(); + @NotNull private final AbstractButton checkboxPermDeath = new JCheckBox(); + @NotNull private final AbstractButton checkboxUltraDeath = new JCheckBox(); + @NotNull private final AbstractButton checkboxUltimateDeath = new JCheckBox(); + @NotNull private final AbstractButton checkboxPvp = new JCheckBox(); + @NotNull private final AbstractButton checkboxPlugins = new JCheckBox(); /** * JButton for ok. */ + @NotNull private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this)); /** * JButton for cancel. */ + @NotNull private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "mapCancel", this)); /** * The MapTilePane. */ + @NotNull private final AbstractMapTilePane<GameObject, MapArchObject, Archetype> mapTilePane; /** @@ -174,7 +207,7 @@ * @param mapPathNormalizer the map path normalizer for converting map paths * to files */ - public MapPropertiesDialog(@NotNull final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { + public MapPropertiesDialog(@NotNull final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { okButton.setDefaultCapable(true); final JButton helpButton = new JButton(ACTION_BUILDER.createAction(false, "mapHelp", this)); final JButton restoreButton = new JButton(ACTION_BUILDER.createAction(false, "mapRestore", this)); @@ -208,7 +241,8 @@ * @param map MapArchObject to create main panel for. * @return Newly created main panel. */ - private Component createMainPanel(final MapArchObject map) { + @NotNull + private Component createMainPanel(@NotNull final MapArchObject map) { final GridBagConstraints gbc = new GridBagConstraints(); final JComponent mainPanel = new JPanel(new GridBagLayout()); mainPanel.setBorder(GUIConstants.DIALOG_BORDER); @@ -242,7 +276,8 @@ * @param map MapArchObject to create panel for. * @return Newly created mapDataPanel. */ - private Component createMapDataPanel(final net.sf.gridarta.model.map.maparchobject.MapArchObject<MapArchObject> map) { + @NotNull + private Component createMapDataPanel(@NotNull final net.sf.gridarta.model.map.maparchobject.MapArchObject<MapArchObject> map) { mapDescription.setText(map.getText()); mapDescription.setCaretPosition(0); final JScrollPane scrollPane = new JScrollPane(mapDescription); @@ -257,7 +292,8 @@ * @param map MapArchObject to create panel for. * @return Newly created optionsPanel. */ - private Component createOptionsPanel(final MapArchObject map) { + @NotNull + private Component createOptionsPanel(@NotNull final MapArchObject map) { final JPanel optionPanel = new JPanel(new GridLayout(0, 2)); optionPanel.add(createPanelLine(fieldEnterX, 10, map.getEnterX(), "mapEnterX")); @@ -289,7 +325,8 @@ * @param map MapArchObject to create panel for. * @return Newly created mapPanel. */ - private Component createMapPanel(final MapArchObject map) { + @NotNull + private Component createMapPanel(@NotNull final MapArchObject map) { final JPanel mapPanel = new JPanel(new GridBagLayout()); final GridBagConstraints labelGbc = new GridBagConstraints(); labelGbc.anchor = GridBagConstraints.EAST; @@ -352,7 +389,8 @@ * @param mapTilePane The <code>MapTilePane<code> contents. * @return Newly created tile path panel. */ - private static Component createTilePathPanel(final Component mapTilePane) { + @NotNull + private static Component createTilePathPanel(@NotNull final Component mapTilePane) { final Container panel = new JPanel(new BorderLayout()); panel.add(mapTilePane, BorderLayout.NORTH); return panel; @@ -392,7 +430,7 @@ * {@inheritDoc} */ @Override - public void setValue(final Object newValue) { + public void setValue(@NotNull final Object newValue) { super.setValue(newValue); if (dialog != null && newValue != UNINITIALIZED_VALUE) { dialog.dispose(); @@ -404,7 +442,8 @@ * @param key i18n Key to look up the l10n title using the ActionBuilder * @return Border */ - private static Border createTitledBorder(final String key) { + @NotNull + private static Border createTitledBorder(@NotNull final String key) { return BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(ACTION_BUILDER.getString(key)), GUIConstants.DIALOG_BORDER); } @@ -416,7 +455,8 @@ * @param labelKey (attribute-)label key * @return created panel */ - private static Component createPanelLine(final JFormattedTextField textField, final int n, final int defaultValue, final String labelKey) { + @NotNull + private static Component createPanelLine(@NotNull final JFormattedTextField textField, final int n, final int defaultValue, @NotNull final String labelKey) { final Container lineLayout = new JPanel(new FlowLayout(FlowLayout.RIGHT)); lineLayout.add(new JLabel(ACTION_BUILDER.getString(labelKey))); textField.setColumns(n); @@ -432,7 +472,8 @@ * @param labelKey (attribute-)label key * @return created Checkbox */ - private static Component createPanelCBox(final AbstractButton checkBox, final boolean state, final String labelKey) { + @NotNull + private static Component createPanelCBox(@NotNull final AbstractButton checkBox, final boolean state, @NotNull final String labelKey) { final JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.add(checkBox); @@ -542,7 +583,7 @@ * @return value of String 's', zero if 's' is empty * @throws IllegalArgumentException when parsing fails */ - private static int parseProperty(final String s, final String label) { + private static int parseProperty(@NotNull final String s, @NotNull final String label) { if (s.length() == 0) { return 0; // empty string is interpreted as zero } @@ -596,7 +637,7 @@ * Creates and displays the map properties dialog. * @param parentComponent the parent component of the dialog */ - public void showDialog(final Component parentComponent) { + public void showDialog(@NotNull final Component parentComponent) { final String title = ACTION_BUILDER.format("mapTitle", mapModel.getMapArchObject().getMapName(), mapModel.getMapArchObject().getMapName()); final JDialog window = createDialog(parentComponent, title); dialog = window; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2010-05-15 10:05:03 UTC (rev 7762) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2010-05-15 10:37:15 UTC (rev 7763) @@ -48,6 +48,7 @@ /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-15 10:05:03 UTC (rev 7762) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-15 10:37:15 UTC (rev 7763) @@ -55,6 +55,7 @@ import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * A dialog to change the properties of a map, like several flags and settings @@ -74,109 +75,148 @@ /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** * The parent frame for help windows. */ + @NotNull private final JFrame helpParent; + @NotNull private final MapModel<GameObject, MapArchObject, Archetype> mapModel; + @Nullable private Window dialog = null; /** * The {@link GridBagConstraints} for label fields before text input * fields. */ + @NotNull private final GridBagConstraints gbcLabel = new GridBagConstraints(); /** * The {@link GridBagConstraints} for text input fields. */ + @NotNull private final GridBagConstraints gbcTextField = new GridBagConstraints(); /** * The {@link GridBagConstraints} for check boxes. */ + @NotNull private final GridBagConstraints gbcCheckBox = new GridBagConstraints(); /** * The {@link GridBagConstraints} for filling the remaining space below all * input fields. */ + @NotNull private final GridBagConstraints gbcFiller = new GridBagConstraints(); // input components, see MapArchObject for expl. of purpose + @NotNull private final JTextComponent mapDescription = new JTextArea(4, 4); // the msg text/arch text + @NotNull private final JTextComponent mapLore = new JTextArea(); // the lore text + @NotNull private final JTextField mapName = new JTextField(); // name of arch + @NotNull private final JTextField mapRegion = new JTextField(); // map's region + @NotNull private final JTextField mapWidthField = new JFormattedTextField(); // len x + @NotNull private final JTextField mapHeightField = new JFormattedTextField(); // len y + @NotNull private final AbstractButton checkboxUnique = new JCheckBox(); // map unique + @NotNull private final AbstractButton checkboxOutdoor = new JCheckBox(); // map outdoor + @NotNull private final AbstractButton checkboxNosmooth = new JCheckBox(); // map nosmooth + @NotNull private final JTextField fieldEnterX = new JFormattedTextField(); // enter x + @NotNull private final JTextField fieldEnterY = new JFormattedTextField(); // enter y + @NotNull private final JTextField fieldSwapTime = new JFormattedTextField(); // swap time + @NotNull private final JTextField fieldResetTimeout = new JFormattedTextField(); // reset timeout + @NotNull private final JTextField fieldBackgroundMusic = new JFormattedTextField(); // background music + @NotNull private final JTextField fieldDifficulty = new JFormattedTextField(); // map difficulty + @NotNull private final JTextField fieldDarkness = new JFormattedTextField(); // darkness + @NotNull private final AbstractButton checkboxFixedReset = new JCheckBox(); // fixed reset + @NotNull private final JTextField fieldShopitems = new JTextField(); // shopitems + @NotNull private final JTextField fieldShopgreed = new JFormattedTextField(); // shopgreed + @NotNull private final JTextField fieldShopmax = new JFormattedTextField(); // shop maximum price + @NotNull private final JTextField fieldShopmin = new JFormattedTextField(); // shop minimum price + @NotNull private final JTextField fieldShoprace = new JTextField(); // shop's preferred race + @NotNull private final JTextField fieldTemperature = new JFormattedTextField(); // temperature + @NotNull private final JTextField fieldPressure = new JFormattedTextField(); // pressure + @NotNull private final JTextField fieldHumidity = new JFormattedTextField(); // humidity + @NotNull private final JTextField fieldWindspeed = new JFormattedTextField(); // wind speed + @NotNull private final JTextField fieldWindDirection = new JFormattedTextField(); // wind direction + @NotNull private final JTextField fieldSkySetting = new JFormattedTextField(); // sky setting /** * JButton for ok. */ + @NotNull private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this)); /** * JButton for cancel. */ + @NotNull private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "mapCancel", this)); /** * The MapTilePane. */ + @NotNull private final AbstractMapTilePane<GameObject, MapArchObject, Archetype> mapTilePane; /** @@ -194,7 +234,7 @@ * @param mapPathNormalizer the map path normalizer for converting map paths * to files */ - public MapPropertiesDialog(final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { + public MapPropertiesDialog(@NotNull final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { okButton.setDefaultCapable(true); final JButton helpButton = new JButton(ACTION_BUILDER.createAction(false, "mapHelp", this)); final JButton restoreButton = new JButton(ACTION_BUILDER.createAction(false, "mapRestore", this)); @@ -258,7 +298,8 @@ * @param map MapArchObject to create map panel for. * @return Newly created map panel. */ - private Component createMapPanel(final MapArchObject map) { + @NotNull + private Component createMapPanel(@NotNull final MapArchObject map) { final Container panel = new JPanel(new GridBagLayout()); final Size2D mapSize = mapModel.getMapSize(); addInputFieldLine(panel, mapName, 16, map.getMapName(), "mapName"); @@ -278,7 +319,8 @@ * @param map MapArchObject to create parameters panel for. * @return Newly created parameters panel. */ - private Component createParametersPanel(final MapArchObject map) { + @NotNull + private Component createParametersPanel(@NotNull final MapArchObject map) { final Container panel = new JPanel(new GridBagLayout()); addInputFieldLine(panel, fieldEnterX, 10, String.valueOf(map.getEnterX()), "mapEnterX"); addInputFieldLine(panel, fieldEnterY, 10, String.valueOf(map.getEnterY()), "mapEnterY"); @@ -296,7 +338,8 @@ * @param map MapArchObject to create shop panel for. * @return Newly created shop panel. */ - private Component createShopPanel(final MapArchObject map) { + @NotNull + private Component createShopPanel(@NotNull final MapArchObject map) { final Container panel = new JPanel(new GridBagLayout()); addInputFieldLine(panel, fieldShopitems, 10, map.getShopItems(), "mapShopType"); addInputFieldLine(panel, fieldShopgreed, 10, String.valueOf(map.getShopGreed()), "mapShopGreed"); @@ -312,7 +355,8 @@ * @param map MapArchObject to create weather panel for. * @return Newly created weather panel. */ - private Component createWeatherPanel(final MapArchObject map) { + @NotNull + private Component createWeatherPanel(@NotNull final MapArchObject map) { final Container panel = new JPanel(new GridBagLayout()); addInputFieldLine(panel, fieldTemperature, 10, String.valueOf(map.getTemp()), "mapTemperature"); addInputFieldLine(panel, fieldPressure, 10, String.valueOf(map.getPressure()), "mapPressure"); @@ -329,7 +373,8 @@ * @param map MapArchObject to create lore panel for. * @return Newly created lore panel. */ - private Component createMapLorePanel(final MapArchObject map) { + @NotNull + private Component createMapLorePanel(@NotNull final MapArchObject map) { final Container panel = new JPanel(new BorderLayout(1, 1)); mapLore.setText(map.getLore()); @@ -344,7 +389,8 @@ * @param map MapArchObject to create map text panel for. * @return Newly created map text panel. */ - private Component createMapTextPanel(final net.sf.gridarta.model.map.maparchobject.MapArchObject<MapArchObject> map) { + @NotNull + private Component createMapTextPanel(@NotNull final net.sf.gridarta.model.map.maparchobject.MapArchObject<MapArchObject> map) { final Container panel = new JPanel(new BorderLayout(1, 1)); mapDescription.setText(map.getText()); @@ -359,7 +405,8 @@ * @param mapTilePane The <code>MapTilePane<code> contents. * @return Newly created tile path panel. */ - private static Component createTilePathPanel(final Component mapTilePane) { + @NotNull + private static Component createTilePathPanel(@NotNull final Component mapTilePane) { final Container panel = new JPanel(new BorderLayout()); panel.add(mapTilePane, BorderLayout.NORTH); return panel; @@ -399,7 +446,7 @@ * {@inheritDoc} */ @Override - public void setValue(final Object newValue) { + public void setValue(@NotNull final Object newValue) { super.setValue(newValue); if (dialog != null && newValue != UNINITIALIZED_VALUE) { dialog.dispose(); @@ -414,7 +461,7 @@ * @param defaultText the default text of the text field * @param labelKey the key of the label */ - private void addInputFieldLine(final Container panel, final JTextField textField, final int n, final String defaultText, final String labelKey) { + private void addInputFieldLine(@NotNull final Container panel, @NotNull final JTextField textField, final int n, @NotNull final String defaultText, @NotNull final String labelKey) { textField.setColumns(n); textField.setText(defaultText); panel.add(new JLabel(ACTION_BUILDER.getString(labelKey)), gbcLabel); @@ -428,7 +475,7 @@ * @param state the default state of the check box * @param labelKey the key of the label */ - private void addCheckBoxLine(final Container panel, final AbstractButton checkBox, final boolean state, final String labelKey) { + private void addCheckBoxLine(@NotNull final Container panel, @NotNull final AbstractButton checkBox, final boolean state, @NotNull final String labelKey) { checkBox.setText(ACTION_BUILDER.getString(labelKey)); checkBox.setSelected(state); panel.add(checkBox, gbcCheckBox); @@ -438,7 +485,7 @@ * Fills the remaining space. * @param panel the panel to fill */ - private void addFiller(final Container panel) { + private void addFiller(@NotNull final Container panel) { panel.add(new JPanel(), gbcFiller); } @@ -571,7 +618,7 @@ * @return value of String 's', zero if 's' is empty * @throws IllegalArgumentException when parsing fails */ - private static int parseProperty(final String s, final String label) { + private static int parseProperty(@NotNull final String s, @NotNull final String label) { if (s.length() == 0) { return 0; // empty string is interpreted as zero } @@ -600,7 +647,7 @@ * @return value of String 's', zero if 's' is empty * @throws IllegalArgumentException when parsing fails */ - private static double parsePropertyToDouble(final String s, final String label) { + private static double parsePropertyToDouble(@NotNull final String s, @NotNull final String label) { if (s.length() == 0) { return 0; // empty string is interpreted as zero } @@ -666,7 +713,7 @@ * Creates and displays the map properties dialog. * @param parentComponent the parent component of the dialog */ - public void showDialog(final Component parentComponent) { + public void showDialog(@NotNull final Component parentComponent) { final String title = ACTION_BUILDER.format("mapTitle", mapModel.getMapArchObject().getMapName(), mapModel.getMapArchObject().getMapName()); final JDialog window = createDialog(parentComponent, title); dialog = window; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-15 10:05:03 UTC (rev 7762) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-15 10:37:15 UTC (rev 7763) @@ -65,6 +65,7 @@ import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.misc.JFileChooserButton; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * A dialog to change the properties of a map, like several flags and settings @@ -84,11 +85,13 @@ /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** * The parent frame for help windows. */ + @NotNull private final JFrame helpParent; /** @@ -97,70 +100,98 @@ @NotNull private final GlobalSettings globalSettings; + @NotNull private final MapModel<GameObject, MapArchObject, Archetype> mapModel; + @Nullable private Window dialog = null; // input components, see MapArchObject for expl. of purpose + @NotNull private final JTextArea mapDescription = new JTextArea(4, 4); // the msg text/arch text + @NotNull private final JTextField mapName = new JTextField(); // name of arch + @NotNull private final JTextField mapBackgroundMusic = new JTextField(); // name of soundfile + @NotNull private final JFormattedTextField mapWidthField = new JFormattedTextField(); // len x + @NotNull private final JFormattedTextField mapHeightField = new JFormattedTextField(); // len y + @NotNull private final AbstractButton checkboxOutdoor = new JCheckBox(); // map outdoor + @NotNull private final JFormattedTextField fieldEnterX = new JFormattedTextField(); // enter x + @NotNull private final JFormattedTextField fieldEnterY = new JFormattedTextField(); // enter y + @NotNull private final JFormattedTextField fieldSwapTime = new JFormattedTextField(); // swap time + @NotNull private final JFormattedTextField fieldResetTimeout = new JFormattedTextField(); // reset timeout + @NotNull private final JFormattedTextField fieldDifficulty = new JFormattedTextField(); // map difficulty + @NotNull private final JFormattedTextField fieldDarkness = new JFormattedTextField(); // darkness + @NotNull private final AbstractButton checkboxFixedReset = new JCheckBox(); // fixed reset + @NotNull private final AbstractButton checkboxNoSave = new JCheckBox(); + @NotNull private final AbstractButton checkboxNoMagic = new JCheckBox(); + @NotNull private final AbstractButton checkboxNoPriest = new JCheckBox(); + @NotNull private final AbstractButton checkboxNoSummon = new JCheckBox(); + @NotNull private final AbstractButton checkboxNoHarm = new JCheckBox(); + @NotNull private final AbstractButton checkboxNoFixedLogin = new JCheckBox(); + @NotNull private final AbstractButton checkboxPermDeath = new JCheckBox(); + @NotNull private final AbstractButton checkboxUltraDeath = new JCheckBox(); + @NotNull private final AbstractButton checkboxUltimateDeath = new JCheckBox(); + @NotNull private final AbstractButton checkboxPvp = new JCheckBox(); /** * JButton for ok. */ + @NotNull private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this)); /** * JButton for cancel. */ + @NotNull private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "mapCancel", this)); /** * The MapTilePane. */ + @NotNull private final AbstractMapTilePane<GameObject, MapArchObject, Archetype> mapTilePane; /** @@ -178,7 +209,7 @@ * @param mapPathNormalizer the map path normalizer for converting map paths * to files */ - public MapPropertiesDialog(@NotNull final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { + public MapPropertiesDialog(@NotNull final JFrame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { okButton.setDefaultCapable(true); final JButton helpButton = new JButton(ACTION_BUILDER.createAction(false, "mapHelp", this)); final JButton restoreButton = new JButton(ACTION_BUILDER.createAction(false, "mapRestore", this)); @@ -213,7 +244,8 @@ * @param map MapArchObject to create main panel for. * @return Newly created main panel. */ - private Component createMainPanel(final MapArchObject map) { + @NotNull + private Component createMainPanel(@NotNull final MapArchObject map) { final GridBagConstraints gbc = new GridBagConstraints(); final JComponent mainPanel = new JPanel(new GridBagLayout()); mainPanel.setBorder(GUIConstants.DIALOG_BORDER); @@ -247,7 +279,8 @@ * @param map MapArchObject to create panel for. * @return Newly created mapDataPanel. */ - private Component createMapDataPanel(final net.sf.gridarta.model.map.maparchobject.MapArchObject<MapArchObject> map) { + @NotNull + private Component createMapDataPanel(@NotNull final net.sf.gridarta.model.map.maparchobject.MapArchObject<MapArchObject> map) { mapDescription.setText(map.getText()); mapDescription.setCaretPosition(0); final JScrollPane scrollPane = new JScrollPane(mapDescription); @@ -262,7 +295,8 @@ * @param map MapArchObject to create panel for. * @return Newly created optionsPanel. */ - private Component createOptionsPanel(final MapArchObject map) { + @NotNull + private Component createOptionsPanel(@NotNull final MapArchObject map) { final JPanel optionPanel = new JPanel(new GridLayout(0, 2)); optionPanel.add(createPanelLine(fieldEnterX, 10, map.getEnterX(), "mapEnterX")); @@ -293,7 +327,8 @@ * @param map MapArchObject to create panel for. * @return Newly created mapPanel. */ - private Component createMapPanel(final MapArchObject map) { + @NotNull + private Component createMapPanel(@NotNull final MapArchObject map) { final JPanel mapPanel = new JPanel(new GridBagLayout()); final GridBagConstraints labelGbc = new GridBagConstraints(); labelGbc.anchor = GridBagConstraints.EAST; @@ -354,7 +389,8 @@ * @param mapTilePane The <code>MapTilePane<code> contents. * @return Newly created tile path panel. */ - private static Component createTilePathPanel(final Component mapTilePane) { + @NotNull + private static Component createTilePathPanel(@NotNull final Component mapTilePane) { final Container panel = new JPanel(new BorderLayout()); panel.add(mapTilePane, BorderLayout.NORTH); return panel; @@ -394,7 +430,7 @@ * {@inheritDoc} */ @Override - public void setValue(final Object newValue) { + public void setValue(@NotNull final Object newValue) { super.setValue(newValue); if (dialog != null && newValue != UNINITIALIZED_VALUE) { dialog.dispose(); @@ -406,7 +442,8 @@ * @param key i18n Key to look up the l10n title using the ActionBuilder * @return Border */ - private static Border createTitledBorder(final String key) { + @NotNull + private static Border createTitledBorder(@NotNull final String key) { return BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(ACTION_BUILDER.getString(key)), GUIConstants.DIALOG_BORDER); } @@ -418,7 +455,8 @@ * @param labelKey (attribute-)label key * @return created panel */ - private static Component createPanelLine(final JFormattedTextField textField, final int n, final int defaultValue, final String labelKey) { + @NotNull + private static Component createPanelLine(@NotNull final JFormattedTextField textField, final int n, final int defaultValue, @NotNull final String labelKey) { final Container lineLayout = new JPanel(new FlowLayout(FlowLayout.RIGHT)); lineLayout.add(new JLabel(ACTION_BUILDER.getString(labelKey))); textField.setColumns(n); @@ -434,7 +472,8 @@ * @param labelKey (attribute-)label key * @return created Checkbox */ - private static Component createPanelCBox(final AbstractButton checkBox, final boolean state, final String labelKey) { + @NotNull + private static Component createPanelCBox(@NotNull final AbstractButton checkBox, final boolean state, @NotNull final String labelKey) { final JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.add(checkBox); @@ -542,7 +581,7 @@ * @return value of String 's', zero if 's' is empty * @throws IllegalArgumentException when parsing fails */ - private static int parseProperty(final String s, final String label) { + private static int parseProperty(@NotNull final String s, @NotNull final String label) { if (s.length() == 0) { return 0; // empty string is interpreted as zero } @@ -594,7 +633,7 @@ * Creates and displays the map properties dialog. * @param parentComponent the parent component of the dialog */ - public void showDialog(final Component parentComponent) { + public void showDialog(@NotNull final Component parentComponent) { final String title = ACTION_BUILDER.format("mapTitle", mapModel.getMapArchObject().getMapName(), mapModel.getMapArchObject().getMapName()); final JDialog window = createDialog(parentComponent, title); dialog = window; Modified: trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java 2010-05-15 10:05:03 UTC (rev 7762) +++ trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java 2010-05-15 10:37:15 UTC (rev 7763) @@ -45,6 +45,8 @@ import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Dialog used to ask the user for coordinates to move the cursor to. @@ -60,43 +62,52 @@ /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** * The manager for this dialog. */ + @NotNull private final AbstractPerMapDialogManager<G, A, R, GoLocationDialog<G, A, R>> goLocationDialogManager; /** * The affected map view of this go location dialog. */ + @NotNull private final MapView<G, A, R> mapView; /** * Textfield for the x coordinate. */ + @NotNull private final JFormattedTextField xCoordinateField = new JFormattedTextField(); /** * Textfield for the y coordinate. */ + @NotNull private final JFormattedTextField yCoordinateField = new JFormattedTextField(); /** * JButton for ok. */ + @NotNull private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "goLocationOkay", this)); /** * JButton for apply. */ + @NotNull private final JButton applyButton = new JButton(ACTION_BUILDER.createAction(false, "goLocationApply", this)); /** * JButton for cancel. */ + @NotNull private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "goLocationCancel", this)); + @Nullable private JDialog dialog = null; /** @@ -104,7 +115,7 @@ * @param goLocationDialogManager The manager for this dialog. * @param mapView the map view to change the cursor */ - public GoLocationDialog(final AbstractPerMapDialogManager<G, A, R, GoLocationDialog<G, A, R>> goLocationDialogManager, final MapView<G, A, R> mapView) { + public GoLocationDialog(@NotNull final AbstractPerMapDialogManager<G, A, R, GoLocationDialog<G, A, R>> goLocationDialogManager, @NotNull final MapView<G, A, R> mapView) { this.goLocationDialogManager = goLocationDialogManager; okButton.setDefaultCapable(true); @@ -126,6 +137,7 @@ * Create the GUI. * @return the panel containing the GUI */ + @NotNull private JPanel createPanel() { final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); @@ -211,7 +223,7 @@ * @return the coordinate value * @throws IllegalArgumentException if the coordinate value is invalid */ - private int parseCoordinate(final JFormattedTextField textField, final int range) { + private int parseCoordinate(@NotNull final JFormattedTextField textField, final int range) { final int result; try { result = (Integer) textField.getValue(); @@ -248,6 +260,7 @@ * Return the {@link Window} for this instance. * @return The <code>Widnow</code>. */ + @Nullable public Window getDialog() { return dialog; } Modified: trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java 2010-05-15 10:05:03 UTC (rev 7762) +++ trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java 2010-05-15 10:37:15 UTC (rev 7763) @@ -31,6 +31,7 @@ import net.sf.gridarta.utils.Size2D; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** @@ -48,6 +49,7 @@ /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** @@ -88,16 +90,19 @@ /** * Checkbox to set whether the default width / height should be overridden. */ + @NotNull private final AbstractButton mapSizeDefaultCheckbox = new JCheckBox(ACTION_BUILDER.createToggle(false, "mapSizeDefault", this)); /** * Textfield for the width of the new map. */ + @NotNull private final JTextField mapWidthField = new JTextField(); /** * Textfield for the height of the new map. */ + @NotNull private final JTextField mapHeightField = new JTextField(); /** @@ -133,7 +138,7 @@ * {@inheritDoc} */ @Override - protected void addMapSizeDefaultCheckbox(final JPanel panel, final GridBagConstraints gbcLabel) { + protected void addMapSizeDefaultCheckbox(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel) { if (!showMapSizeDefault) { return; } @@ -145,7 +150,7 @@ * {@inheritDoc} */ @Override - protected void addMapWidthField(final JPanel panel, final GridBagConstraints gbcLabel, final GridBagConstraints gbcField) { + protected void addMapWidthField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField) { mapWidthField.setText(Integer.toString(widthKey == null ? defaultWidth : prefs.getInt(widthKey, defaultWidth))); mapWidthField.setColumns(3); panel.add(new JLabel(ACTION_BUILDER.getString("mapWidth")), gbcLabel); @@ -157,7 +162,7 @@ * {@inheritDoc} */ @Override - protected void addMapHeightField(final JPanel panel, final GridBagConstraints gbcLabel, final GridBagConstraints gbcField) { + protected void addMapHeightField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField) { mapHeightField.setText(Integer.toString(heightKey == null ? defaultHeight : prefs.getInt(heightKey, defaultHeight))); mapHeightField.setColumns(3); panel.add(new JLabel(ACTION_BUILDER.getString("mapHeight")), gbcLabel); Modified: trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java 2010-05-15 10:05:03 UTC (rev 7762) +++ trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java 2010-05-15 10:37:15 UTC (rev 7763) @@ -47,6 +47,7 @@ import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Dialog used to ask the user the properties for the new level. Contains a @@ -66,23 +67,28 @@ /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** * Preferences. */ + @NotNull protected static final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); /** * JButton for ok. */ + @NotNull private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this)); /** * JButton for cancel. */ + @NotNull private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "mapCancel", this)); + @Nullable private JDialog dialog = null; /** @@ -123,7 +129,7 @@ * @param parentComponent the parent component of this dialog * @param dialogTitle the dialog's title */ - protected void init1(final Component parentComponent, @NotNull final String dialogTitle) { + protected void init1(@NotNull final Component parentComponent, @NotNull final String dialogTitle) { okButton.setDefaultCapable(true); setOptions(new Object[] { okButton, cancelButton }); setMessage(createPanel()); @@ -141,6 +147,7 @@ dialog.setVisible(true); } + @NotNull private JPanel createPanel() { final JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); @@ -156,8 +163,10 @@ return panel; } + @NotNull protected abstract JPanel createMapNamePanel(); + @Nullable protected JPanel createMapParametersPanel() { final JPanel panel = new JPanel(new GridBagLayout()); @@ -177,13 +186,13 @@ return panel; } - protected abstract void addMapSizeDefaultCheckbox(final JPanel panel, final GridBagConstraints gbcLabel); + protected abstract void addMapSizeDefaultCheckbox(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel); - protected abstract void addMapWidthField(final JPanel panel, final GridBagConstraints gbcLabel, final GridBagConstraints gbcField); + protected abstract void addMapWidthField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField); - protected abstract void addMapHeightField(final JPanel panel, final GridBagConstraints gbcLabel, final GridBagConstraints gbcField); + protected abstract void addMapHeightField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField); - protected abstract void addDifficultyField(final JPanel panel, final GridBagConstraints gbcLabel, final GridBagConstraints gbcField); + protected abstract void addDifficultyField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField); /** * Action method for okay. @@ -205,7 +214,7 @@ * {@inheritDoc} */ @Override - public void setValue(final Object newValue) { + public void setValue(@NotNull final Object newValue) { super.setValue(newValue); if (newValue != UNINITIALIZED_VALUE) { dialog.dispose(); Modified: trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java 2010-05-15 10:05:03 UTC (rev 7762) +++ trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java 2010-05-15 10:37:15 UTC (rev 7763) @@ -46,16 +46,19 @@ /** * The key used to store the last used map width in preferences. */ + @NotNull private static final String DEFAULT_LEVEL_WIDTH_KEY = "NewMapDialog.mapWidth"; /** * The key used to store the last used map height in preferences. */ + @NotNull private static final String DEFAULT_LEVEL_HEIGHT_KEY = "NewMapDialog.mapHeight"; /** * The key used to store the last used difficulty in preferences. */ + @NotNull private static final String DEFAULT_DIFFICULTY_KEY = "NewMapDialog.difficulty"; /** @@ -66,11 +69,13 @@ /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** * The {@link MapViewsManager} to use. */ + @NotNull private final MapViewsManager<G, A, R> mapViewsManager; /** @@ -93,11 +98,13 @@ * Textfield for the name of the map. The filename of the new map is unset * and will be specified when the user saves the map for the first time. */ + @NotNull private final JTextComponent mapNameField = new JTextField(16); /** * Textfield for the difficulty of the new map. */ + @NotNull private final JTextField mapDifficultyField = new JTextField(); /** @@ -111,7 +118,7 @@ * @param defaultHeight The default height for new maps. * @param defaultDifficulty The default difficulty for new maps. */ - public NewMapDialog(@NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, final Component parentComponent, final boolean showMapSizeDefault, final boolean showMapDifficulty, final int defaultWidth, final int defaultHeight, final int defaultDifficulty) { + public NewMapDialog(@NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final Component parentComponent, final boolean showMapSizeDefault, final boolean showMapDifficulty, final int defaultWidth, final int defaultHeight, final int defaultDifficulty) { super(showMapSizeDefault, DEFAULT_LEVEL_WIDTH_KEY, DEFAULT_LEVEL_HEIGHT_KEY, defaultWidth, defaultHeight); this.mapViewsManager = mapViewsManager; this.mapArchObjectFactory = mapArchObjectFactory; @@ -130,6 +137,7 @@ /** * {@inheritDoc} */ + @NotNull @Override protected JPanel createMapNamePanel() { final JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -142,7 +150,7 @@ * {@inheritDoc} */ @Override - protected void addDifficultyField(final JPanel panel, final GridBagConstraints gbcLabel, final GridBagConstraints gbcField) { + protected void addDifficultyField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField) { if (!showMapDifficulty) { return; } Modified: trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java 2010-05-15 10:05:03 UTC (rev 7762) +++ trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java 2010-05-15 10:37:15 UTC (rev 7763) @@ -36,6 +36,7 @@ import net.sf.gridarta.utils.Size2D; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** @@ -52,22 +53,26 @@ /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** * The object chooser instance to use. */ + @NotNull private final ObjectChooser<G, A, R> objectChooser; /** * The pickmap chooser control. */ + @NotNull private final PickmapChooserControl<G, A, R> pickmapChooserControl; /** * Textfield for the name of the map. The filename of the new map is unset * and will be specified when the user saves the map for the first time. */ + @NotNull private final JTextComponent pickmapNameField = new JTextField(16); /** @@ -78,7 +83,7 @@ * @param defaultHeight The default height for new maps. * @param pickmapChooserControl the pickmap chooser control */ - public NewPickmapDialog(final ObjectChooser<G, A, R> objectChooser, final Component parentComponent, final int defaultWidth, final int defaultHeight, final PickmapChooserControl<G, A, R> pickmapChooserControl) { + public NewPickmapDialog(@NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final Component parentComponent, final int defaultWidth, final int defaultHeight, @NotNull final PickmapChooserControl<G, A, R> pickmapChooserControl) { super(false, null, null, defaultWidth, defaultHeight); this.objectChooser = objectChooser; this.pickmapChooserControl = pickmapChooserControl; @@ -91,6 +96,7 @@ /** * {@inheritDoc} */ + @NotNull @Override protected JPanel createMapNamePanel() { final JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -103,14 +109,14 @@ * {@inheritDoc} */ @Override - protected void addMapSizeDefaultCheckbox(final JPanel panel, final GridBagConstraints gbcLabel) { + protected void addMapSizeDefaultCheckbox(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel) { } /** * {@inheritDoc} */ @Override - protected void addDifficultyField(final JPanel panel, final GridBagConstraints gbcLabel, final GridBagConstraints gbcField) { + protected void addDifficultyField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField) { } /** Modified: trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapFolderDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapFolderDialog.java 2010-05-15 10:05:03 UTC (rev 7762) +++ trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapFolderDialog.java 2010-05-15 10:37:15 UTC (rev 7763) @@ -54,6 +54,7 @@ /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** @@ -78,6 +79,7 @@ * Textfield for the name of the map. The filename of the new map is unset * and will be specified when the user saves the map for the first time. */ + @NotNull private final JTextComponent folderNameField = new JTextField(16); /** @@ -87,7 +89,7 @@ * @param parent the parent folder to add the pickmap folder to * @param mapViewsManager the map views */ - public NewPickmapFolderDialog(final Component parentComponent, @NotNull final MapFolderTree<G, A, R> mapFolderTree, @Nullable final MapFolder<G, A, R> parent, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { + public NewPickmapFolderDialog(@NotNull final Component parentComponent, @NotNull final MapFolderTree<G, A, R> mapFolderTree, @Nullable final MapFolder<G, A, R> parent, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { this.mapFolderTree = mapFolderTree; this.parent = parent; this.mapViewsManager = mapViewsManager; @@ -100,6 +102,7 @@ /** * {@inheritDoc} */ + @NotNull @Override protected JPanel createMapNamePanel() { final JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -118,7 +121,7 @@ * {@inheritDoc} */ @Override - protected void addMapSizeDefaultCheckbox(final JPanel panel, final GridBagConstraints gbcLabel) { + protected void addMapSizeDefaultCheckbox(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel) { throw new AssertionError(); } @@ -126,7 +129,7 @@ * {@inheritDoc} */ @Override - protected void addMapWidthField(final JPanel panel, final GridBagConstraints gbcLabel, final GridBagConstraints gbcField) { + protected void addMapWidthField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField) { throw new AssertionError(); } @@ -134,7 +137,7 @@ * {@inheritDoc} */ @Override - protected void addMapHeightField(final JPanel panel, final GridBagConstraints gbcLabel, final GridBagConstraints gbcField) { + protected void addMapHeightField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField) { throw new AssertionError(); } @@ -142,7 +145,7 @@ * {@inheritDoc} */ @Override - protected void addDifficultyField(final JPanel panel, final GridBagConstraints gbcLabel, final GridBagConstraints gbcField) { + protected void addDifficultyField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField) { throw new AssertionError(); } Modified: trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java 2010-05-15 10:05:03 UTC (rev 7762) +++ trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java 2010-05-15 10:37:15 UTC (rev 7763) @@ -76,6 +76,7 @@ /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** @@ -118,6 +119,7 @@ /** * The dialog instance. */ + @NotNull private final JDialog dialog; /** @@ -152,36 +154,49 @@ /** * The {@link MapView} to operate on. */ + @NotNull private MapView<G, A, R> mapView; /** * Objects will be replaced with this game object. */ + @Nullable private BaseObject<G, A, R, ?> replaceArch = null; + @NotNull private List<G> replaceCopyBuffer; // objects in CopyBuffer + @NotNull private List<? extends BaseObject<G, A, R, ?>> replacePickmap; // selected objects in pickmap or all if none is selected + @NotNull private JLabel rfHeading; + @Nullable private JLabel rfArchName = null; + @NotNull private JLabel iconLabel; + @NotNull private JLabel colonLabel; + @NotNull private JComboBox replaceCriteria; + @NotNull private JComboBox replaceWithBox; + @NotNull private JComboBox replaceEntireBox; + @NotNull private JTextComponent replaceInput1; /** * Input field for replace density value. */ + @NotNull private JTextComponent replaceDensityInput; private int lastSelectedIndex; @@ -231,7 +246,7 @@ * Replace objects on the map. * @param mapView map view of the active map where the action was invoked */ - public void display(final MapView<G, A, R> mapView) { + public void display(@NotNull final MapView<G, A, R> mapView) { replaceArch = objectChooser.getCursorSelection(); // highlighted arch replacePickmap = objectChooser.getSelections(); // selected arches replaceCopyBuffer = copyBufferMapModel.getAllGameObjects(); @@ -373,7 +388,7 @@ * changed if true, the frame is always packed (packing resizes but also * causes flicker) */ - private void updateArchSelection(final BaseObject<G, A, R, ?> newArch, final boolean alwaysPack) { + private void updateArchSelection(@Nullable final BaseObject<G, A, R, ?> newArch, final boolean alwaysPack) { if (isShowing() && replaceWithBox.getSelectedIndex() == REPLACE_WITH_OBJECT_CHOOSER) { replaceArch = newArch; if (newArch != null) { @@ -514,7 +529,7 @@ * {@inheritDoc} */ @Override - public void itemStateChanged(final ItemEvent e) { + public void itemStateChanged(@NotNull final ItemEvent e) { final int selectedIndex = replaceWithBox.getSelectedIndex(); if (e.getStateChange() == ItemEvent.SELECTED && lastSelectedIndex != selectedIndex) { final int size; @@ -640,7 +655,7 @@ * Dispose the replace dialog. * @param mapView the map view to dispose the dialog of; do nothing if no */ - public void dispose(final MapView<G, A, R> mapView) { + public void dispose(@NotNull final MapView<G, A, R> mapView) { if (mapView == this.mapView) { dialog.setVisible(false); } Modified: trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java =================================================================== --- trunk/src/app/ne... [truncated message content] |
From: <aki...@us...> - 2010-05-15 19:15:07
|
Revision: 7768 http://gridarta.svn.sourceforge.net/gridarta/?rev=7768&view=rev Author: akirschbaum Date: 2010-05-15 19:14:59 +0000 (Sat, 15 May 2010) Log Message: ----------- Add type parameters to Filter and FilterConfig to avoid type casts. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java trunk/src/app/net/sf/gridarta/gui/filter/FilterComponent.java trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java trunk/src/app/net/sf/gridarta/gui/filter/FilterMenuEntry.java trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/script/ScriptController.java trunk/src/app/net/sf/gridarta/gui/script/parameter/FilterParameterView.java trunk/src/app/net/sf/gridarta/gui/script/parameter/PluginParameterViewFactory.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java trunk/src/app/net/sf/gridarta/model/filter/ConfigEvent.java trunk/src/app/net/sf/gridarta/model/filter/ConfigListener.java trunk/src/app/net/sf/gridarta/model/filter/Filter.java trunk/src/app/net/sf/gridarta/model/filter/FilterConfig.java trunk/src/app/net/sf/gridarta/model/filter/FilterParser.java trunk/src/app/net/sf/gridarta/model/filter/FilterVisitor.java trunk/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java trunk/src/app/net/sf/gridarta/model/filter/NamedFilterEvent.java trunk/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilter.java trunk/src/app/net/sf/gridarta/script/parameter/FilterParameter.java trunk/src/app/net/sf/gridarta/script/parameter/PluginParameterFactory.java trunk/src/test/net/sf/gridarta/gui/filter/TestFilterControl.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java trunk/src/app/net/sf/gridarta/model/filter/FilterConfigVisitor.java trunk/src/app/net/sf/gridarta/model/filter/NamedFilter.java trunk/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilterConfig.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/model/filter/BasicFilterConfig.java trunk/src/app/net/sf/gridarta/model/filter/NamedFilterList.java trunk/src/app/net/sf/gridarta/model/filter/SimpleFilterConfig.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -67,7 +67,7 @@ import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.model.filter.NamedFilterList; +import net.sf.gridarta.model.filter.NamedFilter; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; import net.sf.gridarta.model.gameobject.MultiPositionData; @@ -538,7 +538,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilter defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, CommonConstants.EAST, CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -136,7 +136,7 @@ * {@inheritDoc} */ @Override - public void configChanged(final ConfigEvent event) { + public void configChanged(final ConfigEvent<?, ?> event) { forceRepaint(); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -61,7 +61,7 @@ import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.model.filter.NamedFilterList; +import net.sf.gridarta.model.filter.NamedFilter; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.DefaultMapReaderFactory; import net.sf.gridarta.model.io.DirectoryCacheFiles; @@ -400,7 +400,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilter defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", false, mapManager, pickmapManager, archetypeSet, mapControlFactory, null, "CrossfireEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, null, this, errorView, new DirectoryCacheFiles(ConfigFileUtils.getHomeFile("thumbnails"), ".png"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, 0, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, true, scriptedEventEditor, new int[] { CommonConstants.NORTH, CommonConstants.EAST, CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH_EAST, CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -67,7 +67,7 @@ import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.model.filter.NamedFilterList; +import net.sf.gridarta.model.filter.NamedFilter; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; import net.sf.gridarta.model.gameobject.MultiPositionData; @@ -539,7 +539,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilter defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(FileFilters.luaFileFilter, ".lua", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, CommonConstants.EAST, CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } Modified: trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -25,9 +25,8 @@ import net.sf.gridarta.model.filter.ConfigEvent; import net.sf.gridarta.model.filter.ConfigListener; import net.sf.gridarta.model.filter.Filter; -import net.sf.gridarta.model.filter.FilterConfig; +import net.sf.gridarta.model.filter.NamedFilter; import net.sf.gridarta.model.filter.NamedFilterConfig; -import net.sf.gridarta.model.filter.NamedFilterList; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.utils.EventListenerList2; @@ -50,9 +49,9 @@ //TODO allow implementation of own filter public class DefaultFilterControl<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements FilterControl<G, A, R> { - private final NamedFilterList filterList; + private final NamedFilter filterList; - private final FilterConfig filterOutConfig; + private final NamedFilterConfig filterOutConfig; private final NamedFilterConfig[] highlightConfig; @@ -65,7 +64,7 @@ /** {@inheritDoc} */ @Override - public void configChanged(final ConfigEvent event) { + public void configChanged(final ConfigEvent<?, ?> event) { for (final ConfigListener listener : configListeners.getListeners()) { listener.configChanged(event); } @@ -78,12 +77,12 @@ * filterOut anything * @param filterList the filter list instance to use */ - public DefaultFilterControl(final NamedFilterList filterList) { + public DefaultFilterControl(final NamedFilter filterList) { this.filterList = filterList; filterOutConfig = filterList.createConfig(); highlightConfig = new NamedFilterConfig[MAX_HIGHLIGHT]; for (int i = 0; i < MAX_HIGHLIGHT; i++) { - highlightConfig[i] = (NamedFilterConfig) filterList.createConfig(); + highlightConfig[i] = filterList.createConfig(); } filterOutConfig.addConfigChangeListener(configListener); for (int i = 0; i < MAX_HIGHLIGHT; i++) { @@ -112,12 +111,12 @@ */ @Override public void createMenuEntries(final JMenu menu) { - final JMenuItem menuItem = new MenuItemCreator(filterList, filterOutConfig).getMenuItem(); + final JMenuItem menuItem = new MenuItemCreator(filterOutConfig).getMenuItem(); menuItem.setText("Filter view"); menu.add(menuItem); menu.addSeparator(); for (int i = 0; i < MAX_HIGHLIGHT; i++) { - final JMenuItem menuItem2 = new MenuItemCreator(filterList, highlightConfig[i]).getMenuItem(); + final JMenuItem menuItem2 = new MenuItemCreator(highlightConfig[i]).getMenuItem(); menuItem2.setText("Highlight " + i); menu.add(menuItem2); } @@ -170,7 +169,7 @@ * {@inheritDoc} */ @Override - public void addFilter(final String name, final Filter filter) { + public void addFilter(final String name, final Filter<?, ?> filter) { filterList.addFilter(name, filter); } Modified: trunk/src/app/net/sf/gridarta/gui/filter/FilterComponent.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/FilterComponent.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/src/app/net/sf/gridarta/gui/filter/FilterComponent.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -29,7 +29,6 @@ import javax.swing.JSeparator; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import net.sf.gridarta.model.filter.Filter; import net.sf.gridarta.model.filter.FilterConfig; import net.sf.gridarta.model.filter.NamedFilterConfig; @@ -69,12 +68,12 @@ component.add(new JSeparator()); } - public void addFilter(final String name, final Filter filter, final FilterConfig config) { + public void addFilter(final String name, final FilterConfig<?, ?> config) { if (content.containsKey(name)) { return; } - final AbstractButton entry = new MenuItemCreator(filter, config).getMenuItem(); + final AbstractButton entry = new MenuItemCreator(config).getMenuItem(); entry.setVisible(true); entry.setText(name); content.put(name, entry); Modified: trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -56,7 +56,7 @@ boolean canShow(G gameObject); - void addFilter(String name, Filter filter); + void addFilter(String name, Filter<?, ?> filter); void removeFilter(String name); Modified: trunk/src/app/net/sf/gridarta/gui/filter/FilterMenuEntry.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/FilterMenuEntry.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/src/app/net/sf/gridarta/gui/filter/FilterMenuEntry.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -21,14 +21,12 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Map; import javax.swing.JComponent; import javax.swing.JMenu; -import net.sf.gridarta.model.filter.Filter; +import net.sf.gridarta.model.filter.NamedFilter; import net.sf.gridarta.model.filter.NamedFilterConfig; import net.sf.gridarta.model.filter.NamedFilterEvent; import net.sf.gridarta.model.filter.NamedFilterEventType; -import net.sf.gridarta.model.filter.NamedFilterList; import net.sf.gridarta.model.filter.NamedFilterListener; import org.apache.log4j.Category; import org.apache.log4j.Logger; @@ -40,7 +38,7 @@ * The Logger for printing log messages. */ @NotNull - private static final Category log = Logger.getLogger(NamedFilterList.class); + private static final Category log = Logger.getLogger(NamedFilter.class); /** * The serial version UID. @@ -51,25 +49,19 @@ private final NamedFilterConfig config; @NotNull - private final NamedFilterList namedFilterList; - - @NotNull private final Collection<FilterComponent> components = new ArrayList<FilterComponent>(); - public FilterMenuEntry(@NotNull final NamedFilterConfig config, @NotNull final NamedFilterList namedFilterList) { + public FilterMenuEntry(@NotNull final NamedFilterConfig config) { super(""); this.config = config; - this.namedFilterList = namedFilterList; - namedFilterList.addFilterListener(this); + config.getFilter().addFilterListener(this); populateComponent(this); } private void populateComponent(@NotNull final JComponent component) { final FilterComponent filterComponent = new FilterComponent(component, config); - for (final Map.Entry<String, Filter> entry : namedFilterList.getSubFilters().entrySet()) { - final String name = entry.getKey(); - final Filter filter = entry.getValue(); - filterComponent.addFilter(name, filter, config.getConfig(name)); + for (final String name : config.getFilter().getSubFilters().keySet()) { + filterComponent.addFilter(name, config.getConfig(name)); } components.add(filterComponent); } @@ -98,17 +90,18 @@ */ @Override public void nameFilterChanged(@NotNull final NamedFilterEvent event) { + final String name = event.getFilterName(); if (event.getType() == NamedFilterEventType.ADD) { for (final FilterComponent filterComponent : components) { if (log.isDebugEnabled()) { - log.debug("set sub filter enabled(), calling on " + event.getFilterName()); + log.debug("set sub filter enabled(), calling on " + name); } - config.setSubFilterEnabled(event.getFilterName(), event.getFilter(), false); - filterComponent.addFilter(event.getFilterName(), event.getFilter(), config.getConfig(event.getFilterName())); + config.setSubFilterEnabled(name, event.getFilter(), false); + filterComponent.addFilter(name, config.getConfig(name)); } } else if (event.getType() == NamedFilterEventType.REMOVE) { for (final FilterComponent filterComponent : components) { - filterComponent.removeFilter(event.getFilterName()); + filterComponent.removeFilter(name); } } } Modified: trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -23,10 +23,10 @@ import javax.swing.JMenuItem; import net.sf.gridarta.model.filter.Filter; import net.sf.gridarta.model.filter.FilterConfig; +import net.sf.gridarta.model.filter.FilterConfigVisitor; import net.sf.gridarta.model.filter.FilterVisitor; import net.sf.gridarta.model.filter.NamedFilterConfig; -import net.sf.gridarta.model.filter.NamedFilterList; -import net.sf.gridarta.model.filter.NamedGameObjectMatcherFilter; +import net.sf.gridarta.model.filter.NamedGameObjectMatcherFilterConfig; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -46,12 +46,6 @@ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** - * The {@link FilterConfig} to use. - */ - @NotNull - private final FilterConfig config; - - /** * The {@link JMenuItem}. */ @Nullable @@ -61,18 +55,17 @@ * The {@link FilterVisitor} for creating the menu item. */ @NotNull - private final FilterVisitor filterVisitor = new FilterVisitor() { + private final FilterConfigVisitor filterVisitor = new FilterConfigVisitor() { /** {@inheritDoc} */ @Override - public void visit(@NotNull final NamedFilterList filter) { - assert config != null; - menuItem = new FilterMenuEntry((NamedFilterConfig) config, filter); + public void visit(@NotNull final NamedFilterConfig config) { + menuItem = new FilterMenuEntry(config); } /** {@inheritDoc} */ @Override - public void visit(@NotNull final NamedGameObjectMatcherFilter filter) { + public void visit(@NotNull final NamedGameObjectMatcherFilterConfig config) { menuItem = new JCheckBoxMenuItem(ACTION_BUILDER.createToggle(true, "enabled", config)); } @@ -80,12 +73,10 @@ /** * Creates a new instance. - * @param filter the filter * @param config The filter config to use. */ - public MenuItemCreator(@NotNull final Filter filter, @NotNull final FilterConfig config) { - this.config = config; - filter.accept(filterVisitor); + public MenuItemCreator(@NotNull final FilterConfig<?, ?> config) { + config.accept(filterVisitor); assert menuItem != null; } Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -117,7 +117,7 @@ * {@inheritDoc} */ @Override - public void configChanged(final ConfigEvent event) { + public void configChanged(final ConfigEvent<?, ?> event) { forceRepaint(); } Modified: trunk/src/app/net/sf/gridarta/gui/script/ScriptController.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/ScriptController.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/src/app/net/sf/gridarta/gui/script/ScriptController.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -139,7 +139,7 @@ final String filterName = "(s)" + script.getName(); if (script.isFilter()) { - final Filter filter = getScriptAsFilter(script); + final Filter<?, ?> filter = getScriptAsFilter(script); if (filter != null) { filterControl.addFilter(filterName, filter); } @@ -315,11 +315,11 @@ } @Nullable - private Filter getScriptAsFilter(@NotNull final Script<?, ?, ?> script) { + private Filter<?, ?> getScriptAsFilter(@NotNull final Script<?, ?, ?> script) { final Interpreter runner = new Interpreter(); try { scriptParameters.setInterpreterValues(runner, ScriptRunMode.FILTER); - return (Filter) runner.eval(script.getCode()); + return (Filter<?, ?>) runner.eval(script.getCode()); } catch (final EvalError e) { log.warn("Evaluation error on (filter)" + script.getName(), e); } catch (final ClassCastException e) { Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/FilterParameterView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/FilterParameterView.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/FilterParameterView.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -23,18 +23,17 @@ import javax.swing.JPanel; import net.sf.gridarta.gui.filter.MenuItemCreator; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.filter.Filter; import net.sf.gridarta.model.filter.FilterConfig; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.script.parameter.FilterParameter; -public class FilterParameterView<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements PluginParameterView<G, A, R, FilterConfig, Void> { +public class FilterParameterView<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements PluginParameterView<G, A, R, FilterConfig<?, ?>, Void> { private final JComponent value; - public FilterParameterView(final FilterParameter<G, A, R> param, final Filter defaultFilterList) { - value = new MenuItemCreator(defaultFilterList, param.getValue()).getMenuItem(); + public FilterParameterView(final FilterParameter<G, A, R> param) { + value = new MenuItemCreator(param.getValue()).getMenuItem(); value.setName("Choose filters"); } @@ -42,7 +41,7 @@ * {@inheritDoc} */ @Override - public JComponent getValueComponent(final FilterConfig value) { + public JComponent getValueComponent(final FilterConfig<?, ?> value) { return this.value; } Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/PluginParameterViewFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/PluginParameterViewFactory.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/PluginParameterViewFactory.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -25,7 +25,6 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.model.filter.NamedFilterList; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.script.parameter.ArchParameter; @@ -56,9 +55,6 @@ private final ObjectChooser<G, A, R> objectChooser; @NotNull - private final NamedFilterList defaultFilterList; - - @NotNull private final MapManager<G, A, R> mapManager; /** @@ -93,7 +89,7 @@ /** {@inheritDoc} */ @Override public void visit(final FilterParameter<G, A, R> parameter) { - view = new FilterParameterView<G, A, R>(parameter, defaultFilterList); + view = new FilterParameterView<G, A, R>(parameter); } /** {@inheritDoc} */ @@ -121,11 +117,10 @@ * @param faceObjectProviders the face object providers for looking up * faces */ - public PluginParameterViewFactory(@NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final NamedFilterList defaultFilterList, @NotNull final MapManager<G, A, R> mapManager, @NotNull final FaceObjectProviders faceObjectProviders) { + public PluginParameterViewFactory(@NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final MapManager<G, A, R> mapManager, @NotNull final FaceObjectProviders faceObjectProviders) { this.archetypeSet = archetypeSet; this.gameObjectAttributesModel = gameObjectAttributesModel; this.objectChooser = objectChooser; - this.defaultFilterList = defaultFilterList; this.mapManager = mapManager; this.faceObjectProviders = faceObjectProviders; } Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -58,7 +58,7 @@ import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.model.filter.NamedFilterList; +import net.sf.gridarta.model.filter.NamedFilter; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.CacheFiles; @@ -355,7 +355,7 @@ * @param pluginParameterFactory the plugin parameter factory to use * @return the new instance */ - public GUIMainControl<G, A, R> createGUIMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final CacheFiles cacheFiles, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final int[] directionMap, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory) { + public GUIMainControl<G, A, R> createGUIMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final CacheFiles cacheFiles, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final int[] directionMap, @NotNull final NamedFilter defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory) { return new GUIMainControl<G, A, R>(createDirectionPane, mapManager, pickmapManager, archetypeSet, faceObjects, globalSettings, mapViewSettings, mapControlFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, compassIcon, gridartaJarFilename, FileFilters.mapFileFilter, scriptFileFilter, scriptExtension, validators, resources, gameObjectMatchers, errorView, attributeRangeChecker, lockedItemsTypeNumbers, scriptsDir, scriptModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils, autoValidatorDefault, spellFile, allowRandomMapParameters, directionMap, editorFactory, faceObjectProviders, pluginParameterFactory, defaultFilterList, gameObjectFactory, pathManager, cacheFiles, gameObjectSpells, numberSpells, undefinedSpellIndex, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, scriptExecutor, scriptParameters); } Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -46,7 +46,7 @@ import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.model.filter.NamedFilterList; +import net.sf.gridarta.model.filter.NamedFilter; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.DefaultMapReaderFactory; @@ -382,7 +382,7 @@ * @return the new instance */ @NotNull - GUIMainControl<G, A, R> createGUIMainControl(@NotNull DefaultMainControl<G, A, R> mainControl, @NotNull ErrorView errorView, @NotNull GUIUtils guiUtils, @NotNull ConfigSourceFactory configSourceFactory, @NotNull RendererFactory<G, A, R> rendererFactory, @NotNull FilterControl<G, A, R> filterControl, @NotNull ScriptExecutor<G, A, R> scriptExecutor, @NotNull ScriptParameters scriptParameters, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull MapManager<G, A, R> pickmapManager, @NotNull MapControlFactory<G, A, R> mapControlFactory, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull FaceObjects faceObjects, @NotNull GlobalSettings globalSettings, @NotNull MapViewSettings mapViewSettings, @NotNull FaceObjectProviders faceObjectProviders, @NotNull PathManager pathManager, @NotNull InsertionMode<G, A, R> topmostInsertionMode, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull SystemIcons systemIcons, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull PluginParameterFactory<G, A, R> pluginParameterFactory); + GUIMainControl<G, A, R> createGUIMainControl(@NotNull DefaultMainControl<G, A, R> mainControl, @NotNull ErrorView errorView, @NotNull GUIUtils guiUtils, @NotNull ConfigSourceFactory configSourceFactory, @NotNull RendererFactory<G, A, R> rendererFactory, @NotNull FilterControl<G, A, R> filterControl, @NotNull ScriptExecutor<G, A, R> scriptExecutor, @NotNull ScriptParameters scriptParameters, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull MapManager<G, A, R> pickmapManager, @NotNull MapControlFactory<G, A, R> mapControlFactory, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull FaceObjects faceObjects, @NotNull GlobalSettings globalSettings, @NotNull MapViewSettings mapViewSettings, @NotNull FaceObjectProviders faceObjectProviders, @NotNull PathManager pathManager, @NotNull InsertionMode<G, A, R> topmostInsertionMode, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull SystemIcons systemIcons, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilter defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull PluginParameterFactory<G, A, R> pluginParameterFactory); /** * Creates a new {@link AbstractResources} instance. Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-15 19:12:45 UTC (rev 7767) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-15 19:14:59 UTC (rev 7768) @@ -133,7 +133,7 @@ import net.sf.gridarta.model.exitconnector.ExitMatcher; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.model.filter.NamedFilterList; +import net.sf.gridarta.model.filter.NamedFilter; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.CacheFiles; @@ -381,7 +381,7 @@ * @param scriptExecutor the script executor to use * @param scriptParameters the script parameters to use */ - public GUIMainControl(final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final MapReaderFactory<G, A> mapReaderFactory, final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final TreasureTree treasureTree, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final AbstractResources<G, A, R> resources, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ErrorView errorView, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final int[] lockedItemsTypeNumbers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AnimationObjects animationObjects, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final ScriptArchData<G, A, R> scriptArchData, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, final boolean autoValidatorDefault, @Nullable final String spellFile, final boolean allowRandomMapParameters, @NotNull final int[] directionMap, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory, @NotNull final NamedFilterList defaultFilterList, final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final PathManager pathManager, @NotNull final CacheFiles cacheFiles, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, final int undefinedSpellIndex, @NotNull final SystemIcons systemIcons, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters) { + public GUIMainControl(final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final MapReaderFactory<G, A> mapReaderFactory, final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final TreasureTree treasureTree, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final AbstractResources<G, A, R> resources, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ErrorView errorView, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final int[] lockedItemsTypeNumbers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AnimationObjects animationObjects, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final ScriptArchData<G, A, R> scriptArchData, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, final boolean autoValidatorDefault, @Null... [truncated message content] |
From: <aki...@us...> - 2010-05-15 19:45:07
|
Revision: 7770 http://gridarta.svn.sourceforge.net/gridarta/?rev=7770&view=rev Author: akirschbaum Date: 2010-05-15 19:45:00 +0000 (Sat, 15 May 2010) Log Message: ----------- Remove ConfigEvent. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java trunk/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java trunk/src/app/net/sf/gridarta/model/filter/ConfigListener.java trunk/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java trunk/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilterConfig.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/model/filter/ConfigEvent.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-15 19:34:13 UTC (rev 7769) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-15 19:45:00 UTC (rev 7770) @@ -33,8 +33,9 @@ import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.filter.FilterState; import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; -import net.sf.gridarta.model.filter.ConfigEvent; +import net.sf.gridarta.model.filter.ConfigEventType; import net.sf.gridarta.model.filter.ConfigListener; +import net.sf.gridarta.model.filter.FilterConfig; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.map.grid.MapGrid; import net.sf.gridarta.model.map.mapmodel.MapModel; @@ -136,7 +137,7 @@ * {@inheritDoc} */ @Override - public void configChanged(final ConfigEvent<?, ?> event) { + public void configChanged(@NotNull final ConfigEventType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { forceRepaint(); } Modified: trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java 2010-05-15 19:34:13 UTC (rev 7769) +++ trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java 2010-05-15 19:45:00 UTC (rev 7770) @@ -22,9 +22,10 @@ import javax.swing.JMenu; import javax.swing.JMenuItem; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.filter.ConfigEvent; +import net.sf.gridarta.model.filter.ConfigEventType; import net.sf.gridarta.model.filter.ConfigListener; import net.sf.gridarta.model.filter.Filter; +import net.sf.gridarta.model.filter.FilterConfig; import net.sf.gridarta.model.filter.NamedFilter; import net.sf.gridarta.model.filter.NamedFilterConfig; import net.sf.gridarta.model.gameobject.GameObject; @@ -64,9 +65,9 @@ /** {@inheritDoc} */ @Override - public void configChanged(final ConfigEvent<?, ?> event) { + public void configChanged(@NotNull final ConfigEventType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { for (final ConfigListener listener : configListeners.getListeners()) { - listener.configChanged(event); + listener.configChanged(configEventType, filterConfig); } } Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-05-15 19:34:13 UTC (rev 7769) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-05-15 19:45:00 UTC (rev 7770) @@ -26,8 +26,9 @@ import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.filter.FilterState; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.filter.ConfigEvent; +import net.sf.gridarta.model.filter.ConfigEventType; import net.sf.gridarta.model.filter.ConfigListener; +import net.sf.gridarta.model.filter.FilterConfig; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; import net.sf.gridarta.model.gameobject.MultiPositionData; @@ -117,7 +118,7 @@ * {@inheritDoc} */ @Override - public void configChanged(final ConfigEvent<?, ?> event) { + public void configChanged(@NotNull final ConfigEventType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { forceRepaint(); } Modified: trunk/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java 2010-05-15 19:34:13 UTC (rev 7769) +++ trunk/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java 2010-05-15 19:45:00 UTC (rev 7770) @@ -83,7 +83,7 @@ if (log.isDebugEnabled()) { log.debug((enabled ? "enabling" : "disabling") + " filter " + this); } - fireEvent(new ConfigEvent<F, C>(enabled ? ConfigEventType.ENABLE : ConfigEventType.DISABLE, this)); + fireEvent(enabled ? ConfigEventType.ENABLE : ConfigEventType.DISABLE, this); } /** @@ -95,12 +95,13 @@ } /** - * Notify all listeners that a {@link ConfigEvent} has happened. - * @param event The config event. + * Notify all listeners that a {@link FilterConfig} has happened. + * @param configEventType the config event type + * @param filterConfig the changed filter config */ - protected void fireEvent(final ConfigEvent<?, ?> event) { + protected void fireEvent(@NotNull final ConfigEventType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { for (final ConfigListener listener : listenerList.getListeners()) { - listener.configChanged(event); + listener.configChanged(configEventType, filterConfig); } } Deleted: trunk/src/app/net/sf/gridarta/model/filter/ConfigEvent.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/ConfigEvent.java 2010-05-15 19:34:13 UTC (rev 7769) +++ trunk/src/app/net/sf/gridarta/model/filter/ConfigEvent.java 2010-05-15 19:45:00 UTC (rev 7770) @@ -1,54 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.model.filter; - -import java.util.EventObject; - -/** - * Event that's fired in case of changes to the configuration. - * @author tchize - */ -public class ConfigEvent<F extends Filter<F, C>, C extends FilterConfig<F, C>> extends EventObject { - - /** - * The serial version UID. - */ - private static final long serialVersionUID = 1L; - - private final ConfigEventType type; - - private final FilterConfig<F, C> config; - - public ConfigEvent(final ConfigEventType type, final FilterConfig<F, C> config) { - // XXX: Is config really the appropriate source? - super(config); - this.type = type; - this.config = config; - } - - public FilterConfig<F, C> getConfig() { - return config; - } - - public ConfigEventType getType() { - return type; - } - -} // class ConfigEvent Modified: trunk/src/app/net/sf/gridarta/model/filter/ConfigListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/ConfigListener.java 2010-05-15 19:34:13 UTC (rev 7769) +++ trunk/src/app/net/sf/gridarta/model/filter/ConfigListener.java 2010-05-15 19:45:00 UTC (rev 7770) @@ -20,13 +20,20 @@ package net.sf.gridarta.model.filter; import java.util.EventListener; +import org.jetbrains.annotations.NotNull; /** - * Listener for ConfigEvents. + * Interface for listeners interesed in {@link FilterConfig} related changes. * @author tchize + * @author Andreas Kirschbaum */ public interface ConfigListener extends EventListener { - void configChanged(ConfigEvent<?, ?> event); + /** + * A {@link FilterConfig} has changed. + * @param configEventType the change type + * @param filterConfig the changed filter config + */ + void configChanged(@NotNull ConfigEventType configEventType, @NotNull FilterConfig<?, ?> filterConfig); } // interface ConfigListener Modified: trunk/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java 2010-05-15 19:34:13 UTC (rev 7769) +++ trunk/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java 2010-05-15 19:45:00 UTC (rev 7770) @@ -46,13 +46,13 @@ /** {@inheritDoc} */ @Override - public void configChanged(final ConfigEvent<?, ?> event) { + public void configChanged(@NotNull final ConfigEventType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { // XXX What's with newe? // Not used, so why is it created? // This also has no side effect, so is this code wrong and fireEvent(newe) should be invoked instead of fireEvent(event)? // If so, why is the argument ignored in the new event construction? - final ConfigEvent<?, ?> newe = new ConfigEvent<NamedFilter, NamedFilterConfig>(ConfigEventType.CHANGE, NamedFilterConfig.this); - fireEvent(event); + //final ConfigEvent<?, ?> newe = new ConfigEvent<NamedFilter, NamedFilterConfig>(ConfigEventType.CHANGE, NamedFilterConfig.this); + fireEvent(configEventType, filterConfig); } }; @@ -81,8 +81,7 @@ } map.put(event.getFilterName(), myCfg); } - final ConfigEvent<NamedFilter, NamedFilterConfig> e = new ConfigEvent<NamedFilter, NamedFilterConfig>(ConfigEventType.CHANGE, NamedFilterConfig.this); - fireEvent(e); + fireEvent(ConfigEventType.CHANGE, NamedFilterConfig.this); } }; @@ -115,7 +114,7 @@ return; } this.inverted = inverted; - fireEvent(new ConfigEvent<NamedFilter, NamedFilterConfig>(ConfigEventType.CHANGE, this)); + fireEvent(ConfigEventType.CHANGE, this); } public FilterConfig<?, ?> getConfig(final String name) { @@ -150,8 +149,7 @@ config.addConfigChangeListener(configListener); } config.setEnabled(enabled); - final ConfigEvent<NamedFilter, NamedFilterConfig> e = new ConfigEvent<NamedFilter, NamedFilterConfig>(ConfigEventType.CHANGE, this); - fireEvent(e); + fireEvent(ConfigEventType.CHANGE, this); } /** Modified: trunk/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilterConfig.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilterConfig.java 2010-05-15 19:34:13 UTC (rev 7769) +++ trunk/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilterConfig.java 2010-05-15 19:45:00 UTC (rev 7770) @@ -56,7 +56,7 @@ } properties.put(name, value); - fireEvent(new ConfigEvent<NamedGameObjectMatcherFilter, NamedGameObjectMatcherFilterConfig>(ConfigEventType.CHANGE, this)); + fireEvent(ConfigEventType.CHANGE, this); } public String getProperty(final String name) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-15 19:49:59
|
Revision: 7771 http://gridarta.svn.sourceforge.net/gridarta/?rev=7771&view=rev Author: akirschbaum Date: 2010-05-15 19:49:52 +0000 (Sat, 15 May 2010) Log Message: ----------- Rename class names. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java trunk/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java trunk/src/app/net/sf/gridarta/model/filter/FilterConfig.java trunk/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java trunk/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilterConfig.java trunk/src/test/net/sf/gridarta/gui/filter/TestFilterControl.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/model/filter/FilterConfigChangeType.java trunk/src/app/net/sf/gridarta/model/filter/FilterConfigListener.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/model/filter/ConfigEventType.java trunk/src/app/net/sf/gridarta/model/filter/ConfigListener.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-15 19:45:00 UTC (rev 7770) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -33,9 +33,9 @@ import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.filter.FilterState; import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; -import net.sf.gridarta.model.filter.ConfigEventType; -import net.sf.gridarta.model.filter.ConfigListener; import net.sf.gridarta.model.filter.FilterConfig; +import net.sf.gridarta.model.filter.FilterConfigChangeType; +import net.sf.gridarta.model.filter.FilterConfigListener; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.map.grid.MapGrid; import net.sf.gridarta.model.map.mapmodel.MapModel; @@ -131,18 +131,18 @@ this.mapViewSettings = mapViewSettings; this.smoothingRenderer = smoothingRenderer; init(); - final ConfigListener configListener = new ConfigListener() { + final FilterConfigListener filterConfigListener = new FilterConfigListener() { /** * {@inheritDoc} */ @Override - public void configChanged(@NotNull final ConfigEventType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { + public void configChanged(@NotNull final FilterConfigChangeType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { forceRepaint(); } }; - this.filterControl.addConfigListener(configListener); + this.filterControl.addConfigListener(filterConfigListener); } /** Modified: trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java 2010-05-15 19:45:00 UTC (rev 7770) +++ trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -22,10 +22,10 @@ import javax.swing.JMenu; import javax.swing.JMenuItem; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.filter.ConfigEventType; -import net.sf.gridarta.model.filter.ConfigListener; import net.sf.gridarta.model.filter.Filter; import net.sf.gridarta.model.filter.FilterConfig; +import net.sf.gridarta.model.filter.FilterConfigChangeType; +import net.sf.gridarta.model.filter.FilterConfigListener; import net.sf.gridarta.model.filter.NamedFilter; import net.sf.gridarta.model.filter.NamedFilterConfig; import net.sf.gridarta.model.gameobject.GameObject; @@ -57,17 +57,17 @@ private final NamedFilterConfig[] highlightConfig; /** - * The {@link ConfigListener}s to notify. + * The {@link FilterConfigListener}s to notify. */ - private final EventListenerList2<ConfigListener> configListeners = new EventListenerList2<ConfigListener>(ConfigListener.class); + private final EventListenerList2<FilterConfigListener> configListeners = new EventListenerList2<FilterConfigListener>(FilterConfigListener.class); - private final ConfigListener configListener = new ConfigListener() { + private final FilterConfigListener filterConfigListener = new FilterConfigListener() { /** {@inheritDoc} */ @Override - public void configChanged(@NotNull final ConfigEventType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { - for (final ConfigListener listener : configListeners.getListeners()) { - listener.configChanged(configEventType, filterConfig); + public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { + for (final FilterConfigListener listener : configListeners.getListeners()) { + listener.configChanged(filterConfigChangeType, filterConfig); } } @@ -85,9 +85,9 @@ for (int i = 0; i < MAX_HIGHLIGHT; i++) { highlightConfig[i] = filterList.createConfig(); } - filterOutConfig.addConfigChangeListener(configListener); + filterOutConfig.addConfigChangeListener(filterConfigListener); for (int i = 0; i < MAX_HIGHLIGHT; i++) { - highlightConfig[i].addConfigChangeListener(configListener); + highlightConfig[i].addConfigChangeListener(filterConfigListener); } } @@ -95,7 +95,7 @@ * {@inheritDoc} */ @Override - public void addConfigListener(@NotNull final ConfigListener listener) { + public void addConfigListener(@NotNull final FilterConfigListener listener) { configListeners.add(listener); } @@ -103,7 +103,7 @@ * {@inheritDoc} */ @Override - public void removeConfigListener(@NotNull final ConfigListener listener) { + public void removeConfigListener(@NotNull final FilterConfigListener listener) { configListeners.remove(listener); } Modified: trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java 2010-05-15 19:45:00 UTC (rev 7770) +++ trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -21,8 +21,8 @@ import javax.swing.JMenu; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.filter.ConfigListener; import net.sf.gridarta.model.filter.Filter; +import net.sf.gridarta.model.filter.FilterConfigListener; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; @@ -35,16 +35,16 @@ int MAX_HIGHLIGHT = 3; /** - * Adds a {@link ConfigListener} to be notified about changes. + * Adds a {@link FilterConfigListener} to be notified about changes. * @param listener the config listener */ - void addConfigListener(@NotNull ConfigListener listener); + void addConfigListener(@NotNull FilterConfigListener listener); /** - * Removes a {@link ConfigListener} to be notified about changes. + * Removes a {@link FilterConfigListener} to be notified about changes. * @param listener the config listener */ - void removeConfigListener(@NotNull ConfigListener listener); + void removeConfigListener(@NotNull FilterConfigListener listener); void createMenuEntries(JMenu menu); Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-05-15 19:45:00 UTC (rev 7770) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -26,9 +26,9 @@ import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.filter.FilterState; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.filter.ConfigEventType; -import net.sf.gridarta.model.filter.ConfigListener; import net.sf.gridarta.model.filter.FilterConfig; +import net.sf.gridarta.model.filter.FilterConfigChangeType; +import net.sf.gridarta.model.filter.FilterConfigListener; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; import net.sf.gridarta.model.gameobject.MultiPositionData; @@ -112,18 +112,18 @@ emptySquareIcon = systemIcons.getEmptySquareIcon(); this.mapViewSettings = mapViewSettings; this.isoMapSquareInfo = isoMapSquareInfo; - final ConfigListener configListener = new ConfigListener() { + final FilterConfigListener filterConfigListener = new FilterConfigListener() { /** * {@inheritDoc} */ @Override - public void configChanged(@NotNull final ConfigEventType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { + public void configChanged(@NotNull final FilterConfigChangeType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { forceRepaint(); } }; - this.filterControl.addConfigListener(configListener); + this.filterControl.addConfigListener(filterConfigListener); } /** Modified: trunk/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java 2010-05-15 19:45:00 UTC (rev 7770) +++ trunk/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -45,7 +45,7 @@ /** * The registered listeners. */ - private final EventListenerList2<ConfigListener> listenerList = new EventListenerList2<ConfigListener>(ConfigListener.class); + private final EventListenerList2<FilterConfigListener> listenerList = new EventListenerList2<FilterConfigListener>(FilterConfigListener.class); /** * The {@link Filter} this filter config belongs to. @@ -83,7 +83,7 @@ if (log.isDebugEnabled()) { log.debug((enabled ? "enabling" : "disabling") + " filter " + this); } - fireEvent(enabled ? ConfigEventType.ENABLE : ConfigEventType.DISABLE, this); + fireEvent(enabled ? FilterConfigChangeType.ENABLE : FilterConfigChangeType.DISABLE, this); } /** @@ -96,12 +96,12 @@ /** * Notify all listeners that a {@link FilterConfig} has happened. - * @param configEventType the config event type + * @param filterConfigChangeType the config event type * @param filterConfig the changed filter config */ - protected void fireEvent(@NotNull final ConfigEventType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { - for (final ConfigListener listener : listenerList.getListeners()) { - listener.configChanged(configEventType, filterConfig); + protected void fireEvent(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { + for (final FilterConfigListener listener : listenerList.getListeners()) { + listener.configChanged(filterConfigChangeType, filterConfig); } } @@ -109,7 +109,7 @@ * {@inheritDoc} */ @Override - public void addConfigChangeListener(final ConfigListener listener) { + public void addConfigChangeListener(final FilterConfigListener listener) { listenerList.add(listener); } @@ -117,7 +117,7 @@ * {@inheritDoc} */ @Override - public void removeConfigChangeListener(final ConfigListener listener) { + public void removeConfigChangeListener(final FilterConfigListener listener) { listenerList.remove(listener); } Deleted: trunk/src/app/net/sf/gridarta/model/filter/ConfigEventType.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/ConfigEventType.java 2010-05-15 19:45:00 UTC (rev 7770) +++ trunk/src/app/net/sf/gridarta/model/filter/ConfigEventType.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -1,34 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.model.filter; - -/** - * Enumeration of Configuration event types. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public enum ConfigEventType { - - ENABLE, - - DISABLE, - - CHANGE - -} // enum ConfigEventType Deleted: trunk/src/app/net/sf/gridarta/model/filter/ConfigListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/ConfigListener.java 2010-05-15 19:45:00 UTC (rev 7770) +++ trunk/src/app/net/sf/gridarta/model/filter/ConfigListener.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -1,39 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.model.filter; - -import java.util.EventListener; -import org.jetbrains.annotations.NotNull; - -/** - * Interface for listeners interesed in {@link FilterConfig} related changes. - * @author tchize - * @author Andreas Kirschbaum - */ -public interface ConfigListener extends EventListener { - - /** - * A {@link FilterConfig} has changed. - * @param configEventType the change type - * @param filterConfig the changed filter config - */ - void configChanged(@NotNull ConfigEventType configEventType, @NotNull FilterConfig<?, ?> filterConfig); - -} // interface ConfigListener Modified: trunk/src/app/net/sf/gridarta/model/filter/FilterConfig.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/FilterConfig.java 2010-05-15 19:45:00 UTC (rev 7770) +++ trunk/src/app/net/sf/gridarta/model/filter/FilterConfig.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -48,16 +48,16 @@ boolean isEnabled(); /** - * Add a {@link ConfigListener} to be notified about changes. + * Add a {@link FilterConfigListener} to be notified about changes. * @param listener The config listener to add. */ - void addConfigChangeListener(ConfigListener listener); + void addConfigChangeListener(FilterConfigListener listener); /** - * Remove a {@link ConfigListener} to be notified about changes. + * Remove a {@link FilterConfigListener} to be notified about changes. * @param listener The config listener to remove. */ - void removeConfigChangeListener(ConfigListener listener); + void removeConfigChangeListener(FilterConfigListener listener); /** * Visits the appropriate <code>visit()</code> function of a {@link Copied: trunk/src/app/net/sf/gridarta/model/filter/FilterConfigChangeType.java (from rev 7753, trunk/src/app/net/sf/gridarta/model/filter/ConfigEventType.java) =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/FilterConfigChangeType.java (rev 0) +++ trunk/src/app/net/sf/gridarta/model/filter/FilterConfigChangeType.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -0,0 +1,34 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.filter; + +/** + * Enumeration of Configuration event types. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public enum FilterConfigChangeType { + + ENABLE, + + DISABLE, + + CHANGE + +} // enum FilterConfigChangeType Property changes on: trunk/src/app/net/sf/gridarta/model/filter/FilterConfigChangeType.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/src/app/net/sf/gridarta/model/filter/FilterConfigListener.java (from rev 7770, trunk/src/app/net/sf/gridarta/model/filter/ConfigListener.java) =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/FilterConfigListener.java (rev 0) +++ trunk/src/app/net/sf/gridarta/model/filter/FilterConfigListener.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -0,0 +1,39 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.filter; + +import java.util.EventListener; +import org.jetbrains.annotations.NotNull; + +/** + * Interface for listeners interesed in {@link FilterConfig} related changes. + * @author tchize + * @author Andreas Kirschbaum + */ +public interface FilterConfigListener extends EventListener { + + /** + * A {@link FilterConfig} has changed. + * @param filterConfigChangeType the change type + * @param filterConfig the changed filter config + */ + void configChanged(@NotNull FilterConfigChangeType filterConfigChangeType, @NotNull FilterConfig<?, ?> filterConfig); + +} // interface FilterConfigListener Property changes on: trunk/src/app/net/sf/gridarta/model/filter/FilterConfigListener.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java 2010-05-15 19:45:00 UTC (rev 7770) +++ trunk/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -42,17 +42,17 @@ */ private static final Category log = Logger.getLogger(NamedFilterConfig.class); - private final ConfigListener configListener = new ConfigListener() { + private final FilterConfigListener filterConfigListener = new FilterConfigListener() { /** {@inheritDoc} */ @Override - public void configChanged(@NotNull final ConfigEventType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { + public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { // XXX What's with newe? // Not used, so why is it created? // This also has no side effect, so is this code wrong and fireEvent(newe) should be invoked instead of fireEvent(event)? // If so, why is the argument ignored in the new event construction? - //final ConfigEvent<?, ?> newe = new ConfigEvent<NamedFilter, NamedFilterConfig>(ConfigEventType.CHANGE, NamedFilterConfig.this); - fireEvent(configEventType, filterConfig); + //final ConfigEvent<?, ?> newe = new ConfigEvent<NamedFilter, NamedFilterConfig>(FilterConfigChangeType.CHANGE, NamedFilterConfig.this); + fireEvent(filterConfigChangeType, filterConfig); } }; @@ -65,7 +65,7 @@ if (event.getType() == NamedFilterEventType.REMOVE) { final FilterConfig<?, ?> myCfg = map.get(event.getFilterName()); if (myCfg != null) { - myCfg.removeConfigChangeListener(configListener); + myCfg.removeConfigChangeListener(filterConfigListener); } if (log.isDebugEnabled()) { log.debug(this + " removing config for " + event.getFilterName(), new Exception()); @@ -75,13 +75,13 @@ if (event.getType() == NamedFilterEventType.ADD) { final FilterConfig<?, ?> myCfg = event.getFilter().createConfig(); - myCfg.addConfigChangeListener(configListener); + myCfg.addConfigChangeListener(filterConfigListener); if (log.isDebugEnabled()) { log.debug(this + " adding config for " + event.getFilterName(), new Exception()); } map.put(event.getFilterName(), myCfg); } - fireEvent(ConfigEventType.CHANGE, NamedFilterConfig.this); + fireEvent(FilterConfigChangeType.CHANGE, NamedFilterConfig.this); } }; @@ -114,7 +114,7 @@ return; } this.inverted = inverted; - fireEvent(ConfigEventType.CHANGE, this); + fireEvent(FilterConfigChangeType.CHANGE, this); } public FilterConfig<?, ?> getConfig(final String name) { @@ -146,10 +146,10 @@ } map.put(name, config); - config.addConfigChangeListener(configListener); + config.addConfigChangeListener(filterConfigListener); } config.setEnabled(enabled); - fireEvent(ConfigEventType.CHANGE, this); + fireEvent(FilterConfigChangeType.CHANGE, this); } /** Modified: trunk/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilterConfig.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilterConfig.java 2010-05-15 19:45:00 UTC (rev 7770) +++ trunk/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilterConfig.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -56,7 +56,7 @@ } properties.put(name, value); - fireEvent(ConfigEventType.CHANGE, this); + fireEvent(FilterConfigChangeType.CHANGE, this); } public String getProperty(final String name) { Modified: trunk/src/test/net/sf/gridarta/gui/filter/TestFilterControl.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/filter/TestFilterControl.java 2010-05-15 19:45:00 UTC (rev 7770) +++ trunk/src/test/net/sf/gridarta/gui/filter/TestFilterControl.java 2010-05-15 19:49:52 UTC (rev 7771) @@ -21,8 +21,8 @@ import javax.swing.JMenu; import net.sf.gridarta.model.archetype.TestArchetype; -import net.sf.gridarta.model.filter.ConfigListener; import net.sf.gridarta.model.filter.Filter; +import net.sf.gridarta.model.filter.FilterConfigListener; import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; import org.jetbrains.annotations.NotNull; @@ -37,7 +37,7 @@ * {@inheritDoc} */ @Override - public void addConfigListener(@NotNull final ConfigListener listener) { + public void addConfigListener(@NotNull final FilterConfigListener listener) { throw new AssertionError(); } @@ -45,7 +45,7 @@ * {@inheritDoc} */ @Override - public void removeConfigListener(@NotNull final ConfigListener listener) { + public void removeConfigListener(@NotNull final FilterConfigListener listener) { throw new AssertionError(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-16 04:49:26
|
Revision: 7788 http://gridarta.svn.sourceforge.net/gridarta/?rev=7788&view=rev Author: akirschbaum Date: 2010-05-16 04:49:19 +0000 (Sun, 16 May 2010) Log Message: ----------- Rename variables names. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-16 04:42:07 UTC (rev 7787) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-16 04:49:19 UTC (rev 7788) @@ -232,7 +232,7 @@ final BufferedImage newBackBuffer; try { newBackBuffer = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB); - } catch (final OutOfMemoryError ex) { + } catch (final OutOfMemoryError ignore) { if (log.isDebugEnabled()) { log.debug("out of memory creating new back buffer"); } @@ -248,12 +248,12 @@ * {@inheritDoc} */ @Override - protected void paintSquare(@NotNull final Graphics grfx, final int x, final int y, @NotNull final MapSquare<GameObject, MapArchObject, Archetype> square) { + protected void paintSquare(@NotNull final Graphics g, final int x, final int y, @NotNull final MapSquare<GameObject, MapArchObject, Archetype> square) { filterControl.newSquare(filterState); if (square.isEmpty()) { - emptySquareIcon.paintIcon(this, grfx, x, y); + emptySquareIcon.paintIcon(this, g, x, y); } else { - grfx.fillRect(x, y, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT); + g.fillRect(x, y, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT); if (mapViewSettings.isSmoothing()) { int layer = -1; for (final GameObject node : square) { @@ -262,42 +262,42 @@ } filterControl.objectInSquare(filterState, node); if (filterControl.canShow(node) && mapViewSettings.isEditType(node)) { - paintGameObject(grfx, x, y, node); + paintGameObject(g, x, y, node); if (node.getAttributeInt("smoothlevel", true) > 0) { - smoothingRenderer.paintSmooth(grfx, square.getMapX(), square.getMapY(), node.getAttributeInt("smoothlevel", true), layer, false, borderOffset); + smoothingRenderer.paintSmooth(g, square.getMapX(), square.getMapY(), node.getAttributeInt("smoothlevel", true), layer, false, borderOffset); } } if (layer > -1) { - smoothingRenderer.paintSmooth(grfx, square.getMapX(), square.getMapY(), 1, layer + 1, true, borderOffset); + smoothingRenderer.paintSmooth(g, square.getMapX(), square.getMapY(), 1, layer + 1, true, borderOffset); } } } else { for (final GameObject node : square) { filterControl.objectInSquare(filterState, node); if (filterControl.canShow(node) && mapViewSettings.isEditType(node)) { - paintGameObject(grfx, x, y, node); + paintGameObject(g, x, y, node); } } } } for (int i = 0; i < FilterControl.MAX_HIGHLIGHT; i++) { if (filterControl.isHighlightedSquare(filterState, i)) { - final Color color = grfx.getColor(); - grfx.setColor(highLightMask[i]); - grfx.fillRect(x, y, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT); - grfx.setColor(color); + final Color color = g.getColor(); + g.setColor(highLightMask[i]); + g.fillRect(x, y, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT); + g.setColor(color); } } } /** * Paints one game object. - * @param grfx the graphics to paint into + * @param g the graphics to paint into * @param x the x-coordinate to paint at * @param y the y-coordinate to paint at * @param node the game object to paint */ - private void paintGameObject(@NotNull final Graphics grfx, final int x, final int y, @NotNull final net.sf.gridarta.model.gameobject.GameObject<GameObject, MapArchObject, Archetype> node) { + private void paintGameObject(@NotNull final Graphics g, final int x, final int y, @NotNull final net.sf.gridarta.model.gameobject.GameObject<GameObject, MapArchObject, Archetype> node) { final ImageIcon img = node.getImage(mapViewSettings); if (!node.isMulti() || (img.getIconWidth() == IGUIConstants.SQUARE_WIDTH && img.getIconHeight() == IGUIConstants.SQUARE_HEIGHT)) { offset.x = 0; @@ -308,7 +308,7 @@ offset.x = IGUIConstants.SQUARE_WIDTH * (node.getMultiX() - node.getMinX()); offset.y = IGUIConstants.SQUARE_HEIGHT * (node.getMultiY() - node.getMinY()); } - grfx.drawImage(img.getImage(), x, y, x + IGUIConstants.SQUARE_WIDTH, y + IGUIConstants.SQUARE_HEIGHT, offset.x, offset.y, offset.x + IGUIConstants.SQUARE_WIDTH, offset.y + IGUIConstants.SQUARE_HEIGHT, this); + g.drawImage(img.getImage(), x, y, x + IGUIConstants.SQUARE_WIDTH, y + IGUIConstants.SQUARE_HEIGHT, offset.x, offset.y, offset.x + IGUIConstants.SQUARE_WIDTH, offset.y + IGUIConstants.SQUARE_HEIGHT, this); } /** Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-16 04:42:07 UTC (rev 7787) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-16 04:49:19 UTC (rev 7788) @@ -438,27 +438,27 @@ /** * Clears the window to background color if necessary. - * @param grfx Graphics to use for clearing. + * @param g Graphics to use for clearing. */ - protected abstract void clearBackground(@NotNull final Graphics grfx); + protected abstract void clearBackground(@NotNull final Graphics g); /** * Paints one square. - * @param grfx the graphics context to paint to + * @param g the graphics context to paint to * @param x the square coordinate to paint to * @param y the square coordinate to paint to * @param square the square to paint */ - protected abstract void paintSquare(@NotNull final Graphics2D grfx, final int x, final int y, @NotNull final MapSquare<G, A, R> square); + protected abstract void paintSquare(@NotNull final Graphics2D g, final int x, final int y, @NotNull final MapSquare<G, A, R> square); /** * Paints this component. - * @param grfx the graphics context to paint to + * @param g the graphics context to paint to */ - private void paintComponent2(@NotNull final Graphics2D grfx) { + private void paintComponent2(@NotNull final Graphics2D g) { //ImageIcon selIcon = mainControl.mapSelIcon; - clearBackground(grfx); + clearBackground(g); final Rectangle rec = getRepaintRec(getVisibleRect()); final Point pos = new Point(); final Point endPos = rec.getLocation(); @@ -467,30 +467,30 @@ int xstart = origin.x - (pos.y - rec.x + 1) * isoMapSquareInfo.getXlen2(); int ystart = origin.y + (pos.y + rec.x) * isoMapSquareInfo.getYlen2(); for (pos.x = rec.x; pos.x < endPos.x; pos.x++) { - if (grfx.hitClip(xstart, ystart - isoMapSquareInfo.getYlen() * 4, isoMapSquareInfo.getXlen(), isoMapSquareInfo.getYlen() * 5)) { - paintSquare(grfx, xstart, ystart, mapModel.getMapSquare(pos)); + if (g.hitClip(xstart, ystart - isoMapSquareInfo.getYlen() * 4, isoMapSquareInfo.getXlen(), isoMapSquareInfo.getYlen() * 5)) { + paintSquare(g, xstart, ystart, mapModel.getMapSquare(pos)); } xstart += isoMapSquareInfo.getXlen2(); ystart += isoMapSquareInfo.getYlen2(); } } - paintMapGrid(grfx); - paintMapSelection(grfx); + paintMapGrid(g); + paintMapSelection(g); } /** * Returns smallest {@link Rectangle} on the map that needs to be repaint. - * @param visRec the visible rectangle + * @param visibleRectangle the visible rectangle * @return the rectangle to repaint */ - private Rectangle getRepaintRec(@NotNull final Rectangle visRec) { + private Rectangle getRepaintRec(@NotNull final Rectangle visibleRectangle) { // This Rectangle will be returned final Rectangle rec = new Rectangle(); // Upper left corner of viewport - final Point posUL = visRec.getLocation(); + final Point posUL = visibleRectangle.getLocation(); // Dimension of viewport - final Dimension visDim = visRec.getSize(); + final Dimension visDim = visibleRectangle.getSize(); // Other positions of viewport corners final Point posUR = new Point(posUL.x + visDim.width, posUL.y); final Point posDL = new Point(posUL.x, posUL.y + visDim.height); @@ -511,40 +511,40 @@ /** * Paints a single {@link GameObject}. - * @param grfx the graphics to paint to - * @param xstart the x offset for painting - * @param ystart the y offset for painting + * @param g the graphics to paint to + * @param xStart the x offset for painting + * @param yStart the y offset for painting * @param gameObject the game object to paint */ - protected void paintGameObject(@NotNull final Graphics2D grfx, final int xstart, final int ystart, @NotNull final G gameObject) { + protected void paintGameObject(@NotNull final Graphics2D g, final int xStart, final int yStart, @NotNull final G gameObject) { final BaseObject<G, A, R, ?> tmpNode = gameObject.isMulti() ? gameObject : null; final G head = gameObject.getHead(); if (isGameObjectVisible(head)) { - final Icon img = "trans.101".equals(head.getFaceObjName()) ? unknownSquareIcon : head.getImage(mapViewSettings); - final int yoff = img.getIconHeight() - isoMapSquareInfo.getYlen(); + final Icon icon = "trans.101".equals(head.getFaceObjName()) ? unknownSquareIcon : head.getImage(mapViewSettings); + final int yOffset = icon.getIconHeight() - isoMapSquareInfo.getYlen(); if (head.getMultiRefCount() > 0) { // multipart images have to be painted with correct offset // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. if (tmpNode != null && tmpNode.isLowestPart() || head.isLowestPart()) { - img.paintIcon(this, grfx, xstart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr()), ystart - yoff + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr())); + icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr())); } else { final BaseObject<G, A, R, ?> env = head.getContainerGameObject(); if (env != null && isSpawnPoint(env)) { - img.paintIcon(this, grfx, xstart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr()), ystart - yoff + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr())); + icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr())); } } } else { - int xoff = 0; - if (img.getIconWidth() > isoMapSquareInfo.getXlen()) { - xoff = (img.getIconWidth() - isoMapSquareInfo.getXlen()) / 2; + int xOffset = 0; + if (icon.getIconWidth() > isoMapSquareInfo.getXlen()) { + xOffset = (icon.getIconWidth() - isoMapSquareInfo.getXlen()) / 2; } - img.paintIcon(this, grfx, xstart - xoff, ystart - yoff); + icon.paintIcon(this, g, xStart - xOffset, yStart - yOffset); } // Paint first object (most likely a mob) in spawn points. if (isSpawnPoint(head)) { final G mob = head.getFirst(); if (mob != null) { - paintGameObject(grfx, xstart, ystart, mob); + paintGameObject(g, xStart, yStart, mob); } } } @@ -563,16 +563,16 @@ * Paints the selection for the whole map. It's recommended to paint the * complete selection after the map itself, otherwise map elements actually * might hide selections. - * @param grfx the graphics for painting + * @param g the graphics for painting */ - private void paintMapSelection(@NotNull final Graphics grfx) { + private void paintMapSelection(@NotNull final Graphics g) { for (int y = 0; y < mapSize.getHeight(); y++) { int xstart = origin.x - (y + 1) * isoMapSquareInfo.getXlen2(); int ystart = origin.y + y * isoMapSquareInfo.getYlen2(); for (int x = 0; x < mapSize.getWidth(); x++) { - if (grfx.hitClip(xstart, ystart, isoMapSquareInfo.getXlen(), isoMapSquareInfo.getYlen())) { + if (g.hitClip(xstart, ystart, isoMapSquareInfo.getXlen(), isoMapSquareInfo.getYlen())) { final int gridFlags = mapGrid.getFlags(x, y); - gridMapSquarePainter.paint(grfx, gridFlags, xstart, ystart, this); + gridMapSquarePainter.paint(g, gridFlags, xstart, ystart, this); } else { /* DO NOTHING if outside clip region. * DO NOT use continue. xstart and ystart are recalculated at the end of the loop. @@ -588,20 +588,20 @@ * Paints the grid of the whole map. The grid is not painted if it is * disabled. It's recommended to paint the complete grid after the map * itself, otherwise map elements actually might hide parts of the grid. - * @param grfx the graphics for painting + * @param g the graphics for painting */ - private void paintMapGrid(@NotNull final Graphics grfx) { + private void paintMapGrid(@NotNull final Graphics g) { if (mapViewSettings.isGridVisible()) { // draw iso grid - grfx.setColor(Color.black); + g.setColor(Color.black); final int mapWidth = mapSize.getWidth(); final int mapHeight = mapSize.getHeight(); for (int x = 0; x <= mapWidth; x++) { - grfx.drawLine(origin.x + x * isoMapSquareInfo.getXlen2() - 1, origin.y + x * isoMapSquareInfo.getYlen2() - 1, origin.x - (mapHeight - x) * isoMapSquareInfo.getXlen2() - 1, origin.y + (mapHeight + x) * isoMapSquareInfo.getYlen2() - 1); + g.drawLine(origin.x + x * isoMapSquareInfo.getXlen2() - 1, origin.y + x * isoMapSquareInfo.getYlen2() - 1, origin.x - (mapHeight - x) * isoMapSquareInfo.getXlen2() - 1, origin.y + (mapHeight + x) * isoMapSquareInfo.getYlen2() - 1); } for (int y = 0; y <= mapHeight; y++) { - grfx.drawLine(origin.x - y * isoMapSquareInfo.getXlen2() - 1, origin.y + y * isoMapSquareInfo.getYlen2() - 1, origin.x + (mapWidth - y) * isoMapSquareInfo.getXlen2() - 1, origin.y + (mapWidth + y) * isoMapSquareInfo.getYlen2() - 1); + g.drawLine(origin.x - y * isoMapSquareInfo.getXlen2() - 1, origin.y + y * isoMapSquareInfo.getYlen2() - 1, origin.x + (mapWidth - y) * isoMapSquareInfo.getXlen2() - 1, origin.y + (mapWidth + y) * isoMapSquareInfo.getYlen2() - 1); } } } Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-05-16 04:42:07 UTC (rev 7787) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-05-16 04:49:19 UTC (rev 7788) @@ -130,7 +130,7 @@ * {@inheritDoc} */ @Override - protected void clearBackground(@NotNull final Graphics grfx) { + protected void clearBackground(@NotNull final Graphics g) { } /** @@ -145,22 +145,22 @@ * {@inheritDoc} */ @Override - protected void paintSquare(@NotNull final Graphics2D grfx, final int x, final int y, @NotNull final MapSquare<G, A, R> square) { + protected void paintSquare(@NotNull final Graphics2D g, final int x, final int y, @NotNull final MapSquare<G, A, R> square) { filterControl.newSquare(filterState); if (square.isEmpty()) { - emptySquareIcon.paintIcon(this, grfx, x, y); + emptySquareIcon.paintIcon(this, g, x, y); } else { for (final G node : square) { filterControl.objectInSquare(filterState, node); if (filterControl.canShow(node) && mapViewSettings.isEditType(node)) { - paintGameObject(grfx, x, y, node); + paintGameObject(g, x, y, node); } } } for (int i = 0; i < FilterControl.MAX_HIGHLIGHT; i++) { if (filterControl.isHighlightedSquare(filterState, i)) { - final Color color = grfx.getColor(); - grfx.setColor(highLightMask[i]); + final Color color = g.getColor(); + g.setColor(highLightMask[i]); xPoints[0] = x + isoMapSquareInfo.getXlen() / 2; xPoints[1] = x + isoMapSquareInfo.getXlen() - 1; xPoints[2] = xPoints[0]; @@ -169,8 +169,8 @@ yPoints[1] = y + isoMapSquareInfo.getYlen() / 2; yPoints[2] = y + isoMapSquareInfo.getYlen() - 1; yPoints[3] = yPoints[1]; - grfx.fillPolygon(xPoints, yPoints, 4); - grfx.setColor(color); + g.fillPolygon(xPoints, yPoints, 4); + g.setColor(color); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-16 09:48:50
|
Revision: 7793 http://gridarta.svn.sourceforge.net/gridarta/?rev=7793&view=rev Author: akirschbaum Date: 2010-05-16 09:48:43 +0000 (Sun, 16 May 2010) Log Message: ----------- Fix display issues when filtering the map view on mobs within spawn points. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-16 09:37:09 UTC (rev 7792) +++ trunk/atrinik/ChangeLog 2010-05-16 09:48:43 UTC (rev 7793) @@ -1,3 +1,8 @@ +2010-05-16 Andreas Kirschbaum + + * Fix display issues when filtering the map view on mobs within + spawn points. + 2010-05-15 Andreas Kirschbaum * In game object attributes dialog, improve formatting of bitmask Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-16 09:37:09 UTC (rev 7792) +++ trunk/daimonin/ChangeLog 2010-05-16 09:48:43 UTC (rev 7793) @@ -1,3 +1,8 @@ +2010-05-16 Andreas Kirschbaum + + * Fix display issues when filtering the map view on mobs within + spawn points. + 2010-05-15 Andreas Kirschbaum * In game object attributes dialog, improve formatting of bitmask Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-16 09:37:09 UTC (rev 7792) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-16 09:48:43 UTC (rev 7793) @@ -505,47 +505,66 @@ return rec; } + /** + * Checks whether a {@link GameObject} is visible according to current + * editor settings. + * @param gameObject the game object + * @return whether the game object is visible + */ protected abstract boolean isGameObjectVisible(@NotNull final G gameObject); /** + * Paints a single {@link GameObject} if it is visible according to current + * editor settings. + * @param g the graphics to paint to + * @param xStart the x offset for painting + * @param yStart the y offset for painting + * @param gameObject the game object to paint + */ + protected void paintGameObjectIfVisible(@NotNull final Graphics2D g, final int xStart, final int yStart, @NotNull final G gameObject) { + final G head = gameObject.getHead(); + if (isGameObjectVisible(head)) { + paintGameObject(g, xStart, yStart, gameObject); + } + } + + /** * Paints a single {@link GameObject}. * @param g the graphics to paint to * @param xStart the x offset for painting * @param yStart the y offset for painting * @param gameObject the game object to paint */ - protected void paintGameObject(@NotNull final Graphics2D g, final int xStart, final int yStart, @NotNull final G gameObject) { + private void paintGameObject(@NotNull final Graphics2D g, final int xStart, final int yStart, @NotNull final G gameObject) { final G head = gameObject.getHead(); - if (isGameObjectVisible(head)) { - final Icon icon = "trans.101".equals(head.getFaceObjName()) ? unknownSquareIcon : head.getImage(mapViewSettings); - final int yOffset = icon.getIconHeight() - isoMapSquareInfo.getYlen(); - if (head.getMultiRefCount() > 0) { - // multipart images have to be painted with correct offset - // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. - final BaseObject<G, A, R, ?> tmpNode = gameObject.isMulti() ? gameObject : null; - if (tmpNode != null && tmpNode.isLowestPart() || head.isLowestPart()) { + final Icon icon = "trans.101".equals(head.getFaceObjName()) ? unknownSquareIcon : head.getImage(mapViewSettings); + final int yOffset = icon.getIconHeight() - isoMapSquareInfo.getYlen(); + if (head.getMultiRefCount() > 0) { + // multipart images have to be painted with correct offset + // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. + final BaseObject<G, A, R, ?> tmpNode = gameObject.isMulti() ? gameObject : null; + if (tmpNode != null && tmpNode.isLowestPart() || head.isLowestPart()) { + icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr())); + } else { + final BaseObject<G, A, R, ?> env = head.getContainerGameObject(); + if (env != null && isSpawnPoint(env)) { icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr())); - } else { - final BaseObject<G, A, R, ?> env = head.getContainerGameObject(); - if (env != null && isSpawnPoint(env)) { - icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr())); - } } - } else { - int xOffset = 0; - if (icon.getIconWidth() > isoMapSquareInfo.getXlen()) { - xOffset = (icon.getIconWidth() - isoMapSquareInfo.getXlen()) / 2; - } - icon.paintIcon(this, g, xStart - xOffset, yStart - yOffset); } - // Paint first object (most likely a mob) in spawn points. - if (isSpawnPoint(head)) { - final G mob = head.getFirst(); - if (mob != null) { - paintGameObject(g, xStart, yStart, mob); - } + } else { + int xOffset = 0; + if (icon.getIconWidth() > isoMapSquareInfo.getXlen()) { + xOffset = (icon.getIconWidth() - isoMapSquareInfo.getXlen()) / 2; } + icon.paintIcon(this, g, xStart - xOffset, yStart - yOffset); } + // Paint first object (most likely a mob) in spawn points. + if (isSpawnPoint(head)) { + final G mob = head.getFirst(); + if (mob != null) { + paintGameObject(g, xStart, yStart, mob); + } + } } /** Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-05-16 09:37:09 UTC (rev 7792) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-05-16 09:48:43 UTC (rev 7793) @@ -153,7 +153,7 @@ for (final G node : square) { filterControl.objectInSquare(filterState, node); if (filterControl.canShow(node) && isGameObjectVisible(node)) { - paintGameObject(g, x, y, node); + paintGameObjectIfVisible(g, x, y, node); } } } Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java 2010-05-16 09:37:09 UTC (rev 7792) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java 2010-05-16 09:48:43 UTC (rev 7793) @@ -80,7 +80,7 @@ @Override protected void paintSquare(@NotNull final Graphics2D grfx, final int x, final int y, @NotNull final MapSquare<G, A, R> square) { for (final G node : square) { - paintGameObject(grfx, x, y, node); + paintGameObjectIfVisible(grfx, x, y, node); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-16 09:59:01
|
Revision: 7795 http://gridarta.svn.sourceforge.net/gridarta/?rev=7795&view=rev Author: akirschbaum Date: 2010-05-16 09:58:55 +0000 (Sun, 16 May 2010) Log Message: ----------- Rename variable names. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-16 09:57:51 UTC (rev 7794) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-16 09:58:55 UTC (rev 7795) @@ -159,10 +159,10 @@ return; } - final Graphics grfx = backBuffer.getGraphics(); - paintSquare(grfx, borderOffset.x + point.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + point.y * IGUIConstants.SQUARE_HEIGHT, mapModel.getMapSquare(point)); - paintSquareGrid(grfx, point); - paintSquareSelection(grfx, point); + final Graphics g = backBuffer.getGraphics(); + paintSquare(g, borderOffset.x + point.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + point.y * IGUIConstants.SQUARE_HEIGHT, mapModel.getMapSquare(point)); + paintSquareGrid(g, point); + paintSquareSelection(g, point); } /** Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java 2010-05-16 09:57:51 UTC (rev 7794) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java 2010-05-16 09:58:55 UTC (rev 7795) @@ -69,18 +69,18 @@ * {@inheritDoc} */ @Override - protected void clearBackground(@NotNull final Graphics grfx) { - grfx.setColor(getBackground()); - grfx.fillRect(0, 0, getWidth(), getHeight()); + protected void clearBackground(@NotNull final Graphics g) { + g.setColor(getBackground()); + g.fillRect(0, 0, getWidth(), getHeight()); } /** * {@inheritDoc} */ @Override - protected void paintSquare(@NotNull final Graphics2D grfx, final int x, final int y, @NotNull final MapSquare<G, A, R> square) { + protected void paintSquare(@NotNull final Graphics2D g, final int x, final int y, @NotNull final MapSquare<G, A, R> square) { for (final G node : square) { - paintGameObjectIfVisible(grfx, x, y, node); + paintGameObjectIfVisible(g, x, y, node); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-16 11:25:30
|
Revision: 7802 http://gridarta.svn.sourceforge.net/gridarta/?rev=7802&view=rev Author: akirschbaum Date: 2010-05-16 11:25:23 +0000 (Sun, 16 May 2010) Log Message: ----------- Implement #2385942 (Alert message on exit from unique maps). Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapLocation.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties trunk/src/doc/ref/GameObjectMatcher.xhtml Added Paths: ----------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/validation/ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/validation/checks/ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/validation/checks/NonAbsoluteExitPathChecker.java trunk/src/app/net/sf/gridarta/validation/checks/NonAbsoluteExitPathError.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-16 10:26:09 UTC (rev 7801) +++ trunk/crossfire/ChangeLog 2010-05-16 11:25:23 UTC (rev 7802) @@ -1,5 +1,9 @@ 2010-05-16 Andreas Kirschbaum + Implement #2385942 (Alert message on exit from unique maps): add + new map validator "Exit path is not absolute" that checks for + exits within 'unique' maps that reference non-absolute map paths. + * Collect resources. 2010-05-14 Andreas Kirschbaum Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-05-16 10:26:09 UTC (rev 7801) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-05-16 11:25:23 UTC (rev 7802) @@ -125,6 +125,7 @@ import net.sf.gridarta.var.crossfire.model.settings.DefaultGlobalSettings; import net.sf.gridarta.var.crossfire.model.smoothface.SmoothFaces; import net.sf.gridarta.var.crossfire.resource.DefaultResources; +import net.sf.gridarta.var.crossfire.validation.checks.NonAbsoluteExitPathChecker; import net.sf.japi.swing.prefs.PreferencesGroup; import org.apache.log4j.Category; import org.apache.log4j.Logger; @@ -281,6 +282,10 @@ final UnsetSlayingChecker<GameObject, MapArchObject, Archetype> unsetSlayingChecker = new UnsetSlayingChecker<GameObject, MapArchObject, Archetype>(Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER); unsetSlayingChecker.addAllowedValue("player"); mapValidators.addValidators(attributeRangeChecker, new ConnectedInsideContainerChecker<GameObject, MapArchObject, Archetype>(), new ConnectedPickableChecker<GameObject, MapArchObject, Archetype>(), customTypeChecker, new ExitChecker<GameObject, MapArchObject, Archetype>(globalSettings, Archetype.TYPE_EXIT), new MapDifficultyChecker<GameObject, MapArchObject, Archetype>(), new TilePathsChecker<GameObject, MapArchObject, Archetype>(globalSettings, 4), new UndefinedFaceChecker<GameObject, MapArchObject, Archetype>(), new UndefinedArchetypeChecker<GameObject, MapArchObject, Archetype>(), unsetSlayingChecker); + final GameObjectMatcher exitMatcher = gameObjectMatchers.getMatcherWarn(errorViewCollector, "system_exit"); + if (exitMatcher != null) { + mapValidators.addValidator(new NonAbsoluteExitPathChecker(exitMatcher)); + } } /** Added: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/validation/checks/NonAbsoluteExitPathChecker.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/validation/checks/NonAbsoluteExitPathChecker.java (rev 0) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/validation/checks/NonAbsoluteExitPathChecker.java 2010-05-16 11:25:23 UTC (rev 7802) @@ -0,0 +1,92 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.var.crossfire.validation.checks; + +import net.sf.gridarta.gui.map.mapactions.MapLocation; +import net.sf.gridarta.gui.map.mapactions.NoExitPathException; +import net.sf.gridarta.model.map.mapmodel.MapModel; +import net.sf.gridarta.model.map.mapmodel.MapSquare; +import net.sf.gridarta.model.map.validation.ErrorCollector; +import net.sf.gridarta.model.match.GameObjectMatcher; +import net.sf.gridarta.validation.AbstractValidator; +import net.sf.gridarta.validation.GameObjectValidator; +import net.sf.gridarta.validation.MapValidator; +import net.sf.gridarta.validation.checks.NonAbsoluteExitPathError; +import net.sf.gridarta.var.crossfire.model.archetype.Archetype; +import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; +import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link MapValidator} that checks for relative exit paths within unique + * maps. Such paths do not work reliably in Crossfire and Atrinik. + * @author Andreas Kirschbaum + */ +public class NonAbsoluteExitPathChecker extends AbstractValidator implements GameObjectValidator<GameObject, MapArchObject, Archetype> { + + /** + * The {@link GameObjectMatcher} for matching exit objects. + */ + @NotNull + private final GameObjectMatcher exitGameObjectMatcher; + + /** + * Creates a new instance. + * @param exitGameObjectMatcher the game object matcher for matching exit + * objects + */ + public NonAbsoluteExitPathChecker(@NotNull final GameObjectMatcher exitGameObjectMatcher) { + this.exitGameObjectMatcher = exitGameObjectMatcher; + } + + /** + * {@inheritDoc} + */ + @Override + public void validateGameObject(@NotNull final GameObject gameObject, @NotNull final ErrorCollector<GameObject, MapArchObject, Archetype> errorCollector) { + if (!exitGameObjectMatcher.isMatching(gameObject)) { + return; // not an exit => skip + } + + final MapSquare<GameObject, MapArchObject, Archetype> mapSquare = gameObject.getMapSquare(); + if (mapSquare == null) { + return; // not on a map => skip + } + + final MapModel<GameObject, MapArchObject, Archetype> mapModel = mapSquare.getMapModel(); + final MapArchObject mapArchObject = mapModel.getMapArchObject(); + if (!mapArchObject.isUnique()) { + return; // not o a unique map => skip + } + + final String exitPath; + try { + exitPath = MapLocation.getMapPath(gameObject, true); + } catch (final NoExitPathException ignored) { + return; // unset exit path => skip + } + if (exitPath.isEmpty() || exitPath.startsWith("/")) { + return; // unset exit path or absolute exit path => ok + } + + errorCollector.collect(new NonAbsoluteExitPathError<GameObject, MapArchObject, Archetype>(gameObject, exitPath)); + } + +} // class NonAbsoluteExitPathChecker Property changes on: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/validation/checks/NonAbsoluteExitPathChecker.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapLocation.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapLocation.java 2010-05-16 10:26:09 UTC (rev 7801) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapLocation.java 2010-05-16 11:25:23 UTC (rev 7802) @@ -122,7 +122,7 @@ * @return the exit map path * @throws NoExitPathException if the game object is not a valid exit */ - private static String getMapPath(@NotNull final BaseObject<?, ?, ?, ?> gameObject, final boolean allowRandomMapParameters) throws NoExitPathException { + public static String getMapPath(@NotNull final BaseObject<?, ?, ?, ?> gameObject, final boolean allowRandomMapParameters) throws NoExitPathException { String path = gameObject.getAttributeString("slaying"); if (allowRandomMapParameters && path.equals("/!")) { // destination is a random map; extract the final non-random map Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-05-16 10:26:09 UTC (rev 7801) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-05-16 11:25:23 UTC (rev 7802) @@ -946,6 +946,7 @@ prefs.Validator.Exit=Whether this map validator check is is enabled. prefs.Validator.MapDifficulty=Whether this map validator check is is enabled. prefs.Validator.MobOutsideSpawnPoint=Whether this map validator check is is enabled. +prefs.Validator.NonAbsoluteExitPath=Whether this map validator check is is enabled. prefs.Validator.PaidItemShopSquare=Whether this map validator check is is enabled. prefs.Validator.ShopSquare=Whether this map validator check is is enabled. prefs.Validator.Slaying=Whether this map validator check is is enabled. @@ -1111,6 +1112,10 @@ Validator.MobOutsideSpawnPoint.title=Mob outside spawn point Validator.MobOutsideSpawnPoint.msg=<html><h3>{0}</h3><p>On this square there is a mob outside a spawn point.<br>Mobs outside spawn points are okay, but you should perhaps still put the mob inside a spawn point.</p><p>You could:</p><ul><li>Ignore this</li><li>Create a spawn point for this mob</li></ul> +Validator.NonAbsoluteExitPath.default=true +Validator.NonAbsoluteExitPath.title=Exit path is not absolute +Validator.NonAbsoluteExitPath.msg=<html><h3>{0}</h3><p><p>On this square there is an exit which defines an exit path to ''{4}'' that is not absolute.</p><p>Within <em>unique</em> maps exit paths must be absolute (that is, starting with a / character) as relative paths cannot be handled by the server.</p> + Validator.PaidItemShopSquare.default=true Validator.PaidItemShopSquare.title=Shop square contains paid item Validator.PaidItemShopSquare.msg=<html><h3>{0}</h3><p>On this square there is a shop square which contains a paid item. Usually items on shop squares should be unpaid by default. Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-05-16 10:26:09 UTC (rev 7801) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-05-16 11:25:23 UTC (rev 7802) @@ -953,6 +953,9 @@ Validator.MobOutsideSpawnPoint.title=Mob au\xDFerhalb Spawn Point Validator.MobOutsideSpawnPoint.msg=<html><h3>{0}</h3><p>Dieses Feld beinhaltete einen Mob au\xDFerhalb eines Spawn Points.<br>Dies ist erlaubt, aber Sie sollten den Mobs trotzdem in einen Spawn Point einf\xFCgen.</p><p>Sie k\xF6nnen:</p><ul><li>Dieses Problem ignorieren</li><li>Einen Spawn Point f\xFCr diesen Mob erzeugen</li></ul> +Validator.NonAbsoluteExitPath.title=Kartenpfad ist nicht absolut +Validator.NonAbsoluteExitPath.msg=<html><h3>{0}</h3><p>Dieses Feld enth\xE4lt einen Ausgang, der auf den Kartenpfad ''{4}'' zeigt. Diese Pfad ist nicht absolut (d.h. er beginnt nicht mit /).</p><p>In Karten, die als ''<em>unique</em>'' gekennzeichnet sind, d\xFCrfen nur absolute Kartenpfade verwendet werden; relative Kartenpfade werden vom Server nicht unterst\xFCtzt.</p> + Validator.PaidItemShopSquare.title=Gesch\xE4ftsfl\xE4che mit bezahltem Gegenstand Validator.PaidItemShopSquare.msg=<html><h3>{0}</h3><p>Dieses Feld ist eine Gesch\xE4ftsfl\xE4che und enth\xE4lt einen bereits bezahlten Gegenstand. In der Regel sollten diese Gegenst\xE4nde unbezahlt sein. Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-05-16 10:26:09 UTC (rev 7801) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-05-16 11:25:23 UTC (rev 7802) @@ -946,6 +946,9 @@ #Validator.MobOutsideSpawnPoint.title= #Validator.MobOutsideSpawnPoint.msg= +#Validator.NonAbsoluteExitPath.title= +#Validator.NonAbsoluteExitPath.msg= + #Validator.PaidItemShopSquare.title= #Validator.PaidItemShopSquare.msg= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-05-16 10:26:09 UTC (rev 7801) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-05-16 11:25:23 UTC (rev 7802) @@ -950,6 +950,9 @@ #Validator.MapDifficulty.title= #Validator.MapDifficulty.msg= +#Validator.NonAbsoluteExitPath.title= +#Validator.NonAbsoluteExitPath.msg= + #Validator.PaidItemShopSquare.title= #Validator.PaidItemShopSquare.msg= Added: trunk/src/app/net/sf/gridarta/validation/checks/NonAbsoluteExitPathError.java =================================================================== --- trunk/src/app/net/sf/gridarta/validation/checks/NonAbsoluteExitPathError.java (rev 0) +++ trunk/src/app/net/sf/gridarta/validation/checks/NonAbsoluteExitPathError.java 2010-05-16 11:25:23 UTC (rev 7802) @@ -0,0 +1,72 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.validation.checks; + +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.model.map.validation.errors.GameObjectValidationError; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * A {@link GameObjectValidationError} that describes an exit {@link GameObject} + * having an invalid exit path. + * @author Andreas Kirschbaum + */ +public class NonAbsoluteExitPathError<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends GameObjectValidationError<G, A, R> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The incorrect exit path. + */ + @NotNull + private final String exitPath; + + /** + * Creates a new instance. + * @param gameObject the game object having an incorrect exit path + * @param exitPath the incorrect exit path + */ + public NonAbsoluteExitPathError(@NotNull final G gameObject, @NotNull final String exitPath) { + super(gameObject); + this.exitPath = exitPath; + } + + /** + * {@inheritDoc} + */ + @Nullable + @Override + public String getParameter(final int id) { + switch (id) { + case 0: + return exitPath; + + default: + return super.getParameter(id); + } + } + +} // class NonAbsoluteExitPathError Property changes on: trunk/src/app/net/sf/gridarta/validation/checks/NonAbsoluteExitPathError.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/doc/ref/GameObjectMatcher.xhtml =================================================================== --- trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-05-16 10:26:09 UTC (rev 7801) +++ trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-05-16 11:25:23 UTC (rev 7802) @@ -91,6 +91,11 @@ 'system_monster'; no check is performed if the matcher does not exist. </li> + <li>Checks objects matching the 'system_exit' matcher for + "slaying" values which are not absolute + paths; no check is performed if the matcher does not + exist. + </li> </ul> </li> </ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-16 15:30:28
|
Revision: 7803 http://gridarta.svn.sourceforge.net/gridarta/?rev=7803&view=rev Author: akirschbaum Date: 2010-05-16 15:30:22 +0000 (Sun, 16 May 2010) Log Message: ----------- Add tip of the day for CTRL-ALT-E. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod.properties trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod_de.properties trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod.properties trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod_de.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod_de.properties Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod.properties 2010-05-16 11:25:23 UTC (rev 7802) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod.properties 2010-05-16 15:30:22 UTC (rev 7803) @@ -55,3 +55,4 @@ tod.text.31=<html>You should stick to the default map size (24\xD724).<br>That map size is also best for the server. tod.text.32=<html>Beware when editing large maps. You might run out of memory.<br>Be sure to increase the heap size (-Xmx parameter) of Gridarta''s Virtual Machine when editing large maps (e.g. 240\xD7240). tod.text.33=<html>It''s amazing how much archetypes you could find using "Search archetype".<p>Menu: <code>Archetypes -> Find archetype</code>. +tod.text.34=<html>You can quickly switch to the game object text editor with <code>CTRl-ALT-E</code>. Press these keys again to close it. Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod_de.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod_de.properties 2010-05-16 11:25:23 UTC (rev 7802) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod_de.properties 2010-05-16 15:30:22 UTC (rev 7803) @@ -51,3 +51,4 @@ #tod.text.31= tod.text.32=<html>Vorsicht beim Bearbeiten von gro\xDFen Karten: der Platz im Hauptspeicher k\xF6nnte nicht ausreichen.<br>Vergr\xF6\xDFern Sie die "heap size" (Parameter -Xmx beim Aufruf von java) von Gridarta, wenn Sie gro\xDFe Karten (bspw. 240\xD7240) bearbeiten m\xF6chten. tod.text.33=<html>Es ist verbl\xFCffend, wie viele Archetypen man mit "Archetypen finden" entdecken kann.<p>Men\xFC: <code>Archetypen -> Archetypen finden</code>. +tod.text.34=<html>Sie k\xF6nnen den Objekt-Editor \xFCber die Tastenkombination <code>CTRl-ALT-E</code> \xF6ffnen. Dieselbe Tastenkombination schlie\xDFt ihn wieder. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod.properties 2010-05-16 11:25:23 UTC (rev 7802) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod.properties 2010-05-16 15:30:22 UTC (rev 7803) @@ -36,3 +36,4 @@ tod.text.12=<html>To attach a map to other maps, you must save it first. tod.text.13=<html>Beware when editing large maps. You might run out of memory.<br>Be sure to increase the heap size (-Xmx parameter) of Gridarta''s Virtual Machine when editing large maps (e.g. 240\xD7240). tod.text.14=<html>It''s amazing how much archetypes you could find using "Search archetype".<p>Menu: <code>Archetypes -> Find archetype</code>. +tod.text.15=<html>You can quickly switch to the game object text editor with <code>CTRl-ALT-E</code>. Press these keys again to close it. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod_de.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod_de.properties 2010-05-16 11:25:23 UTC (rev 7802) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod_de.properties 2010-05-16 15:30:22 UTC (rev 7803) @@ -36,3 +36,4 @@ tod.text.12=<html>Um eine Karte mit anderen Karten zu verbinden m\xFCssen Sie diese zuerst sichern. tod.text.13=<html>Vorsicht beim Bearbeiten von gro\xDFen Karten: der Platz im Hauptspeicher k\xF6nnte nicht ausreichen.<br>Vergr\xF6\xDFern Sie die "heap size" (Parameter -Xmx beim Aufruf von java) von Gridarta, wenn Sie gro\xDFe Karten (bspw. 240\xD7240) bearbeiten m\xF6chten. tod.text.14=<html>Es ist verbl\xFCffend, wie viele Archetypen man mit "Archetypen finden" entdecken kann.<p>Men\xFC: <code>Archetypen -> Archetypen finden</code>. +tod.text.15=<html>Sie k\xF6nnen den Objekt-Editor \xFCber die Tastenkombination <code>CTRl-ALT-E</code> \xF6ffnen. Dieselbe Tastenkombination schlie\xDFt ihn wieder. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod.properties 2010-05-16 11:25:23 UTC (rev 7802) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod.properties 2010-05-16 15:30:22 UTC (rev 7803) @@ -55,3 +55,4 @@ tod.text.31=<html>You should stick to the default map size (24\xD724).<br>That map size is also best for the server. tod.text.32=<html>Beware when editing large maps. You might run out of memory.<br>Be sure to increase the heap size (-Xmx parameter) of Gridarta''s Virtual Machine when editing large maps (e.g. 240\xD7240). tod.text.33=<html>It''s amazing how much archetypes you could find using "Search archetype".<p>Menu: <code>Archetypes -> Find archetype</code>. +tod.text.34=<html>You can quickly switch to the game object text editor with <code>CTRl-ALT-E</code>. Press these keys again to close it. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod_de.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod_de.properties 2010-05-16 11:25:23 UTC (rev 7802) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod_de.properties 2010-05-16 15:30:22 UTC (rev 7803) @@ -51,3 +51,4 @@ #tod.text.31= tod.text.32=<html>Vorsicht beim Bearbeiten von gro\xDFen Karten: der Platz im Hauptspeicher k\xF6nnte nicht ausreichen.<br>Vergr\xF6\xDFern Sie die "heap size" (Parameter -Xmx beim Aufruf von java) von Gridarta, wenn Sie gro\xDFe Karten (bspw. 240\xD7240) bearbeiten m\xF6chten. tod.text.33=<html>Es ist verbl\xFCffend, wie viele Archetypen man mit "Archetypen finden" entdecken kann.<p>Men\xFC: <code>Archetypen -> Archetypen finden</code>. +tod.text.34=<html>Sie k\xF6nnen den Objekt-Editor \xFCber die Tastenkombination <code>CTRl-ALT-E</code> \xF6ffnen. Dieselbe Tastenkombination schlie\xDFt ihn wieder. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |