From: <chr...@us...> - 2006-05-25 10:56:42
|
Revision: 7 Author: christianhujer Date: 2006-05-25 03:55:22 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=7&view=rev Log Message: ----------- Changed Crossfire source to UTF-8 Modified Paths: -------------- trunk/crossfire/src/cfeditor/AnimationObject.java trunk/crossfire/src/cfeditor/ArchObject.java trunk/crossfire/src/cfeditor/ArchObjectParser.java trunk/crossfire/src/cfeditor/ArchObjectStack.java trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/CArchPanel.java trunk/crossfire/src/cfeditor/CArchPanelPan.java trunk/crossfire/src/cfeditor/CArchQuickView.java trunk/crossfire/src/cfeditor/CAttribBitmask.java trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CDialogBase.java trunk/crossfire/src/cfeditor/CFArchAttrib.java trunk/crossfire/src/cfeditor/CFArchType.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFHelp.java trunk/crossfire/src/cfeditor/CFJavaEditor.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CFancyButton.java trunk/crossfire/src/cfeditor/CFileInputStream.java trunk/crossfire/src/cfeditor/CFileReader.java trunk/crossfire/src/cfeditor/CGUIUtils.java trunk/crossfire/src/cfeditor/CGridderException.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/CMainStatusbar.java trunk/crossfire/src/cfeditor/CMainToolbar.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/CMapControl.java trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/CMapModel.java trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CMapViewIFrame.java trunk/crossfire/src/cfeditor/CMapViewInterface.java trunk/crossfire/src/cfeditor/CNewMapDialog.java trunk/crossfire/src/cfeditor/COptionDialog.java trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/crossfire/src/cfeditor/CSettings.java trunk/crossfire/src/cfeditor/CStartupScreen.java trunk/crossfire/src/cfeditor/CUndoStack.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/FaceObject.java trunk/crossfire/src/cfeditor/IGUIConstants.java trunk/crossfire/src/cfeditor/IUndoable.java trunk/crossfire/src/cfeditor/JFontChooser.java trunk/crossfire/src/cfeditor/MapArchObject.java trunk/crossfire/src/cfeditor/MultiArchData.java trunk/crossfire/src/cfeditor/MultiPositionData.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java trunk/crossfire/src/cfeditor/filter/ConfigEvent.java trunk/crossfire/src/cfeditor/filter/ConfigListener.java trunk/crossfire/src/cfeditor/filter/FilterConfig.java trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java trunk/crossfire/src/cfeditor/filter/NamedFilterEvent.java trunk/crossfire/src/cfeditor/filter/NamedFilterListener.java trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java trunk/crossfire/src/cfeditor/menu/BasicAction.java trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java trunk/crossfire/src/cfeditor/menu/CheckBoxMenuEntry.java trunk/crossfire/src/cfeditor/menu/FilterCheckBoxEntry.java trunk/crossfire/src/cfeditor/menu/MenuGroup.java trunk/crossfire/src/cfeditor/menu/MenuHelper.java trunk/crossfire/src/cfeditor/menu/SeparatorMenuEntry.java trunk/crossfire/src/cfeditor/menu/SimpleMenuEntry.java trunk/crossfire/src/cfeditor/menu/SimpleMenuLocation.java trunk/crossfire/src/cfeditor/textedit/scripteditor/CFPythonPopup.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java Modified: trunk/crossfire/src/cfeditor/AnimationObject.java =================================================================== --- trunk/crossfire/src/cfeditor/AnimationObject.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/AnimationObject.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/ArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/ArchObject.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/ArchObject.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/ArchObjectParser.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/ArchObjectParser.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/ArchObjectStack.java =================================================================== --- trunk/crossfire/src/cfeditor/ArchObjectStack.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/ArchObjectStack.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanel.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CArchPanel.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CArchPanelPan.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CArchQuickView.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CAttribBitmask.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribBitmask.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CAttribBitmask.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CDialogBase.java =================================================================== --- trunk/crossfire/src/cfeditor/CDialogBase.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CDialogBase.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CFArchAttrib.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CFHelp.java =================================================================== --- trunk/crossfire/src/cfeditor/CFHelp.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CFHelp.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CFJavaEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CFancyButton.java =================================================================== --- trunk/crossfire/src/cfeditor/CFancyButton.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CFancyButton.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CFileInputStream.java =================================================================== --- trunk/crossfire/src/cfeditor/CFileInputStream.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CFileInputStream.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CFileReader.java =================================================================== --- trunk/crossfire/src/cfeditor/CFileReader.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CFileReader.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CGUIUtils.java =================================================================== --- trunk/crossfire/src/cfeditor/CGUIUtils.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CGUIUtils.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CGridderException.java =================================================================== --- trunk/crossfire/src/cfeditor/CGridderException.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CGridderException.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMainStatusbar.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainStatusbar.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMainStatusbar.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMainToolbar.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapControl.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMapControl.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapModel.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMapModel.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -508,7 +508,7 @@ } oldarch = newarch; - // insert \xEDt in map or add to arch in map + // insert ít in map or add to arch in map ArchObject node = m_mapGrid[mapx][mapy]; if (node == null) { m_mapGrid[mapx][mapy] = newarch; @@ -669,7 +669,7 @@ } oldarch = arch; - // insert \xEDt in map or add to arch in map + // insert ít in map or add to arch in map ArchObject node = m_mapGrid[mapx][mapy]; if (node == null) { m_mapGrid[mapx][mapy] = arch; Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewIFrame.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMapViewIFrame.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CMapViewInterface.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewInterface.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CMapViewInterface.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CNewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/COptionDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/COptionDialog.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/COptionDialog.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CSettings.java =================================================================== --- trunk/crossfire/src/cfeditor/CSettings.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CSettings.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CStartupScreen.java =================================================================== --- trunk/crossfire/src/cfeditor/CStartupScreen.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CStartupScreen.java 2006-05-25 10:55:22 UTC (rev 7) @@ -2,7 +2,7 @@ * Crossfire Java Editor. * Copyright (C) 2000 Michael Toennies * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -38,7 +38,7 @@ /** * The startup screen (splash screen) shown to the user when he starts up the * level editor. Should at least show the text: - * Gridder version x.x.x, Copyright (C) 2000 Pasi Ker\xE4nen + * Gridder version x.x.x, Copyright (C) 2000 Pasi Keränen * Gridder comes with ABSOLUTELY NO WARRANTY; for details * see license.html. This is free software, and you are welcome * to redistribute it under certain conditions; see license.html Modified: trunk/crossfire/src/cfeditor/CUndoStack.java =================================================================== --- trunk/crossfire/src/cfeditor/CUndoStack.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CUndoStack.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/FaceObject.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/FaceObject.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/IGUIConstants.java =================================================================== --- trunk/crossfire/src/cfeditor/IGUIConstants.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/IGUIConstants.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/IUndoable.java =================================================================== --- trunk/crossfire/src/cfeditor/IUndoable.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/IUndoable.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/JFontChooser.java =================================================================== --- trunk/crossfire/src/cfeditor/JFontChooser.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/JFontChooser.java 2006-05-25 10:55:22 UTC (rev 7) @@ -356,13 +356,13 @@ String new_msg = ""; // return value: new message with html tags while (msg.indexOf("\n") >= 0) { new_msg = new_msg+"<html><font color=black size=\""+getHtmlSize(f.getSize())+ - "\" face=\""+f.getFontName()+"\"><B>"+msg.substring(0, msg.indexOf("\n"))+"</B></font></html>\xA7"; + "\" face=\""+f.getFontName()+"\"><B>"+msg.substring(0, msg.indexOf("\n"))+"</B></font></html>§"; msg = msg.substring(msg.indexOf("\n")+1); } new_msg = new_msg+"<html><font color=black size=\""+getHtmlSize(f.getSize())+ "\" face=\""+f.getFontName()+"\"><B>"+msg+"</B></font></html>"; - new_msg = new_msg.replace('\xA7', '\n'); + new_msg = new_msg.replace('§', '\n'); return new_msg; } Modified: trunk/crossfire/src/cfeditor/MapArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/MapArchObject.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/MapArchObject.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -150,7 +150,7 @@ */ public String getMapNameWithoutMusic() { int t; - if (IGUIConstants.isoView && (t = name.indexOf("\xA7")) > 0) { + if (IGUIConstants.isoView && (t = name.indexOf("§")) > 0) { return name.substring(0, t); } return name; Modified: trunk/crossfire/src/cfeditor/MultiArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/MultiArchData.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/MultiArchData.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/MultiPositionData.java =================================================================== --- trunk/crossfire/src/cfeditor/MultiPositionData.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/MultiPositionData.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-05-25 10:55:22 UTC (rev 7) @@ -3,7 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 30-d\xE9c.-2004 + * Created on 30-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/filter/ConfigEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/ConfigEvent.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/filter/ConfigEvent.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 30-d\xE9c.-2004 + * Created on 30-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/filter/ConfigListener.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/ConfigListener.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/filter/ConfigListener.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 30-d\xE9c.-2004 + * Created on 30-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/filter/FilterConfig.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/FilterConfig.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/filter/FilterConfig.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 26-d\xE9c.-2004 + * Created on 26-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 29-d\xE9c.-2004 + * Created on 29-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/filter/NamedFilterEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/NamedFilterEvent.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/filter/NamedFilterEvent.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 29-d\xE9c.-2004 + * Created on 29-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/filter/NamedFilterListener.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/NamedFilterListener.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/filter/NamedFilterListener.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 29-d\xE9c.-2004 + * Created on 29-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 26-d\xE9c.-2004 + * Created on 26-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java 2006-05-25 10:55:22 UTC (rev 7) @@ -5,7 +5,7 @@ * * This particular class is based on xnap (http://xnap.sourceforge.net). * See second section two. - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Modified: trunk/crossfire/src/cfeditor/menu/BasicAction.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/BasicAction.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/menu/BasicAction.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 18-d\xE9c.-2004 + * Created on 18-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 12-d\xE9c.-2004 + * Created on 12-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/menu/CheckBoxMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/CheckBoxMenuEntry.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/menu/CheckBoxMenuEntry.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 12-d\xE9c.-2004 + * Created on 12-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/menu/FilterCheckBoxEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/FilterCheckBoxEntry.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/menu/FilterCheckBoxEntry.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 29-d\xE9c.-2004 + * Created on 29-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/menu/MenuGroup.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/MenuGroup.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/menu/MenuGroup.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 19-d\xE9c.-2004 + * Created on 19-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/menu/MenuHelper.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/MenuHelper.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/menu/MenuHelper.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 17-d\xE9c.-2004 + * Created on 17-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/menu/SeparatorMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/SeparatorMenuEntry.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/menu/SeparatorMenuEntry.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 07-d\xE9c.-2004 + * Created on 07-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/menu/SimpleMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/SimpleMenuEntry.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/menu/SimpleMenuEntry.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 12-d\xE9c.-2004 + * Created on 12-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/menu/SimpleMenuLocation.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/SimpleMenuLocation.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/menu/SimpleMenuLocation.java 2006-05-25 10:55:22 UTC (rev 7) @@ -1,5 +1,5 @@ /* - * Created on 11-d\xE9c.-2004 + * Created on 11-déc.-2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/CFPythonPopup.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/CFPythonPopup.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/CFPythonPopup.java 2006-05-25 10:55:22 UTC (rev 7) @@ -2,7 +2,7 @@ * Crossfire Java Editor. * Copyright (C) 2000 Michael Toennies * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * 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 Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java 2006-05-25 10:55:22 UTC (rev 7) @@ -2,7 +2,7 @@ * Crossfire Java Editor. * Copyright (C) 2000 Michael Toennies * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * 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 Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-05-25 10:55:22 UTC (rev 7) @@ -2,7 +2,7 @@ * Crossfire Java Editor. * Copyright (C) 2000 Michael Toennies * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * 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 Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java 2006-05-22 00:20:53 UTC (rev 6) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java 2006-05-25 10:55:22 UTC (rev 7) @@ -2,7 +2,7 @@ * Crossfire Java Editor. * Copyright (C) 2000 Michael Toennies * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Ker\xE4nen) + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * * 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-25 11:04:29
|
Revision: 8 Author: christianhujer Date: 2006-05-25 04:04:16 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=8&view=rev Log Message: ----------- Removed usage of deprecated symbols. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CScriptView.java trunk/crossfire/src/cfeditor/gui/ScriptManager.java Modified: trunk/crossfire/src/cfeditor/CScriptView.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptView.java 2006-05-25 10:55:22 UTC (rev 7) +++ trunk/crossfire/src/cfeditor/CScriptView.java 2006-05-25 11:04:16 UTC (rev 8) @@ -167,7 +167,7 @@ } scriptManager.pack(); - scriptManager.show(); + scriptManager.setVisible(true); } } else if (cmd.equals("$$save")) { ctrl.exportXML(); @@ -264,7 +264,7 @@ dialog.getContentPane().add(panel, BorderLayout.CENTER); dialog.getContentPane().add(p, BorderLayout.SOUTH); dialog.pack(); - dialog.show(); + dialog.setVisible(true); Object result = p.getValue(); if (result instanceof Integer) { if (((Integer)result).intValue() == JOptionPane.YES_OPTION) { Modified: trunk/crossfire/src/cfeditor/gui/ScriptManager.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-05-25 10:55:22 UTC (rev 7) +++ trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-05-25 11:04:16 UTC (rev 8) @@ -129,7 +129,7 @@ left.add(bottomLeft, BorderLayout.SOUTH); scripts.setSelectedIndex(0); this.pack(); - this.show(); + this.setVisible(true); } private CScriptController getController() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-25 19:24:38
|
Revision: 13 Author: christianhujer Date: 2006-05-25 12:24:27 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=13&view=rev Log Message: ----------- Minor refactorings. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AnimationObject.java trunk/crossfire/src/cfeditor/CFancyButton.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainToolbar.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/ExitTypes.java trunk/crossfire/src/cfeditor/JarResources.java Modified: trunk/crossfire/src/cfeditor/AnimationObject.java =================================================================== --- trunk/crossfire/src/cfeditor/AnimationObject.java 2006-05-25 18:09:23 UTC (rev 12) +++ trunk/crossfire/src/cfeditor/AnimationObject.java 2006-05-25 19:24:27 UTC (rev 13) @@ -2,6 +2,7 @@ * Crossfire Java Editor. * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl + * Copyright (C) 2006 The Gridarta Developers * * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * @@ -24,7 +25,8 @@ package cfeditor; -import java.util.Hashtable; +import java.util.HashMap; +import java.util.Map; /** * The <code>AnimationObject</code> @@ -40,24 +42,19 @@ // The hash tables hold the name and the index for the field // if one can show me, that storing and accessing names AND objects // in the table is faster than in the static arrays, we can change this - private static final Hashtable animHashTable = new Hashtable(); + private final Map<String,Integer> animHashTable = new HashMap<String,Integer>(); private int animObjCount; - private final CMainControl m_control; - - public AnimationObject(CMainControl control) { - m_control = control; + public AnimationObject() { animObjCount = 0; } - public void addAnimObject(String name, String list) { - animObjects[animObjCount] = new AnimObjectNode(); - animObjects[animObjCount].animName = new String(name); - animObjects[animObjCount].animList = new String(list); - nameTable[animObjCount] = new String(name); - animHashTable.put(name, new Integer(animObjCount)); // put it in list + public void addAnimObject(final String name, final String list) { + animObjects[animObjCount] = new AnimObjectNode(name, list); + nameTable[animObjCount] = name; + animHashTable.put(name, animObjCount); // put it in list animObjCount++; } @@ -66,7 +63,7 @@ return nameTable; } - public String getNameString(int i) { + public String getNameString(final int i) { return nameTable[i]; } @@ -74,26 +71,27 @@ return animObjCount; } - public String getAnimObjectList(int i) { + public String getAnimObjectList(final int i) { return animObjects[i].animList; } - public String getAnimObjectName(int i) { + public String getAnimObjectName(final int i) { return animObjects[i].animName; } - public int findAnimObject(String name) { - Integer num = (Integer)animHashTable.get(name); - return num.intValue(); + public int findAnimObject(final String name) { + return animHashTable.get(name); } -} // End of class -class AnimObjectNode { - String animName; - String animList; // A List of "\n" connected strings - public AnimObjectNode () { - animName = null; - animList = null; - } + private static class AnimObjectNode { + private final String animName; + private final String animList; // A List of "\n" connected strings + + AnimObjectNode (final String animName, final String animList) { + this.animList = animList; + this.animName = animName; + } + } // End of class + } // End of class Modified: trunk/crossfire/src/cfeditor/CFancyButton.java =================================================================== --- trunk/crossfire/src/cfeditor/CFancyButton.java 2006-05-25 18:09:23 UTC (rev 12) +++ trunk/crossfire/src/cfeditor/CFancyButton.java 2006-05-25 19:24:27 UTC (rev 13) @@ -26,152 +26,72 @@ import java.awt.Insets; import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; import javax.swing.ImageIcon; import javax.swing.JButton; -import javax.swing.UIManager; -/** - * <code>CFancyButton</code> implements fancy button that has a cool rollover - * effect enabled under Windows l'n'f. +/** A JButton subclass. * * @author <a href="mailto:mic...@no...">Michael Toennies</a> + * @deprecated Don't use this anymore. */ public class CFancyButton extends JButton { - private ImageIcon m_normalIcon; - private ImageIcon m_rolloverIcon; - private boolean m_fMouseOver = false; - private boolean m_fWindowsLNF = false; + private ImageIcon normalIcon; + private ImageIcon rolloverIcon; private static final long serialVersionUID = -6830925679283342190L; - static MouseListener mStatic_rolloverListener = new MouseListener() { - public void mouseClicked(MouseEvent event) { - } - - public void mousePressed(MouseEvent event) { - } - - public void mouseReleased(MouseEvent event) { - } - - public void mouseEntered(MouseEvent event) { - CFancyButton button = (CFancyButton)event.getSource(); - button.m_fMouseOver = true; - - if (button.m_rolloverIcon != null) { - button.setIcon(button.m_rolloverIcon); - } - - if (button.m_fWindowsLNF) { - button.setBorderPainted(button.isEnabled()); - } - } - - public void mouseExited(MouseEvent event) { - CFancyButton button = (CFancyButton)event.getSource(); - - button.m_fMouseOver = false; - - if (button.m_normalIcon != null) { - button.setIcon(button.m_normalIcon); - } - - if (button.m_fWindowsLNF) { - button.setBorderPainted(false); - } - } - }; - - public CFancyButton(String strLabel, ActionListener actionListener) { + public CFancyButton(final String strLabel, final ActionListener actionListener) { this(strLabel, null, null, actionListener); } - public CFancyButton( - String strLabel, - String strToolTip, - ActionListener actionListener) { - this(strLabel, strToolTip, null, actionListener); + public CFancyButton(final String label, final String toolTip, final ActionListener actionListener) { + this(label, toolTip, null, actionListener); } - public CFancyButton( - String strLabel, - String strToolTip, - String strIcon, - ActionListener actionListener) { - super(strLabel); - if (strToolTip != null) { - setToolTipText(strToolTip); + public CFancyButton(final String label, final String toolTip, final String icon, final ActionListener actionListener) { + super(label); + if (toolTip != null) { + setToolTipText(toolTip); } - - if (strIcon != null) { - m_rolloverIcon = CGUIUtils.getIcon(strIcon); - setFancyIcon(m_rolloverIcon); + if (icon != null) { + rolloverIcon = CGUIUtils.getIcon(icon); + setFancyIcon(rolloverIcon); } - if (actionListener != null) { addActionListener(actionListener); } else { setEnabled(false); } - - Insets insets = getInsets(); - insets.top = 2; - insets.left = insets.top; - insets.right = insets.top; - insets.bottom = insets.top; - this.setMargin(insets); - - m_fWindowsLNF = UIManager.getLookAndFeel().getID().compareToIgnoreCase("Windows") == 0; - - addMouseListener(mStatic_rolloverListener); - - if (m_fWindowsLNF) { - setBorderPainted(m_fMouseOver); - } + setMargin(new Insets(2, 2, 2, 2)); } /** * Sets the fancy icon (automatically calculates the grayscaled normal icon) * @param icon the icon to be used as the rollover icon. */ - public void setFancyIcon(ImageIcon icon) { - m_rolloverIcon = icon; - - if (m_rolloverIcon != null) { - m_normalIcon = CGUIUtils.getGrayScaled(m_rolloverIcon); + public void setFancyIcon(final ImageIcon icon) { + rolloverIcon = icon; + if (rolloverIcon != null) { + normalIcon = CGUIUtils.getGrayScaled(rolloverIcon); } else { - m_normalIcon = null; + normalIcon = null; } - - super.setIcon(m_normalIcon); + super.setIcon(normalIcon); } /** * Preserve rollover icons over UI changes. */ - public void updateUI() { + @Override public void updateUI() { super.updateUI(); - - m_fWindowsLNF = UIManager.getLookAndFeel().getID().compareToIgnoreCase("Windows") == 0; - - if (m_fWindowsLNF) { - setBorderPainted(m_fMouseOver); - } else { - setBorderPainted(true); - } - - if (m_fMouseOver) { - setIcon(m_rolloverIcon); - } else { - setIcon(m_normalIcon); - } + setBorderPainted(true); + setIcon(normalIcon); } - public void setEnabled(boolean fEnabled) { + @Override public void setEnabled(final boolean fEnabled) { super.setEnabled(fEnabled); - setRolloverIcon(m_rolloverIcon); - setIcon(m_normalIcon); + setRolloverIcon(rolloverIcon); + setIcon(normalIcon); } -} + +} // class CFancyButton Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-25 18:09:23 UTC (rev 12) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-25 19:24:27 UTC (rev 13) @@ -233,7 +233,7 @@ // our global object parser archObjectParser = new ArchObjectParser(this); - animationObject = new AnimationObject(this); + animationObject = new AnimationObject(); // read in the type & type field definitions archObjectParser.loadTypeNumbers(); Modified: trunk/crossfire/src/cfeditor/CMainToolbar.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-05-25 18:09:23 UTC (rev 12) +++ trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-05-25 19:24:27 UTC (rev 13) @@ -140,8 +140,8 @@ m_control.newLevelWanted(); } }); - m_new.setVerticalTextPosition(CFancyButton.BOTTOM); - m_new.setHorizontalTextPosition(CFancyButton.CENTER); + m_new.setVerticalTextPosition(JButton.BOTTOM); + m_new.setHorizontalTextPosition(JButton.CENTER); buttons.addElement(m_new); add(m_new); @@ -154,8 +154,8 @@ m_control.openFileWanted(); } }); - m_open.setVerticalTextPosition(CFancyButton.BOTTOM); - m_open.setHorizontalTextPosition(CFancyButton.CENTER); + m_open.setVerticalTextPosition(JButton.BOTTOM); + m_open.setHorizontalTextPosition(JButton.CENTER); buttons.addElement(m_open); add(m_open); @@ -168,8 +168,8 @@ m_control.saveCurrentLevelWanted(); } }); - m_save.setVerticalTextPosition(CFancyButton.BOTTOM); - m_save.setHorizontalTextPosition(CFancyButton.CENTER); + m_save.setVerticalTextPosition(JButton.BOTTOM); + m_save.setHorizontalTextPosition(JButton.CENTER); buttons.addElement(m_save); add(m_save); @@ -182,8 +182,8 @@ m_control.saveCurrentLevelAsWanted(); } }); - m_saveAs.setVerticalTextPosition(CFancyButton.BOTTOM); - m_saveAs.setHorizontalTextPosition(CFancyButton.CENTER); + m_saveAs.setVerticalTextPosition(JButton.BOTTOM); + m_saveAs.setHorizontalTextPosition(JButton.CENTER); buttons.addElement(m_saveAs); add(m_saveAs); @@ -198,8 +198,8 @@ m_control.undoWanted(); } }); - m_undo.setVerticalTextPosition(CFancyButton.BOTTOM); - m_undo.setHorizontalTextPosition(CFancyButton.CENTER); + m_undo.setVerticalTextPosition(JButton.BOTTOM); + m_undo.setHorizontalTextPosition(JButton.CENTER); buttons.addElement(m_undo); add(m_undo); @@ -212,8 +212,8 @@ m_control.redoWanted(); } }); - m_redo.setVerticalTextPosition(CFancyButton.BOTTOM); - m_redo.setHorizontalTextPosition(CFancyButton.CENTER); + m_redo.setVerticalTextPosition(JButton.BOTTOM); + m_redo.setHorizontalTextPosition(JButton.CENTER); buttons.addElement(m_redo); add(m_redo); @@ -228,8 +228,8 @@ m_control.previousWindowWanted(); } }); - m_prevWindow.setVerticalTextPosition(CFancyButton.BOTTOM); - m_prevWindow.setHorizontalTextPosition(CFancyButton.CENTER); + m_prevWindow.setVerticalTextPosition(JButton.BOTTOM); + m_prevWindow.setHorizontalTextPosition(JButton.CENTER); buttons.addElement(m_prevWindow); add(m_prevWindow); @@ -242,8 +242,8 @@ m_control.nextWindowWanted(); } }); - m_nextWindow.setVerticalTextPosition(CFancyButton.BOTTOM); - m_nextWindow.setHorizontalTextPosition(CFancyButton.CENTER); + m_nextWindow.setVerticalTextPosition(JButton.BOTTOM); + m_nextWindow.setHorizontalTextPosition(JButton.CENTER); buttons.addElement(m_nextWindow); add(m_nextWindow); Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-05-25 18:09:23 UTC (rev 12) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-05-25 19:24:27 UTC (rev 13) @@ -38,10 +38,13 @@ import javax.swing.BorderFactory; import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; +import javax.swing.JButton; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.JViewport; +import static javax.swing.JViewport.SIMPLE_SCROLL_MODE; +import static javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER; +import static javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; @@ -87,7 +90,7 @@ m_list.setBackground(Color.lightGray); scrollPane = new JScrollPane(m_list); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); - scrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); + scrollPane.getViewport().setScrollMode(SIMPLE_SCROLL_MODE); add(scrollPane, BorderLayout.CENTER); JPanel dummy = new JPanel(); @@ -95,9 +98,9 @@ dummy.setLayout(new GridLayout(2, 1)); } JScrollPane scrollPane2 = new JScrollPane(dummy); - scrollPane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER); - scrollPane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); - scrollPane2.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); + scrollPane2.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_NEVER); + scrollPane2.setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_NEVER); + scrollPane2.getViewport().setScrollMode(SIMPLE_SCROLL_MODE); if (!m_view.isMapTileListBottom()) { add(scrollPane2, BorderLayout.SOUTH); // put up/down buttons south } else { @@ -112,8 +115,8 @@ m_control.moveTileDown(getMapTileSelection(), true); } }); - buttonDown.setVerticalTextPosition(CFancyButton.BOTTOM); - buttonDown.setHorizontalTextPosition(CFancyButton.CENTER); + buttonDown.setVerticalTextPosition(JButton.BOTTOM); + buttonDown.setHorizontalTextPosition(JButton.CENTER); if (!m_view.isMapTileListBottom()) { dummy.add(buttonDown, BorderLayout.EAST); } @@ -125,8 +128,8 @@ m_control.moveTileUp(getMapTileSelection(), true); } }); - buttonUp.setVerticalTextPosition(CFancyButton.BOTTOM); - buttonUp.setHorizontalTextPosition(CFancyButton.CENTER); + buttonUp.setVerticalTextPosition(JButton.BOTTOM); + buttonUp.setHorizontalTextPosition(JButton.CENTER); if (!m_view.isMapTileListBottom()) { dummy.add(buttonUp, BorderLayout.WEST); } else { Modified: trunk/crossfire/src/cfeditor/ExitTypes.java =================================================================== --- trunk/crossfire/src/cfeditor/ExitTypes.java 2006-05-25 18:09:23 UTC (rev 12) +++ trunk/crossfire/src/cfeditor/ExitTypes.java 2006-05-25 19:24:27 UTC (rev 13) @@ -3,19 +3,21 @@ package cfeditor; import java.util.HashSet; +import java.util.Set; -/** +/** Contains a list of all types that are exits. * @author Andreas Kirschbaum + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public class ExitTypes -{ +public class ExitTypes { + /** List of exit object types. (Integer values) */ - private static final HashSet _exitTypes = new HashSet(); + private static final Set<Integer> EXIT_TYPES = new HashSet<Integer>(); static { - _exitTypes.add(new Integer(41)); // teleporter - _exitTypes.add(new Integer(66)); // exit - _exitTypes.add(new Integer(94)); // pit - _exitTypes.add(new Integer(95)); // trapdoor + EXIT_TYPES.add(41); // teleporter + EXIT_TYPES.add(66); // exit + EXIT_TYPES.add(94); // pit + EXIT_TYPES.add(95); // trapdoor } // Prevent instantiation. @@ -26,8 +28,10 @@ * Determine whether a given ArchObject is an "exit". */ public static boolean contains(final ArchObject exit) { - if (exit == null) throw new IllegalArgumentException(); + if (exit == null) { + throw new IllegalArgumentException(); + } + return EXIT_TYPES.contains(exit.getArchTypNr()); + } - return _exitTypes.contains(new Integer(exit.getArchTypNr())); - } -} +} // class ExitTypes Modified: trunk/crossfire/src/cfeditor/JarResources.java =================================================================== --- trunk/crossfire/src/cfeditor/JarResources.java 2006-05-25 18:09:23 UTC (rev 12) +++ trunk/crossfire/src/cfeditor/JarResources.java 2006-05-25 19:24:27 UTC (rev 13) @@ -55,9 +55,6 @@ private static final Logger log = Logger.getLogger(JarResources.class); - // external debug flag - private boolean debugOn = false; - // jar resource mapping tables private final Hashtable htSizes = new Hashtable(); private final Hashtable htJarContents = new Hashtable(); @@ -128,7 +125,7 @@ FileInputStream fis = new FileInputStream(jarFileName); BufferedInputStream bis = new BufferedInputStream(fis); ZipInputStream zis = new ZipInputStream(bis); - ZipEntry ze = null; + ZipEntry ze; while ((ze = zis.getNextEntry()) != null) { if (ze.isDirectory()) { continue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-26 00:09:56
|
Revision: 21 Author: christianhujer Date: 2006-05-25 17:09:33 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=21&view=rev Log Message: ----------- Unified animations. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ArchObjectStack.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java Added Paths: ----------- trunk/crossfire/src/cfeditor/arch/ trunk/crossfire/src/cfeditor/arch/anim/ trunk/crossfire/src/cfeditor/arch/anim/AnimationObject.java trunk/crossfire/src/cfeditor/arch/anim/AnimationObjects.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/AnimationObject.java trunk/crossfire/src/cfeditor/AnimationObjects.java Deleted: trunk/crossfire/src/cfeditor/AnimationObject.java =================================================================== --- trunk/crossfire/src/cfeditor/AnimationObject.java 2006-05-25 23:58:47 UTC (rev 20) +++ trunk/crossfire/src/cfeditor/AnimationObject.java 2006-05-26 00:09:33 UTC (rev 21) @@ -1,82 +0,0 @@ -/* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * Copyright (C) 2006 The Gridarta Developers - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * 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., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package cfeditor; - -/** - * A single animation object. - */ -public class AnimationObject { - - /** The name of this animation. */ - private final String animName; - - /** The animation list of this animation. - * The individual entries are all postfixed with '\n'. - */ - private final String animList; - - /** - * Create an Animation Object. - * @param animName name of the animation - * @param animList list with frames - */ - public AnimationObject(final String animName, final String animList) { - this.animList = animList; - this.animName = animName; - } - - /** - * Returns the animation list of this animation. - * The individual entries are all postfixed with '\n'. - * @return the animation list of this animation. - */ - public String getAnimList() { - return animList; - } - - /** - * Returns the name of this animation. - * @return the name of this animation. - */ - public String getAnimName() { - return animName; - } - - /** - * {@inheritDoc} - * The String representation of an AnimObjectNode is suitable for writing into the animations file. - */ - @Override public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("anim "); - sb.append(animName); - sb.append('\n'); - sb.append(animList); - sb.append("mina\n"); - return sb.toString(); - } - -} // End of class Deleted: trunk/crossfire/src/cfeditor/AnimationObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/AnimationObjects.java 2006-05-25 23:58:47 UTC (rev 20) +++ trunk/crossfire/src/cfeditor/AnimationObjects.java 2006-05-26 00:09:33 UTC (rev 21) @@ -1,75 +0,0 @@ -/* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * Copyright (C) 2006 The Gridarta Developers - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * 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., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package cfeditor; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.TreeSet; - -/** - * The <code>AnimationObject</code>. - * - * WARNING: This class uses two indexes which are independent of each other: index of animation object and index of animation name. - * - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - */ -public class AnimationObjects implements Iterable<AnimationObject> { - - /** The animation objects. */ - private final List<AnimationObject> animObjects = new ArrayList<AnimationObject>(); - - /** Number of animation objects created. */ - private int numAnimObjects; - - /** Create the AnimationObject container. */ - public AnimationObjects() { - } - - /** {@inheritDoc} */ - public Iterator<AnimationObject> iterator() { - return new TreeSet<AnimationObject>(animObjects).iterator(); - } - - /** - * Add an animation object. - * @param name name of the animation object - * @param list list with individual frames - */ - public void addAnimObject(final String name, final String list) { - animObjects.add(new AnimationObject(name, list)); - numAnimObjects++; - } - - /** - * Returns number of animation objects created. - * @return number of animation objects created. - */ - public int getNumAnimObjects() { - return numAnimObjects; - } - -} // End of class Modified: trunk/crossfire/src/cfeditor/ArchObjectStack.java =================================================================== --- trunk/crossfire/src/cfeditor/ArchObjectStack.java 2006-05-25 23:58:47 UTC (rev 20) +++ trunk/crossfire/src/cfeditor/ArchObjectStack.java 2006-05-26 00:09:33 UTC (rev 21) @@ -48,6 +48,8 @@ import javax.swing.JPanel; import javax.swing.JProgressBar; import org.apache.log4j.Logger; +import cfeditor.arch.anim.AnimationObject; +import cfeditor.arch.anim.AnimationObjects; /** * The <code>ArchObjectStack</code> contains all the default arches. @@ -831,7 +833,7 @@ // loop through all existing ArchPanels and find all arches // along with their display-cathegory for (CArchPanel.PanelNode node = CArchPanel.getStartPanelNode(); - node != null; node = node.next) { + node != null; node = node.next) { int[] numList = node.data.getListNodeNrArray(); // list of nodenumbers String[] cathList = node.data.getListCathegoryArray(); // list of cath. strings @@ -1159,7 +1161,7 @@ // loop through all existing ArchPanels and find all arches // along with their display-cathegory for (CArchPanel.PanelNode node = CArchPanel.getStartPanelNode(); - node != null; node = node.next) { + node != null; node = node.next) { int[] numList = node.data.getListNodeNrArray(); // list of nodenumbers String[] cathList = node.data.getListCathegoryArray(); // list of cath. strings Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-25 23:58:47 UTC (rev 20) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-26 00:09:33 UTC (rev 21) @@ -25,6 +25,7 @@ package cfeditor; import cfeditor.textedit.scripteditor.ScriptEditControl; +import cfeditor.arch.anim.AnimationObjects; import java.awt.Font; import java.awt.Point; import java.awt.Rectangle; Copied: trunk/crossfire/src/cfeditor/arch/anim/AnimationObject.java (from rev 18, trunk/crossfire/src/cfeditor/AnimationObject.java) =================================================================== --- trunk/crossfire/src/cfeditor/arch/anim/AnimationObject.java (rev 0) +++ trunk/crossfire/src/cfeditor/arch/anim/AnimationObject.java 2006-05-26 00:09:33 UTC (rev 21) @@ -0,0 +1,82 @@ +/* + * Crossfire Java Editor. + * Copyright (C) 2000 Michael Toennies + * Copyright (C) 2001 Andreas Vogl + * Copyright (C) 2006 The Gridarta Developers + * + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package cfeditor.arch.anim; + +/** + * A single animation object. + */ +public final class AnimationObject { + + /** The name of this animation. */ + private final String animName; + + /** The animation list of this animation. + * The individual entries are all postfixed with '\n'. + */ + private final String animList; + + /** + * Create an AnimationObject. + * @param animName name of the animation + * @param animList list with frames + */ + public AnimationObject(final String animName, final String animList) { + this.animName = animName; + this.animList = animList; + } + + /** + * Get the animName, which is the name of the animation as usable by the "animations" attribute. + * @return the name of this animation. + */ + public String getAnimName() { + return animName; + } + + /** + * Returns the animation list of this animation. + * The individual entries are all postfixed with '\n'. + * @return the animation list of this animation. + */ + public String getAnimList() { + return animList; + } + + /** + * {@inheritDoc} + * The String representation of an AnimObjectNode is suitable for writing into the animations file. + */ + @Override public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("anim "); + sb.append(animName); + sb.append('\n'); + sb.append(animList); + sb.append("mina\n"); + return sb.toString(); + } + +} // class AnimationObject Property changes on: trunk/crossfire/src/cfeditor/arch/anim/AnimationObject.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Copied: trunk/crossfire/src/cfeditor/arch/anim/AnimationObjects.java (from rev 18, trunk/crossfire/src/cfeditor/AnimationObjects.java) =================================================================== --- trunk/crossfire/src/cfeditor/arch/anim/AnimationObjects.java (rev 0) +++ trunk/crossfire/src/cfeditor/arch/anim/AnimationObjects.java 2006-05-26 00:09:33 UTC (rev 21) @@ -0,0 +1,76 @@ +/* + * Crossfire Java Editor. + * Copyright (C) 2000 Michael Toennies + * Copyright (C) 2001 Andreas Vogl + * Copyright (C) 2006 The Gridarta Developers + * + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package cfeditor.arch.anim; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.TreeSet; +import cfeditor.arch.anim.AnimationObject; + +/** + * The <code>AnimationObject</code>. + * + * WARNING: This class uses two indexes which are independent of each other: index of animation object and index of animation name. + * + * @author <a href="mailto:mic...@no...">Michael Toennies</a> + */ +public class AnimationObjects implements Iterable<AnimationObject> { + + /** The animation objects. */ + private final List<AnimationObject> animObjects = new ArrayList<AnimationObject>(); + + /** Number of animation objects created. */ + private int numAnimObjects; + + /** Create the AnimationObject container. */ + public AnimationObjects() { + } + + /** {@inheritDoc} */ + public Iterator<AnimationObject> iterator() { + return new TreeSet<AnimationObject>(animObjects).iterator(); + } + + /** + * Add an animation object. + * @param name name of the animation object + * @param list list with individual frames + */ + public void addAnimObject(final String name, final String list) { + animObjects.add(new AnimationObject(name, list)); + numAnimObjects++; + } + + /** + * Returns number of animation objects created. + * @return number of animation objects created. + */ + public int getNumAnimObjects() { + return numAnimObjects; + } + +} // End of class Property changes on: trunk/crossfire/src/cfeditor/arch/anim/AnimationObjects.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java 2006-05-25 23:58:47 UTC (rev 20) +++ trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java 2006-05-26 00:09:33 UTC (rev 21) @@ -3,6 +3,7 @@ * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl * Copyright (C) 2005 Christian Hujer + * Copyright (C) 2006 The Gridarta Developers * * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * @@ -31,7 +32,8 @@ import java.util.List; import javax.swing.ImageIcon; -/** A single animation object. +/** + * A single animation object. * It holds the information like the number of frames used and the frames to display, as well as facings, which is the number of different * subanimations, for instance for different directions. * @author <a href="mailto:mic...@no...">Michael Toennies</a> @@ -39,10 +41,12 @@ */ public final class AnimationObject extends NamedObject { - /** The name of the animation. */ + /** The name of this animation. */ private final String animName; - /** The list of animations, separated with "\n". */ + /** The animation list of this animation. + * The individual entries are all postfixed with '\n'. + */ private final String animList; /** The names of the animation frames. */ @@ -54,7 +58,8 @@ /** The number of frames per facing in the animation. */ private final int frameCount; - /** Creates a new AnimObjectNode object and adds it to the datastructures. + /** + * Create an AnimationObject. * Therefore animList is parsed. * Do not invoke this constructor directly, use {@link daieditor.arch.anim.AnimationObjects#addAnimationObject(String,String)} instead. * If you invoke this constructor directly, the created AnimationObject will not be registered. @@ -93,16 +98,6 @@ return FaceFacade.normal.getFace(getFirstFrame(facings > 0 ? 1 : 0)); } - /** Get the animName, which is the name - * of the animation as usable - * by the "animations" attribute. - * @return animName - * @see #getName() - */ - public String getAnimName() { - return animName; - } - /** Get the number of frames per facing. * @return number of frames per facing */ @@ -139,11 +134,36 @@ return frames.get(facing * tmpFrameCount + frame); } - /** Get the animList. - * @return animList + /** + * Get the animName, which is the name of the animation as usable by the "animations" attribute. + * @return the name of this animation. + * @see #getName() */ + public String getAnimName() { + return animName; + } + + /** + * Returns the animation list of this animation. + * The individual entries are all postfixed with '\n'. + * @return the animation list of this animation. + */ public String getAnimList() { return animList; } -} // class AnimObjectNode + /** + * {@inheritDoc} + * The String representation of an AnimObjectNode is suitable for writing into the animations file. + */ + @Override public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("anim "); + sb.append(animName); + sb.append('\n'); + sb.append(animList); + sb.append("mina\n"); + return sb.toString(); + } + +} // class AnimationObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-26 00:36:28
|
Revision: 22 Author: christianhujer Date: 2006-05-25 17:35:12 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=22&view=rev Log Message: ----------- Moved ArchObject related data classes to a package of their own. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/CArchPanel.java trunk/crossfire/src/cfeditor/CArchPanelPan.java trunk/crossfire/src/cfeditor/CArchQuickView.java trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CFilterControl.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/CMainStatusbar.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/CMapControl.java trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/CMapModel.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CMapViewIFrame.java trunk/crossfire/src/cfeditor/CNewMapDialog.java trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/ExitTypes.java trunk/crossfire/src/cfeditor/MultiArchData.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/filter/AttributeFilter.java trunk/crossfire/src/cfeditor/filter/Filter.java trunk/crossfire/src/cfeditor/filter/NamedFilterList.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/parameter/ArchParameter.java Added Paths: ----------- trunk/crossfire/src/cfeditor/arch/ArchObject.java trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/ArchObject.java trunk/crossfire/src/cfeditor/ArchObjectIterator.java trunk/crossfire/src/cfeditor/ArchObjectIteratorDeleteArchMapObject.java trunk/crossfire/src/cfeditor/ArchObjectIteratorDeleteMapArch.java trunk/crossfire/src/cfeditor/ArchObjectParser.java trunk/crossfire/src/cfeditor/ArchObjectStack.java Deleted: trunk/crossfire/src/cfeditor/ArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/ArchObject.java 2006-05-26 00:09:33 UTC (rev 21) +++ trunk/crossfire/src/cfeditor/ArchObject.java 2006-05-26 00:35:12 UTC (rev 22) @@ -1,1472 +0,0 @@ -/* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * 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., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package cfeditor; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.StringReader; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.ListIterator; -import javax.swing.JList; -import org.apache.log4j.Logger; - -/** - * The <code>ArchObject</code> class handles the Crossfire arch objects. - * - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - */ -public class ArchObject implements Cloneable { - - private static final Logger log = Logger.getLogger(ArchObject.class); - public static final int TYPE_UNSET = -666; // means the arch has no type set - - private static ArchObjectStack archstack; // static reference to the archstack (-> default arches) - private static CFArchTypeList typelist; // static reference to the typelist (-> find syntax errors) - private static int my_id_counter = 0; - - private int my_id; // the one and only id - // unique arch object id at editor runtime - - private String faceName; // face name : 1 - private String archName; // arch Name - private String objName; - - private StringBuffer archText; // the arch text (contains only the differences from default arch) - // it is a rule that every line ends with a '\n', including the last line - private StringBuffer msgText; // msg text buffer - private StringBuffer animText; // anim text buffer - private StringBuffer loreText; // lore text buffer - private int archTextCount; // lines inserted in ArchText - - private int nodenr; // we are (internal) arch nr in node list - // the nodenr determines the (default) archetype - - private int mapx; // if on map, we are here - private int mapy; - - private MultiArchData multi; // data for multi-arches - null for single-square arches - - private ScriptArchData script; // data for scripted events - null if no events defined - - private boolean noface; // if true, arch has no face as default - private int facenr; // the index of faceImages[] - - private boolean editflag; // if true, object is in a editor - // for example in the map arch panel - private boolean artifacts_flag; // if set, this is not a "real" arch - // It will NOT be included in the arch collection - - private ArchObject next; // to chain ArchObjects in maps - private ArchObject prev; // same - private ArchObject tempptr; // we need this for chain the arches - - /** - * Enclosing container; if null, this object is not in a container but in a - * map. - */ - private ArchObject _env = null; - - /** - * All inventory objects. Set to {@link java.util.Collections#EMPTY_LIST} - * (to save space) if the object has no inventory. - */ - private List _inv = Collections.EMPTY_LIST; - - private int arch_type; // CF object type of the arch - - private int intern_temp; // used for drawing - private int edit_type; // for view settings - private AutojoinList join; // if nonzero, pointing to the list of autojoining archetypes - - private final HashMap cachedAttribute = new HashMap(); - - /** - * ArchObject constructor - */ - public ArchObject() { - multi = null; // this object stays 'null' for all single-tile arches - script = null; // this object stays 'null' unless there are events defined - - my_id = my_id_counter++; // increase ID counter for every new arch created - - archName = null; - archText = new StringBuffer(""); - msgText = animText = loreText = null; - archTextCount = 0; // lines inserted in archText - - objName = null; - intern_temp = 0; - - noface = true; // this sucker has no face - artifacts_flag = false; // will be true for arches from the artifacts file - faceName = null; // if there is a face cmd, this is the face name - facenr = -1; // if we have a face AND we have loaded the face, this is his number. - // if faceName != null and facenr == -1, we haven't loaded the face - // if faceName == null and facenr != -1, we got the face from default arch! - - editflag = false; - join = null; // no autojoin list per default - arch_type = ArchObject.TYPE_UNSET; // type must be set - nodenr = -1; // as default we are not in a node list - next = null; - prev = null; - tempptr = null; - mapx = 0; - mapy = 0; - edit_type = 0; - } - - // set static references: arch stack and typelist - public static void setArchStack(ArchObjectStack stack) { archstack = stack; } - public static void setTypeList(CFArchTypeList tlist) { typelist = tlist; } - - // edit type is the editable value from arch - // here it is used to identify the layer type - public int getEditType() { - return edit_type; - } - - /** - * @return the default <code>ArchObject</code> for this arch - */ - public ArchObject getDefaultArch() { - return archstack.getArch(nodenr); - } - - /** - * @return true when this ArchObject is a default arch from the stack - */ - public boolean isDefaultArch() { - return archstack.getArch(nodenr) == this; - } - - /** - * Get the EditType of an ArchObject (e.g. floor, monster, etc). - * These are determined by the various attributes of the arch - * (->archText). - * - * @param check_type bitmask containing the edit type(s) to be calculated - * @return new edit_type for this arch - */ - public int calculateEditType(int check_type) { - int no_pick, no_pass; // some attributes - ArchObject defarch = getDefaultArch(); // default arch - - /* if one of the types in check_type already is in edit_type, - // we exclude that one - if ((check_type&edit_type) != 0) { - check_type -= (check_type&edit_type); - } - */ - - // bail out if nothing to do - if (check_type == 0) { - return edit_type; - } - - if (edit_type == IGUIConstants.TILE_EDIT_NONE) { - edit_type = 0; - } else if (edit_type != 0) { - // all flags from 'check_type' must be unset in this arch because they get recalculated now - edit_type &= ~check_type; - } - - if ((check_type&IGUIConstants.TILE_EDIT_BACKGROUND) != 0 && - getAttributeValue("is_floor", defarch) == 1 && - getAttributeValue("no_pick", defarch) == 1) { - // Backgroud: floors - edit_type |= IGUIConstants.TILE_EDIT_BACKGROUND; - } - if ((check_type&IGUIConstants.TILE_EDIT_MONSTER) != 0 && - getAttributeValue("alive", defarch) == 1 && - (getAttributeValue("monster", defarch) == 1 || - getAttributeValue("generator", defarch) == 1)) { - // Monster: monsters/npcs/generators - edit_type |= IGUIConstants.TILE_EDIT_MONSTER; - } - if ((check_type&IGUIConstants.TILE_EDIT_WALL) != 0 && - arch_type == 0 && getAttributeValue("no_pass", defarch) == 1) { - // Walls - edit_type |= IGUIConstants.TILE_EDIT_WALL; - } - if ((check_type&IGUIConstants.TILE_EDIT_CONNECTED) != 0 && - getAttributeValue("connected", defarch) != 0) { - // Connected Objects - edit_type |= IGUIConstants.TILE_EDIT_CONNECTED; - } - if ((check_type&IGUIConstants.TILE_EDIT_EXIT) != 0 && - arch_type == 66 || arch_type == 41 || arch_type == 95) { - // Exit: teleporter/exit/trapdoors - edit_type |= IGUIConstants.TILE_EDIT_EXIT; - } - if ((check_type&IGUIConstants.TILE_EDIT_TREASURE) != 0 && - getAttributeValue("no_pick", defarch) == 0 && (arch_type == 4 || - arch_type == 5 || arch_type == 36 || arch_type == 60 || - arch_type == 85 || arch_type == 111 || arch_type == 123 || - arch_type == 124 || arch_type == 130)) { - // Treasure: randomtreasure/money/gems/potions/spellbooks/scrolls - edit_type |= IGUIConstants.TILE_EDIT_TREASURE; - } - if ((check_type&IGUIConstants.TILE_EDIT_DOOR) != 0 && - arch_type == 20 || arch_type == 23 || arch_type == 26 || - arch_type == 91 || arch_type == 21 || arch_type == 24) { - // Door: door/special door/gates + keys - edit_type |= IGUIConstants.TILE_EDIT_DOOR; - } - if ((check_type&IGUIConstants.TILE_EDIT_EQUIP) != 0 && - getAttributeValue("no_pick", defarch) == 0 && ((arch_type >= 13 && - arch_type <= 16) || arch_type == 33 || arch_type == 34 || - arch_type == 35 || arch_type == 39 || arch_type == 70 || - arch_type == 87 || arch_type == 99 || arch_type == 100 || - arch_type == 104 || arch_type == 109 || arch_type == 113 || - arch_type == 122 || arch_type == 3)) { - // Equipment: weapons/armour/wands/rods - edit_type |= IGUIConstants.TILE_EDIT_EQUIP; - } - - return edit_type; - } - - /** - * Get the value of an arch attribute from the archText - * both of the arch itself and if n.e. in it's default arch. - * If the attribute doesn't exist in either one, or the value is - * not a number, zero is returned. - * - * @param attr search for "attr <value>" - * @param defarch default arch of 'this' arch - * defarch=null means this *is* a default arch, or - * we just want to ignore the default arch - * @return <value>, zero if not found - */ - public int getAttributeValue(String attr, ArchObject defarch) { - String AText = archText.toString(); // The "real" Archtext from arch & defarch - String line; // tmp string - int i, j; - int result = 0; // returned value - - // Add all attributes from defarch that don't already exist in AText - if (defarch != null) { - AText = AText+diffArchText(defarch.getArchText(), true); - } - - if (!AText.endsWith("\n")) { - AText = AText.concat("\n"); // string should end with '\n', see below - } - - attr = attr.trim()+" "; // attr must be followed by space - - // Check line by line for the string 'attr' - for (i = 0, j = 0; i < AText.length(); i++) { - if (AText.charAt(i) == '\n') { - line = AText.substring(j, i).trim(); // get one line from 'AText' - - try { - // try to read the value behind 'attr' - if (line.startsWith(attr)) { - result = Integer.parseInt(line.substring(attr.length()).trim()); - } - } catch (NumberFormatException e) { - result = 0; - } - - j = i+1; - } - } - return result; - } - - /** - * Get the String of an arch attribute from the archText - * both of the arch itself and if n.e. in it's default arch. - * If the attribute doesn't exist in either one, an empty - * String "" is returned. - * - * @param attr search for "attr <string>" - * @param defarch deault arch of 'this' arch - * defarch=null means this *is* a default arch, or - * we just want to ignore the default arch - * @return <string>, "" if not found - */ - public String getAttributeString(String attr, ArchObject defarch) { - String AText = archText.toString(); // The "real" Archtext from arch & defarch - String line; // tmp string - int i, j; - String result = ""; // returned String - attr = attr.trim()+" "; // attr must be followed by space - if (defarch == getDefaultArch()) { - result = getCachedAttributeValue(attr); - if (result != null) { - return result; - } - result = ""; - } - // Add all attributes from defarch that don't already exist in AText - if (defarch != null) { - AText = AText+diffArchText(defarch.getArchText(), true); - } - - if (!AText.endsWith("\n")) { - AText = AText.concat("\n"); // string should end with '\n', see below - } - - // Check line by line for the string 'attr' - for (i = 0, j = 0; i < AText.length(); i++) { - if (AText.charAt(i) == '\n') { - line = AText.substring(j, i).trim(); // get one line from 'AText' - - // take the String behind 'attr' - if (line.startsWith(attr)) { - result = line.substring(attr.length()).trim(); - } - - j = i+1; - } - } - if (defarch == getDefaultArch()) { - setCachedAttributeValue(attr, result); - } - - return result; - } - - /** - * Set the String of an arch attribute in the archText. - * - * @param attr search for "attr <string>" - * @param value value to set - */ - public void setAttributeString(String attr, String value) { - String AText = archText.toString(); // The "real" Archtext from arch - String line; // tmp string - boolean exists = false; - int i, j; - String result = ""; // returned String - - attr = attr.trim()+" "; // attr must be followed by space - - if (!AText.endsWith("\n")) { - AText = AText.concat("\n"); // string should end with '\n', see below - } - - // Check line by line for the string 'attr' - for (i = 0, j = 0; i < AText.length(); i++) { - if (AText.charAt(i) == '\n') { - line = AText.substring(j, i).trim(); // get one line from 'AText' - - // take the String behind 'attr' - if (!line.startsWith(attr)) { - result += line+"\n"; - } else { - result += attr+value+"\n"; - exists = true; - } - - j = i+1; - } - } - if (!exists) { - result += attr+value+"\n"; - } - - if (result.length() > 0 && result.charAt(0) == '\n') { - result = result.substring(1); - } - - setArchText(result); - } - - /** - * Remove the String of an arch attribute from the archText. - * - * @param attr search for "attr <string>" - */ - public void removeAttribute(String attr) { - String AText = archText.toString(); // The "real" Archtext from arch - String line; // tmp string - int i, j; - String result = ""; // returned String - - attr = attr.trim()+" "; // attr must be followed by space - - if (!AText.endsWith("\n")) { - AText = AText.concat("\n"); // string should end with '\n', see below - } - - // Check line by line for the string 'attr' - for (i = 0, j = 0; i < AText.length(); i++) { - if (AText.charAt(i) == '\n') { - line = AText.substring(j, i).trim(); // get one line from 'AText' - - // take the String behind 'attr' - if (!line.startsWith(attr)) { - result += line+"\n"; - } - - j = i+1; - } - } - if (result.length() > 0 && result.charAt(0) == '\n') { - result = result.substring(1); - } - - setArchText(result); - } - - /** - * If there is elevation data in the other arch, move it to here. - * - * @param arch the other arch - */ - public void propagateElevation(ArchObject arch) { - if (arch == null) { - return; - } - - String elevation = arch.getAttributeString("elevation", null); - if (!elevation.equals("")) { - setAttributeString("elevation", elevation); - arch.removeAttribute("elevation"); - } - } - - public void setEditType(int t) { edit_type = t; } - public int getInternTemp() { return intern_temp; } - public void setInternTemp(int t) { intern_temp = t; } - public int getMyID() { return my_id; } - public void setMyID(int num) { my_id = num; } - public ArchObject getContainer() { return _env; } - - /** - * Get the topmost container that 'this' arch is in. - * @return the topmost container - */ - public ArchObject getTopContainer() { - ArchObject tmp_arch; - - for (tmp_arch = this; tmp_arch.getContainer() != null; - tmp_arch = tmp_arch.getContainer()); - - return tmp_arch; - } - - public void setArtifactFlag(boolean aflag) { - artifacts_flag = aflag; - } - - public boolean getArtifactFlag() { - return artifacts_flag; - } - - /** - * Return a ListIterator for all inventory {@link ArchObject}s. - */ - public ListIterator getInventory() { - return Collections.unmodifiableList(_inv).listIterator(); - } - - /** - * The given <code>ArchObject</code> 'arch' is placed as inventory - * into 'this' <code>ArchObject</code>. (Keep in mind that 'arch' - * has to be a free (unlinked) instance of <code>ArchObject</code>.) - * - * @param arch the <code>ArchObject</code> to be placed in the inventory - */ - public void addInvObj(ArchObject arch) { - // arch must not be already in a container - if (arch._env != null) { - throw new IllegalArgumentException(); - } - - if (_inv == Collections.EMPTY_LIST) { - _inv = new LinkedList(); - } - - _inv.add(arch); - arch._env = this; - - arch.setMapX(getMapX()); - arch.setMapY(getMapY()); - } - - /** - * Remove 'this' arch from the inventory-list and delete all it's pointers - */ - public void removeInvObj() { - // object's inventory must have already been deleted - if (_inv != Collections.EMPTY_LIST) { - throw new IllegalArgumentException(); - } - - // object must be in a container - if (_env == null) { - throw new IllegalArgumentException(); - } - - // remove this object from its parent container - if (!_env._inv.remove(this)) { - throw new AssertionError(); - } - - if (_env._inv.size() == 0) { - _env._inv = Collections.EMPTY_LIST; - } - } - - /** - * Remove all inventory objects. - */ - public void clearInventory() { - while (_inv.size() > 0) { - ArchObject inv = (ArchObject)_inv.get(0); - inv.clearInventory(); - inv.removeInvObj(); - } - } - - /** - * browse through the inventory tree and count all elements - * @return number of objects in the inventory - */ - public int countInvObjects() { - int count = _inv.size(); - Iterator it = _inv.iterator(); - while (it.hasNext()) { - ArchObject arch = (ArchObject)it.next(); - count += arch.countInvObjects(); - } - return count; - } - - // ---- GET/SET methods for multi arches - public int getRefMaxX() { - if (multi != null) { - return multi.getRefMaxx(); - } - - return 0; - } - - public int getRefMaxY() { - if (multi != null) { - return multi.getRefMaxy(); - } - - return 0; - } - - public int getRefMaxMX() { - if (multi != null) { - return multi.getRefMaxxm(); - } - - return 0; - } - - public int getRefMaxMY() { - if (multi != null) { - return multi.getRefMaxym(); - } - - return 0; - } - - public void setRefMaxMX(int x) { - //if (multi == null) { - // multi = new MultiArchData(); - //} - multi.setRefMaxxm(x); - } - - public void setRefMaxMY(int y) { - //if (multi == null) { - // multi = new MultiArchData(); - //} - multi.setRefMaxym(y); - } - - public void setRefMaxX(int x) { - //if (multi == null) { - // multi = new MultiArchData(); - //} - - if (x < 0 && x < multi.getRefMaxxm()) { - multi.setRefMaxxm(x); - } else if (x > multi.getRefMaxx()) { - multi.setRefMaxx(x); - } - } - - public void setRefMaxY(int y) { - //if (multi == null) { - // multi = new MultiArchData(); - //} - - if (y < 0 && y < multi.getRefMaxym()) { - multi.setRefMaxym(y); - } - if (y > multi.getRefMaxy()) { - multi.setRefMaxy(y); - } - } - - public void setRefFlag(boolean bool) { - //if (multi == null) { - // multi = new MultiArchData(); - //} - multi.setRefflag(bool); - } - - public boolean getRefFlag() { - if (multi != null) { - return multi.getRefflag(); - } - - return false; - } - - // this chained multi tiles on map for fast access. better then number and search trash - public void setMapMultiHead(ArchObject arch) { - if (multi == null) { - multi = new MultiArchData(); - } - - multi.setHead(arch); // this points to head. Heads DON'T points to himself - } - - public void setMapMultiNext(ArchObject arch) { - if (multi == null) { - multi = new MultiArchData(); - } - - multi.setNext(arch); // if this is null and head != null = last tile - } - - public ArchObject getMapMultiHead() { - if (multi != null) { - return multi.getHead(); // this points to head. Heads points to itsself - } - - return null; - } - - public ArchObject getMapMultiNext() { - if (multi != null) { - return multi.getNext(); // if this is null and head != null = last tile - } - - return null; - } - - public int getMultiShapeID() { - if (multi != null) { - return multi.getMultiShapeID(); - } - - return 0; - } - - public void setMultiShapeID(int value) { - if (multi == null) { - multi = new MultiArchData(); - } - - multi.setMultiShapeID(value); - } - - public int getMultiPartNr() { - if (multi != null) { - return multi.getMultiPartNr(); - } - - return 0; - } - - public void setMultiPartNr(int value) { - if (multi == null) { - multi = new MultiArchData(); - } - - multi.setMultiPartNr(value); - } - - public boolean isLowestPart() { - if (multi != null) { - return multi.isLowestPart(); - } - - return false; - } - - public void setLowestPart(boolean state) { - if (multi == null) { - multi = new MultiArchData(); - } - - multi.setLowestPart(state); - } - - // Set Ref. Number of a multi part arch. - // RefNr == -1 : single tile - // RefNr == NodeNr : head (first) tile of a multi tile arch - // RefNr != NodeNr : part of multi tile arch - public void setRefNr(int nr) { - if (multi == null) { - if (nr != -1) { - multi = new MultiArchData(); - multi.setRefNr(nr); - } - } else { - multi.setRefNr(nr); - } - } - - // Get Ref. Number of a multi part arch. - // RefNr == -1 : single tile - // RefNr == NodeNr : head (first) tile of a multi tile arch - // RefNr != NodeNr : part of multi tile arch - public int getRefNr() { - if (multi != null) { - return multi.getRefNr(); - } - - return -1; // single tile - } - - // refx/refy: Offset of this multi tile from head tile - public void setRefX(int xoff) { - if (multi == null) { - multi = new MultiArchData(); - } - - multi.setRefX(xoff); - } - - public void setRefY(int yoff) { - if (multi == null) { - multi = new MultiArchData(); - } - - multi.setRefY(yoff); - } - - public int getRefX() { - if (multi != null) { - return multi.getRefX(); - } - - return 0; - } - - public int getRefY() { - if (multi != null) { - return multi.getRefY(); - } - - return 0; - } - - public void setRefCount(int count) { - if (multi == null) { - if (count != 0) { - multi = new MultiArchData(); - multi.setRefCount(count); - } - } else { - multi.setRefCount(count); - } - } - - /** - * Returns number of parts for multipart heads. - * (*.getRefCount() > 0) is often used as way to find multi-heads. - * @return number of parts - */ - public int getRefCount() { - if (multi != null) { - return multi.getRefCount(); - } - - return 0; - } - - public boolean isMD() { - return multi != null; - } - - /** - * Initialize the multipart data object - must only be called for multipart arches - */ - public void initMultiData() { - if (multi == null) { - multi = new MultiArchData(); - } - } - // ----- end multi-arch get/set ----- - - public int getArchTypNr() { - return arch_type; - } - - public void setArchTypNr(int type) { - arch_type = type; - } - - public void setMapX(int x) { - mapx = x; - } - - public void setMapY(int y) { - mapy = y; - } - - public int getMapX() { - return mapx; - } - - public int getMapY() { - return mapy; - } - - public void setNextArch(ArchObject arch) { - next = arch; - } - - public void setPrevArch(ArchObject arch) { - prev = arch; - } - - public ArchObject getTemp() { - return tempptr; - } - - public void setTemp(ArchObject temp) { - tempptr = temp; - } - - public ArchObject getNextArch() { - return next; - } - - public ArchObject getPrevArch() { - return prev; - } - - /* Set the default face. Number is index of face list */ - public void setFaceNr(int nr) { - facenr = nr; - } - - /* Get the default face. Number is index of face list */ - public int getFaceNr() { - return facenr; - } - - public boolean getFaceFlag() { - return noface; - } - - public void setFaceFlag(boolean flag) { - noface = flag; - } - - /* Set Node number. Node number is the index of the default arch node list */ - public void setNodeNr(int nr) { - nodenr = nr; - } - - /* Get Node number. Node number is the index of the default arch node list */ - public int getNodeNr() { - return nodenr; - } - - // Arch name - public void setArchName(String name) { - archName = name != null ? name.intern() : null; - } - - public String getArchName() { - return archName; - } - - /** - * Name which is best appropriate to describe this arch. (This can be - * arch/object name or default arch/object name) - * @param defaultArch the default arch (if available, faster to use it than look it up again) - * @return best suitable descriptive name - */ - public String getBestName(ArchObject defaultArch) { - if (getObjName() != null && getObjName().length() > 0) { - return getObjName(); - } else if (defaultArch != null && defaultArch.getObjName() != null && defaultArch.getObjName().length() > 0) { - return defaultArch.getObjName(); - } else if (getArchName() != null && getArchName().length() > 0) { - return getArchName(); - } else if (defaultArch != null && defaultArch.getArchName() != null) { - return defaultArch.getArchName(); - } - - return "???"; // this case should actually never happen - } - - // Obj name - public void setObjName(String name) { - objName = name != null ? name.intern() : null; - } - - public String getObjName() { - return objName; - } - - // face name - public void setFaceName(String name) { - faceName = name != null ? name.intern() : null; - } - - public String getFaceName() { - return faceName; - } - - /** - * append 'text' to the archText of this arch - * @param text text to add - */ - public void addArchText(String text) { - archText.append(text); - } - - /** - * set 'text' = archText of this arch - * @param text set this text - */ - public void setArchText(String text) { - archText.delete(0, archText.length()); - archText.append(text); - clearCachedAttributeValue(); - } - - /** - * returns the archText of this arch as String - * @return the archtext - */ - public String getArchText() { - return archText.toString(); - } - - /** - * deletes the archText of this arch - */ - public void resetArchText() { - archText.delete(0, archText.length()); - } - - /** - * Get all entries from the given archtext 'atxt' that don't exist - * in 'this' archtext. - * - * @param atxt archtext to compare 'this'-arch with - * @param ignore_values if true: the values in the archtext-entries - * are ignored at the comparison - * @return all lines from 'atxt' that don't occur in 'this' arch - */ - public String diffArchText(String atxt, boolean ignore_values) { - String line = ""; // tmp string - String result = ""; // return string - String test; - int i, j; - int pos; - char c; - - if (!atxt.endsWith("\n")) { - atxt = atxt.concat("\n"); // string should end with '\n', see below - } - - // Check line by line for comparison - for (i = 0, j = 0; i < atxt.length(); i++) { - if (atxt.charAt(i) == '\n') { - line = atxt.substring(j, i).trim(); // get one line from 'atxt' - - // if 'line' does NOT exist in 'this' arch, we take it: - if (ignore_values) { - // cut away everything after the first space in that line - // because we want to ignore the "value part": - if (line.length() > 0 && line.indexOf(" ") > 0 && - diffTextString(this.getArchText(), line.substring(0, line.indexOf(" ")+1), ignore_values) == null) { - result = result.concat(line+"\n"); - } - } else { - // not ignoring the value-part - try { - test = diffTextString(this.getArchText(), line, ignore_values); - c = '\n'; - if (test != null) { - c = test.charAt(0); - } - - // An entry is taken if it doesn't exists in 'this' archtext - // at all, or it doesn't have the same lenght - if (line.length() > 0 && (test == null || c == '\n')) { - result = result.concat(line+"\n"); - } - } catch (StringIndexOutOfBoundsException e) { - } - } - - j = i+1; - } - } - - return result; - } - - /** - * Helper function for 'diffArchText()': - * Looks for occurrence of the attribute 'str' in 'base' and if found, - * returns the full line where 'str' occurs in base. - * Only occurrences of 'str' at the beginning of a new line are counted as valid. - * If not found, null is returned. - * - * @param base full text to search - * @param str string (attribute) to look for - * @param ignore_values if true, lines are matched against 'str' only till the first space (" ") - */ - private static String diffTextString(String base, String str, boolean ignore_values) { - int i, j; - String line = ""; - - if (!base.endsWith("\n")) { - base = base.concat("\n"); // string should end with '\n' - } - if (!line.endsWith("\n")) { - line = line.concat("\n"); // string should end with '\n' - } - - // Check line by line for comparison - for (i = 0, j = 0; i < base.length(); i++) { - if (base.charAt(i) == '\n') { - line = base.substring(j, i).trim(); // get one line from base - if (ignore_values) { - if (str.compareTo(line.substring(0, line.indexOf(" ")+1)) == 0) { - return line; - } - } else { - if (str.compareTo(line) == 0) { - return line; - } - } - j = i+1; - } - } - return null; - } - - - public void deleteMsgText() { - msgText = null; - } - - public void resetMsgText() { - if (msgText == null) { - return; - } - - msgText.delete(0, msgText.length()); - } - - // MSGText! - public void addMsgText(String text) { - if (msgText == null) { - msgText = new StringBuffer(); - } - - if (text == null) { // special, this adds a clear string - return; - } - - msgText.append(text); - } - - public String getMsgText() { - if (msgText == null) { - return null; - } - - return msgText.toString(); - } - - // ANIMText! - public void addAnimText(String text) { - if (animText == null) { - animText = new StringBuffer(""); - } - - animText.append(text); - } - - public String getAnimText() { - if (animText == null) { - return null; - } - - return animText.toString(); - } - - // lore text - public String getLoreText() { - return loreText.toString(); - } - - public void addLoreText(String text) { - if (loreText == null) { - loreText = new StringBuffer(""); - } - - loreText.append(text); - } - - // number of string line in text buffer of this arch - public int getArchTextCount() { - return archTextCount; - } - - // set/get autojoin list - public void setJoinList(AutojoinList jlist) { join = jlist; } - public AutojoinList getJoinList() { return join; } - - /** - * returns a new ArchObject, containing a copy of 'this' arch. - * References of course cannot be copied that way! - * This does NOT work for multipart objects. - * Also note that the returned clone is not linked to any map. - * - * @param posx map x coords. for the returned clone - * @param posy map y coords. for the returned clone - * @return clone instance of this <code>ArchObject</code> - */ - public ArchObject getClone(int posx, int posy) { - ArchObject clone = new ArchObject(); // The clone is a new object! - - clone.faceName = faceName; // face name - clone.archName = archName; // arch Name - clone.objName = objName; - - // the arch text (contains only the differences from default arch) - if (archText != null) { - clone.archText = new StringBuffer(archText.toString()); - } else { - clone.archText = null; - } - clone.archTextCount = archTextCount; // lines of text in archText - - // msg text buffer - if (msgText != null) { - clone.msgText = new StringBuffer(msgText.toString()); - } else { - clone.msgText = null; - } - - // anim text buffer - if (animText != null) { - clone.animText = new StringBuffer(animText.toString()); - } else { - clone.animText = null; - } - - if (multi != null) { - clone.multi = multi.getClone(); // clone multi data - } - - if (script != null) { - clone.script = script.getClone(); // clone scripting data - } - - clone.nodenr = nodenr; // node of the default arch - - clone.noface = noface; // if true, arch has no face as default - clone.facenr = facenr; // the index of faceImages[] - clone.editflag = editflag; // if true, object is in a editor - clone.edit_type = edit_type; // bitmask for view-settings - - clone.arch_type = arch_type; // type attribute of the arch - - // set coords: - clone.mapx = posx; - clone.mapy = posy; - - // If 'this' arch is a container, we have to create clones - // of the whole inventory (recursively) and link them in: - Iterator it = _inv.iterator(); - while (it.hasNext()) { - ArchObject tmp = (ArchObject)it.next(); - clone.addInvObj(tmp.getClone(posx, posy)); - } - - return clone; - } - - /** - * @return true if 'this' arch is a container (has something - * inside), otherwise false - */ - public boolean isContainer() { - return _inv.size() > 0; - } - - /** - * @return true if 'this' arch is part of a multisquare object - */ - public boolean isMulti() { - return multi != null && (multi.getRefflag() || multi.getRefCount() > 0); - } - - public void addEventPlugin(String eventType, String pluginName) { - if (script == null) { - script = new ScriptArchData(); - } - script.addEventData(eventType, pluginName, ScriptArchData.EDATA_PLUGIN_NAME); - } - - public void addEventOptions(String eventType, String eventOptions) { - if (script == null) { - script = new ScriptArchData(); - } - script.addEventData(eventType, eventOptions, ScriptArchData.EDATA_EVENT_OPTIONS); - } - - public void addEventScript(String eventType, String filePath) { - if (script == null) { - script = new ScriptArchData(); - } - script.addEventData(eventType, filePath, ScriptArchData.EDATA_FILE_PATH); - } - - /** - * Check wether all events have enough data to be valid. - * Invalid or insufficient ScriptedEvent objects get removed. - */ - public void validateAllEvents() { - if (script != null) { - if (!script.validateAllEvents()) { - script = null; // remove empty script object - } - } - } - - /** - * @return true when this arch has one or more scripted events defined - */ - public boolean isScripted() { - return script != null; - } - - /** - * This method is called from CMapFileEncode.writeMapArch() - * @return text for all scripted events, how it is written in a mapfile - */ - public String getMapArchEventData() { - if (script != null) { - return script.getMapArchEventData(); - } - - return ""; // this case should actually never happen - } - - /** - * Set contents of JList to all existing scripted events. - * @param list the JList which displays all events for this arch - */ - public void addEventsToJList(JList list) { - if (script != null) { - script.addEventsToJList(list); - } - } - - /** - * If there is a scripted event of the specified type, the script pad - * is opened and the appropriate script displayed. - * - * @param eventType type of event - * @param task ID number for task (open script/ edit path/ remove) - * @param eventList JList from the MapArchPanel (script tab) which displays the events - * @param mapanel the MapArchPanel - */ - public void modifyEventScript(String eventType, int task, JList eventList, CMapArchPanel mapanel) { - if (script != null) { - script.modifyEventScript(eventType, task, eventList); - - if (script.isEmpty()) { - script = null; // delete ScriptArchData object if empty - mapanel.setScriptPanelButtonState(true, false, false, false); - } - } - } - - /** - * A popup is opened and the user can create a new scripting event - * which gets attached to this arch. - * - * @param eventList JList from the MapArchPanel (script tab) which displays the events - * @param mapanel the MapArchPanel - */ - public void addEventScript(JList eventList, CMapArchPanel mapanel) { - if (script == null) { - script = new ScriptArchData(); - } - script.addEventScript(eventList, this); - - if (!script.isEmpty()) { - mapanel.setScriptPanelButtonState(true, true, true, true); - script.addEventsToJList(eventList); - } else { - script = null; // delete ScriptArchData object if empty - mapanel.setScriptPanelButtonState(true, false, false, false); - } - } - - /** - * This method checks the archText for syntax errors. More - * precisely: It reads every line in the archText and looks if - * it matches the type-definitions (-> see CFArchTypeList) for this - * arch. If there is no match, the line is considered wrong. - * Of course the type-definitions will never be perfect, this - * should be kept in mind. - * Note that the default arch is ignored in the check. The default - * arches should be correct, and even if not - it isn't the mapmaker to blame. - * - * @param type the type structure belonging to this arch. - * if null, the type is calculated in this function - * @return A String with all lines which don't match the type-definitions.<br> - * If no such "errors" encountered, null is returned. - */ - public String getSyntaxErrors(CFArchType type) { - ArchObject defarch = getDefaultArch(); - - if (typelist != null && archText != null && archText.length() > 0) { - String errors = ""; // return value: all error lines - - // open a reading stream for the archText - StringReader sread = new StringReader(archText.toString()); - BufferedReader sstream = new BufferedReader(sread); - - try { - String line = null; // read line - String attr_key; // key-part of the attribute in 'line' - boolean does_match; // true if line matches (/ is correct) - - if (type == null) { - type = typelist.getTypeOfArch(this); // the type of this arch - } - - if (log.isDebugEnabled()) { - log.debug("Applying type: "+type.getTypeName()); - } - - do { - line = sstream.readLine(); // read one line - - if (line != null && line.length() > 0) { - line = line.trim(); - - // get only the key-part of the attribute - if (line.indexOf(" ") <= 0) { - // this line doesn't even have the proper format: "key value" - // we assume the missing value part means zero-value - attr_key = line; - } else { - attr_key = line.substring(0, line.indexOf(" ")); - } - - if (log.isDebugEnabled()) { - log.debug("read attribute '"+line+"' -> "); - } - - // now check if there's a match in the definitions - does_match = false; - for (int t = 0; t < type.getAttr().length && !does_match; t++) { - if (type.getAttr()[t].getNameOld().equals(attr_key)) { - // found a match: - does_match = true; - } - } - - if (!does_match) { - errors += line.trim()+"\n"; // append line to the errors - /* - // the attribute doesn't match the definitions, - // now check if it is a negation of an entry in the default arch - if (line.indexOf(" ") >= 0) { - String attr_val = line.substring(line.indexOf(" ")).trim(); - if (!(defarch.getAttributeString(attr_key, null).length() > 0 && - (attr_val.equals("0") || attr_val.equals("null") || - attr_val.equals("none")))) { - errors += line.trim()+"\n"; // append line to the errors - } - } else { - errors += line.trim()+"\n"; // append line to the errors - } - */ - } - } - } while (line != null && line.length() > 0); - - // close streams - sstream.close(); - sread.close(); - } catch (IOException e) { - log.error("in getSyntaxErrors: Cannot close StringReader", e); - } - - // return errors, or null if empty - if (errors.trim().length() == 0) { - return null; - } - - return errors; - } else { - return null; - } - } - - private void setCachedAttributeValue(String name, String value) { - cachedAttribute.put(name, value); - } - - private void unSetCachedAttributeValue(String name) { - cachedAttribute.remove(name); - } - - private void clearCachedAttributeValue() { - cachedAttribute.clear(); - } - - private String getCachedAttributeValue(String name) { - return (String)cachedAttribute.get(name); - } -} Deleted: trunk/crossfire/src/cfeditor/ArchObjectIterator.java =================================================================== --- trunk/crossfire/src/cfeditor/ArchObjectIterator.java 2006-05-26 00:09:33 UTC (rev 21) +++ trunk/crossfire/src/cfeditor/ArchObjectIterator.java 2006-05-26 00:35:12 UTC (rev 22) @@ -1,41 +0,0 @@ -/* $Id: ArchObjectIterator.java,v 1.1 2006/04/06 17:16:03 akirschbaum Exp $ */ - -package cfeditor; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -/** - * The class ArchObjectIterator implements an {@link java.util.Iterator} that - * returns all {@link ArchObject}s in a map location. - * - * @author Andreas Kirschbaum - */ -public class ArchObjectIterator implements Iterator -{ - protected ArchObject _nextArchObject; - - protected ArchObject _currArchObject = null; - - public ArchObjectIterator(ArchObject archObject) { - _nextArchObject = archObject; - } - - public boolean hasNext() { - return _nextArchObject != null; - } - - public Object next() { - if (_nextArchObject == null) { - throw new NoSuchElementException(); - } - - _currArchObject = _nextArchObject; - _nextArchObject = _currArchObject.getNextArch(); - return _currArchObject; - } - - public void remove() { - throw new UnsupportedOperationException(); - } -} Deleted: trunk/crossfire/src/cfeditor/ArchObjectIteratorDeleteArchMapObject.java =================================================================== --- trunk/crossfire/src/cfeditor/ArchObjectIteratorDeleteArchMapObject.java 2006-05-26 00:09:33 UTC (rev 21) +++ trunk/crossfire/src/cfeditor/ArchObjectIteratorDeleteArchMapObject.java 2006-05-26 00:35:12 UTC (rev 22) @@ -1,34 +0,0 @@ -/* $Id: ArchObjectIteratorDeleteArchMapObject.java,v 1.1 2006/04/06 17:16:03 akirschbaum Exp $ */ - -package cfeditor; - -import java.util.Iterator; - -/** - * The class ArchObjectIterator implements an {@link ArchObjectIterator} that - * implements the {@link java.util.Iterator#remove()} operation via {@link - * CMapModel#deleteArchMapObject(ArchObject)}. - * - * @author Andreas Kirschbaum - */ -public class ArchObjectIteratorDeleteArchMapObject extends ArchObjectIterator implements Iterator -{ - private final CMapModel _model; - - public ArchObjectIteratorDeleteArchMapObject(CMapModel model, ArchObject archObject) { - super(archObject); - - if(model == null) throw new IllegalArgumentException(); - - _model = model; - } - - public void remove() { - if (_currArchObject == null) { - throw new IllegalStateException(); - } - - _model.deleteArchMapObject(_currArchObject); - _currArchObject = null; - } -} Deleted: trunk/crossfire/src/cfeditor/ArchObjectIteratorDeleteMapArch.java =================================================================== --- trunk/crossfire/src/cfeditor/ArchObjectIteratorDeleteMapArch.java 2006-05-26 00:09:33 UTC (rev 21) +++ trunk/crossfire/src/cfeditor/ArchObjectIteratorDeleteMapArch.java 2006-05-26 00:35:12 UTC (rev 22) @@ -1,46 +0,0 @@ -/* $Id: ArchObjectIteratorDeleteMapArch.java,v 1.1 2006/04/06 17:16:03 akirschbaum Exp $ */ - -package cfeditor; - -import java.util.Iterator; - -/** - * The class ArchObjectIterator implements an {@link ArchObjectIterator} that - * implements the {@link java.util.Iterator#remove()} operation via {@link - * CMapModel#deleteMapArch(int, int, int, boolean, boolean)}. - * - * @author Andreas Kirschbaum - */ -public class ArchObjectIteratorDeleteMapArch extends ArchObjectIterator implements Iterator -{ - private final CMapModel _model; - - private final int _x; - - private final int _y; - - private final boolean _refreshMap; - - private final boolean _join; - - public ArchObjectIteratorDeleteMapArch(CMapModel model, ArchObject archObject, int x, int y, boolean refreshMap, boolean join) { - super(archObject); - - if(model == null) throw new IllegalArgumentException(); - - _model = model; - _x = x; - _y = y; - _refreshMap = refreshMap; - _join = join; - } - - public void remove() { - if (_currArchObject == null) { - throw new IllegalStateException(); - } - - _model.deleteMapArch(_currArchObject.getMyID(), _x, _y, _refreshMap, _join); - _currArchObject = null; - } -} Deleted: trunk/crossfire/src/cfeditor/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/ArchObjectParser.java 2006-05-26 00:09:33 UTC (rev 21) +++ trunk/crossfire/src/cfeditor/ArchObjectParser.java 2006-05-26 00:35:12 UTC (rev 22) @@ -1,787 +0,0 @@ -/* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * 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., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package cfeditor; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.util.Hashtable; -import java.util.List; -import org.apache.log4j.Logger; -import org.jdom.Attribute; -import org.jdom.DataConversionException; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.JDOMException; -import org.jdom.input.SAXBuilder; - -/** - * The <code>ArchObjectParser</code> class handles the parsing of arches. - * - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - */ -public class ArchObjectParser { - private static final Logger log = Logger.getLogger(ArchObjectParser.class); - - // name of the system-arch containing path of starting map - public static final String STARTARCH_NAME = "map"; - - // table with type numbers as keys (Integer), and type names as values (String) - private Hashtable archTypeNumbers; - - private final CMainControl m_control; - - /** - * Constructor - * @param control main control - */ - public ArchObjectParser(CMainControl control) { - m_control = control; - archTypeNumbers = null; - } - - /** - * Parse the typenumbers file (associate names with type numbers) - * Type numbers and names are stored as key-value pairs in the - * Hashtable 'archTypeNumbers'. - */ - public void loadTypeNumbers() { - CFileReader reader = null; // input reader - archTypeNumbers = new Hashtable(); - - try { - // open reading stream to the spells xml file - String baseDir = (IGUIConstants.isoView ? CMainControl.getInstance().getArchDefaultFolder()+File.separator+IGUIConstants.CONFIG_DIR : IGUIConstants.CONFIG_DIR); - reader = new CFileReader(baseDir, IGUIConstants.TYPENR_FILE); - - // parse xml document - SAXBuilder builder = new SAXBuilder(); - builder.setValidation(true); - Document doc = builder.build(reader.getReader()); - - // retrieve the spell data from the xml - Element root = doc.getRootElement(); - Element type_elem; - Attribute a; - if (root == null || !root.getName().equalsIgnoreCase("typenumbers")) { - log.warn("File '"+IGUIConstants.TYPENR_FILE+"' lacks root element 'typenumbers'."); - } else { - List types = root.getChildren("type"); - if (types == null || types.size() == 0) { - log.warn("File '"+IGUIConstants.TYPENR_FILE+"' has no content."); - } else { - // process all 'type' elements from the xml file - int i; - for (i = 0; i < types.size(); i++) { - type_elem = (Element)types.get(i); - - if (type_elem.getAttribute("number") == null) { - log.warn("In File '"+IGUIConstants.TYPENR_FILE+"': Found 'type' element without 'number'"); - ... [truncated message content] |
From: <chr...@us...> - 2006-05-26 01:05:47
|
Revision: 24 Author: christianhujer Date: 2006-05-25 18:05:12 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=24&view=rev Log Message: ----------- Optimized imports. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/CArchPanel.java trunk/crossfire/src/cfeditor/CArchPanelPan.java trunk/crossfire/src/cfeditor/CArchQuickView.java trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CFilterControl.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/CMapControl.java trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/CMapModel.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CMapViewIFrame.java trunk/crossfire/src/cfeditor/CNewMapDialog.java trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/ExitTypes.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/arch/ArchObject.java trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java trunk/crossfire/src/cfeditor/arch/anim/AnimationObjects.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/parameter/ArchParameter.java Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,12 +24,12 @@ package cfeditor; +import cfeditor.arch.ArchObject; +import cfeditor.arch.ArchObjectStack; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import org.apache.log4j.Logger; -import cfeditor.arch.ArchObject; -import cfeditor.arch.ArchObjectStack; /** * The <code>AutojoinList</code> class contains a list of (typically wall-)arches which Modified: trunk/crossfire/src/cfeditor/CArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanel.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CArchPanel.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; @@ -34,7 +35,6 @@ import javax.swing.JTabbedPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import cfeditor.arch.ArchObject; /** * The <code>CArchPanel</code> holds the tile palette. Modified: trunk/crossfire/src/cfeditor/CArchPanelPan.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.ActionEvent; @@ -40,7 +41,6 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import org.apache.log4j.Logger; -import cfeditor.arch.ArchObject; public class CArchPanelPan extends JPanel { private static final Logger log = Logger.getLogger(CArchPanel.class); Modified: trunk/crossfire/src/cfeditor/CArchQuickView.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.GridBagConstraints; @@ -32,7 +33,6 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; -import cfeditor.arch.ArchObject; /** * The <code>CArchQuickView</code> holds the tile palette. Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -64,7 +65,6 @@ import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; import org.apache.log4j.Logger; -import cfeditor.arch.ArchObject; /** * CAttribDialog poses the GUI for CF object attributes Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.EOFException; @@ -44,7 +45,6 @@ import org.jdom.Element; import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; -import cfeditor.arch.ArchObject; /** * This class handles all the CFArchTypes and makes Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,8 @@ package cfeditor; +import cfeditor.arch.ArchObject; +import cfeditor.arch.ArchObjectStack; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -51,8 +53,6 @@ import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreePath; import org.apache.log4j.Logger; -import cfeditor.arch.ArchObject; -import cfeditor.arch.ArchObjectStack; /** * The CFTreasureListTree class fully manages the Crossfire treausrelists. Modified: trunk/crossfire/src/cfeditor/CFilterControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CFilterControl.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CFilterControl.java 2006-05-26 01:05:12 UTC (rev 24) @@ -6,6 +6,7 @@ */ package cfeditor; +import cfeditor.arch.ArchObject; import cfeditor.filter.ConfigEvent; import cfeditor.filter.ConfigListener; import cfeditor.filter.Filter; @@ -14,7 +15,6 @@ import cfeditor.filter.NamedFilterList; import cfeditor.filter.NamedFilterListener; import cfeditor.menu.BasicMenuEntry; -import cfeditor.arch.ArchObject; import javax.swing.JComponent; import javax.swing.JMenu; Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,11 +24,11 @@ package cfeditor; -import cfeditor.textedit.scripteditor.ScriptEditControl; -import cfeditor.arch.anim.AnimationObjects; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectParser; import cfeditor.arch.ArchObjectStack; +import cfeditor.arch.anim.AnimationObjects; +import cfeditor.textedit.scripteditor.ScriptEditControl; import java.awt.Font; import java.awt.Point; import java.awt.Rectangle; Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObjectStack; import cfeditor.menu.AggregateMenuLocation; import cfeditor.menu.BasicMenuEntry; import cfeditor.menu.CheckBoxMenuEntry; @@ -33,7 +34,6 @@ import cfeditor.menu.SimpleMenuEntry; import cfeditor.menu.SimpleMenuLocation; import cfeditor.textedit.scripteditor.ScriptEditControl; -import cfeditor.arch.ArchObjectStack; import java.awt.Event; import java.awt.Font; import java.awt.event.ActionEvent; Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; @@ -44,7 +45,6 @@ import javax.swing.UIManager; import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameListener; -import cfeditor.arch.ArchObject; /** * The main view of the level editor. Contains the "desktop" for internal level Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -54,7 +55,6 @@ import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; -import cfeditor.arch.ArchObject; /** * <code>CMapArchPanel</code> implements the panel that holds information about Modified: trunk/crossfire/src/cfeditor/CMapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapControl.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CMapControl.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,12 +24,12 @@ package cfeditor; +import cfeditor.arch.ArchObject; +import cfeditor.arch.ArchObjectIterator; +import cfeditor.arch.ArchObjectIteratorDeleteMapArch; import java.awt.Point; import java.io.File; import java.util.Iterator; -import cfeditor.arch.ArchObject; -import cfeditor.arch.ArchObjectIterator; -import cfeditor.arch.ArchObjectIteratorDeleteMapArch; /** * The <code>CMapControl</code> Modified: trunk/crossfire/src/cfeditor/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,12 +24,12 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import org.apache.log4j.Logger; -import cfeditor.arch.ArchObject; /** * This class handles the reading of a mapfile and parsing the data Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; @@ -36,7 +37,6 @@ import java.util.HashMap; import java.util.Iterator; import org.apache.log4j.Logger; -import cfeditor.arch.ArchObject; /** * The <code>CMapFileEncode</code> Modified: trunk/crossfire/src/cfeditor/CMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapModel.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CMapModel.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,14 +24,14 @@ package cfeditor; +import cfeditor.arch.ArchObject; +import cfeditor.arch.ArchObjectIterator; +import cfeditor.arch.ArchObjectIteratorDeleteArchMapObject; +import cfeditor.arch.ArchObjectIteratorDeleteMapArch; import cfeditor.filter.Filter; import cfeditor.filter.FilterConfig; import cfeditor.filter.NamedFilterConfig; import cfeditor.filter.NamedFilterList; -import cfeditor.arch.ArchObject; -import cfeditor.arch.ArchObjectIterator; -import cfeditor.arch.ArchObjectIteratorDeleteArchMapObject; -import cfeditor.arch.ArchObjectIteratorDeleteMapArch; import java.awt.Point; import java.util.Iterator; import org.apache.log4j.Logger; Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -47,7 +48,6 @@ import static javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import cfeditor.arch.ArchObject; /** * The panel that holds the map-tiles of the selected map square. (The window Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,9 +24,9 @@ package cfeditor; -import cfeditor.filter.AttributeFilter; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectStack; +import cfeditor.filter.AttributeFilter; import com.visualtek.png.PNGEncoder; import com.visualtek.png.PNGException; import java.awt.Color; Modified: trunk/crossfire/src/cfeditor/CMapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewIFrame.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CMapViewIFrame.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,9 +24,9 @@ package cfeditor; +import cfeditor.arch.ArchObject; import cfeditor.menu.MenuHelper; import cfeditor.menu.MenuManager; -import cfeditor.arch.ArchObject; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Point; Modified: trunk/crossfire/src/cfeditor/CNewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObjectStack; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; @@ -43,7 +44,6 @@ import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; -import cfeditor.arch.ArchObjectStack; /** * Dialog used to ask the user the properties for the new level. Contains a Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.io.File; import java.util.Enumeration; import java.util.Hashtable; @@ -32,7 +33,6 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.apache.log4j.Logger; -import cfeditor.arch.ArchObject; /** * The <code>CPickmapPanel</code> manages the pickmap panel Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,10 +24,10 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.awt.Point; import java.util.Iterator; import org.apache.log4j.Logger; -import cfeditor.arch.ArchObject; /** * This class manages the cut/copy/paste actions in maps. The data is Modified: trunk/crossfire/src/cfeditor/ExitTypes.java =================================================================== --- trunk/crossfire/src/cfeditor/ExitTypes.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/ExitTypes.java 2006-05-26 01:05:12 UTC (rev 24) @@ -2,9 +2,9 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.util.HashSet; import java.util.Set; -import cfeditor.arch.ArchObject; /** Contains a list of all types that are exits. * @author Andreas Kirschbaum Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.arch.ArchObject; import java.awt.Color; import java.awt.FlowLayout; import java.awt.Point; @@ -43,7 +44,6 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; -import cfeditor.arch.ArchObject; /** * This dialog manages the replace action Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,8 +24,8 @@ package cfeditor; +import cfeditor.arch.ArchObject; import cfeditor.textedit.scripteditor.ScriptEditControl; -import cfeditor.arch.ArchObject; import java.awt.Color; import java.awt.FlowLayout; import java.awt.Insets; Modified: trunk/crossfire/src/cfeditor/arch/ArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,13 @@ package cfeditor.arch; +import cfeditor.AutojoinList; +import cfeditor.CFArchType; +import cfeditor.CFArchTypeList; +import cfeditor.CMapArchPanel; +import cfeditor.IGUIConstants; +import cfeditor.MultiArchData; +import cfeditor.ScriptArchData; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; @@ -35,13 +42,6 @@ import java.util.ListIterator; import javax.swing.JList; import org.apache.log4j.Logger; -import cfeditor.CFArchTypeList; -import cfeditor.MultiArchData; -import cfeditor.ScriptArchData; -import cfeditor.AutojoinList; -import cfeditor.IGUIConstants; -import cfeditor.CMapArchPanel; -import cfeditor.CFArchType; /** * The <code>ArchObject</code> class handles the Crossfire arch objects. Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java 2006-05-26 01:05:12 UTC (rev 24) @@ -4,7 +4,6 @@ import java.util.Iterator; import java.util.NoSuchElementException; -import cfeditor.arch.ArchObject; /** * The class ArchObjectIterator implements an {@link java.util.Iterator} that Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java 2006-05-26 01:05:12 UTC (rev 24) @@ -2,10 +2,8 @@ package cfeditor.arch; -import java.util.Iterator; -import cfeditor.arch.ArchObject; -import cfeditor.arch.ArchObjectIterator; import cfeditor.CMapModel; +import java.util.Iterator; /** * The class ArchObjectIterator implements an {@link cfeditor.arch.ArchObjectIterator} that Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java 2006-05-26 01:05:12 UTC (rev 24) @@ -2,10 +2,8 @@ package cfeditor.arch; -import java.util.Iterator; -import cfeditor.arch.ArchObject; -import cfeditor.arch.ArchObjectIterator; import cfeditor.CMapModel; +import java.util.Iterator; /** * The class ArchObjectIterator implements an {@link ArchObjectIterator} that Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-05-26 01:05:12 UTC (rev 24) @@ -24,6 +24,10 @@ package cfeditor.arch; +import cfeditor.CFileReader; +import cfeditor.CMainControl; +import cfeditor.IGUIConstants; +import cfeditor.MultiPositionData; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; @@ -38,11 +42,6 @@ import org.jdom.Element; import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; -import cfeditor.arch.ArchObject; -import cfeditor.CMainControl; -import cfeditor.CFileReader; -import cfeditor.IGUIConstants; -import cfeditor.MultiPositionData; /** * The <code>ArchObjectParser</code> class handles the parsing of arches. Modified: trunk/crossfire/src/cfeditor/arch/anim/AnimationObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/anim/AnimationObjects.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/arch/anim/AnimationObjects.java 2006-05-26 01:05:12 UTC (rev 24) @@ -29,7 +29,6 @@ import java.util.Iterator; import java.util.List; import java.util.TreeSet; -import cfeditor.arch.anim.AnimationObject; /** * The <code>AnimationObject</code>. Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-05-26 01:05:12 UTC (rev 24) @@ -6,9 +6,9 @@ */ package cfeditor.gui; -import cfeditor.arch.ArchObject; import cfeditor.CMainControl; import cfeditor.IGUIConstants; +import cfeditor.arch.ArchObject; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; Modified: trunk/crossfire/src/cfeditor/parameter/ArchParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/ArchParameter.java 2006-05-26 01:03:48 UTC (rev 23) +++ trunk/crossfire/src/cfeditor/parameter/ArchParameter.java 2006-05-26 01:05:12 UTC (rev 24) @@ -6,11 +6,11 @@ */ package cfeditor.parameter; -import cfeditor.arch.ArchObject; -import cfeditor.arch.ArchObjectStack; import cfeditor.CMainControl; import cfeditor.PluginParameter; import cfeditor.PluginParameterView; +import cfeditor.arch.ArchObject; +import cfeditor.arch.ArchObjectStack; import org.jdom.Element; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-26 16:47:14
|
Revision: 29 Author: christianhujer Date: 2006-05-26 09:46:56 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=29&view=rev Log Message: ----------- Moved help related classes to their own package and deprecated CFHelp in favor of JavaHelp. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java Added Paths: ----------- trunk/crossfire/src/cfeditor/help/ trunk/crossfire/src/cfeditor/help/CFHelp.java trunk/crossfire/src/cfeditor/help/HtmlPane.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/CFHelp.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-26 11:27:28 UTC (rev 28) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-26 16:46:56 UTC (rev 29) @@ -25,6 +25,7 @@ package cfeditor; import cfeditor.arch.ArchObject; +import cfeditor.help.CFHelp; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; Deleted: trunk/crossfire/src/cfeditor/CFHelp.java =================================================================== --- trunk/crossfire/src/cfeditor/CFHelp.java 2006-05-26 11:27:28 UTC (rev 28) +++ trunk/crossfire/src/cfeditor/CFHelp.java 2006-05-26 16:46:56 UTC (rev 29) @@ -1,257 +0,0 @@ -/* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * 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., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package cfeditor; - -import java.awt.Container; -import java.awt.Cursor; -import java.awt.Rectangle; -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import javax.swing.JEditorPane; -import javax.swing.JFrame; -import javax.swing.JScrollPane; -import javax.swing.JViewport; -import javax.swing.SwingUtilities; -import javax.swing.event.HyperlinkEvent; -import javax.swing.event.HyperlinkListener; -import javax.swing.text.Document; -import org.apache.log4j.Logger; - -/** - * <code>CFHelp</code> implements the Help Window is a seperate frame with html content. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - */ -public class CFHelp extends JFrame { - - private static final Logger log = Logger.getLogger(CFHelp.class); - - private static final long serialVersionUID = 6896632173566618870L; - - /** - * Konstructor - * @param main_view the main view - * @param big_size if true, the frame gets bigger than normal - * (useful in combination with larger fonts) - * @param fname may contain different things: - * 1. null -> the file "start.html" is opened - * 2. File name of a html-file to be opened - * 3. html-text to be displayed directly (no file) - * (this text must start with "<HTML>") - */ - public CFHelp(JFrame main_view, String fname, boolean big_size) { - super("Help"); // super constructor - - // set application icon - setIconImage(CGUIUtils.getIcon(IGUIConstants.APP_ICON).getImage()); - - Rectangle mvb = main_view.getBounds(); // get main view bounds - if (!big_size) { - setBounds(mvb.x + (mvb.width) / 2 - 260, mvb.y + 70, 520, 600); // standard - } else { - setBounds(mvb.x + (mvb.width) / 2 - 300, mvb.y + 70, 600, 750); // big size - } - - if (fname == null) { - fname = "start.html"; - } - - HtmlPane html; - if (fname.startsWith("<HTML>")) { - html = new HtmlPane("text/html", fname); // direct text - } else { - html = new HtmlPane(fname); // read html file - } - - setContentPane(html); - } -} - -class HtmlPane extends JScrollPane implements HyperlinkListener { - - private static final Logger log = Logger.getLogger(HtmlPane.class); - - JEditorPane html; - - private static final long serialVersionUID = 7957975761362660439L; - - /** - * Konstructor to load the html-file <fname> and display - * it's contents in this HtmlPane - * @param fname Name of the hmtl-file - */ - public HtmlPane(String fname) { - try { - // first looking for the html file in extracted form - File f = new File(IGUIConstants.HELP_DIR + File.separator + fname); - if (f.exists()) { - // file exists in expected directory - String s = f.getAbsolutePath(); - s = "file:" + s; - html = new JEditorPane(s); - } else { - // file missing, so let's look if we can get it from the jar - URL url = ClassLoader.getSystemResource(IGUIConstants.HELP_DIR.replace('\\', '/') + "/" + fname); - - if (url != null) { - html = new JEditorPane(url); - } else { - // let's try it again without first directory - if (log.isInfoEnabled()) { - log.info("trying: HelpFiles/" + fname); - } - url = ClassLoader.getSystemResource("HelpFiles/" + fname); - if (url != null) { - html = new JEditorPane(url); - } else { - if (log.isInfoEnabled()) { - log.info("Failed to open help file '" + fname + "'!"); - } - } - } - } - - html.setEditable(false); - html.addHyperlinkListener(this); - JViewport vp = getViewport(); - - // under windows, the content of the panel get detroyed after scrolling - // this will avoid this problem! - // but it will make the scrolling slower - // so test this! - this.getViewport().putClientProperty("EnableWindowBlit", new Boolean(true)); - vp.setScrollMode(JViewport.SIMPLE_SCROLL_MODE); - - vp.add(html); - setAutoscrolls(true); - } catch (NullPointerException e) { - // failed to open the html file - } catch (MalformedURLException e) { - log.warn("Malformed URL: ", e); - } catch (IOException e) { - log.warn("IOException: ", e); - } - } - - /** - * Konstructor to load the html-file <fname> and display - * it's contents in this HtmlPane - * @param type mime-type of the given text (e.g. "text/html") - * @param text text to display (can be html-text for example) - */ - public HtmlPane(String type, String text) { - // open new JEditorPane - html = new JEditorPane(type, text); - html.setEditable(false); - html.addHyperlinkListener(this); - JViewport vp = getViewport(); - - // under windows, the content of the panel get detroyed after scrolling - // this will avoid this problem! - // but it will make the scrolling slower - // so test this! - this.getViewport().putClientProperty("EnableWindowBlit", new Boolean(true)); - vp.setScrollMode(JViewport.SIMPLE_SCROLL_MODE); - - vp.add(html); - //vp.setView(html); - //vp.setViewPosition(new Point(0, 0)); - - setAutoscrolls(true); - } - - /** - * Notification of a change relative to a - * hyperlink. - * @param e occurred <code>HyperlinkEvent</code> - */ - public void hyperlinkUpdate(HyperlinkEvent e) { - if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { - linkActivated(e.getURL()); - } - } - - /** - * Follows the reference in an - * link. The given url is the requested reference. - * By default this calls <a href="#setPage">setPage</a>, - * and if an exception is thrown the original previous - * document is restored and a beep sounded. If an - * attempt was made to follow a link, but it represented - * a malformed url, this method will be called with a - * null argument. - * @param u the URL to follow - */ - protected void linkActivated(URL u) { - Cursor c = html.getCursor(); - Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR); - html.setCursor(waitCursor); - SwingUtilities.invokeLater(new PageLoader(u, c)); - } - - /** - * temporary class that loads synchronously (although - * later than the request so that a cursor change - * can be done). - */ - class PageLoader implements Runnable { - - PageLoader(URL u, Cursor c) { - url = u; - cursor = c; - } - - public void run() { - if (url == null) { - // restore the original cursor - html.setCursor(cursor); - - // PENDING(prinz) remove this hack when - // automatic validation is activated. - Container parent = html.getParent(); - parent.repaint(); - } else { - Document doc = html.getDocument(); - try { - html.setPage(url); - } catch (IOException ioe) { - html.setDocument(doc); - getToolkit().beep(); - } finally { - // schedule the cursor to revert after - // the paint has happended. - url = null; - SwingUtilities.invokeLater(this); - } - } - } - - URL url; - - Cursor cursor; - } -} Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-26 11:27:28 UTC (rev 28) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-26 16:46:56 UTC (rev 29) @@ -26,6 +26,7 @@ import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectStack; +import cfeditor.help.CFHelp; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-05-26 11:27:28 UTC (rev 28) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-05-26 16:46:56 UTC (rev 29) @@ -25,6 +25,7 @@ package cfeditor; import cfeditor.arch.ArchObject; +import cfeditor.help.CFHelp; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-05-26 11:27:28 UTC (rev 28) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-05-26 16:46:56 UTC (rev 29) @@ -51,6 +51,7 @@ import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; +import cfeditor.help.CFHelp; /** * Dialog used to ask the user the properties for the new level. Added: trunk/crossfire/src/cfeditor/help/CFHelp.java =================================================================== --- trunk/crossfire/src/cfeditor/help/CFHelp.java (rev 0) +++ trunk/crossfire/src/cfeditor/help/CFHelp.java 2006-05-26 16:46:56 UTC (rev 29) @@ -0,0 +1,56 @@ +package cfeditor.help; + +import cfeditor.CGUIUtils; +import cfeditor.IGUIConstants; +import java.awt.Rectangle; +import javax.swing.JFrame; + +/** + * <code>CFHelp</code> implements the Help Window is a seperate frame with html content. + * @author <a href="mailto:mic...@no...">Michael Toennies</a> + * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @deprecated We'll use JavaHelp instead. + */ +@Deprecated public class CFHelp extends JFrame { + + private static final long serialVersionUID = 6896632173566618870L; + + /** + * Konstructor + * @param mainView the main view + * @param bigSize if true, the frame gets bigger than normal + * (useful in combination with larger fonts) + * @param fname may contain different things: + * 1. null -> the file "start.html" is opened + * 2. File name of a html-file to be opened + * 3. html-text to be displayed directly (no file) + * (this text must start with "<HTML>") + */ + public CFHelp(final JFrame mainView, String fname, final boolean bigSize) { + super("Help"); // super constructor + + // set application icon + setIconImage(CGUIUtils.getIcon(IGUIConstants.APP_ICON).getImage()); + + final Rectangle mvb = mainView.getBounds(); // get main view bounds + if (bigSize) { + setBounds(mvb.x + (mvb.width >> 1) - 300, mvb.y + 70, 600, 750); // big size + } else { + setBounds(mvb.x + (mvb.width >> 1) - 260, mvb.y + 70, 520, 600); // standard + } + + if (fname == null) { + fname = "start.html"; + } + + final HtmlPane html; + if (fname.startsWith("<HTML>")) { + html = new HtmlPane("text/html", fname); // direct text + } else { + html = new HtmlPane(fname); // read html file + } + + setContentPane(html); + } + +} // class CFHelp Property changes on: trunk/crossfire/src/cfeditor/help/CFHelp.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Copied: trunk/crossfire/src/cfeditor/help/HtmlPane.java (from rev 27, trunk/crossfire/src/cfeditor/CFHelp.java) =================================================================== --- trunk/crossfire/src/cfeditor/help/HtmlPane.java (rev 0) +++ trunk/crossfire/src/cfeditor/help/HtmlPane.java 2006-05-26 16:46:56 UTC (rev 29) @@ -0,0 +1,212 @@ +/* + * Crossfire Java Editor. + * Copyright (C) 2000 Michael Toennies + * Copyright (C) 2001 Andreas Vogl + * + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package cfeditor.help; + +import java.awt.Container; +import java.awt.Cursor; +import java.io.File; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import java.util.logging.Level; +import javax.swing.JEditorPane; +import javax.swing.JScrollPane; +import javax.swing.JViewport; +import javax.swing.SwingUtilities; +import javax.swing.event.HyperlinkEvent; +import javax.swing.event.HyperlinkListener; +import javax.swing.text.Document; +import cfeditor.IGUIConstants; + +class HtmlPane extends JScrollPane implements HyperlinkListener { + + private static final Logger log = Logger.getLogger("HtmlPane.class"); + + private static final long serialVersionUID = 7957975761362660439L; + + private JEditorPane html; + + /** + * Constructor to load the html-file <fname> and display + * it's contents in this HtmlPane. + * @param fname Name of the hmtl-file + */ + HtmlPane(final String fname) { + try { + // first looking for the html file in extracted form + final File f = new File(IGUIConstants.HELP_DIR + File.separator + fname); + if (f.exists()) { + // file exists in expected directory + final String s = "file:" + f.getAbsolutePath(); + html = new JEditorPane(s); + } else { + // file missing, so let's look if we can get it from the jar + URL url = ClassLoader.getSystemResource(IGUIConstants.HELP_DIR.replace('\\', '/') + "/" + fname); + + if (url != null) { + html = new JEditorPane(url); + } else { + // let's try it again without first directory + log.info("trying: HelpFiles/" + fname); + url = ClassLoader.getSystemResource("HelpFiles/" + fname); + if (url != null) { + html = new JEditorPane(url); + } else { + log.info("Failed to open help file '" + fname + "'!"); + html = new JEditorPane("text/plain", ""); + } + } + } + + html.setEditable(false); + html.addHyperlinkListener(this); + final JViewport vp = getViewport(); + + // under windows, the content of the panel get detroyed after scrolling + // this will avoid this problem! + // but it will make the scrolling slower + // so test this! + getViewport().putClientProperty("EnableWindowBlit", Boolean.TRUE); + vp.setScrollMode(JViewport.SIMPLE_SCROLL_MODE); + + vp.add(html); + setAutoscrolls(true); + } catch (NullPointerException e) { + // failed to open the html file + } catch (MalformedURLException e) { + log.log(Level.WARNING, "Malformed URL: %s", e); + } catch (IOException e) { + log.log(Level.WARNING, "IOException: %s", e); + } + } + + /** + * Konstructor to load the html-file <fname> and display + * it's contents in this HtmlPane + * @param type mime-type of the given text (e.g. "text/html") + * @param text text to display (can be html-text for example) + */ + HtmlPane(final String type, final String text) { + // open new JEditorPane + html = new JEditorPane(type, text); + html.setEditable(false); + html.addHyperlinkListener(this); + final JViewport vp = getViewport(); + + // under windows, the content of the panel get detroyed after scrolling + // this will avoid this problem! + // but it will make the scrolling slower + // so test this! + // XXX The main issue probably is extending JScrollPane (Cher) + getViewport().putClientProperty("EnableWindowBlit", Boolean.TRUE); + vp.setScrollMode(JViewport.SIMPLE_SCROLL_MODE); + + vp.add(html); + //vp.setView(html); + //vp.setViewPosition(new Point(0, 0)); + + setAutoscrolls(true); + } + + /** + * Notification of a change relative to a + * hyperlink. + * @param e occurred <code>HyperlinkEvent</code> + */ + public void hyperlinkUpdate(final HyperlinkEvent e) { + if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { + linkActivated(e.getURL()); + } + } + + /** + * Follows the reference in an + * link. The given url is the requested reference. + * By default this calls <a href="#setPage">setPage</a>, + * and if an exception is thrown the original previous + * document is restored and a beep sounded. If an + * attempt was made to follow a link, but it represented + * a malformed url, this method will be called with a + * null argument. + * @param u the URL to follow + */ + protected void linkActivated(final URL u) { + final Cursor c = html.getCursor(); + final Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR); + html.setCursor(waitCursor); + SwingUtilities.invokeLater(new PageLoader(u, c)); + } + + /** + * Synchronuous page loader, loads a page and handles the cursor. + */ + private class PageLoader implements Runnable { + + /** URL to load. */ + private URL url; + + /** Original cursor that should be restored once the document is loaded. */ + private Cursor cursor; + + /** + * Create a PageLoader. + * @param url URL to load + * @param cursor Cursor to restore once the document is loaded + */ + private PageLoader(final URL url, final Cursor cursor) { + this.url = url; + this.cursor = cursor; + } + + /** {@inheritDoc} */ + public void run() { + if (url == null) { + // restore the original cursor + html.setCursor(cursor); + + // PENDING(prinz) remove this hack when + // automatic validation is activated. + final Container parent = html.getParent(); + parent.repaint(); + } else { + final Document doc = html.getDocument(); + try { + html.setPage(url); + } catch (final IOException ioe) { + html.setDocument(doc); + getToolkit().beep(); + } finally { + // schedule the cursor to revert after + // the paint has happended. + url = null; + SwingUtilities.invokeLater(this); + } + } + } + + } // class PageLoader + +} // class HtmlPane This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-26 19:14:11
|
Revision: 33 Author: christianhujer Date: 2006-05-26 12:13:59 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=33&view=rev Log Message: ----------- Removed unused bigsize parameter from help window. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java trunk/crossfire/src/cfeditor/help/CFHelp.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-26 18:49:11 UTC (rev 32) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-26 19:13:59 UTC (rev 33) @@ -49,7 +49,6 @@ import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JDialog; -import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -1049,7 +1048,7 @@ help_button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // create html-docu on the current type and display it - new CFHelp(m_control.getMainView(), type.createHtmlDocu(), CMainControl.getInstance().isBigFont()).setVisible(true); + new CFHelp(m_control.getMainView(), type.createHtmlDocu()).setVisible(true); } }); Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-26 18:49:11 UTC (rev 32) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-26 19:13:59 UTC (rev 33) @@ -674,7 +674,7 @@ helpButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { // open the help window - new CFHelp(CMainControl.getInstance().getMainView(), "treasurelists.html", false).setVisible(true); + new CFHelp(CMainControl.getInstance().getMainView(), "treasurelists.html").setVisible(true); } }); leftSide.add(helpButton); Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-05-26 18:49:11 UTC (rev 32) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-05-26 19:13:59 UTC (rev 33) @@ -275,7 +275,7 @@ /** open the online help window */ public void openHelpWindow() { - new CFHelp(this, null, false).setVisible(true); + new CFHelp(this, null).setVisible(true); } public void setPickmapActive(boolean state) { Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-05-26 18:49:11 UTC (rev 32) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-05-26 19:13:59 UTC (rev 33) @@ -38,7 +38,6 @@ import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JCheckBox; -import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -354,7 +353,7 @@ button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { // open the help window - new CFHelp(m_control.getMainView(), "tut_mapattr.html", false).setVisible(true); + new CFHelp(m_control.getMainView(), "tut_mapattr.html").setVisible(true); } }); left_buttons.add(button); Modified: trunk/crossfire/src/cfeditor/help/CFHelp.java =================================================================== --- trunk/crossfire/src/cfeditor/help/CFHelp.java 2006-05-26 18:49:11 UTC (rev 32) +++ trunk/crossfire/src/cfeditor/help/CFHelp.java 2006-05-26 19:13:59 UTC (rev 33) @@ -57,7 +57,7 @@ * @todo refactor this. The dual semantic of fname is a Bad Thing. * @todo always creating new help windows is a Bad Thing as well, make this constructor private */ - public CFHelp(final JFrame parent, String fname, final boolean bigSize) { + public CFHelp(final JFrame parent, String fname) { super(parent, "Help", false); // super constructor setResizable(true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-05-31 10:12:08
|
Revision: 89 Author: akirschbaum Date: 2006-05-31 03:11:58 -0700 (Wed, 31 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=89&view=rev Log Message: ----------- Remove unused variables. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CNewMapDialog.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-31 09:51:06 UTC (rev 88) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-31 10:11:58 UTC (rev 89) @@ -141,18 +141,12 @@ // resource directories private File mapDir; - private File archDir; - - private File scriptDir; - private String strMapDir; private String strArchDir; private String strScriptDir; - private String strImageDir = null; // directory for saving map images - // this flag indicates weither the user has ever changed the // active dir since the program started private boolean hasChangedDir = false; Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-05-31 09:51:06 UTC (rev 88) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-05-31 10:11:58 UTC (rev 89) @@ -113,9 +113,6 @@ /** All open level views. */ private Vector mapViews = new Vector(1, 2); - /** Currently focused level view. */ - private CMapViewIFrame focusedMapView; - /** list of objects on map (right side) */ private CMapTileList mapTileList; Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-05-31 09:51:06 UTC (rev 88) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-05-31 10:11:58 UTC (rev 89) @@ -104,8 +104,6 @@ private JTabbedPane panelDesktop; - private JPanel panelDesktop2; - private Style currentAttributes; private Document doc; Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-05-31 09:51:06 UTC (rev 88) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-05-31 10:11:58 UTC (rev 89) @@ -77,9 +77,6 @@ /** The tile palette renderer. */ private final CLevelRenderer renderer; - //private JScrollPane scrollPane; - private Rectangle previewRect; - private boolean changed = false; private boolean showMapGrid; Modified: trunk/crossfire/src/cfeditor/CNewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-05-31 09:51:06 UTC (rev 88) +++ trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-05-31 10:11:58 UTC (rev 89) @@ -90,8 +90,6 @@ private final JTextField mapHeightField; - private JTabbedPane tabbedPane; - private final JPanel newLevelFromScratchPanel; private static final long serialVersionUID = -9194625062729020248L; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-05-31 10:44:43
|
Revision: 90 Author: akirschbaum Date: 2006-05-31 03:44:36 -0700 (Wed, 31 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=90&view=rev Log Message: ----------- Make crossfire editor compilable again. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapViewBasic.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-31 10:11:58 UTC (rev 89) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-31 10:44:36 UTC (rev 90) @@ -147,6 +147,8 @@ private String strScriptDir; + private String strImageDir; // directory for saving map images + // this flag indicates weither the user has ever changed the // active dir since the program started private boolean hasChangedDir = false; @@ -461,9 +463,6 @@ mapDir = new File(currentDir.getAbsolutePath(), mapDir.getPath()); } - archDir = new File(strArchDir); - scriptDir = new File(strScriptDir); - imageSet = new String(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty( USE_IMAGESET, (IGUIConstants.isoView ? "none" : "base"))); if (imageSet.equalsIgnoreCase("none")) { Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-05-31 10:11:58 UTC (rev 89) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-05-31 10:44:36 UTC (rev 90) @@ -599,8 +599,6 @@ */ void updateFocus(boolean fCareAboutIconification) { - focusedMapView = null; - // Show the next level (if such exists) for (Enumeration enu = mapViews.elements(); enu.hasMoreElements();) { CMapViewIFrame view = (CMapViewIFrame) enu.nextElement(); @@ -625,7 +623,6 @@ } // No non-iconified level windows found - focusedMapView = null; mainControl.setCurrentLevel(null); } @@ -694,7 +691,6 @@ public void levelViewFocusGainedNotify(CMapViewIFrame view) { mapViews.removeElement(view); mapViews.insertElementAt(view, 0); - focusedMapView = view; CMapControl level = view.getLevel(); mainControl.setCurrentLevel(level); //statusBar.setLevelInfo(level); Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-05-31 10:11:58 UTC (rev 89) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-05-31 10:44:36 UTC (rev 90) @@ -1497,6 +1497,7 @@ Point[] needRedraw = null; // array of tile coords which need to be redrawn Point[] preRedraw = null; // array of tile coords which need to be redrawn boolean needFullRepaint = false; // true if full repaint of map needed + Rectangle previewRect = null; if (mapLoc != null) { // in "locked pickmaps" mode, pickmaps react only to leftclicks @@ -1962,7 +1963,6 @@ void endFill() { fFilling = false; - previewRect = null; startMapLoc = null; // repaint(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <der...@us...> - 2006-05-31 21:41:03
|
Revision: 103 Author: derdanny Date: 2006-05-31 14:39:59 -0700 (Wed, 31 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=103&view=rev Log Message: ----------- Added @Nullable and @Override annotations. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/BshThread.java trunk/crossfire/src/cfeditor/CArchPanel.java trunk/crossfire/src/cfeditor/CArchPanelPan.java trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CFilterControl.java trunk/crossfire/src/cfeditor/CGUIUtils.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainToolbar.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/crossfire/src/cfeditor/CMapModel.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CMapViewIFrame.java trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/crossfire/src/cfeditor/CScriptController.java trunk/crossfire/src/cfeditor/CScriptModel.java trunk/crossfire/src/cfeditor/CScriptView.java trunk/crossfire/src/cfeditor/CStartupScreen.java trunk/crossfire/src/cfeditor/FaceObject.java trunk/crossfire/src/cfeditor/JFontChooser.java trunk/crossfire/src/cfeditor/PluginParameter.java trunk/crossfire/src/cfeditor/PluginParameterFactory.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/TrackedBufferedInputStream.java trunk/crossfire/src/cfeditor/arch/ArchObject.java trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java trunk/crossfire/src/cfeditor/filter/NamedFilterList.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java trunk/crossfire/src/cfeditor/gui/ScriptManager.java trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java trunk/crossfire/src/cfeditor/menu/BasicAction.java trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java trunk/crossfire/src/cfeditor/menu/CheckBoxMenuEntry.java trunk/crossfire/src/cfeditor/menu/FilterCheckBoxEntry.java trunk/crossfire/src/cfeditor/menu/LocationMenuEntry.java trunk/crossfire/src/cfeditor/menu/SeparatorMenuEntry.java trunk/crossfire/src/cfeditor/menu/SimpleMenuEntry.java trunk/crossfire/src/cfeditor/menu/SwitchedMenuEntry.java trunk/crossfire/src/cfeditor/parameter/ArchParameter.java trunk/crossfire/src/cfeditor/parameter/BooleanParameter.java trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java trunk/crossfire/src/cfeditor/parameter/FilterParameter.java trunk/crossfire/src/cfeditor/parameter/IntegerParameter.java trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java trunk/crossfire/src/cfeditor/parameter/MapParameter.java trunk/crossfire/src/cfeditor/parameter/MapParameterView.java trunk/crossfire/src/cfeditor/parameter/StringParameter.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java trunk/crossfire/src/cfeditor/textedit/textarea/CTokenMarker.java trunk/crossfire/src/cfeditor/textedit/textarea/DefaultInputHandler.java trunk/crossfire/src/cfeditor/textedit/textarea/HTMLTokenMarker.java trunk/crossfire/src/cfeditor/textedit/textarea/InputHandler.java trunk/crossfire/src/cfeditor/textedit/textarea/JEditTextArea.java trunk/crossfire/src/cfeditor/textedit/textarea/PythonTokenMarker.java trunk/crossfire/src/cfeditor/textedit/textarea/SyntaxDocument.java trunk/crossfire/src/cfeditor/textedit/textarea/SyntaxStyle.java trunk/crossfire/src/cfeditor/textedit/textarea/TextAreaPainter.java trunk/crossfire/src/cfeditor/textedit/textarea/Token.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2006-05-31 21:39:59 UTC (rev 103) @@ -30,6 +30,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * The <code>AutojoinList</code> class contains a list of (typically wall-)arches which @@ -319,7 +320,7 @@ * @param y location to search * @return arch which is part of this joinlist, null if no such arch exists */ - private ArchObject findArchOfJoinlist(CMapModel map, int x, int y) { + @Nullable private ArchObject findArchOfJoinlist(CMapModel map, int x, int y) { ArchObject tmp_arch = map.getTopArchObject(x, y); // we look through the arches at the given location (top to bottom): for (; tmp_arch != null; tmp_arch = tmp_arch.getPrevArch()) { Modified: trunk/crossfire/src/cfeditor/BshThread.java =================================================================== --- trunk/crossfire/src/cfeditor/BshThread.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/BshThread.java 2006-05-31 21:39:59 UTC (rev 103) @@ -50,7 +50,7 @@ this.script = script; } - public void run() { + @Override public void run() { try { interpreter.set("scriptThread", this); interpreter.eval(script.getCode()); Modified: trunk/crossfire/src/cfeditor/CArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanel.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CArchPanel.java 2006-05-31 21:39:59 UTC (rev 103) @@ -35,6 +35,7 @@ import javax.swing.JTabbedPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import org.jetbrains.annotations.Nullable; /** * The <code>CArchPanel</code> holds the tile palette. @@ -145,7 +146,7 @@ } } - public ArchObject getArchPanelSelection() { + @Nullable public ArchObject getArchPanelSelection() { if (selectedPanel == null) { return null; } @@ -275,7 +276,7 @@ * Overridden to store and restore the divider location upon * UI change. */ - public void updateUI() { + @Override public void updateUI() { int dividerLocation = getDividerLocation(); int dividerSize = getDividerSize(); super.updateUI(); Modified: trunk/crossfire/src/cfeditor/CArchPanelPan.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-05-31 21:39:59 UTC (rev 103) @@ -109,7 +109,7 @@ // listening for mouse-click events in the ArchPanel list theList.addMouseListener(new MouseAdapter() { - public void mousePressed(final MouseEvent e) { + @Override public void mousePressed(final MouseEvent e) { // In JDK 1.4 it is required to transfer focus back to mapview after // every click in the panel, otherwise the menu-shortcuts stop working if (mainControl.getCurrentMap() != null && @@ -259,7 +259,7 @@ /* This is the only method defined by ListCellRenderer. We just * reconfigure the Jlabel each time we're called. */ - public Component getListCellRendererComponent(final JList list, + @Override public Component getListCellRendererComponent(final JList list, final Object value, // value to display final int index, // cell index final boolean iss, // is the cell selected Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-31 21:39:59 UTC (rev 103) @@ -65,6 +65,7 @@ import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * CAttribDialog poses the GUI for CF object attributes @@ -162,7 +163,7 @@ // when close-box is selected, execute the 'closeDialog' method and nothing else setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { - public void windowClosing(final WindowEvent event) { + @Override public void windowClosing(final WindowEvent event) { closeDialog(); } }); @@ -558,7 +559,7 @@ * with the central part of the dialog window. * All further calls rebuild the existing tabbedpane and return null. */ - private JScrollPane buildAttr() { + @Nullable private JScrollPane buildAttr() { boolean initialCall = false; if (tabbedPane == null) { @@ -597,7 +598,7 @@ * @param secId the identifier of the section * @return a <code>Component</code> containing the attribute panel */ - private Component makeAttribPanel(final int secId) { + @Nullable private Component makeAttribPanel(final int secId) { int number = 0; // number of attributes in this section boolean isText = false; // true if this section contains a textfield boolean hasBitmask = false; // true if this section contains a bitmask attribute Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-05-31 21:39:59 UTC (rev 103) @@ -614,7 +614,7 @@ * The description of this filter. For example: "JPG and GIF Images" * @return filter description */ - public String getDescription() { + @Override public String getDescription() { return "spellist.h"; } @@ -623,7 +623,7 @@ * @param f any file * @return true if the file is accepted as spellist */ - public boolean accept(File f) { + @Override public boolean accept(File f) { return f.isDirectory() || f.getName().equalsIgnoreCase("spellist.h"); } } Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-31 21:39:59 UTC (rev 103) @@ -54,6 +54,7 @@ import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreePath; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * The CFTreasureListTree class fully manages the Crossfire treausrelists. @@ -207,7 +208,7 @@ * If no attribute dialog is attached, or this dialog is hidden, * null is returned. */ - public static CAttribDialog getParentDialog() { + @Nullable public static CAttribDialog getParentDialog() { if (instance != null && instance.frame != null && instance.frame.isShowing()) { return instance.parentDialog; } @@ -694,7 +695,7 @@ * If nothing is selected, null is returned. * @throws CGridderException when user selected an invalid treasurelist (e.g. a god-list) */ - private String getSelectedTreasureList() throws CGridderException { + @Nullable @Nullable private String getSelectedTreasureList() throws CGridderException { // return null when nothing is selected if (isSelectionEmpty()) { return null; @@ -798,7 +799,7 @@ return clone; } - public String toString() { + @Override public String toString() { return content.toString(); } @@ -858,7 +859,7 @@ * @return String representation of this treasure object. This is * what gets displayed on the tree. */ - public String toString() { + @Override public String toString() { return (nrof == UNSET ? "" : nrof + " ") + name + (type == TREASUREONE_LIST ? " [one]" : "") + (magic == UNSET ? "" : " +" + magic) + (chance == UNSET ? "" : " (" + chance + " %)"); } @@ -958,7 +959,7 @@ } /** The cell-drawing method. */ - public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, + @Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { // first use the standard renderer to paint it all super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); Modified: trunk/crossfire/src/cfeditor/CFilterControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CFilterControl.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CFilterControl.java 2006-05-31 21:39:59 UTC (rev 103) @@ -18,6 +18,7 @@ import cfeditor.menu.BasicMenuEntry; import javax.swing.JComponent; import javax.swing.JMenu; +import org.jetbrains.annotations.Nullable; /** * @author tchize @@ -148,15 +149,15 @@ super("<<set me>>"); } - protected void update() { + @Override protected void update() { // nothing to do } - protected void updateItem(JComponent item) { + @Override protected void updateItem(JComponent item) { // nothing to do } - public JComponent getMenuBarComponent() { + @Override public JComponent getMenuBarComponent() { JMenu menu = new JMenu(getName()); BasicMenuEntry outEntry = filterList.createMenuEntry(filterOutConfig); outEntry.setName("Filter view"); @@ -172,11 +173,11 @@ return menu; } - public JComponent getMenuItemComponent() { + @Override public JComponent getMenuItemComponent() { return getMenuBarComponent(); } - public JComponent getToolbarComponent() { + @Override @Nullable public JComponent getToolbarComponent() { return null; } } Modified: trunk/crossfire/src/cfeditor/CGUIUtils.java =================================================================== --- trunk/crossfire/src/cfeditor/CGUIUtils.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CGUIUtils.java 2006-05-31 21:39:59 UTC (rev 103) @@ -160,7 +160,7 @@ * @param y The y-coordinate of the pixel. * @param rgb The pixels colour in default RGB ColorModel. */ - public int filterRGB(int x, int y, int rgb) { + @Override public int filterRGB(int x, int y, int rgb) { float red = (float) ((rgb >> 16) & 0xFF); float green = (float) ((rgb >> 8) & 0xFF); float blue = (float) (rgb & 0xFF); Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-31 21:39:59 UTC (rev 103) @@ -49,6 +49,7 @@ import javax.swing.UnsupportedLookAndFeelException; import javax.swing.filechooser.FileFilter; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; import net.sf.japi.util.filter.file.EndingFileFilter; import net.sf.japi.swing.ActionFactory; @@ -965,7 +966,7 @@ * @param initial the view position to show initially * @return The map controller to manipulate this map. */ - public CMapControl openFile(File file, boolean show, Point initial) { + @Nullable @Nullable @Nullable public CMapControl openFile(File file, boolean show, Point initial) { ArchObject start; MapArchObject maparch; CMapControl control = null; @@ -1212,11 +1213,11 @@ fileChooser.setSelectedFile(new File(filename)); // set a file filter for "*.png" files fileChooser.setFileFilter(new FileFilter() { - public String getDescription() { + @Override public String getDescription() { return "*.png"; } - public boolean accept(File f) { + @Override public boolean accept(File f) { return f.isDirectory() || f.getName().endsWith(".png"); } }); Modified: trunk/crossfire/src/cfeditor/CMainToolbar.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-05-31 21:39:59 UTC (rev 103) @@ -37,6 +37,7 @@ import javax.swing.JPopupMenu; import javax.swing.JRadioButtonMenuItem; import javax.swing.JToolBar; +import org.jetbrains.annotations.Nullable; /** * <code>CMainTolbar</code> implements the main toolbar of the application. @@ -97,7 +98,7 @@ m_popupMenu = new CPopupMenu(); addMouseListener( new MouseAdapter() { - public void mousePressed(MouseEvent event) { + @Override public void mousePressed(MouseEvent event) { if ((event.getModifiers() & MouseEvent.META_MASK) != 0) { m_popupMenu.show(CMainToolbar.this, event.getX(), event.getY()); } @@ -112,7 +113,7 @@ * @param strLabel The label text. * @return The label text or null if labels should not be visible. */ - private String checkLabel(String strLabel) { + @Nullable private String checkLabel(String strLabel) { if (m_eIconAndLabelVisibility == SHOW_ICONS_ONLY) { return null; } @@ -125,7 +126,7 @@ * @param strIcon The icon name. * @return The icon name or null if icons should not be visible. */ - private String checkIcon(String strIcon) { + @Nullable private String checkIcon(String strIcon) { if (m_eIconAndLabelVisibility == SHOW_LABELS_ONLY) { return null; } Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-05-31 21:39:59 UTC (rev 103) @@ -46,6 +46,7 @@ import javax.swing.UIManager; import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameListener; +import org.jetbrains.annotations.Nullable; /** * The main view of the level editor. Contains the "desktop" for internal level @@ -147,7 +148,7 @@ setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener( new WindowAdapter() { - public void windowClosing(WindowEvent event) { + @Override public void windowClosing(WindowEvent event) { mainControl.exitWanted(); } }); @@ -529,7 +530,7 @@ * Returns all level windows that exist in the main view. * @return All level windows */ - Enumeration getAllLevelWindows() { + @Nullable Enumeration getAllLevelWindows() { if (mapViews != null && mapViews.size() > 0) { return mapViews.elements(); } @@ -746,7 +747,7 @@ * Overridden to store and restore the divider location upon * UI change. */ - public void updateUI() { + @Override public void updateUI() { int dividerLocation = getDividerLocation(); int dividerSize = getDividerSize(); super.updateUI(); Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-05-31 21:39:59 UTC (rev 103) @@ -83,11 +83,11 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - public boolean getScrollableTracksViewportWidth() { + @Override public boolean getScrollableTracksViewportWidth() { return getSize().width < getParent().getSize().width; } - public void setSize(Dimension d) { + @Override public void setSize(Dimension d) { if (d.width < getParent().getSize().width) { d.width = getParent().getSize().width; } @@ -922,7 +922,7 @@ * Overridden to store and restore the divider location upon * UI change. */ - public void updateUI() { + @Override public void updateUI() { int dividerLocation = getDividerLocation(); int dividerSize = getDividerSize(); super.updateUI(); Modified: trunk/crossfire/src/cfeditor/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-05-31 21:39:59 UTC (rev 103) @@ -30,6 +30,7 @@ import java.io.FileReader; import java.io.IOException; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * This class handles the reading of a mapfile and parsing the data @@ -141,7 +142,7 @@ * @return the new parsed <code>ArchObject</code> * @throws IOException when an I/O-error occured during file reading */ - public ArchObject readArch(BufferedReader myInput, String thisLine, ArchObject container) + @Nullable public ArchObject readArch(BufferedReader myInput, String thisLine, ArchObject container) throws IOException { ArchObject arch; String thisLine2; Modified: trunk/crossfire/src/cfeditor/CMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapModel.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CMapModel.java 2006-05-31 21:39:59 UTC (rev 103) @@ -35,6 +35,7 @@ import java.awt.Point; import java.util.Iterator; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * The level model that represents a level. @@ -100,7 +101,7 @@ * map-tiles panel. * @return the ArchObject to show; the object(s) must not be modified */ - public ArchObject getMouseRightPosObject() { + @Nullable public ArchObject getMouseRightPosObject() { final int mx = m_control.getMapView().getMapMouseRightPos().x; final int my = m_control.getMapView().getMapMouseRightPos().y; @@ -226,7 +227,7 @@ * Return the bottom {@link ArchObject} in the given location. * @return the ArchObject, or null if no object is present */ - public ArchObject getBottomArchObject(final int x, final int y) { + @Nullable public ArchObject getBottomArchObject(final int x, final int y) { if (!pointValid(x, y)) { return null; } @@ -675,7 +676,7 @@ * @param id ID number of arch (-> <code>arch.getMyID()</code>) * @return the specified arch, or null if not found */ - public ArchObject getMapArch(final int id, final int xx, final int yy) { + @Nullable public ArchObject getMapArch(final int id, final int xx, final int yy) { ArchObject node; if (m_mapGrid == null || xx < 0 || xx >= m_mapWidth || yy < 0 || yy >= m_mapHeight) { @@ -708,7 +709,7 @@ * @param id ID number of arch (-> <code>arch.getMyID()</code>) * @return the specified arch, or null if not found */ - public ArchObject findInvObject(final ArchObject node, final int id) { + @Nullable public ArchObject findInvObject(final ArchObject node, final int id) { final Iterator it = node.getInventory(); while (it.hasNext()) { final ArchObject arch = (ArchObject) it.next(); @@ -925,7 +926,7 @@ * teleporter, exit, pit etc.) * @return ArchObject exit-arch if existent, otherwise null */ - public ArchObject getExit() { + @Nullable public ArchObject getExit() { final Point hspot = m_control.getMapView().getHighlightStart(); // selected spot if (hspot.x < 0 || hspot.y < 0) { Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-05-31 21:39:59 UTC (rev 103) @@ -48,6 +48,7 @@ import static javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; +import org.jetbrains.annotations.Nullable; /** * The panel that holds the map-tiles of the selected map square. (The window @@ -153,7 +154,7 @@ * listen for mouse events in the panel */ list.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { + @Override public void mousePressed(MouseEvent e) { if (e.getModifiers() == MouseEvent.BUTTON1_MASK && !e.isShiftDown() && !e.isControlDown()) { // --- left mouse button: select arch --- @@ -227,7 +228,7 @@ }); } - public ArchObject getMapTileSelection() { + @Nullable public ArchObject getMapTileSelection() { // find the selected entry if one int index = list.getSelectedIndex(); if (index >= list.getModel().getSize() || index < 0 @@ -412,7 +413,7 @@ /* This is the only method defined by ListCellRenderer. We just * reconfigure the Jlabel each time we're called. */ - public Component getListCellRendererComponent( + @Override public Component getListCellRendererComponent( JList list, Object value, // value to display int index, // cell index Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-05-31 21:39:59 UTC (rev 103) @@ -51,6 +51,7 @@ import javax.swing.JScrollPane; import javax.swing.JViewport; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * <code>CMapViewBasic</code> is the true mapview object. However, it is not @@ -407,7 +408,7 @@ * @return a <code>Point</code> array containing the coords of the tiles * which need to be redrawn */ - Point[] calcArchRedraw(ArchObject arch) { + @Nullable @Nullable Point[] calcArchRedraw(ArchObject arch) { if (arch == null) { // safety check return null; } @@ -644,7 +645,7 @@ resizeBackBuffer(); /*taken from java doc, scroll while dragged*/ MouseMotionListener doScrollRectToVisible = new MouseMotionAdapter() { - public void mouseDragged(MouseEvent e) { + @Override public void mouseDragged(MouseEvent e) { Rectangle r = new Rectangle(e.getX(), e.getY(), 1, 1); ((JComponent) e.getSource()).scrollRectToVisible(r); } @@ -688,7 +689,7 @@ return bufImage; } - public void paintComponent(Graphics grfx) { + @Override public void paintComponent(Graphics grfx) { if (isPickmap) { paintComponent((Graphics2D) grfx, false); } else { @@ -1118,7 +1119,7 @@ new Color(0.0f, 1.0f, 1.0f, 0.33f)}; /*taken from java doc, scroll while dragged*/ MouseMotionListener doScrollRectToVisible = new MouseMotionAdapter() { - public void mouseDragged(MouseEvent e) { + @Override public void mouseDragged(MouseEvent e) { Rectangle r = new Rectangle(e.getX(), e.getY(), 1, 1); ((JComponent) e.getSource()).scrollRectToVisible(r); } @@ -1176,7 +1177,7 @@ return bufImage; } - public void paintComponent(Graphics grfx) { + @Override public void paintComponent(Graphics grfx) { paintComponent(grfx, false); } Modified: trunk/crossfire/src/cfeditor/CMapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewIFrame.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CMapViewIFrame.java 2006-05-31 21:39:59 UTC (rev 103) @@ -123,7 +123,7 @@ return view.getViewport(); } - public Dimension getSize() { + @Override public Dimension getSize() { return view.getSize(); } @@ -215,7 +215,7 @@ return view.getViewPosition(); } - public void dispose() { + @Override public void dispose() { super.dispose(); /* workaround jvm 1.4 bug, does not free IFrame * so let's free a maximum of ressources used by Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-05-31 21:39:59 UTC (rev 103) @@ -33,6 +33,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * The <code>CPickmapPanel</code> manages the pickmap panel @@ -210,7 +211,7 @@ * @param maparch the maparch of the pickmap * @return basic mapview */ - private CMapViewBasic newPickmap(ArchObject start, MapArchObject maparch, File mapFile) { + @Nullable private CMapViewBasic newPickmap(ArchObject start, MapArchObject maparch, File mapFile) { CMapControl map; try { map = new CMapControl(mainControl, start, maparch, true, null); Modified: trunk/crossfire/src/cfeditor/CScriptController.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptController.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CScriptController.java 2006-05-31 21:39:59 UTC (rev 103) @@ -34,6 +34,7 @@ import org.jdom.input.SAXBuilder; import org.jdom.output.Format; import org.jdom.output.XMLOutputter; +import org.jetbrains.annotations.Nullable; /** * @author tchize @@ -137,11 +138,11 @@ //show a dialog an propose a filename JFileChooser chooser = new JFileChooser(); FileFilter f = new FileFilter() { - public boolean accept(File f) { + @Override public boolean accept(File f) { return f.getName().endsWith(".xml"); } - public String getDescription() { + @Override public String getDescription() { return "cfeditor script (*.xml)"; } }; @@ -214,7 +215,7 @@ } } - public Filter getScriptAsFilter(CScriptModel script) { + @Nullable public Filter getScriptAsFilter(CScriptModel script) { Interpreter runner = new Interpreter(); try { setInterpreterValues(runner, "filter"); @@ -280,7 +281,7 @@ return view; } - public CScriptModel getScript(int index) { + @Nullable public CScriptModel getScript(int index) { Iterator i = scripts.values().iterator(); CScriptModel m = null; while (i.hasNext() && index-- >= 0) { Modified: trunk/crossfire/src/cfeditor/CScriptModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptModel.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CScriptModel.java 2006-05-31 21:39:59 UTC (rev 103) @@ -17,6 +17,7 @@ import org.jdom.CDATA; import org.jdom.Element; import org.jdom.IllegalDataException; +import org.jetbrains.annotations.Nullable; /** * @author tchize @@ -89,7 +90,7 @@ this.value = value; } - public Object clone() throws CloneNotSupportedException { + @Override public Object clone() throws CloneNotSupportedException { Parameter p = new Parameter(); p.name = new String(name); p.description = new String(description); @@ -137,7 +138,7 @@ * @param index The index number of parameter * @return the name of parameter */ - public String getParamName(int index) { + @Nullable public String getParamName(int index) { try { return ((PluginParameter) params.get(index)).getName(); } catch (Exception e) { @@ -150,7 +151,7 @@ * @param index the parameter index to get * @return Returns the description of a parameter. */ - public String getParamDescription(int index) { + @Nullable public String getParamDescription(int index) { try { return ((PluginParameter) params.get(index)).getDescription(); } catch (Exception e) { @@ -190,7 +191,7 @@ * @param index the parameter index to get * @return Returns the parameter default value. */ - public Object getParamValue(int index) { + @Nullable public Object getParamValue(int index) { try { Object o = ((PluginParameter) params.get(index)).getValue(); return o; @@ -258,7 +259,7 @@ return params.size() - 1; } - public String toString() { + @Override public String toString() { return name; } @@ -294,7 +295,7 @@ * and a clone of each parameter. The listener are not moved along. * @return a clone of this CScriptModel */ - public Object clone() throws CloneNotSupportedException { + @Override public Object clone() throws CloneNotSupportedException { CScriptModel mdl = new CScriptModel(ctrl); mdl.code = new String(code); mdl.name = new String(name); Modified: trunk/crossfire/src/cfeditor/CScriptView.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptView.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CScriptView.java 2006-05-31 21:39:59 UTC (rev 103) @@ -180,11 +180,11 @@ } else if (cmd.equals("$$saveas")) { JFileChooser choose = new JFileChooser(); FileFilter filter = new FileFilter() { - public boolean accept(File f) { + @Override public boolean accept(File f) { return f.isFile() && f.getName().endsWith(".xml"); } - public String getDescription() { + @Override public String getDescription() { return "XML script collection (*.xml)"; } }; @@ -196,11 +196,11 @@ } else if (cmd.equals("$$import")) { JFileChooser choose = new JFileChooser(); FileFilter filter = new FileFilter() { - public boolean accept(File f) { + @Override public boolean accept(File f) { return f.isFile() && f.getName().endsWith(".xml") && f.exists() && f.canWrite(); } - public String getDescription() { + @Override public String getDescription() { return "XML script collection (*.xml)"; } }; Modified: trunk/crossfire/src/cfeditor/CStartupScreen.java =================================================================== --- trunk/crossfire/src/cfeditor/CStartupScreen.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/CStartupScreen.java 2006-05-31 21:39:59 UTC (rev 103) @@ -78,7 +78,7 @@ setBounds(bounds); m_clickListener = new MouseAdapter() { - public void mouseClicked(MouseEvent event) { + @Override public void mouseClicked(MouseEvent event) { close(); } }; @@ -108,7 +108,7 @@ * Overridden to paint the loaded startup image. * @param grfx The graphics context to paint to. */ - public void paint(Graphics grfx) { + @Override public void paint(Graphics grfx) { m_image.paintIcon(this, grfx, 0, 0); //grfx.drawImage(pinga, 0, 0, null); } @@ -117,7 +117,7 @@ * Overridden to startup a timer that then closes this window after * a few seconds. */ - public void setVisible(boolean visible) { + @Override public void setVisible(boolean visible) { if (visible) { super.setVisible(true); m_autoCloseTimer = new Timer(3000, new ActionListener() { Modified: trunk/crossfire/src/cfeditor/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/FaceObject.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/FaceObject.java 2006-05-31 21:39:59 UTC (rev 103) @@ -32,6 +32,7 @@ import java.lang.ref.SoftReference; import javax.swing.ImageIcon; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * The <code>FaceObject</code> @@ -82,7 +83,7 @@ } } - private synchronized ImageIcon loadFace() { + @Nullable private synchronized ImageIcon loadFace() { if (log.isDebugEnabled()) { log.debug("Getting soft reference to " + name); } Modified: trunk/crossfire/src/cfeditor/JFontChooser.java =================================================================== --- trunk/crossfire/src/cfeditor/JFontChooser.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/JFontChooser.java 2006-05-31 21:39:59 UTC (rev 103) @@ -137,7 +137,7 @@ // actionlistener for the font choose-box fontChooser.addComponentListener(new ComponentAdapter() { - public void componentResized(ComponentEvent e) { + @Override public void componentResized(ComponentEvent e) { dialog.pack(); } }); Modified: trunk/crossfire/src/cfeditor/PluginParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/PluginParameter.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/PluginParameter.java 2006-05-31 21:39:59 UTC (rev 103) @@ -114,7 +114,7 @@ setDescription("[description]"); } - public Object clone() throws CloneNotSupportedException { + @Override public Object clone() throws CloneNotSupportedException { return PluginParameterFactory.createParameter(toXML()); } } Modified: trunk/crossfire/src/cfeditor/PluginParameterFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/PluginParameterFactory.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/PluginParameterFactory.java 2006-05-31 21:39:59 UTC (rev 103) @@ -17,6 +17,7 @@ import java.util.LinkedHashMap; import org.apache.log4j.Logger; import org.jdom.Element; +import org.jetbrains.annotations.Nullable; /** * @author tchize @@ -49,7 +50,7 @@ return createParameter(parameterNode.getChildText("type"), parameterNode); } - public static PluginParameter createParameter(String type) { + @Nullable @Nullable public static PluginParameter createParameter(String type) { if (type == null) { type = "java.lang.String"; } @@ -72,7 +73,7 @@ } } - public static PluginParameter createParameter(String type, Element parameterNode) { + @Nullable @Nullable public static PluginParameter createParameter(String type, Element parameterNode) { if (type == null) { type = "java.lang.String"; } Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-05-31 21:39:59 UTC (rev 103) @@ -48,6 +48,7 @@ import javax.swing.JTextField; import static javax.swing.WindowConstants.HIDE_ON_CLOSE; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * Subclass of ArchObject to store and manage information about scripted events. @@ -246,7 +247,7 @@ * Create a new ScriptArchData instance, identical to this one. * @return a cloned instance of this ScriptArchData object */ - public ScriptArchData getClone() { + @Nullable public ScriptArchData getClone() { if (eventList != null && eventList.size() > 0) { ScriptArchData clone = new ScriptArchData(); // new instance Modified: trunk/crossfire/src/cfeditor/TrackedBufferedInputStream.java =================================================================== --- trunk/crossfire/src/cfeditor/TrackedBufferedInputStream.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/TrackedBufferedInputStream.java 2006-05-31 21:39:59 UTC (rev 103) @@ -37,7 +37,7 @@ /* (non-Javadoc) * @see java.io.InputStream#mark(int) */ - public synchronized void mark(int max) { + @Override public synchronized void mark(int max) { // TODO Auto-generated method stub super.mark(max); lastPosition = position; @@ -46,7 +46,7 @@ /* (non-Javadoc) * @see java.io.InputStream#read() */ - public synchronized int read() throws IOException { + @Override public synchronized int read() throws IOException { // TODO Auto-generated method stub int result = super.read(); if (result >= 0) { @@ -58,7 +58,7 @@ /* (non-Javadoc) * @see java.io.InputStream#read(byte[], int, int) */ - public synchronized int read(byte[] data, int offset, int length) + @Override public synchronized int read(byte[] data, int offset, int length) throws IOException { // TODO Auto-generated method stub int result = super.read(data, offset, length); @@ -71,7 +71,7 @@ /* (non-Javadoc) * @see java.io.InputStream#reset() */ - public synchronized void reset() throws IOException { + @Override public synchronized void reset() throws IOException { // TODO Auto-generated method stub super.reset(); position = lastPosition; @@ -80,7 +80,7 @@ /* (non-Javadoc) * @see java.io.InputStream#skip(long) */ - public synchronized long skip(long count) throws IOException { + @Override public synchronized long skip(long count) throws IOException { // TODO Auto-generated method stub long realSkipped = super.skip(count); position += realSkipped; Modified: trunk/crossfire/src/cfeditor/arch/ArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-05-31 21:39:59 UTC (rev 103) @@ -42,6 +42,7 @@ import java.util.ListIterator; import javax.swing.JList; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * The <code>ArchObject</code> class handles the Crossfire arch objects. @@ -696,7 +697,7 @@ multi.setNext(arch); // if this is null and head != null = last tile } - public ArchObject getMapMultiHead() { + @Nullable public ArchObject getMapMultiHead() { if (multi != null) { return multi.getHead(); // this points to head. Heads points to itsself } @@ -704,7 +705,7 @@ return null; } - public ArchObject getMapMultiNext() { + @Nullable public ArchObject getMapMultiNext() { if (multi != null) { return multi.getNext(); // if this is null and head != null = last tile } @@ -1078,7 +1079,7 @@ * @param str string (attribute) to look for * @param ignore_values if true, lines are matched against 'str' only till the first space (" ") */ - private static String diffTextString(String base, String str, boolean ignore_values) { + @Nullable private static String diffTextString(String base, String str, boolean ignore_values) { int i, j; String line = ""; @@ -1134,7 +1135,7 @@ msgText.append(text); } - public String getMsgText() { + @Nullable public String getMsgText() { if (msgText == null) { return null; } @@ -1151,7 +1152,7 @@ animText.append(text); } - public String getAnimText() { + @Nullable public String getAnimText() { if (animText == null) { return null; } @@ -1383,7 +1384,7 @@ * @return A String with all lines which don't match the type-definitions.<br> * If no such "errors" encountered, null is returned. */ - public String getSyntaxErrors(CFArchType type) { + @Nullable @Nullable public String getSyntaxErrors(CFArchType type) { ArchObject defarch = getDefaultArch(); if (typelist != null && archText != null && archText.length() > 0) { Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java 2006-05-31 21:39:59 UTC (rev 103) @@ -25,7 +25,7 @@ _model = model; } - public void remove() { + @Override public void remove() { if (_currArchObject == null) { throw new IllegalStateException(); } Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java 2006-05-31 21:39:59 UTC (rev 103) @@ -37,7 +37,7 @@ _join = join; } - public void remove() { + @Override public void remove() { if (_currArchObject == null) { throw new IllegalStateException(); } Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-05-31 21:39:59 UTC (rev 103) @@ -42,6 +42,7 @@ import org.jdom.Element; import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; +import org.jetbrains.annotations.Nullable; /** * The <code>ArchObjectParser</code> class handles the parsing of arches. @@ -185,7 +186,7 @@ * @param arch_name arch-object name (only for artifacts) * @param index current index on the ArchPanel */ - public ArchObject parseDefArchFromStream(BufferedReader myInput, ArchObject def_arch, String line, String arch_name, int index) { + @Nullable public ArchObject parseDefArchFromStream(BufferedReader myInput, ArchObject def_arch, String line, String arch_name, int index) { String thisLine; // read line with trimmed spaces String thisLine2; // read line, original spaces String oldCath, newCath; // display cathegory Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-05-31 21:39:59 UTC (rev 103) @@ -60,6 +60,7 @@ import javax.swing.JPanel; import javax.swing.JProgressBar; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * The <code>ArchObjectStack</code> contains all the default arches. @@ -142,7 +143,7 @@ return archHashTable; } - public ImageIcon getFace(int i) { + @Nullable public ImageIcon getFace(int i) { if (i >= 0 && i < faceListCount) { return faceObjects[i].getFace(); } @@ -150,7 +151,7 @@ return null; } - public String getFaceName(int i) { + @Nullable public String getFaceName(int i) { if (i >= 0 && i < faceListCount) { return faceObjects[i].getName(); } @@ -166,7 +167,7 @@ return faceListCount; } - public ArchObjectNode getNextNode(ArchObjectNode node) { + @Nullable public ArchObjectNode getNextNode(ArchObjectNode node) { if (node == null) { return archNodeList[0]; } @@ -179,7 +180,7 @@ return null; } - public ArchObject getArch(int i) { + @Nullable public ArchObject getArch(int i) { if (i >= 0 && i < archNodeListCount) { return archNodeList[i].arch; } @@ -187,7 +188,7 @@ return null; } - public ArchObject newArchObjectInstance(int i) { + @Nullable public ArchObject newArchObjectInstance(int i) { if (i < 0 && i >= archNodeListCount) { return null; } Modified: trunk/crossfire/src/cfeditor/filter/NamedFilterList.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/NamedFilterList.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/filter/NamedFilterList.java 2006-05-31 21:39:59 UTC (rev 103) @@ -372,13 +372,13 @@ components.add(fc); } - public JComponent getMenuBarComponent() { + @Override public JComponent getMenuBarComponent() { JMenu menu = new JMenu(getName()); populateComponent(menu); return menu; } - public JComponent getMenuItemComponent() { + @Override public JComponent getMenuItemComponent() { JMenu menu = new JMenu(getName()); populateComponent(menu); return menu; @@ -394,7 +394,7 @@ public btnPopup() { btn.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { + @Override public void mousePressed(MouseEvent e) { ppm.show(btn, e.getX(), e.getY()); } }); @@ -405,7 +405,7 @@ } } - public JComponent getToolbarComponent() { + @Override public JComponent getToolbarComponent() { return new btnPopup().getButton(); } @@ -427,10 +427,10 @@ } } - protected void update() { + @Override protected void update() { } - protected void updateItem(JComponent item) { + @Override protected void updateItem(JComponent item) { } } } Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-05-31 21:39:59 UTC (rev 103) @@ -38,6 +38,7 @@ import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * @author tchize @@ -254,7 +255,7 @@ /* (non-Javadoc) * @see javax.swing.ComboBoxEditor#getItem() */ - public Object getItem() { + @Nullable public Object getItem() { // TODO Auto-generated method stub return null; } @@ -407,7 +408,7 @@ /* This is the only method defined by ListCellRenderer. We just * reconfigure the Jlabel each time we're called. */ - public Component getListCellRendererComponent(JList list, + @Override public Component getListCellRendererComponent(JList list, Object value, // value to display int index, // cell index boolean iss, // is the cell selected Modified: trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java 2006-05-31 21:39:59 UTC (rev 103) @@ -100,7 +100,7 @@ setSelectedComponent(component); } - public void addTab(String title, Component component) { + @Override public void addTab(String title, Component component) { addTab(title, component, true); } @@ -108,7 +108,7 @@ protected class ClosingListener extends MouseAdapter { - public void mouseReleased(MouseEvent e) { + @Override public void mouseReleased(MouseEvent e) { int i = getSelectedIndex(); // nothing selected Modified: trunk/crossfire/src/cfeditor/gui/ScriptManager.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-05-31 21:39:59 UTC (rev 103) @@ -30,6 +30,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * @author tchize @@ -76,7 +77,7 @@ getController().addChangeListener(l); } - public Object getElementAt(int index) { + @Nullable public Object getElementAt(int index) { try { return ctrl.getScript(index); } catch (Exception e) { Modified: trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java 2006-05-31 21:39:59 UTC (rev 103) @@ -10,6 +10,7 @@ import java.util.LinkedHashMap; import java.util.Set; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; public class AggregateMenuLocation extends SimpleMenuLocation { @@ -57,7 +58,7 @@ return location; } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { if (obj instanceof WrappedMenuLocation) { WrappedMenuLocation loc = (WrappedMenuLocation) obj; return ((loc.name == null ? name == null : loc.equals(name)) && @@ -66,7 +67,7 @@ return false; } - public int hashCode() { + @Override public int hashCode() { return (name == null ? 0 : name.hashCode()) + (location == null ? 0 : location.hashCode()); } @@ -106,7 +107,7 @@ * @param location The location name. This should not include the * AggregateMenuLocation name as parent. It is a relative path. */ - public MenuLocation getMenuLocation(String location) { + @Nullable public MenuLocation getMenuLocation(String location) { WrappedMenuLocation wml = (WrappedMenuLocation) subMenus.get(location); if (wml != null) { return wml.getLocation(); @@ -115,7 +116,7 @@ } } - public boolean contains(MenuEntry entry) { + @Override public boolean contains(MenuEntry entry) { if (super.contains(entry)) { return true; } @@ -128,7 +129,7 @@ return false; } - public void setMenuManager(MenuManager menuManager) { + @Override public void setMenuManager(MenuManager menuManager) { if (log.isDebugEnabled()) { log.debug("Setting menu Manager for " + getName()); } Modified: trunk/crossfire/src/cfeditor/menu/BasicAction.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/BasicAction.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/menu/BasicAction.java 2006-05-31 21:39:59 UTC (rev 103) @@ -67,7 +67,7 @@ putValue(MNEMONIC_KEY, new Integer(key)); } - public Object getValue(String key) { + @Override public Object getValue(String key) { if (log.isDebugEnabled()) { log.debug("getValue(" + key + ") -> " + super.getValue(key)); } Modified: trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-05-31 21:39:59 UTC (rev 103) @@ -126,7 +126,7 @@ log.debug("Acton performed done"); } - protected void fireUpdate() { + @Override protected void fireUpdate() { log.debug("fireUpdate()"); getBasicAction().setName(getName()); getBasicAction().setActionCommand(getName()); Modified: trunk/crossfire/src/cfeditor/menu/CheckBoxMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/CheckBoxMenuEntry.java 2006-05-31 21:19:48 UTC (rev 102) +++ trunk/crossfire/src/cfeditor/menu/CheckBoxMenuEntry.java 2006-05-31 21:39:59 UTC (rev 103) @@ -55,11 +55,11 @@ } } - protected void update() { + @Override protected void update() { //getModel().setSelected(isChecked()); } - protected void updateItem(JComponent item) { + @Override protected void updateItem(JComponent item) { defaultUpdateItem(item); if (item instanceof JCheckBoxMenuItem) { ((JCheckBoxMenuItem) item).setSelected(isChecked()); @@ -69,11 +69,11 @@ } } - public JComponent getMenuBarComponent() { + @Override public JComponent getMenuBarComponent() { return new JPanel(); // no supported } - public JComponent getMenuItemComponent() { + @Override public JComponent getMenuItemComponent() { log.debug("getMenuItemComponent()"); JCheckBoxMenuItem chk = new JCheckBoxMenuItem(); initItem(chk); @@ -81,14 +81,14 @@ return chk; } - ... [truncated message content] |
From: <der...@us...> - 2006-05-31 22:05:30
|
Revision: 104 Author: derdanny Date: 2006-05-31 15:05:15 -0700 (Wed, 31 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=104&view=rev Log Message: ----------- Deleted multiple @Nullable annotations. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/PluginParameterFactory.java trunk/crossfire/src/cfeditor/arch/ArchObject.java trunk/crossfire/src/cfeditor/parameter/ArchParameter.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java trunk/crossfire/src/cfeditor/textedit/textarea/DefaultInputHandler.java Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-31 21:39:59 UTC (rev 103) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-31 22:05:15 UTC (rev 104) @@ -695,7 +695,7 @@ * If nothing is selected, null is returned. * @throws CGridderException when user selected an invalid treasurelist (e.g. a god-list) */ - @Nullable @Nullable private String getSelectedTreasureList() throws CGridderException { + @Nullable private String getSelectedTreasureList() throws CGridderException { // return null when nothing is selected if (isSelectionEmpty()) { return null; Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-31 21:39:59 UTC (rev 103) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-05-31 22:05:15 UTC (rev 104) @@ -966,7 +966,7 @@ * @param initial the view position to show initially * @return The map controller to manipulate this map. */ - @Nullable @Nullable @Nullable public CMapControl openFile(File file, boolean show, Point initial) { + @Nullable public CMapControl openFile(File file, boolean show, Point initial) { ArchObject start; MapArchObject maparch; CMapControl control = null; Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-05-31 21:39:59 UTC (rev 103) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-05-31 22:05:15 UTC (rev 104) @@ -408,7 +408,7 @@ * @return a <code>Point</code> array containing the coords of the tiles * which need to be redrawn */ - @Nullable @Nullable Point[] calcArchRedraw(ArchObject arch) { + @Nullable Point[] calcArchRedraw(ArchObject arch) { if (arch == null) { // safety check return null; } Modified: trunk/crossfire/src/cfeditor/PluginParameterFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/PluginParameterFactory.java 2006-05-31 21:39:59 UTC (rev 103) +++ trunk/crossfire/src/cfeditor/PluginParameterFactory.java 2006-05-31 22:05:15 UTC (rev 104) @@ -50,7 +50,7 @@ return createParameter(parameterNode.getChildText("type"), parameterNode); } - @Nullable @Nullable public static PluginParameter createParameter(String type) { + @Nullable public static PluginParameter createParameter(String type) { if (type == null) { type = "java.lang.String"; } @@ -73,7 +73,7 @@ } } - @Nullable @Nullable public static PluginParameter createParameter(String type, Element parameterNode) { + @Nullable public static PluginParameter createParameter(String type, Element parameterNode) { if (type == null) { type = "java.lang.String"; } Modified: trunk/crossfire/src/cfeditor/arch/ArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-05-31 21:39:59 UTC (rev 103) +++ trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-05-31 22:05:15 UTC (rev 104) @@ -1384,7 +1384,7 @@ * @return A String with all lines which don't match the type-definitions.<br> * If no such "errors" encountered, null is returned. */ - @Nullable @Nullable public String getSyntaxErrors(CFArchType type) { + @Nullable public String getSyntaxErrors(CFArchType type) { ArchObject defarch = getDefaultArch(); if (typelist != null && archText != null && archText.length() > 0) { Modified: trunk/crossfire/src/cfeditor/parameter/ArchParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/ArchParameter.java 2006-05-31 21:39:59 UTC (rev 103) +++ trunk/crossfire/src/cfeditor/parameter/ArchParameter.java 2006-05-31 22:05:15 UTC (rev 104) @@ -30,7 +30,7 @@ parameterType = getParameterType(); } - @Nullable @Nullable private ArchObject locateArch(String name) { + @Nullable private ArchObject locateArch(String name) { ArchObjectStack stack = CMainControl.getInstance().getArchObjectStack(); if (ArchObjectStack.getLoadStatus() != ArchObjectStack.IS_COMPLETE) { return null; Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java 2006-05-31 21:39:59 UTC (rev 103) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java 2006-05-31 22:05:15 UTC (rev 104) @@ -341,7 +341,7 @@ /** * @return file path of active tab, null if no path is available */ - @Nullable @Nullable final String getActiveFilePath() { + @Nullable final String getActiveFilePath() { if (view != null && opened != null && view.getSelectedIndex() >= 0 && opened.size() > 0) { // get stored path final String path = (String) opened.elementAt(view.getSelectedIndex()); Modified: trunk/crossfire/src/cfeditor/textedit/textarea/DefaultInputHandler.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/textarea/DefaultInputHandler.java 2006-05-31 21:39:59 UTC (rev 103) +++ trunk/crossfire/src/cfeditor/textedit/textarea/DefaultInputHandler.java 2006-05-31 22:05:15 UTC (rev 104) @@ -260,7 +260,7 @@ * <code>KeyEvent</code> class, without the <code>VK_</code> prefix. * @param keyStroke a string description of the key stroke */ - @Nullable @Nullable @Nullable public static KeyStroke parseKeyStroke(final String keyStroke) { + @Nullable public static KeyStroke parseKeyStroke(final String keyStroke) { if (keyStroke == null) { return null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <der...@us...> - 2006-06-01 23:55:56
|
Revision: 106 Author: derdanny Date: 2006-06-01 16:09:01 -0700 (Thu, 01 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=106&view=rev Log Message: ----------- Changed some int x/y and width/height pairs to Point and Dimension. Added some final modifiers. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapControl.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/CMapModel.java trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CMapViewIFrame.java trunk/crossfire/src/cfeditor/CNewMapDialog.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/MapArchObject.java trunk/crossfire/src/cfeditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-06-01 00:15:21 UTC (rev 105) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-06-01 23:09:01 UTC (rev 106) @@ -34,6 +34,7 @@ import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; +import java.awt.Dimension; import java.io.File; import java.io.IOException; import java.util.Enumeration; @@ -428,8 +429,8 @@ getPlainFont().getSize()) > 13; } - void setMapAndArchPosition(int archid, int x, int y) { - currentMap.getMapView().setMapAndArchPosition(archid, x, y); + void setMapAndArchPosition(final int archid, final Point pos) { + currentMap.getMapView().setMapAndArchPosition(archid, pos); } /** @@ -573,23 +574,22 @@ return JFontChooser.msgToHtml(msg, getPlainFont()); } - boolean addArchToMap(int archnr, int mapx, int mapy, int intern, boolean join) { - return currentMap.addArchToMap(archnr, mapx, mapy, intern, join); + boolean addArchToMap(final int archnr, final Point pos, final int intern, final boolean join) { + return currentMap.addArchToMap(archnr, pos, intern, join); } - boolean insertArchToMap(ArchObject newarch, int archnr, ArchObject next, int mapx, int mapy, boolean join) { - return currentMap.insertArchToMap(newarch, archnr, next, mapx, mapy, join); + boolean insertArchToMap(final ArchObject newarch, final int archnr, final ArchObject next, final Point pos, final boolean join) { + return currentMap.insertArchToMap(newarch, archnr, next, pos, join); } - public void deleteMapArch(int index, int mapx, int mapy, boolean refreshMap, boolean join) { - currentMap.deleteMapArch(index, mapx, mapy, refreshMap, join); + public void deleteMapArch(final int index, final Point pos, final boolean refreshMap, final boolean join) { + currentMap.deleteMapArch(index, pos, refreshMap, join); } - public ArchObject getMapArch(int index, int mapx, int mapy) { - return currentMap.getMapArch(index, mapx, mapy); + public ArchObject getMapArch(final int index, final Point pos) { + return currentMap.getMapArch(index, pos); } - public CMainView getMainView() { return mainView; } @@ -1322,17 +1322,16 @@ * @param archText map text * @param loreText lore text * @param strMapTitle map name - * @param mapWidth width of map - * @param mapHeight height of map + * @param mapSize size of map */ - void setLevelProperties(CMapControl level, String archText, String loreText, String strMapTitle, int mapWidth, int mapHeight) { + void setLevelProperties(final CMapControl level, final String archText, final String loreText, final String strMapTitle, final Dimension mapSize) { if (level != null) { - level.setProperties(archText, loreText, strMapTitle, mapWidth, mapHeight); + level.setProperties(archText, loreText, strMapTitle, mapSize); refreshMenusAndToolbars(); } } - void setPickmapsLocked(boolean state) { + void setPickmapsLocked(final boolean state) { pickmapsLocked = state; } @@ -1358,7 +1357,6 @@ ArchObject exit; // selected exit object CMapControl oldmap; // store control of active map (to evt. close it later) String path; // exit path - int dx, dy; // exit destination coords. exit = currentMap.getMapModel().getExit(); @@ -1369,16 +1367,17 @@ } path = exit.getAttributeString("slaying", getArch(exit.getNodeNr())); - dx = exit.getAttributeValue("hp", getArch(exit.getNodeNr())); - dy = exit.getAttributeValue("sp", getArch(exit.getNodeNr())); + final Point exitPos = new Point(); + exitPos.x = exit.getAttributeValue("hp", getArch(exit.getNodeNr())); + exitPos.y = exit.getAttributeValue("sp", getArch(exit.getNodeNr())); if (path.length() == 0 || (currentMap.getMapFile() != null && path.equals(currentMap.getMapFile().getName()))) { // path points to the same map - if (dx == 0 && dy == 0) { + if (exitPos.x == 0 && exitPos.y == 0) { showMessage("Destination Invalid", "This exit points nowhere."); - } else if (currentMap.pointValid(dx, dy)) { - currentMap.getMapView().setHotspot(dx, dy); + } else if (currentMap.pointValid(exitPos)) { + currentMap.getMapView().setHotspot(exitPos.x, exitPos.y); } else { showMessage("Destination Invalid", "The destination of this exit is outside the map."); } @@ -1407,12 +1406,12 @@ oldmap = currentMap; // store old map control openFile(newfile); // open the new map - if (dx == 0 && dy == 0) { + if (exitPos.x == 0 && exitPos.y == 0) { // use the entry point defined by the map header - dx = currentMap.getMapModel().getMapArchObject().getEnterX(); - dy = currentMap.getMapModel().getMapArchObject().getEnterY(); + exitPos.x = currentMap.getMapModel().getMapArchObject().getEnterX(); + exitPos.y = currentMap.getMapModel().getMapArchObject().getEnterY(); } - currentMap.getMapView().setHotspot(dx, dy); // set hotspot + currentMap.getMapView().setHotspot(exitPos.x, exitPos.y); // set hotspot // Update the main view so the new map instantly pops up. mainView.update(mainView.getGraphics()); @@ -1420,7 +1419,7 @@ closeLevel(oldmap, false); // close the old map } if (log.isDebugEnabled()) { - log.debug("exit: '" + path + "' " + dx + ", " + dy); + log.debug("exit: '" + path + "' " + exitPos.x + ", " + exitPos.y); } } Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-06-01 00:15:21 UTC (rev 105) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-06-01 23:09:01 UTC (rev 106) @@ -303,8 +303,8 @@ if (pmap != null && pmap.getMapView().isHighlight()) { // now try to get the topmost object ArchObject arch = null; - if (pmap.pointValid(pmap.getMapView().getHighlightStart().x, pmap.getMapView().getHighlightStart().y)) { - arch = pmap.getMapModel().getBottomArchObject(pmap.getMapView().getHighlightStart().x, pmap.getMapView().getHighlightStart().y); + if (pmap.pointValid(pmap.getMapView().getHighlightStart())) { + arch = pmap.getMapModel().getBottomArchObject(pmap.getMapView().getHighlightStart()); } if (arch != null) { // so here we return the arch from the pickmap Modified: trunk/crossfire/src/cfeditor/CMapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapControl.java 2006-06-01 00:15:21 UTC (rev 105) +++ trunk/crossfire/src/cfeditor/CMapControl.java 2006-06-01 23:09:01 UTC (rev 106) @@ -28,6 +28,7 @@ import cfeditor.arch.ArchObjectIterator; import cfeditor.arch.ArchObjectIteratorDeleteMapArch; import java.awt.Point; +import java.awt.Dimension; import java.io.File; import java.util.Iterator; @@ -143,12 +144,14 @@ */ public void addEditType(int newType) { // calculate only if needed + final Dimension size = mapModel.getMapSize(); + final Point pos = new Point(); if (!hasEditType(newType)) { - for (int posx = 0; posx < mapModel.getMapWidth(); posx++) { - for (int posy = 0; posy < mapModel.getMapHeight(); posy++) { - Iterator it = mapModel.getArchObjects(posx, posy); + for (pos.x = 0; pos.x < size.width; pos.x++) { + for (pos.y = 0; pos.y < size.height; pos.y++) { + final Iterator it = mapModel.getArchObjects(pos); while (it.hasNext()) { - ArchObject arch = (ArchObject) it.next(); + final ArchObject arch = (ArchObject) it.next(); // calculate the new edit type if (arch.getRefFlag() && arch.getMapMultiHead() != null) { // multi tails get the value from their head @@ -220,65 +223,72 @@ mapModel.freeMapArchObject(); } - boolean addArchToMap(int archnr, int mapx, int mapy, int intern, boolean join, - boolean insertBelow) { - return mapModel.addArchToMap(archnr, mapx, mapy, intern, join, insertBelow); + boolean addArchToMap(final int archnr, final Point pos, final int intern, final boolean join, final boolean insertBelow) { + return mapModel.addArchToMap(archnr, pos, intern, join, insertBelow); } /** wrapper method for addArchToMap, always inserting new arches on top */ - public boolean addArchToMap(int archnr, int xx, int yy, int intern, boolean join) { - return addArchToMap(archnr, xx, yy, intern, join, false); + public boolean addArchToMap(final int archnr, final Point pos, final int intern, final boolean join) { + return addArchToMap(archnr, pos, intern, join, false); } - public boolean insertArchToMap(ArchObject newarch, int archnr, ArchObject next, int mapx, int mapy, boolean join) { - return mapModel.insertArchToMap(newarch, archnr, next, mapx, mapy, join); + /** wrapper method for addArchToMap, always inserting new arches on top */ + @Deprecated public boolean addArchToMap(int archnr, int xx, int yy, int intern, boolean join) { + return addArchToMap(archnr, new Point(xx, yy), intern, join, false); } + public boolean insertArchToMap(final ArchObject newarch, final int archnr, final ArchObject next, final Point pos, final boolean join) { + return mapModel.insertArchToMap(newarch, archnr, next, pos, join); + } + public void addArchObjectToMap(ArchObject arch, boolean insertBelow) { mapModel.addArchObjectToMap(arch, insertBelow); } - public void addArchObjectToMap(ArchObject arch) { + public void addArchObjectToMap(final ArchObject arch) { mapModel.addArchObjectToMap(arch, false); } - public void deleteMapArch(int index, int mapx, int mapy, - boolean refreshMap, boolean join) { - mapModel.deleteMapArch(index, mapx, mapy, refreshMap, join); + public void deleteMapArch(final int index, final Point pos, final boolean refreshMap, final boolean join) { + mapModel.deleteMapArch(index, pos, refreshMap, join); } - public ArchObject getMapArch(int index, int mapx, int mapy) { - return mapModel.getMapArch(index, mapx, mapy); + public ArchObject getMapArch(final int index, final Point pos) { + return mapModel.getMapArch(index, pos); } - public String getMapTilePath(int direction) { + public String getMapTilePath(final int direction) { return mapModel.getMapArchObject().getTilePath(direction); } - public ArchObjectIterator getArchObjects(int x, int y) { - return mapModel.getArchObjects(x, y); + public ArchObjectIterator getArchObjects(final Point pos) { + return mapModel.getArchObjects(pos); } - public ArchObjectIteratorDeleteMapArch getArchObjectsDeleteMapArch(int x, int y, boolean refreshMap, boolean join) { - return mapModel.getArchObjectsDeleteMapArch(x, y, refreshMap, join); + public ArchObjectIteratorDeleteMapArch getArchObjectsDeleteMapArch(final Point pos, final boolean refreshMap, final boolean join) { + return mapModel.getArchObjectsDeleteMapArch(pos, refreshMap, join); } - public boolean containsArchObject(int x, int y) { - return mapModel.containsArchObject(x, y); + public boolean containsArchObject(final Point pos) { + return mapModel.containsArchObject(pos); } - public ArchObject getBottomArchObject(int x, int y) { - return mapModel.getBottomArchObject(x, y); + @Deprecated public boolean containsArchObject(final int x, final int y) { + return containsArchObject(new Point(x, y)); } - public ArchObject getTopArchObject(int x, int y) { - return mapModel.getTopArchObject(x, y); + public ArchObject getBottomArchObject(final Point pos) { + return mapModel.getBottomArchObject(pos); } - public void setArchObject(int x, int y, ArchObject arch) { - mapModel.setArchObject(x, y, arch); + public ArchObject getTopArchObject(final Point pos) { + return mapModel.getTopArchObject(pos); } + public void setArchObject(final Point pos, final ArchObject arch) { + mapModel.setArchObject(pos, arch); + } + /** * Returns whether the level has changed since it was last saved or not. * @return True if level has changed, false if not. @@ -302,14 +312,12 @@ * @param archText map text * @param loreText lore text * @param strMapTitle map name - * @param mapWidth width of map - * @param mapHeight height of map + * @param newSize size of map */ - protected void setProperties(String archText, String loreText, String strMapTitle, - int mapWidth, int mapHeight) { + protected void setProperties(final String archText, final String loreText, String strMapTitle, final Dimension newSize) { // resize this map - if (mapWidth != getMapWidth() || mapHeight != getMapHeight()) { - resizeMap(mapWidth, mapHeight); + if (!newSize.equals(getMapSize())) { + resizeMap(newSize); } setNewMapText(archText); // change map text @@ -375,19 +383,27 @@ } /** + * Returns the map size of the mapModel. + * @return map size. + */ + public Dimension getMapSize() { + return mapModel.getMapSize(); + } + + /** * Returns the width of the level. * @return map width. */ - public int getMapWidth() { - return mapModel.getMapWidth(); + @Deprecated public int getMapWidth() { + return getMapSize().width; } /** * Returns the height of the level. * @return map height. */ - public int getMapHeight() { - return mapModel.getMapHeight(); + @Deprecated public int getMapHeight() { + return getMapSize().height; } /** @@ -405,9 +421,9 @@ // TODO implement this int getDisplayMapWidth() { if (showTiles) { - return mapModel.getMapWidth() + eastWidth + westWidth; + return mapModel.getMapSize().width + eastWidth + westWidth; } else { - return mapModel.getMapWidth(); + return mapModel.getMapSize().width; } } @@ -417,9 +433,9 @@ */ int getDisplayMapHeight() { if (showTiles) { - return mapModel.getMapWidth() + northHeight + southHeight; + return mapModel.getMapSize().height + northHeight + southHeight; } else { - return mapModel.getMapHeight(); + return mapModel.getMapSize().height; } } @@ -445,28 +461,30 @@ } } + @Deprecated public boolean pointValid(final int posx, final int posy) { + return pointValid(new Point(posx, posy)); + } + /** * Check if the coordinates posx, posy are valid (located within the * borders of the map). - * @param posx x coordinate - * @param posy y coordinate + * @param pos coordinate to check. * @return true if this point is located within the map boundaries */ - public boolean pointValid(int posx, int posy) { - return mapModel.pointValid(posx, posy); + public boolean pointValid(final Point pos) { + return mapModel.pointValid(pos); } - public boolean checkResizeMap(int newWidth, int newHeight) { - return mapModel.checkResizeMap(newWidth, newHeight); + public boolean checkResizeMap(final Dimension dim) { + return mapModel.checkResizeMap(dim); } /** * Resize the map. - * @param newWidth the new level width. - * @param newHeight the new level height. + * @param size the new level size. */ - void resizeMap(int newWidth, int newHeight) { - mapModel.resizeMap(newWidth, newHeight); + void resizeMap(final Dimension size) { + mapModel.resizeMap(size); } /** @return The level name. */ Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-01 00:15:21 UTC (rev 105) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-01 23:09:01 UTC (rev 106) @@ -36,6 +36,8 @@ import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; +import java.awt.Dimension; +import java.awt.Point; import org.apache.log4j.Logger; /** @@ -82,11 +84,13 @@ map.writeMapArch(bufferedWriter); // first, write all one tile parts - for (int x = 0; x < map.getWidth(); x++) { - for (int y = 0; y < map.getHeight(); y++) { - Iterator it = mapModel.getArchObjects(x, y); + final Dimension size = map.getMapSize(); + final Point pos = new Point(); + for (pos.x = 0; pos.x < size.width; pos.x++) { + for (pos.y = 0; pos.y < size.height; pos.y++) { + final Iterator it = mapModel.getArchObjects(pos); while (it.hasNext()) { - ArchObject node = (ArchObject) it.next(); + final ArchObject node = (ArchObject) it.next(); // only non muli suckers if (node.getMapMultiHead() == null && node.getMapMultiNext() == null) { if (!writeMapArch(node, false)) { @@ -98,11 +102,11 @@ } // second, we drop the multi part suckers out - for (int x = 0; x < map.getWidth(); x++) { - for (int y = 0; y < map.getHeight(); y++) { - Iterator it = mapModel.getArchObjects(x, y); + for (pos.x = 0; pos.x < size.width; pos.x++) { + for (pos.y = 0; pos.y < size.height; pos.y++) { + final Iterator it = mapModel.getArchObjects(pos); while (it.hasNext()) { - ArchObject node = (ArchObject) it.next(); + final ArchObject node = (ArchObject) it.next(); // search only for heads! if (node.getRefCount() > 0 && node.getMapMultiNext() != null) { /* old version: Both heads and tails got written into the mapfile Modified: trunk/crossfire/src/cfeditor/CMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapModel.java 2006-06-01 00:15:21 UTC (rev 105) +++ trunk/crossfire/src/cfeditor/CMapModel.java 2006-06-01 23:09:01 UTC (rev 106) @@ -33,6 +33,7 @@ import cfeditor.filter.NamedFilterConfig; import cfeditor.filter.NamedFilterList; import java.awt.Point; +import java.awt.Dimension; import java.util.Iterator; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -61,12 +62,9 @@ */ private ArchObject[][] m_mapGrid; - /** The width of the level (in tiles). Is always positive. */ - private int m_mapWidth; + /** Size of this map. */ + private final Dimension mapSize = new Dimension(); - /** The height of the level (in tiles). Is always positive. */ - private int m_mapHeight; - /** Flag that indicates if the level has been changed since last save. */ private boolean m_fLevelChanged = false; @@ -85,15 +83,13 @@ public CMapModel(final CMainControl mc, final CMapControl control, final MapArchObject map) { m_main_control = mc; m_control = control; - m_mapWidth = map.getWidth(); - m_mapHeight = map.getHeight(); + mapSize.setSize(map.getMapSize()); - m_mapGrid = initMap(m_mapWidth, m_mapHeight); + m_mapGrid = initMap(); m_mapArch = map; - setMapX(m_mapWidth); - setMapY(m_mapHeight); + m_mapArch.setMapSize(mapSize); } /** @@ -102,14 +98,13 @@ * @return the ArchObject to show; the object(s) must not be modified */ @Nullable public ArchObject getMouseRightPosObject() { - final int mx = m_control.getMapView().getMapMouseRightPos().x; - final int my = m_control.getMapView().getMapMouseRightPos().y; + final Point pos = m_control.getMapView().getMapMouseRightPos(); - if (mx == -1 || my == -1 || !pointValid(mx, my)) { + if (pos.x == -1 || pos.y == -1 || !pointValid(pos)) { return null; } - return m_mapGrid[mx][my]; + return m_mapGrid[pos.x][pos.y]; } /** @@ -130,22 +125,6 @@ } /** - * Update the map width. - * @param len the new map width - */ - public void setMapX(final int len) { - m_mapArch.setWidth(len); - } - - /** - * Update the map height. - * @param len the new map height - */ - public void setMapY(final int len) { - m_mapArch.setHeight(len); - } - - /** * Place a list of arches onto the map. * @param arch the head of the arches list; may be null to insert nothing */ @@ -211,90 +190,128 @@ * Return the width of the level. * @return the width of the level */ - public int getMapWidth() { - return m_mapWidth; + @Deprecated public int getMapWidth() { + return mapSize.width; } /** * Returns the height of the level. * @return The height of the level. */ - int getMapHeight() { - return m_mapHeight; + @Deprecated public int getMapHeight() { + return mapSize.height; } + /** Return the map size of this level. + * @return Map size of this level. + */ + public Dimension getMapSize() { + return mapSize; + } + /** * Return the bottom {@link ArchObject} in the given location. * @return the ArchObject, or null if no object is present */ - @Nullable public ArchObject getBottomArchObject(final int x, final int y) { - if (!pointValid(x, y)) { + @Deprecated @Nullable public ArchObject getBottomArchObject(final int x, final int y) { + return getBottomArchObject(new Point(x, y)); + } + + /** + * Return the bottom {@link ArchObject} in the given location. + * @return the ArchObject, or null if no object is present + */ + @Nullable public ArchObject getBottomArchObject(final Point pos) { + if (!pointValid(pos)) { return null; } - return m_mapGrid[x][y]; + return m_mapGrid[pos.x][pos.y]; } + @Deprecated public ArchObject getTopArchObject(final int x, final int y) { + return getTopArchObject(new Point(x, y)); + } + /** * Return the topmost {@link ArchObject} in the given location. * @return the ArchObject, or null if no object is present */ - public ArchObject getTopArchObject(final int x, final int y) { - ArchObject result = getBottomArchObject(x, y); + public ArchObject getTopArchObject(final Point pos) { + ArchObject result = getBottomArchObject(pos); while (result != null && result.getNextArch() != null) { result = result.getNextArch(); } return result; } + @Deprecated public void setArchObject(final int x, final int y, final ArchObject arch) { + setArchObject(new Point(x, y), arch); + } + /** Save a map square to the given ArchObject. */ - public void setArchObject(final int x, final int y, final ArchObject arch) { - if (!pointValid(x, y)) { + public void setArchObject(final Point pos, final ArchObject arch) { + if (!pointValid(pos)) { throw new IllegalArgumentException(); } if (arch == null) { throw new IllegalArgumentException(); } - m_mapGrid[x][y] = arch; + m_mapGrid[pos.x][pos.y] = arch; } /** * Return an Iterator of all ArchObjects in the given location. The * Iterator supports deleting objects. */ - public ArchObjectIteratorDeleteMapArch getArchObjectsDeleteMapArch(final int x, final int y, final boolean refreshMap, final boolean join) { - return new ArchObjectIteratorDeleteMapArch(this, getBottomArchObject(x, y), x, y, refreshMap, join); + @Deprecated public ArchObjectIteratorDeleteMapArch getArchObjectsDeleteMapArch(final int x, final int y, final boolean refreshMap, final boolean join) { + return getArchObjectsDeleteMapArch(new Point(x, y), refreshMap, join); } /** * Return an Iterator of all ArchObjects in the given location. The * Iterator supports deleting objects. */ - public ArchObjectIteratorDeleteArchMapObject getArchObjectsDeleteArchMapObject(final int x, final int y) { - return new ArchObjectIteratorDeleteArchMapObject(this, getBottomArchObject(x, y)); + public ArchObjectIteratorDeleteMapArch getArchObjectsDeleteMapArch(final Point pos, final boolean refreshMap, final boolean join) { + return new ArchObjectIteratorDeleteMapArch(this, getBottomArchObject(pos), pos.x, pos.y, refreshMap, join); } + /** + * Return an Iterator of all ArchObjects in the given location. The + * Iterator supports deleting objects. + */ + public ArchObjectIteratorDeleteArchMapObject getArchObjectsDeleteArchMapObject(final Point pos) { + return new ArchObjectIteratorDeleteArchMapObject(this, getBottomArchObject(pos)); + } + /** Return an Iterator of all ArchObjects in the given location. */ - public ArchObjectIterator getArchObjects(final int x, final int y) { - return new ArchObjectIterator(getBottomArchObject(x, y)); + @Deprecated public ArchObjectIterator getArchObjects(final int x, final int y) { + return getArchObjects(new Point(x, y)); } + /** Return an Iterator of all ArchObjects in the given location. */ + public ArchObjectIterator getArchObjects(final Point pos) { + return new ArchObjectIterator(getBottomArchObject(pos)); + } /** Check whether a given location contains at least one ArchObject. */ - public boolean containsArchObject(final int x, final int y) { - return pointValid(x, y) && m_mapGrid[x][y] != null; + @Deprecated public boolean containsArchObject(final int x, final int y) { + return containsArchObject(new Point(x, y)); } + /** Check whether a given location contains at least one ArchObject. */ + public boolean containsArchObject(final Point pos) { + return pointValid(pos) && m_mapGrid[pos.x][pos.y] != null; + } + /** * Create an empty map grid. - * @param width the width of the new map - * @param height the height of the new map * @return the empty map grid */ - private ArchObject[][] initMap(final int width, final int height) { - final ArchObject[][] map = new ArchObject[width][height]; - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { + private ArchObject[][] initMap() { + final ArchObject[][] map = new ArchObject[mapSize.width][mapSize.height]; + for (int y = 0; y < mapSize.height; y++) { + for (int x = 0; x < mapSize.width; x++) { map[x][y] = null; } } @@ -316,7 +333,7 @@ for (int c = 0; c <= count; c++) { final int mapx = xx + m_main_control.getArchObjectStack().getArch(archnr + c).getRefX(); final int mapy = yy + m_main_control.getArchObjectStack().getArch(archnr + c).getRefY(); - if (mapx < 0 || mapy < 0 || mapx >= m_mapWidth || mapy >= m_mapHeight) { + if (mapx < 0 || mapy < 0 || mapx >= mapSize.width|| mapy >= mapSize.height) { // outside map return false; } @@ -420,12 +437,15 @@ } } + @Deprecated public boolean addArchToMap(final int archnr, final int xx, final int yy, final int intern, final boolean join, final boolean insert_below) { + return addArchToMap(archnr, new Point(xx, yy), intern, join, insert_below); + } + /** * Add a new arch to the map. Including multi tile arches. This function * allows only to choose from the default arches (->archnr). * @param archnr ID from a default arch on the ArchObjectStack - * @param xx insert-location on this map - * @param yy insert-location on this map + * @param pos insert-location on this map * @param intern if NOT '-1': only one arch of the same kind can be * inserted per square * @param join if set to JOIN_ENABLE auto-joining is supported; autojoining @@ -434,15 +454,15 @@ * inserted below * @return true if insertion successful, false if not */ - public boolean addArchToMap(int archnr, final int xx, final int yy, final int intern, final boolean join, final boolean insert_below) { + public boolean addArchToMap(int archnr, final Point pos, final int intern, final boolean join, final boolean insert_below) { ArchObject newarch, oldarch, startarch; // our new suckers (copys, not ref ptrs) if (archnr < 0 || archnr >= m_main_control.getArchObjectStack().getArchCount() - || xx == -1 || yy == -1 || xx >= m_mapWidth || yy >= m_mapHeight) { + || pos.x == -1 || pos.y == -1 || pos.x >= mapSize.width|| pos.y >= mapSize.height) { // invalid parameter return false; } - if (!testArchToMap(archnr, xx, yy, intern)) { + if (!testArchToMap(archnr, pos.x, pos.y, intern)) { // does not fit on map return false; } @@ -451,7 +471,7 @@ if (m_main_control.getAutojoin() && join == JOIN_ENABLE && m_main_control.getJoinlist() != null && newarch.getJoinList() != null && !newarch.isMulti()) { // do autojoining if enabled - archnr = newarch.getJoinList().join_insert(this, xx, yy); + archnr = newarch.getJoinList().join_insert(this, pos.x, pos.y); if (archnr == -1) { return false; // only one autojoin type per square allowed } @@ -462,8 +482,8 @@ oldarch = null; startarch = null; for (int c = 0; c <= count; c++) { - final int mapx = xx + m_main_control.getArchObjectStack().getArch(archnr + c).getRefX(); - final int mapy = yy + m_main_control.getArchObjectStack().getArch(archnr + c).getRefY(); + final int mapx = pos.x + m_main_control.getArchObjectStack().getArch(archnr + c).getRefX(); + final int mapy = pos.y + m_main_control.getArchObjectStack().getArch(archnr + c).getRefY(); newarch = m_main_control.getArchObjectStack().newArchObjectInstance(archnr + c); if (oldarch != null) { newarch.setMapMultiHead(startarch); @@ -509,6 +529,9 @@ return true; } + @Deprecated public boolean insertArchToMap(ArchObject newarch, int archnr, final ArchObject next, final int mapx, final int mapy, final boolean join) { + return insertArchToMap(newarch, archnr, next, new Point(mapx, mapy), join); + } /** * Insert a new arch to the map at a specified position. This function * allows either to choose from the default arches (->archnr) or to insert @@ -522,16 +545,15 @@ * @param next the new arch gets inserted before 'next' if ('next'==null) * the arch gets inserted at bottom -> 'next' must be an arch from the map! * (or null) - * @param mapx map position to insert the new arch - * @param mapy map position to insert the new arch + * @param pos map position to insert the new arch * @param join if set to JOIN_ENABLE auto-joining is supported * @return true if insertion was successful */ - public boolean insertArchToMap(ArchObject newarch, int archnr, final ArchObject next, final int mapx, final int mapy, final boolean join) { + public boolean insertArchToMap(ArchObject newarch, int archnr, final ArchObject next, final Point pos, final boolean join) { ArchObject node; // map coords must be valid - if (!m_control.pointValid(mapx, mapy)) { + if (!m_control.pointValid(pos)) { return false; } @@ -545,13 +567,13 @@ archnr = newarch.getNodeNr(); } // insert a new instance of the default arch (number 'archnr') - if (!m_control.addArchToMap(archnr, mapx, mapy, -1, join)) { + if (!m_control.addArchToMap(archnr, pos, -1, join)) { return false; } } else { // insert the given 'newarch' (multis not allowed here yet - sorry) if (!newarch.isMulti()) { - newarch = newarch.getClone(mapx, mapy); // create a clone + newarch = newarch.getClone(pos.x, pos.y); // create a clone m_control.addArchObjectToMap(newarch); // insert it to the map } else { return false; // tried to insert multi (probably from pickmap) @@ -559,7 +581,7 @@ } // jump to the end of the list (-> grab "topmost" arch) - for (node = m_mapGrid[mapx][mapy]; + for (node = m_mapGrid[pos.x][pos.y]; node != null && node.getNextArch() != null; node = node.getNextArch()) { ; @@ -583,7 +605,7 @@ } else { // create clone from a pickmap if (!newarch.isMulti()) { - invnew = newarch.getClone(mapx, mapy); + invnew = newarch.getClone(pos.x, pos.y); } else { return false; } @@ -669,23 +691,25 @@ return; } + @Deprecated @Nullable public ArchObject getMapArch(final int id, final int xx, final int yy) { + return getMapArch(id, new Point(xx, yy)); + } /** - * Get the arch from the map with the specified 'id', at location (xx, yy). - * @param xx x-location - * @param yy y-location + * Get the arch from the map with the specified 'id', at location pos. + * @param pos Location of ArchObject. * @param id ID number of arch (-> <code>arch.getMyID()</code>) * @return the specified arch, or null if not found */ - @Nullable public ArchObject getMapArch(final int id, final int xx, final int yy) { + @Nullable public ArchObject getMapArch(final int id, final Point pos) { ArchObject node; - if (m_mapGrid == null || xx < 0 || xx >= m_mapWidth || yy < 0 || yy >= m_mapHeight) { + if (m_mapGrid == null || pos.x < 0 || pos.x >= mapSize.width || pos.y < 0 || pos.y >= mapSize.height) { return null; } // first, try to find the tile we had selected node = null; - final Iterator it = getArchObjects(xx, yy); + final Iterator it = getArchObjects(pos.x, pos.y); while (it.hasNext()) { node = (ArchObject) it.next(); @@ -727,20 +751,23 @@ return null; } + @Deprecated public void deleteMapArch(final int id, final int xx, final int yy, final boolean refresh_map, final boolean join) { + deleteMapArch(id, new Point(xx, yy), refresh_map, join); + } + /** * Delete an existing arch from the map. (If the specified arch doesn't * exist, nothing happens.) (This includes deletion of multiparts and * inventory.) * @param id ID of the arch to be removed (->arch.getMyID()) - * @param xx location of the arch to be removed - * @param yy location of the arch to be removed + * @param pos location of the arch to be removed * @param refresh_map If true, mapview is redrawn after deletion. keep in * mind: drawing consumes time! * @param join if set to JOIN_ENABLE auto-joining is supported */ - public void deleteMapArch(final int id, final int xx, final int yy, final boolean refresh_map, final boolean join) { + public void deleteMapArch(final int id, final Point pos, final boolean refresh_map, final boolean join) { // first, try to find the tile we had selected - final Iterator it = getArchObjectsDeleteArchMapObject(xx, yy); + final Iterator it = getArchObjectsDeleteArchMapObject(pos); while (it.hasNext()) { final ArchObject node = (ArchObject) it.next(); @@ -752,7 +779,7 @@ if (m_main_control.getAutojoin() && join == JOIN_ENABLE && m_main_control.getJoinlist() != null && temp.getJoinList() != null && !temp.isMulti()) { // remove connections to the deleted arch - temp.getJoinList().join_delete(this, xx, yy); + temp.getJoinList().join_delete(this, pos.x, pos.y); } break; @@ -856,8 +883,8 @@ * every single ArchObject of the map... */ public void freeMapArchObject() { - for (int x = 0; x < m_mapWidth; x++) { - for (int y = 0; y < m_mapHeight; y++) { + for (int x = 0; x < mapSize.width; x++) { + for (int y = 0; y < mapSize.height; y++) { while (m_mapGrid[x][y] != null) { deleteArchMapObject(m_mapGrid[x][y]); } @@ -910,15 +937,17 @@ return m_mapArch; } + @Deprecated public boolean pointValid(final int posx, final int posy) { + return pointValid(new Point(posx, posy)); + } + /** * Check whether the given coordinate is within map bounds. - * @param posx the x-coordinate to check - * @param posy the y-coordinate to check + * @param pos the coordinates to check. * @return true=the given coordinates are within map bounds */ - public boolean pointValid(final int posx, final int posy) { - return 0 <= posx && posx < getMapWidth() - && 0 <= posy && posy < getMapHeight(); + public boolean pointValid(final Point pos) { + return pos.x >= 0 && pos.x < mapSize.width && pos.y >= 0 && pos.y < mapSize.height; } /** @@ -958,17 +987,19 @@ return exit; } + @Deprecated public boolean checkResizeMap(final int newWidth, final int newHeight) { + return checkResizeMap(new Dimension(newWidth, newHeight)); + } /** * Check if objects get cut off if the map was resized to the given bounds. - * @param newWidth the new level width. - * @param newHeight the new level height. + * @param newSize the new level size. * @return true if objects would be cut off */ - public boolean checkResizeMap(final int newWidth, final int newHeight) { - if (m_mapWidth > newWidth) { + public boolean checkResizeMap(final Dimension newSize) { + if (mapSize.width > newSize.width) { // search the right stripe (as far as being cut off) - for (int x = newWidth; x < m_mapWidth; x++) { - for (int y = 0; y < m_mapHeight; y++) { + for (int x = newSize.width; x < mapSize.width; x++) { + for (int y = 0; y < mapSize.height; y++) { if (m_mapGrid[x][y] != null) { return true; } @@ -976,10 +1007,10 @@ } } - if (m_mapHeight > newHeight) { + if (mapSize.height > newSize.height) { // search the bottom stripe (as far as being cut off) - for (int y = newHeight; y < m_mapHeight; y++) { - for (int x = 0; x < m_mapWidth; x++) { + for (int y = newSize.height; y < mapSize.height; y++) { + for (int x = 0; x < mapSize.width; x++) { if (m_mapGrid[x][y] != null) { return true; } @@ -990,20 +1021,23 @@ return false; } + @Deprecated void resizeMap(final int newWidth, final int newHeight) { + resizeMap(new Dimension(newWidth, newHeight)); + } + /** * Resize this map to the new size. If any bounds are smaller than before, * the map gets cut on the right and bottom side. Accordingly, new space is * attached to right and bottom. - * @param newWidth new map width - * @param newHeight new map height + * @param newSize new map size. */ - void resizeMap(int newWidth, int newHeight) { + void resizeMap(final Dimension newSize) { // don't allow negative values - if (newWidth < 0) { - newWidth = 0; + if (newSize.width < 0) { + newSize.width = 0; } - if (newHeight < 0) { - newHeight = 0; + if (newSize.height < 0) { + newSize.height = 0; } // no other thread may access this mapmodel while resizing @@ -1011,10 +1045,10 @@ // first delete all arches in the area that will get cut off // (this is especially important to remove all multipart-objects // reaching into that area) - if (m_mapWidth > newWidth) { + if (mapSize.width > newSize.width) { // clear out the right stripe (as far as being cut off) - for (int x = newWidth; x < m_mapWidth; x++) { - for (int y = 0; y < m_mapHeight; y++) { + for (int x = newSize.width; x < mapSize.width; x++) { + for (int y = 0; y < mapSize.height; y++) { // for every map square: delete all arches on it final Iterator it = getArchObjectsDeleteMapArch(x, y, false, false); while (it.hasNext()) { @@ -1025,12 +1059,12 @@ } } - if (m_mapHeight > newHeight) { + if (mapSize.height > newSize.height) { // clear out the bottom stripe (as far as being cut off) // (and yes, there is an area getting sweeped twice - and yes it could // be optimized you smartass - but I don't care!) - for (int y = newHeight; y < m_mapHeight; y++) { - for (int x = 0; x < m_mapWidth; x++) { + for (int y = newSize.height; y < mapSize.height; y++) { + for (int x = 0; x < mapSize.height; x++) { // for every map square: delete all arches on it final Iterator it = getArchObjectsDeleteMapArch(x, y, false, false); while (it.hasNext()) { @@ -1043,17 +1077,17 @@ // Now the critical step: create an ArchObject array of new dimension, // copy all objects and set it to replace the current one. - final ArchObject[][] newGrid = new ArchObject[newWidth][newHeight]; + final ArchObject[][] newGrid = new ArchObject[newSize.width][newSize.height]; // fill it with nulls - for (int x = 0; x < newWidth; x++) { - for (int y = 0; y < newHeight; y++) { + for (int x = 0; x < newSize.width; x++) { + for (int y = 0; y < newSize.height; y++) { newGrid[x][y] = null; } } // relink all arches to the new grid - for (int x = 0; x < Math.min(newWidth, m_mapWidth); x++) { - for (int y = 0; y < Math.min(newHeight, m_mapHeight); y++) { + for (int x = 0; x < Math.min(newSize.width, mapSize.width); x++) { + for (int y = 0; y < Math.min(newSize.height, mapSize.height); y++) { newGrid[x][y] = m_mapGrid[x][y]; } } @@ -1062,10 +1096,8 @@ m_mapGrid = newGrid; // adjust the map and model attributes - m_mapHeight = newHeight; - m_mapWidth = newWidth; - m_mapArch.setWidth(newWidth); - m_mapArch.setHeight(newHeight); + mapSize.setSize(newSize.width, newSize.height); + m_mapArch.setMapSize(newSize); // an important last point: if there is a highlighted area in a region // that got cut off - unhilight it! @@ -1103,7 +1135,7 @@ * @return whether a match was found */ public boolean filterSquare(Filter filter, FilterConfig config, int x, int y) { - if (x < 0 || y < 0 || x >= getMapWidth() || y >= getMapHeight()) { + if (x < 0 || y < 0 || x >= mapSize.width || y >= mapSize.height) { return false; } Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-01 00:15:21 UTC (rev 105) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-01 23:09:01 UTC (rev 106) @@ -186,8 +186,9 @@ createPanelLine(mapPanel, m_nameField, 16, m_level.getMapName(), "Name: "); createPanelLine(mapPanel, m_regionField, 16, map.getMapRegion(), "Region: "); - createPanelLine(mapPanel, m_levelWidthField, 10, String.valueOf(m_level.getMapWidth()), "Width: "); - createPanelLine(mapPanel, m_levelHeightField, 10, String.valueOf(m_level.getMapHeight()), "Height: "); + final Dimension mapSize = m_level.getMapSize(); + createPanelLine(mapPanel, m_levelWidthField, 10, String.valueOf(mapSize.width), "Width: "); + createPanelLine(mapPanel, m_levelHeightField, 10, String.valueOf(mapSize.height), "Height: "); createPanelCBox(mapPanel, m_unique, map.isUnique(), " Unique Map"); createPanelCBox(mapPanel, m_outdoor, map.isOutdoor(), " Outdoor Map"); createPanelCBox(mapPanel, m_fixedReset, map.isFixedReset(), " Fixed Reset"); @@ -450,7 +451,7 @@ boolean modifyTilepaths = false; // true when map tile-paths were modified // tmp variables for parsing - int t_width, t_height; + final Dimension size = new Dimension(); int t_enter_x, t_enter_y; int t_reset_timeout, t_swap_time; int t_difficulty, t_darkness; @@ -464,8 +465,8 @@ // first check if the entries are all okay try { // try to parse everything - t_width = parseProperty(m_levelWidthField.getText(), "Width"); - t_height = parseProperty(m_levelHeightField.getText(), "Height"); + size.width = parseProperty(m_levelWidthField.getText(), "Width"); + size.height = parseProperty(m_levelHeightField.getText(), "Height"); t_enter_x = parseProperty(m_enterX.getText(), "Enter X"); t_enter_y = parseProperty(m_enterY.getText(), "Enter Y"); t_swap_time = parseProperty(m_swapTime.getText(), "Swap Time"); @@ -501,7 +502,7 @@ } // Now do some sanity checks: - if (t_width < 1 || t_height < 1) { + if (size.width < 1 || size.height < 1) { m_control.showMessage( "Illegal Value", "Level dimensions must be greater than zero."); @@ -525,17 +526,16 @@ } // if the mapsize has been modified, see if we should ask for a confirm - if (m_level.checkResizeMap(t_width, t_height)) { - if (!askConfirmResize(t_width, t_height)) { + if (m_level.checkResizeMap(size)) { + if (!askConfirmResize(size)) { // resizing has been cancelled - t_width = m_level.getMapWidth(); - t_height = m_level.getMapHeight(); + size.setSize(m_level.getMapSize()); } } // now that all is well, write the new values into the maparch m_control.setLevelProperties(m_level, m_textArea.getText(), m_loreArea.getText(), - m_nameField.getText(), t_width, t_height); + m_nameField.getText(), size); map.setMapRegion(t_region); map.setEnterX(t_enter_x); @@ -665,8 +665,9 @@ m_loreArea.setText(m_level.getMapLore()); m_nameField.setText(m_level.getMapName()); m_regionField.setText("" + map.getMapRegion()); - m_levelWidthField.setText("" + map.getWidth()); - m_levelHeightField.setText("" + map.getHeight()); + final Dimension mapSize = map.getMapSize(); + m_levelWidthField.setText(String.valueOf(mapSize.width)); + m_levelHeightField.setText(String.valueOf(mapSize.height)); m_enterX.setText("" + map.getEnterX()); m_enterY.setText("" + map.getEnterY()); m_swapTime.setText("" + map.getSwapTime()); @@ -713,9 +714,9 @@ * popup dialog disables all other windows (and threads). * @return true if user confirmed, false if user cancelled resize */ - private boolean askConfirmResize(int newWidth, int newHeight) { + private boolean askConfirmResize(final Dimension size) { return JOptionPane.showConfirmDialog(this, - "You selected a new map size of " + newWidth + "x" + newHeight + ". If the map was\n" + + "You selected a new map size of " + size.width + "x" + size.height + ". If the map was\n" + "resized in this way, some objects would get cut off and deleted.\n" + "Are you really sure you want this?", "Confirm", Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-06-01 00:15:21 UTC (rev 105) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-06-01 23:09:01 UTC (rev 106) @@ -30,6 +30,7 @@ import java.awt.Component; import java.awt.GridLayout; import java.awt.Rectangle; +import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; @@ -179,7 +180,7 @@ } else if ((e.getModifiers() & MouseEvent.BUTTON3_MASK) != 0 || ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && e.isShiftDown())) { // --- right mouse button: insert arch --- - String entry; + final String entry; if ((list.locationToIndex(e.getPoint()) >= 0 || list.getModel().getSize() > 0) && mainControl.getArchPanelSelection() != null) { @@ -191,16 +192,17 @@ entry = model.getElementAt(list.locationToIndex(e.getPoint())).toString(); } - int num = Integer.parseInt(entry.substring(0, 10)); - int mapx = Integer.parseInt(entry.substring(10, 20)); - int mapy = Integer.parseInt(entry.substring(20, 30)); + final int num = Integer.parseInt(entry.substring(0, 10)); + final Point pos = new Point(); + pos.x = Integer.parseInt(entry.substring(10, 20)); + pos.y = Integer.parseInt(entry.substring(20, 30)); // find the lowest Y-coord. in list, to see if selection points below it // (We need this because JDK 1.4 doesn't give locationToIndex -1 when below) int lowestY = 0; if (list.getFirstVisibleIndex() != -1) { try { - Rectangle bounds = list.getCellBounds(list.getFirstVisibleIndex(), + final Rectangle bounds = list.getCellBounds(list.getFirstVisibleIndex(), list.getLastVisibleIndex()); lowestY = (int) (bounds.getY() + bounds.getHeight()); } catch (NullPointerException ne) { @@ -211,9 +213,9 @@ // insert arch next to selected position if (list.locationToIndex(e.getPoint()) < 0 || (lowestY != -10 && (int) (e.getPoint().getY()) > lowestY)) { - mainControl.insertArchToMap(mainControl.getArchPanelSelection(), mainControl.getPanelArch(), null, mapx, mapy, CMapModel.JOIN_ENABLE); + mainControl.insertArchToMap(mainControl.getArchPanelSelection(), mainControl.getPanelArch(), null, pos, CMapModel.JOIN_ENABLE); } else { - mainControl.insertArchToMap(mainControl.getArchPanelSelection(), mainControl.getPanelArch(), mainControl.getMapArch(num, mapx, mapy), mapx, mapy, CMapModel.JOIN_ENABLE); + mainControl.insertArchToMap(mainControl.getArchPanelSelection(), mainControl.getPanelArch(), mainControl.getMapArch(num, pos), pos, CMapModel.JOIN_ENABLE); } // refresh @@ -230,30 +232,32 @@ @Nullable public ArchObject getMapTileSelection() { // find the selected entry if one - int index = list.getSelectedIndex(); + final int index = list.getSelectedIndex(); if (index >= list.getModel().getSize() || index < 0 || list.getModel().getSize() <= 0 || mainControl.getCurrentMap() == null) { return null; } // parse selected entry and get the arch object - String entry = model.getElementAt(index).toString(); - int num = Integer.parseInt(entry.substring(0, 10)); - int mapx = Integer.parseInt(entry.substring(10, 20)); - int mapy = Integer.parseInt(entry.substring(20, 30)); + final String entry = model.getElementAt(index).toString(); + final int num = Integer.parseInt(entry.substring(0, 10)); + final Point pos = new Point(); + pos.x = Integer.parseInt(entry.substring(10, 20)); + pos.y = Integer.parseInt(entry.substring(20, 30)); - return mainControl.getMapArch(num, mapx, mapy); + return mainControl.getMapArch(num, pos); } /** Insert a tile index of list, this will delete it. */ - void deleteIndexFromList(int index) { + void deleteIndexFromList(final int index) { if (index != -1 && index < list.getModel().getSize()) { - ArchObject temp = getMapTileSelection(); - String entry = model.getElementAt(index).toString(); - int num = Integer.parseInt(entry.substring(0, 10)); - int mapx = Integer.parseInt(entry.substring(10, 20)); - int mapy = Integer.parseInt(entry.substring(20, 30)); - mainControl.deleteMapArch(num, mapx, mapy, true, CMapModel.JOIN_ENABLE); + final ArchObject temp = getMapTileSelection(); + final String entry = model.getElementAt(index).toString(); + final int num = Integer.parseInt(entry.substring(0, 10)); + final Point pos = new Point(); + pos.x = Integer.parseInt(entry.substring(10, 20)); + pos.y = Integer.parseInt(entry.substring(20, 30)); + mainControl.deleteMapArch(num, pos, true, CMapModel.JOIN_ENABLE); mainView.setMapTileList(mainControl.getCurrentMap(), (temp == null ? -1 : temp.getMyID())); } } @@ -261,7 +265,7 @@ void appExitNotify() { } - public int getPanelArch(int oldindex) { + public int getPanelArch(final int oldindex) { int index = -1; if (oldindex == -1) { @@ -426,14 +430,14 @@ */ super.getListCellRendererComponent(list, value, index, iss, chf); - String entry = value.toString(); - int num = Integer.parseInt(entry.substring(0, 10)); - int mapx = Integer.parseInt(entry.substring(10, 20)); - int mapy = Integer.parseInt(entry.substring(20, 30)); - int indent = Integer.parseInt(entry.substring(30, 40)); + final String entry = value.toString(); + final int num = Integer.parseInt(entry.substring(0, 10)); + final Point pos = new Point(); + pos.x = Integer.parseInt(entry.substring(10, 20)); + pos.y = Integer.parseInt(entry.substring(20, 30)); + final int indent = Integer.parseInt(entry.substring(30, 40)); - ArchObject arch = mainControl.getMapArch(num, mapx, mapy); - ArchObject tmp; + ArchObject arch = mainControl.getMapArch(num, pos); //String label; // We must set a disabled Icon (even though we don't want it) Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-06-01 00:15:21 UTC (rev 105) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-06-01 23:09:01 UTC (rev 106) @@ -74,10 +74,9 @@ private final CMainControl mainControl; - private int mapWidth; + /** Size of the map. */ + private final Dimension mapSize = new Dimension(); - private int mapHeight; - /** The tile palette renderer. */ private final CLevelRenderer renderer; @@ -112,8 +111,8 @@ /** * Constructs a level view. - * @param mc the main controller - * @param control the controller of this view + * @param mainControl the main controller + * @param mapControl the controller of this view * @param initial the initial view position to show; null=show top left * corner */ @@ -357,18 +356,17 @@ /** Refreshes the data in the view from the model. */ void refreshDataFromModel() { - Dimension forcedSize; - mapWidth = mapControl.getMapWidth(); - mapHeight = mapControl.getMapHeight(); + final Dimension forcedSize; + mapSize.setSize(mapControl.getMapSize()); log.debug("refreshDataFromModel"); // define how much drawing space we need for the map if (IGUIConstants.isoView) { forcedSize = new Dimension( - (isPickmap() ? 3 + 2 * IGUIConstants.TILE_ISO_YLEN : mapHeight * IGUIConstants.TILE_ISO_YLEN) + mapWidth * IGUIConstants.TILE_ISO_YLEN + IGUIConstants.TILE_ISO_XLEN, - ((isPickmap() ? Math.max(mapHeight - 2, 0) : mapHeight) * IGUIConstants.TILE_ISO_YLEN + (mapWidth - mapHeight) * IGUICo... [truncated message content] |
From: <chr...@us...> - 2006-06-02 20:25:13
|
Revision: 108 Author: christianhujer Date: 2006-06-02 13:24:44 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=108&view=rev Log Message: ----------- Unified splitpanes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CArchPanel.java trunk/daimonin/src/daieditor/swing/DSplitPane.java Added Paths: ----------- trunk/crossfire/src/cfeditor/DSplitPane.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/CSplitPane.java Modified: trunk/crossfire/src/cfeditor/CArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanel.java 2006-06-02 20:04:11 UTC (rev 107) +++ trunk/crossfire/src/cfeditor/CArchPanel.java 2006-06-02 20:24:44 UTC (rev 108) @@ -61,7 +61,7 @@ private final JTabbedPane archAndPickPane; /** Our split pane. */ - private final CSplitPane splitPane; + private final DSplitPane splitPane; /** The Tab panel with arch lists. */ private final JTabbedPane tabDesktop; @@ -100,7 +100,7 @@ // this listener informs the mainview which panel is active: archlist or pickmaps? CPickmapPanel.getInstance().addArchNPickChangeListener(archAndPickPane); - splitPane = new CSplitPane(JSplitPane.VERTICAL_SPLIT, archAndPickPane, archQuickPanel); + splitPane = new DSplitPane(JSplitPane.VERTICAL_SPLIT, archAndPickPane, archQuickPanel); // calculate default value in case there is no settings file final Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); Deleted: trunk/crossfire/src/cfeditor/CSplitPane.java =================================================================== --- trunk/crossfire/src/cfeditor/CSplitPane.java 2006-06-02 20:04:11 UTC (rev 107) +++ trunk/crossfire/src/cfeditor/CSplitPane.java 2006-06-02 20:24:44 UTC (rev 108) @@ -1,28 +0,0 @@ -package cfeditor; - -import javax.swing.JSplitPane; -import java.awt.Component; - -/** Splitpane class that keeps its size even upon L'n'F change. */ -public class CSplitPane extends JSplitPane { - - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - - public CSplitPane(final int newOrientation, final Component newLeftComponent, final Component newRightComponent) { - super(newOrientation, newLeftComponent, newRightComponent); - } - - /** - * Overridden to store and restore the divider location upon - * UI change. - */ - @Override public void updateUI() { - final int dividerLocation = getDividerLocation(); - final int dividerSize = getDividerSize(); - super.updateUI(); - setDividerLocation(dividerLocation); - setDividerSize(dividerSize); - } - -} // class CSplitPane Copied: trunk/crossfire/src/cfeditor/DSplitPane.java (from rev 107, trunk/crossfire/src/cfeditor/CSplitPane.java) =================================================================== --- trunk/crossfire/src/cfeditor/DSplitPane.java (rev 0) +++ trunk/crossfire/src/cfeditor/DSplitPane.java 2006-06-02 20:24:44 UTC (rev 108) @@ -0,0 +1,38 @@ +package cfeditor; + +import java.awt.Component; +import javax.swing.JSplitPane; + +/** + * Splitpane subclass that keeps its size even upon L'n'F change. + * @author <a href="mailto:mic...@no...">Michael Toennies</a> + * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class DSplitPane extends JSplitPane { + + /** Serial Version UID. */ + private static final long serialVersionUID = 1L; + + /** + * Create a new DSplitPane. + * @param newOrientation {@link JSplitPane#HORIZONTAL_SPLIT} or {@link JSplitPane.VERTICAL_SPLIT}. + * @param newLeftComponent the Component that will appear on the left of a horizontally-split pane, or at the top of a vertically-split pane + * @param newRightComponent the Component that will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane + */ + public DSplitPane(final int newOrientation, final Component newLeftComponent, final Component newRightComponent) { + super(newOrientation, newLeftComponent, newRightComponent); + setOneTouchExpandable(true); + } + + /** {@inheritDoc} */ + // Overridden to store and restore the divider location upon UI change. + @Override public void updateUI() { + final int dividerLocationBackup = getDividerLocation(); + final int dividerSizeBackup = getDividerSize(); + super.updateUI(); + setDividerLocation(dividerLocationBackup); + setDividerSize(dividerSizeBackup); + } + +} // class DSplitPane Property changes on: trunk/crossfire/src/cfeditor/DSplitPane.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/daimonin/src/daieditor/swing/DSplitPane.java =================================================================== --- trunk/daimonin/src/daieditor/swing/DSplitPane.java 2006-06-02 20:04:11 UTC (rev 107) +++ trunk/daimonin/src/daieditor/swing/DSplitPane.java 2006-06-02 20:24:44 UTC (rev 108) @@ -32,15 +32,16 @@ * Splitpane subclass that keeps its size even upon L'n'F change. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class DSplitPane extends JSplitPane { +public class DSplitPane extends JSplitPane { /** Serial Version UID. */ private static final long serialVersionUID = 1L; /** * Create a new DSplitPane. - * @param newOrientation JSplitPane.HORIZONTAL_SPLIT or JSplitPane.VERTICAL_SPLIT + * @param newOrientation {@link JSplitPane#HORIZONTAL_SPLIT} or {@link JSplitPane.VERTICAL_SPLIT}. * @param newLeftComponent the Component that will appear on the left of a horizontally-split pane, or at the top of a vertically-split pane * @param newRightComponent the Component that will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane */ @@ -49,14 +50,14 @@ setOneTouchExpandable(true); } - // This method is currently unused because changing the look and feel while the applicatin is running is not possible any longer. - ///** {@inheritDoc} - // * Overridden to store and restore the divider location upon UI change. - // */ - //@Override public final void updateUI() { - // int dividerLocation = getDividerLocation(); - // super.updateUI(); - // setDividerLocation(dividerLocation); - //} + /** {@inheritDoc} */ + // Overridden to store and restore the divider location upon UI change. + @Override public void updateUI() { + final int dividerLocationBackup = getDividerLocation(); + final int dividerSizeBackup = getDividerSize(); + super.updateUI(); + setDividerLocation(dividerLocationBackup); + setDividerSize(dividerSizeBackup); + } } // class DSplitPane This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-03 23:14:57
|
Revision: 126 Author: christianhujer Date: 2006-06-03 16:14:42 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=126&view=rev Log Message: ----------- Removed unused originator field from GridderException. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainView.java trunk/src/app/net/sf/gridarta/GridderException.java Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-06-03 23:14:02 UTC (rev 125) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-06-03 23:14:42 UTC (rev 126) @@ -543,7 +543,7 @@ * @param error The error to be shown. */ void showError(GridderException error) { - JOptionPane.showConfirmDialog(this, error.getMessage(), IGUIConstants.APP_NAME + " Error in " + error.getOriginator(), JOptionPane.OK_OPTION, JOptionPane.WARNING_MESSAGE); + JOptionPane.showConfirmDialog(this, error.getMessage(), IGUIConstants.APP_NAME, JOptionPane.OK_OPTION, JOptionPane.WARNING_MESSAGE); } /** Modified: trunk/src/app/net/sf/gridarta/GridderException.java =================================================================== --- trunk/src/app/net/sf/gridarta/GridderException.java 2006-06-03 23:14:02 UTC (rev 125) +++ trunk/src/app/net/sf/gridarta/GridderException.java 2006-06-03 23:14:42 UTC (rev 126) @@ -35,37 +35,12 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** The originator of the error. */ - private final Object originator; - /** * Create a CGridderException. * @param msg message */ public GridderException(final String msg) { - this(msg, null); - } - - /** - * Create a CGridderException. - * @param msg Message - * @param originator Originator - */ - public GridderException(final String msg, final Object originator) { super(msg); - this.originator = originator; } - /** - * Returns the originator of the error. - * @return the originator of the error. - */ - public String getOriginator() { - if (originator != null) { - return originator.getClass().getName(); - } - - return "unknown"; - } - } // class CGridderException This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-04 01:05:22
|
Revision: 129 Author: christianhujer Date: 2006-06-03 18:05:07 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=129&view=rev Log Message: ----------- Some work on adding final, adding deprecation, documenting deprecation, removing usage of deprecated, improving inner classes, renaming symbols to code style. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapControl.java trunk/crossfire/src/cfeditor/CMapModel.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CSettings.java trunk/crossfire/src/cfeditor/CStartupScreen.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java Modified: trunk/crossfire/src/cfeditor/CMapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapControl.java 2006-06-03 23:18:32 UTC (rev 128) +++ trunk/crossfire/src/cfeditor/CMapControl.java 2006-06-04 01:05:07 UTC (rev 129) @@ -107,6 +107,10 @@ mapModel.appExitNotify(); // and then the model } + /** + * Returns flag that indicates whether this is a pickmap or not. + * @return flag that indicates whether this is a pickmap or not. + */ public boolean isPickmap() { return isPickmap; } @@ -115,15 +119,25 @@ return mapView.isGridVisible(); } - public void setGridVisibility(boolean fVisible) { + public void setGridVisibility(final boolean fVisible) { mapView.setGridVisibility(fVisible); } + /** + * Returns contains the edit types that have already been (requested and) + * calculated (edit types get calculated only when needed to save time) + * @return contains the edit types that have already been (requested and) + */ public int getActiveEditType() { return activeEditType; } - public void setActiveEditType(int newType) { + /** + * Sets contains the edit types that have already been (requested and) + * calculated (edit types get calculated only when needed to save time) + * @param newType contains the edit types that have already been (requested and) + */ + public void setActiveEditType(final int newType) { activeEditType = newType; } @@ -132,7 +146,7 @@ * @param checkType edit type * @return true if this edit type is active */ - public boolean hasEditType(int checkType) { + public boolean hasEditType(final int checkType) { return (activeEditType & checkType) != 0; } @@ -142,16 +156,16 @@ * save that state in 'activeEditType' so we don't need to do it again. * @param newType new edit type */ - public void addEditType(int newType) { + public void addEditType(final int newType) { // calculate only if needed final Dimension size = mapModel.getMapSize(); final Point pos = new Point(); if (!hasEditType(newType)) { for (pos.x = 0; pos.x < size.width; pos.x++) { for (pos.y = 0; pos.y < size.height; pos.y++) { - final Iterator it = mapModel.getArchObjects(pos); + final Iterator<ArchObject> it = mapModel.getArchObjects(pos); while (it.hasNext()) { - final ArchObject arch = (ArchObject) it.next(); + final ArchObject arch = it.next(); // calculate the new edit type if (arch.getRefFlag() && arch.getMapMultiHead() != null) { // multi tails get the value from their head @@ -232,8 +246,16 @@ return addArchToMap(archnr, pos, intern, join, false); } - /** wrapper method for addArchToMap, always inserting new arches on top */ - @Deprecated public boolean addArchToMap(int archnr, int xx, int yy, int intern, boolean join) { + /** wrapper method for addArchToMap, always inserting new arches on top. + * @param archnr + * @param xx + * @param yy + * @param intern + * @param join + * @return + * @deprecated use {@link #addArchToMap(int, Point, int, boolean)} instead + */ + @Deprecated public boolean addArchToMap(final int archnr, final int xx, final int yy, final int intern, final boolean join) { return addArchToMap(archnr, new Point(xx, yy), intern, join, false); } @@ -241,7 +263,7 @@ return mapModel.insertArchToMap(newarch, archnr, next, pos, join); } - public void addArchObjectToMap(ArchObject arch, boolean insertBelow) { + public void addArchObjectToMap(final ArchObject arch, final boolean insertBelow) { mapModel.addArchObjectToMap(arch, insertBelow); } @@ -384,7 +406,7 @@ /** * Returns the map size of the mapModel. - * @return map size. + * @return map size */ public Dimension getMapSize() { return mapModel.getMapSize(); @@ -392,7 +414,8 @@ /** * Returns the width of the level. - * @return map width. + * @return map width + * @deprecated use {@link #getMapSize()} instead. */ @Deprecated public int getMapWidth() { return getMapSize().width; @@ -400,7 +423,8 @@ /** * Returns the height of the level. - * @return map height. + * @return map height + * @deprecated use {@link #getMapSize()} instead. */ @Deprecated public int getMapHeight() { return getMapSize().height; @@ -416,7 +440,7 @@ /** * Returns the width of the level + neighbors tile maps if any. - * @return global width. + * @return global width */ // TODO implement this int getDisplayMapWidth() { @@ -429,7 +453,7 @@ /** * Returns the height of the level + neighbors tile maps if any. - * @return global height. + * @return global height */ int getDisplayMapHeight() { if (showTiles) { @@ -443,7 +467,7 @@ return showTiles; } - void setTileShow(boolean show) { + void setTileShow(final boolean show) { showTiles = show; if (show) { /*Do the tile maps loading :)*/ @@ -468,7 +492,7 @@ /** * Check if the coordinates posx, posy are valid (located within the * borders of the map). - * @param pos coordinate to check. + * @param pos coordinate to check * @return true if this point is located within the map boundaries */ public boolean pointValid(final Point pos) { Modified: trunk/crossfire/src/cfeditor/CMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapModel.java 2006-06-03 23:18:32 UTC (rev 128) +++ trunk/crossfire/src/cfeditor/CMapModel.java 2006-06-04 01:05:07 UTC (rev 129) @@ -709,7 +709,7 @@ // first, try to find the tile we had selected node = null; - final Iterator it = getArchObjects(pos.x, pos.y); + final Iterator it = getArchObjects(pos); while (it.hasNext()) { node = (ArchObject) it.next(); @@ -966,7 +966,7 @@ ArchObject exit = m_main_control.getMainView().getMapTileSelection(); if (exit == null || !ExitTypes.contains(exit)) { // if not, we check the whole selected spot for an exit - final Iterator it = getArchObjects(hspot.x, hspot.y); + final Iterator it = getArchObjects(hspot); while (it.hasNext()) { exit = (ArchObject) it.next(); if (ExitTypes.contains(exit)) { Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-06-03 23:18:32 UTC (rev 128) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-06-04 01:05:07 UTC (rev 129) @@ -1071,7 +1071,7 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - private final CMapModel _model; + private final CMapModel mapModel; /** 32x32 Image and Icon for temprary storing tiles before drawing */ private Image tmpImage; @@ -1092,7 +1092,7 @@ /** Constructor */ CIsoLevelRenderer(CMapModel model, boolean pickmap) { - _model = model; + mapModel = model; af = new AttributeFilter(); af.addAttribute("no_pass", "1"); @@ -1207,13 +1207,13 @@ } ystart = y * IGUIConstants.TILE_ISO_YLEN2 + (isPickmap ? 0 : IGUIConstants.TILE_ISO_YLEN); for (int x = 0; x < mapSize.width; x++) { - if (!_model.containsArchObject(x, y)) { + if (!mapModel.containsArchObject(x, y)) { // empty square if (!isPickmap) { mainControl.getUnknownTileIcon().paintIcon(this, grfx, xstart, ystart); } } else { - Iterator it = _model.getArchObjects(x, y); + Iterator it = mapModel.getArchObjects(x, y); while (it.hasNext()) { node = (ArchObject) it.next(); Modified: trunk/crossfire/src/cfeditor/CSettings.java =================================================================== --- trunk/crossfire/src/cfeditor/CSettings.java 2006-06-03 23:18:32 UTC (rev 128) +++ trunk/crossfire/src/cfeditor/CSettings.java 2006-06-04 01:05:07 UTC (rev 129) @@ -28,7 +28,8 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.util.Hashtable; +import java.util.HashMap; +import java.util.Map; import java.util.Properties; import org.apache.log4j.Logger; @@ -41,19 +42,20 @@ * the properties are not saved! * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @deprecated This should be replaced by java.util.prefs */ -public class CSettings { +@Deprecated public class CSettings { - private static final Logger log = Logger.getLogger(CSettings.class); + private static final Logger LOG = Logger.getLogger(CSettings.class); /** The properties object that contains the settings. */ - private final Properties m_properties = new Properties(); + private final Properties properties = new Properties(); /** The file that is used to store the settings or null if none specified. */ - private String m_strFile; + private String strFile; /** The shared hashtable that maps filenames to settings instances. */ - private static final Hashtable m_hashFromNameToInstance = new Hashtable(); + private static final Map<String, CSettings> hashFromNameToInstance = new HashMap<String, CSettings>(); /** * Returns the settings instance for the given filename. If no such instance @@ -61,14 +63,14 @@ * @param strFile The filename whose settings object instance we want. * @return The settings instance for the given filename. */ - public static CSettings getInstance(String strFile) { - if (m_hashFromNameToInstance.containsKey(strFile)) { - return (CSettings) m_hashFromNameToInstance.get(strFile); + public static CSettings getInstance(final String strFile) { + if (hashFromNameToInstance.containsKey(strFile)) { + return hashFromNameToInstance.get(strFile); } - CSettings instance = new CSettings(strFile); + final CSettings instance = new CSettings(strFile); instance.loadSettings(); - m_hashFromNameToInstance.put(strFile, instance); + hashFromNameToInstance.put(strFile, instance); return instance; } @@ -79,15 +81,16 @@ * standard configuration for resource files. * @param strFile */ - private CSettings(String strFile) { - m_strFile = CResourceLoader.getHomeFileName(strFile); + private CSettings(final String strFile) { + this.strFile = CResourceLoader.getHomeFileName(strFile); } /** Loads the settings from the file. */ public synchronized void loadSettings() { try { - m_properties.load(new FileInputStream(m_strFile)); - } catch (IOException ioe) { + properties.load(new FileInputStream(strFile)); + } catch (final IOException ioe) { + // TODO } } @@ -97,16 +100,16 @@ * called, the settings are not saved to anywhere. */ public synchronized void saveSettings() { - if (m_strFile == null) { + if (strFile == null) { return; } try { - if (log.isDebugEnabled()) { - log.debug("SAVE SETTINGS: " + (new File(m_strFile)).getAbsolutePath()); + if (LOG.isDebugEnabled()) { + LOG.debug("SAVE SETTINGS: " + (new File(strFile)).getAbsolutePath()); } - m_properties.store(new FileOutputStream(m_strFile), ""); - } catch (IOException ioe) { + properties.store(new FileOutputStream(strFile), ""); + } catch (final IOException ioe) { } } @@ -115,8 +118,8 @@ * list. The method returns <code>null</code> if the * property is not found. * @param strKey The key that identifies the property. */ - public synchronized String getProperty(String strKey) { - return m_properties.getProperty(strKey); + public synchronized String getProperty(final String strKey) { + return properties.getProperty(strKey); } /** @@ -126,8 +129,8 @@ * @param strKey the key that identifies the property * @param strDefaultValue the default value to use */ - public synchronized String getProperty(String strKey, String strDefaultValue) { - String strValue = m_properties.getProperty(strKey); + public synchronized String getProperty(final String strKey, final String strDefaultValue) { + final String strValue = properties.getProperty(strKey); if (strValue == null) { setProperty(strKey, strDefaultValue); return strDefaultValue; @@ -142,15 +145,15 @@ * @param strKey the key that identifies the property * @param strValue the value of the property */ - public synchronized void setProperty(String strKey, String strValue) { - m_properties.put(strKey, strValue); + public synchronized void setProperty(final String strKey, final String strValue) { + properties.setProperty(strKey, strValue); } /** * Removes the key-value pair of specified key from the property table. * @param strKey the key that identifies the property */ - public synchronized void clearProperty(String strKey) { - m_properties.remove(strKey); + public synchronized void clearProperty(final String strKey) { + properties.remove(strKey); } } Modified: trunk/crossfire/src/cfeditor/CStartupScreen.java =================================================================== --- trunk/crossfire/src/cfeditor/CStartupScreen.java 2006-06-03 23:18:32 UTC (rev 128) +++ trunk/crossfire/src/cfeditor/CStartupScreen.java 2006-06-04 01:05:07 UTC (rev 129) @@ -48,57 +48,57 @@ public class CStartupScreen extends Window { /** The image shown by this startup screen. */ - private ImageIcon m_image; + private ImageIcon image; - private Timer m_autoCloseTimer; + private Timer autoCloseTimer; - private MouseListener m_clickListener; + private MouseListener clickListener; private static final long serialVersionUID = 5107663950987715313L; /** Constructs and shows a startup screen. */ - public CStartupScreen(Frame parentFrame) { + public CStartupScreen(final Frame parentFrame) { super(parentFrame); - m_image = CGUIUtils.getIcon(IGUIConstants.STARTUP_IMAGE); - if (m_image == null) { + image = CGUIUtils.getIcon(IGUIConstants.STARTUP_IMAGE); + if (image == null) { return; } // Center the startup screen to the parent frame - int width = m_image.getIconWidth(); - int height = m_image.getIconHeight(); + final int width = image.getIconWidth(); + final int height = image.getIconHeight(); - Rectangle bounds = parentFrame.getBounds(); - bounds.x += (bounds.width - width) / 2; - bounds.y += (bounds.height - height) / 2; + final Rectangle bounds = parentFrame.getBounds(); + bounds.x += bounds.width - width >> 1; + bounds.y += bounds.height - height >> 1; bounds.width = width; bounds.height = height; setBounds(bounds); - m_clickListener = new MouseAdapter() { - @Override public void mouseClicked(MouseEvent event) { + clickListener = new MouseAdapter() { + @Override public void mouseClicked(final MouseEvent event) { close(); } }; - addMouseListener(m_clickListener); + addMouseListener(clickListener); } /** Performes all actions needed to close the window. */ private void close() { - if (m_clickListener != null) { - removeMouseListener(m_clickListener); - m_clickListener = null; + if (clickListener != null) { + removeMouseListener(clickListener); + clickListener = null; } - if (m_autoCloseTimer != null) { - m_autoCloseTimer.stop(); - m_autoCloseTimer = null; + if (autoCloseTimer != null) { + autoCloseTimer.stop(); + autoCloseTimer = null; } - m_image = null; + image = null; setVisible(false); dispose(); @@ -108,8 +108,8 @@ * Overridden to paint the loaded startup image. * @param grfx The graphics context to paint to. */ - @Override public void paint(Graphics grfx) { - m_image.paintIcon(this, grfx, 0, 0); + @Override public void paint(final Graphics grfx) { + image.paintIcon(this, grfx, 0, 0); //grfx.drawImage(pinga, 0, 0, null); } @@ -117,19 +117,20 @@ * Overridden to startup a timer that then closes this window after * a few seconds. */ - @Override public void setVisible(boolean visible) { + @Override public void setVisible(final boolean visible) { if (visible) { super.setVisible(true); - m_autoCloseTimer = new Timer(3000, new ActionListener() { - public void actionPerformed(ActionEvent event) { + autoCloseTimer = new Timer(3000, new ActionListener() { + public void actionPerformed(final ActionEvent event) { close(); } }); - m_autoCloseTimer.setInitialDelay(3000); - m_autoCloseTimer.setRepeats(false); - m_autoCloseTimer.start(); + autoCloseTimer.setInitialDelay(3000); + autoCloseTimer.setRepeats(false); + autoCloseTimer.start(); } else { super.setVisible(false); } } -} + +} // class CStartupScreen Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-06-03 23:18:32 UTC (rev 128) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-06-04 01:05:07 UTC (rev 129) @@ -26,6 +26,7 @@ import cfeditor.arch.ArchObject; import java.awt.Color; +import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Point; import java.awt.event.ActionEvent; @@ -61,7 +62,7 @@ private static ReplaceDialog instance = null; - private final CMainControl m_control; + private final CMainControl mainControl; private boolean isBuilt; @@ -87,20 +88,20 @@ /** * Construct instance. - * @param cm + * @param mainControl */ - private ReplaceDialog(CMainControl cm) { - super(cm.getMainView(), "Replace", false); - setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); - m_control = cm; + private ReplaceDialog(final CMainControl mainControl) { + super(mainControl.getMainView(), "Replace", false); + setDefaultCloseOperation(HIDE_ON_CLOSE); + this.mainControl = mainControl; isBuilt = false; rfArchName = null; replaceArch = null; } - public static void init(CMainControl cm) { + public static void init(final CMainControl mainControl) { if (instance == null) { - instance = new ReplaceDialog(cm); + instance = new ReplaceDialog(mainControl); } } @@ -115,39 +116,39 @@ /** * Replace objects on the map. - * @param m_ctrl MapControl of the active map where the action was invoked + * @param mapControl MapControl of the active map where the action was invoked */ - public void display(CMapControl m_ctrl) { - replaceArch = m_control.getArchPanelSelection(); // selected arch + public void display(final CMapControl mapControl) { + replaceArch = mainControl.getArchPanelSelection(); // selected arch if (!isBuilt) { - JPanel main_panel = new JPanel(); - main_panel.setLayout(new BoxLayout(main_panel, BoxLayout.Y_AXIS)); - main_panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 2, 5)); + final JPanel mainPanel = new JPanel(); + mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); + mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 2, 5)); // first line: heading JPanel line = new JPanel(new FlowLayout(FlowLayout.LEFT)); - JLabel labelon = new JLabel("On"); + final JLabel labelon = new JLabel("On"); labelon.setForeground(Color.black); line.add(labelon); line.add(Box.createVerticalStrut(3)); replaceEntireBox = new JComboBox(new String[]{"entire map", "selected squares of"}); replaceEntireBox.setBackground(Color.white); - if (m_ctrl.getMapView().isHighlight()) { + if (mapControl.getMapView().isHighlight()) { replaceEntireBox.setSelectedIndex(1); } else { replaceEntireBox.setSelectedIndex(0); } line.add(replaceEntireBox); line.add(Box.createVerticalStrut(3)); - rfHeading = new JLabel("\"" + m_ctrl.getMapFileName() + "\":"); + rfHeading = new JLabel("\"" + mapControl.getMapFileName() + "\":"); rfHeading.setForeground(Color.black); line.add(rfHeading); - main_panel.add(line); + mainPanel.add(line); // second line: replace what? line = new JPanel(new FlowLayout(FlowLayout.LEFT)); - JLabel label1 = new JLabel("delete objects with"); + final JLabel label1 = new JLabel("delete objects with"); line.add(label1); line.add(Box.createVerticalStrut(5)); @@ -159,11 +160,11 @@ replaceInput1 = new JTextField(20); line.add(replaceInput1); - main_panel.add(line); + mainPanel.add(line); // third line: replace by? line = new JPanel(new FlowLayout(FlowLayout.LEFT)); - JLabel label2 = new JLabel("and replace by"); + final JLabel label2 = new JLabel("and replace by"); line.add(label2); line.add(Box.createVerticalStrut(5)); replaceWithBox = new JComboBox(new String[]{"object", "nothing"}); @@ -173,13 +174,13 @@ replaceWithBox.setSelectedIndex(0); } replaceWithBox.setBackground(Color.white); - replaceWithBox.addItemListener(new ReplaceWithBoxAL(this, replaceWithBox)); + replaceWithBox.addItemListener(new ReplaceWithBoxAL()); line.add(replaceWithBox); iconLabel = new JLabel(); if (replaceArch != null) { colonLabel = new JLabel(":"); - iconLabel.setIcon(m_control.getArchObjectStack().getFace(replaceArch.getFaceNr())); + iconLabel.setIcon(mainControl.getArchObjectStack().getFace(replaceArch.getFaceNr())); rfArchName = new JLabel(" " + replaceArch.getBestName(replaceArch.getDefaultArch())); } else { colonLabel = new JLabel(""); @@ -188,40 +189,40 @@ line.add(colonLabel); line.add(Box.createVerticalStrut(5)); rfArchName.setForeground(Color.black); - m_control.setPlainFont(rfArchName); + mainControl.setPlainFont(rfArchName); line.add(iconLabel); line.add(rfArchName); - main_panel.add(line); + mainPanel.add(line); // button panel: - main_panel.add(Box.createVerticalStrut(10)); + mainPanel.add(Box.createVerticalStrut(10)); line = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - JButton okButton = new JButton("OK"); - okButtonListener = new OkButtonAL(this, m_ctrl); + final JButton okButton = new JButton("OK"); + okButtonListener = new OkButtonAL(mapControl); okButton.addActionListener(okButtonListener); line.add(okButton); - JButton cancelButton = new JButton("Cancel"); + final JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent event) { + public void actionPerformed(final ActionEvent event) { setVisible(false); } }); line.add(cancelButton); - main_panel.add(line); + mainPanel.add(line); - getContentPane().add(main_panel); + getContentPane().add(mainPanel); pack(); - setLocationRelativeTo(m_control.getMainView()); + setLocationRelativeTo(mainControl.getMainView()); setVisible(true); isBuilt = true; } else { // just set fields and show - rfHeading.setText("\"" + m_ctrl.getMapFileName() + "\":"); + rfHeading.setText("\"" + mapControl.getMapFileName() + "\":"); replaceInput1.setText(""); - okButtonListener.setMapControl(m_ctrl); + okButtonListener.setMapControl(mapControl); if (replaceArch == null) { replaceWithBox.setSelectedIndex(1); iconLabel.setIcon(null); @@ -229,12 +230,12 @@ colonLabel.setText(""); } else { replaceWithBox.setSelectedIndex(0); - iconLabel.setIcon(m_control.getArchObjectStack().getFace(replaceArch.getFaceNr())); + iconLabel.setIcon(mainControl.getArchObjectStack().getFace(replaceArch.getFaceNr())); rfArchName.setText(" " + replaceArch.getBestName(replaceArch.getDefaultArch())); colonLabel.setText(":"); } - if (m_ctrl.getMapView().isHighlight()) { + if (mapControl.getMapView().isHighlight()) { replaceEntireBox.setSelectedIndex(1); // selected squares } else { replaceEntireBox.setSelectedIndex(0); // entire map @@ -253,13 +254,13 @@ * changed if true, the frame is always packed (packing resizes but also * causes flicker) */ - public void updateArchSelection(ArchObject newArch, boolean alwaysPack) { + public void updateArchSelection(final ArchObject newArch, final boolean alwaysPack) { if (isShowing() && replaceWithBox.getSelectedIndex() == 0) { replaceArch = newArch; if (newArch != null) { - Icon oldIcon = iconLabel.getIcon(); + final Icon oldIcon = iconLabel.getIcon(); - iconLabel.setIcon(m_control.getArchObjectStack().getFace(newArch.getFaceNr())); + iconLabel.setIcon(mainControl.getArchObjectStack().getFace(newArch.getFaceNr())); rfArchName.setText(" " + newArch.getBestName(newArch.getDefaultArch())); colonLabel.setText(":"); @@ -279,7 +280,7 @@ /** * This method performs the actual replace action on a map. - * @param mc MapControl of the map where the action was invoked + * @param mapControl MapControl of the map where the action was invoked * @param matchCriteria matching criteria for replace * @param matchString this is what to search for * @param entireMap if true, the entire map is affected - if false, only @@ -288,21 +289,22 @@ * replaced * @return number of arches that have been replaced */ - private int doReplace(CMapControl mc, int matchCriteria, String matchString, boolean entireMap, boolean deleteOnly) { - int replaceCount = 0; // count how many arches have been replaced + private int doReplace(final CMapControl mapControl, final int matchCriteria, final String matchString, final boolean entireMap, final boolean deleteOnly) { - if (mc == null) { + if (mapControl == null) { return 0; } // define area of effect - Point startp, offset; + final Point startp; + final Point offset; if (entireMap) { startp = new Point(0, 0); - offset = new Point(mc.getMapWidth() - 1, mc.getMapHeight() - 1); + final Dimension mapSize = mapControl.getMapSize(); + offset = new Point(mapSize.width - 1, mapSize.height - 1); } else { - startp = mc.getMapView().getHighlightStart(); // start of highlighted rect - offset = mc.getMapView().getHighlightOffset(); // offset of rect from startp + startp = mapControl.getMapView().getHighlightStart(); // start of highlighted rect + offset = mapControl.getMapView().getHighlightOffset(); // offset of rect from startp } // convert negative 'offset' into positive by flipping 'startp' @@ -317,12 +319,13 @@ // cycle through all tile coordinates between startpoint and offset: final Point pos = new Point(); + int replaceCount = 0; for (pos.x = startp.x; pos.x - startp.x <= offset.x; pos.x++) { for (pos.y = startp.y; pos.y - startp.y <= offset.y; pos.y++) { - final Iterator it = mc.getArchObjectsDeleteMapArch(pos, false, false); + final Iterator<ArchObject> it = mapControl.getArchObjectsDeleteMapArch(pos, false, false); while (it.hasNext()) { - final ArchObject node = (ArchObject) it.next(); + final ArchObject node = it.next(); if ((!node.isMulti() || node.getRefCount() > 0) && ((matchCriteria == MATCH_ARCH_NAME && node.getArchName() != null && node.getArchName().equalsIgnoreCase(matchString)) || @@ -339,11 +342,11 @@ if (replaceArch.getRefCount() == 0 && replaceArch.getMapMultiHead() != null) { replaceArch = replaceArch.getMapMultiHead(); } - mc.addArchToMap(replaceArch.getNodeNr(), pos, 0, false); + mapControl.addArchToMap(replaceArch.getNodeNr(), pos, 0, false); // TODO: if from pickmap it could have special attributes -> copy them } else { - mc.insertArchToMap(replaceArch, 0, prevArch, pos, false); + mapControl.insertArchToMap(replaceArch, 0, prevArch, pos, false); } } replaceCount++; @@ -353,104 +356,96 @@ } // now the map and toolbars must be redrawn - mc.repaint(); - m_control.getMainView().refreshMapTileList(); + mapControl.repaint(); + mainControl.getMainView().refreshMapTileList(); return replaceCount; } - // ----------------------- SUBCLASSES ----------------------- - /** Item-listener for the "replace with"-selection box. */ private class ReplaceWithBoxAL implements ItemListener { - ReplaceDialog frame; // the entire frame + private int lastSelectedIndex; - int lastSelectedIndex; - - JComboBox box; - /** * Constructor. - * @param frame the dialog mainframe */ - public ReplaceWithBoxAL(ReplaceDialog frame, JComboBox box) { - this.frame = frame; - this.box = box; - lastSelectedIndex = box.getSelectedIndex(); + ReplaceWithBoxAL() { + lastSelectedIndex = replaceWithBox.getSelectedIndex(); } /** * A (new) type has been selected in the box. * @param event the occured <code>ItemEvent</code> (button pressed) */ - public void itemStateChanged(ItemEvent event) { + public void itemStateChanged(final ItemEvent event) { if (event.getStateChange() == ItemEvent.SELECTED && - lastSelectedIndex != box.getSelectedIndex()) { - if (box.getSelectedIndex() == 0) { + lastSelectedIndex != replaceWithBox.getSelectedIndex()) { + if (replaceWithBox.getSelectedIndex() == 0) { // replace with arch - replaceArch = m_control.getArchPanelSelection(); // selected arch + replaceArch = mainControl.getArchPanelSelection(); // selected arch updateArchSelection(replaceArch, true); - } else if (box.getSelectedIndex() == 1) { + } else if (replaceWithBox.getSelectedIndex() == 1) { // replace with nothing iconLabel.setIcon(null); rfArchName.setText(""); colonLabel.setText(""); pack(); } - lastSelectedIndex = box.getSelectedIndex(); + lastSelectedIndex = replaceWithBox.getSelectedIndex(); } } - } + } // class ReplaceWithBoxAL + /** Listener class for the ok-button of the replace dialog. */ public class OkButtonAL implements ActionListener { - CMapControl mc; // map control + private CMapControl mapControl; // map control - ReplaceDialog frame; // the entire frame - - public OkButtonAL(ReplaceDialog frame, CMapControl mc) { - this.frame = frame; - this.mc = mc; + public OkButtonAL(final CMapControl mapControl) { + this.mapControl = mapControl; } - public void setMapControl(CMapControl mc) { - this.mc = mc; + public void setMapControl(final CMapControl mapControl) { + this.mapControl = mapControl; } - public void actionPerformed(ActionEvent event) { - int replaceCount; // how many arches have been replaced - int matchCriteria = 0; - String matchString = replaceInput1.getText().trim(); - boolean deleteOnly = frame.replaceWithBox.getSelectedIndex() == 1; - boolean entireMap = replaceEntireBox.getSelectedIndex() == 0; + public void actionPerformed(final ActionEvent event) { + final String matchString = replaceInput1.getText().trim(); + final boolean deleteOnly = replaceWithBox.getSelectedIndex() == 1; + final boolean entireMap = replaceEntireBox.getSelectedIndex() == 0; - if (mc == null || mc.isClosing()) { - frame.setVisible(false); - m_control.showMessage("Replace", "Map \"" + mc.getMapFileName() + "\" is no longer available.\n", JOptionPane.ERROR_MESSAGE); - } else if (!entireMap && !mc.getMapView().isHighlight()) { + if (mapControl == null || mapControl.isClosing()) { + setVisible(false); + mainControl.showMessage("Replace", "Map \"" + mapControl.getMapFileName() + "\" is no longer available.\n", JOptionPane.ERROR_MESSAGE); + } else if (!entireMap && !mapControl.getMapView().isHighlight()) { // user selected "replace highlighted" but nothing is highlighted - m_control.showMessage("Replace", "You chose to replace on selected squares of\n" + - "map \"" + mc.getMapFileName() + "\", but there is no selected area.", JOptionPane.ERROR_MESSAGE); + mainControl.showMessage("Replace", "You chose to replace on selected squares of\n" + + "map \"" + mapControl.getMapFileName() + "\", but there is no selected area.", JOptionPane.ERROR_MESSAGE); } else { + final int matchCriteria; if (replaceCriteria.getSelectedIndex() == 0) { matchCriteria = ReplaceDialog.MATCH_ARCH_NAME; } else if (replaceCriteria.getSelectedIndex() == 1) { matchCriteria = ReplaceDialog.MATCH_OBJ_NAME; + } else { + matchCriteria = 0; } - replaceCount = frame.doReplace(mc, matchCriteria, matchString, entireMap, deleteOnly); + final int replaceCount = doReplace(mapControl, matchCriteria, matchString, entireMap, deleteOnly); if (replaceCount > 0) { - frame.setVisible(false); + setVisible(false); if (replaceCount == 1) { - m_control.showMessage("Replace", "1 object has been replaced."); + mainControl.showMessage("Replace", "1 object has been replaced."); } else { - m_control.showMessage("Replace", replaceCount + " objects have been replaced."); + mainControl.showMessage("Replace", replaceCount + " objects have been replaced."); } } else { - m_control.showMessage("Replace", "No matching object found.", JOptionPane.ERROR_MESSAGE); + mainControl.showMessage("Replace", "No matching object found.", JOptionPane.ERROR_MESSAGE); } } } - } -} + + } // class OkButtonAL + +} // class ReplaceDialog Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java 2006-06-03 23:18:32 UTC (rev 128) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java 2006-06-04 01:05:07 UTC (rev 129) @@ -6,35 +6,39 @@ import java.util.NoSuchElementException; /** - * The class ArchObjectIterator implements an {@link java.util.Iterator} that + * The class ArchObjectIterator implements an {@link Iterator} that * returns all {@link ArchObject}s in a map location. * @author Andreas Kirschbaum */ -public class ArchObjectIterator implements Iterator { +public class ArchObjectIterator implements Iterator<ArchObject> { - protected ArchObject _nextArchObject; + protected ArchObject nextArchObject; - protected ArchObject _currArchObject = null; + protected ArchObject currArchObject = null; - public ArchObjectIterator(ArchObject archObject) { - _nextArchObject = archObject; + public ArchObjectIterator(final ArchObject archObject) { + nextArchObject = archObject; } + /** {@inheritDoc} */ public boolean hasNext() { - return _nextArchObject != null; + return nextArchObject != null; } - public Object next() { - if (_nextArchObject == null) { + /** {@inheritDoc} */ + public ArchObject next() { + if (nextArchObject == null) { throw new NoSuchElementException(); } - _currArchObject = _nextArchObject; - _nextArchObject = _currArchObject.getNextArch(); - return _currArchObject; + currArchObject = nextArchObject; + nextArchObject = currArchObject.getNextArch(); + return currArchObject; } + /** {@inheritDoc} */ public void remove() { throw new UnsupportedOperationException(); } -} + +} // class ArchObjectIterator Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java 2006-06-03 23:18:32 UTC (rev 128) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java 2006-06-04 01:05:07 UTC (rev 129) @@ -7,30 +7,32 @@ /** * The class ArchObjectIterator implements an {@link ArchObjectIterator} that - * implements the {@link java.util.Iterator#remove()} operation via {@link + * implements the {@link Iterator#remove()} operation via {@link * CMapModel#deleteArchMapObject(ArchObject)}. * @author Andreas Kirschbaum */ -public class ArchObjectIteratorDeleteArchMapObject extends ArchObjectIterator implements Iterator { +public class ArchObjectIteratorDeleteArchMapObject extends ArchObjectIterator { - private final CMapModel _model; + private final CMapModel model; - public ArchObjectIteratorDeleteArchMapObject(CMapModel model, ArchObject archObject) { + public ArchObjectIteratorDeleteArchMapObject(final CMapModel model, final ArchObject archObject) { super(archObject); if (model == null) { throw new IllegalArgumentException(); } - _model = model; + this.model = model; } + /** {@inheritDoc} */ @Override public void remove() { - if (_currArchObject == null) { + if (currArchObject == null) { throw new IllegalStateException(); } - _model.deleteArchMapObject(_currArchObject); - _currArchObject = null; + model.deleteArchMapObject(currArchObject); + currArchObject = null; } -} + +} // class ArchObjectIteratorDeleteArchMapObject Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java 2006-06-03 23:18:32 UTC (rev 128) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java 2006-06-04 01:05:07 UTC (rev 129) @@ -4,45 +4,58 @@ import cfeditor.CMapModel; import java.util.Iterator; +import java.awt.Point; /** * The class ArchObjectIterator implements an {@link ArchObjectIterator} that - * implements the {@link java.util.Iterator#remove()} operation via {@link + * implements the {@link Iterator#remove()} operation via {@link * CMapModel#deleteMapArch(int, int, int, boolean, boolean)}. * @author Andreas Kirschbaum */ -public class ArchObjectIteratorDeleteMapArch extends ArchObjectIterator implements Iterator { +public class ArchObjectIteratorDeleteMapArch extends ArchObjectIterator { - private final CMapModel _model; + private final CMapModel mapModel; - private final int _x; + private final Point pos; - private final int _y; + private final boolean refreshMap; - private final boolean _refreshMap; + private final boolean join; - private final boolean _join; - - public ArchObjectIteratorDeleteMapArch(CMapModel model, ArchObject archObject, int x, int y, boolean refreshMap, boolean join) { + public ArchObjectIteratorDeleteMapArch(final CMapModel mapModel, final ArchObject archObject, final Point pos, final boolean refreshMap, final boolean join) { super(archObject); - if (model == null) { + if (mapModel == null) { throw new IllegalArgumentException(); } - _model = model; - _x = x; - _y = y; - _refreshMap = refreshMap; - _join = join; + this.mapModel = mapModel; + this.pos = pos; + this.refreshMap = refreshMap; + this.join = join; } + /** + * @param mapModel + * @param archObject + * @param x + * @param y + * @param refreshMap + * @param join + * @deprecated use {@link #ArchObjectIteratorDeleteMapArch(cfeditor.CMapModel, ArchObject, java.awt.Point, boolean, boolean)} instead + */ + @Deprecated public ArchObjectIteratorDeleteMapArch(final CMapModel mapModel, final ArchObject archObject, final int x, final int y, final boolean refreshMap, final boolean join) { + this(mapModel, archObject, new Point(x, y), refreshMap, join); + } + + /** {@inheritDoc} */ @Override public void remove() { - if (_currArchObject == null) { + if (currArchObject == null) { throw new IllegalStateException(); } - _model.deleteMapArch(_currArchObject.getMyID(), _x, _y, _refreshMap, _join); - _currArchObject = null; + mapModel.deleteMapArch(currArchObject.getMyID(), pos, refreshMap, join); + currArchObject = null; } -} + +} // class ArchObjectIteratorDeleteMapArch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-06-11 15:37:34
|
Revision: 144 Author: akirschbaum Date: 2006-06-11 08:37:10 -0700 (Sun, 11 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=144&view=rev Log Message: ----------- Reset all serialVersionUID numbers to 1. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CDialogBase.java trunk/crossfire/src/cfeditor/CFancyButton.java trunk/crossfire/src/cfeditor/CMainToolbar.java trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java trunk/crossfire/src/cfeditor/COptionDialog.java trunk/crossfire/src/cfeditor/CStartupScreen.java trunk/crossfire/src/cfeditor/JFontChooser.java trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java trunk/crossfire/src/cfeditor/gui/ScriptEditor.java trunk/crossfire/src/cfeditor/gui/ScriptManager.java trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java trunk/crossfire/src/cfeditor/parameter/MapParameterView.java trunk/crossfire/src/cfeditor/parameter/ParameterDescriptionEditor.java trunk/crossfire/src/cfeditor/parameter/ParameterNameEditor.java trunk/crossfire/src/cfeditor/parameter/ParameterTypeEditor.java Modified: trunk/crossfire/src/cfeditor/CDialogBase.java =================================================================== --- trunk/crossfire/src/cfeditor/CDialogBase.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/CDialogBase.java 2006-06-11 15:37:10 UTC (rev 144) @@ -41,7 +41,7 @@ */ @Deprecated public abstract class CDialogBase extends JDialog { - private static final long serialVersionUID = -625386596453840074L; + private static final long serialVersionUID = 1L; /** * Create a CDialogBase. Modified: trunk/crossfire/src/cfeditor/CFancyButton.java =================================================================== --- trunk/crossfire/src/cfeditor/CFancyButton.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/CFancyButton.java 2006-06-11 15:37:10 UTC (rev 144) @@ -40,7 +40,7 @@ private ImageIcon rolloverIcon; - private static final long serialVersionUID = -6830925679283342190L; + private static final long serialVersionUID = 1L; public CFancyButton(final String strLabel, final ActionListener actionListener) { this(strLabel, null, null, actionListener); Modified: trunk/crossfire/src/cfeditor/CMainToolbar.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-06-11 15:37:10 UTC (rev 144) @@ -84,7 +84,7 @@ private JButton m_prevWindow; - private static final long serialVersionUID = -3989252938129708277L; + private static final long serialVersionUID = 1L; /** * Constructs a new toolbar. @@ -333,7 +333,7 @@ final ButtonGroup m_group; - private static final long serialVersionUID = -2232217397820552908L; + private static final long serialVersionUID = 1L; /** Constructs the popup menu with the appropriate menuitems. */ public CPopupMenu() { Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-11 15:37:10 UTC (rev 144) @@ -145,7 +145,7 @@ private final JCheckBox m_pvp = new JCheckBox(); - private static final long serialVersionUID = 6994866465987083128L; + private static final long serialVersionUID = 1L; /** * Constructs the map-options dialog. Modified: trunk/crossfire/src/cfeditor/COptionDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/COptionDialog.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/COptionDialog.java 2006-06-11 15:37:10 UTC (rev 144) @@ -66,7 +66,7 @@ private final JCheckBox m_mapPanelBottom; // is map-tile panel in bottom panel? - private static final long serialVersionUID = 7268632624185255433L; + private static final long serialVersionUID = 1L; /** * Constructs a new option dialog. Modified: trunk/crossfire/src/cfeditor/CStartupScreen.java =================================================================== --- trunk/crossfire/src/cfeditor/CStartupScreen.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/CStartupScreen.java 2006-06-11 15:37:10 UTC (rev 144) @@ -54,7 +54,7 @@ private MouseListener clickListener; - private static final long serialVersionUID = 5107663950987715313L; + private static final long serialVersionUID = 1L; /** Constructs and shows a startup screen. */ public CStartupScreen(final Frame parentFrame) { Modified: trunk/crossfire/src/cfeditor/JFontChooser.java =================================================================== --- trunk/crossfire/src/cfeditor/JFontChooser.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/JFontChooser.java 2006-06-11 15:37:10 UTC (rev 144) @@ -71,7 +71,7 @@ private Font fontValue; - private static final long serialVersionUID = 3927109879696626225L; + private static final long serialVersionUID = 1L; public JFontChooser() { this(UIManager.getFont("Button.font")); Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-06-11 15:37:10 UTC (rev 144) @@ -950,7 +950,7 @@ final JLabel label; - private static final long serialVersionUID = -3633959822875652319L; + private static final long serialVersionUID = 1L; /** * Constructor - builds the window layout and shows it Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-06-11 15:37:10 UTC (rev 144) @@ -58,7 +58,7 @@ private final ArchComboBoxModel archComboBoxModel; - private static final long serialVersionUID = 6027654196326451339L; + private static final long serialVersionUID = 1L; public ArchComboBox() { setMaximumRowCount(4); @@ -305,7 +305,7 @@ private ArrayList subFilters = new ArrayList(); - private static final long serialVersionUID = 5878378868557234984L; + private static final long serialVersionUID = 1L; public ArchComboBoxModel() { archList = new ArchObject[mainControl.getArchCount()]; @@ -401,7 +401,7 @@ public final String sizeTester = new String("**Sizetester**"); - private static final long serialVersionUID = 8402293189506584343L; + private static final long serialVersionUID = 1L; /* This is the only method defined by ListCellRenderer. We just * reconfigure the Jlabel each time we're called. Modified: trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java 2006-06-11 15:37:10 UTC (rev 144) @@ -75,7 +75,7 @@ protected final ImageIcon closingIcon; - private static final long serialVersionUID = -2004164431543696336L; + private static final long serialVersionUID = 1L; //--- Constructor(s) --- Modified: trunk/crossfire/src/cfeditor/gui/ScriptEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-06-11 15:37:10 UTC (rev 144) @@ -120,7 +120,7 @@ private final JCheckBox typeBash; - private static final long serialVersionUID = -925081688574710327L; + private static final long serialVersionUID = 1L; /** * Create a visual JComponent used to edit the given script Modified: trunk/crossfire/src/cfeditor/gui/ScriptManager.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-06-11 15:37:10 UTC (rev 144) @@ -53,7 +53,7 @@ private final HashMap components = new HashMap(); - private static final long serialVersionUID = -3819064077177259928L; + private static final long serialVersionUID = 1L; /** @throws java.awt.HeadlessException */ public ScriptManager(final CScriptController scriptController) { Modified: trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2006-06-11 15:37:10 UTC (rev 144) @@ -41,7 +41,7 @@ private class TooltipSpinner extends JSpinner { - private static final long serialVersionUID = 5134878830296936975L; + private static final long serialVersionUID = 1L; public TooltipSpinner() { super(); Modified: trunk/crossfire/src/cfeditor/parameter/MapParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2006-06-11 15:37:10 UTC (rev 144) @@ -87,7 +87,7 @@ */ public class MyCellRenderer extends DefaultListCellRenderer { - private static final long serialVersionUID = 7664767338340779298L; + private static final long serialVersionUID = 1L; public MyCellRenderer() { super(); @@ -122,7 +122,7 @@ private Object selected = null; - private static final long serialVersionUID = -9203046166810105260L; + private static final long serialVersionUID = 1L; public MyComboBoxModel() { super(); Modified: trunk/crossfire/src/cfeditor/parameter/ParameterDescriptionEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/ParameterDescriptionEditor.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/parameter/ParameterDescriptionEditor.java 2006-06-11 15:37:10 UTC (rev 144) @@ -22,7 +22,7 @@ private final PluginParameter parameter; - private static final long serialVersionUID = 3240105882190854344L; + private static final long serialVersionUID = 1L; public ParameterDescriptionEditor(final PluginParameter param) { super(); Modified: trunk/crossfire/src/cfeditor/parameter/ParameterNameEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/ParameterNameEditor.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/parameter/ParameterNameEditor.java 2006-06-11 15:37:10 UTC (rev 144) @@ -22,7 +22,7 @@ private final PluginParameter parameter; - private static final long serialVersionUID = 8115567486952666272L; + private static final long serialVersionUID = 1L; public ParameterNameEditor(final PluginParameter param) { super(); Modified: trunk/crossfire/src/cfeditor/parameter/ParameterTypeEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/ParameterTypeEditor.java 2006-06-11 15:20:57 UTC (rev 143) +++ trunk/crossfire/src/cfeditor/parameter/ParameterTypeEditor.java 2006-06-11 15:37:10 UTC (rev 144) @@ -26,7 +26,7 @@ private final CScriptModel theScript; - private static final long serialVersionUID = -4478213043766173573L; + private static final long serialVersionUID = 1L; public ParameterTypeEditor(final CScriptModel script, final PluginParameter param) { super(PluginParameterFactory.getTypes()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-06-22 18:15:26
|
Revision: 172 Author: akirschbaum Date: 2006-06-22 11:15:11 -0700 (Thu, 22 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=172&view=rev Log Message: ----------- Unify variable names. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/map/MapArchObject.java trunk/crossfire/src/cfeditor/map/MapModel.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-06-22 17:55:24 UTC (rev 171) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-06-22 18:15:11 UTC (rev 172) @@ -376,13 +376,13 @@ * @param x starting x-coord for floodfill * @param y starting y-coord for floodfill * @param arch ArchObject to fill with - * @param is_defarch true when 'arch' is a default arch + * @param isDefarch true when 'arch' is a default arch */ - private static void floodfill(final MapControl mapControl, final int x, final int y, final ArchObject arch, final boolean is_defarch) { + private static void floodfill(final MapControl mapControl, final int x, final int y, final ArchObject arch, final boolean isDefarch) { final Point p = new Point(x, y); // insert new arch to x, y - //m_ctrl.addArchToMap(mainControl.getPanelArch(), p, 0, MapModel.JOIN_DISABLE); - if (is_defarch) { + //mapControl.addArchToMap(mainControl.getPanelArch(), p, 0, MapModel.JOIN_DISABLE); + if (isDefarch) { mapControl.addArchToMap(arch.getNodeNr(), p, 0, MapModel.JOIN_DISABLE); } else { // insert arch-clone from pickmap @@ -391,16 +391,16 @@ // now go recursive into all four directions if (mapControl.pointValid(x - 1, y) && !mapControl.containsArchObject(x - 1, y)) { - floodfill(mapControl, x - 1, y, arch, is_defarch); + floodfill(mapControl, x - 1, y, arch, isDefarch); } if (mapControl.pointValid(x, y - 1) && !mapControl.containsArchObject(x, y - 1)) { - floodfill(mapControl, x, y - 1, arch, is_defarch); + floodfill(mapControl, x, y - 1, arch, isDefarch); } if (mapControl.pointValid(x + 1, y) && !mapControl.containsArchObject(x + 1, y)) { - floodfill(mapControl, x + 1, y, arch, is_defarch); + floodfill(mapControl, x + 1, y, arch, isDefarch); } if (mapControl.pointValid(x, y + 1) && !mapControl.containsArchObject(x, y + 1)) { - floodfill(mapControl, x, y + 1, arch, is_defarch); + floodfill(mapControl, x, y + 1, arch, isDefarch); } } Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-06-22 17:55:24 UTC (rev 171) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-06-22 18:15:11 UTC (rev 172) @@ -717,9 +717,9 @@ pathFrame = new JDialog(CMainControl.getInstance().getMainView(), "Edit Parameters", true); pathFrame.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); - final JPanel main_panel = new JPanel(); - main_panel.setLayout(new BoxLayout(main_panel, BoxLayout.Y_AXIS)); - main_panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 2, 5)); + final JPanel mainPanel = new JPanel(); + mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); + mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 2, 5)); // input line: script path final JPanel line1 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -727,7 +727,7 @@ line1.add(text1); inputFPath = new JTextField(filePath, 20); line1.add(inputFPath); - main_panel.add(line1); + mainPanel.add(line1); // input line: plugin name final JPanel line2 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -735,7 +735,7 @@ line2.add(text2); inputPlName = new JTextField(pluginName, 20); line2.add(inputPlName); - main_panel.add(line2); + mainPanel.add(line2); // input line: event options final JPanel line3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -743,8 +743,8 @@ line3.add(text3); inputEEOptions = new JTextField(eventOptions, 20); line3.add(inputEEOptions); - main_panel.add(line3); - main_panel.add(Box.createVerticalStrut(5)); + mainPanel.add(line3); + mainPanel.add(Box.createVerticalStrut(5)); // button panel: final JPanel line4 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -759,9 +759,9 @@ ccListener.setTargetEvent(this); cancelButton.addActionListener(ccListener); line4.add(cancelButton); - main_panel.add(line4); + mainPanel.add(line4); - pathFrame.getContentPane().add(main_panel); + pathFrame.getContentPane().add(mainPanel); pathFrame.pack(); pathFrame.setLocationRelativeTo(CMainControl.getInstance().getMainView()); pathFrame.setVisible(true); Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-06-22 17:55:24 UTC (rev 171) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-06-22 18:15:11 UTC (rev 172) @@ -51,19 +51,19 @@ private static final Logger log = Logger.getLogger(DefaultMapModel.class); /** The MapArchObject; it contains global map attributes. */ - private MapArchObject m_mapArch = null; + private MapArchObject mapArch = null; /** * Level grid data. Contains all arches grid-wise. Its size is - * m_mapGrid[m_mapWidth][m_mapHeight]. Can never be null. + * mapGrid[m_mapWidth][m_mapHeight]. Can never be null. */ - private ArchObject[][] m_mapGrid; + private ArchObject[][] mapGrid; /** Size of this map. */ private final Dimension mapSize = new Dimension(); /** Flag that indicates if the level has been changed since last save. */ - private boolean m_fLevelChanged = false; + private boolean levelChanged = false; /** CMainControl. */ private final CMainControl mainControl; @@ -82,11 +82,11 @@ mapControl = control; mapSize.setSize(map.getMapSize()); - m_mapGrid = initMap(); + mapGrid = initMap(); - m_mapArch = map; + mapArch = map; - m_mapArch.setMapSize(mapSize); + mapArch.setMapSize(mapSize); } /** @@ -101,7 +101,7 @@ return null; } - return m_mapGrid[pos.x][pos.y]; + return mapGrid[pos.x][pos.y]; } /** @@ -109,8 +109,8 @@ * @param str the new description text */ public void setNewMapText(final String str) { - m_mapArch.resetText(); - m_mapArch.addText(str); + mapArch.resetText(); + mapArch.addText(str); } /** @@ -118,7 +118,7 @@ * @return the map description text */ public String getMapText() { - return m_mapArch.getText(); + return mapArch.getText(); } /** @@ -146,12 +146,12 @@ /** Reset the level changed flag to false. */ public void resetLevelChangedFlag() { - if (!m_fLevelChanged) { + if (!levelChanged) { return; } // change status and update title bar - m_fLevelChanged = false; + levelChanged = false; if (mapControl.getMapView() != null) { mapControl.getMapView().changedFlagNotify(); } @@ -159,12 +159,12 @@ /** Set the level changed flag to true. */ public void setLevelChangedFlag() { - if (m_fLevelChanged) { + if (levelChanged) { return; } // change status and update title bar - m_fLevelChanged = true; + levelChanged = true; if (mapControl.getMapView() != null) { mapControl.getMapView().changedFlagNotify(); } @@ -180,7 +180,7 @@ * @return true=level has changed */ public boolean isLevelChanged() { - return m_fLevelChanged; + return levelChanged; } /** @@ -223,7 +223,7 @@ return null; } - return m_mapGrid[pos.x][pos.y]; + return mapGrid[pos.x][pos.y]; } @Deprecated public ArchObject getTopArchObject(final int x, final int y) { @@ -255,7 +255,7 @@ throw new IllegalArgumentException(); } - m_mapGrid[pos.x][pos.y] = arch; + mapGrid[pos.x][pos.y] = arch; } /** @@ -298,7 +298,7 @@ /** Check whether a given location contains at least one ArchObject. */ public boolean containsArchObject(final Point pos) { - return pointValid(pos) && m_mapGrid[pos.x][pos.y] != null; + return pointValid(pos) && mapGrid[pos.x][pos.y] != null; } /** @@ -386,7 +386,7 @@ if (arch.getPrevArch() != null) { arch.getPrevArch().setNextArch(arch); } else { - m_mapGrid[arch.getMapX()][arch.getMapY()] = arch; + mapGrid[arch.getMapX()][arch.getMapY()] = arch; } arch.propagateElevation(prev); @@ -426,7 +426,7 @@ if (arch.getPrevArch() != null) { arch.getPrevArch().setNextArch(arch); } else { - m_mapGrid[arch.getMapX()][arch.getMapY()] = arch; + mapGrid[arch.getMapX()][arch.getMapY()] = arch; } arch.propagateElevation(prev); @@ -436,8 +436,8 @@ } } - @Deprecated public boolean addArchToMap(final int archnr, final int xx, final int yy, final int intern, final boolean join, final boolean insert_below) { - return addArchToMap(archnr, new Point(xx, yy), intern, join, insert_below); + @Deprecated public boolean addArchToMap(final int archnr, final int xx, final int yy, final int intern, final boolean join, final boolean insertBelow) { + return addArchToMap(archnr, new Point(xx, yy), intern, join, insertBelow); } /** @@ -449,11 +449,11 @@ * inserted per square * @param join if set to JOIN_ENABLE auto-joining is supported; autojoining * is only done if enabled in the main control - * @param insert_below true: new arch is inserted on top, false: new arch is + * @param insertBelow true: new arch is inserted on top, false: new arch is * inserted below * @return true if insertion successful, false if not */ - public boolean addArchToMap(int archnr, final Point pos, final int intern, final boolean join, final boolean insert_below) { + public boolean addArchToMap(int archnr, final Point pos, final int intern, final boolean join, final boolean insertBelow) { ArchObject newarch, oldarch, startarch; // our new suckers (copys, not ref ptrs) if (archnr < 0 || archnr >= mainControl.getArchObjectStack().getArchCount() @@ -493,13 +493,13 @@ oldarch = newarch; // insert ít in map or add to arch in map - ArchObject node = m_mapGrid[mapx][mapy]; + ArchObject node = mapGrid[mapx][mapy]; if (node == null) { - m_mapGrid[mapx][mapy] = newarch; - m_mapGrid[mapx][mapy].setMapX(mapx); - m_mapGrid[mapx][mapy].setMapY(mapy); + mapGrid[mapx][mapy] = newarch; + mapGrid[mapx][mapy].setMapX(mapx); + mapGrid[mapx][mapy].setMapY(mapy); } else { - if (!insert_below) { + if (!insertBelow) { // if we want to insert on top, we need to get last node element for (int i = 0; node.getNextArch() != null; i++) { node = node.getNextArch(); @@ -513,7 +513,7 @@ //ArchObject tmp = node; node.setPrevArch(newarch); newarch.setNextArch(node); - m_mapGrid[mapx][mapy] = newarch; + mapGrid[mapx][mapy] = newarch; newarch.setMapX(mapx); newarch.setMapY(mapy); newarch.propagateElevation(node); @@ -581,7 +581,7 @@ } // jump to the end of the list (-> grab "topmost" arch) - for (node = m_mapGrid[pos.x][pos.y]; + for (node = mapGrid[pos.x][pos.y]; node != null && node.getNextArch() != null; node = node.getNextArch()) { ; @@ -626,10 +626,10 @@ * that the given 'arch' is a new and unlinked object. * @param arch the new arch to be linked onto the map. (Dest. * coordinates must be set (arch.mapx/y)!) - * @param insert_below true: new arch is inserted on top, false: new arch + * @param insertBelow true: new arch is inserted on top, false: new arch * is inserted below */ - public void addArchObjectToMap(final ArchObject arch, final boolean insert_below) { + public void addArchObjectToMap(final ArchObject arch, final boolean insertBelow) { ArchObject oldarch, startarch; // our new suckers (copys, not ref ptrs) // Make sure this arch has the proper edit_type @@ -652,13 +652,13 @@ oldarch = arch; // insert ít in map or add to arch in map - ArchObject node = m_mapGrid[mapx][mapy]; + ArchObject node = mapGrid[mapx][mapy]; if (node == null) { - m_mapGrid[mapx][mapy] = arch; - m_mapGrid[mapx][mapy].setMapX(mapx); - m_mapGrid[mapx][mapy].setMapY(mapy); + mapGrid[mapx][mapy] = arch; + mapGrid[mapx][mapy].setMapX(mapx); + mapGrid[mapx][mapy].setMapY(mapy); } else { - if (!insert_below) { + if (!insertBelow) { // if we want to insert on top, we need to get last node element for (int i = 0; node.getNextArch() != null; i++) { node = node.getNextArch(); @@ -672,7 +672,7 @@ // insert below, so just put it on first place node.setPrevArch(arch); arch.setNextArch(node); - m_mapGrid[mapx][mapy] = arch; + mapGrid[mapx][mapy] = arch; arch.setMapX(mapx); arch.setMapY(mapy); arch.propagateElevation(node); @@ -703,7 +703,7 @@ @Nullable public ArchObject getMapArch(final int id, final Point pos) { ArchObject node; - if (m_mapGrid == null || pos.x < 0 || pos.x >= mapSize.width || pos.y < 0 || pos.y >= mapSize.height) { + if (mapGrid == null || pos.x < 0 || pos.x >= mapSize.width || pos.y < 0 || pos.y >= mapSize.height) { return null; } @@ -751,8 +751,8 @@ return null; } - @Deprecated public void deleteMapArch(final int id, final int xx, final int yy, final boolean refresh_map, final boolean join) { - deleteMapArch(id, new Point(xx, yy), refresh_map, join); + @Deprecated public void deleteMapArch(final int id, final int xx, final int yy, final boolean refreshMap, final boolean join) { + deleteMapArch(id, new Point(xx, yy), refreshMap, join); } /** @@ -761,11 +761,11 @@ * inventory.) * @param id ID of the arch to be removed (->arch.getMyID()) * @param pos location of the arch to be removed - * @param refresh_map If true, mapview is redrawn after deletion. Keep in + * @param refreshMap If true, mapview is redrawn after deletion. Keep in * mind: drawing consumes time! * @param join if set to JOIN_ENABLE auto-joining is supported */ - public void deleteMapArch(final int id, final Point pos, final boolean refresh_map, final boolean join) { + public void deleteMapArch(final int id, final Point pos, final boolean refreshMap, final boolean join) { // first, try to find the tile we had selected final Iterator it = getArchObjectsDeleteArchMapObject(pos); while (it.hasNext()) { @@ -794,7 +794,7 @@ } setLevelChangedFlag(); // the map has been modified - if (refresh_map) { + if (refreshMap) { mainControl.refreshCurrentMap(); // redraw } } @@ -847,7 +847,7 @@ if (prev == null) { // if some up (or null), put this on start - m_mapGrid[mapx][mapy] = next; + mapGrid[mapx][mapy] = next; if (next != null) { // if there one up, mark them as starter next.setPrevArch(null); } @@ -885,8 +885,8 @@ public void freeMapArchObject() { for (int x = 0; x < mapSize.width; x++) { for (int y = 0; y < mapSize.height; y++) { - while (m_mapGrid[x][y] != null) { - deleteArchMapObject(m_mapGrid[x][y]); + while (mapGrid[x][y] != null) { + deleteArchMapObject(mapGrid[x][y]); } } } @@ -897,7 +897,7 @@ * @param strFileName the new map filename */ public void setFileName(final String strFileName) { - m_mapArch.setFileName(strFileName); + mapArch.setFileName(strFileName); } /** @@ -905,7 +905,7 @@ * @return the map filename */ public String getFileName() { - return m_mapArch.getFileName(); + return mapArch.getFileName(); } /** @@ -913,7 +913,7 @@ * @param name the new map name */ public void setMapName(final String name) { - m_mapArch.setMapName(name); + mapArch.setMapName(name); } /** @@ -921,12 +921,12 @@ * @return the map name */ public String getMapName() { - return m_mapArch.getMapName(); + return mapArch.getMapName(); } /** ??? */ public String getMapNameWithoutMusic() { - return m_mapArch.getMapNameWithoutMusic(); + return mapArch.getMapNameWithoutMusic(); } /** @@ -934,7 +934,7 @@ * @return the map object */ public MapArchObject getMapArchObject() { - return m_mapArch; + return mapArch; } @Deprecated public boolean pointValid(final int posx, final int posy) { @@ -1001,7 +1001,7 @@ // search the right stripe (as far as being cut off) for (int x = newSize.width; x < mapSize.width; x++) { for (int y = 0; y < mapSize.height; y++) { - if (m_mapGrid[x][y] != null) { + if (mapGrid[x][y] != null) { return true; } } @@ -1012,7 +1012,7 @@ // search the bottom stripe (as far as being cut off) for (int y = newSize.height; y < mapSize.height; y++) { for (int x = 0; x < mapSize.width; x++) { - if (m_mapGrid[x][y] != null) { + if (mapGrid[x][y] != null) { return true; } } @@ -1089,16 +1089,16 @@ // relink all arches to the new grid for (int x = 0; x < Math.min(newSize.width, mapSize.width); x++) { for (int y = 0; y < Math.min(newSize.height, mapSize.height); y++) { - newGrid[x][y] = m_mapGrid[x][y]; + newGrid[x][y] = mapGrid[x][y]; } } // replace old grid by new one - m_mapGrid = newGrid; + mapGrid = newGrid; // adjust the map and model attributes mapSize.setSize(newSize.width, newSize.height); - m_mapArch.setMapSize(newSize); + mapArch.setMapSize(newSize); // an important last point: if there is a highlighted area in a region // that got cut off - unhilight it! @@ -1180,7 +1180,7 @@ m_levelGrid[x][y] |= data&m_dataMask; // Level data has changed - m_fLevelChanged = true; + levelChanged = true; mapControl.repaint(); } Modified: trunk/crossfire/src/cfeditor/map/MapArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-06-22 17:55:24 UTC (rev 171) +++ trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-06-22 18:15:11 UTC (rev 172) @@ -74,16 +74,16 @@ private Dimension mapSize = new Dimension(); /** Default enter coordinates (usage not recommended). */ - private int enter_x, enter_y; + private int enterX, enterY; /** Number of seconds that need to elapse before this map will be reset. */ - private int reset_timeout; + private int resetTimeout; /** * Number of ticks that must elapse after tha map has not been used before * it gets swapped out. */ - private int swap_time; + private int swapTime; /** * Map difficulty. If zero, server calculates something. @@ -94,7 +94,7 @@ * If nonzero, the map reset time will not be updated when someone enters / * exits the map. */ - private boolean fixed_resettime; + private boolean fixedResettime; /** * Light / darkness of map (overall). Zero means fully bright. @@ -147,28 +147,28 @@ private int shopmax; /** No magic spells. */ - private boolean no_magic; + private boolean noMagic; /** No prayers. */ - private boolean no_priest; + private boolean noPriest; /** No harmful spells allowed. */ - private boolean no_harm; + private boolean noHarm; /** No summoning allowed. */ - private boolean no_summon; + private boolean noSummon; /** Check map reset status after re-login. */ - private boolean fixed_login; + private boolean fixedLogin; /** Permanent death with revivable corpses. */ - private boolean perm_death; + private boolean permDeath; /** Permament death with corpses temporarily available. */ - private boolean ultra_death; + private boolean ultraDeath; /** Permanent death with instant character deletion. */ - private boolean ultimate_death; + private boolean ultimateDeath; /** Player vs Player combat allowed. */ private boolean pvp; @@ -189,7 +189,7 @@ * The map tile paths used for map tiling. * 0 = north, 1 = east, 2 = south, 3 = west. */ - private final String[] tile_path = new String[MAX_TILE]; + private final String[] tilePath = new String[MAX_TILE]; /** * Constructor, set default values @@ -199,32 +199,32 @@ * that? Made it public so beanshell script can use this object */ public MapArchObject() { - enter_x = 0; - enter_y = 0; - reset_timeout = 0; - swap_time = 0; + enterX = 0; + enterY = 0; + resetTimeout = 0; + swapTime = 0; difficulty = 0; darkness = 0; for (int i = 0; i < MAX_TILE; i++) { - tile_path[i] = ""; + tilePath[i] = ""; } name = DEFAULT_MAP_NAME; // map creation enforces setting a real map name filename = IGUIConstants.DEF_MAPFNAME; // default map file name - fixed_resettime = false; + fixedResettime = false; unique = false; template = false; outdoor = false; nosmooth = false; // iso flags - no_magic = false; - no_priest = false; - no_summon = false; - fixed_login = false; - perm_death = false; - ultra_death = false; - ultimate_death = false; + noMagic = false; + noPriest = false; + noSummon = false; + fixedLogin = false; + permDeath = false; + ultraDeath = false; + ultimateDeath = false; pvp = false; } @@ -295,10 +295,10 @@ /** * Set the map name. - * @param new_name new map name + * @param newName new map name */ - public void setMapName(final String new_name) { - name = new_name; + public void setMapName(final String newName) { + name = newName; } /** @@ -311,42 +311,42 @@ /** * Set the map filename. - * @param new_name new map filename + * @param newName new map filename */ - public void setFileName(final String new_name) { - filename = new_name; + public void setFileName(final String newName) { + filename = newName; } public int getEnterX() { - return enter_x; + return enterX; } public void setEnterX(final int x) { - enter_x = x; + enterX = x; } public int getEnterY() { - return enter_y; + return enterY; } public void setEnterY(final int y) { - enter_y = y; + enterY = y; } public int getResetTimeout() { - return reset_timeout; + return resetTimeout; } public void setResetTimeout(final int n) { - reset_timeout = n; + resetTimeout = n; } public int getSwapTime() { - return swap_time; + return swapTime; } public void setSwapTime(final int n) { - swap_time = n; + swapTime = n; } public int getDifficulty() { @@ -358,11 +358,11 @@ } public boolean isFixedReset() { - return fixed_resettime; + return fixedResettime; } public void setFixedReset(final boolean b) { - fixed_resettime = b; + fixedResettime = b; } public int getDarkness() { @@ -406,35 +406,35 @@ } public String getTilePath(final int n) { - return tile_path[n]; + return tilePath[n]; } public void setTilePath(final int n, final String s) { - tile_path[n] = s; + tilePath[n] = s; } public String getMapRegion() { return region; } - public void setMapRegion(final String new_region) { - region = new_region; + public void setMapRegion(final String newRegion) { + region = newRegion; } public String getShopItems() { return shopitems; } - public void setShopItems(final String new_shopitems) { - shopitems = new_shopitems; + public void setShopItems(final String newShopitems) { + shopitems = newShopitems; } public String getShopRace() { return shoprace; } - public void setShopRace(final String new_shoprace) { - shoprace = new_shoprace; + public void setShopRace(final String newShoprace) { + shoprace = newShoprace; } public int getShopMin() { @@ -510,67 +510,67 @@ } public boolean isNoMagic() { - return no_magic; + return noMagic; } public void setNoMagic(final boolean b) { - no_magic = b; + noMagic = b; } public boolean isNoPriest() { - return no_priest; + return noPriest; } public void setNoPriest(final boolean b) { - no_priest = b; + noPriest = b; } public boolean isNoSummon() { - return no_summon; + return noSummon; } public void setNoSummon(final boolean b) { - no_summon = b; + noSummon = b; } public boolean isNoHarm() { - return no_harm; + return noHarm; } public void setNoHarm(final boolean b) { - no_harm = b; + noHarm = b; } public boolean isFixedLogin() { - return fixed_login; + return fixedLogin; } public void setFixedLogin(final boolean b) { - fixed_login = b; + fixedLogin = b; } public boolean isPermDeath() { - return perm_death; + return permDeath; } public void setPermDeath(final boolean b) { - perm_death = b; + permDeath = b; } public boolean isUltraDeath() { - return ultra_death; + return ultraDeath; } public void setUltraDeath(final boolean b) { - ultra_death = b; + ultraDeath = b; } public boolean isUltimateDeath() { - return ultimate_death; + return ultimateDeath; } public void setUltimateDeath(final boolean b) { - ultimate_death = b; + ultimateDeath = b; } public boolean isPvp() { @@ -623,7 +623,7 @@ } /** @return true if the mapsize is zero */ - public boolean size_null() { + public boolean sizeNull() { return mapSize.width <= 0 && mapSize.height <= 0; } @@ -642,13 +642,13 @@ boolean msgflag = false; // flag for map-message boolean loreflag = false; // flag for lore-text boolean archflag = false; // flag for arch<->end - boolean end_reached = false; // true when end of maparch is reached + boolean endReached = false; // true when end of maparch is reached filename = fname; // store file name try { // read lines - while ((!end_reached && (line2 = reader.readLine()) != null)) { + while ((!endReached && (line2 = reader.readLine()) != null)) { final String line = line2.trim(); if (archflag) { @@ -681,7 +681,7 @@ if (line.equalsIgnoreCase(TAG_START_LORE)) { loreflag = true; } else if (line.equalsIgnoreCase("end")) { - end_reached = true; + endReached = true; } else if (line.startsWith("name")) { name = line.substring(line.indexOf(" ") + 1).trim(); } else if (line.startsWith("region")) { @@ -691,20 +691,20 @@ } else if (line.startsWith("height") || line.startsWith("y ")) { mapSize.height = getLineValue(line); } else if (line.startsWith("enter_x") || line.startsWith("hp")) { - enter_x = getLineValue(line); + enterX = getLineValue(line); } else if (line.startsWith("enter_y") || line.startsWith("sp")) { - enter_y = getLineValue(line); + enterY = getLineValue(line); } else if (line.startsWith("reset_timeout") || line.startsWith("weight")) { - reset_timeout = getLineValue(line); + resetTimeout = getLineValue(line); } else if (line.startsWith("swap_time") || line.startsWith("value")) { - swap_time = getLineValue(line); + swapTime = getLineValue(line); } else if (line.startsWith("difficulty") || line.startsWith("level")) { difficulty = getLineValue(line); } else if (line.startsWith("darkness") || line.startsWith("invisible")) { darkness = getLineValue(line); } else if (line.startsWith("fixed_resettime") || line.startsWith("stand_still")) { if (getLineValue(line) != 0) { - fixed_resettime = true; + fixedResettime = true; } } else if (line.startsWith("unique")) { if (getLineValue(line) != 0) { @@ -727,7 +727,7 @@ try { i = Integer.valueOf(line.substring(10, 11)).intValue(); // direction if (i > 0 && i <= MAX_TILE && line.lastIndexOf(" ") > 0) { - tile_path[i - 1] = line.substring(line.lastIndexOf(" ") + 1); + tilePath[i - 1] = line.substring(line.lastIndexOf(" ") + 1); } } catch (NumberFormatException e) { } @@ -755,35 +755,35 @@ sky = getLineValue(line); } else if (IGUIConstants.isoView && line.startsWith("no_magic")) { if (getLineValue(line) != 0) { - no_magic = true; + noMagic = true; } } else if (IGUIConstants.isoView && line.startsWith("no_priest")) { if (getLineValue(line) != 0) { - no_priest = true; + noPriest = true; } } else if (IGUIConstants.isoView && line.startsWith("no_summon")) { if (getLineValue(line) != 0) { - no_summon = true; + noSummon = true; } } else if (IGUIConstants.isoView && line.startsWith("no_harm")) { if (getLineValue(line) != 0) { - no_harm = true; + noHarm = true; } } else if (IGUIConstants.isoView && line.startsWith("fixed_login")) { if (getLineValue(line) != 0) { - fixed_login = true; + fixedLogin = true; } } else if (IGUIConstants.isoView && line.startsWith("perm_death")) { if (getLineValue(line) != 0) { - perm_death = true; + permDeath = true; } } else if (IGUIConstants.isoView && line.startsWith("ultra_death")) { if (getLineValue(line) != 0) { - ultra_death = true; + ultraDeath = true; } } else if (IGUIConstants.isoView && line.startsWith("ultimate_death")) { if (getLineValue(line) != 0) { - ultimate_death = true; + ultimateDeath = true; } } else if (IGUIConstants.isoView && line.startsWith("pvp")) { if (getLineValue(line) != 0) { @@ -851,13 +851,13 @@ if (name.length() > 0 && !name.equals(DEFAULT_MAP_NAME)) { stream.write("name " + name + "\n"); } - if (swap_time > 0) { - stream.write("swap_time " + swap_time + "\n"); + if (swapTime > 0) { + stream.write("swap_time " + swapTime + "\n"); } - if (reset_timeout > 0) { - stream.write("reset_timeout " + reset_timeout + "\n"); + if (resetTimeout > 0) { + stream.write("reset_timeout " + resetTimeout + "\n"); } - if (fixed_resettime) { + if (fixedResettime) { stream.write("fixed_resettime 1\n"); } if (difficulty > 0) { @@ -890,11 +890,11 @@ if (mapSize.height > 0) { stream.write("height " + mapSize.height + "\n"); } - if (enter_x > 0) { - stream.write("enter_x " + enter_x + "\n"); + if (enterX > 0) { + stream.write("enter_x " + enterX + "\n"); } - if (enter_y > 0) { - stream.write("enter_y " + enter_y + "\n"); + if (enterY > 0) { + stream.write("enter_y " + enterY + "\n"); } if (msgText.length() > 0 && msgText.toString().trim().length() > 0) { stream.write(TAG_START_TEXT + "\n"); @@ -934,36 +934,36 @@ stream.write("sky " + sky + "\n"); } for (i = 0; i < MAX_TILE; i++) { - if (tile_path[i].length() > 0) { - stream.write("tile_path_" + (i + 1) + " " + tile_path[i] + "\n"); + if (tilePath[i].length() > 0) { + stream.write("tile_path_" + (i + 1) + " " + tilePath[i] + "\n"); } } if (nosmooth) { stream.write("nosmooth 1\n"); } if (IGUIConstants.isoView) { - if (no_magic) { + if (noMagic) { stream.write("no_magic 1\n"); } - if (no_priest) { + if (noPriest) { stream.write("no_priest 1\n"); } - if (no_summon) { + if (noSummon) { stream.write("no_summon 1\n"); } - if (no_harm) { + if (noHarm) { stream.write("no_harm 1\n"); } - if (fixed_login) { + if (fixedLogin) { stream.write("fixed_login 1\n"); } - if (perm_death) { + if (permDeath) { stream.write("perm_death 1\n"); } - if (ultra_death) { + if (ultraDeath) { stream.write("ultra_death 1\n"); } - if (ultimate_death) { + if (ultimateDeath) { stream.write("ultimate_death 1\n"); } if (pvp) { Modified: trunk/crossfire/src/cfeditor/map/MapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapModel.java 2006-06-22 17:55:24 UTC (rev 171) +++ trunk/crossfire/src/cfeditor/map/MapModel.java 2006-06-22 18:15:11 UTC (rev 172) @@ -48,16 +48,16 @@ Dimension getMapSize(); - @Deprecated boolean addArchToMap(int archnr, int xx, int yy, int intern, boolean join, boolean insert_below); - boolean addArchToMap(int archnr, Point pos, int intern, boolean join, boolean insert_below); + @Deprecated boolean addArchToMap(int archnr, int xx, int yy, int intern, boolean join, boolean insertBelow); + boolean addArchToMap(int archnr, Point pos, int intern, boolean join, boolean insertBelow); @Deprecated boolean insertArchToMap(ArchObject newarch, int archnr, ArchObject next, int mapx, int mapy, boolean join); boolean insertArchToMap(ArchObject newarch, int archnr, ArchObject next, Point pos, boolean join); void addArchObjectToMap(ArchObject arch, boolean insertBelow); - @Deprecated void deleteMapArch(int id, int xx, int yy, boolean refresh_map, boolean join); - void deleteMapArch(int id, Point pos, boolean refresh_map, boolean join); + @Deprecated void deleteMapArch(int id, int xx, int yy, boolean refreshMap, boolean join); + void deleteMapArch(int id, Point pos, boolean refreshMap, boolean join); @Deprecated @Nullable ArchObject getMapArch(int id, int xx, int yy); @Nullable ArchObject getMapArch(int id, Point pos); Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-06-22 17:55:24 UTC (rev 171) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-06-22 18:15:11 UTC (rev 172) @@ -277,9 +277,9 @@ /** * Redraws the whole menu with latest custom fonts. - * @param do_redraw if true, menu is redrawn at the end + * @param doRedraw if true, menu is redrawn at the end */ - public void updateFont(final boolean do_redraw) { + public void updateFont(final boolean doRedraw) { if (!control.isStandAlone()) { // File menu: control.getMainControl().setBoldFont(menuFile); @@ -303,7 +303,7 @@ control.getMainControl().setBoldFont(miColors); } - if (do_redraw) { + if (doRedraw) { // redraw the menu bar refresh(); if (getGraphics() != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-06-25 20:20:22
|
Revision: 202 Author: akirschbaum Date: 2006-06-25 13:20:04 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=202&view=rev Log Message: ----------- Make the crossfire editor compilable. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CNewMapDialog.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/map/MapArchObject.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/map/MapModel.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import static net.sf.japi.swing.ActionFactory.getFactory; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectParser; @@ -54,6 +53,7 @@ import javax.swing.filechooser.FileFilter; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; +import net.sf.gridarta.Size2D; import net.sf.japi.util.filter.file.EndingFileFilter; import net.sf.japi.swing.ActionFactory; import net.sf.gridarta.GridderException; Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapModel; @@ -41,6 +40,7 @@ import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; +import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; /** Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import java.awt.BorderLayout; @@ -55,6 +54,7 @@ import javax.swing.border.TitledBorder; import net.sf.gridarta.GridderException; import net.sf.gridarta.help.Help; +import net.sf.gridarta.Size2D; /** * Dialog used to ask the user the properties for the new level. Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectStack; import cfeditor.filter.AttributeFilter; @@ -53,6 +52,7 @@ import javax.swing.JComponent; import javax.swing.JScrollPane; import javax.swing.JViewport; +import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; Modified: trunk/crossfire/src/cfeditor/CNewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObjectStack; import cfeditor.map.MapArchObject; import java.awt.BorderLayout; @@ -45,6 +44,7 @@ import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; +import net.sf.gridarta.Size2D; /** * Dialog used to ask the user the properties for the new level. Contains a Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.map.DefaultMapModel; import cfeditor.map.MapArchObject; @@ -32,6 +31,7 @@ import cfeditor.map.MapModel; import java.awt.Point; import java.util.Iterator; +import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; /** Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.map.MapControl; import java.awt.Color; @@ -47,6 +46,7 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; +import net.sf.gridarta.Size2D; /** * This dialog manages the replace action. Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor.map; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectIterator; import cfeditor.arch.ArchObjectIteratorDeleteArchMapObject; @@ -38,6 +37,7 @@ import cfeditor.IGUIConstants; import java.awt.Point; import java.util.Iterator; +import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; Modified: trunk/crossfire/src/cfeditor/map/MapArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,11 +24,11 @@ package cfeditor.map; -import app.net.sf.gridarta.Size2D; import cfeditor.IGUIConstants; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; +import net.sf.gridarta.Size2D; /** * MapArchObject contains the specific meta data about a map that is stored in Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor.map; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectIterator; import cfeditor.arch.ArchObjectIteratorDeleteMapArch; @@ -38,6 +37,7 @@ import java.io.File; import java.util.Iterator; import net.sf.gridarta.GridderException; +import net.sf.gridarta.Size2D; /** * The <code>MapControl</code> Modified: trunk/crossfire/src/cfeditor/map/MapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapModel.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/map/MapModel.java 2006-06-25 20:20:04 UTC (rev 202) @@ -1,12 +1,12 @@ package cfeditor.map; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectIterator; import cfeditor.arch.ArchObjectIteratorDeleteArchMapObject; import cfeditor.arch.ArchObjectIteratorDeleteMapArch; import java.awt.Point; import java.util.Iterator; +import net.sf.gridarta.Size2D; import org.jetbrains.annotations.Nullable; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-06-25 20:33:43
|
Revision: 205 Author: akirschbaum Date: 2006-06-25 13:33:34 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=205&view=rev Log Message: ----------- Remove unused import statements. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-25 20:24:09 UTC (rev 204) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-25 20:33:34 UTC (rev 205) @@ -27,7 +27,6 @@ import cfeditor.arch.ArchObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapModel; -import java.awt.Dimension; import java.awt.Point; import java.io.BufferedReader; import java.io.BufferedWriter; Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-06-25 20:24:09 UTC (rev 204) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-06-25 20:33:34 UTC (rev 205) @@ -27,7 +27,6 @@ import cfeditor.arch.ArchObject; import cfeditor.map.MapControl; import java.awt.Color; -import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Point; import java.awt.event.ActionEvent; Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-06-25 20:24:09 UTC (rev 204) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-06-25 20:33:34 UTC (rev 205) @@ -31,7 +31,6 @@ import daieditor.IGUIConstants; import daieditor.arch.ArchObject; import daieditor.arch.ArchObjectParser; -import java.awt.Dimension; import java.awt.Point; import java.awt.Toolkit; import java.util.ArrayList; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-07-02 18:58:11
|
Revision: 229 Author: akirschbaum Date: 2006-07-02 11:57:56 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=229&view=rev Log Message: ----------- Unify ArchObjectIterator implementation; unify method names in ArchObject. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/crossfire/src/cfeditor/arch/ArchObject.java trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2006-07-02 12:48:06 UTC (rev 228) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2006-07-02 18:57:56 UTC (rev 229) @@ -315,7 +315,7 @@ @Nullable private ArchObject findArchOfJoinlist(final MapModel map, final int x, final int y) { ArchObject tmpArch = map.getTopArchObject(x, y); // we look through the arches at the given location (top to bottom): - for (; tmpArch != null; tmpArch = tmpArch.getPrevArch()) { + for (; tmpArch != null; tmpArch = tmpArch.getPrev()) { if (stack.getArch(tmpArch.getNodeNr()).getJoinList() == this) { return tmpArch; // we found an arch } Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-07-02 12:48:06 UTC (rev 228) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-07-02 18:57:56 UTC (rev 229) @@ -317,13 +317,13 @@ ArchObject node = map.getMapModel().getMouseRightPosObject(); // Jump to the end of the list - for (; node != null && node.getNextArch() != null; node = node.getNextArch()) { + for (; node != null && node.getNext() != null; node = node.getNext()) { ; } // Now go through the list backwards and put all arches // on the panel in this order - for (; node != null; node = node.getPrevArch()) { + for (; node != null; node = node.getPrev()) { // add the node if (node.getMyID() == archid) { postSelect = listCounter; Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-07-02 12:48:06 UTC (rev 228) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-07-02 18:57:56 UTC (rev 229) @@ -1628,13 +1628,13 @@ ArchObject tmpArch = mapControl.getBottomArchObject(mapLoc); if (tmpArch != null) { // go to the topmost arch (end of the list) - for (; tmpArch.getNextArch() != null; tmpArch = tmpArch.getNextArch()) { + for (; tmpArch.getNext() != null; tmpArch = tmpArch.getNext()) { ; } // now search backwards for matching view settings for (; tmpArch != null && mainControl.getTileEdit() != 0 && - !mainControl.isTileEdit(tmpArch.getEditType()); tmpArch = tmpArch.getPrevArch()) { + !mainControl.isTileEdit(tmpArch.getEditType()); tmpArch = tmpArch.getPrev()) { ; } if (tmpArch != null) { @@ -1789,13 +1789,13 @@ ArchObject tmpArch = mapControl.getBottomArchObject(temp); if (tmpArch != null) { // go to the topmost arch (end of the list) - for (; tmpArch.getNextArch() != null; tmpArch = tmpArch.getNextArch()) { + for (; tmpArch.getNext() != null; tmpArch = tmpArch.getNext()) { ; } // now search backwards for matching view settings for (; tmpArch != null && mainControl.getTileEdit() != 0 && - !mainControl.isTileEdit(tmpArch.getEditType()); tmpArch = tmpArch.getPrevArch()) { + !mainControl.isTileEdit(tmpArch.getEditType()); tmpArch = tmpArch.getPrev()) { ; } if (tmpArch != null) { Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-07-02 12:48:06 UTC (rev 228) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-07-02 18:57:56 UTC (rev 229) @@ -262,17 +262,17 @@ if (oldHead != null && oldHead.getNodeNr() == arch.getNodeNr()) { // replace old head with our clone: - if (oldHead.getPrevArch() != null) { - oldHead.getPrevArch().setNextArch(clone); - clone.setPrevArch(oldHead.getPrevArch()); + if (oldHead.getPrev() != null) { + oldHead.getPrev().setNext(clone); + clone.setPrev(oldHead.getPrev()); } else { // no previous arch, we must stick it on the grid mapControl.setArchObject(pos, clone); } - if (oldHead.getNextArch() != null) { - oldHead.getNextArch().setPrevArch(clone); - clone.setNextArch(oldHead.getNextArch()); + if (oldHead.getNext() != null) { + oldHead.getNext().setPrev(clone); + clone.setNext(oldHead.getNext()); } clone.setMyID(oldHead.getMyID()); // pass ID to new head @@ -284,8 +284,8 @@ } // delete old head: - oldHead.setNextArch(null); - oldHead.setPrevArch(null); + oldHead.setNext(null); + oldHead.setPrev(null); oldHead.setMapMultiNext(null); oldHead = null; } else { Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-07-02 12:48:06 UTC (rev 228) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-07-02 18:57:56 UTC (rev 229) @@ -334,7 +334,7 @@ (matchCriteria == MATCH_OBJ_NAME && node.getBestName(node.getDefaultArch()).equalsIgnoreCase(matchString)))) { // first, delete the old arch - final ArchObject prevArch = node.getPrevArch(); + final ArchObject prevArch = node.getPrev(); it.remove(); if (replaceArch != null && !deleteOnly) { Modified: trunk/crossfire/src/cfeditor/arch/ArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-07-02 12:48:06 UTC (rev 228) +++ trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-07-02 18:57:56 UTC (rev 229) @@ -883,11 +883,19 @@ return mapy; } - public void setNextArch(final ArchObject arch) { + /** + * Set Next link. + * @param arch Arch to point next to + */ + public void setNext(final ArchObject arch) { next = arch; } - public void setPrevArch(final ArchObject arch) { + /** + * Set Prev link. + * @param arch Arch to point prev to + */ + public void setPrev(final ArchObject arch) { prev = arch; } @@ -899,11 +907,19 @@ tempptr = temp; } - public ArchObject getNextArch() { + /** + * Get Next link. + * @return next link + */ + public ArchObject getNext() { return next; } - public ArchObject getPrevArch() { + /** + * Get Prev link. + * @return prev link + */ + public ArchObject getPrev() { return prev; } Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java 2006-07-02 12:48:06 UTC (rev 228) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java 2006-07-02 18:57:56 UTC (rev 229) @@ -1,4 +1,26 @@ -/* $Id: ArchObjectIterator.java,v 1.1 2006/04/06 17:16:03 akirschbaum Exp $ */ +/* + * Daimonin Java Editor. + * Copyright (C) 2000 Michael Toennies + * Copyright (C) 2001 Andreas Vogl + * + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ package cfeditor.arch; @@ -6,39 +28,72 @@ import java.util.NoSuchElementException; /** - * The class ArchObjectIterator implements an {@link Iterator} that - * returns all {@link ArchObject}s in a map location. - * @author Andreas Kirschbaum + * Iterator for ArchObjects. + * This class is only meant for usage during the transition from manually linked lists to encapslued Collections lists in arch handling. + * This Iterator is believed to be safe against concurrent modification. + * Therefore it is not fail-fast, it does not throw ConcurrentModificationException. + * The next link is future-fetched, which means that the invocation of {@link #next()} already prepares the next invocation of {@link #hasNext()} or {@link #next()}. + * This allows to safely perform manipulations on the current object, especially deletion, without loosing traversal. + * @author <a href="mailto:ch...@it...">Christian Hujer</a> */ public class ArchObjectIterator implements Iterator<ArchObject> { - protected ArchObject nextArchObject; +// /** Current ArchObject, used for {@link #remove()}. */ +// private ArchObject current; - protected ArchObject currArchObject = null; + /** Traversal direction. */ + private final boolean forward; - public ArchObjectIterator(final ArchObject archObject) { - nextArchObject = archObject; + /** ArchObject for first iteration step. */ + private ArchObject next; + + /** + * Creates a new instance of ArchObjectIterator (forward iteration). + * @param first first ArchObject to start forward iteration on + */ + public ArchObjectIterator(final ArchObject first) { + this(first, true); } + /** + * Creates a new instance of ArchObjectIterator. + * @param first first ArchObject to start iteration on + * @param forward <code>true</code> for forward iteration, <code>false</code> for backward iteration + */ + ArchObjectIterator(final ArchObject first, final boolean forward) { + next = first; + this.forward = forward; + } + /** {@inheritDoc} */ public boolean hasNext() { - return nextArchObject != null; + return next != null; } /** {@inheritDoc} */ public ArchObject next() { - if (nextArchObject == null) { - throw new NoSuchElementException(); + try { + return next; + } finally { + try { + next = forward ? next.getNext() : next.getPrev(); + } catch (final NullPointerException e) { + //noinspection ThrowFromFinallyBlock + throw new NoSuchElementException(); + } } - - currArchObject = nextArchObject; - nextArchObject = currArchObject.getNextArch(); - return currArchObject; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * @todo eventually, multitile-removal should go here. + */ public void remove() { throw new UnsupportedOperationException(); +// ArchObject prev = current.getPrevArch(); +// ArchObject next = current.getNextArch(); +// if (next != null) { next.setPrevArch(prev); } +// if (prev != null) { prev.setPrevArch(next); } } } // class ArchObjectIterator Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java 2006-07-02 12:48:06 UTC (rev 228) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteArchMapObject.java 2006-07-02 18:57:56 UTC (rev 229) @@ -26,6 +26,12 @@ } /** {@inheritDoc} */ + public ArchObject next() { + currArchObject = super.next(); + return currArchObject; + } + + /** {@inheritDoc} */ @Override public void remove() { if (currArchObject == null) { throw new IllegalStateException(); @@ -35,4 +41,6 @@ currArchObject = null; } + private ArchObject currArchObject = null; + } // class ArchObjectIteratorDeleteArchMapObject Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java 2006-07-02 12:48:06 UTC (rev 228) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java 2006-07-02 18:57:56 UTC (rev 229) @@ -49,6 +49,12 @@ } /** {@inheritDoc} */ + public ArchObject next() { + currArchObject = super.next(); + return currArchObject; + } + + /** {@inheritDoc} */ @Override public void remove() { if (currArchObject == null) { throw new IllegalStateException(); @@ -58,4 +64,6 @@ currArchObject = null; } + private ArchObject currArchObject = null; + } // class ArchObjectIteratorDeleteMapArch Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-07-02 12:48:06 UTC (rev 228) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-07-02 18:57:56 UTC (rev 229) @@ -227,8 +227,8 @@ */ public ArchObject getTopArchObject(final Point pos) { ArchObject result = getBottomArchObject(pos); - while (result != null && result.getNextArch() != null) { - result = result.getNextArch(); + while (result != null && result.getNext() != null) { + result = result.getNext(); } return result; } @@ -362,20 +362,20 @@ return; } - final ArchObject arch = prev.getNextArch(); + final ArchObject arch = prev.getNext(); if (arch == null) { return; } - prev.setNextArch(arch.getNextArch()); - arch.setPrevArch(prev.getPrevArch()); - arch.setNextArch(prev); - prev.setPrevArch(arch); - if (prev.getNextArch() != null) { - prev.getNextArch().setPrevArch(prev); + prev.setNext(arch.getNext()); + arch.setPrev(prev.getPrev()); + arch.setNext(prev); + prev.setPrev(arch); + if (prev.getNext() != null) { + prev.getNext().setPrev(prev); } - if (arch.getPrevArch() != null) { - arch.getPrevArch().setNextArch(arch); + if (arch.getPrev() != null) { + arch.getPrev().setNext(arch); } else { mapGrid[arch.getMapX()][arch.getMapY()] = arch; } @@ -402,20 +402,20 @@ return; } - final ArchObject prev = arch.getPrevArch(); + final ArchObject prev = arch.getPrev(); if (prev == null) { return; } - prev.setNextArch(arch.getNextArch()); - arch.setPrevArch(prev.getPrevArch()); - arch.setNextArch(prev); - prev.setPrevArch(arch); - if (prev.getNextArch() != null) { - prev.getNextArch().setPrevArch(prev); + prev.setNext(arch.getNext()); + arch.setPrev(prev.getPrev()); + arch.setNext(prev); + prev.setPrev(arch); + if (prev.getNext() != null) { + prev.getNext().setPrev(prev); } - if (arch.getPrevArch() != null) { - arch.getPrevArch().setNextArch(arch); + if (arch.getPrev() != null) { + arch.getPrev().setNext(arch); } else { mapGrid[arch.getMapX()][arch.getMapY()] = arch; } @@ -492,18 +492,18 @@ } else { if (!insertBelow) { // if we want to insert on top, we need to get last node element - for (int i = 0; node.getNextArch() != null; i++) { - node = node.getNextArch(); + for (int i = 0; node.getNext() != null; i++) { + node = node.getNext(); } - node.setNextArch(newarch); - node.getNextArch().setPrevArch(node); - node.getNextArch().setMapX(mapx); - node.getNextArch().setMapY(mapy); + node.setNext(newarch); + node.getNext().setPrev(node); + node.getNext().setMapX(mapx); + node.getNext().setMapY(mapy); } else { //ArchObject tmp = node; - node.setPrevArch(newarch); - newarch.setNextArch(node); + node.setPrev(newarch); + newarch.setNext(node); mapGrid[mapx][mapy] = newarch; newarch.setMapX(mapx); newarch.setMapY(mapy); @@ -572,14 +572,14 @@ // jump to the end of the list (-> grab "topmost" arch) ArchObject node; for (node = mapGrid[pos.x][pos.y]; - node != null && node.getNextArch() != null; - node = node.getNextArch()) { + node != null && node.getNext() != null; + node = node.getNext()) { ; } // now move the arch down till it meets the insert position - for (; node != null && node.getPrevArch() != null && - (next == null || node.getPrevArch().getMyID() != next.getMyID()); + for (; node != null && node.getPrev() != null && + (next == null || node.getPrev().getMyID() != next.getMyID()); moveTileDown(node, false)) { ; } @@ -650,18 +650,18 @@ } else { if (!insertBelow) { // if we want to insert on top, we need to get last node element - for (int i = 0; node.getNextArch() != null; i++) { - node = node.getNextArch(); + for (int i = 0; node.getNext() != null; i++) { + node = node.getNext(); } - node.setNextArch(arch); - node.getNextArch().setPrevArch(node); - node.getNextArch().setMapX(mapx); - node.getNextArch().setMapY(mapy); + node.setNext(arch); + node.getNext().setPrev(node); + node.getNext().setMapX(mapx); + node.getNext().setMapY(mapy); } else { // insert below, so just put it on first place - node.setPrevArch(arch); - arch.setNextArch(node); + node.setPrev(arch); + arch.setNext(node); mapGrid[mapx][mapy] = arch; arch.setMapX(mapx); arch.setMapY(mapy); @@ -824,8 +824,8 @@ final int mapx = node.getMapX(); final int mapy = node.getMapY(); // second, we remove our arch from the map position chain - final ArchObject prev = node.getPrevArch(); - ArchObject next = node.getNextArch(); + final ArchObject prev = node.getPrev(); + ArchObject next = node.getNext(); if (next == node) { // should not happen, but better we double-check to prevent infinite loop @@ -837,13 +837,13 @@ // if some up (or null), put this on start mapGrid[mapx][mapy] = next; if (next != null) { // if there one up, mark them as starter - next.setPrevArch(null); + next.setPrev(null); } } else { // we chain next to prev - prev.setNextArch(next); + prev.setNext(next); if (next != null) { // we are last... no next - next.setPrevArch(prev); + next.setPrev(prev); } } if (next != null) { @@ -852,8 +852,8 @@ // remove all inventory... node.clearInventory(); - node.setNextArch(null); - node.setPrevArch(null); + node.setNext(null); + node.setPrev(null); final ArchObject temp = node.getMapMultiNext(); // we save our next part (or null=finished) node.setMapMultiHead(null); node.setMapMultiNext(null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-07-03 21:21:31
|
Revision: 233 Author: christianhujer Date: 2006-07-03 14:21:15 -0700 (Mon, 03 Jul 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=233&view=rev Log Message: ----------- Some unification of ArchObject. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/arch/ArchObject.java trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java trunk/crossfire/src/cfeditor/filter/AttributeFilter.java trunk/daimonin/src/daieditor/arch/ArchObject.java Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-07-03 21:04:56 UTC (rev 232) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-07-03 21:21:15 UTC (rev 233) @@ -183,7 +183,7 @@ if (replaceArch != null) { colonLabel = new JLabel(":"); iconLabel.setIcon(mainControl.getArchObjectStack().getFace(replaceArch.getFaceNr())); - rfArchName = new JLabel(" " + replaceArch.getBestName(replaceArch.getDefaultArch())); + rfArchName = new JLabel(" " + replaceArch.getBestName()); } else { colonLabel = new JLabel(""); rfArchName = new JLabel(""); @@ -233,7 +233,7 @@ } else { replaceWithBox.setSelectedIndex(0); iconLabel.setIcon(mainControl.getArchObjectStack().getFace(replaceArch.getFaceNr())); - rfArchName.setText(" " + replaceArch.getBestName(replaceArch.getDefaultArch())); + rfArchName.setText(" " + replaceArch.getBestName()); colonLabel.setText(":"); } @@ -263,7 +263,7 @@ final Icon oldIcon = iconLabel.getIcon(); iconLabel.setIcon(mainControl.getArchObjectStack().getFace(newArch.getFaceNr())); - rfArchName.setText(" " + newArch.getBestName(newArch.getDefaultArch())); + rfArchName.setText(" " + newArch.getBestName()); colonLabel.setText(":"); // pack frame only if height of icon changed @@ -332,7 +332,7 @@ ((matchCriteria == MATCH_ARCH_NAME && node.getArchName() != null && node.getArchName().equalsIgnoreCase(matchString)) || (matchCriteria == MATCH_OBJ_NAME && - node.getBestName(node.getDefaultArch()).equalsIgnoreCase(matchString)))) { + node.getBestName().equalsIgnoreCase(matchString)))) { // first, delete the old arch final ArchObject prevArch = node.getPrev(); it.remove(); Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-07-03 21:04:56 UTC (rev 232) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-07-03 21:21:15 UTC (rev 233) @@ -373,7 +373,7 @@ * @param panelList JList from the MapArchPanel (script tab) which displays the events */ public void addEventScript(final JList panelList, final ArchObject arch) { - final String archName = arch.getBestName(arch.getDefaultArch()); + final String archName = arch.getBestName(); // create a reasonable default script name for lazy users :-) final String defScriptName = chooseDefaultScriptName(archName); Modified: trunk/crossfire/src/cfeditor/arch/ArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-07-03 21:04:56 UTC (rev 232) +++ trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-07-03 21:21:15 UTC (rev 233) @@ -132,7 +132,7 @@ private boolean editflag; // if true, object is in a editor // for example in the map arch panel - private boolean artifactsFlag; // if set, this is not a "real" arch + private boolean artifact; // if set, this is not a "real" arch // It will NOT be included in the arch collection private ArchObject next; // to chain ArchObjects in maps @@ -175,7 +175,7 @@ objName = null; noface = true; // this sucker has no face - artifactsFlag = false; // will be true for arches from the artifacts file + artifact = false; // will be true for arches from the artifacts file faceName = null; // if there is a face cmd, this is the face name facenr = -1; // if we have a face AND we have loaded the face, this is his number. // if faceName != null and facenr == -1, we haven't loaded the face @@ -452,6 +452,23 @@ this.editType = editType; } + /** {@inheritDoc} */ + public ArchObject getContainer() { + return env; + } + + /** {@inheritDoc} */ + public ArchObject getTopContainer() { + ArchObject tmpArch; + + for (tmpArch = this; tmpArch.getContainer() != null; + tmpArch = tmpArch.getContainer()) { + ; + } + + return tmpArch; + } + /** * Set the String of an arch attribute in the archText. * @param attr search for "attr <string>" @@ -557,31 +574,29 @@ myId = num; } - /** {@inheritDoc} */ - public ArchObject getContainer() { - return env; + /** + * Sets if this flag is set, the arch is not a "real" arch but comes from + * the artifacts file. Such ArchObject instances are not included in the + * arch collection, since the artifacts file is the same for editor and + * server. + * @param artifact if this flag is set, the arch is not a "real" arch but comes from the artifacts file. + */ + public void setArtifact(final boolean artifact) { + this.artifact = artifact; } - /** {@inheritDoc} */ - public ArchObject getTopContainer() { - ArchObject tmpArch; - - for (tmpArch = this; tmpArch.getContainer() != null; - tmpArch = tmpArch.getContainer()) { - ; - } - - return tmpArch; + /** + * Returns if this flag is set, the arch is not a "real" arch but comes + * from the artifacts file. Such ArchObject instances are not included in + * the arch collection, since the artifacts file is the same for editor and + * server. + * @return if this flag is set, the arch is not a "real" arch but comes + * from the artifacts file. + */ + public boolean isArtifact() { + return artifact; } - public void setArtifactFlag(final boolean aflag) { - artifactsFlag = aflag; - } - - public boolean getArtifactFlag() { - return artifactsFlag; - } - /** * The given <code>ArchObject</code> 'arch' is placed as inventory * into 'this' <code>ArchObject</code>. (Keep in mind that 'arch' @@ -714,8 +729,7 @@ } public boolean isReferenced() { - return multi != null ? multi.isReferenced() : false; - + return multi != null && multi.isReferenced(); } // this chained multi tiles on map for fast access. better then number and search trash @@ -978,11 +992,10 @@ /** * Name which is best appropriate to describe this arch. (This can be - * arch/object name or default arch/object name) - * @param defaultArch the default arch (if available, faster to use it than look it up again) + * arch/object name or default arch/object name) * @return best suitable descriptive name */ - public String getBestName(final ArchObject defaultArch) { + public String getBestName() { if (objName != null && objName.length() > 0) { return objName; } else if (defaultArch != null && defaultArch.objName != null && defaultArch.objName.length() > 0) { @@ -1050,12 +1063,13 @@ } /** - * Get all entries from the given archtext 'atxt' that don't exist - * in 'this' archtext. - * @param atxt archtext to compare 'this'-arch with - * @param ignoreValues if true: the values in the archtext-entries - * are ignored at the comparison + * Get all entries from the given archtext 'atxt' that don't exist in + * 'this' archtext. + * @param atxt archtext to compare 'this'-arch with + * @param ignoreValues if true: the values in the archtext-entries are + * ignored at the comparison * @return all lines from 'atxt' that don't occur in 'this' arch + * @todo this method is too slow - find a faster way */ public String diffArchText(String atxt, final boolean ignoreValues) { int j; Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-07-03 21:04:56 UTC (rev 232) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-07-03 21:21:15 UTC (rev 233) @@ -357,7 +357,7 @@ // if this arch was from Artifacts file - return here: if (archName != null) { - arch.setArtifactFlag(true); + arch.setArtifact(true); // here we add all unchanged arch text lines from def_arch back to arch arch.addArchText(arch.diffArchText(defArch.getArchText(), true)); return arch; Modified: trunk/crossfire/src/cfeditor/filter/AttributeFilter.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/AttributeFilter.java 2006-07-03 21:04:56 UTC (rev 232) +++ trunk/crossfire/src/cfeditor/filter/AttributeFilter.java 2006-07-03 21:21:15 UTC (rev 233) @@ -73,7 +73,7 @@ if (matchType >= 0) { hasChecked = true; if (LOG.isDebugEnabled()) { - LOG.debug("checking type for " + object.getBestName(object.getDefaultArch())); + LOG.debug("checking type for " + object.getBestName()); LOG.debug("o.getArchTypNr() != matchType: " + object.getArchTypNr() + " != " + matchType); } if (object.getArchTypNr() != matchType) { Modified: trunk/daimonin/src/daieditor/arch/ArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-07-03 21:04:56 UTC (rev 232) +++ trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-07-03 21:21:15 UTC (rev 233) @@ -434,6 +434,16 @@ this.editType = editType; } + /** {@inheritDoc} */ + public ArchObjectContainer getContainer() { + return container; + } + + /** {@inheritDoc} */ + public ArchObject getTopContainer() { + return isInContainer() ? ((ArchObject) container).getTopContainer() : this; + } + /** * Sets container of this ArchObject. * There are two possibilities for the container: @@ -447,11 +457,6 @@ this.container = container; } - /** {@inheritDoc} */ - public ArchObjectContainer getContainer() { - return container; - } - /** * Check whether this ArchObject is in a Container (in Daimonin sense, * which means being in a MapSquare isn't, but being in an ArchObject is). @@ -464,11 +469,6 @@ } /** {@inheritDoc} */ - public ArchObject getTopContainer() { - return isInContainer() ? ((ArchObject) container).getTopContainer() : this; - } - - /** {@inheritDoc} */ @Override public MapSquare getMapSquare() { return container != null ? container.getMapSquare() : null; } @@ -628,11 +628,7 @@ } public boolean isReferenced() { - if (multi != null) { - return multi.isReferenced(); - } - - return false; + return multi != null && multi.isReferenced(); } // this chained multi tiles on map for fast access. better then number and search trash @@ -970,7 +966,45 @@ return archText.toString(); } + /** Clears the arch text of this arch. */ + public void resetArchText() { + archText.delete(0, archText.length()); + } + /** + * Get all entries from the given archtext 'atxt' that don't exist in + * 'this' archtext. + * @param atxt archtext to compare 'this'-arch with + * @param ignoreValues if true: the values in the archtext-entries are + * ignored at the comparison + * @return all lines from 'atxt' that don't occur in 'this' arch + * @todo this method is too slow - find a faster way + */ + public String diffArchText(final String atxt, final boolean ignoreValues) { + final StringBuilder result = new StringBuilder(); + for (String line : atxt.split("\\s*\n")) { + if (ignoreValues) { + final int spaceIndex = line.indexOf(" "); + if (line.length() > 0 && spaceIndex > 0 && diffTextString(getArchText(), line.substring(0, spaceIndex + 1), ignoreValues) == null) { + result.append(line).append('\n'); + } + } else { + try { + final String test = diffTextString(getArchText(), line, ignoreValues); + char c = '\n'; + if (test != null) { + c = test.charAt(0); + } + if (line.length() > 0 && (test == null || c == '\n')) { + result.append(line).append('\n'); + } + } catch (final StringIndexOutOfBoundsException e) { /* ignore */ } + } + } + return result.toString(); + } + + /** * Set The "face >name>" field of a object. We need this for fast * access. We set here the string name, the face number and we will handle * invalid/double names including comparing with a default arch. @@ -1099,44 +1133,6 @@ return null; } - /** Clears the arch text of this arch. */ - public void resetArchText() { - archText.delete(0, archText.length()); - } - - /** - * Get all entries from the given archtext 'atxt' that don't exist in - * 'this' archtext. - * @param atxt archtext to compare 'this'-arch with - * @param ignoreValues if true: the values in the archtext-entries are - * ignored at the comparison - * @return all lines from 'atxt' that don't occur in 'this' arch - * @todo this method is too slow - find a faster way - */ - public String diffArchText(final String atxt, final boolean ignoreValues) { - final StringBuilder result = new StringBuilder(); - for (String line : atxt.split("\\s*\n")) { - if (ignoreValues) { - final int spaceIndex = line.indexOf(" "); - if (line.length() > 0 && spaceIndex > 0 && diffTextString(getArchText(), line.substring(0, spaceIndex + 1), ignoreValues) == null) { - result.append(line).append('\n'); - } - } else { - try { - final String test = diffTextString(getArchText(), line, ignoreValues); - char c = '\n'; - if (test != null) { - c = test.charAt(0); - } - if (line.length() > 0 && (test == null || c == '\n')) { - result.append(line).append('\n'); - } - } catch (final StringIndexOutOfBoundsException e) { /* ignore */ } - } - } - return result.toString(); - } - /** Delete message text by nullification. */ public void deleteMsgText() { msgText = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-05 13:33:16
|
Revision: 248 Author: christianhujer Date: 2006-08-05 06:32:52 -0700 (Sat, 05 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=248&view=rev Log Message: ----------- Added some MapModel unification. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/map/MapModel.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/daimonin/src/daieditor/map/MapModel.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/map/ trunk/src/app/net/sf/gridarta/map/MapModel.java Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-08-04 19:58:10 UTC (rev 247) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-08-05 13:32:52 UTC (rev 248) @@ -529,7 +529,7 @@ // if the mapsize has been modified, see if we should ask for a confirm Size2D size = new Size2D(width, height); - if (m_level.checkResizeMap(size)) { + if (!m_level.isCutoffSave(size)) { if (!askConfirmResize(size)) { // resizing has been cancelled size = m_level.getMapSize(); Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-08-04 19:58:10 UTC (rev 247) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-08-05 13:32:52 UTC (rev 248) @@ -978,15 +978,15 @@ /** * Check if objects get cut off if the map was resized to the given bounds. * @param newSize the new level size - * @return true if objects would be cut off + * @return true if objects would not be cut off, so cut off is safe, otherwise <code>false</code> */ - public boolean isCutoffUnsafe(final Size2D newSize) { + public boolean isCutoffSafe(final Size2D newSize) { if (mapSize.getWidth() > newSize.getWidth()) { // search the right stripe (as far as being cut off) for (int x = newSize.getWidth(); x < mapSize.getWidth(); x++) { for (int y = 0; y < mapSize.getHeight(); y++) { if (mapGrid[x][y] != null) { - return true; + return false; } } } @@ -997,13 +997,13 @@ for (int y = newSize.getHeight(); y < mapSize.getHeight(); y++) { for (int x = 0; x < mapSize.getWidth(); x++) { if (mapGrid[x][y] != null) { - return true; + return false; } } } } - return false; + return true; } /** Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-08-04 19:58:10 UTC (rev 247) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-08-05 13:32:52 UTC (rev 248) @@ -511,8 +511,8 @@ return mapModel.isPointValid(pos); } - public boolean checkResizeMap(final Size2D size) { - return mapModel.isCutoffUnsafe(size); + public boolean isCutoffSave(final Size2D size) { + return mapModel.isCutoffSafe(size); } /** Modified: trunk/crossfire/src/cfeditor/map/MapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapModel.java 2006-08-04 19:58:10 UTC (rev 247) +++ trunk/crossfire/src/cfeditor/map/MapModel.java 2006-08-05 13:32:52 UTC (rev 248) @@ -7,12 +7,13 @@ import java.util.List; import net.sf.gridarta.Size2D; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; /** * Interface for MapModels. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public interface MapModel { +public interface MapModel extends net.sf.gridarta.map.MapModel { /** Enable autojoin when inserting objects. */ boolean JOIN_ENABLE = true; @@ -39,14 +40,6 @@ @Nullable ArchObject getMouseRightPosObject(); - void resetLevelChangedFlag(); - - void setLevelChangedFlag(); - - boolean isLevelChanged(); - - Size2D getMapSize(); - @Deprecated boolean addArchToMap(int archnr, int xx, int yy, int intern, boolean join, boolean insertBelow); boolean addArchToMap(int archnr, Point pos, int intern, boolean join, boolean insertBelow); @@ -62,14 +55,9 @@ @Nullable ArchObject getMapArch(int id, Point pos); @Deprecated boolean isPointValid(int x, int y); - boolean isPointValid(Point pos); @Nullable ArchObject getExit(); - boolean isCutoffUnsafe(Size2D newSize); - - void resizeMap(Size2D newSize); - void moveTileUp(ArchObject prev, boolean refresh); void moveTileDown(ArchObject arch, boolean refresh); Modified: trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-08-04 19:58:10 UTC (rev 247) +++ trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-08-05 13:32:52 UTC (rev 248) @@ -431,7 +431,7 @@ } // if the mapsize has been modified, see if we should ask for a confirm - if (mapControl.checkResizeMap(mapSize)) { + if (!mapControl.isCutoffSafe(mapSize)) { if (!askConfirmResize(mapSize)) { // resizing has been cancelled mapSize = mapControl.getMapSize(); Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-08-04 19:58:10 UTC (rev 247) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-08-05 13:32:52 UTC (rev 248) @@ -338,7 +338,7 @@ return mapModel.isPointValid(pos); } - public boolean checkResizeMap(final Size2D size) { + public boolean isCutoffSafe(final Size2D size) { return mapModel.isCutoffSafe(size); } Modified: trunk/daimonin/src/daieditor/map/MapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapModel.java 2006-08-04 19:58:10 UTC (rev 247) +++ trunk/daimonin/src/daieditor/map/MapModel.java 2006-08-05 13:32:52 UTC (rev 248) @@ -18,7 +18,7 @@ * And there is no rollback. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public interface MapModel extends Iterable<MapSquare> { +public interface MapModel extends Iterable<MapSquare>, net.sf.gridarta.map.MapModel { /** {@inheritDoc} */ Iterator<MapSquare> iterator(); @@ -39,31 +39,6 @@ @Deprecated @Nullable MapSquare getMouseRightPosObject(); /** - * Reset the level changed flag to false. - * @todo this probably belongs to CMapControl instead - */ - void resetLevelChangedFlag(); - - /** - * Set the level changed flag to true. - * @todo this probably belongs to CMapControl instead - */ - void setLevelChangedFlag(); - - /** - * Return whether the level has changed since it was last saved or not. - * @return <code>true</code> if level has changed, <code>false</code> if not. - * @todo this probably belongs to CMapControl instead - */ - boolean isLevelChanged(); - - /** - * Return the map size of this level. - * @return map size of this level - */ - Size2D getMapSize(); - - /** * Checks whether an ArchObject (multi-arch) would still fit on this map. * @param archname name of arch to check * @param pos position of multitile head @@ -141,13 +116,6 @@ MapArchObject getMapArch(); /** - * Check whether the given coordinate is within map bounds. - * @param pos the coordinates to check - * @return <code>true</code> if the given coordinates are on the map, otherwise <code>false</code> (also returns <code>false</code> if <code><var>pos</var> == null</code>) - */ - boolean isPointValid(@Nullable Point pos); - - /** * Get the first exit on the MapSquare described by <var>hspot</var>. * Possible exits include teleporters, exits and pits. * @param hspot Point to get exit at @@ -157,21 +125,6 @@ @Nullable ArchObject getExit(@Nullable Point hspot); /** - * Check if no objects get cut off if the map was resized to the given bounds so cutoff is safe. - * @param newSize the new level size - * @return true if no objects would be cut off - */ - boolean isCutoffSafe(@NotNull Size2D newSize); - - /** - * Resize this map to the new size. - * If any bounds are smaller than before, the map gets cut on the right and bottom side. - * Accordingly, new space is attached to right and bottom. - * @param newSize new map size - */ - void resizeMap(@NotNull Size2D newSize); - - /** * Returns the MapControl that controls this MapModel. * @return the MapControl that controls this MapModel */ Added: trunk/src/app/net/sf/gridarta/map/MapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapModel.java (rev 0) +++ trunk/src/app/net/sf/gridarta/map/MapModel.java 2006-08-05 13:32:52 UTC (rev 248) @@ -0,0 +1,62 @@ +package net.sf.gridarta.map; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import net.sf.gridarta.Size2D; +import java.awt.Point; + +/** + * A MapModel reflects the data of a map. + * This MapModel interface covers the similarities between the current CFEditor and DaiEditor implementations. + */ +public interface MapModel { + + /** + * Return the map size of this level. + * @return map size of this level + */ + Size2D getMapSize(); + + /** + * Check if no objects get cut off if the map was resized to the given bounds so cutoff is safe. + * @param newSize the new level size + * @return true if no objects would be cut off + */ + boolean isCutoffSafe(@NotNull Size2D newSize); + + /** + * Resize this map to the new size. + * If any bounds are smaller than before, the map gets cut on the right and bottom side. + * Accordingly, new space is attached to right and bottom. + * @param newSize new map size + * @see {@link #isCutoffSafe(net.sf.gridarta.Size2D)} for checking whether map contents would get cut off. + */ + void resizeMap(@NotNull Size2D newSize); + + /** + * Check whether the given coordinate is within map bounds. + * @param pos the coordinates to check + * @return <code>true</code> if the given coordinates are on the map, otherwise <code>false</code> (also returns <code>false</code> if <code><var>pos</var> == null</code>) + */ + boolean isPointValid(@Nullable Point pos); + + /** + * Reset the level changed flag to false. + * @todo this probably belongs to CMapControl instead + */ + void resetLevelChangedFlag(); + + /** + * Set the level changed flag to true. + * @todo this probably belongs to CMapControl instead + */ + void setLevelChangedFlag(); + + /** + * Return whether the level has changed since it was last saved or not. + * @return <code>true</code> if level has changed, <code>false</code> if not. + * @todo this probably belongs to CMapControl instead + */ + boolean isLevelChanged(); + +} // interface MapModel Property changes on: trunk/src/app/net/sf/gridarta/map/MapModel.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-13 13:25:27
|
Revision: 252 Author: christianhujer Date: 2006-08-13 06:25:14 -0700 (Sun, 13 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=252&view=rev Log Message: ----------- Replaced CSplitPane classes with GSplitPane. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/src/app/net/sf/gridarta/gui/GSplitPane.java Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-08-13 13:24:17 UTC (rev 251) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-08-13 13:25:14 UTC (rev 252) @@ -27,27 +27,25 @@ import cfeditor.arch.ArchObject; import cfeditor.map.MapControl; import java.awt.BorderLayout; -import java.awt.Component; import java.awt.Dimension; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.beans.PropertyVetoException; -import java.util.List; import java.util.ArrayList; import java.util.Collections; +import java.util.List; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JDesktopPane; import javax.swing.JFrame; import javax.swing.JOptionPane; -import javax.swing.JSplitPane; import javax.swing.JTabbedPane; import javax.swing.UIManager; import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameListener; -import cfeditor.GridderException; +import net.sf.gridarta.gui.GSplitPane; import net.sf.gridarta.help.Help; import org.jetbrains.annotations.Nullable; @@ -111,13 +109,13 @@ private CMainMenu menu; /** The split pane. */ - private CSplitPane splitPane; + private GSplitPane splitPane; /** All open level views. */ - private CSplitPane splitDownPane; + private GSplitPane splitDownPane; /** All open level views. */ - private CSplitPane splitRightPane; + private GSplitPane splitRightPane; /** All open level views. */ private List<MapViewIFrame> mapViews = new ArrayList<MapViewIFrame>(); @@ -214,7 +212,7 @@ if (!mapTileListBottom) { // the map tile list is on the right side - splitRightPane = new CSplitPane(CSplitPane.HORIZONTAL_SPLIT, mapDesktop, mapTileList); + splitRightPane = new GSplitPane(GSplitPane.HORIZONTAL_SPLIT, mapDesktop, mapTileList); splitRightPane.setDividerLocation(divLocationRight); splitRightPane.setDividerSize(BORDER_SIZE); @@ -222,14 +220,14 @@ getContentPane().add(splitRightPane, BorderLayout.CENTER); mapArchPanel = new CMapArchPanel(mainControl, this); - splitDownPane = new CSplitPane(CSplitPane.VERTICAL_SPLIT, splitRightPane, mapArchPanel); + splitDownPane = new GSplitPane(GSplitPane.VERTICAL_SPLIT, splitRightPane, mapArchPanel); splitDownPane.setDividerLocation(divLocationDown); splitDownPane.setDividerSize(BORDER_SIZE); getContentPane().add(splitDownPane, BorderLayout.CENTER); - splitPane = new CSplitPane(CSplitPane.HORIZONTAL_SPLIT, archPanel, splitDownPane); + splitPane = new GSplitPane(GSplitPane.HORIZONTAL_SPLIT, archPanel, splitDownPane); splitPane.setDividerLocation(divLocation); splitPane.setDividerSize(BORDER_SIZE); @@ -237,20 +235,20 @@ } else { // the map tile list is merged into the bottom panel mapArchPanel = new CMapArchPanel(mainControl, this); - splitRightPane = new CSplitPane(CSplitPane.HORIZONTAL_SPLIT, mapArchPanel, mapTileList); + splitRightPane = new GSplitPane(GSplitPane.HORIZONTAL_SPLIT, mapArchPanel, mapTileList); splitRightPane.setDividerLocation(divLocationRight); splitRightPane.setDividerSize(BORDER_SIZE); // split off the bottom panel - splitDownPane = new CSplitPane(CSplitPane.VERTICAL_SPLIT, mapDesktop, splitRightPane); + splitDownPane = new GSplitPane(GSplitPane.VERTICAL_SPLIT, mapDesktop, splitRightPane); splitDownPane.setDividerLocation(divLocationDown); splitDownPane.setDividerSize(BORDER_SIZE); getContentPane().add(splitDownPane, BorderLayout.CENTER); // split off the left arch panel - splitPane = new CSplitPane(CSplitPane.HORIZONTAL_SPLIT, archPanel, splitDownPane); + splitPane = new GSplitPane(GSplitPane.HORIZONTAL_SPLIT, archPanel, splitDownPane); splitPane.setDividerLocation(divLocation); splitPane.setDividerSize(BORDER_SIZE); @@ -746,28 +744,4 @@ public void internalFrameDeactivated(final InternalFrameEvent e) { } - /** Splitpane class that keeps its size even upon L'n'F change. */ - public static final class CSplitPane extends JSplitPane { - - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - - public CSplitPane(final int newOrientation, final Component newLeftComponent, final Component newRightComponent) { - super(newOrientation, newLeftComponent, newRightComponent); - } - - /** - * Overridden to store and restore the divider location upon - * UI change. - */ - @Override public void updateUI() { - final int dividerLocation = getDividerLocation(); - final int dividerSize = getDividerSize(); - super.updateUI(); - setDividerLocation(dividerLocation); - setDividerSize(dividerSize); - } - - } // class CSplitPane - } // class CMainView Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-08-13 13:24:17 UTC (rev 251) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-08-13 13:25:14 UTC (rev 252) @@ -56,6 +56,7 @@ import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; +import net.sf.gridarta.gui.GSplitPane; /** * <code>CMapArchPanel</code> implements the panel that holds information about @@ -106,7 +107,7 @@ private final CMainView mainView; - private final CSplitPane splitPane; + private final GSplitPane splitPane; private final JTabbedPane panelDesktop; @@ -186,8 +187,8 @@ panelDesktop = new JTabbedPane(JTabbedPane.TOP); mapArchPanel.setLayout(new BorderLayout()); - splitPane = new CSplitPane( - CSplitPane.HORIZONTAL_SPLIT, + splitPane = new GSplitPane( + GSplitPane.HORIZONTAL_SPLIT, scrollPane3, scrollPane2); @@ -892,28 +893,4 @@ s_remove.setEnabled(removeButton); } - /** Splitpane class that keeps its size even upon L'n'F change. */ - public final class CSplitPane extends JSplitPane { - - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - - public CSplitPane(final int newOrientation, - final Component newLeftComponent, - final Component newRightComponent) { - super(newOrientation, newLeftComponent, newRightComponent); - } - - /** - * Overridden to store and restore the divider location upon - * UI change. - */ - @Override public void updateUI() { - final int dividerLocation = getDividerLocation(); - final int dividerSize = getDividerSize(); - super.updateUI(); - setDividerLocation(dividerLocation); - setDividerSize(dividerSize); - } - } -} +} // class CMapArchPanel Modified: trunk/src/app/net/sf/gridarta/gui/GSplitPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/GSplitPane.java 2006-08-13 13:24:17 UTC (rev 251) +++ trunk/src/app/net/sf/gridarta/gui/GSplitPane.java 2006-08-13 13:25:14 UTC (rev 252) @@ -55,10 +55,10 @@ // Overridden to store and restore the divider location upon UI change. @Override public void updateUI() { final int dividerLocationBackup = getDividerLocation(); - //final int dividerSizeBackup = getDividerSize(); + final int dividerSizeBackup = getDividerSize(); super.updateUI(); setDividerLocation(dividerLocationBackup); - //setDividerSize(dividerSizeBackup); + setDividerSize(dividerSizeBackup); } } // class DSplitPane This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 15:57:51
|
Revision: 287 Author: christianhujer Date: 2006-08-27 08:57:43 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=287&view=rev Log Message: ----------- File when saving a map must not be null. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/map/MapControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-08-27 15:53:13 UTC (rev 286) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-08-27 15:57:43 UTC (rev 287) @@ -60,6 +60,7 @@ import net.sf.japi.util.filter.file.EndingFileFilter; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; /** * The main controller of the level editor. Basically the main application. @@ -1020,7 +1021,7 @@ * @param file File to save to * @param mapModel MapModel to save */ - public void encodeMapFile(final File file, final MapModel mapModel) { + public void encodeMapFile(@NotNull final File file, final MapModel mapModel) { mapFileEncoder.encodeMapFile(file, mapModel); } @@ -1134,6 +1135,7 @@ if (returnVal == JFileChooser.APPROVE_OPTION) { hasChangedDir = true; // user has chosen an active dir final File file = fileChooser.getSelectedFile(); + assert file != null; level.saveAs(file); level.setMapFileName(file.getName()); // window title and file name //level.setMapName(file.getName()); // map name (internal) Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-08-27 15:53:13 UTC (rev 286) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-08-27 15:57:43 UTC (rev 287) @@ -41,6 +41,7 @@ import java.util.Iterator; import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; /** * The <code>CMapFileEncode</code> @@ -69,15 +70,10 @@ * @param file mapfile * @param mapModel the MapModel to encode */ - public void encodeMapFile(File file, final MapModel mapModel) { + public void encodeMapFile(@NotNull final File file, final MapModel mapModel) { final MapArchObject map = mapModel.getMapArchObject(); try { - if (file == null) { - // if the file doesn't yet exist, we create it in the map-folder - file = new File(mainControl.getMapDefaultFolder(), map.getFileName()); - } - fname = file.getAbsolutePath(); fileWriter = new FileWriter(file); bufferedWriter = new BufferedWriter(fileWriter); Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-08-27 15:53:13 UTC (rev 286) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-08-27 15:57:43 UTC (rev 287) @@ -39,6 +39,7 @@ import java.util.Iterator; import java.util.List; import net.sf.gridarta.Size2D; +import org.jetbrains.annotations.NotNull; /** * The <code>MapControl</code> @@ -571,6 +572,7 @@ } else { CMainStatusbar.getInstance().setText("Saving map '" + getMapFileName() + "'..."); } + assert mapFile != null; mainControl.encodeMapFile(mapFile, mapModel); mapModel.resetLevelChangedFlag(); mapView.changedFlagNotify(); @@ -580,7 +582,7 @@ * Save the file with the given file name. * @param file the file to be saved to */ - public void saveAs(final File file) { + public void saveAs(@NotNull final File file) { CMainStatusbar.getInstance().setText("Saving the map to a file..."); mainControl.encodeMapFile(file, mapModel); mapModel.resetLevelChangedFlag(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |