You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <aki...@us...> - 2011-03-08 19:41:44
|
Revision: 8860 http://gridarta.svn.sourceforge.net/gridarta/?rev=8860&view=rev Author: akirschbaum Date: 2011-03-08 19:41:37 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Remove temporary variables. Modified Paths: -------------- trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java trunk/model/src/test/net/sf/gridarta/validation/ValidationUtils.java trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java trunk/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java Modified: trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java 2011-03-08 19:35:50 UTC (rev 8859) +++ trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java 2011-03-08 19:41:37 UTC (rev 8860) @@ -492,8 +492,7 @@ private FaceObjectProviders newFaceObjectProviders() { final FaceObjects<TestGameObject, TestMapArchObject, TestArchetype> faceObjects = new TestFaceObjects(); assert systemIcons != null; - final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); - return faceObjectProviders; + return new FaceObjectProviders(0, faceObjects, systemIcons); } /** Modified: trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java 2011-03-08 19:35:50 UTC (rev 8859) +++ trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java 2011-03-08 19:41:37 UTC (rev 8860) @@ -176,8 +176,7 @@ final TestMapArchObject mapArchObject = mapArchObjectFactory.newMapArchObject(false); mapArchObject.setMapSize(mapSize); mapArchObject.setMapName(mapName); - final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl = mapManager.newMap(null, mapArchObject, mapFile, true); - return mapControl; + return mapManager.newMap(null, mapArchObject, mapFile, true); } /** Modified: trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java 2011-03-08 19:35:50 UTC (rev 8859) +++ trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java 2011-03-08 19:41:37 UTC (rev 8860) @@ -165,8 +165,7 @@ private FaceObjectProviders newFaceObjectProviders() { final FaceObjects<TestGameObject, TestMapArchObject, TestArchetype> faceObjects = new TestFaceObjects(); assert systemIcons != null; - final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); - return faceObjectProviders; + return new FaceObjectProviders(0, faceObjects, systemIcons); } /** Modified: trunk/model/src/test/net/sf/gridarta/validation/ValidationUtils.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/validation/ValidationUtils.java 2011-03-08 19:35:50 UTC (rev 8859) +++ trunk/model/src/test/net/sf/gridarta/validation/ValidationUtils.java 2011-03-08 19:41:37 UTC (rev 8860) @@ -63,8 +63,7 @@ final MapArchObjectParserFactory<TestMapArchObject> mapArchObjectParserFactory = new TestMapArchObjectParserFactory(); final MapWriter<TestGameObject, TestMapArchObject, TestArchetype> mapWriter = new DefaultMapWriter<TestGameObject, TestMapArchObject, TestArchetype>(mapArchObjectParserFactory, gameObjectParser); final GlobalSettings globalSettings = new TestGlobalSettings(); - final ValidatorFactory<TestGameObject, TestMapArchObject, TestArchetype> validatorFactory = new ValidatorFactory<TestGameObject, TestMapArchObject, TestArchetype>(validatorPreferences, gameObjectMatchers, globalSettings, mapWriter); - return validatorFactory; + return new ValidatorFactory<TestGameObject, TestMapArchObject, TestArchetype>(validatorPreferences, gameObjectMatchers, globalSettings, mapWriter); } } // class ValidationUtils Modified: trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java =================================================================== --- trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java 2011-03-08 19:35:50 UTC (rev 8859) +++ trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java 2011-03-08 19:41:37 UTC (rev 8860) @@ -140,12 +140,11 @@ private void loadAdjacentMaps(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Collection<MapControl<G, A, R>> mapControls, @NotNull final String[] tilePaths) throws CannotLoadMapFileException { for (@Nullable final String tilePath : tilePaths) { @Nullable final MapControl<G, A, R> mapControl; - final String path = tilePath; - if (path != null && path.length() != 0) { + if (tilePath != null && tilePath.length() != 0) { try { - mapControl = loadMapControl(mapModel, path); + mapControl = loadMapControl(mapModel, tilePath); } catch (final IOException ex) { - throw new CannotLoadMapFileException(path, ex); + throw new CannotLoadMapFileException(tilePath, ex); } } else { mapControl = null; Modified: trunk/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java 2011-03-08 19:35:50 UTC (rev 8859) +++ trunk/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java 2011-03-08 19:41:37 UTC (rev 8860) @@ -186,8 +186,8 @@ * @return the <code>JComboBox</code> for selecting the proxy type */ private static JComboBox createProxyType() { - final JComboBox proxyType = new JComboBox(EnumSet.allOf(Proxy.Type.class).toArray()); - return proxyType; + + return new JComboBox(EnumSet.allOf(Proxy.Type.class).toArray()); } /** Modified: trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java 2011-03-08 19:35:50 UTC (rev 8859) +++ trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java 2011-03-08 19:41:37 UTC (rev 8860) @@ -62,8 +62,7 @@ @NotNull public static MapView<TestGameObject, TestMapArchObject, TestArchetype> newMapView(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl) { final MapViewBasic<TestGameObject, TestMapArchObject, TestArchetype> mapViewBasic = new TestMapViewBasic(mapControl.getMapModel()); - final MapView<TestGameObject, TestMapArchObject, TestArchetype> mapView = new TestMapView(mapControl, mapViewBasic); - return mapView; + return new TestMapView(mapControl, mapViewBasic); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-03-08 19:35:57
|
Revision: 8859 http://gridarta.svn.sourceforge.net/gridarta/?rev=8859&view=rev Author: akirschbaum Date: 2011-03-08 19:35:50 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Simplify expressions. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java Modified: trunk/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java 2011-03-08 19:33:17 UTC (rev 8858) +++ trunk/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java 2011-03-08 19:35:50 UTC (rev 8859) @@ -297,7 +297,7 @@ */ @Override public boolean isMatching(@NotNull final G gameObject) { - return activeTab == null ? false : activeTab.isMatching(gameObject); + return activeTab != null && activeTab.isMatching(gameObject); } /** Modified: trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java 2011-03-08 19:33:17 UTC (rev 8858) +++ trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java 2011-03-08 19:35:50 UTC (rev 8859) @@ -44,7 +44,7 @@ */ public static boolean getBoolean(@NotNull final ActionBuilder actionBuilder, @NotNull final String key) { final String value = actionBuilder.getString(key); - return value == null ? false : Boolean.parseBoolean(value); + return value != null && Boolean.parseBoolean(value); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-03-08 19:33:24
|
Revision: 8858 http://gridarta.svn.sourceforge.net/gridarta/?rev=8858&view=rev Author: akirschbaum Date: 2011-03-08 19:33:17 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Fix pointless Javadoc links. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/SavedSquares.java trunk/model/src/app/net/sf/gridarta/model/match/NotGameObjectMatcher.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2011-03-08 19:31:19 UTC (rev 8857) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2011-03-08 19:33:17 UTC (rev 8858) @@ -197,7 +197,7 @@ void insertAfter(@NotNull G node); /** - * Returns the environment {@link GameObject} if this game object is in the + * Returns the environment game object if this game object is in the * inventory or <code>null</code>. * @return the game object this game object is part of or <code>null</code> */ Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/SavedSquares.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/SavedSquares.java 2011-03-08 19:31:19 UTC (rev 8857) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/SavedSquares.java 2011-03-08 19:33:17 UTC (rev 8858) @@ -158,8 +158,8 @@ } /** - * Creates a new {@link SavedSquares} instance having the same contents as - * this instance, then forgets all saves squares in this instance. + * Creates a new instance having the same contents as this instance, then + * forgets all saves squares in this instance. * @return the new instance */ @NotNull Modified: trunk/model/src/app/net/sf/gridarta/model/match/NotGameObjectMatcher.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/NotGameObjectMatcher.java 2011-03-08 19:31:19 UTC (rev 8857) +++ trunk/model/src/app/net/sf/gridarta/model/match/NotGameObjectMatcher.java 2011-03-08 19:33:17 UTC (rev 8858) @@ -41,7 +41,7 @@ private final GameObjectMatcher gameObjectMatcher; /** - * Create a {@link NotGameObjectMatcher}. + * Creates a new instance. * @param gameObjectMatcher the matcher to negate */ public NotGameObjectMatcher(@NotNull final GameObjectMatcher gameObjectMatcher) { Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2011-03-08 19:31:19 UTC (rev 8857) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2011-03-08 19:33:17 UTC (rev 8858) @@ -255,7 +255,7 @@ } /** - * Returns the {@link MapViewsManager} instance for a {@link MapControl}. + * Returns the {@link MapViews} instance for a {@link MapControl}. * @param mapControl the map control * @return the map views */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-03-08 19:31:25
|
Revision: 8857 http://gridarta.svn.sourceforge.net/gridarta/?rev=8857&view=rev Author: akirschbaum Date: 2011-03-08 19:31:19 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Remove static qualifiers. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java trunk/model/src/app/net/sf/gridarta/model/filter/FilterParser.java trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java 2011-03-08 19:29:55 UTC (rev 8856) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java 2011-03-08 19:31:19 UTC (rev 8857) @@ -21,6 +21,7 @@ import java.util.LinkedHashMap; import java.util.Map; +import java.util.Map.Entry; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.errorview.ErrorViewCollector; @@ -147,7 +148,7 @@ sb.append(attribute).append('\n'); } } - for (final Map.Entry<String, String> attribute : attributes.entrySet()) { + for (final Entry<String, String> attribute : attributes.entrySet()) { sb.append(attribute.getKey()).append(' ').append(attribute.getValue()).append('\n'); } result.setObjectText(sb.toString()); Modified: trunk/model/src/app/net/sf/gridarta/model/filter/FilterParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/filter/FilterParser.java 2011-03-08 19:29:55 UTC (rev 8856) +++ trunk/model/src/app/net/sf/gridarta/model/filter/FilterParser.java 2011-03-08 19:31:19 UTC (rev 8857) @@ -19,7 +19,7 @@ package net.sf.gridarta.model.filter; -import java.util.Map; +import java.util.Map.Entry; import org.jdom.Content; import org.jdom.Element; import org.jetbrains.annotations.NotNull; @@ -54,7 +54,7 @@ final Element inverted = new Element("inverted"); inverted.addContent(Boolean.toString(filterConfig.isInverted())); result.addContent(inverted); - for (final Map.Entry<String, FilterConfig<?, ?>> entry : filterConfig.getEntries().entrySet()) { + for (final Entry<String, FilterConfig<?, ?>> entry : filterConfig.getEntries().entrySet()) { final String key = entry.getKey(); final FilterConfig<?, ?> subFilterConfig = entry.getValue(); final Content filterValue = toXML(subFilterConfig); Modified: trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java 2011-03-08 19:29:55 UTC (rev 8856) +++ trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java 2011-03-08 19:31:19 UTC (rev 8857) @@ -29,6 +29,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import net.sf.gridarta.utils.EventListenerList2; import org.jetbrains.annotations.NotNull; @@ -111,7 +112,7 @@ synchronized (sync) { final String nameLowerCase = name.toLowerCase(); final Collection<V> result = new HashSet<V>(); - for (final Map.Entry<V, String> e : names.entrySet()) { + for (final Entry<V, String> e : names.entrySet()) { if (e.getValue().toLowerCase().contains(nameLowerCase)) { result.add(e.getKey()); } Modified: trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2011-03-08 19:29:55 UTC (rev 8856) +++ trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2011-03-08 19:31:19 UTC (rev 8857) @@ -25,6 +25,7 @@ import java.util.Collection; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.regex.Pattern; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeSet; @@ -215,7 +216,7 @@ appendable.append("arch "); appendable.append(gameObject.getArchetype().getArchetypeName()); appendable.append("\n"); - for (final Map.Entry<String, String> entry : fields.entrySet()) { + for (final Entry<String, String> entry : fields.entrySet()) { appendable.append(entry.getKey()); appendable.append(entry.getValue()); appendable.append("\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-03-08 19:30:02
|
Revision: 8856 http://gridarta.svn.sourceforge.net/gridarta/?rev=8856&view=rev Author: akirschbaum Date: 2011-03-08 19:29:55 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Add final modifiers. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java trunk/src/app/net/sf/gridarta/gui/gomapdialog/GoMapDialog.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenu.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java Modified: trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java 2011-03-08 19:26:41 UTC (rev 8855) +++ trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java 2011-03-08 19:29:55 UTC (rev 8856) @@ -59,21 +59,21 @@ * @serial */ @NotNull - private Map<V, Long> timestamps = new HashMap<V, Long>(); + private final Map<V, Long> timestamps = new HashMap<V, Long>(); /** * Maps value to name. * @serial */ @NotNull - private Map<V, String> names = new HashMap<V, String>(); + private final Map<V, String> names = new HashMap<V, String>(); /** * Pending values. * @serial */ @NotNull - private Set<V> pending = new HashSet<V>(); + private final Set<V> pending = new HashSet<V>(); /** * Whether the state ({@link #timestamps} or {@link #names}) was modified Modified: trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java 2011-03-08 19:26:41 UTC (rev 8855) +++ trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java 2011-03-08 19:29:55 UTC (rev 8856) @@ -66,14 +66,14 @@ */ // TODO: use this field (it looks unused but usage is planned) @Nullable - private ViewGameObjectMatcherManager transparencyManager = null; + private final ViewGameObjectMatcherManager transparencyManager = null; /** * The visibility settings. */ // TODO: use this field (it looks unused but usage is planned) @Nullable - private ViewGameObjectMatcherManager visibilityManager = null; + private final ViewGameObjectMatcherManager visibilityManager = null; /** * The MapViewSettingsListeners to inform of changes. Modified: trunk/src/app/net/sf/gridarta/gui/gomapdialog/GoMapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gomapdialog/GoMapDialog.java 2011-03-08 19:26:41 UTC (rev 8855) +++ trunk/src/app/net/sf/gridarta/gui/gomapdialog/GoMapDialog.java 2011-03-08 19:29:55 UTC (rev 8856) @@ -240,7 +240,7 @@ * #mapsIndex} changes. */ @NotNull - private DelayedChangeManager delayedChangeManager = new DelayedChangeManager(100, 1000, new DelayedChangeListener() { + private final DelayedChangeManager delayedChangeManager = new DelayedChangeManager(100, 1000, new DelayedChangeListener() { @Override public void change() { Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenu.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenu.java 2011-03-08 19:26:41 UTC (rev 8855) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenu.java 2011-03-08 19:29:55 UTC (rev 8856) @@ -56,7 +56,7 @@ * The root node of {@link #treeModel}. */ @NotNull - private DefaultMutableTreeNode root = new DefaultMutableTreeNode(new MapMenuEntryDir("Bookmarks"), true); + private final DefaultMutableTreeNode root = new DefaultMutableTreeNode(new MapMenuEntryDir("Bookmarks"), true); /** * The {@link DefaultTreeModel} that contains all menu entries. Modified: trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java =================================================================== --- trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java 2011-03-08 19:26:41 UTC (rev 8855) +++ trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java 2011-03-08 19:29:55 UTC (rev 8856) @@ -66,7 +66,7 @@ * Whether the caret should be wide even in insert mode. * @serial */ - private boolean blockCaret; + private final boolean blockCaret; /** * The syntax styles used to paint colorized text. @@ -89,37 +89,37 @@ * The caret color. * @serial */ - private Color caretColor; + private final Color caretColor; /** * The selection color. * @serial */ - private Color selectionColor; + private final Color selectionColor; /** * The color for line highlighting. * @serial */ - private Color lineHighlightColor; + private final Color lineHighlightColor; /** * Whether line highlighting is enabled. * @serial */ - private boolean lineHighlight; + private final boolean lineHighlight; /** * The color for bracket highlighting. * @serial */ - private Color bracketHighlightColor; + private final Color bracketHighlightColor; /** * Whether bracket highlighting is enabled. * @serial */ - private boolean bracketHighlight; + private final boolean bracketHighlight; /** * Whether invalid lines should be painted as red tildes. @@ -132,13 +132,13 @@ * @serial */ @NotNull - private Color eolMarkerColor; + private final Color eolMarkerColor; /** * Whether end of line markers should be painted. * @serial */ - private boolean eolMarkers; + private final boolean eolMarkers; /** * The currently painted line. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-03-08 19:26:47
|
Revision: 8855 http://gridarta.svn.sourceforge.net/gridarta/?rev=8855&view=rev Author: akirschbaum Date: 2011-03-08 19:26:41 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Replace array creation expression with array initializer. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapCheckerScriptChecker.java Modified: trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapCheckerScriptChecker.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapCheckerScriptChecker.java 2011-03-08 19:24:23 UTC (rev 8854) +++ trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapCheckerScriptChecker.java 2011-03-08 19:26:41 UTC (rev 8855) @@ -269,7 +269,7 @@ */ private boolean waitForTermination(@NotNull final Process process, @NotNull final ErrorCollector<G, A, R> errorCollector, @NotNull final MapModel<G, A, R> mapModel, @NotNull final String command, @NotNull final CopyReader stdout, @NotNull final CopyReader stderr) { final Semaphore sem = new Semaphore(0); - final int[] tmp = new int[] { -1, }; + final int[] tmp = { -1, }; final Runnable runnable = new Runnable() { @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-03-08 19:24:30
|
Revision: 8854 http://gridarta.svn.sourceforge.net/gridarta/?rev=8854&view=rev Author: akirschbaum Date: 2011-03-08 19:24:23 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Weaken types. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDragSource.java trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDropTarget.java trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDragSource.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDragSource.java 2011-03-08 19:12:05 UTC (rev 8853) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDragSource.java 2011-03-08 19:24:23 UTC (rev 8854) @@ -29,7 +29,6 @@ import java.awt.dnd.DragSourceEvent; import java.awt.dnd.DragSourceListener; import javax.swing.JTree; -import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.MutableTreeNode; import javax.swing.tree.TreePath; @@ -139,7 +138,7 @@ return; } - draggedTreeNode = (DefaultMutableTreeNode) selectionPath.getLastPathComponent(); + draggedTreeNode = (MutableTreeNode) selectionPath.getLastPathComponent(); final Cursor cursor; switch (dge.getDragAction()) { case DnDConstants.ACTION_COPY: Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDropTarget.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDropTarget.java 2011-03-08 19:12:05 UTC (rev 8853) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDropTarget.java 2011-03-08 19:24:23 UTC (rev 8854) @@ -33,7 +33,6 @@ import java.awt.dnd.DropTargetListener; import java.io.IOException; import javax.swing.JTree; -import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.MutableTreeNode; import javax.swing.tree.TreePath; @@ -94,7 +93,7 @@ final DropTargetContext dropTargetContext = dtde.getDropTargetContext(); final JTree tree = (JTree) dropTargetContext.getComponent(); final TreePath parentTreePath = tree.getClosestPathForLocation(location.x, location.y); - final MutableTreeNode parentTreeNode = (DefaultMutableTreeNode) parentTreePath.getLastPathComponent(); + final MutableTreeNode parentTreeNode = (MutableTreeNode) parentTreePath.getLastPathComponent(); final int dropAction = dtde.getDropAction(); if (dropAction != DnDConstants.ACTION_COPY && dropAction != DnDConstants.ACTION_MOVE) { @@ -111,7 +110,7 @@ final Rectangle parentRectangle = tree.getPathBounds(parentTreePath); final int relativeY = location.y - parentRectangle.y; final TreePath treePath = (TreePath) transferable.getTransferData(flavor); - final MutableTreeNode draggedTreeNode = (DefaultMutableTreeNode) treePath.getLastPathComponent(); + final MutableTreeNode draggedTreeNode = (MutableTreeNode) treePath.getLastPathComponent(); final DefaultTreeModel treeModel = (DefaultTreeModel) tree.getModel(); final MutableTreeNode parent; final int index; Modified: trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java 2011-03-08 19:12:05 UTC (rev 8853) +++ trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java 2011-03-08 19:24:23 UTC (rev 8854) @@ -20,8 +20,8 @@ package net.sf.gridarta.gui.misc; import java.io.File; -import net.sf.gridarta.gui.mapmenu.AbstractMapMenuPreferences; import net.sf.gridarta.gui.mapmenu.MapMenuEntryMap; +import net.sf.gridarta.gui.mapmenu.MapMenuPreferences; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; @@ -43,7 +43,7 @@ * @param mapManager the map manager to track for opened maps * @param mapMenuPreferences the map menu preferences to use */ - public RecentManager(@NotNull final MapManager<G, A, R> mapManager, @NotNull final AbstractMapMenuPreferences mapMenuPreferences) { + public RecentManager(@NotNull final MapManager<G, A, R> mapManager, @NotNull final MapMenuPreferences mapMenuPreferences) { final MapManagerListener<G, A, R> mapManagerListener = new MapManagerListener<G, A, R>() { /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2011-03-08 19:12:05 UTC (rev 8853) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2011-03-08 19:24:23 UTC (rev 8854) @@ -79,10 +79,10 @@ import net.sf.gridarta.gui.mapfiles.MapFolderTree; import net.sf.gridarta.gui.mapfiles.MapFolderTreeActions; import net.sf.gridarta.gui.mapimagecache.MapImageCache; -import net.sf.gridarta.gui.mapmenu.AbstractMapMenuPreferences; import net.sf.gridarta.gui.mapmenu.BookmarksMapMenuPreferences; import net.sf.gridarta.gui.mapmenu.MapMenu; import net.sf.gridarta.gui.mapmenu.MapMenuManager; +import net.sf.gridarta.gui.mapmenu.MapMenuPreferences; import net.sf.gridarta.gui.mapmenu.RecentMapMenuPreferences; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; import net.sf.gridarta.gui.mapuserlistener.MapUserListenerManager; @@ -600,7 +600,7 @@ globalSettings.setAutoPopupDocumentation(false); } - final AbstractMapMenuPreferences recentMapMenuPreferences = new RecentMapMenuPreferences(); + final MapMenuPreferences recentMapMenuPreferences = new RecentMapMenuPreferences(); final MapMenuManager<G, A, R> recentMapMenuManager = new MapMenuManager<G, A, R>(recentMapMenuPreferences.getMapMenu(), mapViewsManager, fileControl, mapImageCache); final JMenu recentMenu = MenuUtils.getMenu(menuBar, "recent"); if (recentMenu == null) { Modified: trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java 2011-03-08 19:12:05 UTC (rev 8853) +++ trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java 2011-03-08 19:24:23 UTC (rev 8854) @@ -52,7 +52,7 @@ final TestMapControlCreator testMapControlCreator = new TestMapControlCreator(); final File file = File.createTempFile("gridarta", null); - final AbstractMapMenuPreferences mapMenuPreferences = new TestMapMenuPreferences(); + final MapMenuPreferences mapMenuPreferences = new TestMapMenuPreferences(); try { final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl1 = testMapControlCreator.newMapControl(file, "name1", new Size2D(1, 1)); final MapMenuEntryMap mapMenuEntry = new MapMenuEntryMap(new File("test1"), "title1"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-03-08 19:12:13
|
Revision: 8853 http://gridarta.svn.sourceforge.net/gridarta/?rev=8853&view=rev Author: akirschbaum Date: 2011-03-08 19:12:05 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Remove unused fields and parameters. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.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/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.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/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.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/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/model/src/test/net/sf/gridarta/model/io/TestGameObjectParser.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/actions/InputActions.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 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -222,8 +222,8 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { - return new DefaultGameObjectParserFactory(gameObjectFactory, gameObjectMatchers, archetypeSet); + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet); } /** Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -24,7 +24,6 @@ import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.AbstractGameObjectParser; -import net.sf.gridarta.model.match.GameObjectMatchers; 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; @@ -41,11 +40,10 @@ * Create a new instance. * @param gameObjectFactory the game object factory for creating new game * object instances - * @param gameObjectMatchers the game object matchers to use * @param archetypeSet the archetype set for looking up archetypes */ - public DefaultGameObjectParser(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { - super(gameObjectFactory, gameObjectMatchers, archetypeSet); + public DefaultGameObjectParser(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + super(gameObjectFactory, archetypeSet); } /** Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -23,7 +23,6 @@ import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; -import net.sf.gridarta.model.match.GameObjectMatchers; 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; @@ -42,12 +41,6 @@ private final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory; /** - * The {@link GameObjectMatchers} to use. - */ - @NotNull - private final GameObjectMatchers gameObjectMatchers; - - /** * The {@link ArchetypeSet} for looking up archetypes. */ @NotNull @@ -56,12 +49,10 @@ /** * Creates a new instance. * @param gameObjectFactory the game object factory to use - * @param gameObjectMatchers the game object matchers to use * @param archetypeSet the archetype set for looking up archetypes */ - public DefaultGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public DefaultGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { this.gameObjectFactory = gameObjectFactory; - this.gameObjectMatchers = gameObjectMatchers; this.archetypeSet = archetypeSet; } @@ -70,7 +61,7 @@ */ @Override public GameObjectParser<GameObject, MapArchObject, Archetype> newGameObjectParser() { - return new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers, archetypeSet); + return new DefaultGameObjectParser(gameObjectFactory, archetypeSet); } } // class DefaultGameObjectParserFactory Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -35,7 +35,6 @@ import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; import net.sf.gridarta.model.gameobject.MultiPositionData; import net.sf.gridarta.model.io.GameObjectParser; -import net.sf.gridarta.model.match.GameObjectMatchers; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.var.atrinik.model.gameobject.DefaultGameObjectFactory; @@ -149,11 +148,10 @@ final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); - final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(); archetypeSet = new ArchetypeSet(archetypeFactory, faceObjectProviders); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; - final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers, archetypeSet); + final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); assert archetypeSet != null; final IsoMapSquareInfo isoMapSquareInfo = new IsoMapSquareInfo(1, 1, 1, 1); final MultiPositionData multiPositionData = new MultiPositionData(isoMapSquareInfo); 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 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -193,8 +193,8 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { - return new DefaultGameObjectParserFactory(gameObjectFactory, gameObjectMatchers, archetypeSet); + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -26,7 +26,6 @@ import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.AbstractGameObjectParser; -import net.sf.gridarta.model.match.GameObjectMatchers; 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; @@ -329,11 +328,10 @@ * Create a new instance. * @param gameObjectFactory the game object factory for creating new game * object instances - * @param gameObjectMatchers the game object matchers to use * @param archetypeSet the archetype set for looking up archetypes */ - public DefaultGameObjectParser(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { - super(gameObjectFactory, gameObjectMatchers, archetypeSet); + public DefaultGameObjectParser(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + super(gameObjectFactory, archetypeSet); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -23,7 +23,6 @@ import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; -import net.sf.gridarta.model.match.GameObjectMatchers; 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; @@ -42,12 +41,6 @@ private final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory; /** - * The {@link GameObjectMatchers} to use. - */ - @NotNull - private final GameObjectMatchers gameObjectMatchers; - - /** * The {@link ArchetypeSet} for looking up archetypes. */ @NotNull @@ -56,12 +49,10 @@ /** * Creates a new instance. * @param gameObjectFactory the game object factory to use - * @param gameObjectMatchers the game object matchers to use * @param archetypeSet the archetype set for looking up archetypes */ - public DefaultGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public DefaultGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { this.gameObjectFactory = gameObjectFactory; - this.gameObjectMatchers = gameObjectMatchers; this.archetypeSet = archetypeSet; } @@ -70,7 +61,7 @@ */ @Override public GameObjectParser<GameObject, MapArchObject, Archetype> newGameObjectParser() { - return new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers, archetypeSet); + return new DefaultGameObjectParser(gameObjectFactory, archetypeSet); } } // class DefaultGameObjectParserFactory Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -32,7 +32,6 @@ import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.io.GameObjectParser; -import net.sf.gridarta.model.match.GameObjectMatchers; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.var.crossfire.model.gameobject.DefaultGameObjectFactory; @@ -106,11 +105,10 @@ final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects = new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>("animtree"); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); - final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(); archetypeSet = new ArchetypeSet("images", archetypeFactory, faceObjectProviders); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; - final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers, archetypeSet); + final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); assert archetypeSet != null; final SmoothFaces smoothFaces = new SmoothFaces(faceObjects); assert archetypeSet != null; 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 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -222,8 +222,8 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { - return new DefaultGameObjectParserFactory(gameObjectFactory, gameObjectMatchers, archetypeSet); + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet); } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParser.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParser.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParser.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -24,7 +24,6 @@ import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.AbstractGameObjectParser; -import net.sf.gridarta.model.match.GameObjectMatchers; 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; @@ -41,11 +40,10 @@ * Create a new instance. * @param gameObjectFactory the game object factory for creating new game * object instances - * @param gameObjectMatchers the game object matchers to use * @param archetypeSet the archetype set for looking up archetypes */ - public DefaultGameObjectParser(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { - super(gameObjectFactory, gameObjectMatchers, archetypeSet); + public DefaultGameObjectParser(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + super(gameObjectFactory, archetypeSet); } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParserFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParserFactory.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParserFactory.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -23,7 +23,6 @@ import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; -import net.sf.gridarta.model.match.GameObjectMatchers; 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; @@ -42,12 +41,6 @@ private final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory; /** - * The {@link GameObjectMatchers} to use. - */ - @NotNull - private final GameObjectMatchers gameObjectMatchers; - - /** * The {@link ArchetypeSet}. */ @NotNull @@ -56,12 +49,10 @@ /** * Creates a new instance. * @param gameObjectFactory the game object factory to use - * @param gameObjectMatchers the game object matchers to use * @param archetypeSet the archetype set */ - public DefaultGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public DefaultGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { this.gameObjectFactory = gameObjectFactory; - this.gameObjectMatchers = gameObjectMatchers; this.archetypeSet = archetypeSet; } @@ -70,7 +61,7 @@ */ @Override public GameObjectParser<GameObject, MapArchObject, Archetype> newGameObjectParser() { - return new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers, archetypeSet); + return new DefaultGameObjectParser(gameObjectFactory, archetypeSet); } } // class DefaultGameObjectParserFactory Modified: trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -33,7 +33,6 @@ import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; -import net.sf.gridarta.model.match.GameObjectMatchers; import net.sf.gridarta.utils.StringUtils; import org.apache.log4j.Category; import org.apache.log4j.Logger; @@ -66,12 +65,6 @@ private final GameObjectFactory<G, A, R> gameObjectFactory; /** - * The {@link GameObjectMatchers} to use. - */ - @NotNull - private final GameObjectMatchers gameObjectMatchers; - - /** * The {@link ArchetypeSet} for looking up archetypes. */ @NotNull @@ -81,12 +74,10 @@ * Create a new instance. * @param gameObjectFactory the game object factory for creating new game * object instances - * @param gameObjectMatchers the game object matchers to use * @param archetypeSet the archetype set for looking up archetypes */ - protected AbstractGameObjectParser(@NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<G, A, R> archetypeSet) { + protected AbstractGameObjectParser(@NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final ArchetypeSet<G, A, R> archetypeSet) { this.gameObjectFactory = gameObjectFactory; - this.gameObjectMatchers = gameObjectMatchers; this.archetypeSet = archetypeSet; } Modified: trunk/model/src/test/net/sf/gridarta/model/io/TestGameObjectParser.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/io/TestGameObjectParser.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/model/src/test/net/sf/gridarta/model/io/TestGameObjectParser.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -26,7 +26,6 @@ import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.maparchobject.TestMapArchObject; -import net.sf.gridarta.model.match.GameObjectMatchers; import org.jetbrains.annotations.NotNull; /** @@ -39,11 +38,10 @@ * Create a new instance. * @param gameObjectFactory the game object factory for creating new game * object instances - * @param gameObjectMatchers the game object matchers to use * @param archetypeSet the archetype set for looking up archetypes */ - public TestGameObjectParser(@NotNull final GameObjectFactory<TestGameObject, TestMapArchObject, TestArchetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet) { - super(gameObjectFactory, gameObjectMatchers, archetypeSet); + public TestGameObjectParser(@NotNull final GameObjectFactory<TestGameObject, TestMapArchObject, TestArchetype> gameObjectFactory, @NotNull final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet) { + super(gameObjectFactory, archetypeSet); } /** Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -307,7 +307,7 @@ * @return the new game object parser instance */ public GameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> newGameObjectParser() { - return new TestGameObjectParser(gameObjectFactory, gameObjectMatchers, archetypeSet); + return new TestGameObjectParser(gameObjectFactory, archetypeSet); } /** Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -153,12 +153,11 @@ /** * Creates a new {@link GameObjectParserFactory} instance. * @param gameObjectFactory the game object parser factory to use - * @param gameObjectMatchers the game object matchers to use * @param archetypeSet the archetype set for looking up archetypes * @return the new instance */ @NotNull - GameObjectParserFactory<G, A, R> newGameObjectParserFactory(@NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<G, A, R> archetypeSet); + GameObjectParserFactory<G, A, R> newGameObjectParserFactory(@NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final ArchetypeSet<G, A, R> archetypeSet); /** * Creates a new {@link GlobalSettings} instance. Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -248,7 +248,7 @@ final GameObjectFactory<G, A, R> gameObjectFactory = editorFactory.newGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final ArchetypeFactory<G, A, R> archetypeFactory = editorFactory.newArchetypeFactory(faceObjectProviders, animationObjects); final ArchetypeSet<G, A, R> archetypeSet = editorFactory.newArchetypeSet(globalSettings, archetypeFactory, faceObjectProviders); - final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, gameObjectMatchers, archetypeSet); + final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, archetypeSet); final GameObjectParser<G, A, R> gameObjectParser = gameObjectParserFactory.newGameObjectParser(); final MapArchObjectFactory<A> mapArchObjectFactory = editorFactory.newMapArchObjectFactory(globalSettings); final MapArchObjectParserFactory<A> mapArchObjectParserFactory = editorFactory.newMapArchObjectParserFactory(); Modified: trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -103,7 +103,7 @@ final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(); final ArchetypeFactory<G, A, R> archetypeFactory = editorFactory.newArchetypeFactory(faceObjectProviders, animationObjects); final ArchetypeSet<G, A, R> archetypeSet = editorFactory.newArchetypeSet(globalSettings, archetypeFactory, faceObjectProviders); - final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, gameObjectMatchers, archetypeSet); + final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, archetypeSet); final GameObjectParser<G, A, R> gameObjectParser = gameObjectParserFactory.newGameObjectParser(); final MapViewSettings mapViewSettings = new DefaultMapViewSettings(); final MapReaderFactory<G, A> mapReaderFactory = new DefaultMapReaderFactory<G, A, R>(mapArchObjectFactory, mapArchObjectParserFactory, gameObjectParserFactory, mapViewSettings); Modified: trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -71,12 +71,6 @@ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** - * Preferences. - */ - @NotNull - private final Preferences preferences; - - /** * The {@link TextAreaDefaults} for tabs. */ @NotNull @@ -140,7 +134,6 @@ */ public ScriptEditView(@NotNull final ScriptEditControl control, @NotNull final Frame owner, @NotNull final Preferences preferences, @NotNull final Exiter exiter) { super(owner, "Script Pad"); - this.preferences = preferences; setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); textAreas = new ArrayList<JEditTextArea>(); Modified: trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/actions/InputActions.java =================================================================== --- trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/actions/InputActions.java 2011-03-01 22:35:43 UTC (rev 8852) +++ trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/actions/InputActions.java 2011-03-08 19:12:05 UTC (rev 8853) @@ -97,8 +97,6 @@ public final ActionListener toggleRectangle = new ToggleRectangle(); - private final ActionListener save; - public final ActionListener functionMenu; // Default action @@ -108,7 +106,7 @@ private final Map<String, ActionListener> actions = new HashMap<String, ActionListener>(); public InputActions(@NotNull final ScriptEditControl scriptEditControl) { - save = new Save(scriptEditControl); + final ActionListener save = new Save(scriptEditControl); functionMenu = new FunctionMenu(scriptEditControl); actions.put("backspace", backspace); actions.put("backspace-word", backspaceWord); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-03-01 22:35:50
|
Revision: 8852 http://gridarta.svn.sourceforge.net/gridarta/?rev=8852&view=rev Author: akirschbaum Date: 2011-03-01 22:35:43 +0000 (Tue, 01 Mar 2011) Log Message: ----------- Fix Javadoc issue. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java Modified: trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java 2011-03-01 21:57:10 UTC (rev 8851) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java 2011-03-01 22:35:43 UTC (rev 8852) @@ -29,7 +29,6 @@ import net.sf.gridarta.gui.mapmenu.AbstractMapMenuPreferences; import net.sf.gridarta.gui.mapmenu.MapMenu; import net.sf.gridarta.gui.mapmenu.MapMenuEntryMap; -import net.sf.gridarta.gui.mapmenu.MapMenuManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; @@ -55,7 +54,7 @@ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** - * The {@link MapMenuManager} defining the bookmarks menu entries. + * The {@link AbstractMapMenuPreferences} for adding new bookmarks. */ @NotNull private final AbstractMapMenuPreferences bookmarksMapMenuPreferences; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-03-01 21:57:17
|
Revision: 8851 http://gridarta.svn.sourceforge.net/gridarta/?rev=8851&view=rev Author: akirschbaum Date: 2011-03-01 21:57:10 +0000 (Tue, 01 Mar 2011) Log Message: ----------- Manage bookmarks dialog: Add "undo remove" button for restoring a previously removed bookmark. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenu.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/test/net/sf/gridarta/gui/mapmenu/MapMenuTest.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-02-28 17:53:53 UTC (rev 8850) +++ trunk/atrinik/ChangeLog 2011-03-01 21:57:10 UTC (rev 8851) @@ -1,3 +1,8 @@ +2011-03-01 Andreas Kirschbaum + + * Manage bookmarks dialog: Add "undo remove" button for restoring + a previously removed bookmark. + 2011-02-28 Andreas Kirschbaum * Implement bookmark directories. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-02-28 17:53:53 UTC (rev 8850) +++ trunk/crossfire/ChangeLog 2011-03-01 21:57:10 UTC (rev 8851) @@ -1,3 +1,8 @@ +2011-03-01 Andreas Kirschbaum + + * Manage bookmarks dialog: Add "undo remove" button for restoring + a previously removed bookmark. + 2011-02-28 Andreas Kirschbaum * Implement bookmark directories. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-02-28 17:53:53 UTC (rev 8850) +++ trunk/daimonin/ChangeLog 2011-03-01 21:57:10 UTC (rev 8851) @@ -1,3 +1,8 @@ +2011-03-01 Andreas Kirschbaum + + * Manage bookmarks dialog: Add "undo remove" button for restoring + a previously removed bookmark. + 2011-02-28 Andreas Kirschbaum * Implement bookmark directories. Modified: trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java 2011-02-28 17:53:53 UTC (rev 8850) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java 2011-03-01 21:57:10 UTC (rev 8851) @@ -133,6 +133,13 @@ private final Action removeAction = ACTION_BUILDER.createAction(false, "manageBookmarksRemove", this); /** + * The {@link Action} for "remove bookmark". + * @serial + */ + @NotNull + private final Action unDeleteAction = ACTION_BUILDER.createAction(false, "manageBookmarksUnDelete", this); + + /** * The {@link Action} for "new directory". * @serial */ @@ -170,8 +177,9 @@ new TreeDropTarget(bookmarksTree); final JButton editButton = new JButton(editAction); final JButton removeButton = new JButton(removeAction); + final JButton unDeleteButton = new JButton(unDeleteAction); final JButton newDirectoryButton = new JButton(newDirectoryAction); - setOptions(new Object[] { editButton, removeButton, newDirectoryButton, closeButton }); + setOptions(new Object[] { editButton, removeButton, unDeleteButton, newDirectoryButton, closeButton }); setMessage(createPanel()); @@ -274,6 +282,14 @@ } /** + * Action method for "undo deletion". + */ + @ActionMethod + public void manageBookmarksUnDelete() { + doUnDeleteBookmark(true); + } + + /** * Action method for "new directory". */ @ActionMethod @@ -374,6 +390,25 @@ } /** + * Restores the last deleted bookmark. + * @param performAction whether the action should be performed + * @return whether the action can or was performed + */ + private boolean doUnDeleteBookmark(final boolean performAction) { + final MapMenu.DeletedNode deletedNode = mapMenu.getDeletedNode(performAction); + if (deletedNode == null) { + return false; + } + + if (performAction) { + final TreePath treePath = mapMenu.addMapMenuEntry(deletedNode.getDirectory(), deletedNode.getTreeNode()); + bookmarksTree.setSelectionPath(treePath); + } + + return true; + } + + /** * Create a new directory. * @param performAction whether the action should be performed * @return whether the action can or was performed @@ -416,6 +451,7 @@ private void updateActions() { editAction.setEnabled(doEditBookmark(false)); removeAction.setEnabled(doRemoveBookmark(false)); + unDeleteAction.setEnabled(doUnDeleteBookmark(false)); newDirectoryAction.setEnabled(doNewDirectory(false)); @Nullable final Icon previewIcon; if (selectedTreePath == null) { Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenu.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenu.java 2011-02-28 17:53:53 UTC (rev 8850) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenu.java 2011-03-01 21:57:10 UTC (rev 8851) @@ -20,16 +20,20 @@ package net.sf.gridarta.gui.mapmenu; import java.io.IOException; +import java.util.ArrayDeque; +import java.util.Deque; import javax.swing.JTree; import javax.swing.event.TreeModelEvent; import javax.swing.event.TreeModelListener; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.MutableTreeNode; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import org.apache.log4j.Category; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Manages the contents of a recent or bookmark menu. @@ -61,6 +65,12 @@ private final DefaultTreeModel treeModel = new DefaultTreeModel(root); /** + * Recently deleted nodes. The first node is the last deleted node. + */ + @NotNull + private final Deque<DeletedNode> deletedNodes = new ArrayDeque<DeletedNode>(); + + /** * Whether {@link #treeModel} has been modified since last save. */ private boolean treeModelModified = false; @@ -183,9 +193,23 @@ * Adds a {@link MapMenuEntry} to this menu. * @param directory the directory to add to * @param mapMenuEntry the map menu entry + * @return the tree path for the inserted node * @noinspection TypeMayBeWeakened */ - public void addMapMenuEntry(@NotNull final String directory, @NotNull final MapMenuEntry mapMenuEntry) { + @NotNull + public TreePath addMapMenuEntry(@NotNull final String directory, @NotNull final MapMenuEntry mapMenuEntry) { + return addMapMenuEntry(directory, new DefaultMutableTreeNode(mapMenuEntry, mapMenuEntry.allowsChildren())); + } + + /** + * Adds a {@link DefaultMutableTreeNode} to this menu. + * @param directory the directory to add to + * @param treeNode the tree node + * @return the tree path for the inserted node + * @noinspection TypeMayBeWeakened + */ + @NotNull + public TreePath addMapMenuEntry(@NotNull final String directory, @NotNull final DefaultMutableTreeNode treeNode) { final String[] paths = directory.split("/"); DefaultMutableTreeNode dir2 = root; for (final String path : paths) { @@ -193,7 +217,8 @@ dir2 = getOrCreateDirectory(dir2, path); } } - dir2.add(new DefaultMutableTreeNode(mapMenuEntry, mapMenuEntry.allowsChildren())); + treeModel.insertNodeInto(treeNode, dir2, dir2.getChildCount()); + return new TreePath(treeModel.getPathToRoot(treeNode)); } /** @@ -204,7 +229,7 @@ * @return the entry */ @NotNull - public static DefaultMutableTreeNode getOrCreateDirectory(@NotNull final DefaultMutableTreeNode this2, @NotNull final String path) { + public DefaultMutableTreeNode getOrCreateDirectory(@NotNull final MutableTreeNode this2, @NotNull final String path) { if (!MapMenuEntryDir.isValidDirectory(path)) { throw new IllegalArgumentException("invalid directory name '" + path + "'"); } @@ -218,7 +243,7 @@ } final DefaultMutableTreeNode new2 = new DefaultMutableTreeNode(new MapMenuEntryDir(path), true); - this2.add(new2); + treeModel.insertNodeInto(new2, this2, this2.getChildCount()); return new2; } @@ -246,12 +271,50 @@ */ public void removeNode(@NotNull final DefaultMutableTreeNode treeNode) { if (treeNode != root) { + final String directory = getDirectory(treeNode); treeModel.removeNodeFromParent(treeNode); + deletedNodes.addFirst(new DeletedNode(directory, treeNode)); + while (deletedNodes.size() > 10) { + deletedNodes.removeLast(); + } save(); } } /** + * Returns the directory of a {@link TreeNode}. + * @param treeNode the tree node + * @return the directory + */ + @NotNull + private String getDirectory(@NotNull final TreeNode treeNode) { + final TreeNode[] treePath = treeModel.getPathToRoot(treeNode); + if (treePath == null) { + throw new IllegalArgumentException(); + } + final StringBuilder sb = new StringBuilder(); + for (int i = 1; i + 1 < treePath.length; i++) { + final TreeNode tmp = treePath[i]; + final MapMenuEntry mapMenuEntry = (MapMenuEntry) ((DefaultMutableTreeNode) tmp).getUserObject(); + if (sb.length() > 0) { + sb.append('/'); + } + sb.append(mapMenuEntry.getTitle()); + } + return sb.toString(); + } + + /** + * Returns the last deleted node. + * @param delete whether to delete the returned node + * @return the deleted node or <code>null</code> + */ + @Nullable + public DeletedNode getDeletedNode(final boolean delete) { + return delete ? deletedNodes.pollFirst() : deletedNodes.peekFirst(); + } + + /** * Returns the number of entries in this menu. * @return the number of entries */ @@ -295,4 +358,53 @@ return root; } + /** + * Result value consisting of a {@link TreeNode} and its location + * (directory). + * @noinspection PublicInnerClass + */ + public static class DeletedNode { + + /** + * The entry's directory. + */ + @NotNull + private final String directory; + + /** + * The entry. + */ + @NotNull + private final DefaultMutableTreeNode treeNode; + + /** + * Creates a new instance. + * @param directory the entry's directory + * @param treeNode the tree node + */ + public DeletedNode(@NotNull final String directory, @NotNull final DefaultMutableTreeNode treeNode) { + this.directory = directory; + this.treeNode = treeNode; + } + + /** + * Returns the entry's directory. + * @return the entry's directory + */ + @NotNull + public String getDirectory() { + return directory; + } + + /** + * Returns the tree node. + * @return the tree node + */ + @NotNull + public DefaultMutableTreeNode getTreeNode() { + return treeNode; + } + + } + } Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2011-02-28 17:53:53 UTC (rev 8850) +++ trunk/src/app/net/sf/gridarta/messages.properties 2011-03-01 21:57:10 UTC (rev 8851) @@ -452,6 +452,8 @@ manageBookmarks.title=Manage Bookmarks manageBookmarksEdit.text=Edit manageBookmarksRemove.text=Remove +manageBookmarksUnDelete.text=Undo Remove +manageBookmarksUnDelete.shortdescription=Restores the last deleted bookmark. manageBookmarksNewDirectory.text=New Directory manageBookmarksClose.text=Close Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2011-02-28 17:53:53 UTC (rev 8850) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2011-03-01 21:57:10 UTC (rev 8851) @@ -429,6 +429,8 @@ manageBookmarks.title=Lesezeichen verwalten manageBookmarksEdit.text=\u00c4ndern manageBookmarksRemove.text=L\u00f6schen +manageBookmarksUnDelete.text=Wiederherstellen +manageBookmarksUnDelete.shortdescription=Stellt das zuletzt gel\u00f6schte Bookmark wieder her. manageBookmarksNewDirectory.text=Neues Verzeichnis manageBookmarksClose.text=Schie\u00dfen Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2011-02-28 17:53:53 UTC (rev 8850) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2011-03-01 21:57:10 UTC (rev 8851) @@ -429,6 +429,8 @@ manageBookmarks.title=Gestion des raccourcis manageBookmarksEdit.text=Modifier manageBookmarksRemove.text=Supprimer +#manageBookmarksUnDelete.text= +#manageBookmarksUnDelete.shortdescription= #manageBookmarksNewDirectory.text= manageBookmarksClose.text=Fermer Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2011-02-28 17:53:53 UTC (rev 8850) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2011-03-01 21:57:10 UTC (rev 8851) @@ -426,6 +426,8 @@ #manageBookmarks.title= #manageBookmarksEdit.text= #manageBookmarksRemove.text= +#manageBookmarksUnDelete.text= +#manageBookmarksUnDelete.shortdescription= #manageBookmarksNewDirectory.text= #manageBookmarksClose.text= Modified: trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuTest.java 2011-02-28 17:53:53 UTC (rev 8850) +++ trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuTest.java 2011-03-01 21:57:10 UTC (rev 8851) @@ -20,6 +20,7 @@ package net.sf.gridarta.gui.mapmenu; import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.MutableTreeNode; import net.sf.gridarta.preferences.FilePreferencesFactory; import org.jetbrains.annotations.NotNull; import org.junit.Assert; @@ -33,46 +34,48 @@ public class MapMenuTest { /** - * Checks that {@link MapMenu#getOrCreateDirectory(DefaultMutableTreeNode, - * String)} works as expected. + * Checks that {@link MapMenu#getOrCreateDirectory(MutableTreeNode, String)} + * works as expected. */ @Test public void testSubDir1() { - final DefaultMutableTreeNode dir = new DefaultMutableTreeNode(new MapMenuEntryDir("Test"), true); + final MapMenu mapMenu = new MapMenu("test"); + final MutableTreeNode dir = mapMenu.getRoot(); checkDir(dir); - MapMenu.getOrCreateDirectory(dir, "dir1"); + mapMenu.getOrCreateDirectory(dir, "dir1"); checkDir(dir, "dir1"); - MapMenu.getOrCreateDirectory(dir, "dir2"); - MapMenu.getOrCreateDirectory(dir, "dir3"); + mapMenu.getOrCreateDirectory(dir, "dir2"); + mapMenu.getOrCreateDirectory(dir, "dir3"); checkDir(dir, "dir1", "dir2", "dir3"); - MapMenu.getOrCreateDirectory(dir, "dir2"); + mapMenu.getOrCreateDirectory(dir, "dir2"); checkDir(dir, "dir1", "dir2", "dir3"); } /** - * Checks that {@link MapMenu#getOrCreateDirectory(DefaultMutableTreeNode, - * String)} rejects invalid path names. + * Checks that {@link MapMenu#getOrCreateDirectory(MutableTreeNode, String)} + * rejects invalid path names. */ @Test public void testSubDir2() { - final DefaultMutableTreeNode dir = new DefaultMutableTreeNode(new MapMenuEntryDir("Test"), true); + final MapMenu mapMenu = new MapMenu("test"); + final MutableTreeNode dir = mapMenu.getRoot(); checkDir(dir); - MapMenu.getOrCreateDirectory(dir, "dir1"); - MapMenu.getOrCreateDirectory(dir, "dir2"); - MapMenu.getOrCreateDirectory(dir, "dir3"); + mapMenu.getOrCreateDirectory(dir, "dir1"); + mapMenu.getOrCreateDirectory(dir, "dir2"); + mapMenu.getOrCreateDirectory(dir, "dir3"); checkDir(dir, "dir1", "dir2", "dir3"); try { - MapMenu.getOrCreateDirectory(dir, "dir2/sub"); + mapMenu.getOrCreateDirectory(dir, "dir2/sub"); Assert.fail("IllegalArgumentException expected"); } catch (final IllegalArgumentException ignored) { } try { - MapMenu.getOrCreateDirectory(dir, "dir4/sub"); + mapMenu.getOrCreateDirectory(dir, "dir4/sub"); Assert.fail("IllegalArgumentException expected"); } catch (final IllegalArgumentException ignored) { } try { - MapMenu.getOrCreateDirectory(dir, ""); + mapMenu.getOrCreateDirectory(dir, ""); Assert.fail("IllegalArgumentException expected"); } catch (final IllegalArgumentException ignored) { } @@ -86,7 +89,7 @@ * @param paths the paths of the child nodes * @noinspection TypeMayBeWeakened // IDEA bug */ - private static void checkDir(@NotNull final DefaultMutableTreeNode dir, @NotNull final String... paths) { + private static void checkDir(@NotNull final MutableTreeNode dir, @NotNull final String... paths) { Assert.assertEquals(paths.length, dir.getChildCount()); for (int i = 0; i < paths.length; i++) { final DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) dir.getChildAt(i); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-02-28 17:54:02
|
Revision: 8850 http://gridarta.svn.sourceforge.net/gridarta/?rev=8850&view=rev Author: akirschbaum Date: 2011-02-28 17:53:53 +0000 (Mon, 28 Feb 2011) Log Message: ----------- Implement bookmark directories. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/build.xml trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/RecentMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.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 trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkDirectoryDialog.java trunk/src/app/net/sf/gridarta/gui/bookmarks/MapMenuEntryIcons.java trunk/src/app/net/sf/gridarta/gui/mapmenu/ActionFactory.java trunk/src/app/net/sf/gridarta/gui/mapmenu/AutoscrollJTree.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenu.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuAction.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntryDir.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntryMap.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntryTreeCellRenderer.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntryVisitor.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuLoader.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuUtils.java trunk/src/app/net/sf/gridarta/gui/mapmenu/TransferableTreeNode.java trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDragSource.java trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDropTarget.java trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuPreferencesTest.java trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuTest.java trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuUtilsTest.java trunk/src/test/net/sf/gridarta/gui/mapmenu/TestMapMenuPreferences.java trunk/src/test/net/sf/gridarta/gui/mapmenu/testLoad1.properties Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-02-27 19:48:47 UTC (rev 8849) +++ trunk/atrinik/ChangeLog 2011-02-28 17:53:53 UTC (rev 8850) @@ -1,3 +1,7 @@ +2011-02-28 Andreas Kirschbaum + + * Implement bookmark directories. + 2011-02-22 Andreas Kirschbaum * Fix ambiguous French menu shortcuts. Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2011-02-27 19:48:47 UTC (rev 8849) +++ trunk/build.xml 2011-02-28 17:53:53 UTC (rev 8850) @@ -331,6 +331,9 @@ </classpath> <compilerarg line="${javac.args}"/> </javac> + <copy todir="${build.dir}/atrinik/app"> + <fileset dir="atrinik/src/app" includes="**/*.properties"/> + </copy> <mkdir dir="${build.dir}/atrinik/test"/> <javac srcdir="atrinik/src/test" destdir="${build.dir}/atrinik/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> @@ -344,8 +347,8 @@ </classpath> <compilerarg line="${javac.args}"/> </javac> - <copy todir="${build.dir}/atrinik/app"> - <fileset dir="atrinik/src/app" includes="**/*.properties"/> + <copy todir="${build.dir}/atrinik/test"> + <fileset dir="atrinik/src/test" includes="**/*.properties"/> </copy> </target> @@ -365,6 +368,9 @@ </classpath> <compilerarg line="${javac.args}"/> </javac> + <copy todir="${build.dir}/crossfire/app"> + <fileset dir="crossfire/src/app" includes="**/*.properties"/> + </copy> <mkdir dir="${build.dir}/crossfire/test"/> <javac srcdir="crossfire/src/test" destdir="${build.dir}/crossfire/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> @@ -378,8 +384,8 @@ </classpath> <compilerarg line="${javac.args}"/> </javac> - <copy todir="${build.dir}/crossfire/app"> - <fileset dir="crossfire/src/app" includes="**/*.properties"/> + <copy todir="${build.dir}/crossfire/test"> + <fileset dir="crossfire/src/test" includes="**/*.properties"/> </copy> </target> @@ -399,6 +405,9 @@ </classpath> <compilerarg line="${javac.args}"/> </javac> + <copy todir="${build.dir}/daimonin/test"> + <fileset dir="daimonin/src/test" includes="**/*.properties"/> + </copy> <mkdir dir="${build.dir}/daimonin/test"/> <javac srcdir="daimonin/src/test" destdir="${build.dir}/daimonin/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> @@ -439,6 +448,9 @@ </classpath> <compilerarg line="${javac.args}"/> </javac> + <copy todir="${build.dir}/gridarta/test"> + <fileset dir="src/test" includes="**/*.properties,cfpython_menu.def"/> + </copy> <mkdir dir="${build.dir}/gridarta/test"/> <javac srcdir="src/test" destdir="${build.dir}/gridarta/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> @@ -448,6 +460,7 @@ <path refid="path.class.textedit.test"/> <path refid="path.class.utils.test"/> <path refid="path.lib.annotations"/> + <path refid="path.lib.japi-swing-action"/> <path refid="path.lib.junit"/> </classpath> <compilerarg line="${javac.args}"/> @@ -472,6 +485,9 @@ </classpath> <compilerarg line="${javac.args}"/> </javac> + <copy todir="${build.dir}/model/test"> + <fileset dir="model/src/test" includes="**/*.properties"/> + </copy> <mkdir dir="${build.dir}/model/test"/> <javac srcdir="model/src/test" destdir="${build.dir}/model/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> @@ -499,6 +515,9 @@ </classpath> <compilerarg line="${javac.args}"/> </javac> + <copy todir="${build.dir}/preferences/test"> + <fileset dir="preferences/src/test" includes="**/*.properties"/> + </copy> <mkdir dir="${build.dir}/preferences/test"/> <javac srcdir="preferences/src/test" destdir="${build.dir}/preferences/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> @@ -525,6 +544,9 @@ </classpath> <compilerarg line="${javac.args}"/> </javac> + <copy todir="${build.dir}/script/test"> + <fileset dir="script/src/test" includes="**/*.properties"/> + </copy> <mkdir dir="${build.dir}/script/test"/> <javac srcdir="script/src/test" destdir="${build.dir}/script/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> @@ -548,6 +570,9 @@ </classpath> <compilerarg line="${javac.args}"/> </javac> + <copy todir="${build.dir}/textedit/test"> + <fileset dir="textedit/src/test" includes="**/*.properties"/> + </copy> <mkdir dir="${build.dir}/textedit/test"/> <javac srcdir="textedit/src/test" destdir="${build.dir}/textedit/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> @@ -572,6 +597,9 @@ </classpath> <compilerarg line="${javac.args}"/> </javac> + <copy todir="${build.dir}/utils/test"> + <fileset dir="utils/src/test" includes="**/*.properties"/> + </copy> <mkdir dir="${build.dir}/utils/test"/> <javac srcdir="utils/src/test" destdir="${build.dir}/utils/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> @@ -1028,10 +1056,12 @@ <classpath> <path refid="path.class.gridarta.test"/> <path refid="path.class.model.test"/> + <path refid="path.class.preferences.test"/> <path refid="path.class.utils.test"/> <path refid="path.lib.japi-swing-action"/> <path refid="path.lib.junit"/> <path refid="path.lib.log4j"/> + <pathelement location="resource"/> </classpath> <formatter type="plain"/> <formatter type="xml"/> Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-02-27 19:48:47 UTC (rev 8849) +++ trunk/crossfire/ChangeLog 2011-02-28 17:53:53 UTC (rev 8850) @@ -1,3 +1,7 @@ +2011-02-28 Andreas Kirschbaum + + * Implement bookmark directories. + 2011-02-22 Andreas Kirschbaum * Fix ambiguous French menu shortcuts. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-02-27 19:48:47 UTC (rev 8849) +++ trunk/daimonin/ChangeLog 2011-02-28 17:53:53 UTC (rev 8850) @@ -1,3 +1,7 @@ +2011-02-28 Andreas Kirschbaum + + * Implement bookmark directories. + 2011-02-22 Andreas Kirschbaum * Fix ambiguous French menu shortcuts. Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2011-02-27 19:48:47 UTC (rev 8849) +++ trunk/gridarta.ipr 2011-02-28 17:53:53 UTC (rev 8850) @@ -1200,6 +1200,8 @@ <w>djava</w> <w>doctype</w> <w>dragonmen</w> + <w>dsde</w> + <w>dtde</w> <w>encodings</w> <w>endlore</w> <w>endmsg</w> @@ -1255,6 +1257,7 @@ <w>licensor</w> <w>lifesteal</w> <w>listentry</w> + <w>locn</w> <w>logentry</w> <w>longdescription</w> <w>lookups</w> @@ -1262,6 +1265,7 @@ <w>mailto</w> <w>mandriva</w> <w>mapcontrol</w> + <w>mapmenu</w> <w>matchers</w> <w>megaxslt</w> <w>mergeable</w> Modified: trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java 2011-02-27 19:48:47 UTC (rev 8849) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java 2011-02-28 17:53:53 UTC (rev 8850) @@ -20,12 +20,15 @@ package net.sf.gridarta.gui.bookmarks; import java.awt.Component; +import java.io.File; import javax.swing.Action; import net.sf.gridarta.gui.map.mapview.MapView; import net.sf.gridarta.gui.map.mapview.MapViewManager; import net.sf.gridarta.gui.map.mapview.MapViewManagerListener; import net.sf.gridarta.gui.mapimagecache.MapImageCache; -import net.sf.gridarta.gui.mapmenu.BookmarksMapMenuPreferences; +import net.sf.gridarta.gui.mapmenu.AbstractMapMenuPreferences; +import net.sf.gridarta.gui.mapmenu.MapMenu; +import net.sf.gridarta.gui.mapmenu.MapMenuEntryMap; import net.sf.gridarta.gui.mapmenu.MapMenuManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; @@ -55,14 +58,13 @@ * The {@link MapMenuManager} defining the bookmarks menu entries. */ @NotNull - private final MapMenuManager<G, A, R> bookmarksMapMenuManager; + private final AbstractMapMenuPreferences bookmarksMapMenuPreferences; /** - * The {@link BookmarksMapMenuPreferences} defining the bookmarks menu - * entries. + * The {@link MapMenu} defining the bookmarks menu entries. */ @NotNull - private final BookmarksMapMenuPreferences<G, A, R> bookmarksMapMenuPreferences; + private final MapMenu mapMenu; /** * The {@link MapImageCache} for creating map previews. @@ -97,17 +99,16 @@ /** * Creates a new instance. - * @param bookmarksMapMenuManager the map menu manager defining the + * @param bookmarksMapMenuPreferences the map menu preferences defining the * bookmarks menu entries - * @param bookmarksMapMenuPreferences the bookmarks map menu preferences - * definition the bookmarks menu entries + * @param mapMenu the map menu definition the bookmarks menu entries * @param mapViewManager the map view manager instance * @param parentComponent the parent component for dialogs * @param mapImageCache the map image cache for creating map previews */ - public BookmarkActions(@NotNull final MapMenuManager<G, A, R> bookmarksMapMenuManager, @NotNull final BookmarksMapMenuPreferences<G, A, R> bookmarksMapMenuPreferences, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final Component parentComponent, @NotNull final MapImageCache<G, A, R> mapImageCache) { - this.bookmarksMapMenuManager = bookmarksMapMenuManager; + public BookmarkActions(@NotNull final AbstractMapMenuPreferences bookmarksMapMenuPreferences, @NotNull final MapMenu mapMenu, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final Component parentComponent, @NotNull final MapImageCache<G, A, R> mapImageCache) { this.bookmarksMapMenuPreferences = bookmarksMapMenuPreferences; + this.mapMenu = mapMenu; this.mapViewManager = mapViewManager; this.parentComponent = parentComponent; this.mapImageCache = mapImageCache; @@ -152,7 +153,7 @@ @ActionMethod public void manageBookmarks() { if (manageBookmarksDialog == null) { - manageBookmarksDialog = new ManageBookmarksDialog<G, A, R>(parentComponent, bookmarksMapMenuPreferences, mapImageCache); + manageBookmarksDialog = new ManageBookmarksDialog<G, A, R>(parentComponent, mapImageCache, mapMenu); } manageBookmarksDialog.showDialog(parentComponent); } @@ -177,7 +178,8 @@ final MapControl<G, A, R> mapControl = mapView.getMapControl(); final MapModel<G, A, R> mapModel = mapControl.getMapModel(); - if (mapModel.getMapFile() == null) { + final File mapFile = mapModel.getMapFile(); + if (mapFile == null) { return false; } @@ -185,7 +187,8 @@ final A mapArchObject = mapModel.getMapArchObject(); final EditBookmarkDialog editBookmarkDialog = new EditBookmarkDialog(mapView.getInternalFrame(), mapArchObject.getMapName()); if (editBookmarkDialog.showDialog()) { - bookmarksMapMenuManager.addRecent(mapModel, editBookmarkDialog.getDescription()); + final MapMenuEntryMap mapMenuEntry = new MapMenuEntryMap(mapFile, editBookmarkDialog.getDescription()); + bookmarksMapMenuPreferences.addEntry(mapMenuEntry); } } Added: trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkDirectoryDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkDirectoryDialog.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkDirectoryDialog.java 2011-02-28 17:53:53 UTC (rev 8850) @@ -0,0 +1,205 @@ +/* + * 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.bookmarks; + +import java.awt.Component; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.WindowConstants; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.JTextComponent; +import net.sf.gridarta.gui.mapmenu.MapMenuEntryDir; +import net.sf.gridarta.gui.utils.GUIConstants; +import net.sf.gridarta.gui.utils.TextComponentUtils; +import net.sf.gridarta.utils.ActionBuilderUtils; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.action.ActionMethod; +import org.jetbrains.annotations.NotNull; + +/** + * A dialog that queries a bookmark directory name. + * @author Andreas Kirschbaum + */ +public class BookmarkDirectoryDialog extends JOptionPane { + + /** + * The serial Version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The {@link ActionBuilder}. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The dialog. + * @serial + */ + @NotNull + private final JDialog dialog; + + /** + * The text input field for the directory name. + * @serial + */ + @NotNull + private final JTextComponent directoryField = new JTextField(); + + /** + * The {@link JButton} for ok. + * @serial + */ + @NotNull + private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "bookmarkDirectoryOkay", this)); + + /** + * The {@link JButton} for cancel. + * @serial + */ + @NotNull + private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "bookmarkDirectoryCancel", this)); + + /** + * Creates a new instance. + * @param parentComponent the parent component for the dialog + * @param defaultDirectory the default value for the directory input field + */ + public BookmarkDirectoryDialog(@NotNull final Component parentComponent, @NotNull final String defaultDirectory) { + okButton.setDefaultCapable(true); + setOptions(new Object[] { okButton, cancelButton }); + + setMessage(createPanel()); + + TextComponentUtils.setAutoSelectOnFocus(directoryField); + directoryField.setText(defaultDirectory); + + final DocumentListener documentListener = new DocumentListener() { + + /** {@inheritDoc} */ + @Override + public void insertUpdate(@NotNull final DocumentEvent e) { + updateOkButton(); + } + + /** {@inheritDoc} */ + @Override + public void removeUpdate(@NotNull final DocumentEvent e) { + updateOkButton(); + } + + /** {@inheritDoc} */ + @Override + public void changedUpdate(@NotNull final DocumentEvent e) { + updateOkButton(); + } + + }; + directoryField.getDocument().addDocumentListener(documentListener); + updateOkButton(); + + dialog = createDialog(parentComponent, ActionBuilderUtils.getString(ACTION_BUILDER, "bookmarkDirectory.title")); + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + dialog.getRootPane().setDefaultButton(okButton); + dialog.pack(); + dialog.setLocationRelativeTo(parentComponent); + } + + /** + * Opens the dialog. Returns when the dialog has been dismissed. + * @return whether "ok" was selected + */ + public boolean showDialog() { + dialog.setVisible(true); + return getValue() == okButton; + } + + /** + * Creates 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)); + + mainPanel.setBorder(GUIConstants.DIALOG_BORDER); + + mainPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "bookmarkDirectory.description")); + mainPanel.add(Box.createVerticalStrut(5)); + + mainPanel.add(directoryField); + mainPanel.add(Box.createVerticalStrut(5)); + + return mainPanel; + } + + /** + * Action method for okay. + */ + @ActionMethod + public void bookmarkDirectoryOkay() { + if (isOkEnabled()) { + setValue(okButton); + } + } + + /** + * Action method for cancel. + */ + @ActionMethod + public void bookmarkDirectoryCancel() { + setValue(cancelButton); + } + + /** + * Returns the directory name. + * @return the directory name + */ + @NotNull + public String getDirectory() { + return directoryField.getText().trim(); + } + + /** + * Sets the enabled state of {@link #okButton} depending on the contents of + * {@link #directoryField}. + */ + private void updateOkButton() { + okButton.setEnabled(isOkEnabled()); + } + + /** + * Returns whether the "ok" button is enabled. + * @return whether the "ok" button is enabled + */ + private boolean isOkEnabled() { + return MapMenuEntryDir.isValidDirectory(getDirectory()); + } + +} Property changes on: trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkDirectoryDialog.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java 2011-02-27 19:48:47 UTC (rev 8849) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java 2011-02-28 17:53:53 UTC (rev 8850) @@ -23,27 +23,34 @@ import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; -import java.io.File; +import java.awt.dnd.DnDConstants; import javax.swing.Action; -import javax.swing.DefaultListCellRenderer; -import javax.swing.ImageIcon; +import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JLabel; -import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.JTree; import javax.swing.JViewport; -import javax.swing.ListSelectionModel; import javax.swing.ScrollPaneConstants; import javax.swing.SwingConstants; import javax.swing.WindowConstants; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.TreePath; +import javax.swing.tree.TreeSelectionModel; import net.sf.gridarta.gui.mapimagecache.MapImageCache; -import net.sf.gridarta.gui.mapmenu.BookmarksMapMenuPreferences; +import net.sf.gridarta.gui.mapmenu.MapMenu; import net.sf.gridarta.gui.mapmenu.MapMenuEntry; +import net.sf.gridarta.gui.mapmenu.MapMenuEntryDir; +import net.sf.gridarta.gui.mapmenu.MapMenuEntryMap; +import net.sf.gridarta.gui.mapmenu.MapMenuEntryTreeCellRenderer; +import net.sf.gridarta.gui.mapmenu.MapMenuEntryVisitor; +import net.sf.gridarta.gui.mapmenu.TreeDragSource; +import net.sf.gridarta.gui.mapmenu.TreeDropTarget; import net.sf.gridarta.gui.utils.GUIConstants; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; @@ -73,24 +80,29 @@ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** - * The {@link BookmarksMapMenuPreferences} to affect. - * @serial + * The {@link MapImageCache} for creating map previews. */ @NotNull - private final BookmarksMapMenuPreferences<G, A, R> bookmarksMapMenuPreferences; + private final MapImageCache<G, A, R> mapImageCache; /** - * The {@link MapImageCache} for creating map previews. + * The {@link MapMenu} being edited. */ @NotNull - private final MapImageCache<G, A, R> mapImageCache; + private final MapMenu mapMenu; /** - * The {@link JList} of all bookmarks. + * The {@link MapMenuEntryIcons} for looking up icons. + */ + @NotNull + private final MapMenuEntryIcons mapMenuEntryIcons; + + /** + * The {@link JTree} of all bookmarks. * @serial */ @NotNull - private final JList bookmarksList; + private final JTree bookmarksTree; /** * The map preview image. @@ -114,27 +126,20 @@ private final Action editAction = ACTION_BUILDER.createAction(false, "manageBookmarksEdit", this); /** - * The {@link Action} for "move up bookmark". + * The {@link Action} for "remove bookmark". * @serial */ @NotNull - private final Action moveUpAction = ACTION_BUILDER.createAction(false, "manageBookmarksMoveUp", this); + private final Action removeAction = ACTION_BUILDER.createAction(false, "manageBookmarksRemove", this); /** - * The {@link Action} for "move down bookmark". + * The {@link Action} for "new directory". * @serial */ @NotNull - private final Action moveDownAction = ACTION_BUILDER.createAction(false, "manageBookmarksMoveDown", this); + private final Action newDirectoryAction = ACTION_BUILDER.createAction(false, "manageBookmarksNewDirectory", this); /** - * The {@link Action} for "remove bookmark". - * @serial - */ - @NotNull - private final Action removeAction = ACTION_BUILDER.createAction(false, "manageBookmarksRemove", this); - - /** * The {@link JButton} for cancel. * @serial */ @@ -146,24 +151,27 @@ * @serial */ @Nullable - private MapMenuEntry<G, A, R> selectedMapMenuEntry = null; + private TreePath selectedTreePath = null; /** * Creates a new instance. * @param parentComponent the parent component for the dialog - * @param bookmarksMapMenuPreferences the bookmarks map menu preferences to - * affect * @param mapImageCache the map image cache for creating map previews + * @param mapMenu the map menu to edit */ - public ManageBookmarksDialog(@NotNull final Component parentComponent, @NotNull final BookmarksMapMenuPreferences<G, A, R> bookmarksMapMenuPreferences, @NotNull final MapImageCache<G, A, R> mapImageCache) { - this.bookmarksMapMenuPreferences = bookmarksMapMenuPreferences; + public ManageBookmarksDialog(@NotNull final Component parentComponent, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final MapMenu mapMenu) { this.mapImageCache = mapImageCache; - bookmarksList = new JList(bookmarksMapMenuPreferences); + this.mapMenu = mapMenu; + mapMenuEntryIcons = new MapMenuEntryIcons(mapImageCache); + bookmarksTree = mapMenu.newTree(); + //noinspection ResultOfObjectAllocationIgnored + new TreeDragSource(bookmarksTree, DnDConstants.ACTION_COPY_OR_MOVE); + //noinspection ResultOfObjectAllocationIgnored + new TreeDropTarget(bookmarksTree); final JButton editButton = new JButton(editAction); - final JButton moveUpButton = new JButton(moveUpAction); - final JButton moveDownButton = new JButton(moveDownAction); final JButton removeButton = new JButton(removeAction); - setOptions(new Object[] { editButton, moveUpButton, moveDownButton, removeButton, closeButton }); + final JButton newDirectoryButton = new JButton(newDirectoryAction); + setOptions(new Object[] { editButton, removeButton, newDirectoryButton, closeButton }); setMessage(createPanel()); @@ -181,8 +189,9 @@ * @param parentComponent the parent component for the dialog */ public void showDialog(@NotNull final Component parentComponent) { - setInitialValue(bookmarksList); - bookmarksList.setSelectedIndex(0); + setInitialValue(bookmarksTree); + bookmarksTree.setRootVisible(false); + bookmarksTree.setSelectionRow(0); dialog.setLocationRelativeTo(parentComponent); dialog.setMinimumSize(new Dimension(600, 300)); dialog.setPreferredSize(new Dimension(800, 600)); @@ -204,9 +213,9 @@ mainPanel.setBorder(GUIConstants.DIALOG_BORDER); final JScrollPane bookmarksScrollPane = new JScrollPane(); - bookmarksScrollPane.setViewportView(bookmarksList); - bookmarksScrollPane.setBackground(bookmarksList.getBackground()); - bookmarksScrollPane.getViewport().add(bookmarksList); + bookmarksScrollPane.setViewportView(bookmarksTree); + bookmarksScrollPane.setBackground(bookmarksTree.getBackground()); + bookmarksScrollPane.getViewport().add(bookmarksTree); bookmarksScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); bookmarksScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); bookmarksScrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); @@ -223,48 +232,28 @@ gbc.gridx = 1; mainPanel.add(preview, gbc); - bookmarksList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + bookmarksTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); + bookmarksTree.setCellRenderer(new MapMenuEntryTreeCellRenderer(mapImageCache)); - bookmarksList.setCellRenderer(new DefaultListCellRenderer() { + final TreeSelectionListener treeSelectionListener = new TreeSelectionListener() { - /** - * The serial version UID. - */ - private static final long serialVersionUID = 1L; - @Override - public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - final MapMenuEntry<?, ?, ?> mapMenuEntry = (MapMenuEntry<?, ?, ?>) value; - setText(mapMenuEntry.getTitle()); - final File mapFile = mapMenuEntry.getMapFile(); - setToolTipText(mapFile.getPath()); - return this; - } - - }); - - final ListSelectionListener listSelectionListener = new ListSelectionListener() { - - @Override - public void valueChanged(final ListSelectionEvent e) { + public void valueChanged(final TreeSelectionEvent e) { updateSelectedBookmark(); } }; - bookmarksList.addListSelectionListener(listSelectionListener); + bookmarksTree.addTreeSelectionListener(treeSelectionListener); + updateSelectedBookmark(); return mainPanel; } /** - * Updates {@link #selectedMapMenuEntry} from {@link #bookmarksList}. + * Updates {@link #selectedTreePath} from {@link #bookmarksTree}. */ private void updateSelectedBookmark() { - //JList does not use type parameters - @SuppressWarnings({ "unchecked" }) - final MapMenuEntry<G, A, R> mapMenuEntry = (MapMenuEntry<G, A, R>) bookmarksList.getSelectedValue(); - selectedMapMenuEntry = mapMenuEntry; + selectedTreePath = bookmarksTree.getSelectionPath(); updateActions(); } @@ -277,30 +266,22 @@ } /** - * Action method for "move up bookmark". + * Action method for "remove bookmark". */ @ActionMethod - public void manageBookmarksMoveUp() { - doMoveUpBookmark(true); + public void manageBookmarksRemove() { + doRemoveBookmark(true); } /** - * Action method for "move down bookmark". + * Action method for "new directory". */ @ActionMethod - public void manageBookmarksMoveDown() { - doMoveDownBookmark(true); + public void manageBookmarksNewDirectory() { + doNewDirectory(true); } /** - * Action method for "remove bookmark". - */ - @ActionMethod - public void manageBookmarksRemove() { - doRemoveBookmark(true); - } - - /** * Action method for "close bookmarks dialog". */ @ActionMethod @@ -309,88 +290,120 @@ } /** - * Edits the selected bookmark. - * @param performAction whether the action should be performed - * @return whether the action can or was performed + * {@inheritDoc} */ - private boolean doEditBookmark(final boolean performAction) { - final MapMenuEntry<G, A, R> mapMenuEntry = selectedMapMenuEntry; - if (mapMenuEntry == null) { - return false; + @Override + public void setValue(@Nullable final Object newValue) { + super.setValue(newValue); + if (newValue != UNINITIALIZED_VALUE) { + mapMenu.save(); } - - if (performAction) { - final EditBookmarkDialog editBookmarkDialog = new EditBookmarkDialog(this, mapMenuEntry.getTitle()); - if (editBookmarkDialog.showDialog()) { - bookmarksMapMenuPreferences.setTitle(mapMenuEntry, editBookmarkDialog.getDescription()); - } - } - - return true; } /** - * Moves up the selected bookmark. + * Edits the selected bookmark. * @param performAction whether the action should be performed * @return whether the action can or was performed */ - private boolean doMoveUpBookmark(final boolean performAction) { - final MapMenuEntry<G, A, R> mapMenuEntry = selectedMapMenuEntry; - if (mapMenuEntry == null) { + private boolean doEditBookmark(final boolean performAction) { + final TreePath tmpSelectedTreePath = selectedTreePath; + if (tmpSelectedTreePath == null) { return false; } - if (!bookmarksMapMenuPreferences.doMoveUp(mapMenuEntry, performAction)) { + final DefaultMutableTreeNode selectedTreeNode = (DefaultMutableTreeNode) tmpSelectedTreePath.getLastPathComponent(); + if (selectedTreeNode == mapMenu.getRoot()) { return false; } if (performAction) { - bookmarksList.setSelectedIndex(bookmarksList.getSelectedIndex() - 1); + final DefaultMutableTreeNode tmpSelectedTreeNode = (DefaultMutableTreeNode) tmpSelectedTreePath.getLastPathComponent(); + final MapMenuEntryVisitor mapMenuEntryVisitor = new MapMenuEntryVisitor() { + + @Override + public void visit(@NotNull final MapMenuEntryDir mapMenuEntry) { + final BookmarkDirectoryDialog bookmarkDirectoryDialog = new BookmarkDirectoryDialog(ManageBookmarksDialog.this, mapMenuEntry.getTitle()); + if (bookmarkDirectoryDialog.showDialog()) { + mapMenuEntry.setTitle(bookmarkDirectoryDialog.getDirectory()); + bookmarksTree.getModel().valueForPathChanged(tmpSelectedTreePath, mapMenuEntry); + } + } + + @Override + public void visit(@NotNull final MapMenuEntryMap mapMenuEntry) { + final EditBookmarkDialog editBookmarkDialog = new EditBookmarkDialog(ManageBookmarksDialog.this, mapMenuEntry.getTitle()); + if (editBookmarkDialog.showDialog()) { + mapMenuEntry.setTitle(editBookmarkDialog.getDescription()); + bookmarksTree.getModel().valueForPathChanged(tmpSelectedTreePath, mapMenuEntry); + } + } + + }; + ((MapMenuEntry) tmpSelectedTreeNode.getUserObject()).visit(mapMenuEntryVisitor); } return true; } /** - * Moves down the selected bookmark. + * Removes the selected bookmark. * @param performAction whether the action should be performed * @return whether the action can or was performed */ - private boolean doMoveDownBookmark(final boolean performAction) { - final MapMenuEntry<G, A, R> mapMenuEntry = selectedMapMenuEntry; - if (mapMenuEntry == null) { + private boolean doRemoveBookmark(final boolean performAction) { + final TreePath tmpSelectedTreePath = selectedTreePath; + if (tmpSelectedTreePath == null) { return false; } - if (!bookmarksMapMenuPreferences.doMoveDown(mapMenuEntry, performAction)) { + final DefaultMutableTreeNode selectedTreeNode = (DefaultMutableTreeNode) tmpSelectedTreePath.getLastPathComponent(); + if (selectedTreeNode == mapMenu.getRoot()) { return false; } if (performAction) { - bookmarksList.setSelectedIndex(bookmarksList.getSelectedIndex() + 1); + final int[] selectionRows = bookmarksTree.getSelectionRows(); + mapMenu.removeNode(selectedTreeNode); + final int index = selectionRows == null ? 0 : selectionRows[0]; + if (index > 0) { + bookmarksTree.setSelectionRow(index - 1); + } } return true; } /** - * Removes the selected bookmark. + * Create a new directory. * @param performAction whether the action should be performed * @return whether the action can or was performed */ - private boolean doRemoveBookmark(final boolean performAction) { - final MapMenuEntry<G, A, R> mapMenuEntry = selectedMapMenuEntry; - if (mapMenuEntry == null) { + private boolean doNewDirectory(final boolean performAction) { + final TreePath tmpSelectedTreePath = selectedTreePath; + if (tmpSelectedTreePath == null) { return false; } if (performAction) { - final int index = bookmarksList.getSelectedIndex(); - bookmarksMapMenuPreferences.removeMapMenuEntry(mapMenuEntry); - if (index < bookmarksList.getModel().getSize()) { - bookmarksList.setSelectedIndex(index); - } else if (index > 0) { - bookmarksList.setSelectedIndex(index - 1); + final DefaultMutableTreeNode selectedTreeNode = (DefaultMutableTreeNode) tmpSelectedTreePath.getLastPathComponent(); + final BookmarkDirectoryDialog bookmarkDirectoryDialog = new BookmarkDirectoryDialog(this, ""); + if (bookmarkDirectoryDialog.showDialog()) { + final String directory = bookmarkDirectoryDialog.getDirectory(); + final MapMenuEntry mapEntry = new MapMenuEntryDir(directory); + final DefaultMutableTreeNode parent; + final int index; + if (selectedTreeNode == mapMenu.getRoot()) { + parent = selectedTreeNode; + index = 0; + } else { + parent = (DefaultMutableTreeNode) selectedTreeNode.getParent(); + assert parent != null; + index = parent.getIndex(selectedTreeNode) + 1; + assert index != 0; + } + final TreePath treePath = mapMenu.insertNodeInto(mapEntry, parent, index); + bookmarksTree.setSelectionPath(treePath); + } } @@ -402,11 +415,17 @@ */ private void updateActions() { editAction.setEnabled(doEditBookmark(false)); - moveUpAction.setEnabled(doMoveUpBookmark(false)); - moveDownAction.setEnabled(doMoveDownBookmark(false)); removeAction.setEnabled(doRemoveBookmark(false)); - final MapMenuEntry<?, ?, ?> mapMenuEntry = selectedMapMenuEntry; - preview.setIcon(mapMenuEntry == null ? null : new ImageIcon(mapImageCache.getOrCreatePreview(mapMenuEntry.getMapFile()))); + newDirectoryAction.setEnabled(doNewDirectory(false)); + @Nullable final Icon previewIcon; + if (selectedTreePath == null) { + previewIcon = null; + } else { + final DefaultMutableTreeNode tmpSelectedTreeNode = (DefaultMutableTreeNode) selectedTreePath.getLastPathComponent(); + final MapMenuEntry mapMenuEntry = (MapMenuEntry) tmpSelectedTreeNode.getUserObject(); + previewIcon = mapMenuEntryIcons.getIcon(mapMenuEntry); + } + preview.setIcon(previewIcon); } } // class ManageBookmarksDialog Added: trunk/src/app/net/sf/gridarta/gui/bookmarks/MapMenuEntryIcons.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/MapMenuEntryIcons.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/MapMenuEntryIcons.java 2011-02-28 17:53:53 UTC (rev 8850) @@ -0,0 +1,87 @@ +/* + * 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.bookmarks; + +import javax.swing.Icon; +import javax.swing.ImageIcon; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import net.sf.gridarta.gui.mapmenu.MapMenuEntry; +import net.sf.gridarta.gui.mapmenu.MapMenuEntryDir; +import net.sf.gridarta.gui.mapmenu.MapMenuEntryMap; +import net.sf.gridarta.gui.mapmenu.MapMenuEntryVisitor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Generates icons for {@link MapMenuEntry} instances. + * @author Andreas Kirschbaum + */ +public class MapMenuEntryIcons implements MapMenuEntryVisitor { + + /** + * The {@link MapImageCache} for looking up icons. + */ + @NotNull + private final MapImageCache<?, ?, ?> mapImageCache; + + /** + * The result icon. + */ + @Nullable + private Icon icon = null; + + /** + * Creates a new instance. + * @param mapImageCache the map image cache for looking up icons + */ + public MapMenuEntryIcons(@NotNull final MapImageCache<?, ?, ?> mapImageCache) { + this.mapImageCache = mapImageCache; + } + + /** + * Returns an {@link Icon} for a {@link MapMenuEntry} instance. + * @param mapMenuEntry the instance + * @return the icon or <code>null</code> + */ + @Nullable + public Icon getIcon(@NotNull final MapMenuEntry mapMenuEntry) { + mapMenuEntry.visit(this); + final Icon result = icon; + icon = null; + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public void visit(@NotNull final MapMenuEntryDir mapMenuEntry) { + icon = null; + } + + /** + * {@inheritDoc} + */ + @Override + public void visit(@NotNull final MapMenuEntryMap mapMenuEntry) { + icon = new ImageIcon(mapImageCache.getOrCreatePreview(mapMenuEntry.getMapFile())); + } + +} Property changes on: trunk/src/app/net/sf/gridarta/gui/bookmarks/MapMenuEntryIcons.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java 2011-02-27 19:48:47 UTC (rev 8849) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java 2011-02-28 17:53:53 UTC (rev 8850) @@ -19,290 +19,35 @@ package net.sf.gridarta.gui.mapmenu; -import java.io.File; -import java.io.IOException; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import javax.swing.AbstractListModel; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; -import net.sf.gridarta.gui.mapimagecache.MapImageCache; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.mapmanager.FileControl; -import net.sf.gridarta.model.settings.GlobalSettings; import org.jetbrains.annotations.NotNull; /** * Abstract base class for {@link MapMenuPreferences} implementations. * @author Andreas Kirschbaum */ -public abstract class AbstractMapMenuPreferences<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractListModel implements MapMenuPreferences<G, A, R> { +public abstract class AbstractMapMenuPreferences implements MapMenuPreferences { /** - * The {@link MapViewsManager} instance. + * The managed {@link MapMenu}. */ @NotNull - private final MapViewsManager<G, A, R> mapViewsManager; + private final MapMenu mapMenu; /** - * The global settings instance. - */ - @NotNull - private final GlobalSettings globalSettings; - - /** - * The {@link MapImageCache} to use. - */ - @NotNull - private final MapImageCache<G, A, R> mapImageCache; - - /** - * The {@link FileControl}. - */ - @NotNull - private final FileControl<G, A, R> fileControl; - - /** - * List with mapMenuEntries. - */ - @NotNull - private final List<MapMenuEntry<G, A, R>> mapMenuEntries = new LinkedList<MapMenuEntry<G, A, R>>(); - - /** * Creates a new instance. - * @param mapViewsManager the map views manager instance - * @param globalSettings the global settings instance - * @param mapImageCache the map image cache instance - * @param fileControl the file control + * @param key the preferences key prefix */ - protected AbstractMapMenuPreferences(@NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final FileControl<G, A, R> fileControl) { - this.mapViewsManager = mapViewsManager; - this.globalSettings = globalSettings; - this.mapImageCache = mapImageCache; - this.fileControl = fileControl; + protected AbstractMapMenuPreferences(@NotNull final String key) { + mapMenu = new MapMenu(key); } /** - * Creates a new {@link MapMenuEntry}. - * @param title the entry's title - * @param mapFile the entry's map file - * @param replaceExisting whether an existing entry should be replaced - */ - protected void newMapMenuEntry(@NotNull final String title, @NotNull final File mapFile, final boolean replaceExisting) { - final MapMenuEntry<G, A, R> mapMenuEntry = new MapMenuEntry<G, A, R>(title, mapFile, mapViewsManager, mapImageCache, fileControl, getShortDescription(title, getShortMapFile(globalSettings.getMapsDirectory(), mapFile))); - final int index; - if (replaceExisting) { - removeMapMenuEntryInt(mapMenuEntry); // remove old entry to get new entry at first pos. - index = 0; - } else { - index = getSize(); - } - addMapMenuEntryInt(index, mapMenuEntry); - } - - /** - * Returns the base name of a map file. - * @param mapsDirectory the maps directory - * @param mapFile the map file - * @return the base name - */ - @NotNull - private static String getShortMapFile(@NotNull final File mapsDirectory, @NotNull final File mapFile) { - String canonicalMapFile; - String canonicalMapsDirectory; - try { - canonicalMapFile = mapFile.getCanonicalPath(); - canonicalMapsDirectory = mapsDirectory.getCanonicalPath(); - } catch (final IOException ignored) { - canonicalMapFile = mapFile.getAbsolutePath(); - canonicalMapsDirectory = mapsDirectory.getAbsolutePath(); - } - - if (canonicalMapFile.startsWith(canonicalMapsDirectory)) { - return canonicalMapFile.substring(canonicalMapsDirectory.length()).replace('\\', '/'); - } else { - return canonicalMapFile.replace('\\', '/'); - } - } - - /** - * Adds a {@link MapMenuEntry}. The change is not saved to preferences. - * @param index the insertion index - * @param mapMenuEntry the map menu entry - */ - protected void addMapMenuEntryInt(final int index, @NotNull final MapMenuEntry<G, A, R> mapMenuEntry) { - mapMenuEntries.add(index, mapMenuEntry); - fireIntervalAdded(this, index, index); - } - - /** * {@inheritDoc} */ - @Override - public void addMapMenuEntry(@NotNull final String title, @NotNull final File mapFile) { - addMapMenuEntryInt(title, mapFile); - save(); - } - - /** - * Adds a {@link MapMenuEntry}. The change is not saved to preferences. - * @param title the entry's title - * @param mapFile the entry's short map file - */ - protected abstract void addMapMenuEntryInt(@NotNull String title, @NotNull File mapFile); - - /** - * {@inheritDoc} - */ - @Override - public void removeMapMenuEntry(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry) { - removeMapMenuEntryInt(mapMenuEntry); - save(); - } - - /** - * Removes a {@link MapMenuEntry}. The change is not saved to preferences. - * @param mapMenuEntry the map menu entry - */ - protected void removeMapMenuEntryInt(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry) { - final int index = mapMenuEntries.indexOf(mapMenuEntry); - if (index == -1) { - return; - } - - mapMenuEntries.remove(index); - fireIntervalRemoved(this, index, index); - } - - /** - * {@inheritDoc} - */ - @Override - public int getSize() { - return mapMenuEntries.size(); - } - - /** - * {@inheritDoc} - */ - @Override - public Object getElementAt(final int index) { - return mapMenuEntries.get(index); - } - - /** - * {@inheritDoc} - */ @NotNull @Override - public Iterator<MapMenuEntry<G, A, R>> iterator() { - return new Iterator<MapMenuEntry<G, A, R>>() { - - /** - * The {@link Iterator} to forward to. - */ - @NotNull - private final Iterator<MapMenuEntry<G, A, R>> it = mapMenuEntries.iterator(); - - /** - * The index of the current entry. - */ - private int index = -1; - - @Override - public boolean hasNext() { - return it.hasNext(); - } - - @Override - public MapMenuEntry<G, A, R> next() { - index++; - return it.next(); - } - - @Override - public void remove() { - it.remove(); - fireIntervalRemoved(AbstractMapMenuPreferences.this, index, index); - index--; - save(); - } - - }; + public MapMenu getMapMenu() { + return mapMenu; } - /** - * Saves all entries to preferences. - */ - protected abstract void save(); - - /** - * Moves an entry upwards. - * @param mapMenuEntry the entry - * @param performAction whether to perform the move or just check - * @return whether the action was or can be performed - */ - public boolean doMoveUp(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry, final boolean performAction) { - final int index = indexOf(mapMenuEntry); - if (index == -1) { - throw new IllegalArgumentException(); - } - - if (index <= 0) { - return false; - } - - if (performAction) { - mapMenuEntries.remove(index); - mapMenuEntries.add(index - 1, mapMenuEntry); - save(); - fireContentsChanged(this, index - 1, index); - } - - return true; - } - - /** - * Moves an entry downwards. - * @param mapMenuEntry the entry - * @param performAction whether to perform the move or just check - * @return whether the action was or can be performed - */ - public boolean doMoveDown(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry, final boolean performAction) { - final int index = indexOf(mapMenuEntry); - if (index == -1) { - throw new IllegalArgumentException(); - } - - if (index >= mapMenuEntries.size() - 1) { - return false; - } - - if (performAction) { - mapMenuEntries.remove(index); - mapMenuEntries.add(index + 1, mapMenuEntry); - save(); - fireContentsChanged(this, index, index + 1); - } - - return true; - } - - /** - * Returns the index of a {@link MapMenuEntry} within {@link - * #mapMenuEntries}. - * @param mapMenuEntry the map menu entry - * @return the index - */ - protected int indexOf(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry) { - for (int i = 0; i < mapMenuEntries.size(); i++) { - if (mapMenuEntries.get(i) == mapMenuEntry) { - return i; - } - } - return -1; - } - } // class AbstractMapMenuPreferences Added: trunk/src/app/net/sf/gridarta/gui/mapmenu/ActionFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/ActionFactory.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/ActionFactory.java 2011-02-28 17:53:53 UTC (rev 8850) @@ -0,0 +1,120 @@ +/* + * 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.mapmenu; + +import java.util.IdentityHashMap; +import java.util.Map; +import javax.swing.Action; +import net.sf.gridarta.gui.map.mapview.MapViewsManager; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import net.sf.gridarta.model.mapmanager.FileControl; +import org.jetbrains.annotations.NotNull; + +/** + * A factory for creating {@link MapMenuAction} instances. + * @author Andreas Kirschbaum + */ +public class ActionFactory { + + /** + * The {@link MapViewsManager} for opening map files. + */ + @NotNull + private final MapViewsManager<?, ?, ?> mapViewsManager; + + /** + * The {@link FileControl} for reporting errors. + */ + @NotNull + private final FileControl<?, ?, ?> fileControl; + + /** + * The {@link MapImageCache} to query. + */ + @NotNull + private final MapImageCache<?, ?, ?> mapImageCache; + + /** + * Maps {@link MapMenuEntryMap} instance to associated {@link + * MapMenuAction}. + */ + @NotNull + private final Map<MapMenuEntryMap, MapMenuAction> actions = new IdentityHashMap<MapMenuEntryMap, MapMenuAction>(); + + /** + * Keys of {@link #actions} to delete when {@link #end()} is called. + */ + @NotNull + private final Map<MapMenuEntryMap, Void> keysToDelete = new IdentityHashMap<MapMenuEntryMap, Void>(); + + /** + * Creates a new instance. + * @param mapViewsManager the map views manager for opening map files + * @param fileControl the file control for reporting errors + * @param mapImageCache the map image cache to query + */ + public ActionFactory(@NotNull final MapViewsManager<?, ?, ?> mapViewsManager, @NotNull final FileControl<?, ?, ?> fileControl, @NotNull final MapImageCache<?, ?, ?> mapImageCache) { + this.mapViewsManager = mapViewsManager; + this.fileControl = fileControl; + this.mapImageCache = mapImageCache; + } + + /** + * Begins a lookup sequence. + */ + public void begin() { + keysToDelete.clear(); + for (final MapMenuEntryMap mapMenuEntryMap : actions.keySet()) { + keysToDelete.put(mapMenuEntryMap, null); + } + } + + /** + * Ends a lookup sequence. All actions not looked up between the preceding + * call to {@link #begin()} are deleted. + */ + public void end() { + for (final MapMenuEntryMap mapMenuEntryMap : keysToDelete.keySet()) { + actions.remove(mapMenuEntryMap); + } + keysToDelete.clear(); + } + + /** + * Returns an {@link Action} for a {@link MapMenuEntryMap} instance. + * @param mapMenuEntryMap the instance + * @return the action + */ + @NotNull + public Action getAction(@NotNull final MapMenuEntryMap mapMenuEntryMap) { + keysToDelete.remove(mapMenuEntryMap); + final MapMenuAction existingAction = actions.get(mapMenuEntryMap); + final MapMenuAction action; + if (existingAction == null) { + action = new MapMenuAction(mapMenuEntryMap, mapViewsManager, fileControl); + actions.put(mapMenuEntryMap, action); + } else { + action = existingAction; + } + action.update(mapImageCache); + return action; + } + +} Property changes on: trunk/src/app/net/sf/gridarta/gui/mapmenu/ActionFactory.java _________________________________________________________... [truncated message content] |
From: <aki...@us...> - 2011-02-27 19:48:53
|
Revision: 8849 http://gridarta.svn.sourceforge.net/gridarta/?rev=8849&view=rev Author: akirschbaum Date: 2011-02-27 19:48:47 +0000 (Sun, 27 Feb 2011) Log Message: ----------- Fix FilePreferences.keys() returning incorrect keys. Modified Paths: -------------- trunk/preferences/src/app/net/sf/gridarta/preferences/Storage.java Modified: trunk/preferences/src/app/net/sf/gridarta/preferences/Storage.java =================================================================== --- trunk/preferences/src/app/net/sf/gridarta/preferences/Storage.java 2011-02-27 17:46:23 UTC (rev 8848) +++ trunk/preferences/src/app/net/sf/gridarta/preferences/Storage.java 2011-02-27 19:48:47 UTC (rev 8849) @@ -165,7 +165,7 @@ final Map<String, String> map = values.get(path); assert map != null; // AbstractPreferences.keysSpi() ensures this - final Set<String> keys = values.keySet(); + final Set<String> keys = map.keySet(); return keys.toArray(new String[keys.size()]); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-02-27 17:46:29
|
Revision: 8848 http://gridarta.svn.sourceforge.net/gridarta/?rev=8848&view=rev Author: akirschbaum Date: 2011-02-27 17:46:23 +0000 (Sun, 27 Feb 2011) Log Message: ----------- Remove unused type parameters. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java Modified: trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java 2011-02-27 17:42:14 UTC (rev 8847) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java 2011-02-27 17:46:23 UTC (rev 8848) @@ -183,7 +183,7 @@ if (performAction) { final A mapArchObject = mapModel.getMapArchObject(); - final EditBookmarkDialog<G, A, R> editBookmarkDialog = new EditBookmarkDialog<G, A, R>(mapView.getInternalFrame(), mapArchObject.getMapName()); + final EditBookmarkDialog editBookmarkDialog = new EditBookmarkDialog(mapView.getInternalFrame(), mapArchObject.getMapName()); if (editBookmarkDialog.showDialog()) { bookmarksMapMenuManager.addRecent(mapModel, editBookmarkDialog.getDescription()); } Modified: trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java 2011-02-27 17:42:14 UTC (rev 8847) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java 2011-02-27 17:46:23 UTC (rev 8848) @@ -33,9 +33,6 @@ import javax.swing.text.JTextComponent; import net.sf.gridarta.gui.utils.GUIConstants; import net.sf.gridarta.gui.utils.TextComponentUtils; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; @@ -46,7 +43,7 @@ * A dialog that displays one bookmark and allows to edit the values. * @author Andreas Kirschbaum */ -public class EditBookmarkDialog<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends JOptionPane { +public class EditBookmarkDialog extends JOptionPane { /** * The serial Version UID. Modified: trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java 2011-02-27 17:42:14 UTC (rev 8847) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java 2011-02-27 17:46:23 UTC (rev 8848) @@ -320,7 +320,7 @@ } if (performAction) { - final EditBookmarkDialog<G, A, R> editBookmarkDialog = new EditBookmarkDialog<G, A, R>(this, mapMenuEntry.getTitle()); + final EditBookmarkDialog editBookmarkDialog = new EditBookmarkDialog(this, mapMenuEntry.getTitle()); if (editBookmarkDialog.showDialog()) { bookmarksMapMenuPreferences.setTitle(mapMenuEntry, editBookmarkDialog.getDescription()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-02-27 17:42:20
|
Revision: 8847 http://gridarta.svn.sourceforge.net/gridarta/?rev=8847&view=rev Author: akirschbaum Date: 2011-02-27 17:42:14 +0000 (Sun, 27 Feb 2011) Log Message: ----------- Extract duplicated code. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java Modified: trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java 2011-02-22 20:12:04 UTC (rev 8846) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java 2011-02-27 17:42:14 UTC (rev 8847) @@ -166,7 +166,7 @@ */ @ActionMethod public void editBookmarkOkay() { - if (!getDescription().isEmpty()) { + if (isOkEnabled()) { setValue(okButton); } } @@ -193,7 +193,15 @@ * {@link #descriptionField}. */ private void updateOkButton() { - okButton.setEnabled(!getDescription().isEmpty()); + okButton.setEnabled(isOkEnabled()); } + /** + * Returns whether the "ok" button is enabled. + * @return whether the "ok" button is enabled + */ + private boolean isOkEnabled() { + return !getDescription().isEmpty(); + } + } // class EditBookmarkDialog This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-02-22 20:12:11
|
Revision: 8846 http://gridarta.svn.sourceforge.net/gridarta/?rev=8846&view=rev Author: akirschbaum Date: 2011-02-22 20:12:04 +0000 (Tue, 22 Feb 2011) Log Message: ----------- Fix ambiguous French menu shortcuts. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/messages_fr.properties Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-02-01 19:47:09 UTC (rev 8845) +++ trunk/atrinik/ChangeLog 2011-02-22 20:12:04 UTC (rev 8846) @@ -1,3 +1,7 @@ +2011-02-22 Andreas Kirschbaum + + * Fix ambiguous French menu shortcuts. + 2011-02-01 Andreas Kirschbaum * Release 0.9. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-02-01 19:47:09 UTC (rev 8845) +++ trunk/crossfire/ChangeLog 2011-02-22 20:12:04 UTC (rev 8846) @@ -1,3 +1,7 @@ +2011-02-22 Andreas Kirschbaum + + * Fix ambiguous French menu shortcuts. + 2011-02-01 Andreas Kirschbaum * Release 0.9. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-02-01 19:47:09 UTC (rev 8845) +++ trunk/daimonin/ChangeLog 2011-02-22 20:12:04 UTC (rev 8846) @@ -1,3 +1,7 @@ +2011-02-22 Andreas Kirschbaum + + * Fix ambiguous French menu shortcuts. + 2011-02-01 Andreas Kirschbaum * Release 0.9. Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2011-02-01 19:47:09 UTC (rev 8845) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2011-02-22 20:12:04 UTC (rev 8846) @@ -68,7 +68,7 @@ #goNorthWest.shortdescription= goMap.text=Aller \u00e0 une carte... -goMap.mnemonic=M +goMap.mnemonic=A goMap.shortdescription=Ouvrir une carte par nom partiel. goMap.accel=ctrl pressed N @@ -117,7 +117,7 @@ closeAllMaps.text=Tout fermer closeAllMaps.shortdescription=Ferme toutes les cartes ouvertes. #closeAllMaps.longdescription= -closeAllMaps.mnemonic=U +closeAllMaps.mnemonic=T saveAllMaps.text=Engistrer toutes les cartes saveAllMaps.shortdescription=Enregistre toutes les cartes modifi\u00e9s. @@ -127,7 +127,7 @@ #gridVisible.shortdescription= smoothing.text=Lissage -#smoothing.mnemonic= +smoothing.mnemonic=L smoothing.shortdescription=Active le lissage des images, permettant un rendu moins carr\u00e9. tileShow.text=Montrer les cartes li\u00e9es @@ -146,7 +146,7 @@ shrinkMapSize.shortdescription=Supprime les espaces inutiles \u00e0 droite et en bas. autoJoin.text=Auto-connection des murs -#autoJoin.mnemonic= +autoJoin.mnemonic=C autoJoin.shortdescription=Active ou d\u00e9sactive la connexion automatique des murs. #autoJoin.longdescription= @@ -169,12 +169,12 @@ #enterExitNotSaved.message= nextExit.text=Sortie suivante -#nextExit.mnemonic= +nextExit.mnemonic=S nextExit.shortdescription=S\u00e9lectionne la sortie suivante sur la carte courante. #nextExit.longdescription= prevExit.text=Sortie pr\u00e9c\u00e9dente -#prevExit.mnemonic= +prevExit.mnemonic=P prevExit.shortdescription=S\u00e9lectionne la sortie pr\u00e9c\u00e9dente sur la carte courante. #prevExit.longdescription= @@ -601,7 +601,7 @@ undo.text=Annuler undo.name=Annuler {0} undo.shortdescription=Annuler la derni\u00e8re action -undo.mnemonic=U +undo.mnemonic=A redo.text=R\u00e9p\u00e9ter redo.name=R\u00e9p\u00e9ter {0} @@ -641,7 +641,7 @@ recent.text=R\u00e9cemment ouvert... recent.shortdescription=Charge une carte r\u00e9cemment ouverte. -#recent.mnemonic= +recent.mnemonic=C #recentItem.shortdescriptionformat= newMap.text=Nouveau @@ -694,26 +694,26 @@ #pasteTiled.longdescription= shift.text=D\u00e9caler -shift.mnemonic=S +shift.mnemonic=D shift.shortdescription=D\u00e9cale les cases s\u00e9lectionn\u00e9es. shiftNorth.text=D\u00e9caler vers le nord -#shiftNorth.mnemonic= +shiftNorth.mnemonic=N shiftNorth.shortdescription=D\u00e9cale la s\u00e9lection vers le nord. shiftNorthEast.text=D\u00e9caler vers le nord-est shiftNorthEast.shortdescription=D\u00e9cale la s\u00e9lection vers le nord-est. shiftEast.text=D\u00e9caler vers l'est -#shiftEast.mnemonic= +shiftEast.mnemonic=E shiftEast.shortdescription=D\u00e9cale la s\u00e9lection vers l'est. shiftSouthEast.text=D\u00e9caler vers le sud-est shiftSouthEast.shortdescription=D\u00e9cale la s\u00e9lection vers le sud-est. shiftSouth.text=D\u00e9caler vers le sud -#shiftSouth.mnemonic= +shiftSouth.mnemonic=S shiftSouth.shortdescription=D\u00e9cale la s\u00e9lection vers le sud. shiftSouthWest.text=D\u00e9caler vers le sud-ouest shiftSouthWest.shortdescription=D\u00e9cale la s\u00e9lection vers le sud-ouest. shiftWest.text=D\u00e9caler vers l'ouest -#shiftWest.mnemonic= +shiftWest.mnemonic=O shiftWest.shortdescription=D\u00e9cale la s\u00e9lection vers l'ouest. shiftNorthWest.text=D\u00e9caler vers le nord-ouest shiftNorthWest.shortdescription=D\u00e9cale la s\u00e9lection vers le nord-ouest. @@ -723,17 +723,17 @@ #replace.shortdescription= fillAuto.text=Remplir -#fillAuto.mnemonic= +fillAuto.mnemonic=P fillAuto.shortdescription=Remplit les cases s\u00e9lectionn\u00e9es, en effa\u00e7ant les objets existants. #fillAuto.longdescription= fillAbove.text=Remplir au-dessus -fillAbove.mnemonic=H +fillAbove.mnemonic=S fillAbove.shortdescription=Remplit la s\u00e9lection en ajoutant au-dessus des objets existants. #fillAbove.longdescription= fillBelow.text=Remplir en-dessous -fillBelow.mnemonic=B +fillBelow.mnemonic=U fillBelow.shortdescription=Remplit la s\u00e9lection en ajoutant au-dessous des objets existants. #fillBelow.longdescription= @@ -771,7 +771,7 @@ # Resources resources.text=Ressources -resources.mnemonic=R +resources.mnemonic=U collectArches.text=Rassembler arch\u00e9types collectArches.mnemonic=A @@ -779,7 +779,7 @@ #collectArches.longdescription= reloadFaces.text=Recharger les images -#reloadFaces.mnemonic= +reloadFaces.mnemonic=I reloadFaces.shortdescription=Recharge toutes les images des arch\u00e9types. @@ -787,7 +787,7 @@ # Analyze analyze.text=Analyse -#analyze.mnemonic= +analyze.mnemonic=Y #enabled.text= @@ -825,14 +825,14 @@ ########### # Bookmarks bookmarks.text=Raccourcis -#bookmarks.mnemonic= +bookmarks.mnemonic=R addBookmark.text=Ajouter un raccourci -#addBookmark.mnemonic= +addBookmark.mnemonic=A addBookmark.shortdescription=Ajoute un raccourci sur la carte courante. manageBookmarks.text=G\u00e9rer les raccourcis -#manageBookmarks.mnemonic= +manageBookmarks.mnemonic=G manageBookmarks.shortdescription=Permet de g\u00e9rer les raccourcis d\u00e9finis. #bookmarkItem.shortdescriptionformat= @@ -849,7 +849,7 @@ #showHelp.shortdescription= tipOfTheDay.text=Astuces -#tipOfTheDay.mnemonic= +tipOfTheDay.mnemonic=S tipOfTheDay.shortdescription=Affiche les astuces du programme. about.text=\u00c0 propos... @@ -859,8 +859,8 @@ aboutTab.title=\u00c0 propos aboutRuntimeProperties.title=Param\u00e8tres d'ex\u00e9cution -#license.text= -#license.mnemonic= +license.text=Licence +license.mnemonic=L license.title=Licence #license.missing= @@ -921,7 +921,7 @@ #addNewPickmap.shortdescription= deletePickmap.text=Supprimer l'assortiment -#deletePickmap.mnemonic= +deletePickmap.mnemonic=S deletePickmap.shortdescription=Supprime l'assortiment actif. openPickmapMap.text=Ouvrir l'assortiment actif comme carte @@ -943,7 +943,7 @@ deletePickmapFolder.shortdescription=Supprime le dossier actif d'assortiments. pickmapFolders.text=Dossiers -#pickmapFolders.mnemonic= +pickmapFolders.mnemonic=D pickmapFolders.shortdescription=Dossiers d'assortiments. @@ -1405,12 +1405,12 @@ mapwindowFile.mnemonic=F mapwindowEdit.text=\u00c9dition -mapwindowEdit.mnemonic=E +mapwindowEdit.mnemonic=D mapwindowMap.text=Carte mapwindowMap.mnemonic=C -#mapwindowCursor.text= +mapwindowCursor.text=Cursor mapwindowCursor.mnemonic=U This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-02-01 19:47:15
|
Revision: 8845 http://gridarta.svn.sourceforge.net/gridarta/?rev=8845&view=rev Author: akirschbaum Date: 2011-02-01 19:47:09 +0000 (Tue, 01 Feb 2011) Log Message: ----------- Fix version number. Modified Paths: -------------- trunk/debian/changelog Modified: trunk/debian/changelog =================================================================== --- trunk/debian/changelog 2011-02-01 18:20:03 UTC (rev 8844) +++ trunk/debian/changelog 2011-02-01 19:47:09 UTC (rev 8845) @@ -1,3 +1,9 @@ +gridarta (0.9.trunk) unstable; urgency=low + + * Release 0.9. + + -- Andreas Kirschbaum <aki...@us...> Tue, 01 Feb 2011 20:45:57 +0100 + gridarta (0.8.trunk) unstable; urgency=low * Initial Release. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-02-01 18:20:09
|
Revision: 8844 http://gridarta.svn.sourceforge.net/gridarta/?rev=8844&view=rev Author: akirschbaum Date: 2011-02-01 18:20:03 +0000 (Tue, 01 Feb 2011) Log Message: ----------- Create tag 0.9. Added Paths: ----------- tags/0.9/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-02-01 18:07:15
|
Revision: 8843 http://gridarta.svn.sourceforge.net/gridarta/?rev=8843&view=rev Author: akirschbaum Date: 2011-02-01 18:07:09 +0000 (Tue, 01 Feb 2011) Log Message: ----------- Create branch 0.9. Added Paths: ----------- branches/0.9/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-02-01 18:05:56
|
Revision: 8842 http://gridarta.svn.sourceforge.net/gridarta/?rev=8842&view=rev Author: akirschbaum Date: 2011-02-01 18:05:48 +0000 (Tue, 01 Feb 2011) Log Message: ----------- Release 0.9. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-02-01 17:54:58 UTC (rev 8841) +++ trunk/atrinik/ChangeLog 2011-02-01 18:05:48 UTC (rev 8842) @@ -1,3 +1,7 @@ +2011-02-01 Andreas Kirschbaum + + * Release 0.9. + 2011-01-10 Andreas Kirschbaum * Properly create inventory objects when inserting game objects Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-02-01 17:54:58 UTC (rev 8841) +++ trunk/crossfire/ChangeLog 2011-02-01 18:05:48 UTC (rev 8842) @@ -1,5 +1,7 @@ 2011-02-01 Andreas Kirschbaum + * Release 0.9. + * Collect resources. 2011-01-10 Andreas Kirschbaum Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-02-01 17:54:58 UTC (rev 8841) +++ trunk/daimonin/ChangeLog 2011-02-01 18:05:48 UTC (rev 8842) @@ -1,3 +1,7 @@ +2011-02-01 Andreas Kirschbaum + + * Release 0.9. + 2010-12-20 Andreas Kirschbaum * Report truncated archetype definitions. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-02-01 17:55:04
|
Revision: 8841 http://gridarta.svn.sourceforge.net/gridarta/?rev=8841&view=rev Author: akirschbaum Date: 2011-02-01 17:54:58 +0000 (Tue, 01 Feb 2011) Log Message: ----------- Revert. Removed Paths: ------------- branches/0.9/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-02-01 17:52:52
|
Revision: 8840 http://gridarta.svn.sourceforge.net/gridarta/?rev=8840&view=rev Author: akirschbaum Date: 2011-02-01 17:52:46 +0000 (Tue, 01 Feb 2011) Log Message: ----------- Create branch 0.9. Added Paths: ----------- branches/0.9/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-02-01 08:24:28
|
Revision: 8839 http://gridarta.svn.sourceforge.net/gridarta/?rev=8839&view=rev Author: akirschbaum Date: 2011-02-01 08:24:21 +0000 (Tue, 01 Feb 2011) Log Message: ----------- Collect resources. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/resource/conf/archetypes trunk/crossfire/resource/resource/conf/smooth Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-01-25 22:03:48 UTC (rev 8838) +++ trunk/crossfire/ChangeLog 2011-02-01 08:24:21 UTC (rev 8839) @@ -1,3 +1,7 @@ +2011-02-01 Andreas Kirschbaum + + * Collect resources. + 2011-01-10 Andreas Kirschbaum * Properly create inventory objects when inserting game objects Modified: trunk/crossfire/resource/resource/conf/archetypes =================================================================== --- trunk/crossfire/resource/resource/conf/archetypes 2011-01-25 22:03:48 UTC (rev 8838) +++ trunk/crossfire/resource/resource/conf/archetypes 2011-02-01 08:24:21 UTC (rev 8839) @@ -16481,6 +16481,42 @@ slaying /python/Moving_Fog.py end end +Object temp_summon_fog +editor_folder ground/ground +name fog +face fog.111 +animation temp_fog +type 67 +move_type fly_low +no_pick 1 +is_used_up 1 +resist_fire 100 +resist_electricity 100 +resist_confusion 100 +resist_acid 100 +resist_drain 100 +resist_weaponmagic 100 +resist_ghosthit 100 +resist_poison 100 +resist_slow 100 +resist_paralyze 100 +resist_turn_undead 100 +resist_fear 100 +resist_cancellation 100 +resist_deplete 100 +resist_death 100 +material 1 +changing 1 +blocksview 1 +weight 100000 +value 1 +speed 0.5 +arch event_destroy +name GenerateFog +title Python +slaying /python/Moving_Fog.py +end +end Object thorns editor_folder ground/ground type 102 @@ -41232,7 +41268,7 @@ Object pl_dragon editor_folder player/race msg -Skills: Clawing, Levitate, Woodsman, Evocation +Skills: Clawing, Levitate, Woodsman, Pyromancy Resistances: None Attunements: None Special: Can not use weapons or most armor. Natural armor improves over time @@ -41280,6 +41316,8 @@ maxhp 30 maxsp 30 maxgrace 30 +race_choice_1 dragon_ability_force_fire dragon_ability_force_cold dragon_ability_force_electricity dragon_ability_force_poison +race_choice_description_1 Choose a dragon focus end Object dragon_skin_force editor_folder player/race @@ -41301,6 +41339,66 @@ neutral 1 no_drop 1 end +Object dragon_ability_force_fire +editor_folder player/race +name Fire hatchling focus +title fire hatchling +invisible 1 +type 10 +exp 2 +neutral 1 +no_drop 1 +face pl_dragon_r.151 +animation pl_dragon_r +is_animated 1 +anim_speed -1 +auto_apply 1 +end +Object dragon_ability_force_electricity +editor_folder player/race +name Electricity hatchling focus +title electricity hatchling +invisible 1 +type 10 +exp 3 +neutral 1 +no_drop 1 +face pl_dragon.151 +animation pl_dragon_blue +is_animated 1 +anim_speed -1 +auto_apply 1 +end +Object dragon_ability_force_cold +editor_folder player/race +name Cold hatchling focus +title cold hatchling +invisible 1 +type 10 +exp 4 +neutral 1 +no_drop 1 +face pl_dragon_bl.151 +animation pl_dragon_bl +is_animated 1 +anim_speed -1 +auto_apply 1 +end +Object dragon_ability_force_poison +editor_folder player/race +name Poison hatchling focus +title poison hatchling +invisible 1 +type 10 +exp 10 +neutral 1 +no_drop 1 +face pl_dragon_g.151 +animation pl_dragon_g +is_animated 1 +anim_speed -1 +auto_apply 1 +end Object pl_half_orc editor_folder player/race msg @@ -46153,6 +46251,7 @@ value 90 sp 10 casting_time 3 +skill evocation path_attuned 8 other_arch ball_lightning dam 8 @@ -46186,6 +46285,7 @@ attacktype 4 no_drop 1 invisible 1 +skill pyromancy end Object abil_fear editor_folder spell/Ability @@ -46209,6 +46309,7 @@ attacktype 16384 no_drop 1 invisible 1 +skill sorcery end Object abil_create_fire_wall editor_folder spell/Ability @@ -46220,6 +46321,7 @@ casting_time 4 path_attuned 2048 other_arch firebreath +skill pyromancy type 101 subtype 15 value 60 @@ -46273,6 +46375,7 @@ dam_modifier 4 duration 11 maxsp 48 +skill evocation type 101 subtype 4 value 30 @@ -46303,6 +46406,7 @@ attacktype 16 no_drop 1 invisible 1 +skill evocation end Object abil_large_icestorm editor_folder spell/Ability @@ -46326,6 +46430,7 @@ attacktype 16 no_drop 1 invisible 1 +skill evocation end Object abil_medium_fireball editor_folder spell/Ability @@ -46348,6 +46453,7 @@ attacktype 4 no_drop 1 invisible 1 +skill pyromancy food 4 end Object abil_poison_cloud @@ -46371,6 +46477,7 @@ attacktype 1024 no_drop 1 invisible 1 +skill sorcery food 5 end Object abil_slow @@ -46395,6 +46502,7 @@ attacktype 2048 no_drop 1 invisible 1 +skill sorcery end Object ability_dragonbreath editor_folder spell/Ability @@ -47957,6 +48065,7 @@ other_arch shell dam 7 dam_modifier 0 +skill pyromancy range 8 duration 4 maxsp 0 @@ -54140,7 +54249,7 @@ value 20 no_drop 1 invisible 1 -other_arch fog +other_arch temp_summon_fog dam 2 dam_modifier 10 monster 1 @@ -62433,7 +62542,7 @@ face bow.111 dam 7 weight 12000 -value 50 +value 40 sp 50 no_strength 0 attacktype 1 @@ -62452,7 +62561,7 @@ face compositebow.111 dam 14 weight 3000 -value 100 +value 60 sp 35 no_strength 0 attacktype 1 @@ -62472,7 +62581,7 @@ weight 25000 sp 40 wc 1 -value 75 +value 40 no_strength 1 attacktype 1 name_pl crossbows @@ -62551,7 +62660,7 @@ face huntersbow.111 dam 10 weight 2000 -value 50 +value 40 sp 20 no_strength 0 attacktype 1 @@ -62591,7 +62700,7 @@ face longbow.111 dam 20 weight 8000 -value 500 +value 200 sp 40 no_strength 0 attacktype 1 @@ -63019,7 +63128,7 @@ material 18 dam 12 weight 26500 -value 100 +value 50 can_impale 1 attacktype 1 weapontype 5 @@ -63037,7 +63146,7 @@ material 18 dam 18 weight 35500 -value 500 +value 200 can_impale 1 can_cut 1 can_dam_armour 1 @@ -63158,7 +63267,7 @@ material 2 dam 7 weight 8500 -value 50 +value 25 attacktype 1 weapontype 5 name_pl spears @@ -63898,7 +64007,7 @@ material 2 dam 1 weight 1500 -value 35 +value 15 attacktype 1 weapontype 2 name_pl throwing daggers Modified: trunk/crossfire/resource/resource/conf/smooth =================================================================== --- trunk/crossfire/resource/resource/conf/smooth 2011-01-25 22:03:48 UTC (rev 8838) +++ trunk/crossfire/resource/resource/conf/smooth 2011-02-01 08:24:21 UTC (rev 8839) @@ -77,7 +77,6 @@ fireball.112 fireball_S.112 fireball.113 fireball_S.113 flagstone.111 flagstone_S.111 -fog.111 fog_S.111 footpath_0.111 grass_S.111 footpath_1.111 grass_S.111 footpath_2.111 grass_S.111 @@ -99,7 +98,6 @@ grass_br_gr.111 empty_S.111 grassbrown.111 empty_S.111 grassdark.111 grassdark_S.111 -grassmedium.111 grassmedium_S.111 grasspond.111 grass_S.111 gray-white-h-marble.111 empty_S.111 gray-white-h-marble.112 empty_S.111 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-01-25 22:03:54
|
Revision: 8838 http://gridarta.svn.sourceforge.net/gridarta/?rev=8838&view=rev Author: akirschbaum Date: 2011-01-25 22:03:48 +0000 (Tue, 25 Jan 2011) Log Message: ----------- Fix Javadoc issue. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/MapTilePanel.java Modified: trunk/src/app/net/sf/gridarta/gui/map/maptilepane/MapTilePanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/MapTilePanel.java 2011-01-25 21:59:56 UTC (rev 8837) +++ trunk/src/app/net/sf/gridarta/gui/map/maptilepane/MapTilePanel.java 2011-01-25 22:03:48 UTC (rev 8838) @@ -65,9 +65,6 @@ tilePanel.addTextFieldActionListener(actionListener); } - /** - * {@inheritDoc} - */ @NotNull public TilePanel getTilePanel() { return tilePanel; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-01-25 22:00:04
|
Revision: 8837 http://gridarta.svn.sourceforge.net/gridarta/?rev=8837&view=rev Author: akirschbaum Date: 2011-01-25 21:59:56 +0000 (Tue, 25 Jan 2011) Log Message: ----------- Rewrite complex expressions. Modified Paths: -------------- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java trunk/model/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-01-25 20:49:06 UTC (rev 8836) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-01-25 21:59:56 UTC (rev 8837) @@ -69,7 +69,15 @@ */ @Test public void testMpartIdOk() throws IOException, UndefinedArchetypeException { - check("Object head\n" + "mpart_id 1\n" + "end\nMore\nObject tail\n" + "mpart_id 1\n" + "end\n", false, false, 2); + final StringBuilder input = new StringBuilder(); + input.append("Object head\n"); + input.append("mpart_id 1\n"); + input.append("end\n"); + input.append("More\n"); + input.append("Object tail\n"); + input.append("mpart_id 1\n"); + input.append("end\n"); + check(input.toString(), false, false, 2); Assert.assertEquals(1, getArchetypeSet().getArchetype("head").getMultiShapeID()); Assert.assertEquals(1, getArchetypeSet().getArchetype("tail").getMultiShapeID()); } @@ -81,7 +89,15 @@ */ @Test public void testMpartIdInconsistent() throws IOException, UndefinedArchetypeException { - check("Object head\n" + "mpart_id 1\n" + "end\nMore\nObject tail\n" + "mpart_id 2\n" + "end\n", false, true, 2); + final StringBuilder input = new StringBuilder(); + input.append("Object head\n"); + input.append("mpart_id 1\n"); + input.append("end\n"); + input.append("More\n"); + input.append("Object tail\n"); + input.append("mpart_id 2\n"); + input.append("end\n"); + check(input.toString(), false, true, 2); Assert.assertEquals(1, getArchetypeSet().getArchetype("head").getMultiShapeID()); Assert.assertEquals(2, getArchetypeSet().getArchetype("tail").getMultiShapeID()); } @@ -93,7 +109,15 @@ */ @Test public void testInventoryGameObjects() throws IOException, UndefinedArchetypeException { - check("Object arch1\n" + "end\n" + "Object arch2\n" + "arch arch1\n" + "name name1\n" + "end\n" + "end\n", false, false, 2); + final StringBuilder input = new StringBuilder(); + input.append("Object arch1\n"); + input.append("end\n"); + input.append("Object arch2\n"); + input.append("arch arch1\n"); + input.append("name name1\n"); + input.append("end\n"); + input.append("end\n"); + check(input.toString(), false, false, 2); final Archetype arch2 = getArchetypeSet().getArchetype("arch2"); Assert.assertEquals(1, arch2.countInvObjects()); final GameObject inv = arch2.iterator().next(); Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-01-25 20:49:06 UTC (rev 8836) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-01-25 21:59:56 UTC (rev 8837) @@ -67,7 +67,15 @@ */ @Test public void testInventoryGameObjects() throws IOException, UndefinedArchetypeException { - check("Object arch1\n" + "end\n" + "Object arch2\n" + "arch arch1\n" + "name name1\n" + "end\n" + "end\n", false, false, 2); + final StringBuilder input = new StringBuilder(); + input.append("Object arch1\n"); + input.append("end\n"); + input.append("Object arch2\n"); + input.append("arch arch1\n"); + input.append("name name1\n"); + input.append("end\n"); + input.append("end\n"); + check(input.toString(), false, false, 2); final Archetype arch2 = getArchetypeSet().getArchetype("arch2"); Assert.assertEquals(1, arch2.countInvObjects()); final GameObject inv = arch2.iterator().next(); Modified: trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java 2011-01-25 20:49:06 UTC (rev 8836) +++ trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java 2011-01-25 21:59:56 UTC (rev 8837) @@ -62,7 +62,10 @@ */ @Test public void testEmpty() throws IOException { - check("Object test\n" + "end\n", false, false, 1); + final StringBuilder input = new StringBuilder(); + input.append("Object test\n"); + input.append("end\n"); + check(input.toString(), false, false, 1); } /** @@ -81,7 +84,12 @@ */ @Test public void testMsgTextEmpty() throws IOException, UndefinedArchetypeException { - check("Object test\n" + "msg\n" + "endmsg\n" + "end\n", false, false, 1); + final StringBuilder input = new StringBuilder(); + input.append("Object test\n"); + input.append("msg\n"); + input.append("endmsg\n"); + input.append("end\n"); + check(input.toString(), false, false, 1); Assert.assertNull(getArchetypeSet().getArchetype("test").getMsgText()); } @@ -92,8 +100,20 @@ */ @Test public void testMsgTextLines() throws IOException, UndefinedArchetypeException { - check("Object test\n" + "msg\n" + "abc\n" + "def\n" + "ghi\n" + "endmsg\n" + "end\n", false, false, 1); - Assert.assertEquals("abc\n" + "def\n" + "ghi\n", getArchetypeSet().getArchetype("test").getMsgText()); + final StringBuilder input = new StringBuilder(); + input.append("Object test\n"); + input.append("msg\n"); + input.append("abc\n"); + input.append("def\n"); + input.append("ghi\n"); + input.append("endmsg\n"); + input.append("end\n"); + check(input.toString(), false, false, 1); + final StringBuilder msgText = new StringBuilder(); + msgText.append("abc\n"); + msgText.append("def\n"); + msgText.append("ghi\n"); + Assert.assertEquals(msgText.toString(), getArchetypeSet().getArchetype("test").getMsgText()); } /** @@ -103,8 +123,22 @@ */ @Test public void testMsgTextTrailingWhitespace() throws IOException, UndefinedArchetypeException { - check("Object test\n" + "msg\n" + "abc \n" + "def\n" + "ghi \n\n" + "endmsg\n" + "end\n", false, false, 1); - Assert.assertEquals("abc\n" + "def\n" + "ghi\n\n", getArchetypeSet().getArchetype("test").getMsgText()); + final StringBuilder input = new StringBuilder(); + input.append("Object test\n"); + input.append("msg\n"); + input.append("abc \n"); + input.append("def\n"); + input.append("ghi \n"); + input.append("\n"); + input.append("endmsg\n"); + input.append("end\n"); + check(input.toString(), false, false, 1); + final StringBuilder msgText = new StringBuilder(); + msgText.append("abc\n"); + msgText.append("def\n"); + msgText.append("ghi\n"); + msgText.append("\n"); + Assert.assertEquals(msgText.toString(), getArchetypeSet().getArchetype("test").getMsgText()); } /** @@ -114,8 +148,22 @@ */ @Test public void testMsgTextLeadingWhitespace() throws IOException, UndefinedArchetypeException { - check("Object test\n" + "msg\n\n abc\n" + "def\n ghi\n" + "endmsg\n" + "end\n", false, false, 1); - Assert.assertEquals("\n abc\n" + "def\n ghi\n", getArchetypeSet().getArchetype("test").getMsgText()); + final StringBuilder input = new StringBuilder(); + input.append("Object test\n"); + input.append("msg\n"); + input.append("\n"); + input.append(" abc\n"); + input.append("def\n"); + input.append(" ghi\n"); + input.append("endmsg\n"); + input.append("end\n"); + check(input.toString(), false, false, 1); + final StringBuilder msgText = new StringBuilder(); + msgText.append("\n"); + msgText.append(" abc\n"); + msgText.append("def\n"); + msgText.append(" ghi\n"); + Assert.assertEquals(msgText.toString(), getArchetypeSet().getArchetype("test").getMsgText()); } /** @@ -124,7 +172,12 @@ */ @Test public void testMsgTextTruncated() throws IOException { - check("Object test\n" + "msg\n" + "abc\n" + "def\n", true, false, 0); + final StringBuilder input = new StringBuilder(); + input.append("Object test\n"); + input.append("msg\n"); + input.append("abc\n"); + input.append("def\n"); + check(input.toString(), true, false, 0); } /** Modified: trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java 2011-01-25 20:49:06 UTC (rev 8836) +++ trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java 2011-01-25 21:59:56 UTC (rev 8837) @@ -55,29 +55,30 @@ */ @Test public void test1() throws ParserConfigurationException, UnsupportedEncodingException { - check("<bitmasks/>\n" - + "<lists/>\n" - + "<ignorelists/>\n" - + "<default_type>\n" - + "<attribute arch=\"name\" editor=\"name_editor\" type=\"string\">name description</attribute>\n" - + "</default_type>\n" - + "<type number=\"123\" name=\"name 123\">\n" - + "<description>description 123</description>\n" - + "<attribute arch=\"f\" value=\"v\" type=\"fixed\"/>\n" - + "</type>\n" - + "", - false, - "default_type:-1,default\n" - + ":\n" - + ":\n" - + "string/name[name_editor] section=0/General\n" - + "\n" - + "type:123,name 123\n" - + ":\n" - + ":\n" - + "fixed/f[v] section=1/Special\n" - + "string/name[name_editor] section=0/General\n" - + "\n"); + final StringBuilder typesXml = new StringBuilder(); + typesXml.append("<bitmasks/>\n"); + typesXml.append("<lists/>\n"); + typesXml.append("<ignorelists/>\n"); + typesXml.append("<default_type>\n"); + typesXml.append("<attribute arch=\"name\" editor=\"name_editor\" type=\"string\">name description</attribute>\n"); + typesXml.append("</default_type>\n"); + typesXml.append("<type number=\"123\" name=\"name 123\">\n"); + typesXml.append("<description>description 123</description>\n"); + typesXml.append("<attribute arch=\"f\" value=\"v\" type=\"fixed\"/>\n"); + typesXml.append("</type>\n"); + final StringBuilder expectedResult = new StringBuilder(); + expectedResult.append("default_type:-1,default\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + expectedResult.append("string/name[name_editor] section=0/General\n"); + expectedResult.append("\n"); + expectedResult.append("type:123,name 123\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + expectedResult.append("fixed/f[v] section=1/Special\n"); + expectedResult.append("string/name[name_editor] section=0/General\n"); + expectedResult.append("\n"); + check(typesXml.toString(), false, expectedResult.toString()); } /** @@ -87,53 +88,54 @@ */ @Test public void testImport1() throws ParserConfigurationException, UnsupportedEncodingException { - check("<bitmasks/>\n" - + "<lists/>\n" - + "<ignorelists/>\n" - + "<default_type>\n" - + "<attribute arch=\"default_attr1\" editor=\"default\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"default_attr2\" editor=\"default\" type=\"string\">description</attribute>\n" - + "</default_type>\n" - + "<type number=\"1\" name=\"name1\">\n" - + "<description>description1</description>\n" - + "<attribute arch=\"name1_attr1\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"name1_attr2\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "</type>\n" - + "<type number=\"2\" name=\"name2\">\n" - + "<import_type name=\"name1\"/>\n" - + "<description>description2</description>\n" - + "<attribute arch=\"name2_attr1\" editor=\"name2\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"name1_attr2\" editor=\"name2\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"default_attr2\" editor=\"name2\" type=\"string\">description</attribute>\n" - + "</type>\n" - + "", - false, - "default_type:-1,default\n" - + ":\n" - + ":\n" - + "string/default_attr1[default] section=0/General\n" - + "string/default_attr2[default] section=0/General\n" - + "\n" - + "type:1,name1\n" - + ":\n" - + ":\n" - + "string/name1_attr1[name1] section=1/Special\n" - + "string/name1_attr2[name1] section=1/Special\n" - + "string/default_attr1[default] section=0/General\n" - + "string/default_attr2[default] section=0/General\n" - + "\n" - + "type:2,name2\n" - + ":\n" - + ":\n" - /* attributes */ - + "string/name2_attr1[name2] section=1/Special\n" - + "string/name1_attr2[name2] section=1/Special\n" - + "string/default_attr2[name2] section=1/Special\n" - /* imports */ - + "string/name1_attr1[name1] section=1/Special\n" - /* defaults */ - + "string/default_attr1[default] section=0/General\n" - + "\n"); + final StringBuilder typesXml = new StringBuilder(); + typesXml.append("<bitmasks/>\n"); + typesXml.append("<lists/>\n"); + typesXml.append("<ignorelists/>\n"); + typesXml.append("<default_type>\n"); + typesXml.append("<attribute arch=\"default_attr1\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"default_attr2\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("</default_type>\n"); + typesXml.append("<type number=\"1\" name=\"name1\">\n"); + typesXml.append("<description>description1</description>\n"); + typesXml.append("<attribute arch=\"name1_attr1\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"name1_attr2\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("</type>\n"); + typesXml.append("<type number=\"2\" name=\"name2\">\n"); + typesXml.append("<import_type name=\"name1\"/>\n"); + typesXml.append("<description>description2</description>\n"); + typesXml.append("<attribute arch=\"name2_attr1\" editor=\"name2\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"name1_attr2\" editor=\"name2\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"default_attr2\" editor=\"name2\" type=\"string\">description</attribute>\n"); + typesXml.append("</type>\n"); + final StringBuilder expectedResult = new StringBuilder(); + expectedResult.append("default_type:-1,default\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + expectedResult.append("string/default_attr1[default] section=0/General\n"); + expectedResult.append("string/default_attr2[default] section=0/General\n"); + expectedResult.append("\n"); + expectedResult.append("type:1,name1\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + expectedResult.append("string/name1_attr1[name1] section=1/Special\n"); + expectedResult.append("string/name1_attr2[name1] section=1/Special\n"); + expectedResult.append("string/default_attr1[default] section=0/General\n"); + expectedResult.append("string/default_attr2[default] section=0/General\n"); + expectedResult.append("\n"); + expectedResult.append("type:2,name2\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + /* attributes */ + expectedResult.append("string/name2_attr1[name2] section=1/Special\n"); + expectedResult.append("string/name1_attr2[name2] section=1/Special\n"); + expectedResult.append("string/default_attr2[name2] section=1/Special\n"); + /* imports */ + expectedResult.append("string/name1_attr1[name1] section=1/Special\n"); + /* defaults */ + expectedResult.append("string/default_attr1[default] section=0/General\n"); + expectedResult.append("\n"); + check(typesXml.toString(), false, expectedResult.toString()); } /** @@ -143,131 +145,132 @@ */ @Test public void testImport2() throws ParserConfigurationException, UnsupportedEncodingException { - check("<bitmasks/>\n" - + "<lists/>\n" - + "<ignorelists/>\n" - + "<default_type>\n" - + "<attribute arch=\"attr1\" editor=\"default\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attr3\" editor=\"default\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attr5\" editor=\"default\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attr7\" editor=\"default\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attr9\" editor=\"default\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrB\" editor=\"default\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrD\" editor=\"default\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrF\" editor=\"default\" type=\"string\">description</attribute>\n" - + "</default_type>\n" - + "<type number=\"1\" name=\"name1\">\n" - + "<description>description1</description>\n" - + "<attribute arch=\"attr2\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attr3\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attr6\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attr7\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrA\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrB\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrE\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrF\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "</type>\n" - + "<type number=\"2\" name=\"name2\">\n" - + "<description>description2</description>\n" - + "<attribute arch=\"attr4\" editor=\"name2\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attr5\" editor=\"name2\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attr6\" editor=\"name2\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attr7\" editor=\"name2\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrC\" editor=\"name2\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrD\" editor=\"name2\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrE\" editor=\"name2\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrF\" editor=\"name2\" type=\"string\">description</attribute>\n" - + "</type>\n" - + "<type number=\"3\" name=\"name3\">\n" - + "<import_type name=\"name1\"/>\n" - + "<import_type name=\"name2\"/>\n" - + "<description>description3</description>\n" - + "<attribute arch=\"attr8\" editor=\"name3\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attr9\" editor=\"name3\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrA\" editor=\"name3\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrB\" editor=\"name3\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrC\" editor=\"name3\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrD\" editor=\"name3\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrE\" editor=\"name3\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"attrF\" editor=\"name3\" type=\"string\">description</attribute>\n" - + "</type>\n" - + "", - false, - "default_type:-1,default\n" - + ":\n" - + ":\n" - /* attributes */ - + "string/attr1[default] section=0/General\n" - + "string/attr3[default] section=0/General\n" - + "string/attr5[default] section=0/General\n" - + "string/attr7[default] section=0/General\n" - + "string/attr9[default] section=0/General\n" - + "string/attrB[default] section=0/General\n" - + "string/attrD[default] section=0/General\n" - + "string/attrF[default] section=0/General\n" - /* defaults */ - /* imports */ - + "\n" - + "type:1,name1\n" - + ":\n" - + ":\n" - /* attributes */ - + "string/attr2[name1] section=1/Special\n" - + "string/attr3[name1] section=1/Special\n" - + "string/attr6[name1] section=1/Special\n" - + "string/attr7[name1] section=1/Special\n" - + "string/attrA[name1] section=1/Special\n" - + "string/attrB[name1] section=1/Special\n" - + "string/attrE[name1] section=1/Special\n" - + "string/attrF[name1] section=1/Special\n" - /* defaults */ - + "string/attr1[default] section=0/General\n" - + "string/attr5[default] section=0/General\n" - + "string/attr9[default] section=0/General\n" - + "string/attrD[default] section=0/General\n" - /* imports */ - + "\n" - + "type:2,name2\n" - + ":\n" - + ":\n" - /* attributes */ - + "string/attr4[name2] section=1/Special\n" - + "string/attr5[name2] section=1/Special\n" - + "string/attr6[name2] section=1/Special\n" - + "string/attr7[name2] section=1/Special\n" - + "string/attrC[name2] section=1/Special\n" - + "string/attrD[name2] section=1/Special\n" - + "string/attrE[name2] section=1/Special\n" - + "string/attrF[name2] section=1/Special\n" - /* defaults */ - + "string/attr1[default] section=0/General\n" - + "string/attr3[default] section=0/General\n" - + "string/attr9[default] section=0/General\n" - + "string/attrB[default] section=0/General\n" - /* attributes */ - /* imports */ - + "\n" - + "type:3,name3\n" - + ":\n" - + ":\n" - + "string/attr8[name3] section=1/Special\n" - + "string/attr9[name3] section=1/Special\n" - + "string/attrA[name3] section=1/Special\n" - + "string/attrB[name3] section=1/Special\n" - + "string/attrC[name3] section=1/Special\n" - + "string/attrD[name3] section=1/Special\n" - + "string/attrE[name3] section=1/Special\n" - + "string/attrF[name3] section=1/Special\n" - /* imports */ - + "string/attr2[name1] section=1/Special\n" - + "string/attr3[name1] section=1/Special\n" - + "string/attr6[name1] section=1/Special\n" - + "string/attr7[name1] section=1/Special\n" - + "string/attr4[name2] section=1/Special\n" - + "string/attr5[name2] section=1/Special\n" - /* defaults */ - + "string/attr1[default] section=0/General\n" - + "\n"); + final StringBuilder typesXml = new StringBuilder(); + typesXml.append("<bitmasks/>\n"); + typesXml.append("<lists/>\n"); + typesXml.append("<ignorelists/>\n"); + typesXml.append("<default_type>\n"); + typesXml.append("<attribute arch=\"attr1\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attr3\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attr5\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attr7\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attr9\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrB\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrD\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrF\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("</default_type>\n"); + typesXml.append("<type number=\"1\" name=\"name1\">\n"); + typesXml.append("<description>description1</description>\n"); + typesXml.append("<attribute arch=\"attr2\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attr3\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attr6\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attr7\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrA\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrB\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrE\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrF\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("</type>\n"); + typesXml.append("<type number=\"2\" name=\"name2\">\n"); + typesXml.append("<description>description2</description>\n"); + typesXml.append("<attribute arch=\"attr4\" editor=\"name2\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attr5\" editor=\"name2\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attr6\" editor=\"name2\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attr7\" editor=\"name2\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrC\" editor=\"name2\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrD\" editor=\"name2\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrE\" editor=\"name2\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrF\" editor=\"name2\" type=\"string\">description</attribute>\n"); + typesXml.append("</type>\n"); + typesXml.append("<type number=\"3\" name=\"name3\">\n"); + typesXml.append("<import_type name=\"name1\"/>\n"); + typesXml.append("<import_type name=\"name2\"/>\n"); + typesXml.append("<description>description3</description>\n"); + typesXml.append("<attribute arch=\"attr8\" editor=\"name3\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attr9\" editor=\"name3\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrA\" editor=\"name3\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrB\" editor=\"name3\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrC\" editor=\"name3\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrD\" editor=\"name3\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrE\" editor=\"name3\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"attrF\" editor=\"name3\" type=\"string\">description</attribute>\n"); + typesXml.append("</type>\n"); + final StringBuilder expectedResult = new StringBuilder(); + expectedResult.append("default_type:-1,default\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + /* attributes */ + expectedResult.append("string/attr1[default] section=0/General\n"); + expectedResult.append("string/attr3[default] section=0/General\n"); + expectedResult.append("string/attr5[default] section=0/General\n"); + expectedResult.append("string/attr7[default] section=0/General\n"); + expectedResult.append("string/attr9[default] section=0/General\n"); + expectedResult.append("string/attrB[default] section=0/General\n"); + expectedResult.append("string/attrD[default] section=0/General\n"); + expectedResult.append("string/attrF[default] section=0/General\n"); + /* defaults */ + /* imports */ + expectedResult.append("\n"); + expectedResult.append("type:1,name1\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + /* attributes */ + expectedResult.append("string/attr2[name1] section=1/Special\n"); + expectedResult.append("string/attr3[name1] section=1/Special\n"); + expectedResult.append("string/attr6[name1] section=1/Special\n"); + expectedResult.append("string/attr7[name1] section=1/Special\n"); + expectedResult.append("string/attrA[name1] section=1/Special\n"); + expectedResult.append("string/attrB[name1] section=1/Special\n"); + expectedResult.append("string/attrE[name1] section=1/Special\n"); + expectedResult.append("string/attrF[name1] section=1/Special\n"); + /* defaults */ + expectedResult.append("string/attr1[default] section=0/General\n"); + expectedResult.append("string/attr5[default] section=0/General\n"); + expectedResult.append("string/attr9[default] section=0/General\n"); + expectedResult.append("string/attrD[default] section=0/General\n"); + /* imports */ + expectedResult.append("\n"); + expectedResult.append("type:2,name2\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + /* attributes */ + expectedResult.append("string/attr4[name2] section=1/Special\n"); + expectedResult.append("string/attr5[name2] section=1/Special\n"); + expectedResult.append("string/attr6[name2] section=1/Special\n"); + expectedResult.append("string/attr7[name2] section=1/Special\n"); + expectedResult.append("string/attrC[name2] section=1/Special\n"); + expectedResult.append("string/attrD[name2] section=1/Special\n"); + expectedResult.append("string/attrE[name2] section=1/Special\n"); + expectedResult.append("string/attrF[name2] section=1/Special\n"); + /* defaults */ + expectedResult.append("string/attr1[default] section=0/General\n"); + expectedResult.append("string/attr3[default] section=0/General\n"); + expectedResult.append("string/attr9[default] section=0/General\n"); + expectedResult.append("string/attrB[default] section=0/General\n"); + /* attributes */ + /* imports */ + expectedResult.append("\n"); + expectedResult.append("type:3,name3\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + expectedResult.append("string/attr8[name3] section=1/Special\n"); + expectedResult.append("string/attr9[name3] section=1/Special\n"); + expectedResult.append("string/attrA[name3] section=1/Special\n"); + expectedResult.append("string/attrB[name3] section=1/Special\n"); + expectedResult.append("string/attrC[name3] section=1/Special\n"); + expectedResult.append("string/attrD[name3] section=1/Special\n"); + expectedResult.append("string/attrE[name3] section=1/Special\n"); + expectedResult.append("string/attrF[name3] section=1/Special\n"); + /* imports */ + expectedResult.append("string/attr2[name1] section=1/Special\n"); + expectedResult.append("string/attr3[name1] section=1/Special\n"); + expectedResult.append("string/attr6[name1] section=1/Special\n"); + expectedResult.append("string/attr7[name1] section=1/Special\n"); + expectedResult.append("string/attr4[name2] section=1/Special\n"); + expectedResult.append("string/attr5[name2] section=1/Special\n"); + /* defaults */ + expectedResult.append("string/attr1[default] section=0/General\n"); + expectedResult.append("\n"); + check(typesXml.toString(), false, expectedResult.toString()); } /** @@ -277,35 +280,36 @@ */ @Test public void testIgnoreDefaultAttribute1() throws ParserConfigurationException, UnsupportedEncodingException { - check("<bitmasks/>\n" - + "<lists/>\n" - + "<ignorelists/>\n" - + "<default_type>\n" - + "<attribute arch=\"default_attr1\" editor=\"default\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"default_attr2\" editor=\"default\" type=\"string\">description</attribute>\n" - + "</default_type>\n" - + "<type number=\"1\" name=\"name1\">\n" - + "<ignore>\n" - + "<attribute arch=\"default_attr1\"/>\n" - + "</ignore>\n" - + "<description>description1</description>\n" - + "</type>\n" - + "", - false, - "default_type:-1,default\n" - + ":\n" - + ":\n" - + "string/default_attr1[default] section=0/General\n" - + "string/default_attr2[default] section=0/General\n" - + "\n" - + "type:1,name1\n" - + ":\n" - + ":\n" - /* attributes */ - /* imports */ - /* defaults */ - + "string/default_attr2[default] section=0/General\n" - + "\n"); + final StringBuilder typesXml = new StringBuilder(); + typesXml.append("<bitmasks/>\n"); + typesXml.append("<lists/>\n"); + typesXml.append("<ignorelists/>\n"); + typesXml.append("<default_type>\n"); + typesXml.append("<attribute arch=\"default_attr1\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"default_attr2\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("</default_type>\n"); + typesXml.append("<type number=\"1\" name=\"name1\">\n"); + typesXml.append("<ignore>\n"); + typesXml.append("<attribute arch=\"default_attr1\"/>\n"); + typesXml.append("</ignore>\n"); + typesXml.append("<description>description1</description>\n"); + typesXml.append("</type>\n"); + final StringBuilder expectedResult = new StringBuilder(); + expectedResult.append("default_type:-1,default\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + expectedResult.append("string/default_attr1[default] section=0/General\n"); + expectedResult.append("string/default_attr2[default] section=0/General\n"); + expectedResult.append("\n"); + expectedResult.append("type:1,name1\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + /* attributes */ + /* imports */ + /* defaults */ + expectedResult.append("string/default_attr2[default] section=0/General\n"); + expectedResult.append("\n"); + check(typesXml.toString(), false, expectedResult.toString()); } /** @@ -315,48 +319,49 @@ */ @Test public void testIgnoreImportAttribute1() throws ParserConfigurationException, UnsupportedEncodingException { - check("<bitmasks/>\n" - + "<lists/>\n" - + "<ignorelists/>\n" - + "<default_type>\n" - + "<attribute arch=\"default_attr1\" editor=\"default\" type=\"string\">description</attribute>\n" - + "</default_type>\n" - + "<type number=\"1\" name=\"name1\">\n" - + "<description>description1</description>\n" - + "<attribute arch=\"name1_attr1\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"name1_attr2\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "</type>\n" - + "<type number=\"2\" name=\"name2\">\n" - + "<import_type name=\"name1\"/>\n" - + "<ignore>\n" - + "<attribute arch=\"name1_attr1\"/>\n" - + "</ignore>\n" - + "<description>description2</description>\n" - + "</type>\n" - + "", - false, - "default_type:-1,default\n" - + ":\n" - + ":\n" - + "string/default_attr1[default] section=0/General\n" - + "\n" - + "type:1,name1\n" - + ":\n" - + ":\n" - + "string/name1_attr1[name1] section=1/Special\n" - + "string/name1_attr2[name1] section=1/Special\n" - + "string/default_attr1[default] section=0/General\n" - + "\n" - + "type:2,name2\n" - + ":\n" - + ":\n" - /* attributes */ - /* imports */ - + "string/name1_attr1[name1] section=1/Special\n" // imported attributes are not affected by ignores - + "string/name1_attr2[name1] section=1/Special\n" - /* defaults */ - + "string/default_attr1[default] section=0/General\n" - + "\n"); + final StringBuilder typesXml = new StringBuilder(); + typesXml.append("<bitmasks/>\n"); + typesXml.append("<lists/>\n"); + typesXml.append("<ignorelists/>\n"); + typesXml.append("<default_type>\n"); + typesXml.append("<attribute arch=\"default_attr1\" editor=\"default\" type=\"string\">description</attribute>\n"); + typesXml.append("</default_type>\n"); + typesXml.append("<type number=\"1\" name=\"name1\">\n"); + typesXml.append("<description>description1</description>\n"); + typesXml.append("<attribute arch=\"name1_attr1\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"name1_attr2\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("</type>\n"); + typesXml.append("<type number=\"2\" name=\"name2\">\n"); + typesXml.append("<import_type name=\"name1\"/>\n"); + typesXml.append("<ignore>\n"); + typesXml.append("<attribute arch=\"name1_attr1\"/>\n"); + typesXml.append("</ignore>\n"); + typesXml.append("<description>description2</description>\n"); + typesXml.append("</type>\n"); + final StringBuilder expectedResult = new StringBuilder(); + expectedResult.append("default_type:-1,default\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + expectedResult.append("string/default_attr1[default] section=0/General\n"); + expectedResult.append("\n"); + expectedResult.append("type:1,name1\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + expectedResult.append("string/name1_attr1[name1] section=1/Special\n"); + expectedResult.append("string/name1_attr2[name1] section=1/Special\n"); + expectedResult.append("string/default_attr1[default] section=0/General\n"); + expectedResult.append("\n"); + expectedResult.append("type:2,name2\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + /* attributes */ + /* imports */ + expectedResult.append("string/name1_attr1[name1] section=1/Special\n"); // imported attributes are not affected by ignores + expectedResult.append("string/name1_attr2[name1] section=1/Special\n"); + /* defaults */ + expectedResult.append("string/default_attr1[default] section=0/General\n"); + expectedResult.append("\n"); + check(typesXml.toString(), false, expectedResult.toString()); } /** @@ -366,33 +371,34 @@ */ @Test public void testIgnoreDefinedAttribute1() throws ParserConfigurationException, UnsupportedEncodingException { - check("<bitmasks/>\n" - + "<lists/>\n" - + "<ignorelists/>\n" - + "<default_type/>\n" - + "<type number=\"1\" name=\"name1\">\n" - + "<ignore>\n" - + "<attribute arch=\"name1_attr1\"/>\n" - + "</ignore>\n" - + "<description>description1</description>\n" - + "<attribute arch=\"name1_attr1\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "<attribute arch=\"name1_attr2\" editor=\"name1\" type=\"string\">description</attribute>\n" - + "</type>\n" - + "", - false, - "default_type:-1,default\n" - + ":\n" - + ":\n" - + "\n" - + "type:1,name1\n" - + ":\n" - + ":\n" - /* attributes */ - + "string/name1_attr1[name1] section=1/Special\n" // defined attributes are not affected by ignores - + "string/name1_attr2[name1] section=1/Special\n" - /* imports */ - /* defaults */ - + "\n"); + final StringBuilder typesXml = new StringBuilder(); + typesXml.append("<bitmasks/>\n"); + typesXml.append("<lists/>\n"); + typesXml.append("<ignorelists/>\n"); + typesXml.append("<default_type/>\n"); + typesXml.append("<type number=\"1\" name=\"name1\">\n"); + typesXml.append("<ignore>\n"); + typesXml.append("<attribute arch=\"name1_attr1\"/>\n"); + typesXml.append("</ignore>\n"); + typesXml.append("<description>description1</description>\n"); + typesXml.append("<attribute arch=\"name1_attr1\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("<attribute arch=\"name1_attr2\" editor=\"name1\" type=\"string\">description</attribute>\n"); + typesXml.append("</type>\n"); + final StringBuilder expectedResult = new StringBuilder(); + expectedResult.append("default_type:-1,default\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + expectedResult.append("\n"); + expectedResult.append("type:1,name1\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + /* attributes */ + expectedResult.append("string/name1_attr1[name1] section=1/Special\n"); // defined attributes are not affected by ignores + expectedResult.append("string/name1_attr2[name1] section=1/Special\n"); + /* imports */ + /* defaults */ + expectedResult.append("\n"); + check(typesXml.toString(), false, expectedResult.toString()); } /** @@ -402,29 +408,31 @@ */ @Test public void testMsgDefault1() throws ParserConfigurationException, UnsupportedEncodingException { - check("<bitmasks/>\n" - + "<lists/>\n" - + "<ignorelists/>\n" - + "<default_type>\n" - + "<attribute arch_begin=\"msg\" arch_end=\"endmsg\" editor=\"default\" type=\"text\">msg</attribute>\n" - + "</default_type>\n" - + "<type number=\"1\" name=\"name1\">\n" - + "<description>description</description>\n" - + "</type>\n" - + "", false, - "default_type:-1,default\n" - + ":\n" - + ":\n" - + "text/msg[default] section=2/default\n" - + "\n" - + "type:1,name1\n" - + ":\n" - + ":\n" - /* attributes */ - /* imports */ - /* defaults */ - + "text/msg[default] section=2/default\n" - + "\n"); + final StringBuilder typesXml = new StringBuilder(); + typesXml.append("<bitmasks/>\n"); + typesXml.append("<lists/>\n"); + typesXml.append("<ignorelists/>\n"); + typesXml.append("<default_type>\n"); + typesXml.append("<attribute arch_begin=\"msg\" arch_end=\"endmsg\" editor=\"default\" type=\"text\">msg</attribute>\n"); + typesXml.append("</default_type>\n"); + typesXml.append("<type number=\"1\" name=\"name1\">\n"); + typesXml.append("<description>description</description>\n"); + typesXml.append("</type>\n"); + final StringBuilder expectedResult = new StringBuilder(); + expectedResult.append("default_type:-1,default\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + expectedResult.append("text/msg[default] section=2/default\n"); + expectedResult.append("\n"); + expectedResult.append("type:1,name1\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + /* attributes */ + /* imports */ + /* defaults */ + expectedResult.append("text/msg[default] section=2/default\n"); + expectedResult.append("\n"); + check(typesXml.toString(), false, expectedResult.toString()); } /** @@ -434,31 +442,32 @@ */ @Test public void testMsgDefault2() throws ParserConfigurationException, UnsupportedEncodingException { - check("<bitmasks/>\n" - + "<lists/>\n" - + "<ignorelists/>\n" - + "<default_type>\n" - + "<attribute arch_begin=\"msg\" arch_end=\"endmsg\" editor=\"default\" type=\"text\">msg1</attribute>\n" - + "</default_type>\n" - + "<type number=\"1\" name=\"name1\">\n" - + "<description>description</description>\n" - + "<attribute arch_begin=\"msg\" arch_end=\"endmsg\" editor=\"name1\" type=\"text\">msg2</attribute>\n" - + "</type>\n" - + "", - false, - "default_type:-1,default\n" - + ":\n" - + ":\n" - + "text/msg[default] section=2/default\n" - + "\n" - + "type:1,name1\n" - + ":\n" - + ":\n" - /* attributes */ - + "text/msg[name1] section=2/name1\n" - /* imports */ - /* defaults */ - + "\n"); + final StringBuilder typesXml = new StringBuilder(); + typesXml.append("<bitmasks/>\n"); + typesXml.append("<lists/>\n"); + typesXml.append("<ignorelists/>\n"); + typesXml.append("<default_type>\n"); + typesXml.append("<attribute arch_begin=\"msg\" arch_end=\"endmsg\" editor=\"default\" type=\"text\">msg1</attribute>\n"); + typesXml.append("</default_type>\n"); + typesXml.append("<type number=\"1\" name=\"name1\">\n"); + typesXml.append("<description>description</description>\n"); + typesXml.append("<attribute arch_begin=\"msg\" arch_end=\"endmsg\" editor=\"name1\" type=\"text\">msg2</attribute>\n"); + typesXml.append("</type>\n"); + final StringBuilder expectedResult = new StringBuilder(); + expectedResult.append("default_type:-1,default\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + expectedResult.append("text/msg[default] section=2/default\n"); + expectedResult.append("\n"); + expectedResult.append("type:1,name1\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + /* attributes */ + expectedResult.append("text/msg[name1] section=2/name1\n"); + /* imports */ + /* defaults */ + expectedResult.append("\n"); + check(typesXml.toString(), false, expectedResult.toString()); } /** @@ -468,31 +477,33 @@ */ @Test public void testMsgDefault3() throws ParserConfigurationException, UnsupportedEncodingException { - check("<bitmasks/>\n" - + "<lists/>\n" - + "<ignorelists/>\n" - + "<default_type>\n" - + "<attribute arch_begin=\"msg\" arch_end=\"endmsg\" editor=\"default\" type=\"text\">msg1</attribute>\n" - + "</default_type>\n" - + "<type number=\"1\" name=\"name1\">\n" - + "<ignore>\n" - + "<attribute arch=\"msg\"/>\n" - + "</ignore>\n" - + "<description>description</description>\n" - + "</type>\n" - + "", false, - "default_type:-1,default\n" - + ":\n" - + ":\n" - + "text/msg[default] section=2/default\n" - + "\n" - + "type:1,name1\n" - + ":\n" - + ":\n" - /* attributes */ - /* imports */ - /* defaults */ - + "\n"); + final StringBuilder typesXml = new StringBuilder(); + typesXml.append("<bitmasks/>\n"); + typesXml.append("<lists/>\n"); + typesXml.append("<ignorelists/>\n"); + typesXml.append("<default_type>\n"); + typesXml.append("<attribute arch_begin=\"msg\" arch_end=\"endmsg\" editor=\"default\" type=\"text\">msg1</attribute>\n"); + typesXml.append("</default_type>\n"); + typesXml.append("<type number=\"1\" name=\"name1\">\n"); + typesXml.append("<ignore>\n"); + typesXml.append("<attribute arch=\"msg\"/>\n"); + typesXml.append("</ignore>\n"); + typesXml.append("<description>description</description>\n"); + typesXml.append("</type>\n"); + final StringBuilder expectedResult = new StringBuilder(); + expectedResult.append("default_type:-1,default\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + expectedResult.append("text/msg[default] section=2/default\n"); + expectedResult.append("\n"); + expectedResult.append("type:1,name1\n"); + expectedResult.append(":\n"); + expectedResult.append(":\n"); + /* attributes */ + /* imports */ + /* defaults */ + expectedResult.append("\n"); + check(typesXml.toString(), false, expectedResult.toString()); } /** @@ -534,13 +545,13 @@ */ @NotNull private static InputSource createInputSource(@NotNull final String string) throws UnsupportedEncodingException { - final String typesString = - "<?xml version=\"1.0\" standalone=\"no\" ?>\n" - + "<!DOCTYPE types SYSTEM \"types.dtd\">\n" - + "<types>\n" - + string - + "</types>\n"; - final InputSource inputSource = new InputSource(new ByteArrayInputStream(typesString.getBytes("UTF-8"))); + final StringBuilder typesString = new StringBuilder(); + typesString.append("<?xml version=\"1.0\" standalone=\"no\" ?>\n"); + typesString.append("<!DOCTYPE types SYSTEM \"types.dtd\">\n"); + typesString.append("<types>\n"); + typesString.append(string); + typesString.append("</types>\n"); + final InputSource inputSource = new InputSource(new ByteArrayInputStream(typesString.toString().getBytes("UTF-8"))); inputSource.setSystemId("types.dtd"); return inputSource; } Modified: trunk/model/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java 2011-01-25 20:49:06 UTC (rev 8836) +++ trunk/model/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java 2011-01-25 21:59:56 UTC (rev 8837) @@ -47,7 +47,13 @@ final TestErrorView errorView = new TestErrorView(); final TestParser parser = new TestParser(errorView); parser.addArchetype("base", "sp 2"); - parser.parseArtifacts("artifact art\n" + "def_arch base\nObject obj\nsp 3\n" + "end\n"); + final StringBuilder artifacts = new StringBuilder(); + artifacts.append("artifact art\n"); + artifacts.append("def_arch base\n"); + artifacts.append("Object obj\n"); + artifacts.append("sp 3\n"); + artifacts.append("end\n"); + parser.parseArtifacts(artifacts.toString()); Assert.assertFalse(errorView.hasWarnings()); Assert.assertFalse(errorView.hasErrors()); Assert.assertEquals(2, parser.getArchetypeCount()); @@ -66,7 +72,13 @@ public void testDefaultName1() throws DuplicateArchetypeException, IOException, UndefinedArchetypeException { final TestParser parser = new TestParser(); parser.addArchetype("horn"); - parser.parseArtifacts("artifact horn_fools\n" + "def_arch horn\n" + "Object obj\n" + "title of fools\n" + "end\n"); + final StringBuilder artifacts = new StringBuilder(); + artifacts.append("artifact horn_fools\n"); + artifacts.append("def_arch horn\n"); + artifacts.append("Object obj\n"); + artifacts.append("title of fools\n"); + artifacts.append("end\n"); + parser.parseArtifacts(artifacts.toString()); Assert.assertEquals("horn of fools", parser.getArchetype("horn_fools").getBestName()); } @@ -81,7 +93,13 @@ public void testDefaultName2() throws DuplicateArchetypeException, IOException, UndefinedArchetypeException { final TestParser parser = new TestParser(); parser.addArchetype("horn", "name horn2"); - parser.parseArtifacts("artifact horn_fools\n" + "def_arch horn\n" + "Object obj\n" + "title of fools\n" + "end\n"); + final StringBuilder artifacts = new StringBuilder(); + artifacts.append("artifact horn_fools\n"); + artifacts.append("def_arch horn\n"); + artifacts.append("Object obj\n"); + artifacts.append("title of fools\n"); + artifacts.append("end\n"); + parser.parseArtifacts(artifacts.toString()); Assert.assertEquals("horn2 of fools", parser.getArchetype("horn_fools").getBestName()); } @@ -96,7 +114,13 @@ public void testDefaultName3() throws DuplicateArchetypeException, IOException, UndefinedArchetypeException { final TestParser parser = new TestParser(); parser.addArchetype("horn", "name base_horn"); - parser.parseArtifacts("artifact horn_fools\n" + "def_arch horn\n" + "Object obj\n" + "title of fools\n" + "end\n"); + final StringBuilder artifacts = new StringBuilder(); + artifacts.append("artifact horn_fools\n"); + artifacts.append("def_arch horn\n"); + artifacts.append("Object obj\n"); + artifacts.append("title of fools\n"); + artifacts.append("end\n"); + parser.parseArtifacts(artifacts.toString()); Assert.assertEquals("base_horn of fools", parser.getArchetype("horn_fools").getBestName()); } @@ -111,7 +135,14 @@ public void testDefaultName4() throws DuplicateArchetypeException, IOException, UndefinedArchetypeException { final TestParser parser = new TestParser(); parser.addArchetype("horn", "name base_horn"); - parser.parseArtifacts("artifact horn_fools\n" + "def_arch horn\n" + "Object obj\n" + "name special_horn\n" + "title of fools\n" + "end\n"); + final StringBuilder artifacts = new StringBuilder(); + artifacts.append("artifact horn_fools\n"); + artifacts.append("def_arch horn\n"); + artifacts.append("Object obj\n"); + artifacts.append("name special_horn\n"); + artifacts.append("title of fools\n"); + artifacts.append("end\n"); + parser.parseArtifacts(artifacts.toString()); Assert.assertEquals("special_horn of fools", parser.getArchetype("horn_fools").getBestName()); } Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java 2011-01-25 20:49:06 UTC (rev 8836) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java 2011-01-25 21:59:56 UTC (rev 8837) @@ -165,7 +165,11 @@ mapModel.beginTransaction("TEST"); mapModel.getMapArchObject().setMapSize(new Size2D(4, 3)); mapModel.endTransaction(); - Assert.assertEquals("mapSizeChanged:\n" + "no squares\n" + "no game objects\n", result.toString()); + final StringBuilder expectedResult = new StringBuilder(); + expectedResult.append("mapSizeChanged:\n"); + expectedResult.append("no squares\n"); + expectedResult.append("no game objects\n"); + Assert.assertEquals(expectedResult.toString(), result.toString()); } /** @@ -205,7 +209,11 @@ mapModelCreator.addGameObjectToMap(mapModel, "1", 2, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); mapModel.getMapArchObject().setMapSize(new Size2D(1, 2)); // cancels square changed event mapModel.endTransaction(); - Assert.assertEquals("mapSizeChanged:\n" + "no squares\n" + "no game objects\n", result.toString()); + final StringBuilder expectedResult = new StringBuilder(); + expectedResult.append("mapSizeChanged:\n"); + expectedResult.append("no squares\n"); + expectedResult.append("no game objects\n"); + Assert.assertEquals(expectedResult.toString(), result.toString()); } /** @@ -229,7 +237,11 @@ mapModelCreator.addGameObjectToMap(mapModel, "1", 2, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); mapModel.getMapArchObject().setMapSize(new Size2D(1, 2)); // cancels square changed event mapModel.endTransaction(); - Assert.assertEquals("mapSizeChanged:\n" + "no squares\n" + "no game objects\n", result.toString()); + final StringBuilder expectedResult = new StringBuilder(); + expectedResult.append("mapSizeChanged:\n"); + expectedResult.append("no squares\n"); + expectedResult.append("no game objects\n"); + Assert.as... [truncated message content] |
From: <aki...@us...> - 2011-01-25 20:49:15
|
Revision: 8836 http://gridarta.svn.sourceforge.net/gridarta/?rev=8836&view=rev Author: akirschbaum Date: 2011-01-25 20:49:06 +0000 (Tue, 25 Jan 2011) Log Message: ----------- Fix Javadoc issues. Modified Paths: -------------- 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/FlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatPickmapRenderer.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java trunk/model/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java trunk/model/src/app/net/sf/gridarta/model/io/InvalidMapFormatException.java trunk/model/src/app/net/sf/gridarta/model/io/PathManager.java trunk/model/src/app/net/sf/gridarta/model/mapcontrol/MapControl.java trunk/model/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/StringKeyManager.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java trunk/src/app/net/sf/gridarta/gui/help/HtmlPane.java trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpListener.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/MapTilePanel.java 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 trunk/src/app/net/sf/gridarta/gui/map/tools/BasicAbstractTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListener.java trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java trunk/src/app/net/sf/gridarta/gui/prefs/AppPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/DevPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/ResPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePreferences.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchEditor.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java trunk/src/app/net/sf/gridarta/updater/Updater.java trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java trunk/utils/src/app/net/sf/gridarta/utils/HideFileFilterProxy.java trunk/utils/src/app/net/sf/gridarta/utils/ProcessRunner.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 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -296,7 +296,7 @@ * Creates a new instance. * @param mapViewSettings the map view settings instance to use * @param mapModel the map model to render - * @param mapGrid Grid to render + * @param mapGrid the grid to render * @param borderSize the size of the map borders in pixel * @param gridMapSquarePainter the grid square painter to use * @param gameObjectParser the game object parser for creating tooltip @@ -469,7 +469,7 @@ * 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 graphics Graphics for painting + * @param graphics the graphics for painting */ private void paintMapSelection(@NotNull final Graphics graphics) { for (tmpPoint.y = 0; tmpPoint.y < mapSize.getHeight(); tmpPoint.y++) { 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 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -149,7 +149,7 @@ * @param mapViewSettings the map view settings instance to use * @param filterControl the filter to use * @param mapModel the map model to render - * @param mapGrid Grid to render + * @param mapGrid the grid to render * @param gridMapSquarePainter the grid square painter to use * @param gameObjectParser the game object parser for creating tooltip * information Modified: 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/FlatPickmapRenderer.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatPickmapRenderer.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -50,10 +50,10 @@ private static final long serialVersionUID = 1L; /** - * Create a new instance. + * Creates a new instance. * @param mapViewSettings the map view settings instance to use * @param mapModel the map model to render - * @param mapGrid Grid to render + * @param mapGrid the grid to render * @param gridMapSquarePainter the grid square painter to use * @param gameObjectParser the game object parser for creating tooltip * information Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -190,8 +190,8 @@ /** * Looks up the section name from the ID. - * @param sectionId ID of the section - * @return name of that section + * @param sectionId the ID of the section + * @return the name of that section */ @NotNull public String getSectionName(final int sectionId) { Modified: trunk/model/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/model/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -86,12 +86,12 @@ * isn't already a BufferedReader itself. * @param animationObjects the animation objects to update * @param errorViewCollector the error view collector for reporting errors - * @param reader Reader to load animations from + * @param reader the reader to load animations from * @param startKey the key that begins an animation block; it must end with * a space character * @param ignoreOtherText if set, ignore all text outside animation * definitions - * @param path Path relative to the arch directory, used to create tree + * @param path the path relative to the arch directory, used to create tree * information; either <code>animations</code> or this parameter must be * non-<code>null</code> * @param animations maps animation name to animation path; either @@ -141,7 +141,7 @@ * @param startKey the "anim" tag name * @param animationObjects the animation objects to update * @param errorViewCollector the error view collector for reporting errors - * @param path Path relative to the arch directory, used to create tree + * @param path the path relative to the arch directory, used to create tree * information; either <code>animations</code> or this parameter must be * non-<code>null</code> * @param animations maps animation name to animation path; either @@ -179,7 +179,7 @@ * Processes a complete anim..mina block. * @param animationObjects the animation objects to update * @param errorViewCollector the error view collector for reporting errors - * @param path Path relative to the arch directory, used to create tree + * @param path the path relative to the arch directory, used to create tree * information; either <code>animations</code> or this parameter must be * non-<code>null</code> * @param animations maps animation name to animation path; either Modified: trunk/model/src/app/net/sf/gridarta/model/io/InvalidMapFormatException.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/InvalidMapFormatException.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/model/src/app/net/sf/gridarta/model/io/InvalidMapFormatException.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -34,8 +34,8 @@ private static final long serialVersionUID = 1L; /** - * Create an InvalidMapFormatException. - * @param msg Message text + * Create a new instance. + * @param msg the message text */ public InvalidMapFormatException(final String msg) { super(msg); Modified: trunk/model/src/app/net/sf/gridarta/model/io/PathManager.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/PathManager.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/model/src/app/net/sf/gridarta/model/io/PathManager.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -93,7 +93,7 @@ * Check whether a path is absolute. Paths starting with "/" are absolute, * paths starting with other characters are relative. Empty paths are * relative. - * @param path Path to check + * @param path the path to check * @return <code>true</code> if <var>path</var> is absolute, * <code>false</code> otherwise * @see #isRelative(String) which nearly is the opposite of this method @@ -105,7 +105,7 @@ /** * Check whether a path is relative. Paths not starting with "/" are * relative, paths starting with are absolute. Empty paths are relative. - * @param path Path to check + * @param path the path to check * @return <code>true</code> if <var>path</var> is relative, * <code>false</code> otherwise * @see #isAbsolute(String) which nearly is the opposite of this method @@ -196,7 +196,7 @@ /** * Counts the occurrences of a character within a string. - * @param s String to count in + * @param s the string to count in * @param c character to count * @return number of occurrences of <var>c</var> in <var>s</var> */ @@ -212,7 +212,7 @@ /** * Create a reasonable path. - * @param str String to create path from + * @param str the string to create path from * @return path */ @NotNull Modified: trunk/model/src/app/net/sf/gridarta/model/mapcontrol/MapControl.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapcontrol/MapControl.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/model/src/app/net/sf/gridarta/model/mapcontrol/MapControl.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -48,14 +48,14 @@ MapModel<G, A, R> getMapModel(); /** - * Register a map control listener. - * @param listener MapControlListener to register + * Registers a {@link MapControlListener}. + * @param listener the listener to register */ void addMapControlListener(@NotNull MapControlListener<G, A, R> listener); /** - * Unregister a map listener. - * @param listener MapControlListener to unregister + * Unregisters a {@link MapControlListener}. + * @param listener the listener to unregister */ void removeMapControlListener(@NotNull MapControlListener<G, A, R> listener); Modified: trunk/model/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/model/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -60,7 +60,7 @@ /** * Set all ScriptedEvents to appear in the given JList This method should be * fast because it may be executed when user clicks on map objects. - * @param list JList + * @param list the <code>JList</code> * @param gameObject the game object to operate on */ void addEventsToJList(@NotNull final JList list, @NotNull final Iterable<? extends GameObject<?, ?, ?>> gameObject); Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -123,7 +123,7 @@ private String previousSearch = ""; /** - * Create a new instance. + * Creates a new instance. * @param parent the parent component * @param archetypeChooserControl the archetype chooser control to to * search @@ -258,10 +258,10 @@ } /** - * Search for the current name. Does nothing if the current name matches + * Searches for the current name. Does nothing if the current name matches * {@link #previousSearch}. - * @param force If set, perform the search even if the current name is too - * short. + * @param force if set, perform the search even if the current name is too + * short */ private void doSearch(final boolean force) { @Nullable final R selectedArchetype; @@ -325,7 +325,7 @@ } /** - * Highlight the selected row from {@link #resultTable} in the insertion + * Highlights the selected row from {@link #resultTable} in the insertion * object chooser. */ private void highlightSelectedEntry() { @@ -362,7 +362,7 @@ } /** - * Select one row in the result table. + * Selects one row in the result table. * @param index the row index to select */ private void selectRow(final int index) { Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/StringKeyManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/StringKeyManager.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/StringKeyManager.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -37,8 +37,8 @@ private final JComboBox box; /** - * Create a StringKeyManager. - * @param box JComboBox to create StringKeyManager for + * Creates a new instance. + * @param box the JComboBox to create a <code>StringKeyManager</code> for */ public StringKeyManager(final JComboBox box) { this.box = box; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -457,7 +457,7 @@ /** * Action proxy for direction. - * @param direction Direction number + * @param direction the direction number */ private void direction(final int direction) { final GameObject<G, A, R> selectedGameObject = gameObjectAttributesModel.getSelectedGameObject(); Modified: trunk/src/app/net/sf/gridarta/gui/help/HtmlPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/help/HtmlPane.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/help/HtmlPane.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -61,7 +61,7 @@ /** * Constructor to load the html-file <fileName> and display it's * contents in this HtmlPane. - * @param fileName Name of the HTML-file + * @param fileName the name of the HTML-file */ HtmlPane(final String fileName) { try { @@ -191,8 +191,8 @@ /** * Create a PageLoader. - * @param url URL to load - * @param cursor Cursor to restore once the document is loaded + * @param url the URL to load + * @param cursor the cursor to restore once the document is loaded */ private PageLoader(final URL url, final Cursor cursor) { this.url = url; Modified: trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpListener.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpListener.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -31,31 +31,31 @@ /** * Mouse was clicked. - * @param e Event + * @param e the event */ void clicked(MouseOpEvent<G, A, R> e); /** * Mouse was dragged. - * @param e Event + * @param e the event */ void dragged(MouseOpEvent<G, A, R> e); /** * Mouse was moved. - * @param e Event + * @param e the event */ void moved(MouseOpEvent<G, A, R> e); /** * Mouse was pressed. - * @param e Event + * @param e the event */ void pressed(MouseOpEvent<G, A, R> e); /** * Mouse was released. - * @param e Event + * @param e the event */ void released(MouseOpEvent<G, A, R> e); Modified: trunk/src/app/net/sf/gridarta/gui/map/maptilepane/MapTilePanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/MapTilePanel.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/map/maptilepane/MapTilePanel.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -37,8 +37,8 @@ private final TilePanel tilePanel; /** - * Create a new instance. - * @param direction Index, used to determine the direction and corresponding + * Creates a new instance. + * @param direction index, used to determine the direction and corresponding * locale keys * @param nextFocus the indices of next focus * @param tilePanel the tile panel to show @@ -65,6 +65,9 @@ tilePanel.addTextFieldActionListener(actionListener); } + /** + * {@inheritDoc} + */ @NotNull public TilePanel getTilePanel() { return tilePanel; Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -292,7 +292,7 @@ * @param spawnPointTypeNo the game object type number for spawn points * @param mapViewSettings the map view settings instance to use * @param mapModel the map model to render - * @param mapGrid Grid to render + * @param mapGrid the grid to render * @param borderOffsetX the horizontal border size * @param borderOffsetY the vertical border size * @param multiPositionData the multi position data to query for multi-part Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -114,7 +114,7 @@ * @param mapViewSettings the map view settings instance to use * @param filterControl the filter to use * @param mapModel the map model to render - * @param mapGrid Grid to render + * @param mapGrid the grid to render * @param multiPositionData the multi position data to query for multi-part * objects * @param isoMapSquareInfo the iso square info to use Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -47,11 +47,11 @@ private static final long serialVersionUID = 1L; /** - * Create a new instance. + * Creates a new instance. * @param spawnPointTypeNo the game object type number for spawn points * @param mapViewSettings the map view settings instance to use * @param mapModel the map model to render - * @param mapGrid Grid to render + * @param mapGrid the grid to render * @param multiPositionData the multi position data query for multi-part * objects * @param isoMapSquareInfo the iso square info to use Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/BasicAbstractTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/BasicAbstractTool.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/BasicAbstractTool.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -40,7 +40,7 @@ /** * Create a BasicAbstractTool. - * @param id ID (used for {@link #getId()} as well as for the + * @param id the ID (used for {@link #getId()} as well as for the * ActionBuilder) */ protected BasicAbstractTool(@NotNull final String id) { Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -109,7 +109,7 @@ private static final Insets EMPTY_MARGIN = new Insets(0, 0, 0, 0); /** - * Create a ToolSelector component. + * Creates a new instance. * @param defaultTool name of the tool that should be selected by default * @param mapViewSettings the map view settings instance * @param selectedSquareView the selected square view @@ -139,7 +139,7 @@ } /** - * Create the user interface elements of the ToolSelector. + * Creates the user interface elements of the ToolSelector. */ private void createUI() { setLayout(new BorderLayout()); @@ -148,8 +148,8 @@ } /** - * Add a tool to this tool selector. - * @param tool Tool to add + * Adds a tool to this tool selector. + * @param tool the tool to add */ @SuppressWarnings({ "MethodOverloadsMethodOfSuperclass" }) public void add(@NotNull final Tool<G, A, R> tool) { @@ -157,8 +157,8 @@ } /** - * Add a tool to this tool selector. - * @param tool Tool to add + * Adds a tool to this tool selector. + * @param tool the tool to add * @param selected <code>true</code> if the tool should be made the selected * tool, otherwise <code>false</code> */ @@ -181,12 +181,12 @@ } /** - * Create the options view for a tool. This method is a delegate to {@link + * Creates the options view for a tool. This method is a delegate to {@link * Tool#createOptionsView()} but will provide a fallback if the tool doesn't * provide tweaking its options. - * @param tool Tool to create options view for - * @return options view (the tool's options view or a dummy fallback if the - * tool doesn't provide an options view) + * @param tool the tool to create options view for + * @return the options view (the tool's options view or a dummy fallback if + * the tool doesn't provide an options view) */ @NotNull private static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> Component createOptionsView(@NotNull final Tool<G, A, R> tool) { @@ -195,8 +195,8 @@ } /** - * Make a tool the currently selected tool to edit its options. - * @param tool Tool to select + * Makes a tool the currently selected tool to edit its options. + * @param tool the tool to select * @pre the tool must be controlled by this tool-selector. * @see #setSelectedTool(String) */ @@ -206,10 +206,10 @@ } /** - * Make a tool the currently selected tool to edit its options. This method + * Makes a tool the currently selected tool to edit its options. This method * exists to allow programs to store the currently selected tool in * preferences and restore it after startup. - * @param id ID of tool to select + * @param id the ID of tool to select * @pre the tool must be controlled by this tool-selector. * @see #setSelectedTool(Tool) * @see Tool#getId() @@ -219,7 +219,7 @@ } /** - * Get the tool that is currently selected. + * Returns the tool that is currently selected. * @return the currently selected tool */ @NotNull @@ -244,8 +244,8 @@ private final Tool<G, A, R> tool; /** - * Create a SelectionAction. - * @param tool Tool to select with this action + * Creates a SelectionAction. + * @param tool the tool to select with this action */ SelectionAction(@NotNull final Tool<G, A, R> tool) { this.tool = tool; Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -395,15 +395,15 @@ /** * Updates the focus to the first non-iconified map window. - * @param fCareAboutIconification True if the focus update should ignore all - * windows iconified by the user. + * @param careAboutIconification <code>true</code> if the focus update + * should ignore all windows iconified by the user. */ - private void updateFocus(final boolean fCareAboutIconification) { + private void updateFocus(final boolean careAboutIconification) { // Show the next map (if such exists) for (final MapView<G, A, R> mapView : mapViewManager) { final JInternalFrame internalFrame = mapView.getInternalFrame(); if (internalFrame.isIcon()) { - if (!fCareAboutIconification) { + if (!careAboutIconification) { try { internalFrame.setIcon(false); } catch (final PropertyVetoException e) { Modified: trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListener.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListener.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -146,8 +146,8 @@ /** * Get the mouse operation for a MouseEvent. - * @param event MouseEvent to get mouse operation for - * @return mouse operation for <var>event</var> + * @param event the mouse event to get mouse operation for + * @return the mouse operation for <var>event</var> */ @Nullable private MouseOpListener<G, A, R> getMouseOperation(final MouseEvent event) { @@ -157,9 +157,9 @@ /** * Get the map location for a MouseEvent. - * @param event MouseEvent to get map location for - * @return map location for <var>event</var> or <code>null</code> if outside - * map + * @param event the mouse event to get map location for + * @return the map location for <var>event</var> or <code>null</code> if + * outside map */ @Nullable private Point getMapLocation(final MouseEvent event) { Modified: trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -96,10 +96,10 @@ private final JFrame frame; /** - * Constructs the CPreview user interface. When image is not null it either - * increases or decreases the zoom. If m_Image is null the the program will - * wait for a zoom factor to be chosen. - * @param original Image to be displayed + * Constructs the user interface. When image is not null it either increases + * or decreases the zoom. If m_Image is null the the program will wait for a + * zoom factor to be chosen. + * @param original the image to be displayed */ public MapPreview(final Image original) { this.original = original; Modified: trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -307,7 +307,7 @@ /** * Sets the level status text, which usually displays arch numbers. - * @param text String to set + * @param text the text */ public void setStatusText(final String text) { status.setText(text); Modified: trunk/src/app/net/sf/gridarta/gui/prefs/AppPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/AppPreferences.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/prefs/AppPreferences.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -88,9 +88,9 @@ } /** - * Create a titled border. - * @param titleKey Action Key for border title - * @return titled border + * Creates a titled border. + * @param titleKey the action key for border title + * @return the titled border */ private static Border createTitledBorder(final String titleKey) { return new CompoundBorder(new TitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, titleKey)), GUIConstants.DIALOG_BORDER); @@ -136,7 +136,7 @@ /** * Creates the sub-panel with the external applications. - * @return sub-panel + * @return the sub-panel */ private Component createAppPanel() { final JComponent panel = new JPanel(new GridBagLayout()); Modified: trunk/src/app/net/sf/gridarta/gui/prefs/DevPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/DevPreferences.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/prefs/DevPreferences.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -86,9 +86,9 @@ } /** - * Create a titled border. - * @param titleKey Action Key for border title - * @return titled border + * Creates a titled border. + * @param titleKey the action key for border title + * @return the titled border */ private static Border createTitledBorder(final String titleKey) { return new CompoundBorder(new TitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, titleKey)), GUIConstants.DIALOG_BORDER); Modified: trunk/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -122,9 +122,9 @@ } /** - * Create a titled border. - * @param titleKey Action Key for border title - * @return titled border + * Creates a titled border. + * @param titleKey the action key for border title + * @return the titled border */ private static Border createTitledBorder(final String titleKey) { return new CompoundBorder(new TitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, titleKey)), GUIConstants.DIALOG_BORDER); @@ -175,8 +175,8 @@ } /** - * Construct the Combo box for the selection of locales. - * @return combo box with locales to select + * Constructs the combo box for the selection of locales. + * @return the combo box with locales to select */ private Component buildLocaleBox() { final Container lineLayout = Box.createHorizontalBox(); @@ -204,7 +204,7 @@ /** * Creates the sub-panel with the global settings. - * @return sub-panel + * @return the sub-panel */ private Component createGlobalPanel() { final JComponent panel = new JPanel(new GridBagLayout()); @@ -218,7 +218,7 @@ /** * Creates the sub-panel with the layout settings. - * @return sub-panel + * @return the sub-panel */ private Component createLayoutPanel() { final JComponent panel = new JPanel(new GridBagLayout()); Modified: trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPreferences.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPreferences.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -100,9 +100,9 @@ } /** - * Create a titled border. - * @param titleKey Action Key for border title - * @return titled border + * Creates a titled border. + * @param titleKey the action key for border title + * @return the titled border */ private static Border createTitledBorder(final String titleKey) { return new CompoundBorder(new TitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, titleKey)), GUIConstants.DIALOG_BORDER); @@ -155,8 +155,8 @@ } /** - * Create the Panel with the generic validation settings. - * @return sub-panel + * Creates the sub-panel with the generic validation settings. + * @return the sub-panel */ @NotNull private Component createValidationPanel() { @@ -168,8 +168,8 @@ } /** - * Create the Panel with the validators information. - * @return sub-panel + * Creates the sub-panel with the validators information. + * @return the sub-panel */ @NotNull private Component createValidatorsPanel() { Modified: trunk/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -111,9 +111,9 @@ } /** - * Create a titled border. - * @param titleKey Action Key for border title - * @return titled border + * Creates a titled border. + * @param titleKey the action key for border title + * @return the titled border */ private static Border createTitledBorder(final String titleKey) { return new CompoundBorder(new TitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, titleKey)), GUIConstants.DIALOG_BORDER); @@ -169,7 +169,7 @@ /** * Creates the sub-panel with the external applications. - * @return sub-panel + * @return the sub-panel */ private Component createNetPanel() { final JComponent panel = new JPanel(new GridBagLayout()); @@ -182,8 +182,8 @@ } /** - * Create the JComboBox for selecting the proxy type. - * @return JComboBox for selecting the proxy type + * Creates the {@link JComboBox} for selecting the proxy type. + * @return the <code>JComboBox</code> for selecting the proxy type */ private static JComboBox createProxyType() { final JComboBox proxyType = new JComboBox(EnumSet.allOf(Proxy.Type.class).toArray()); @@ -191,8 +191,8 @@ } /** - * Return the currently preferred proxy. - * @return currently preferred proxy + * Returns the currently preferred proxy. + * @return the currently preferred proxy */ public static Proxy getProxy() { final Proxy.Type proxyType = Proxy.Type.valueOf(PREFERENCES.get(NET_PREFERENCES_KEY_TYPE, "DIRECT")); Modified: trunk/src/app/net/sf/gridarta/gui/prefs/ResPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/ResPreferences.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/prefs/ResPreferences.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -150,9 +150,9 @@ } /** - * Create a titled border. - * @param titleKey Action Key for border title - * @return titled border + * Creates a titled border. + * @param titleKey the action key for border title + * @return the titled border */ @NotNull private static Border createTitledBorder(final String titleKey) { @@ -268,7 +268,7 @@ /** * Creates the sub-panel with the global settings. - * @return sub-panel + * @return the sub-panel */ @NotNull private Component createGlobalPanel() { @@ -293,8 +293,8 @@ } /** - * Construct the Combo box for the selection of image sets. - * @return combo box with image sets to select + * Constructs the combo box for the selection of image sets. + * @return the combo box with image sets to select */ @NotNull private Component buildImageSetBox() { Modified: trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePreferences.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePreferences.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -84,9 +84,9 @@ } /** - * Create a titled border. - * @param titleKey Action Key for border title - * @return titled border + * Creates a titled border. + * @param titleKey the action key for border title + * @return the titled border */ private static Border createTitledBorder(final String titleKey) { return new CompoundBorder(new TitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, titleKey)), GUIConstants.DIALOG_BORDER); @@ -129,7 +129,7 @@ /** * Creates the sub-panel with the update settings. - * @return sub-panel + * @return the sub-panel */ private Component createUpdatePanel() { final JComponent panel = new JPanel(new GridBagLayout()); @@ -143,8 +143,8 @@ } /** - * Set AutoUpdate state. - * @param autoUpdate auto-update state + * Sets the auto-update state. + * @param autoUpdate the auto-update state */ @ActionMethod public void setAutoUpdate(final boolean autoUpdate) { @@ -152,8 +152,8 @@ } /** - * Get AutoUpdate state. - * @return auto-update state + * Returns the auto-update state. + * @return the auto-update state */ @ActionMethod public boolean isAutoUpdate() { @@ -161,8 +161,8 @@ } /** - * Create the JComboBox with the update choices. - * @return JComboBox with update choices + * Creates the component with update choices. + * @return the component with update choices */ private Component createComboBox() { final String[] items = { ActionBuilderUtils.getString(ACTION_BUILDER, "prefsUpdateAuto0.text"), ActionBuilderUtils.getString(ACTION_BUILDER, "prefsUpdateAuto1.text"), ActionBuilderUtils.getString(ACTION_BUILDER, "prefsUpdateAuto2.text"), ActionBuilderUtils.getString(ACTION_BUILDER, "prefsUpdateAuto3.text"), }; Modified: trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -89,8 +89,8 @@ * opened and the appropriate script displayed. * @param eventIndex index of event in the owner's inventory * @param task the task to execute - * @param panelList JList from the MapArchPanel (script tab) which displays - * the events + * @param panelList the <code>JList</code> from the <code>MapArchPanel</code> + * (script tab) which displays the events * @param mapManager the map manager instance * @param parent the parent frame for dialog boxes * @param gameObject the game object to operate on Modified: trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchEditor.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchEditor.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -35,7 +35,7 @@ /** * A popup is opened and the user can create a new scripting event which * gets attached to this gameObject. - * @param gameObject GameObject to add event to + * @param gameObject the game object to add event to * @param scriptArchData the <code>ScriptArchData</code> instance to * display * @param parent the parent frame for the editor Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -100,7 +100,7 @@ }; /** - * Create a SelectedSquareControl. + * Creates a new instance. * @param selectedSquareModel the model for this controller * @param gameObjectAttributesDialogFactory the factory for creating game * object attributes dialog instances @@ -116,15 +116,15 @@ } /** - * Delete the currently selected game object. + * Deletes the currently selected game object. */ public void deleteSelection(@NotNull final MapView<G, A, R> mapView) { deleteIndex(mapView, selectedSquareView.getSelectedIndex()); } /** - * Delete an GameObject with a specific list index. - * @param index List index of GameObject + * Deletes a {@link GameObject} with a specific list index. + * @param index the list index of the game object to delete */ private void deleteIndex(final int index) { final MapView<G, A, R> currentMapView = selectedSquareModel.getCurrentMapView(); @@ -167,7 +167,7 @@ } /** - * Insert a new game object. + * Inserts a new game object. * @param index the list index to insert at */ private void insertGameObjectFromObjectChooser(final int index) { @@ -178,7 +178,7 @@ } /** - * Insert a new game object. + * Inserts a new game object. * @param mapView the map to insert into * @param index the list index to insert at */ @@ -212,7 +212,7 @@ } /** - * Determine if "select" was selected. + * Determines if "select" was selected. * @param e the mouse event to check for "select" * @return <code>true</code> is "select" was selected */ @@ -221,7 +221,7 @@ } /** - * Determine if "insert" was selected. + * Determines if "insert" was selected. * @param e the mouse event to check for "insert" * @return <code>true</code> is "insert" was selected */ @@ -230,7 +230,7 @@ } /** - * Determine if "delete" was selected. + * Determines if "delete" was selected. * @param e the mouse event to check for "delete" * @return <code>true</code> is "delete" was selected */ Modified: trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -86,7 +86,7 @@ /** * Opens a file chooser to select the spell list file, then import spells. * @param dir the directory to use - * @param parent Component the parent component for dialog boxes + * @param parent the parent component for dialog boxes */ public void importSpells(@NotNull final File dir, @NotNull final Component parent) { // open a file chooser window @@ -116,8 +116,8 @@ } /** - * Read all spells from a Crossfire or Daimonin spell list file and write an - * alphabetical list into "spells.def". + * Reads all spells from a Crossfire or Daimonin spell list file and write + * an alphabetical list into "spells.def". * @param spellFile spell file to read * @param dir the base directory to load the spells file from * @return number of successfully collected spells Modified: trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -457,9 +457,9 @@ * Helper method for returning the maximum of an unspecified number of * arguments. (The class {@link Math} only provides max methods for 2 * arguments. - * @param numbers Numbers to get maximum of - * @return maximum of numbers, which is {@link Integer#MIN_VALUE} in case no - * number was supplied. + * @param numbers the numbers to get maximum of + * @return the maximum of numbers, which is {@link Integer#MIN_VALUE} in + * case no number was supplied. */ private static int max(@NotNull final int... numbers) { int ret = Integer.MIN_VALUE; Modified: trunk/src/app/net/sf/gridarta/updater/Updater.java =================================================================== --- trunk/src/app/net/sf/gridarta/updater/Updater.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/updater/Updater.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -105,8 +105,8 @@ private static final int BUF_SIZE = 4096; /** - * Create an Updater. - * @param parentComponent Component to show dialogs on + * Create a new instance. + * @param parentComponent the parent component to show dialogs on * @param exiter the exiter for terminating the application * @param updateFileName the file to update */ Modified: trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -101,7 +101,7 @@ * Creates a new instance. * @param exiter the exiter for terminating the application * @param mapManager the map manager to use - * @param parentComponent Component to show dialogs on + * @param parentComponent the parent component to show dialogs on * @param updateFileName the file to update */ public UpdaterManager(@NotNull final Exiter exiter, @NotNull final MapManager<?, ?, ?> mapManager, final Component parentComponent, final String updateFileName) { Modified: trunk/utils/src/app/net/sf/gridarta/utils/HideFileFilterProxy.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/HideFileFilterProxy.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/utils/src/app/net/sf/gridarta/utils/HideFileFilterProxy.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -54,8 +54,8 @@ private final Collection<String> rejectedDirectoryNames = new ArrayList<String>(); /** - * Create a HideFileFilterProxy. - * @param other FileFilter to wrap + * Creates a new instance. + * @param other the file filter to wrap */ public HideFileFilterProxy(@NotNull final FileFilter other) { this.other = other; Modified: trunk/utils/src/app/net/sf/gridarta/utils/ProcessRunner.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/ProcessRunner.java 2011-01-23 19:24:29 UTC (rev 8835) +++ trunk/utils/src/app/net/sf/gridarta/utils/ProcessRunner.java 2011-01-25 20:49:06 UTC (rev 8836) @@ -148,7 +148,7 @@ * directory. * @param key i18n key * @param command the command to run and its arguments - * @param dir Working directory for command + * @param dir the working directory for command */ private ProcessRunner(@NotNull final String key, @NotNull final String[] command, @Nullable final String dir) { this.key = key; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |