From: <chr...@us...> - 2006-05-26 11:01:31
|
Revision: 27 Author: christianhujer Date: 2006-05-26 03:55:45 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=27&view=rev Log Message: ----------- Applied automatic code formatting. 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/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/CFilterControl.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/CResourceLoader.java trunk/crossfire/src/cfeditor/CScriptController.java trunk/crossfire/src/cfeditor/CScriptModel.java trunk/crossfire/src/cfeditor/CScriptView.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/ExitTypes.java trunk/crossfire/src/cfeditor/FaceObject.java trunk/crossfire/src/cfeditor/IGUIConstants.java trunk/crossfire/src/cfeditor/IUndoable.java trunk/crossfire/src/cfeditor/IdGenerator.java trunk/crossfire/src/cfeditor/JFontChooser.java trunk/crossfire/src/cfeditor/JarResources.java trunk/crossfire/src/cfeditor/MapArchObject.java trunk/crossfire/src/cfeditor/MultiArchData.java trunk/crossfire/src/cfeditor/MultiPositionData.java trunk/crossfire/src/cfeditor/PluginParameter.java trunk/crossfire/src/cfeditor/PluginParameterFactory.java trunk/crossfire/src/cfeditor/PluginParameterView.java trunk/crossfire/src/cfeditor/ReplaceDialog.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/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 trunk/crossfire/src/cfeditor/arch/anim/AnimationObjects.java trunk/crossfire/src/cfeditor/filter/AttributeFilter.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/Filter.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/NamedFilterList.java trunk/crossfire/src/cfeditor/filter/NamedFilterListener.java trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.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/gui/StackLayout.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/MenuChangeEvent.java trunk/crossfire/src/cfeditor/menu/MenuEntry.java trunk/crossfire/src/cfeditor/menu/MenuGroup.java trunk/crossfire/src/cfeditor/menu/MenuHelper.java trunk/crossfire/src/cfeditor/menu/MenuListener.java trunk/crossfire/src/cfeditor/menu/MenuLocation.java trunk/crossfire/src/cfeditor/menu/MenuManager.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/menu/SwitchedMenuEntry.java trunk/crossfire/src/cfeditor/parameter/ArchParameter.java trunk/crossfire/src/cfeditor/parameter/ArchParameterView.java trunk/crossfire/src/cfeditor/parameter/BooleanParameter.java trunk/crossfire/src/cfeditor/parameter/BooleanParameterView.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/FilterParameterView.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/ParameterDescriptionEditor.java trunk/crossfire/src/cfeditor/parameter/ParameterNameEditor.java trunk/crossfire/src/cfeditor/parameter/ParameterTypeEditor.java trunk/crossfire/src/cfeditor/parameter/StringParameter.java trunk/crossfire/src/cfeditor/parameter/StringParameterView.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 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/JavaScriptTokenMarker.java trunk/crossfire/src/cfeditor/textedit/textarea/KeywordMap.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/SyntaxUtilities.java trunk/crossfire/src/cfeditor/textedit/textarea/TextAreaDefaults.java trunk/crossfire/src/cfeditor/textedit/textarea/TextAreaPainter.java trunk/crossfire/src/cfeditor/textedit/textarea/TextUtilities.java trunk/crossfire/src/cfeditor/textedit/textarea/Token.java trunk/crossfire/src/cfeditor/textedit/textarea/TokenMarker.java trunk/crossfire/src/cfeditor/textedit/textarea/XMLTokenMarker.java trunk/daimonin/src/daieditor/ArchUpdater.java trunk/daimonin/src/daieditor/CArchPanel.java trunk/daimonin/src/daieditor/CArchPanelPan.java trunk/daimonin/src/daieditor/CArchQuickView.java trunk/daimonin/src/daieditor/CAttribBitmask.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFArchAttrib.java trunk/daimonin/src/daieditor/CFArchType.java trunk/daimonin/src/daieditor/CFArchTypeList.java trunk/daimonin/src/daieditor/CFJavaEditor.java trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CFileInputStream.java trunk/daimonin/src/daieditor/CFileReader.java trunk/daimonin/src/daieditor/CGUIUtils.java trunk/daimonin/src/daieditor/CGridderException.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainStatusbar.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/CMapArchPanel.java trunk/daimonin/src/daieditor/CMapFileDecode.java trunk/daimonin/src/daieditor/CMapFileEncode.java trunk/daimonin/src/daieditor/CMapTileList.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/CMapViewIFrame.java trunk/daimonin/src/daieditor/CNewMapDialog.java trunk/daimonin/src/daieditor/CPickmapPanel.java trunk/daimonin/src/daieditor/CPreview.java trunk/daimonin/src/daieditor/CUndoStack.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/IGUIConstants.java trunk/daimonin/src/daieditor/IUndoable.java trunk/daimonin/src/daieditor/MapTilePane.java trunk/daimonin/src/daieditor/MultiArchData.java trunk/daimonin/src/daieditor/MultiPositionData.java trunk/daimonin/src/daieditor/PathManager.java trunk/daimonin/src/daieditor/ProcessRunner.java trunk/daimonin/src/daieditor/ReplaceDialog.java trunk/daimonin/src/daieditor/ResourceFileManager.java trunk/daimonin/src/daieditor/ScriptArchData.java trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/SplashScreen.java trunk/daimonin/src/daieditor/Updater.java trunk/daimonin/src/daieditor/arch/ArchAttribType.java trunk/daimonin/src/daieditor/arch/ArchObject.java trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java trunk/daimonin/src/daieditor/arch/ArchObjectIterator.java trunk/daimonin/src/daieditor/arch/ArchObjectParser.java trunk/daimonin/src/daieditor/arch/ArchObjectStack.java trunk/daimonin/src/daieditor/arch/DuplicateArchException.java trunk/daimonin/src/daieditor/arch/NamedObject.java trunk/daimonin/src/daieditor/arch/NamedObjects.java trunk/daimonin/src/daieditor/arch/NamedTreeNode.java trunk/daimonin/src/daieditor/arch/RecursiveArchObjectIterator.java trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java trunk/daimonin/src/daieditor/arch/anim/AnimationObjects.java trunk/daimonin/src/daieditor/arch/anim/AnimationParseException.java trunk/daimonin/src/daieditor/arch/anim/DuplicateAnimationException.java trunk/daimonin/src/daieditor/arch/face/DuplicateFaceException.java trunk/daimonin/src/daieditor/arch/face/FaceFacade.java trunk/daimonin/src/daieditor/arch/face/FaceObject.java trunk/daimonin/src/daieditor/arch/face/FaceObjects.java trunk/daimonin/src/daieditor/arch/match/AndArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/ArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/ArchObjectMatchers.java trunk/daimonin/src/daieditor/arch/match/AttribArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/MutableNameArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/MutableOrArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/NamedArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/NotArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/OrArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/TypeNrsArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/ViewArchObjectMatcherManager.java trunk/daimonin/src/daieditor/gui/AboutDialog.java trunk/daimonin/src/daieditor/gui/ConnectionView.java trunk/daimonin/src/daieditor/gui/DirectionLayout.java trunk/daimonin/src/daieditor/gui/ErrorListView.java trunk/daimonin/src/daieditor/gui/HideFileFilterProxy.java trunk/daimonin/src/daieditor/gui/MapFileFilter.java trunk/daimonin/src/daieditor/gui/map/LevelRenderer.java trunk/daimonin/src/daieditor/gui/map/MapCursor.java trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java trunk/daimonin/src/daieditor/gui/map/MapCursorEvent.java trunk/daimonin/src/daieditor/gui/map/MapCursorListener.java trunk/daimonin/src/daieditor/gui/map/MapGrid.java trunk/daimonin/src/daieditor/gui/map/MapGridEvent.java trunk/daimonin/src/daieditor/gui/map/MapGridListener.java trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/daimonin/src/daieditor/gui/map/MapUserListener.java trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java trunk/daimonin/src/daieditor/gui/map/MapViewSettingsEvent.java trunk/daimonin/src/daieditor/gui/map/MapViewSettingsListener.java trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java trunk/daimonin/src/daieditor/help/DHelp.java trunk/daimonin/src/daieditor/icons/AbstractFaceProvider.java trunk/daimonin/src/daieditor/icons/ArchFaceProvider.java trunk/daimonin/src/daieditor/icons/DaimoninFaceProvider.java trunk/daimonin/src/daieditor/icons/FaceProvider.java trunk/daimonin/src/daieditor/icons/FilterFaceProvider.java trunk/daimonin/src/daieditor/map/ArchOutOfMapBoundsException.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/daimonin/src/daieditor/map/MapEvent.java trunk/daimonin/src/daieditor/map/MapListener.java trunk/daimonin/src/daieditor/map/MapModel.java trunk/daimonin/src/daieditor/map/MapModelEvent.java trunk/daimonin/src/daieditor/map/MapModelListener.java trunk/daimonin/src/daieditor/map/MapSquare.java trunk/daimonin/src/daieditor/map/validation/AbstractValidator.java trunk/daimonin/src/daieditor/map/validation/ArchValidationError.java trunk/daimonin/src/daieditor/map/validation/ArchValidator.java trunk/daimonin/src/daieditor/map/validation/ArchesValidationError.java trunk/daimonin/src/daieditor/map/validation/CorrectableError.java trunk/daimonin/src/daieditor/map/validation/DefaultErrorCollector.java trunk/daimonin/src/daieditor/map/validation/DelegatingMapValidator.java trunk/daimonin/src/daieditor/map/validation/ErrorCollector.java trunk/daimonin/src/daieditor/map/validation/ErrorHandler.java trunk/daimonin/src/daieditor/map/validation/MapValidationError.java trunk/daimonin/src/daieditor/map/validation/MapValidator.java trunk/daimonin/src/daieditor/map/validation/SquareValidationError.java trunk/daimonin/src/daieditor/map/validation/SquareValidator.java trunk/daimonin/src/daieditor/map/validation/ValidationError.java trunk/daimonin/src/daieditor/map/validation/Validator.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedMobOrSpawnPointChecker.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedMobOrSpawnPointError.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerChecker.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerError.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableChecker.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableError.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleArchChecker.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleArchError.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleLayerChecker.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleLayerError.java trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointChecker.java trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointError.java trunk/daimonin/src/daieditor/map/validation/checks/ExitChecker.java trunk/daimonin/src/daieditor/map/validation/checks/ExitError.java trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointChecker.java trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointError.java trunk/daimonin/src/daieditor/map/validation/checks/SlayingChecker.java trunk/daimonin/src/daieditor/map/validation/checks/SlayingError.java trunk/daimonin/src/daieditor/map/validation/checks/SquareWithoutFloorChecker.java trunk/daimonin/src/daieditor/map/validation/checks/SquareWithoutFloorError.java trunk/daimonin/src/daieditor/map/validation/checks/SysObjectOnLayerZeroChecker.java trunk/daimonin/src/daieditor/map/validation/checks/SysObjectOnLayerZeroError.java trunk/daimonin/src/daieditor/map/validation/checks/TilePathsChecker.java trunk/daimonin/src/daieditor/map/validation/checks/TilePathsError.java trunk/daimonin/src/daieditor/swing/DSplitPane.java trunk/daimonin/src/daieditor/textedit/scripteditor/CFPythonPopup.java trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditControl.java trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditView.java trunk/daimonin/src/daieditor/textedit/textarea/CTokenMarker.java trunk/daimonin/src/daieditor/textedit/textarea/DefaultInputHandler.java trunk/daimonin/src/daieditor/textedit/textarea/HTMLTokenMarker.java trunk/daimonin/src/daieditor/textedit/textarea/InputHandler.java trunk/daimonin/src/daieditor/textedit/textarea/JEditTextArea.java trunk/daimonin/src/daieditor/textedit/textarea/JavaScriptTokenMarker.java trunk/daimonin/src/daieditor/textedit/textarea/KeywordMap.java trunk/daimonin/src/daieditor/textedit/textarea/LuaTokenMarker.java trunk/daimonin/src/daieditor/textedit/textarea/SyntaxDocument.java trunk/daimonin/src/daieditor/textedit/textarea/SyntaxStyle.java trunk/daimonin/src/daieditor/textedit/textarea/SyntaxUtilities.java trunk/daimonin/src/daieditor/textedit/textarea/TextAreaDefaults.java trunk/daimonin/src/daieditor/textedit/textarea/TextAreaPainter.java trunk/daimonin/src/daieditor/textedit/textarea/TextUtilities.java trunk/daimonin/src/daieditor/textedit/textarea/Token.java trunk/daimonin/src/daieditor/textedit/textarea/TokenMarker.java trunk/daimonin/src/daieditor/textedit/textarea/XMLTokenMarker.java Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2006-05-26 10:23:05 UTC (rev 26) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2006-05-26 10:55:45 UTC (rev 27) @@ -34,18 +34,21 @@ /** * The <code>AutojoinList</code> class contains a list of (typically wall-)arches which * do autojoining. - * * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ public class AutojoinList { + private static final Logger log = Logger.getLogger(AutojoinList.class); private static final String filename = "autojoin.txt"; // file with autojoin lists // bitmask constants for nodenr index private static final int NORTH = 1; + private static final int EAST = 2; + private static final int SOUTH = 4; + private static final int WEST = 8; private ArchObjectStack stack; // reference to the stack of default arches @@ -58,10 +61,8 @@ // (0 = no connection, N = north, E = east, S = south, W = west) private int[] nodenr; - /** - * Konstructor - */ - public AutojoinList () { + /** Konstructor */ + public AutojoinList() { stack = null; // pointer to stack of default arches next = null; // pointer to next element nodenr = null; // this array gets initialized in loadList (when needed) @@ -73,11 +74,10 @@ * to the (head) instance which it is called from. * The links from the default arches to their appropriate * AutojoinLists also get set here. - * + * <p/> * Note that this method takes only split seconds to execute, * as it uses the arch hashtable to look up the default arches. :-) - * - * @param archstack the stack of default arches + * @param archstack the stack of default arches * @return true if at least one autojoin list was successfully loaded */ public boolean loadList(ArchObjectStack archstack) { @@ -89,10 +89,10 @@ int[] nbuf = new int[16]; // buffer for nodenumbers of 16 arches int count = 0; // counter index AutojoinList jlist = this; // index of the linked list of AutojoinLists - // (starting at 'this') + // (starting at 'this') // open the resource file - String baseDir = (IGUIConstants.isoView ? CMainControl.getInstance().getArchDefaultFolder()+File.separator+IGUIConstants.CONFIG_DIR : IGUIConstants.CONFIG_DIR); + String baseDir = (IGUIConstants.isoView ? CMainControl.getInstance().getArchDefaultFolder() + File.separator + IGUIConstants.CONFIG_DIR : IGUIConstants.CONFIG_DIR); CFileReader stream = new CFileReader(baseDir, filename); // read the file @@ -123,15 +123,15 @@ jlist.nodenr[i] = nbuf[i]; // store nodenr. in the list archstack.getArch(nbuf[i]).setJoinList(jlist); // set the link in the def. arch if (log.isDebugEnabled()) { - log.debug("("+i+") arch: '"+archstack.getArch(nbuf[i]).getArchName()+"' -> nr: ("+nbuf[i]+")"); + log.debug("(" + i + ") arch: '" + archstack.getArch(nbuf[i]).getArchName() + "' -> nr: (" + nbuf[i] + ")"); } } success = true; // we did it! } else if (count > 16) { - log.warn("In file "+filename+": List with more than 16 valid entries!"); + log.warn("In file " + filename + ": List with more than 16 valid entries!"); } else if (archstack.getArchCount() >= 1) { - log.warn("In file "+filename+": List with less than 16 valid entries!"); + log.warn("In file " + filename + ": List with less than 16 valid entries!"); } section_flag = false; } else if (count < 16) { @@ -147,17 +147,17 @@ if (!archstack.getArch(nbuf[count]).isMulti()) { count++; // no multipart, this one's okay } else { - log.warn("In file "+filename+": Arch '"+line+"' is a multipart."); + log.warn("In file " + filename + ": Arch '" + line + "' is a multipart."); } } else { // (If no arches exist at all, errormessages are suppressed here) if (archstack.getArchCount() >= 1) { - log.warn("In file "+filename+": Arch '"+line+"' not found."); + log.warn("In file " + filename + ": Arch '" + line + "' not found."); } } } catch (NumberFormatException e) { // parsing failed (should not happen) - log.error("ArchObjectStack Hashtable entry '"+entry.toString()+"' not parseable as int!", e); + log.error("ArchObjectStack Hashtable entry '" + entry.toString() + "' not parseable as int!", e); } } else { count++; // too many arches @@ -170,11 +170,11 @@ stream.close(); } catch (FileNotFoundException e) { if (log.isInfoEnabled()) { - log.info("Autojoin definitions file '"+filename+"' not found."); + log.info("Autojoin definitions file '" + filename + "' not found."); } return false; } catch (IOException e) { - log.warn("Read error in file '"+filename+"'."); + log.warn("Read error in file '" + filename + "'."); return false; } @@ -191,11 +191,9 @@ * node_nr of the correct arch to be inserted is returned. * This method must be called from the appropriate element of the * AutojoinList, best use the link from the default arch. - * - * @param x Location of the insert point on the map - * @param y Location of the insert point on the map - * @param map Data model of the map - * + * @param x Location of the insert point on the map + * @param y Location of the insert point on the map + * @param map Data model of the map * @return node_nr of the (def.) arch to be inserted at x, y * -1 if there's already an arch of this list on x, y */ @@ -209,29 +207,29 @@ } // now do the joining in all four directions: - if (map.pointValid(x, y-1)) { - if ((arch = findArchOfJoinlist(map, x, y-1)) != null) { + if (map.pointValid(x, y - 1)) { + if ((arch = findArchOfJoinlist(map, x, y - 1)) != null) { new_index = add_dir(new_index, NORTH); connectArch(arch, nodenr[add_dir(get_index(arch.getNodeNr()), SOUTH)]); } } - if (map.pointValid(x+1, y)) { - if ((arch = findArchOfJoinlist(map, x+1, y)) != null) { + if (map.pointValid(x + 1, y)) { + if ((arch = findArchOfJoinlist(map, x + 1, y)) != null) { new_index = add_dir(new_index, EAST); connectArch(arch, nodenr[add_dir(get_index(arch.getNodeNr()), WEST)]); } } - if (map.pointValid(x, y+1)) { - if ((arch = findArchOfJoinlist(map, x, y+1)) != null) { + if (map.pointValid(x, y + 1)) { + if ((arch = findArchOfJoinlist(map, x, y + 1)) != null) { new_index = add_dir(new_index, SOUTH); connectArch(arch, nodenr[add_dir(get_index(arch.getNodeNr()), NORTH)]); } } - if (map.pointValid(x-1, y)) { - if ((arch = findArchOfJoinlist(map, x-1, y)) != null) { + if (map.pointValid(x - 1, y)) { + if ((arch = findArchOfJoinlist(map, x - 1, y)) != null) { new_index = add_dir(new_index, WEST); connectArch(arch, nodenr[add_dir(get_index(arch.getNodeNr()), EAST)]); } @@ -245,35 +243,34 @@ * All arches around the insert point get adjusted. * This method must be called from the appropriate element of the * AutojoinList, best use the link from the default arch. - * - * @param x Location of the insert point on the map - * @param y Location of the insert point on the map - * @param map Data model of the map + * @param x Location of the insert point on the map + * @param y Location of the insert point on the map + * @param map Data model of the map */ public void join_delete(CMapModel map, int x, int y) { ArchObject arch = null; // temp. arch // do the joining in all four directions: - if (map.pointValid(x, y-1)) { - if ((arch = findArchOfJoinlist(map, x, y-1)) != null) { + if (map.pointValid(x, y - 1)) { + if ((arch = findArchOfJoinlist(map, x, y - 1)) != null) { connectArch(arch, nodenr[remove_dir(get_index(arch.getNodeNr()), SOUTH)]); } } - if (map.pointValid(x+1, y)) { - if ((arch = findArchOfJoinlist(map, x+1, y)) != null) { + if (map.pointValid(x + 1, y)) { + if ((arch = findArchOfJoinlist(map, x + 1, y)) != null) { connectArch(arch, nodenr[remove_dir(get_index(arch.getNodeNr()), WEST)]); } } - if (map.pointValid(x, y+1)) { - if ((arch = findArchOfJoinlist(map, x, y+1)) != null) { + if (map.pointValid(x, y + 1)) { + if ((arch = findArchOfJoinlist(map, x, y + 1)) != null) { connectArch(arch, nodenr[remove_dir(get_index(arch.getNodeNr()), NORTH)]); } } - if (map.pointValid(x-1, y)) { - if ((arch = findArchOfJoinlist(map, x-1, y)) != null) { + if (map.pointValid(x - 1, y)) { + if ((arch = findArchOfJoinlist(map, x - 1, y)) != null) { connectArch(arch, nodenr[remove_dir(get_index(arch.getNodeNr()), EAST)]); } } @@ -281,14 +278,15 @@ /** * Looking up the given node in the nodenr-array of this class. - * - * @param node node to lookup + * @param node node to lookup * @return index of the node in the array. */ private int get_index(int node) { int i; - for (i = 0; i < 16 && node != nodenr[i]; i++); + for (i = 0; i < 16 && node != nodenr[i]; i++) { + ; + } if (node != nodenr[i]) { log.warn("Error in AutojoinList.get_index: index not found"); @@ -298,34 +296,27 @@ return i; } - /** - * Checks if the index (=bitmask) contains the following direction - */ + /** Checks if the index (=bitmask) contains the following direction */ private boolean has_dir(int index, int direction) { - return (index&direction) != 0; + return (index & direction) != 0; } - /** - * add direction to the index - */ + /** add direction to the index */ private int add_dir(int index, int direction) { - return index|direction; + return index | direction; } - /** - * remove direction from the index - */ + /** remove direction from the index */ private int remove_dir(int index, int direction) { - return index&~direction; + return index & ~direction; } /** * Looks for an arch at map-position (x, y) which is part * of this AutojoinList. - * - * @param map the data model of the map - * @param x location to search - * @param y location to search + * @param map the data model of the map + * @param x location to search + * @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) { Modified: trunk/crossfire/src/cfeditor/BshThread.java =================================================================== --- trunk/crossfire/src/cfeditor/BshThread.java 2006-05-26 10:23:05 UTC (rev 26) +++ trunk/crossfire/src/cfeditor/BshThread.java 2006-05-26 10:55:45 UTC (rev 27) @@ -4,6 +4,7 @@ * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ + package cfeditor; import bsh.EvalError; @@ -11,14 +12,16 @@ /** * @author tchize - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments + * <p/> + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments */ public class BshThread extends Thread { private CScriptModel script; + private Interpreter interpreter; + /** * */ @@ -26,9 +29,7 @@ super(); } - /** - * @param name - */ + /** @param name */ public BshThread(String name) { super(name); } @@ -41,7 +42,7 @@ super(group, name); } - public void setInterpreter (Interpreter interpreter) { + public void setInterpreter(Interpreter interpreter) { this.interpreter = interpreter; } Modified: trunk/crossfire/src/cfeditor/CArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanel.java 2006-05-26 10:23:05 UTC (rev 26) +++ trunk/crossfire/src/cfeditor/CArchPanel.java 2006-05-26 10:55:45 UTC (rev 27) @@ -38,23 +38,32 @@ /** * The <code>CArchPanel</code> holds the tile palette. - * * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ public class CArchPanel extends JPanel { + private static final String ARCHPANEL_LOCATION_KEY = "MainWindowArchPanel.dividerLocation"; + /** Controller of this subview. */ private final CMainControl m_control; + /** The "Import..." button. */ private int selectedArch; + private final JTabbedPane m_archAndPickPane; // panel holding both archlist and pickmaps + private final CSplitPane m_splitPane; // our split pane + private final JTabbedPane m_tabDesktop; // the tab panel with arch lists + private final CArchQuickView archQuickPanel; // data/view of selected objects in tab panel + private static PanelNode panelNodeStart; // list of arch panels + private PanelNode panelNodeLast; + private CArchPanelPan m_selectedPanel; // the active panel private static final long serialVersionUID = 6634110300452920361L; @@ -87,7 +96,7 @@ // calculate default value in case there is no settings file Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); - int divLocation = Integer.parseInt(settings.getProperty(ARCHPANEL_LOCATION_KEY, ""+(int)(0.77*0.9*screen.getHeight()))); + int divLocation = Integer.parseInt(settings.getProperty(ARCHPANEL_LOCATION_KEY, "" + (int) (0.77 * 0.9 * screen.getHeight()))); m_splitPane.setDividerLocation(divLocation); m_splitPane.setDividerSize(5); @@ -96,7 +105,7 @@ // we must set the list of the selected list depend on combo selection m_tabDesktop.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { - JTabbedPane tp = (JTabbedPane)e.getSource(); + JTabbedPane tp = (JTabbedPane) e.getSource(); // This is weird: we need to compare against SelectedComponent, // and *not* SelectedIndex. The index seemed to get all messed up during @@ -119,9 +128,7 @@ return panelNodeStart; } - /** - * Move the pickmap panel in front of the default-archpanel - */ + /** Move the pickmap panel in front of the default-archpanel */ public void movePickmapPanelToFront() { if (m_archAndPickPane != null && m_archAndPickPane.getTabCount() > 1) { m_archAndPickPane.setSelectedIndex(1); @@ -177,7 +184,9 @@ // insert new panels in alphabetical order int i; - for (i = 0; i < m_tabDesktop.getTabCount() && name.compareToIgnoreCase(m_tabDesktop.getTitleAt(i)) < 0; i++); + for (i = 0; i < m_tabDesktop.getTabCount() && name.compareToIgnoreCase(m_tabDesktop.getTitleAt(i)) < 0; i++) { + ; + } this.m_tabDesktop.insertTab(name, null, newnode.data.getPanel(), null, i); // careful: during the build proccess we are setting 'm_selectedPanel' @@ -205,7 +214,7 @@ void appExitNotify() { CSettings settings = CSettings.getInstance(IGUIConstants.APP_NAME); - settings.setProperty(ARCHPANEL_LOCATION_KEY, ""+m_splitPane.getDividerLocation()); + settings.setProperty(ARCHPANEL_LOCATION_KEY, "" + m_splitPane.getDividerLocation()); } public int getPanelArch() { @@ -227,8 +236,11 @@ } public class PanelNode { + public CArchPanelPan data; + public PanelNode next; // next node + String title; // title of this PanelNode public PanelNode(CArchPanelPan data, String title) { @@ -242,10 +254,9 @@ } } - /** - * Splitpane class that keeps its size even upon L'n'F change. - */ + /** Splitpane class that keeps its size even upon L'n'F change. */ public class CSplitPane extends JSplitPane { + private static final long serialVersionUID = -2537906454141191712L; public CSplitPane(int newOrientation, Modified: trunk/crossfire/src/cfeditor/CArchPanelPan.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-05-26 10:23:05 UTC (rev 26) +++ trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-05-26 10:55:45 UTC (rev 27) @@ -43,17 +43,26 @@ import org.apache.log4j.Logger; public class CArchPanelPan extends JPanel { + private static final Logger log = Logger.getLogger(CArchPanel.class); + /** Controller of this subview. */ private final CMainControl m_control; private final JList m_list; + private final DefaultListModel model; + private final JPanel m_panelDesktop; + private final JComboBox jbox; + private final StringBuffer list; + private int listcounter; + private int combo_counter; + private final CArchPanel m_panel; private static final long serialVersionUID = 8690200410771201444L; @@ -103,7 +112,7 @@ // 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 (m_control.getCurrentMap() != null && - m_control.getCurrentMap().getMapView() != null) { + m_control.getCurrentMap().getMapView() != null) { m_control.getCurrentMap().getMapView().requestFocus(); // focus to mapview } } @@ -134,7 +143,8 @@ This happens in JDK 1.4 when you select an arch in panel A, then select Panel B, then Panel A again. (why??) */ - } catch (NumberFormatException e) {} + } catch (NumberFormatException e) { + } } m_control.showArchPanelQuickObject(arch); // send it to quick view } @@ -145,11 +155,11 @@ String def = "00000"; String num = Integer.toString(archnr); - this.list.append(def.substring(0, 5-num.length())); + this.list.append(def.substring(0, 5 - num.length())); this.list.append(num); num = Integer.toString(index); - this.list.append(def.substring(0, 5-num.length())); + this.list.append(def.substring(0, 5 - num.length())); this.list.append(num); this.listcounter++; @@ -180,10 +190,10 @@ * @return an array of nodenumbers from all arches in this panel */ public int[] getListNodeNrArray() { - int[] numList = new int[(int)(list.length()/10.)]; + int[] numList = new int[(int) (list.length() / 10.)]; - for (int i = 0; i < (int)(list.length()/10.); i++) { - numList[i] = Integer.parseInt(list.substring(0+10*i, 5+10*i)); + for (int i = 0; i < (int) (list.length() / 10.); i++) { + numList[i] = Integer.parseInt(list.substring(0 + 10 * i, 5 + 10 * i)); //log.debug(CMainControl.getInstance().getArchObjectStack().getArch(numList[i]).getArchName()); } @@ -197,12 +207,12 @@ * note that the same indices are used for same arches in 'getListNodeNrArray()' */ public String[] getListCathegoryArray() { - String[] cathList = new String[(int)(list.length()/10.)]; + String[] cathList = new String[(int) (list.length() / 10.)]; int index; - for (int i = 0; i < (int)(list.length()/10.); i++) { + for (int i = 0; i < (int) (list.length() / 10.); i++) { try { - index = Integer.parseInt(list.substring(5+10*i, 10+10*i)); + index = Integer.parseInt(list.substring(5 + 10 * i, 10 + 10 * i)); cathList[i] = jbox.getItemAt(index).toString().trim(); } catch (NullPointerException e) { log.warn("Nullpointer in getListCathegoryArray()!", e); @@ -226,10 +236,10 @@ if (index >= 0) { if (index == 0) { // this.model.addElement(this.list.substring(offset, offset+5)+" I:"+this.list.substring(offset+5, offset+10)); - this.model.addElement(this.list.substring(offset, offset+5)); + this.model.addElement(this.list.substring(offset, offset + 5)); } else { - if (index == Integer.parseInt(this.list.substring(offset+5, offset+10))) { - this.model.addElement(this.list.substring(offset, offset+5)); + if (index == Integer.parseInt(this.list.substring(offset + 5, offset + 10))) { + this.model.addElement(this.list.substring(offset, offset + 5)); } } } @@ -261,7 +271,7 @@ ArchObject arch = m_control.getArchObjectStack().getArch(Integer.parseInt(value.toString())); if (iss) { m_panel.setPanelArch(Integer.parseInt(value.toString())); - m_control.setStatusText(" "+value.toString()+" "); + m_control.setStatusText(" " + value.toString() + " "); } m_control.setPlainFont(this); setText(arch.getArchName()); Modified: trunk/crossfire/src/cfeditor/CArchQuickView.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-05-26 10:23:05 UTC (rev 26) +++ trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-05-26 10:55:45 UTC (rev 27) @@ -36,15 +36,19 @@ /** * The <code>CArchQuickView</code> holds the tile palette. - * * @author <a href="mailto:mic...@no...">Michael Toennies</a> */ public class CArchQuickView extends JPanel { + /** Controller of this subview. */ private final CMainControl m_control; + private final JLabel archArchNameText = new JLabel(); + private final JLabel archObjNameText = new JLabel(); + private final JLabel archTypeText = new JLabel(); + private final JLabel archTileText = new JLabel(); private static final long serialVersionUID = -5176382751320643475L; @@ -115,33 +119,33 @@ return; } - archArchNameText.setText("<html><font color=black>Arch: "+arch.getArchName()+"</font></html>"); + archArchNameText.setText("<html><font color=black>Arch: " + arch.getArchName() + "</font></html>"); if (arch.getObjName() == null || arch.getObjName().length() <= 0) { ArchObject def = arch.getDefaultArch(); if (def == null || def == arch) { archObjNameText.setText("<html><font color=black>Name: -none- </font></html>"); } else if (def.getObjName() != null && def.getObjName().length() > 0) { - archObjNameText.setText("<html><font color=black>Name: "+def.getObjName()+"</font></html>"); + archObjNameText.setText("<html><font color=black>Name: " + def.getObjName() + "</font></html>"); } else if (def.getArchName() != null && def.getArchName().length() > 0) { - archObjNameText.setText("<html><font color=black>Name: "+def.getArchName()+"</font></html>"); + archObjNameText.setText("<html><font color=black>Name: " + def.getArchName() + "</font></html>"); } else { archObjNameText.setText("<html><font color=black>Name: -none- </font></html>"); } } else { - archObjNameText.setText("<html><font color=black>Name: "+arch.getObjName()+"</font></html>"); + archObjNameText.setText("<html><font color=black>Name: " + arch.getObjName() + "</font></html>"); } - archTypeText.setText("<html><font color=black>Type: "+ - m_control.getArchObjectParser().getArchTypeName(arch.getArchTypNr()) - +" ("+arch.getArchTypNr()+") </font></html>"); + archTypeText.setText("<html><font color=black>Type: " + + m_control.getArchObjectParser().getArchTypeName(arch.getArchTypNr()) + + " (" + arch.getArchTypNr() + ") </font></html>"); if (arch.getRefCount() > 0) { - archTileText.setText("<html><font color=black>Tile: </font><font color=green> multi</font><font color=black> ("+ - +(arch.getRefCount()+1)+" parts) ("+(arch.getRefMaxX()-arch.getRefMaxMX()+1)+","+(arch.getRefMaxY()-arch.getRefMaxMY()+1) - +")</font></html>"); + archTileText.setText("<html><font color=black>Tile: </font><font color=green> multi</font><font color=black> (" + + +(arch.getRefCount() + 1) + " parts) (" + (arch.getRefMaxX() - arch.getRefMaxMX() + 1) + "," + (arch.getRefMaxY() - arch.getRefMaxMY() + 1) + + ")</font></html>"); } else { archTileText.setText("<html><font color=black>Tile: single" - +"</font></html>"); + + "</font></html>"); } // notify ReplaceDialog Modified: trunk/crossfire/src/cfeditor/CAttribBitmask.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribBitmask.java 2006-05-26 10:23:05 UTC (rev 26) +++ trunk/crossfire/src/cfeditor/CAttribBitmask.java 2006-05-26 10:55:45 UTC (rev 27) @@ -47,11 +47,12 @@ * arch attributes. Attacktype, spellpath and material are such * bitmasks. They are disguised for the user, with the help of * the attribute dialog. - * * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ public class CAttribBitmask { + private static final Logger log = Logger.getLogger(CAttribBitmask.class); + // maximum number of characters in a line before linebreak (see getText()) //private static final int MAX_CHARS_PER_LINE = 50; private static final int MAX_CHARS_PER_LINE = 35; @@ -59,15 +60,16 @@ private final String[] bit_name; // array of the names of bitmask-entries private final int maxvalue; // max. possible value + private final int number; // number of bitmask entrys (not counting zero) /** * Konstructor of a bitmask (DEPRECATED!) - * @param name array of names for the bit-entries + * @param name array of names for the bit-entries */ public CAttribBitmask(String[] name) { // initialize arrays - bit_name = new String[name.length+1]; + bit_name = new String[name.length + 1]; //bit_value = new int[name.length+1]; // the zero-bit is always <none> @@ -76,17 +78,17 @@ for (int i = 0; i < name.length; i++) { // fill array and assign 2^i values - bit_name[i+1] = name[i]; + bit_name[i + 1] = name[i]; //bit_value[i+1] = (int)(Math.pow(2., (double)(i-1))); } - number = bit_name.length-1; - maxvalue = ((int)Math.pow(2., (double)(bit_name.length+1)))-1; + number = bit_name.length - 1; + maxvalue = ((int) Math.pow(2., (double) (bit_name.length + 1))) - 1; } /** * Konstructor of a bitmask from XML element - * @param root xml bitmask element + * @param root xml bitmask element */ public CAttribBitmask(Element root) { int i; @@ -99,7 +101,7 @@ // find highest bit number int max_bit = 0; for (i = 0; entries != null && i < entries.size(); i++) { - elem = (Element)entries.get(i); + elem = (Element) entries.get(i); if ((a = elem.getAttribute("bit")) == null || elem.getAttribute("name") == null) { log.warn("Parse error: Found bitmask entry without 'bit' or 'name'."); elem.detach(); // remove element from DOM tree @@ -110,7 +112,7 @@ max_bit = bit; // this is the highest bit so far } } catch (DataConversionException e) { - log.warn("Parse error: Bitmask bit '"+a.getValue()+"' ("+elem.getAttribute("name").getValue()+") is not an integer."); + log.warn("Parse error: Bitmask bit '" + a.getValue() + "' (" + elem.getAttribute("name").getValue() + ") is not an integer."); elem.detach(); // remove element from DOM tree } } @@ -118,34 +120,35 @@ entries = root.getChildren("entry"); // retake list, in case we detached some elements // initialize array - bit_name = new String[max_bit+2]; + bit_name = new String[max_bit + 2]; // initialize names array - the zero-bit always stays <none> - for (i = 0; i < max_bit+2; i++) { + for (i = 0; i < max_bit + 2; i++) { bit_name[i] = "<none>"; } for (i = 0; entries != null && i < entries.size(); i++) { - elem = (Element)entries.get(i); + elem = (Element) entries.get(i); // fill array and assign 2^i values try { - bit_name[elem.getAttribute("bit").getIntValue()+1] = elem.getAttribute("name").getValue(); - } catch (DataConversionException e) {} + bit_name[elem.getAttribute("bit").getIntValue() + 1] = elem.getAttribute("name").getValue(); + } catch (DataConversionException e) { + } } if (log.isDebugEnabled()) { - String s = "bitmask '"+root.getAttribute("name")+"':"; + String s = "bitmask '" + root.getAttribute("name") + "':"; for (i = 0; i < bit_name.length; i++) { - s = s+" "+i+" = "+bit_name[i]; + s = s + " " + i + " = " + bit_name[i]; } log.debug(s); } - number = bit_name.length-1; - maxvalue = ((int)Math.pow(2., (double)(bit_name.length+1)))-1; + number = bit_name.length - 1; + maxvalue = ((int) Math.pow(2., (double) (bit_name.length + 1))) - 1; } else { // Error: this is an "empty" bitmask - log.warn("Error in \""+IGUIConstants.TYPEDEF_FILE+"\": Found a bitmask without content!"); + log.warn("Error in \"" + IGUIConstants.TYPEDEF_FILE + "\": Found a bitmask without content!"); bit_name = new String[1]; bit_name[0] = "<none>"; number = 0; @@ -155,21 +158,20 @@ /** * check wether the given bit-index is an active bit in the bitmask - * @param index index of the bit to check (range from 1-'number') - * @param mask bitmask to check against + * @param index index of the bit to check (range from 1-'number') + * @param mask bitmask to check against * @return true if the bit-index is an active bit */ private boolean is_active(int index, int mask) { - return ((int)(Math.pow(2., (double)(index-1)))&mask) != 0; + return ((int) (Math.pow(2., (double) (index - 1))) & mask) != 0; } /** * Display the appropriate text for a given bitmask value. * The text is put into a non-editable textarea. - * - * @param value bitmask value - * @param textf if non-null, this textarea is used for drawing, - * if null, a new textarea is created and returned + * @param value bitmask value + * @param textf if non-null, this textarea is used for drawing, + * if null, a new textarea is created and returned * @return <code>JTextArea</code> with all entries belonging to the bitmask * and proper dimensions */ @@ -185,7 +187,7 @@ } else { // value too big? if (value > maxvalue) { - log.warn("bitmask value "+value+" is too big."); + log.warn("bitmask value " + value + " is too big."); } boolean linebreak = false; @@ -195,7 +197,7 @@ if (is_active(i, value)) { // is a linebreak required? linelength = text.indexOf("\n") >= 0 ? text.substring(text.lastIndexOf("\n")).length() : text.length(); - if (linelength+bit_name[i].length()+2 > MAX_CHARS_PER_LINE) { + if (linelength + bit_name[i].length() + 2 > MAX_CHARS_PER_LINE) { text += ", \n "; linebreak = true; rows++; @@ -204,7 +206,7 @@ } // append text - text += ((text.length() <= 1 || linebreak) ? "" : ", ")+bit_name[i]; + text += ((text.length() <= 1 || linebreak) ? "" : ", ") + bit_name[i]; linelength = text.indexOf("\n") >= 0 ? text.substring(text.lastIndexOf("\n")).length() : text.length(); if (linelength > columns) { @@ -216,7 +218,7 @@ // create JTextArea (setting columns results in textarea being too wide) if (textf == null) { - textf = new JTextArea(text+" ", rows, 18); + textf = new JTextArea(text + " ", rows, 18); // set colors, border and stuff textf.setForeground(Color.black); @@ -225,7 +227,7 @@ textf.setBorder(BorderFactory.createLineBorder(Color.gray)); } else { // textarea already exists, so change it - textf.setText(text+" "); + textf.setText(text + " "); textf.setRows(rows); textf.setColumns(18); } @@ -233,11 +235,9 @@ return textf; } - /** - * Open a popup frame to select bitmask-entries via chooseboxes. - */ + /** Open a popup frame to select bitmask-entries via chooseboxes. */ public void popup_frame(CAttribDialog attrDialog, CAttribDialog.BitmaskAttrib gui_attr) { - String title = "Choose "+gui_attr.ref.getNameNew().substring(0, 1).toUpperCase()+gui_attr.ref.getNameNew().substring(1); + String title = "Choose " + gui_attr.ref.getNameNew().substring(0, 1).toUpperCase() + gui_attr.ref.getNameNew().substring(1); JDialog frame = new JDialog(attrDialog, title, true); frame.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); @@ -245,7 +245,7 @@ JPanel main_panel = new JPanel(); main_panel.setLayout(new BoxLayout(main_panel, BoxLayout.Y_AXIS)); JPanel grid_panel = new JPanel(new GridLayout(1, 2)); - JPanel left_list = new JPanel(); // left column of checkboxes + JPanel left_list = new JPanel(); // left column of checkboxes left_list.setLayout(new BoxLayout(left_list, BoxLayout.Y_AXIS)); JPanel right_list = new JPanel(); // right column of checkboxes right_list.setLayout(new BoxLayout(right_list, BoxLayout.Y_AXIS)); @@ -254,9 +254,9 @@ // create checkboxes JCheckBox[] checkbox = new JCheckBox[number]; for (int i = 0; i < number; i++) { - checkbox[i] = new JCheckBox(" "+bit_name[i+1]); - checkbox[i].setSelected(is_active(i+1, gui_attr.getValue())); - if (i%2 == 0) { + checkbox[i] = new JCheckBox(" " + bit_name[i + 1]); + checkbox[i].setSelected(is_active(i + 1, gui_attr.getValue())); + if (i % 2 == 0) { left_list.add(checkbox[i]); } else { right_list.add(checkbox[i]); @@ -291,19 +291,24 @@ * where changes to the bitmask can be selected. */ private class PopupFrameAL implements ActionListener { + CAttribBitmask bitmask; // reference to this CAttribBitmask instance + JDialog frame; // reference to the popup dialog frame + CAttribDialog.BitmaskAttrib gui_attr; // gui attribute instance + JCheckBox[] checkbox; // array of checkboxes on the frame + CAttribDialog attrDialog; // instance of attribute dialog (parent frame) /** * Contructor - * @param new_frame thepopup dialog frame - * @param new_gui_attr gui attribute instance - * @param new_mask this CAttribBitmask instance - * @param boxarray array of checkboxes in the popup frame - * @param new_attrD attribute dialog frame + * @param new_frame thepopup dialog frame + * @param new_gui_attr gui attribute instance + * @param new_mask this CAttribBitmask instance + * @param boxarray array of checkboxes in the popup frame + * @param new_attrD attribute dialog frame */ public PopupFrameAL(JDialog new_frame, CAttribDialog.BitmaskAttrib new_gui_attr, CAttribBitmask new_mask, JCheckBox[] boxarray, CAttribDialog new_attrD) { @@ -316,17 +321,17 @@ /** * a button was pressed - * @param event the occured <code>ActionEvent</code> (button pressed) + * @param event the occured <code>ActionEvent</code> (button pressed) */ public void actionPerformed(ActionEvent event) { if (event.getSource() instanceof JButton) { // check if the okay button was pressed - if (((JButton)event.getSource()).getText().equalsIgnoreCase("Ok")) { + if (((JButton) event.getSource()).getText().equalsIgnoreCase("Ok")) { // calculate the new bitmask value: int new_value = 0; for (int i = 0; i < bitmask.number; i++) { if (checkbox[i].isSelected()) { - new_value |= (int)(Math.pow(2., (double)i)); + new_value |= (int) (Math.pow(2., (double) i)); } } Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-26 10:23:05 UTC (rev 26) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-26 10:55:45 UTC (rev 27) @@ -68,20 +68,25 @@ /** * CAttribDialog poses the GUI... [truncated message content] |