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...> - 2010-06-24 00:44:59
|
Revision: 8435 http://gridarta.svn.sourceforge.net/gridarta/?rev=8435&view=rev Author: akirschbaum Date: 2010-06-24 00:44:52 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Move action methods to correct class. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java 2010-06-24 00:39:41 UTC (rev 8434) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java 2010-06-24 00:44:52 UTC (rev 8435) @@ -34,7 +34,6 @@ import net.sf.gridarta.model.map.mapcontrol.MapControl; import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapSquare; -import net.sf.japi.swing.action.ActionMethod; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -73,12 +72,6 @@ private final SelectedSquareModel<G, A, R> selectedSquareModel; /** - * The {@link SelectedSquareActions} for this controller. - */ - @NotNull - private final SelectedSquareActions<G, A, R> selectedSquareActions; - - /** * The {@link MouseListener} attached to the view to process mouse actions. */ @NotNull @@ -109,15 +102,13 @@ /** * Create a SelectedSquareControl. * @param selectedSquareModel the model for this controller - * @param selectedSquareActions the selected square actions to use * @param gameObjectAttributesDialogFactory the factory for creating game * object attributes dialog instances * @param objectChooser the object chooser * @param selectedSquareView the selected square view */ - public SelectedSquareControl(@NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final SelectedSquareActions<G, A, R> selectedSquareActions, @NotNull final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final SelectedSquareView<G, A, R> selectedSquareView) { + public SelectedSquareControl(@NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final SelectedSquareView<G, A, R> selectedSquareView) { this.selectedSquareModel = selectedSquareModel; - this.selectedSquareActions = selectedSquareActions; this.gameObjectAttributesDialogFactory = gameObjectAttributesDialogFactory; this.objectChooser = objectChooser; this.selectedSquareView = selectedSquareView; @@ -129,55 +120,6 @@ } /** - * Action method for moving an arch topmost within its square. - */ - @ActionMethod - public void moveSquareTop() { - selectedSquareActions.doMoveSquareTop(true); - } - - /** - * Action method for moving an arch up within its square. - */ - @ActionMethod - public void moveSquareUp() { - selectedSquareActions.doMoveSquareUp(true); - } - - /** - * Action method for moving an arch down within its square. - */ - @ActionMethod - public void moveSquareDown() { - selectedSquareActions.doMoveSquareDown(true); - } - - /** - * Action method for moving an arch topmost within its square. - */ - @ActionMethod - public void moveSquareBottom() { - selectedSquareActions.doMoveSquareBottom(true); - } - - /** - * Action method for moving a game object to its environment. - */ - @ActionMethod - public void moveSquareEnv() { - selectedSquareActions.doMoveSquareEnv(true); - } - - /** - * Action method for moving a game object to the inventory of its preceding - * game object. - */ - @ActionMethod - public void moveSquareInv() { - selectedSquareActions.doMoveSquareInv(true); - } - - /** * Delete the currently selected game object. */ public void deleteSelection(@NotNull final MapView<G, A, R> mapView) { Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-24 00:39:41 UTC (rev 8434) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-24 00:44:52 UTC (rev 8435) @@ -71,6 +71,7 @@ import net.sf.gridarta.utils.Size2D; 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; import org.jetbrains.annotations.Nullable; @@ -102,6 +103,12 @@ private final SelectedSquareModel<G, A, R> selectedSquareModel; /** + * The {@link SelectedSquareActions} for this controller. + */ + @NotNull + private final SelectedSquareActions<G, A, R> selectedSquareActions; + + /** * The {@link ModelUpdater} used for updating {@link #model}. */ @NotNull @@ -357,6 +364,7 @@ /** * Create a new instance. * @param selectedSquareModel the model for this view + * @param selectedSquareActions the selected square actions to use * @param mapManager the map manager to use * @param mapViewManager the map view manager to use * @param mapViewSettings the map view settings instance @@ -366,8 +374,9 @@ * faces * @param unknownSquareIcon the icon for unknown squares */ - public SelectedSquareView(@NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final MapViewSettings mapViewSettings, @Nullable final ImageIcon compassIcon, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final Icon unknownSquareIcon) { + public SelectedSquareView(@NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final SelectedSquareActions<G, A, R> selectedSquareActions, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final MapViewSettings mapViewSettings, @Nullable final ImageIcon compassIcon, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final Icon unknownSquareIcon) { this.selectedSquareModel = selectedSquareModel; + this.selectedSquareActions = selectedSquareActions; mapSquareSelectionCache = new MapSquareSelectionCache<G, A, R>(mapViewManager); setLayout(new BorderLayout()); @@ -543,4 +552,53 @@ return index; } + /** + * Action method for moving an arch topmost within its square. + */ + @ActionMethod + public void moveSquareTop() { + selectedSquareActions.doMoveSquareTop(true); + } + + /** + * Action method for moving an arch up within its square. + */ + @ActionMethod + public void moveSquareUp() { + selectedSquareActions.doMoveSquareUp(true); + } + + /** + * Action method for moving an arch down within its square. + */ + @ActionMethod + public void moveSquareDown() { + selectedSquareActions.doMoveSquareDown(true); + } + + /** + * Action method for moving an arch topmost within its square. + */ + @ActionMethod + public void moveSquareBottom() { + selectedSquareActions.doMoveSquareBottom(true); + } + + /** + * Action method for moving a game object to its environment. + */ + @ActionMethod + public void moveSquareEnv() { + selectedSquareActions.doMoveSquareEnv(true); + } + + /** + * Action method for moving a game object to the inventory of its preceding + * game object. + */ + @ActionMethod + public void moveSquareInv() { + selectedSquareActions.doMoveSquareInv(true); + } + } // class SelectedSquareView Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-24 00:39:41 UTC (rev 8434) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-24 00:44:52 UTC (rev 8435) @@ -461,8 +461,8 @@ newMapDialogFactory.setObjectChooser(objectChooser); final SelectedSquareModel<G, A, R> selectedSquareModel = new SelectedSquareModel<G, A, R>(); final SelectedSquareActions<G, A, R> selectedSquareActions = new SelectedSquareActions<G, A, R>(selectedSquareModel); - final SelectedSquareView<G, A, R> selectedSquareView = new SelectedSquareView<G, A, R>(selectedSquareModel, mapManager, mapViewManager, mapViewSettings, compassIcon, faceObjectProviders, unknownSquareIcon); - final SelectedSquareControl<G, A, R> selectedSquareControl = new SelectedSquareControl<G, A, R>(selectedSquareModel, selectedSquareActions, gameObjectAttributesDialogFactory, objectChooser, selectedSquareView); + final SelectedSquareView<G, A, R> selectedSquareView = new SelectedSquareView<G, A, R>(selectedSquareModel, selectedSquareActions, mapManager, mapViewManager, mapViewSettings, compassIcon, faceObjectProviders, unknownSquareIcon); + final SelectedSquareControl<G, A, R> selectedSquareControl = new SelectedSquareControl<G, A, R>(selectedSquareModel, gameObjectAttributesDialogFactory, objectChooser, selectedSquareView); final InsertionModeSet<G, A, R> insertionModeSet = new InsertionModeSet<G, A, R>(topmostInsertionMode); final CopyBuffer<G, A, R> copyBuffer = new CopyBuffer<G, A, R>(mapViewSettings, gameObjectFactory, mapArchObjectFactory, mapControlFactory, insertionModeSet); final ReplaceDialogManager<G, A, R> replaceDialogManager = new ReplaceDialogManager<G, A, R>(mainViewFrame, copyBuffer, objectChooser, mapViewManager, faceObjectProviders, insertionModeSet); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 00:39:47
|
Revision: 8434 http://gridarta.svn.sourceforge.net/gridarta/?rev=8434&view=rev Author: akirschbaum Date: 2010-06-24 00:39:41 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Move code from constructor to field declarations. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-24 00:36:44 UTC (rev 8433) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-24 00:39:41 UTC (rev 8434) @@ -108,19 +108,19 @@ private final ModelUpdater modelUpdater; /** - * The list of game objects. + * The {@link DefaultListModel} of {@link #list}. */ - private final JList list; + private final DefaultListModel model = new DefaultListModel(); /** - * The {@link DefaultListModel} of {@link #list}. + * The list of game objects. */ - private final DefaultListModel model; + private final JList list = new JList(model); /** * The arrow buttons. */ - private final Container arrows; + private final Container arrows = new JPanel(); /** * The cache to store selections for each map control. @@ -372,9 +372,7 @@ setLayout(new BorderLayout()); - model = new DefaultListModel(); modelUpdater = new ModelUpdater(model, mapViewSettings); - list = new JList(model); list.setCellRenderer(new CellRenderer<G, A, R>(faceObjectProviders, unknownSquareIcon)); list.setBackground(Color.lightGray); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); @@ -383,7 +381,6 @@ scrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); add(scrollPane, BorderLayout.CENTER); - arrows = new JPanel(); updateArrows(false); final Collection<Action> actions = new ArrayList<Action>(); actions.add(aMoveSquareTop); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 00:36:50
|
Revision: 8433 http://gridarta.svn.sourceforge.net/gridarta/?rev=8433&view=rev Author: akirschbaum Date: 2010-06-24 00:36:44 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Remove SelectedSquareControl.getSelectedSquareView(). Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java 2010-06-24 00:33:06 UTC (rev 8432) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java 2010-06-24 00:36:44 UTC (rev 8433) @@ -24,22 +24,16 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import javax.swing.Icon; -import javax.swing.ImageIcon; import net.sf.gridarta.gui.gameobjectattributesdialog.GameObjectAttributesDialogFactory; import net.sf.gridarta.gui.map.mapview.MapView; -import net.sf.gridarta.gui.map.mapview.MapViewManager; import net.sf.gridarta.gui.objectchooser.ObjectChooser; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.baseobject.BaseObject; -import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.mapcontrol.MapControl; import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapSquare; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.japi.swing.action.ActionMethod; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -119,22 +113,16 @@ * @param gameObjectAttributesDialogFactory the factory for creating game * object attributes dialog instances * @param objectChooser the object chooser - * @param mapManager the map manager to use - * @param mapViewManager the map view manager to use - * @param mapViewSettings the map view settings instance - * @param compassIcon If non-<code>null</code>, display this icon on the top - * of the list - * @param faceObjectProviders the face object providers for looking up - * faces - * @param unknownSquareIcon the icon for unknown squares + * @param selectedSquareView the selected square view */ - public SelectedSquareControl(@NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final SelectedSquareActions<G, A, R> selectedSquareActions, @NotNull final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final MapViewSettings mapViewSettings, @Nullable final ImageIcon compassIcon, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final Icon unknownSquareIcon) { + public SelectedSquareControl(@NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final SelectedSquareActions<G, A, R> selectedSquareActions, @NotNull final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final SelectedSquareView<G, A, R> selectedSquareView) { this.selectedSquareModel = selectedSquareModel; this.selectedSquareActions = selectedSquareActions; this.gameObjectAttributesDialogFactory = gameObjectAttributesDialogFactory; this.objectChooser = objectChooser; + this.selectedSquareView = selectedSquareView; - selectedSquareView = new SelectedSquareView<G, A, R>(selectedSquareModel, mapManager, mapViewManager, mapViewSettings, compassIcon, faceObjectProviders, unknownSquareIcon); + selectedSquareView.addListMouseListener(mouseListener); refreshActions(); @@ -281,16 +269,6 @@ } } - /** - * Return the view for this controller. - * @return the view for this controller - */ - @Deprecated - @NotNull - public SelectedSquareView<G, A, R> getSelectedSquareView() { - return selectedSquareView; - } - public void selectArch(final boolean above) { selectedSquareView.setSelectedIndex(selectedSquareView.getSelectedIndex() + (above ? 1 : -1)); } Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-24 00:33:06 UTC (rev 8432) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-24 00:36:44 UTC (rev 8433) @@ -461,7 +461,8 @@ newMapDialogFactory.setObjectChooser(objectChooser); final SelectedSquareModel<G, A, R> selectedSquareModel = new SelectedSquareModel<G, A, R>(); final SelectedSquareActions<G, A, R> selectedSquareActions = new SelectedSquareActions<G, A, R>(selectedSquareModel); - final SelectedSquareControl<G, A, R> selectedSquareControl = new SelectedSquareControl<G, A, R>(selectedSquareModel, selectedSquareActions, gameObjectAttributesDialogFactory, objectChooser, mapManager, mapViewManager, mapViewSettings, compassIcon, faceObjectProviders, unknownSquareIcon); + final SelectedSquareView<G, A, R> selectedSquareView = new SelectedSquareView<G, A, R>(selectedSquareModel, mapManager, mapViewManager, mapViewSettings, compassIcon, faceObjectProviders, unknownSquareIcon); + final SelectedSquareControl<G, A, R> selectedSquareControl = new SelectedSquareControl<G, A, R>(selectedSquareModel, selectedSquareActions, gameObjectAttributesDialogFactory, objectChooser, selectedSquareView); final InsertionModeSet<G, A, R> insertionModeSet = new InsertionModeSet<G, A, R>(topmostInsertionMode); final CopyBuffer<G, A, R> copyBuffer = new CopyBuffer<G, A, R>(mapViewSettings, gameObjectFactory, mapArchObjectFactory, mapControlFactory, insertionModeSet); final ReplaceDialogManager<G, A, R> replaceDialogManager = new ReplaceDialogManager<G, A, R>(mainViewFrame, copyBuffer, objectChooser, mapViewManager, faceObjectProviders, insertionModeSet); @@ -491,7 +492,6 @@ final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager = new DelayedMapModelListenerManager<G, A, R>(mapManager, exiter); final Control<?, G, A, R> lockedItemsControl = new LockedItemsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, lockedItemsTypeNumbers); final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel = new GameObjectAttributesModel<G, A, R>(); - final SelectedSquareView<G, A, R> selectedSquareView = selectedSquareControl.getSelectedSquareView(); final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl = new GameObjectAttributesControl<G, A, R>(gameObjectAttributesModel, gameObjectAttributesDialogFactory, objectChooser, mapManager, selectedSquareModel, selectedSquareView, gameObjectFactory, gameObjectMatchers); final PluginParameterViewFactory<G, A, R> pluginParameterViewFactory = new PluginParameterViewFactory<G, A, R>(archetypeSet, gameObjectAttributesModel, objectChooser, mapManager, faceObjectProviders); final File scriptsFile = new File(globalSettings.getMapsDirectory(), scriptsDir); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 00:33:12
|
Revision: 8432 http://gridarta.svn.sourceforge.net/gridarta/?rev=8432&view=rev Author: akirschbaum Date: 2010-06-24 00:33:06 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Move code from SelectedSquareControl to SelectedSquareView. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java 2010-06-24 00:19:16 UTC (rev 8431) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java 2010-06-24 00:33:06 UTC (rev 8432) @@ -24,9 +24,6 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import java.util.ArrayList; -import java.util.List; -import javax.swing.Action; import javax.swing.Icon; import javax.swing.ImageIcon; import net.sf.gridarta.gui.gameobjectattributesdialog.GameObjectAttributesDialogFactory; @@ -43,9 +40,6 @@ import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapSquare; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; -import net.sf.gridarta.utils.ActionUtils; -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; import org.jetbrains.annotations.Nullable; @@ -61,12 +55,6 @@ public class SelectedSquareControl<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { /** - * The action builder. - */ - @NotNull - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - - /** * The factory for creating game object attributes dialog instances. */ @NotNull @@ -97,42 +85,6 @@ private final SelectedSquareActions<G, A, R> selectedSquareActions; /** - * The action for "move square top". - */ - @NotNull - private final Action aMoveSquareTop = ActionUtils.newAction(ACTION_BUILDER, "Selected Square View", this, "moveSquareTop"); - - /** - * The action for "move square up". - */ - @NotNull - private final Action aMoveSquareUp = ActionUtils.newAction(ACTION_BUILDER, "Selected Square View", this, "moveSquareUp"); - - /** - * The action for "move square down". - */ - @NotNull - private final Action aMoveSquareDown = ActionUtils.newAction(ACTION_BUILDER, "Selected Square View", this, "moveSquareDown"); - - /** - * The action for "move square bottom". - */ - @NotNull - private final Action aMoveSquareBottom = ActionUtils.newAction(ACTION_BUILDER, "Selected Square View", this, "moveSquareBottom"); - - /** - * The action for "move square env". - */ - @NotNull - private final Action aMoveSquareEnv = ActionUtils.newAction(ACTION_BUILDER, "Selected Square View", this, "moveSquareEnv"); - - /** - * The action for "move square inv". - */ - @NotNull - private final Action aMoveSquareInv = ActionUtils.newAction(ACTION_BUILDER, "Selected Square View", this, "moveSquareInv"); - - /** * The {@link MouseListener} attached to the view to process mouse actions. */ @NotNull @@ -182,14 +134,7 @@ this.gameObjectAttributesDialogFactory = gameObjectAttributesDialogFactory; this.objectChooser = objectChooser; - final List<Action> actions = new ArrayList<Action>(); - actions.add(aMoveSquareTop); - actions.add(aMoveSquareUp); - actions.add(aMoveSquareDown); - actions.add(aMoveSquareBottom); - actions.add(aMoveSquareEnv); - actions.add(aMoveSquareInv); - selectedSquareView = new SelectedSquareView<G, A, R>(selectedSquareModel, mapManager, mapViewManager, mapViewSettings, compassIcon, actions, faceObjectProviders, unknownSquareIcon); + selectedSquareView = new SelectedSquareView<G, A, R>(selectedSquareModel, mapManager, mapViewManager, mapViewSettings, compassIcon, faceObjectProviders, unknownSquareIcon); selectedSquareView.addListMouseListener(mouseListener); refreshActions(); Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-24 00:19:16 UTC (rev 8431) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-24 00:33:06 UTC (rev 8432) @@ -30,6 +30,8 @@ import java.awt.event.MouseListener; import java.awt.geom.RectangularShape; import java.io.File; +import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -65,7 +67,10 @@ import net.sf.gridarta.model.mapcursor.MapCursorEvent; import net.sf.gridarta.model.mapcursor.MapCursorListener; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; +import net.sf.gridarta.utils.ActionUtils; import net.sf.gridarta.utils.Size2D; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -85,6 +90,12 @@ private static final long serialVersionUID = 1L; /** + * The action builder. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** * The model for this view. */ @NotNull @@ -125,6 +136,42 @@ private final Map<MapControl<G, A, R>, MapModelListener<G, A, R>> mapModelListeners = new HashMap<MapControl<G, A, R>, MapModelListener<G, A, R>>(); /** + * The action for "move square top". + */ + @NotNull + private final Action aMoveSquareTop = ActionUtils.newAction(ACTION_BUILDER, "Selected Square View", this, "moveSquareTop"); + + /** + * The action for "move square up". + */ + @NotNull + private final Action aMoveSquareUp = ActionUtils.newAction(ACTION_BUILDER, "Selected Square View", this, "moveSquareUp"); + + /** + * The action for "move square down". + */ + @NotNull + private final Action aMoveSquareDown = ActionUtils.newAction(ACTION_BUILDER, "Selected Square View", this, "moveSquareDown"); + + /** + * The action for "move square bottom". + */ + @NotNull + private final Action aMoveSquareBottom = ActionUtils.newAction(ACTION_BUILDER, "Selected Square View", this, "moveSquareBottom"); + + /** + * The action for "move square env". + */ + @NotNull + private final Action aMoveSquareEnv = ActionUtils.newAction(ACTION_BUILDER, "Selected Square View", this, "moveSquareEnv"); + + /** + * The action for "move square inv". + */ + @NotNull + private final Action aMoveSquareInv = ActionUtils.newAction(ACTION_BUILDER, "Selected Square View", this, "moveSquareInv"); + + /** * The map manager listener. */ private final MapManagerListener<G, A, R> mapManagerListener = new MapManagerListener<G, A, R>() { @@ -315,12 +362,11 @@ * @param mapViewSettings the map view settings instance * @param compassIcon if non-<code>null</code>, display this icon on the top * of the list - * @param arrowActions the actions to display * @param faceObjectProviders the face object providers for looking up * faces * @param unknownSquareIcon the icon for unknown squares */ - public SelectedSquareView(@NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final MapViewSettings mapViewSettings, @Nullable final ImageIcon compassIcon, @NotNull final Iterable<Action> arrowActions, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final Icon unknownSquareIcon) { + public SelectedSquareView(@NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final MapViewSettings mapViewSettings, @Nullable final ImageIcon compassIcon, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final Icon unknownSquareIcon) { this.selectedSquareModel = selectedSquareModel; mapSquareSelectionCache = new MapSquareSelectionCache<G, A, R>(mapViewManager); @@ -339,7 +385,14 @@ arrows = new JPanel(); updateArrows(false); - for (final Action action : arrowActions) { + final Collection<Action> actions = new ArrayList<Action>(); + actions.add(aMoveSquareTop); + actions.add(aMoveSquareUp); + actions.add(aMoveSquareDown); + actions.add(aMoveSquareBottom); + actions.add(aMoveSquareEnv); + actions.add(aMoveSquareInv); + for (final Action action : actions) { final AbstractButton button = new JButton(action); arrows.add(button); button.setMargin(new Insets(0, 0, 0, 0)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 00:19:26
|
Revision: 8431 http://gridarta.svn.sourceforge.net/gridarta/?rev=8431&view=rev Author: akirschbaum Date: 2010-06-24 00:19:16 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Remove mapModel parameter from MapModelListener.modifiedChanged(). Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -259,7 +259,7 @@ * {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -639,7 +639,7 @@ */ private void fireModifiedChanged() { for (final MapModelListener<G, A, R> listener : mapModelListeners.getListeners()) { - listener.modifiedChanged(this); + listener.modifiedChanged(); } } Modified: trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -79,8 +79,7 @@ /** * The modified flag has changed. - * @param mapModel the map model that has changed */ - void modifiedChanged(@NotNull MapModel<G, A, R> mapModel); + void modifiedChanged(); } // interface MapModelListener Modified: trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -127,7 +127,7 @@ * {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel) { + public void modifiedChanged() { // ignore } }; Modified: trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -375,7 +375,7 @@ * {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -734,7 +734,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -213,7 +213,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -285,7 +285,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -173,7 +173,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { updateActions(); } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -125,7 +125,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { updateTitle(); } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -143,7 +143,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -254,7 +254,7 @@ * {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -31,7 +31,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.mapcontrol.MapControl; -import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapModelListener; import net.sf.gridarta.model.map.mapmodel.MapSquare; import net.sf.gridarta.model.map.validation.ErrorCollector; @@ -144,7 +143,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { updateName(); } Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -294,7 +294,7 @@ * {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -54,7 +54,6 @@ import net.sf.gridarta.model.map.mapcontrol.DefaultMapControl; import net.sf.gridarta.model.map.mapcontrol.MapControl; import net.sf.gridarta.model.map.mapcontrol.MapControlListener; -import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapModelListener; import net.sf.gridarta.model.map.mapmodel.MapSquare; import net.sf.gridarta.model.map.validation.ErrorCollector; @@ -260,7 +259,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { refresh(); } Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -23,9 +23,11 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Set; import net.sf.gridarta.mapfiles.MapFile; import net.sf.gridarta.mapfiles.MapFileNameComparator; @@ -60,57 +62,11 @@ private final Collection<PickmapChooserModelListener<G, A, R>> listeners = new LinkedList<PickmapChooserModelListener<G, A, R>>(); /** - * The map control listener which is attached to all pickmaps to detect - * changes of the "modified" flag. + * Maps {@link MapControl} instance to attached {@link MapModelListener}. */ @NotNull - private final MapModelListener<G, A, R> mapModelListener = new MapModelListener<G, A, R>() { + private final Map<MapControl<G, A, R>, MapModelListener<G, A, R>> mapModelListeners = new HashMap<MapControl<G, A, R>, MapModelListener<G, A, R>>(); - /** {@inheritDoc} */ - @Override - public void mapSizeChanged(@NotNull final Size2D newSize) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void mapFileChanged(@Nullable final File oldMapFile) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { - int index = 0; - for (final MapFile<G, A, R> mapFile : mapFiles) { - if (mapFile.getPickmap().getMapModel() == mapModel) { - firePickmapModifiedChanged(index, mapFile); - return; - } - index++; - } - } - - }; - /** * Adds a map file. * @param mapFile the map file to add @@ -120,7 +76,7 @@ final int tmp = Collections.binarySearch(mapFiles, mapFile, MapFileNameComparator.INSTANCE); final int index = tmp >= 0 ? tmp : -tmp - 1; mapFiles.add(index, mapFile); - mapFile.getPickmap().getMapModel().addMapModelListener(mapModelListener); + addMapModelListener(mapFile.getPickmap()); return index; } @@ -135,7 +91,7 @@ if (index < 0) { return -1; // might have been a pickmap that could not be loaded } - mapFile.getPickmap().getMapModel().removeMapModelListener(mapModelListener); + removeMapModelListener(mapFile.getPickmap()); mapFiles.remove(index); return index; } @@ -152,8 +108,8 @@ if (index < 0) { return -1; // might have been a pickmap that could not be loaded } - oldPickmap.getMapModel().removeMapModelListener(mapModelListener); - mapFile.getPickmap().getMapModel().addMapModelListener(mapModelListener); + removeMapModelListener(oldPickmap); + addMapModelListener(mapFile.getPickmap()); firePickmapReverted(mapFile); return index; } @@ -214,7 +170,7 @@ */ public void clear() { for (final MapFile<G, A, R> mapFile : mapFiles) { - mapFile.getPickmap().getMapModel().removeMapModelListener(mapModelListener); + removeMapModelListener(mapFile.getPickmap()); } mapFiles.clear(); } @@ -258,4 +214,91 @@ } } + /** + * Tracks a {@link MapControl} instance for changes. The map control + * instance must not be tracked. + * @param mapControl the map control instance + */ + private void addMapModelListener(@NotNull final MapControl<G, A, R> mapControl) { + final MapModel<G, A, R> mapModel = mapControl.getMapModel(); + final MapModelListener<G, A, R> mapModelListener = new PickmapChooserMapModelListener(mapModel); + mapModel.addMapModelListener(mapModelListener); + mapModelListeners.put(mapControl, mapModelListener); + } + + /** + * Stops tracking a {@link MapControl} instance for changes. The map control + * instance must be tracked. + * @param mapControl the map control instance + */ + private void removeMapModelListener(@NotNull final MapControl<G, A, R> mapControl) { + final MapModelListener<G, A, R> mapModelListener = mapModelListeners.remove(mapControl); + assert mapModelListener != null; + mapControl.getMapModel().removeMapModelListener(mapModelListener); + } + + /** + * A {@link MapModelListener} which tracks a pickmap for modifications. + */ + private class PickmapChooserMapModelListener implements MapModelListener<G, A, R> { + + /** + * The tracked {@link MapModel}. + */ + @NotNull + private final MapModel<G, A, R> mapModel; + + /** + * Creates a new instance. + * @param mapModel the tracked map map mpdel + */ + private PickmapChooserMapModelListener(@NotNull final MapModel<G, A, R> mapModel) { + this.mapModel = mapModel; + } + + /** {@inheritDoc} */ + @Override + public void mapSizeChanged(@NotNull final Size2D newSize) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapFileChanged(@Nullable final File oldMapFile) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void modifiedChanged() { + int index = 0; + for (final MapFile<G, A, R> mapFile : mapFiles) { + if (mapFile.getPickmap().getMapModel() == mapModel) { + firePickmapModifiedChanged(index, mapFile); + return; + } + index++; + } + } + + } + } // class PickmapChooserModel Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -180,7 +180,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -598,7 +598,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 23:43:42
|
Revision: 8430 http://gridarta.svn.sourceforge.net/gridarta/?rev=8430&view=rev Author: akirschbaum Date: 2010-06-23 23:43:35 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Remove mapModel parameter from MapModelListener.mapSizeChanged(). Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -169,7 +169,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore: will trigger an mapGridChanged() callback } Modified: trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -581,7 +581,7 @@ private void fireMapSizeChanged(@NotNull final Size2D newSize) { setModified(); for (final MapModelListener<G, A, R> listener : mapModelListeners.getListeners()) { - listener.mapSizeChanged(this, newSize); + listener.mapSizeChanged(newSize); } } Modified: trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -38,10 +38,9 @@ /** * The size of a map has changed. - * @param mapModel the map model that has changed * @param newSize the new map size */ - void mapSizeChanged(@Deprecated @NotNull MapModel<G, A, R> mapModel, @NotNull Size2D newSize); + void mapSizeChanged(@NotNull Size2D newSize); /** * Squares of a map have changed. The following things are square changes: Modified: trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -82,7 +82,7 @@ * {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { log("mapSizeChanged", null, null); } Modified: trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -335,8 +335,8 @@ * {@inheritDoc} */ @Override - public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { - scheduleMapModel(this.mapModel); + public void mapSizeChanged(@NotNull final Size2D newSize) { + scheduleMapModel(mapModel); } /** Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -698,7 +698,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { if (gameObject.getMapSquare() == null) { setValue(cancelButton); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -183,7 +183,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -240,7 +240,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -143,7 +143,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -95,7 +95,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -113,7 +113,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { getMapGrid().resize(newSize); } Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -214,7 +214,7 @@ * {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore: will trigger an mapGridChanged() callback } Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -114,7 +114,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -250,7 +250,7 @@ * {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -230,7 +230,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -68,7 +68,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -30,6 +30,8 @@ import java.awt.event.MouseListener; import java.awt.geom.RectangularShape; import java.io.File; +import java.util.HashMap; +import java.util.Map; import java.util.Set; import javax.swing.AbstractButton; import javax.swing.Action; @@ -116,69 +118,76 @@ private final MapSquareSelectionCache<G, A, R> mapSquareSelectionCache; /** - * The map model listener. + * Maps {@link MapControl} instance to the attached {@link MapModelListener} + * instance. */ - private final MapModelListener<G, A, R> mapModelListener = new MapModelListener<G, A, R>() { + @NotNull + private final Map<MapControl<G, A, R>, MapModelListener<G, A, R>> mapModelListeners = new HashMap<MapControl<G, A, R>, MapModelListener<G, A, R>>(); - /** {@inheritDoc} */ - @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { - if (selectedSquareModel.isSelectedMapModel(mapModel)) { - refresh(); - } - } + /** + * The map manager listener. + */ + private final MapManagerListener<G, A, R> mapManagerListener = new MapManagerListener<G, A, R>() { /** {@inheritDoc} */ @Override - public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) { - if (selectedSquareModel.isSelectedMapSquares(mapSquares)) { - refresh(); - } + public void currentMapChanged(@Nullable final MapControl<G, A, R> mapControl) { + // ignore } /** {@inheritDoc} */ @Override - public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) { - if (selectedSquareModel.isSelectedGameObjects(gameObjects) || selectedSquareModel.isSelectedGameObjects(transientGameObjects)) { - refresh(); - } - } + public void mapCreated(@NotNull final MapControl<G, A, R> mapControl, final boolean interactive) { - /** {@inheritDoc} */ - @Override - public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) { - // ignore - } + final MapModel<G, A, R> mapModel = mapControl.getMapModel(); + final MapModelListener<G, A, R> mapModelListener = new MapModelListener<G, A, R>() { - /** {@inheritDoc} */ - @Override - public void mapFileChanged(@Nullable final File oldMapFile) { - // ignore - } + /** {@inheritDoc} */ + @Override + public void mapSizeChanged(@NotNull final Size2D newSize) { + if (selectedSquareModel.isSelectedMapModel(mapModel)) { + refresh(); + } + } - /** {@inheritDoc} */ - @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { - // ignore - } + /** {@inheritDoc} */ + @Override + public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) { + if (selectedSquareModel.isSelectedMapSquares(mapSquares)) { + refresh(); + } + } - }; + /** {@inheritDoc} */ + @Override + public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) { + if (selectedSquareModel.isSelectedGameObjects(gameObjects) || selectedSquareModel.isSelectedGameObjects(transientGameObjects)) { + refresh(); + } + } - /** - * The map manager listener. - */ - private final MapManagerListener<G, A, R> mapManagerListener = new MapManagerListener<G, A, R>() { + /** {@inheritDoc} */ + @Override + public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) { + // ignore + } - /** {@inheritDoc} */ - @Override - public void currentMapChanged(@Nullable final MapControl<G, A, R> mapControl) { - // ignore - } + /** {@inheritDoc} */ + @Override + public void mapFileChanged(@Nullable final File oldMapFile) { + // ignore + } - /** {@inheritDoc} */ - @Override - public void mapCreated(@NotNull final MapControl<G, A, R> mapControl, final boolean interactive) { - mapControl.getMapModel().addMapModelListener(mapModelListener); + /** {@inheritDoc} */ + @Override + public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + // ignore + } + + }; + + mapModel.addMapModelListener(mapModelListener); + mapModelListeners.put(mapControl, mapModelListener); } /** {@inheritDoc} */ @@ -190,6 +199,8 @@ /** {@inheritDoc} */ @Override public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { + final MapModelListener<G, A, R> mapModelListener = mapModelListeners.remove(mapControl); + assert mapModelListener != null; mapControl.getMapModel().removeMapModelListener(mapModelListener); } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -568,7 +568,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 23:27:20
|
Revision: 8429 http://gridarta.svn.sourceforge.net/gridarta/?rev=8429&view=rev Author: akirschbaum Date: 2010-06-23 23:27:13 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-23 20:15:25 UTC (rev 8428) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-23 23:27:13 UTC (rev 8429) @@ -240,12 +240,6 @@ private final ScriptController<G, A, R> scriptControl; /** - * The {@link ScriptExecutor} instance. - */ - @NotNull - private final ScriptExecutor<G, A, R> scriptExecutor; - - /** * The {@link MapManager} instance. */ @NotNull @@ -443,7 +437,6 @@ this.editorFactory = editorFactory; this.scriptExtension = scriptExtension; this.validators = validators; - this.scriptExecutor = scriptExecutor; final ArchetypeChooserControl<G, A, R> archetypeChooserControl = new ArchetypeChooserControl<G, A, R>(archetypeChooserModel, createDirectionPane, faceObjectProviders); final ImageCreator<G, A, R> imageCreator = new ImageCreator<G, A, R>(mapManager, rendererFactory); final ImageCreator2<G, A, R> imageCreator2 = new ImageCreator2<G, A, R>(globalSettings, imageCreator); @@ -781,16 +774,6 @@ } /** - * Returns the script executor. - * @return the script executor - */ - @Deprecated - @NotNull - public ScriptExecutor<G, A, R> getScriptExecutor() { - return scriptExecutor; - } - - /** * Load a list of map files. * @param filenames collection of filenames to load */ @@ -847,12 +830,6 @@ } } - @Deprecated - @NotNull - public Exiter getExiter() { - return exiter; - } - /** * Starts the editor: makes the main window visible and opens map files. * @param args the map files to open This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 20:15:31
|
Revision: 8428 http://gridarta.svn.sourceforge.net/gridarta/?rev=8428&view=rev Author: akirschbaum Date: 2010-06-23 20:15:25 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Use correct application name in error messages. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:14:58 UTC (rev 8427) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:15:25 UTC (rev 8428) @@ -152,7 +152,7 @@ boolean err = false; // whether a fatal error (exit required) occurred. String script = null; final LongOpt[] longOpts = { new LongOpt("batchpng", LongOpt.NO_ARGUMENT, null, (int) 'b'), new LongOpt("normal", LongOpt.NO_ARGUMENT, null, (int) 'n'), new LongOpt("singlepng", LongOpt.NO_ARGUMENT, null, (int) 's'), new LongOpt("collectarches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("collectArches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("help", LongOpt.NO_ARGUMENT, null, (int) 'h'), new LongOpt("noexit", LongOpt.NO_ARGUMENT, null, 2), new LongOpt("script", LongOpt.REQUIRED_ARGUMENT, null, 1), new LongOpt("config", LongOpt.REQUIRED_ARGUMENT, null, 3), }; - final Getopt g = new Getopt("testprog", args, "bchns", longOpts); + final Getopt g = new Getopt(editorJarName, args, "bchns", longOpts); GridartaRunMode mode = GridartaRunMode.NORMAL; File config = defaultConfig == null ? null : ConfigFileUtils.getHomeFile(defaultConfig); boolean doExit = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 20:15:04
|
Revision: 8427 http://gridarta.svn.sourceforge.net/gridarta/?rev=8427&view=rev Author: akirschbaum Date: 2010-06-23 20:14:58 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Add comment. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:13:26 UTC (rev 8426) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:14:58 UTC (rev 8427) @@ -489,6 +489,12 @@ return 0; } + /** + * Prints the editor's command-line options to {@link System#out}. + * @param editorJarName the name of the editor's .jar file + * @param defaultConfig the default config file or <code>null</code> for + * Java preferences + */ private static void usage(@NotNull final String editorJarName, @Nullable final String defaultConfig) { System.out.println("usage: java -jar " + editorJarName + " [option...] [map-file...]"); System.out.println(""); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 20:13:33
|
Revision: 8426 http://gridarta.svn.sourceforge.net/gridarta/?rev=8426&view=rev Author: akirschbaum Date: 2010-06-23 20:13:26 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Move GridartaEditor.Mode to GridartaRunMode. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/maincontrol/GridartaRunMode.java Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:11:07 UTC (rev 8425) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:13:26 UTC (rev 8426) @@ -153,7 +153,7 @@ String script = null; final LongOpt[] longOpts = { new LongOpt("batchpng", LongOpt.NO_ARGUMENT, null, (int) 'b'), new LongOpt("normal", LongOpt.NO_ARGUMENT, null, (int) 'n'), new LongOpt("singlepng", LongOpt.NO_ARGUMENT, null, (int) 's'), new LongOpt("collectarches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("collectArches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("help", LongOpt.NO_ARGUMENT, null, (int) 'h'), new LongOpt("noexit", LongOpt.NO_ARGUMENT, null, 2), new LongOpt("script", LongOpt.REQUIRED_ARGUMENT, null, 1), new LongOpt("config", LongOpt.REQUIRED_ARGUMENT, null, 3), }; final Getopt g = new Getopt("testprog", args, "bchns", longOpts); - Mode mode = Mode.NORMAL; + GridartaRunMode mode = GridartaRunMode.NORMAL; File config = defaultConfig == null ? null : ConfigFileUtils.getHomeFile(defaultConfig); boolean doExit = true; while (true) { @@ -164,11 +164,11 @@ switch (ch) { case 'b': - mode = Mode.BATCH_PNG; + mode = GridartaRunMode.BATCH_PNG; break; case 'c': - mode = Mode.COLLECT_ARCHES; + mode = GridartaRunMode.COLLECT_ARCHES; break; case 'h': @@ -176,11 +176,11 @@ return; case 'n': - mode = Mode.NORMAL; + mode = GridartaRunMode.NORMAL; break; case 's': - mode = Mode.SINGLE_PNG; + mode = GridartaRunMode.SINGLE_PNG; break; case 1: @@ -230,7 +230,7 @@ actionBuilder.addPref(DefaultMainControl.class); actionBuilder.addParent(ActionBuilderFactory.getInstance().getActionBuilder(actionBuilderPackage)); @Nullable final SplashScreen splashScreen; - if (mode == Mode.NORMAL) { + if (mode == GridartaRunMode.NORMAL) { splashScreen = new SplashScreen(); splashScreen.show(); } else { @@ -279,7 +279,7 @@ final Spells<GameObjectSpell<G, A, R>> gameObjectSpells = new Spells<GameObjectSpell<G, A, R>>(); final AttributeRangeChecker<G, A, R> attributeRangeChecker = new AttributeRangeChecker<G, A, R>(validatorPreferences); final PluginParameterFactory<G, A, R> pluginParameterFactory = new PluginParameterFactory<G, A, R>(archetypeSet, mapManager, defaultFilterList); - final DefaultMainControl<G, A, R> mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory, validatorPreferences); + final DefaultMainControl<G, A, R> mainControl = editorFactory.newMainControl(mode == GridartaRunMode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory, validatorPreferences); final NamedFilter defaultNamedFilterList = new NamedFilter(gameObjectMatchers.getFilters()); final FilterControl<G, A, R> filterControl = new DefaultFilterControl<G, A, R>(defaultNamedFilterList); @@ -330,7 +330,7 @@ } } } - if (doExit && (mode != Mode.NORMAL || returnCode != 0)) { + if (doExit && (mode != GridartaRunMode.NORMAL || returnCode != 0)) { System.exit(returnCode); } } @@ -503,49 +503,4 @@ System.out.println(" run a plugin script with the given arguments"); } - private enum Mode { - - /** - * Normal operation: Start editor with GUI. - */ - NORMAL(false), - - /** - * Batch PNG: Create PNG files for all given maps in their directories. - */ - BATCH_PNG(false), - - /** - * Single PNG: Create a PNG file from the specified map. - */ - SINGLE_PNG(false), - - /** - * Collect archetypes. - */ - COLLECT_ARCHES(true); - - /** - * Whether this mode uses console-mode. - */ - private final boolean consoleMode; - - /** - * Creates a new instance. - * @param consoleMode whether this mode uses console mode - */ - Mode(final boolean consoleMode) { - this.consoleMode = consoleMode; - } - - /** - * Returns whether this mode uses console-mode. - * @return whether this mode uses console-mode - */ - public boolean isConsoleMode() { - return consoleMode; - } - - } // enum Mode - } // class GridartaEditor Added: trunk/src/app/net/sf/gridarta/maincontrol/GridartaRunMode.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaRunMode.java (rev 0) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaRunMode.java 2010-06-23 20:13:26 UTC (rev 8426) @@ -0,0 +1,69 @@ +/* + * 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.maincontrol; + +/** + * Main run mode of the editor. + * @author Andreas Kirschbaum + */ +public enum GridartaRunMode { + + /** + * Normal operation: Start editor with GUI. + */ + NORMAL(false), + + /** + * Batch PNG: Create PNG files for all given maps in their directories. + */ + BATCH_PNG(false), + + /** + * Single PNG: Create a PNG file from the specified map. + */ + SINGLE_PNG(false), + + /** + * Collect archetypes. + */ + COLLECT_ARCHES(true); + + /** + * Whether this mode uses console-mode. + */ + private final boolean consoleMode; + + /** + * Creates a new instance. + * @param consoleMode whether this mode uses console mode + */ + GridartaRunMode(final boolean consoleMode) { + this.consoleMode = consoleMode; + } + + /** + * Returns whether this mode uses console-mode. + * @return whether this mode uses console-mode + */ + public boolean isConsoleMode() { + return consoleMode; + } + +} // enum GridartaRunMode Property changes on: trunk/src/app/net/sf/gridarta/maincontrol/GridartaRunMode.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 20:11:15
|
Revision: 8425 http://gridarta.svn.sourceforge.net/gridarta/?rev=8425&view=rev Author: akirschbaum Date: 2010-06-23 20:11:07 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Remove redundant catch clause. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:10:18 UTC (rev 8424) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:11:07 UTC (rev 8425) @@ -275,22 +275,11 @@ final NamedFilter defaultFilterList = new NamedFilter(Collections.<NamedGameObjectMatcher>emptyList()); final AbstractArchetypeParser<G, A, R, ?> archetypeParser = editorFactory.newArchetypeParser(errorView, gameObjectParser, animationObjects, archetypeSet, gameObjectFactory, globalSettings); final AbstractResources<G, A, R> resources = editorFactory.newResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); - final DefaultMainControl<G, A, R> mainControl; final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); final Spells<GameObjectSpell<G, A, R>> gameObjectSpells = new Spells<GameObjectSpell<G, A, R>>(); final AttributeRangeChecker<G, A, R> attributeRangeChecker = new AttributeRangeChecker<G, A, R>(validatorPreferences); final PluginParameterFactory<G, A, R> pluginParameterFactory = new PluginParameterFactory<G, A, R>(archetypeSet, mapManager, defaultFilterList); - try { - mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory, validatorPreferences); - } catch (final RuntimeException ex) { - log.fatal(ex.getMessage(), ex); - if (doExit) { - System.exit(1); - throw new AssertionError(); - } else { - return; - } - } + final DefaultMainControl<G, A, R> mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory, validatorPreferences); final NamedFilter defaultNamedFilterList = new NamedFilter(gameObjectMatchers.getFilters()); final FilterControl<G, A, R> filterControl = new DefaultFilterControl<G, A, R>(defaultNamedFilterList); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 20:10:25
|
Revision: 8424 http://gridarta.svn.sourceforge.net/gridarta/?rev=8424&view=rev Author: akirschbaum Date: 2010-06-23 20:10:18 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Remove redundant catch clause. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:08:22 UTC (rev 8423) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:10:18 UTC (rev 8424) @@ -311,12 +311,7 @@ try { switch (mode) { case NORMAL: - try { - returnCode = runNormal(args2, mainControl, editorFactory, splashScreen, errorView, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); - } catch (final Exception ex) { - log.fatal(ex.getMessage(), ex); - returnCode = 1; - } + returnCode = runNormal(args2, mainControl, editorFactory, splashScreen, errorView, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); break; case BATCH_PNG: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 20:08:28
|
Revision: 8423 http://gridarta.svn.sourceforge.net/gridarta/?rev=8423&view=rev Author: akirschbaum Date: 2010-06-23 20:08:22 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Do not ignore caught exception. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:07:40 UTC (rev 8422) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:08:22 UTC (rev 8423) @@ -408,10 +408,10 @@ private static void waitDialog(final ErrorView errorView) { try { errorView.waitDialog(); - } catch (final InterruptedException ignored) { + } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); DefaultExiter.callExit(1); - throw new AssertionError(); + throw new AssertionError(ex); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 20:07:47
|
Revision: 8422 http://gridarta.svn.sourceforge.net/gridarta/?rev=8422&view=rev Author: akirschbaum Date: 2010-06-23 20:07:40 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Rename variable name. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:06:44 UTC (rev 8421) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:07:40 UTC (rev 8422) @@ -408,7 +408,7 @@ private static void waitDialog(final ErrorView errorView) { try { errorView.waitDialog(); - } catch (final InterruptedException ex) { + } catch (final InterruptedException ignored) { Thread.currentThread().interrupt(); DefaultExiter.callExit(1); throw new AssertionError(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 20:06:51
|
Revision: 8421 http://gridarta.svn.sourceforge.net/gridarta/?rev=8421&view=rev Author: akirschbaum Date: 2010-06-23 20:06:44 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Fix unchecked warning. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:05:09 UTC (rev 8420) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 20:06:44 UTC (rev 8421) @@ -457,7 +457,7 @@ * @return return code suitable for passing to {@link System#exit(int)} */ private int runNormal(@NotNull final Iterable<String> args, @NotNull final DefaultMainControl<G, A, R> mainControl, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final SplashScreen splashScreen, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory) { - final GUIMainControl<G, A, R>[] guiMainControl = (GUIMainControl<G, A, R>[]) new GUIMainControl<?, ?, ?>[1]; + final GUIMainControl<?, ?, ?>[] guiMainControl = new GUIMainControl<?, ?, ?>[1]; final Runnable runnable = new Runnable() { /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 20:05:16
|
Revision: 8420 http://gridarta.svn.sourceforge.net/gridarta/?rev=8420&view=rev Author: akirschbaum Date: 2010-06-23 20:05:09 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Open map files even if no archetypes have been found. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.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 Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/atrinik/ChangeLog 2010-06-23 20:05:09 UTC (rev 8420) @@ -1,5 +1,7 @@ 2010-06-23 Andreas Kirschbaum + * Open map files even if no archetypes have been found. + * Add --config command-line option for a specific config file rather than the default (~/.gridarta/atrinik.conf, ~/.gridarta/crossfire.conf, Java preferences). Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/crossfire/ChangeLog 2010-06-23 20:05:09 UTC (rev 8420) @@ -1,5 +1,7 @@ 2010-06-23 Andreas Kirschbaum + * Open map files even if no archetypes have been found. + * Add --config command-line option for a specific config file rather than the default (~/.gridarta/atrinik.conf, ~/.gridarta/crossfire.conf, Java preferences). Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/daimonin/ChangeLog 2010-06-23 20:05:09 UTC (rev 8420) @@ -1,5 +1,7 @@ 2010-06-23 Andreas Kirschbaum + * Open map files even if no archetypes have been found. + * Add --config command-line option for a specific config file rather than the default (~/.gridarta/atrinik.conf, ~/.gridarta/crossfire.conf, Java preferences). Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-23 20:05:09 UTC (rev 8420) @@ -479,7 +479,7 @@ scriptEditControl.setTextAreaDefaults(textAreaDefaults); scriptedEventEditor.setScriptEditControl(scriptEditControl); scriptArchEditor.setScriptEditControl(scriptEditControl); - fileControl = new DefaultFileControl<G, A, R>(globalSettings, archetypeSet, mapImageCache, mapManager, mapViewsManager, mainViewFrame, GuiFileFilters.mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension, scriptEditControl); + fileControl = new DefaultFileControl<G, A, R>(globalSettings, mapImageCache, mapManager, mapViewsManager, mainViewFrame, GuiFileFilters.mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension, scriptEditControl); pickmapChooserControl.setFileControl(fileControl); mapViewsManager.setFileControl(fileControl); final GameObjectMatcher floorMatcher = gameObjectMatchers.getMatcher("system_floor", "floor"); Modified: trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-06-23 20:05:09 UTC (rev 8420) @@ -30,7 +30,6 @@ import net.sf.gridarta.gui.mapimagecache.MapImageCache; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.mapcontrol.MapControl; @@ -63,12 +62,6 @@ private final GlobalSettings globalSettings; /** - * The {@link ArchetypeSet}. - */ - @NotNull - private final ArchetypeSet<G, A, R> archetypeSet; - - /** * The {@link MapImageCache}. */ @NotNull @@ -132,7 +125,6 @@ /** * Creates a new instance. * @param globalSettings the global settings instance - * @param archetypeSet the archetype set * @param mapImageCache the map image cache * @param mapManager the map manager * @param mapViewsManager the map views manager @@ -143,9 +135,8 @@ * @param scriptExtension the file extension for script files * @param scriptEditControl the script edit control to forward to */ - public DefaultFileControl(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final Component parent, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final String scriptExtension, @NotNull final ScriptEditControl scriptEditControl) { + public DefaultFileControl(@NotNull final GlobalSettings globalSettings, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final Component parent, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final String scriptExtension, @NotNull final ScriptEditControl scriptEditControl) { this.globalSettings = globalSettings; - this.archetypeSet = archetypeSet; this.mapImageCache = mapImageCache; this.mapManager = mapManager; this.mapViewsManager = mapViewsManager; @@ -216,12 +207,6 @@ return; } - if (archetypeSet.getArchetypeCount() == 0) { - // ArchStack is empty -> abort! - ACTION_BUILDER.showMessageDialog(parent, "openFileWantedNoArches"); - return; - } - globalSettings.setChangedDir(true); // user has chosen an active dir final File dir = tmpFileChooser.getCurrentDirectory(); final File[] files = tmpFileChooser.getSelectedFiles(); Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-06-23 20:05:09 UTC (rev 8420) @@ -1517,8 +1517,6 @@ fileDialog.filter.txt=Text Files fileDialog.filter.text=Text Files fileDialog.filter.py=Python Scripts -openFileWantedNoArches.title=Cannot open map -openFileWantedNoArches.message=There are currently no archetypes available!\nYou need to have archetypes loaded before opening a map. ################## Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-06-23 20:05:09 UTC (rev 8420) @@ -1305,8 +1305,6 @@ fileDialog.filter.txt=Text-Dateien fileDialog.filter.text=Text-Dateien fileDialog.filter.py=Python-Skripte -openFileWantedNoArches.title=Kann Karte nicht \xF6ffnen -openFileWantedNoArches.message=Es sind keine Archetypen verf\xFCgbar.\nDiese werden ben\xF6tigt, um eine Karte zu \xF6ffnen. ################## Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-06-23 20:05:09 UTC (rev 8420) @@ -1285,8 +1285,6 @@ #fileDialog.filter.arc= #fileDialog.filter.anim= #fileDialog.filter.face= -#openFileWantedNoArches.title= -#openFileWantedNoArches.message= ################## Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-06-23 20:05:09 UTC (rev 8420) @@ -1296,8 +1296,6 @@ fileDialog.filter.arc=Arketypdefinitioner fileDialog.filter.anim=Animationdefinitioner #fileDialog.filter.face= -openFileWantedNoArches.title=Kan inte \xF6ppna karta -openFileWantedNoArches.message=Det finns inga arketyper (arches) tillg\xE4ngliga!\nDu m\xE5ste ha arketyperna innan du kan \xF6ppna en karta.\nL\xE4s i online-dokumentationen hur du kan skaffa arketypfiler.. ################## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 19:56:02
|
Revision: 8419 http://gridarta.svn.sourceforge.net/gridarta/?rev=8419&view=rev Author: akirschbaum Date: 2010-06-23 19:55:55 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Add --config command-line option for a specific config file rather than the default. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/AtrinikEditor.java trunk/build.xml trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/CrossfireEditor.java trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DaimoninEditor.java trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/atrinik/ChangeLog 2010-06-23 19:55:55 UTC (rev 8419) @@ -1,5 +1,13 @@ 2010-06-23 Andreas Kirschbaum + * Add --config command-line option for a specific config file + rather than the default (~/.gridarta/atrinik.conf, + ~/.gridarta/crossfire.conf, Java preferences). + + May be used to run regression tests or scripts independent of + editor settings, or to use different settings when editing maps + for different server versions. + * Make --script command line option work in headless mode. 2010-06-22 Andreas Kirschbaum Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/AtrinikEditor.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/AtrinikEditor.java 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/AtrinikEditor.java 2010-06-23 19:55:55 UTC (rev 8419) @@ -20,8 +20,6 @@ package net.sf.gridarta.var.atrinik.maincontrol; import net.sf.gridarta.maincontrol.GridartaEditor; -import net.sf.gridarta.preferences.FilePreferencesFactory; -import net.sf.gridarta.utils.ConfigFileUtils; 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; @@ -33,11 +31,6 @@ */ public class AtrinikEditor { - static { - System.setProperty("java.util.prefs.PreferencesFactory", "net.sf.gridarta.preferences.FilePreferencesFactory"); - FilePreferencesFactory.initialize("user_net_sf_gridarta", ConfigFileUtils.getHomeFile("atrinik.conf")); - } - /** * Prevent instantiation (UtilityClass). */ @@ -49,7 +42,7 @@ * @param args The command line parameters given to the level editor. */ public static void main(final String... args) { - new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.atrinik.tod").run("net.sf.gridarta.var.atrinik", "AtrinikEditor.jar", new DefaultEditorFactory(), args); + new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.atrinik.tod").run("net.sf.gridarta.var.atrinik", "AtrinikEditor.jar", new DefaultEditorFactory(), "atrinik.conf", args); } } // class AtrinikEditor Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/build.xml 2010-06-23 19:55:55 UTC (rev 8419) @@ -322,7 +322,7 @@ </copy> </target> - <target name="compile-gridarta" description="Compiles the gridarta module." depends="compile-model,compile-textedit,compile-utils"> + <target name="compile-gridarta" description="Compiles the gridarta module." depends="compile-model,compile-preferences,compile-textedit,compile-utils"> <mkdir dir="dest/gridarta/app"/> <javac srcdir="src/app" destdir="dest/gridarta/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> @@ -339,6 +339,7 @@ <fileset dir="lib" includes="jdom.jar"/> <fileset dir="lib" includes="log4j-1.2.13.jar"/> <pathelement location="dest/model/app"/> + <pathelement location="dest/preferences/app"/> <pathelement location="dest/textedit/app"/> <pathelement location="dest/utils/app"/> </classpath> @@ -351,6 +352,7 @@ <fileset dir="lib" includes="junit-4.2.jar"/> <pathelement location="dest/gridarta/app"/> <pathelement location="dest/model/app"/> + <pathelement location="dest/preferences/app"/> <pathelement location="dest/model/test"/> <pathelement location="dest/utils/app"/> </classpath> Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/crossfire/ChangeLog 2010-06-23 19:55:55 UTC (rev 8419) @@ -1,5 +1,13 @@ 2010-06-23 Andreas Kirschbaum + * Add --config command-line option for a specific config file + rather than the default (~/.gridarta/atrinik.conf, + ~/.gridarta/crossfire.conf, Java preferences). + + May be used to run regression tests or scripts independent of + editor settings, or to use different settings when editing maps + for different server versions. + * Make --script command line option work in headless mode. 2010-06-22 Andreas Kirschbaum Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/CrossfireEditor.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/CrossfireEditor.java 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/CrossfireEditor.java 2010-06-23 19:55:55 UTC (rev 8419) @@ -20,8 +20,6 @@ package net.sf.gridarta.var.crossfire.maincontrol; import net.sf.gridarta.maincontrol.GridartaEditor; -import net.sf.gridarta.preferences.FilePreferencesFactory; -import net.sf.gridarta.utils.ConfigFileUtils; 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; @@ -33,11 +31,6 @@ */ public class CrossfireEditor { - static { - System.setProperty("java.util.prefs.PreferencesFactory", "net.sf.gridarta.preferences.FilePreferencesFactory"); - FilePreferencesFactory.initialize("user_net_sf_gridarta", ConfigFileUtils.getHomeFile("crossfire.conf")); - } - /** * Prevent instantiation (UtilityClass). */ @@ -49,7 +42,7 @@ * @param args The command line parameters given to the level editor. */ public static void main(final String... args) { - new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.crossfire.tod").run("net.sf.gridarta.var.crossfire", "CrossfireEditor.jar", new DefaultEditorFactory(), args); + new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.crossfire.tod").run("net.sf.gridarta.var.crossfire", "CrossfireEditor.jar", new DefaultEditorFactory(), "crossfire.conf", args); } } // class CrossfireEditor Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/daimonin/ChangeLog 2010-06-23 19:55:55 UTC (rev 8419) @@ -1,5 +1,13 @@ 2010-06-23 Andreas Kirschbaum + * Add --config command-line option for a specific config file + rather than the default (~/.gridarta/atrinik.conf, + ~/.gridarta/crossfire.conf, Java preferences). + + May be used to run regression tests or scripts independent of + editor settings, or to use different settings when editing maps + for different server versions. + * Make --script command line option work in headless mode. 2010-06-22 Andreas Kirschbaum Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DaimoninEditor.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DaimoninEditor.java 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DaimoninEditor.java 2010-06-23 19:55:55 UTC (rev 8419) @@ -42,7 +42,7 @@ * @param args The command line parameters given to the level editor. */ public static void main(final String... args) { - new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.daimonin.tod").run("net.sf.gridarta.var.daimonin", "DaimoninEditor.jar", new DefaultEditorFactory(), args); + new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.daimonin.tod").run("net.sf.gridarta.var.daimonin", "DaimoninEditor.jar", new DefaultEditorFactory(), null, args); } } // class DaimoninEditor Modified: trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java =================================================================== --- trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java 2010-06-23 19:55:55 UTC (rev 8419) @@ -50,6 +50,10 @@ * not use a backing file */ public static void initialize(@NotNull final String defaultName, @Nullable final File file) { + if (userRoot != null || systemRoot != null) { + throw new IllegalStateException(); + } + final Storage storage = new Storage(defaultName, file); userRoot = new FilePreferencesRoot(NodeType.USER, storage); systemRoot = new FilePreferencesRoot(NodeType.SYSTEM, storage); Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 19:55:55 UTC (rev 8419) @@ -89,10 +89,12 @@ import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.NumberSpell; import net.sf.gridarta.model.spells.Spells; +import net.sf.gridarta.preferences.FilePreferencesFactory; import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; import net.sf.gridarta.script.ScriptParameters; import net.sf.gridarta.script.parameter.PluginParameterFactory; +import net.sf.gridarta.utils.ConfigFileUtils; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SyntaxErrorException; import net.sf.gridarta.utils.SystemIcons; @@ -134,12 +136,6 @@ } catch (final MissingResourceException e) { log.warn("No build number found:", e); } - // Make sure the locale is set before any ActionBuilder is used. - final Preferences preferences = Preferences.userNodeForPackage(MainControl.class); - final String locName = preferences.get(GUIPreferences.PREFERENCES_LANGUAGE, null); - if (locName != null) { - Locale.setDefault(new Locale(locName)); - } } /** @@ -148,14 +144,17 @@ * builder * @param editorJarName the name of the .jar file containing the executable * @param editorFactory the editor factory to use + * @param defaultConfig the default config file or <code>null</code> to use + * Java's preferences * @param args the command line parameters given to the level editor */ - public void run(@NotNull final String actionBuilderPackage, @NotNull final String editorJarName, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final String... args) { + public void run(@NotNull final String actionBuilderPackage, @NotNull final String editorJarName, @NotNull final EditorFactory<G, A, R> editorFactory, @Nullable final String defaultConfig, @NotNull final String... args) { boolean err = false; // whether a fatal error (exit required) occurred. String script = null; - final LongOpt[] longOpts = { new LongOpt("batchpng", LongOpt.NO_ARGUMENT, null, (int) 'b'), new LongOpt("normal", LongOpt.NO_ARGUMENT, null, (int) 'n'), new LongOpt("singlepng", LongOpt.NO_ARGUMENT, null, (int) 's'), new LongOpt("collectarches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("collectArches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("help", LongOpt.NO_ARGUMENT, null, (int) 'h'), new LongOpt("noexit", LongOpt.NO_ARGUMENT, null, 2), new LongOpt("script", LongOpt.REQUIRED_ARGUMENT, null, 1), }; + final LongOpt[] longOpts = { new LongOpt("batchpng", LongOpt.NO_ARGUMENT, null, (int) 'b'), new LongOpt("normal", LongOpt.NO_ARGUMENT, null, (int) 'n'), new LongOpt("singlepng", LongOpt.NO_ARGUMENT, null, (int) 's'), new LongOpt("collectarches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("collectArches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("help", LongOpt.NO_ARGUMENT, null, (int) 'h'), new LongOpt("noexit", LongOpt.NO_ARGUMENT, null, 2), new LongOpt("script", LongOpt.REQUIRED_ARGUMENT, null, 1), new LongOpt("config", LongOpt.REQUIRED_ARGUMENT, null, 3), }; final Getopt g = new Getopt("testprog", args, "bchns", longOpts); Mode mode = Mode.NORMAL; + File config = defaultConfig == null ? null : ConfigFileUtils.getHomeFile(defaultConfig); boolean doExit = true; while (true) { final int ch = g.getopt(); @@ -173,7 +172,7 @@ break; case 'h': - usage(editorJarName); + usage(editorJarName, defaultConfig); return; case 'n': @@ -192,6 +191,14 @@ doExit = false; break; + case 3: // --config + config = new File(g.getOptarg()); + if (!config.exists()) { + System.err.println(config + ": configuration file does not exist"); + err = true; + } + break; + case '?': default: err = true; @@ -202,6 +209,18 @@ if (err) { returnCode = 1; } else { + if (config != null) { + System.setProperty("java.util.prefs.PreferencesFactory", "net.sf.gridarta.preferences.FilePreferencesFactory"); + FilePreferencesFactory.initialize("user_net_sf_gridarta", config); + } + + // Make sure the locale is set before any ActionBuilder is used. + final Preferences preferences = Preferences.userNodeForPackage(MainControl.class); + final String locName = preferences.get(GUIPreferences.PREFERENCES_LANGUAGE, null); + if (locName != null) { + Locale.setDefault(new Locale(locName)); + } + final List<String> args2 = Arrays.asList(args).subList(g.getOptind(), args.length); // print jre version, for easier recognition of jre-specific problems @@ -486,7 +505,7 @@ return 0; } - private static void usage(@NotNull final String editorJarName) { + private static void usage(@NotNull final String editorJarName, @Nullable final String defaultConfig) { System.out.println("usage: java -jar " + editorJarName + " [option...] [map-file...]"); System.out.println(""); System.out.println(" -h, --help print this help"); @@ -494,6 +513,7 @@ System.out.println(" -c, --collectarches collect archetypes"); System.out.println(" -n, --normal start editor with GUI (default)"); System.out.println(" -s, --singlepng create a PNG file from the specified map"); + System.out.println(" --config=config-file use given config file; uses "+(defaultConfig == null ? "Java preferences" : "~/.gridarta/" + defaultConfig)+" is not given"); System.out.println(" --noexit do not call System.exit()"); System.out.println(" --script=name [arg=value...]"); System.out.println(" run a plugin script with the given arguments"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 19:28:55
|
Revision: 8418 http://gridarta.svn.sourceforge.net/gridarta/?rev=8418&view=rev Author: akirschbaum Date: 2010-06-23 19:28:49 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Make --script command line option work in headless mode. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-23 19:22:16 UTC (rev 8417) +++ trunk/atrinik/ChangeLog 2010-06-23 19:28:49 UTC (rev 8418) @@ -1,3 +1,7 @@ +2010-06-23 Andreas Kirschbaum + + * Make --script command line option work in headless mode. + 2010-06-22 Andreas Kirschbaum * Improve CTRL-ALT-E (toggle game object text editor): do not Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-23 19:22:16 UTC (rev 8417) +++ trunk/crossfire/ChangeLog 2010-06-23 19:28:49 UTC (rev 8418) @@ -1,3 +1,7 @@ +2010-06-23 Andreas Kirschbaum + + * Make --script command line option work in headless mode. + 2010-06-22 Andreas Kirschbaum * Improve CTRL-ALT-E (toggle game object text editor): do not Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-23 19:22:16 UTC (rev 8417) +++ trunk/daimonin/ChangeLog 2010-06-23 19:28:49 UTC (rev 8418) @@ -1,3 +1,7 @@ +2010-06-23 Andreas Kirschbaum + + * Make --script command line option work in headless mode. + 2010-06-22 Andreas Kirschbaum * Improve CTRL-ALT-E (toggle game object text editor): do not Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 19:22:16 UTC (rev 8417) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 19:28:49 UTC (rev 8418) @@ -21,6 +21,7 @@ import gnu.getopt.Getopt; import gnu.getopt.LongOpt; +import java.awt.GraphicsEnvironment; import java.io.File; import java.lang.reflect.InvocationTargetException; import java.util.Arrays; @@ -218,7 +219,7 @@ } // Create the application and give it the parameters - final ErrorView errorView = mode.isConsoleMode() ? new ConsoleErrorView() : new DefaultErrorView(null); + final ErrorView errorView = GraphicsEnvironment.isHeadless() || mode.isConsoleMode() ? new ConsoleErrorView() : new DefaultErrorView(null); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final ConfigSourceFactory configSourceFactory = new DefaultConfigSourceFactory(); @@ -286,7 +287,7 @@ final ScriptExecutor<G, A, R> scriptExecutor = new ScriptExecutor<G, A, R>(scriptModel, scriptParameters); if (script != null) { - returnCode = runScript(script, editorFactory, mainControl, errorView, args2, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); + returnCode = runScript(script, errorView, args2, scriptExecutor); } else { try { switch (mode) { @@ -333,69 +334,13 @@ /** * Executes a plugin script. - * @param mainControl the main control to use * @param script the name of the script to run - * @param editorFactory the editor factory to use * @param errorView the error view to add errors to * @param args2 the arguments for the script - * @param guiUtils the gui utils to use - * @param configSourceFactory the config source factory to use - * @param rendererFactory the renderer factory to use - * @param filterControl the filter control to use * @param scriptExecutor the script executor to use - * @param scriptParameters the script parameters to use - * @param mapManager the map manager to use - * @param pickmapManager the pickmap manager to use - * @param mapControlFactory the map control factory to use - * @param archetypeSet the archetype set - * @param faceObjects the face objects - * @param globalSettings the global settings - * @param mapViewSettings the map view settings - * @param faceObjectProviders the face object providers - * @param pathManager the path manager - * @param topmostInsertionMode the "topmost" insertion mode - * @param gameObjectFactory the game object factory - * @param systemIcons the system icons for creating icons - * @param archetypeTypeSet the archetype type set - * @param mapArchObjectFactory the map arch object factory to use - * @param mapReaderFactory the map reader factory to use - * @param validators the map validators - * @param gameObjectMatchers the game object matchers - * @param scriptModel the script model - * @param animationObjects the animation objects - * @param archetypeChooserModel the archetype chooser model - * @param scriptedEventEditor the scripted event editor - * @param resources the resources - * @param numberSpells the number spells to use - * @param gameObjectSpells the game object spells to use - * @param attributeRangeChecker the attribute range checker to use - * @param pluginParameterFactory the plugin parameter factory to use * @return return code suitable for passing to {@link System#exit(int)} */ - private int runScript(@NotNull final String script, final EditorFactory<G, A, R> editorFactory, final DefaultMainControl<G, A, R> mainControl, final ErrorView errorView, final List<String> args2, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory) { - final GUIMainControl<G, A, R>[] tmp2 = (GUIMainControl<G, A, R>[]) new GUIMainControl<?, ?, ?>[1]; - final Runnable runnable2 = new Runnable() { - - /** {@inheritDoc} */ - @Override - public void run() { - tmp2[0] = editorFactory.createGUIMainControl(mainControl, errorView, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); - } - - }; - try { - SwingUtilities.invokeAndWait(runnable2); - } catch (final InterruptedException ex) { - log.fatal(ex.getMessage(), ex); - Thread.currentThread().interrupt(); - return 1; - } catch (final InvocationTargetException ex) { - log.fatal(ex.getMessage(), ex); - return 1; - } - assert tmp2[0] != null; - final GUIMainControl<G, A, R> guiMainControl = tmp2[0]; - + private int runScript(@NotNull final String script, final ErrorView errorView, final List<String> args2, @NotNull final ScriptExecutor<G, A, R> scriptExecutor) { checkForErrors(errorView); waitDialog(errorView); @@ -406,12 +351,8 @@ /** {@inheritDoc} */ @Override public void run() { - try { - final Command command = new ScriptCommand(script2, args2, guiMainControl.getScriptExecutor()); - tmp[0] = command.execute(); - } finally { - guiMainControl.getExiter().doExit(tmp[0]); - } + final Command command = new ScriptCommand(script2, args2, scriptExecutor); + tmp[0] = command.execute(); } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 19:22:22
|
Revision: 8417 http://gridarta.svn.sourceforge.net/gridarta/?rev=8417&view=rev Author: akirschbaum Date: 2010-06-23 19:22:16 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Fix misleading error messages about incorrect autojoin lists when no archetypes are defined. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinListsParser.java Modified: trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinListsParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinListsParser.java 2010-06-23 18:58:42 UTC (rev 8416) +++ trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinListsParser.java 2010-06-23 19:22:16 UTC (rev 8417) @@ -151,10 +151,8 @@ archetypes.add(archetype); } } catch (final UndefinedArchetypeException ex) { - if (archetypeSet.getArchetypeCount() >= 1) { - errorView.addWarning(ErrorViewCategory.AUTOJOIN_ENTRY_INVALID, url + ": Autojoin list references undefined archetype: archetype '" + ex.getMessage() + "'"); - skipList = true; - } + errorView.addWarning(ErrorViewCategory.AUTOJOIN_ENTRY_INVALID, url + ": Autojoin list references undefined archetype: archetype '" + ex.getMessage() + "'"); + skipList = true; } } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 18:58:48
|
Revision: 8416 http://gridarta.svn.sourceforge.net/gridarta/?rev=8416&view=rev Author: akirschbaum Date: 2010-06-23 18:58:42 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Remove unused resource key. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/messages.properties Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-06-23 18:42:07 UTC (rev 8415) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-06-23 18:58:42 UTC (rev 8416) @@ -1108,7 +1108,6 @@ prefs.exitConnectorAutoCreateExit=If set, automatically create an exit game object when needed. prefs.exitConnectorExitArchetypeName=The archetype to create exit game objects from. prefs.language=Language for the user interface. -prefs.loadArchFromCollection=true=load collected archetypes, false=load from archetype directory. prefs.MainWindow.dividerLocation2=Specifies the layout of the main window. prefs.MainWindow.dividerLocation3=Specifies the layout of the main window. prefs.MainWindow.dividerLocation=Specifies the layout of the main window. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 18:42:14
|
Revision: 8415 http://gridarta.svn.sourceforge.net/gridarta/?rev=8415&view=rev Author: akirschbaum Date: 2010-06-23 18:42:07 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Rename variable name. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 18:36:43 UTC (rev 8414) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 18:42:07 UTC (rev 8415) @@ -152,8 +152,8 @@ public void run(@NotNull final String actionBuilderPackage, @NotNull final String editorJarName, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final String... args) { boolean err = false; // whether a fatal error (exit required) occurred. String script = null; - final LongOpt[] longopts = { new LongOpt("batchpng", LongOpt.NO_ARGUMENT, null, (int) 'b'), new LongOpt("normal", LongOpt.NO_ARGUMENT, null, (int) 'n'), new LongOpt("singlepng", LongOpt.NO_ARGUMENT, null, (int) 's'), new LongOpt("collectarches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("collectArches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("help", LongOpt.NO_ARGUMENT, null, (int) 'h'), new LongOpt("noexit", LongOpt.NO_ARGUMENT, null, 2), new LongOpt("script", LongOpt.REQUIRED_ARGUMENT, null, 1), }; - final Getopt g = new Getopt("testprog", args, "bchns", longopts); + final LongOpt[] longOpts = { new LongOpt("batchpng", LongOpt.NO_ARGUMENT, null, (int) 'b'), new LongOpt("normal", LongOpt.NO_ARGUMENT, null, (int) 'n'), new LongOpt("singlepng", LongOpt.NO_ARGUMENT, null, (int) 's'), new LongOpt("collectarches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("collectArches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("help", LongOpt.NO_ARGUMENT, null, (int) 'h'), new LongOpt("noexit", LongOpt.NO_ARGUMENT, null, 2), new LongOpt("script", LongOpt.REQUIRED_ARGUMENT, null, 1), }; + final Getopt g = new Getopt("testprog", args, "bchns", longOpts); Mode mode = Mode.NORMAL; boolean doExit = true; while (true) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 18:36:49
|
Revision: 8414 http://gridarta.svn.sourceforge.net/gridarta/?rev=8414&view=rev Author: akirschbaum Date: 2010-06-23 18:36:43 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Fix unchecked warnings. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/map/validation/errors/DoubleTypeError.java trunk/model/src/app/net/sf/gridarta/model/map/validation/errors/GameObjectsValidationError.java Modified: trunk/model/src/app/net/sf/gridarta/model/map/validation/errors/DoubleTypeError.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/validation/errors/DoubleTypeError.java 2010-06-23 18:27:41 UTC (rev 8413) +++ trunk/model/src/app/net/sf/gridarta/model/map/validation/errors/DoubleTypeError.java 2010-06-23 18:36:43 UTC (rev 8414) @@ -41,10 +41,10 @@ /** * Create an DoubleTypeError. * @param mapSquare the square on which the error occurred - * @param gameObjects the GameObject on which the error occurred + * @param gameObject the game object on which the error occurred */ - public DoubleTypeError(@NotNull final MapSquare<G, A, R> mapSquare, @NotNull final G... gameObjects) { - super(mapSquare, gameObjects); + public DoubleTypeError(@NotNull final MapSquare<G, A, R> mapSquare, @NotNull final G gameObject) { + super(mapSquare, gameObject); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/map/validation/errors/GameObjectsValidationError.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/validation/errors/GameObjectsValidationError.java 2010-06-23 18:27:41 UTC (rev 8413) +++ trunk/model/src/app/net/sf/gridarta/model/map/validation/errors/GameObjectsValidationError.java 2010-06-23 18:36:43 UTC (rev 8414) @@ -39,13 +39,11 @@ /** * Create an GameObjectValidationError. * @param mapSquare the square on which the error occurred - * @param gameObjects the arch on which the error occurred + * @param gameObject the game object on which the error occurred */ - public GameObjectsValidationError(@NotNull final MapSquare<G, A, R> mapSquare, @NotNull final G... gameObjects) { + public GameObjectsValidationError(@NotNull final MapSquare<G, A, R> mapSquare, @NotNull final G gameObject) { super(mapSquare); - for (final G gameObject : gameObjects) { - addGameObject(gameObject); - } + addGameObject(gameObject); } } // class GameObjectValidationError This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 18:27:48
|
Revision: 8413 http://gridarta.svn.sourceforge.net/gridarta/?rev=8413&view=rev Author: akirschbaum Date: 2010-06-23 18:27:41 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Merge duplicate properties. Modified Paths: -------------- trunk/build.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-06-23 18:16:41 UTC (rev 8412) +++ trunk/build.xml 2010-06-23 18:27:41 UTC (rev 8413) @@ -30,6 +30,8 @@ <property name="build.source.version" value="1.5"/> <property name="build.target.version" value="${build.source.version}"/> <property name="debug" value="false"/> + <property name="build.developer" value="unknown"/> + <property name="javac.fork" value="no"/> <property name="javac.args" value="-Xlint:all,-path,-unchecked,-fallthrough,-serial,-deprecation"/> <property name="user.javadoc.link" value="http://java.sun.com/javase/6/docs/api/"/> <property name="user.javadoc.javasrc" value="${user.javadoc.javahome}/src"/> @@ -204,14 +206,6 @@ </target> <target name="init-properties"> - <property file="developer.properties"/> - <property name="build.source.version" value="1.5"/> - <property name="build.target.version" value="${build.source.version}"/> - <property name="build.source.encoding" value="utf-8"/> - <property name="debug" value="false"/> - <property name="build.developer" value="unknown"/> - <property name="javac.args" value="-Xlint:all,-path,-unchecked,-fallthrough,-serial,-deprecation"/> - <property name="javac.fork" value="no"/> <tstamp> <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/> </tstamp> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 18:16:47
|
Revision: 8412 http://gridarta.svn.sourceforge.net/gridarta/?rev=8412&view=rev Author: akirschbaum Date: 2010-06-23 18:16:41 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserView.java Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserView.java 2010-06-23 17:59:28 UTC (rev 8411) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserView.java 2010-06-23 18:16:41 UTC (rev 8412) @@ -210,7 +210,7 @@ } final int index = pickmapChooserModel.addMapFile(mapFile); - final MapViewBasic<G,A,R> mapViewBasic = mapFile.getView(); + final MapViewBasic<G, A, R> mapViewBasic = mapFile.getView(); pickmapPanel.insertTab(getTitle(mapFile), null, mapViewBasic == null ? null : mapViewBasic.getScrollPane(), null, index); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 17:59:34
|
Revision: 8411 http://gridarta.svn.sourceforge.net/gridarta/?rev=8411&view=rev Author: akirschbaum Date: 2010-06-23 17:59:28 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Skip MapMenuManagerTest in headless mode. Modified Paths: -------------- trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java Modified: trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java 2010-06-23 17:43:50 UTC (rev 8410) +++ trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java 2010-06-23 17:59:28 UTC (rev 8411) @@ -19,6 +19,7 @@ package net.sf.gridarta.gui.mapmenu; +import java.awt.GraphicsEnvironment; import java.io.File; import java.io.IOException; import net.sf.gridarta.gui.map.mapview.MapViewsManager; @@ -48,6 +49,10 @@ */ @Test public void testSaveBookmarks() throws DuplicateArchetypeException, IOException { + if (GraphicsEnvironment.isHeadless()) { + return; + } + final TestMapControlCreator testMapControlCreator = new TestMapControlCreator(); final MapViewsManager<TestGameObject, TestMapArchObject, TestArchetype> mapViewsManager = testMapControlCreator.newMapViewsManager(); final MapImageCache<TestGameObject, TestMapArchObject, TestArchetype> mapImageCache = testMapControlCreator.newMapImageCache(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |