From: <chr...@us...> - 2006-11-11 15:18:36
|
Revision: 642 http://svn.sourceforge.net/gridarta/?rev=642&view=rev Author: christianhujer Date: 2006-11-11 07:18:20 -0800 (Sat, 11 Nov 2006) Log Message: ----------- Minor code cleanup: Improved some naming. Removed unneccessary invocation indirection. Moved global rng to common interface. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CArchPanel.java trunk/daimonin/src/daieditor/CArchQuickView.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/src/app/net/sf/gridarta/MainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-11 15:04:21 UTC (rev 641) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-11 15:18:20 UTC (rev 642) @@ -74,9 +74,6 @@ /** ActionFactory. */ private static final ActionFactory ACTION_FACTORY = getFactory("cfeditor"); - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - /** Logger. */ private static final Logger log = Logger.getLogger(CMainControl.class); @@ -155,9 +152,6 @@ private String strCurrentDir; - /** Global random number generator. */ - public static final Random rnd = new Random(System.currentTimeMillis() + 19580427); - // resource directories private File mapDir; Modified: trunk/daimonin/src/daieditor/CArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanel.java 2006-11-11 15:04:21 UTC (rev 641) +++ trunk/daimonin/src/daieditor/CArchPanel.java 2006-11-11 15:18:20 UTC (rev 642) @@ -136,8 +136,8 @@ return selectedPanel != null ? selectedPanel.getArchListObject() : null; } - public void showArchPanelQuickObject(final GameObject arch) { - archQuickPanel.showArchPanelQuickObject(arch); + public void showArchPanelQuickObject(final GameObject gameObject) { + archQuickPanel.showArchPanelQuickObject(gameObject); } public int addArchPanelCombo(final String name) { Modified: trunk/daimonin/src/daieditor/CArchQuickView.java =================================================================== --- trunk/daimonin/src/daieditor/CArchQuickView.java 2006-11-11 15:04:21 UTC (rev 641) +++ trunk/daimonin/src/daieditor/CArchQuickView.java 2006-11-11 15:18:20 UTC (rev 642) @@ -91,11 +91,11 @@ /** * Show quick info for an object. * - * @param gameObjectPart the object to show; this may be any part of a multi-part + * @param gameObject the object to show; this may be any part of a multi-part * object */ - void showArchPanelQuickObject(final GameObject gameObjectPart) { - if (gameObjectPart == null) { + void showArchPanelQuickObject(final GameObject gameObject) { + if (gameObject == null) { if (mainControl.getMainView().isPickmapActive()) { archObjNameText.setText(" -random pick- "); archObjNameText.setForeground(Color.BLUE); @@ -106,11 +106,11 @@ archTypeText.setText(null); archTileText.setText(null); } else { - final GameObject gameObject = gameObjectPart.getHead(); - String objName = gameObject.getObjName(); + final GameObject headObject = gameObject.getHead(); + String objName = headObject.getObjName(); if (objName == null || objName.length() == 0) { - final Archetype<GameObject> archetype = gameObject.getArchetype(); - if (archetype == null || archetype == gameObject) { + final Archetype<GameObject> archetype = headObject.getArchetype(); + if (archetype == null || archetype == headObject) { objName = null; } else if ((objName = archetype.getObjName()) != null && objName.length() != 0) { } else if ((objName = archetype.getArchetypeName()) != null && objName.length() != 0) { @@ -126,19 +126,19 @@ } archObjNameText.setText(objName); - archArchNameText.setText(gameObject.getArchetypeName()); + archArchNameText.setText(headObject.getArchetypeName()); - archTypeText.setText(mainControl.getTypeList().getArchTypeName(gameObject.getArchTypNr()) + " (" + gameObject.getArchTypNr() + ')'); + archTypeText.setText(mainControl.getTypeList().getArchTypeName(headObject.getArchTypNr()) + " (" + headObject.getArchTypNr() + ')'); - if (gameObject.isMulti()) { - archTileText.setText("<html><span style=\"color:green;\"> multi</span> (" + gameObject.getMultiRefCount() + " parts) (" + gameObject.getSizeX() + ',' + gameObject.getSizeY() + ")</html>"); + if (headObject.isMulti()) { + archTileText.setText("<html><span style=\"color:green;\"> multi</span> (" + headObject.getMultiRefCount() + " parts) (" + headObject.getSizeX() + ',' + headObject.getSizeY() + ")</html>"); } else { archTileText.setText("single"); } // notify ReplaceDialog if (ReplaceDialog.isBuilt() && ReplaceDialog.getInstance().isShowing()) { - ReplaceDialog.getInstance().updateArchSelection(gameObject, false); + ReplaceDialog.getInstance().updateArchSelection(headObject, false); } } } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-11-11 15:04:21 UTC (rev 641) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-11-11 15:18:20 UTC (rev 642) @@ -80,7 +80,6 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; -import static java.lang.System.currentTimeMillis; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -88,7 +87,6 @@ import java.util.List; import java.util.ListIterator; import java.util.MissingResourceException; -import java.util.Random; import static java.util.ResourceBundle.getBundle; import java.util.logging.Level; import java.util.logging.Logger; @@ -242,9 +240,6 @@ /** The current main directory. */ private File currentDir; - /** Global random number generator. */ - public static final Random rnd = new Random(currentTimeMillis() + 19580427); - // resource directories private File mapDir; @@ -783,8 +778,8 @@ } // setup quick view window - public void showArchPanelQuickObject(final GameObject arch) { - mainView.showArchPanelQuickObject(arch); + public void showArchPanelQuickObject(final GameObject gameObject) { + mainView.showArchPanelQuickObject(gameObject); } boolean insertArchToMap(final GameObject newarch, final String archname, final GameObject next, final int mapx, final int mapy) { Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-11-11 15:04:21 UTC (rev 641) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-11-11 15:18:20 UTC (rev 642) @@ -293,7 +293,7 @@ return arch; } } - mainControl.showArchPanelQuickObject(null); // send it to quick view + showArchPanelQuickObject(null); return null; } @@ -332,8 +332,8 @@ return null; } - public void showArchPanelQuickObject(final GameObject arch) { - archPanel.showArchPanelQuickObject(arch); + public void showArchPanelQuickObject(final GameObject gameObject) { + archPanel.showArchPanelQuickObject(gameObject); } /** @return the panel with all pickmaps */ Modified: trunk/src/app/net/sf/gridarta/MainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/MainControl.java 2006-11-11 15:04:21 UTC (rev 641) +++ trunk/src/app/net/sf/gridarta/MainControl.java 2006-11-11 15:18:20 UTC (rev 642) @@ -4,6 +4,7 @@ import net.sf.gridarta.gameobject.ArchetypeParser; import net.sf.gridarta.gameobject.ArchetypeSet; import org.jetbrains.annotations.NotNull; +import java.util.Random; /** * This interface is only for unification. @@ -13,6 +14,11 @@ public interface MainControl { /** + * Global random number generator. + */ + Random rnd = new Random(); + + /** * Refresh menus and toolbars. * @deprecated This method is bullshit for being a severe violation of MVC and therefore MUST be removed some day. Do not use it for other than unification purposes. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-11 15:47:05
|
Revision: 643 http://svn.sourceforge.net/gridarta/?rev=643&view=rev Author: christianhujer Date: 2006-11-11 07:46:16 -0800 (Sat, 11 Nov 2006) Log Message: ----------- Fixed modifier order, removed modifier redundancies. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/daimonin/src/daieditor/CArchPanelPan.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/ProcessRunner.java trunk/daimonin/src/daieditor/ReplaceDialog.java trunk/daimonin/src/daieditor/gui/map/tools/InsertionTool.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java trunk/src/app/net/sf/gridarta/textedit/textarea/LuaTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxStyle.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java trunk/src/app/net/sf/gridarta/textedit/textarea/Token.java trunk/src/app/net/sf/gridarta/textedit/textarea/TokenMarker.java Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-11-11 15:46:16 UTC (rev 643) @@ -219,7 +219,7 @@ * @param name Name of a treasurelist * @return True when the treasurelists with the given name exists */ - public static final boolean containsTreasureList(final String name) { + public static boolean containsTreasureList(final String name) { return treasureTable.containsKey(name); } Modified: trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java 2006-11-11 15:46:16 UTC (rev 643) @@ -18,7 +18,7 @@ */ public class SimpleFilterConfig extends BasicFilterConfig { - private boolean enabled = true; + private final boolean enabled = true; private Map<String, Object> properties = new HashMap<String, Object>(); Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-11-11 15:46:16 UTC (rev 643) @@ -108,7 +108,7 @@ boolean locked = false; - ArchComboBoxModel archModel; + private final ArchComboBoxModel archModel; public ArchComboBoxEditor() { archModel = new ArchComboBoxModel(); Modified: trunk/daimonin/src/daieditor/CArchPanelPan.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-11-11 15:46:16 UTC (rev 643) @@ -79,7 +79,7 @@ /** The popup menu for the arch lists to bring up the editor. */ // This looks unused, but don't remove it. It will be used in future. - private JPopupMenu menu = createListPopupMenu(); + private final JPopupMenu menu = createListPopupMenu(); private final CArchPanel archPanel; Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-11-11 15:46:16 UTC (rev 643) @@ -1589,7 +1589,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { if (strAttr != null) { CFTreasureListTree.getInstance().showDialog(strAttr.input, dialog); } Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-11-11 15:46:16 UTC (rev 643) @@ -212,7 +212,7 @@ * @param name Name of a treasurelist * @return True when the treasurelists with the given name exists */ - public static final boolean containsTreasureList(final String name) { + public static boolean containsTreasureList(final String name) { return treasureTable.containsKey(name); } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-11-11 15:46:16 UTC (rev 643) @@ -295,10 +295,10 @@ public MutableOrGameObjectMatcher moaomAlpha = new MutableOrGameObjectMatcher(false); /** The ViewGameObjectMatcherManager for show only. */ - public ViewGameObjectMatcherManager vaommShow = new ViewGameObjectMatcherManager(moaomShow); + public final ViewGameObjectMatcherManager vaommShow = new ViewGameObjectMatcherManager(moaomShow); /** The ViewGameObjectMatcherManager for alpha. */ - public ViewGameObjectMatcherManager vaommAlpha = new ViewGameObjectMatcherManager(moaomAlpha); + public final ViewGameObjectMatcherManager vaommAlpha = new ViewGameObjectMatcherManager(moaomAlpha); private boolean gridVisible; Modified: trunk/daimonin/src/daieditor/ProcessRunner.java =================================================================== --- trunk/daimonin/src/daieditor/ProcessRunner.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/daimonin/src/daieditor/ProcessRunner.java 2006-11-11 15:46:16 UTC (rev 643) @@ -190,7 +190,7 @@ * Set the command to be executed by this ProcessRunner. * @param command command */ - public final void setCommand(final String command) { + public void setCommand(final String command) { this.command = command; } @@ -198,7 +198,7 @@ * Get the command to be executed by this ProcessRunner. * @return command */ - public final String getCommand() { + public String getCommand() { return command; } @@ -206,7 +206,7 @@ * Set the working directory. * @param dir working directory */ - public final void setDir(final File dir) { + public void setDir(final File dir) { this.dir = dir; } @@ -214,7 +214,7 @@ * Get the working directory. * @return working directory */ - public final File getDir() { + public File getDir() { return dir; } @@ -222,7 +222,7 @@ * Action method for starting. * @used */ - public final void controlStart() { + public void controlStart() { synchronized (lock) { if (process != null) { try { @@ -262,7 +262,7 @@ * Action method for stopping. * @used */ - public final void controlStop() { + public void controlStop() { if (process != null) { process.destroy(); } @@ -274,7 +274,7 @@ * Action method for clearing the log. * @used */ - public final void controlClear() { + public void controlClear() { stdtxt.setText(""); } Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-11 15:46:16 UTC (rev 643) @@ -80,8 +80,6 @@ private GameObject replaceArch; // objects will be replaced by this arch - private List<GameObject> replaceSingle = new ArrayList<GameObject>(1); // Used to store only 1 object - private List<GameObject> replaceCopyBuffer; // objects in CopyBuffer private List<GameObject> replacePickmap; // selected objects in pickmap or all if none is selected Modified: trunk/daimonin/src/daieditor/gui/map/tools/InsertionTool.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/InsertionTool.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/daimonin/src/daieditor/gui/map/tools/InsertionTool.java 2006-11-11 15:46:16 UTC (rev 643) @@ -22,7 +22,8 @@ @NotNull private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor.gui.map.tools"); /** The ToggleAction for toggling the insertBelow status. */ - private ToggleAction insertBelowAction = (ToggleAction) ACTION_FACTORY.createToggle(true, "insertBelow", this); + @SuppressWarnings({"UnusedDeclaration"}) + private final ToggleAction insertBelowAction = (ToggleAction) ACTION_FACTORY.createToggle(true, "insertBelow", this); /** The position for insertion. */ private boolean insertBelow; Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-11-11 15:46:16 UTC (rev 643) @@ -58,9 +58,6 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); - /** Flag that indicates if the level has been changed since last save. */ - private boolean levelChanged = false; - /** * The CMainControl used for various operations. * @deprecated it's not a good idea to require the MapModel implementation to know such a heavy-weight strongly UI-related glue class like {@link CMainControl}. Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-11-11 15:46:16 UTC (rev 643) @@ -244,7 +244,7 @@ } /** @return the maptext */ - public @NotNull String getText() { + @NotNull public String getText() { return msgText.toString(); } Modified: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java 2006-11-11 15:46:16 UTC (rev 643) @@ -10,13 +10,13 @@ * 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(); + String getAnimName(); /** * 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(); + String getAnimList(); } // interface AnimationObject Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2006-11-11 15:46:16 UTC (rev 643) @@ -149,7 +149,7 @@ * @return true when this popup menu has been fully initialized and is * ready for use */ - public final boolean isInitialized() { + public boolean isInitialized() { return isReady; } @@ -157,13 +157,13 @@ * Set the caret position where this menu has been invoked. * @param pos caret position in the document */ - public final void setCaretPosition(final int pos) { + public void setCaretPosition(final int pos) { caretPos = pos; getMenu().requestFocus(); ScriptEditControl.registerActivePopup(this); } - public final CFPythonPopupMenu getMenu() { + public CFPythonPopupMenu getMenu() { return menu; } @@ -183,7 +183,7 @@ ignore = false; } - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { if (!ignore) { // get method name to insert String method = popup.getSelectedItem().toString(); Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java 2006-11-11 15:46:16 UTC (rev 643) @@ -100,7 +100,7 @@ return instance; } - public static final boolean isStandAlone() { + public static boolean isStandAlone() { return isStandAlone; } @@ -108,7 +108,7 @@ * @return instance of gridarta main control (is null for stand-alone * configuration!) */ - @Nullable final MainControl getMainControl() { + @Nullable MainControl getMainControl() { return mainControl; } @@ -117,14 +117,14 @@ * popup will be closed (if still open). * @param p active popup to register */ - public static final void registerActivePopup(final CFPythonPopup p) { + public static void registerActivePopup(final CFPythonPopup p) { activePopup = p; } /** * Open a new empty script document. */ - public final void openScriptNew() { + public void openScriptNew() { opened.add("<>"); // this script has no filename assigned yet view.addTab("<New Script>", null); } @@ -132,7 +132,7 @@ /** * Open a new empty script document. */ - public final void openScriptFile(final String pathname) { + public void openScriptFile(final String pathname) { final File file = new File(pathname); if (file.exists() && file.isFile()) { @@ -149,7 +149,7 @@ /** * Open a file which is chosen by the user. */ - public final void openUserWanted() { + public void openUserWanted() { final JFileChooser fileChooser = new JFileChooser(); fileChooser.setDialogTitle("Open Script File"); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); @@ -178,7 +178,7 @@ /** * Close the active script-tab. */ - public final void closeActiveTab() { + public void closeActiveTab() { if (view.getSelectedIndex() >= 0 && opened.size() > 0) { opened.remove(view.getSelectedIndex()); // dump the filename } @@ -199,7 +199,7 @@ /** * Close all opened script-tabs. */ - public final void closeAllTabs() { + public void closeAllTabs() { // simply keep closing active tabs till none are left while (view.getSelectedIndex() >= 0 || opened.size() > 0) { closeActiveTab(); @@ -210,7 +210,7 @@ * Open a filebrowser and prompt the user for a location/name to store this * file. If everything goes fine, the file is saved. */ - public final void saveAsActiveTab() { + public void saveAsActiveTab() { final String activePath = getActiveFilePath(); // active file path ('null' if undefined) final String text = getActiveTextArea().getText(); // Store text data to ensure that the right text is saved later. // User could switch tabs or type text in the meantime, who knows. @@ -270,7 +270,7 @@ /** * Save the active script-tab to the stored filepath. */ - public final void saveActiveTab() { + public void saveActiveTab() { if (getActiveFilePath() != null) { final File file = new File(getActiveFilePath()); // get active path saveTextToFile(file, getActiveTextArea().getText()); // write text to file @@ -286,7 +286,7 @@ * @param file text gets saved into this file * @param text text to be saved */ - public final void saveTextToFile(final File file, String text) { + public void saveTextToFile(final File file, String text) { if (text == null) { text = ""; } @@ -317,14 +317,14 @@ /** * @return currently active JEditTextArea, or null if none are open */ - final JEditTextArea getActiveTextArea() { + JEditTextArea getActiveTextArea() { return view.getActiveTextArea(); } /** * @return file path of active tab, null if no path is available */ - @Nullable final String getActiveFilePath() { + @Nullable String getActiveFilePath() { if (view != null && opened != null && view.getSelectedIndex() >= 0 && opened.size() > 0) { // get stored path final String path = opened.get(view.getSelectedIndex()); Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java 2006-11-11 15:46:16 UTC (rev 643) @@ -189,7 +189,7 @@ /** * Refreshes the enable/disable state of all menus. */ - public final void refresh() { + public void refresh() { // see if there is a path for direct 'save' miSave.setEnabled(control.getActiveFilePath() != null); } Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2006-11-11 15:46:16 UTC (rev 643) @@ -113,7 +113,7 @@ * @param title title of this script (filename) * @param file file where this script is stored, null if new script opened */ - public final void addTab(final String title, final File file) { + public void addTab(final String title, final File file) { final JEditTextArea ta = new JEditTextArea(); // open new TextArea //ta.setFont(new Font("Courier New", Font.PLAIN, 12)); ta.setDocument(new SyntaxDocument()); @@ -172,7 +172,7 @@ /** * Close the active script-tab. */ - public final void closeActiveTab() { + public void closeActiveTab() { if (textAreas.size() > 0) { // remove textArea textAreas.remove(tabPane.getSelectedIndex()); @@ -185,7 +185,7 @@ /** * @return the currently active TextArea (in front) */ - @Nullable public final JEditTextArea getActiveTextArea() { + @Nullable public JEditTextArea getActiveTextArea() { if (getTabCount() > 0) { return textAreas.get(tabPane.getSelectedIndex()); } @@ -196,14 +196,14 @@ /** * @return index of selected tab pane */ - public final int getSelectedIndex() { + public int getSelectedIndex() { return tabPane.getSelectedIndex(); } /** * @return number of open tabs */ - public final int getTabCount() { + public int getTabCount() { return tabPane.getTabCount(); } @@ -212,7 +212,7 @@ * @param index index of the tab to change title * @param title new title string */ - public final void setTitleAt(final int index, final String title) { + public void setTitleAt(final int index, final String title) { tabPane.setTitleAt(index, title); } @@ -224,7 +224,7 @@ * @param message the message to be shown * @return true if the user agrees, false if user disagrees */ - public final boolean askConfirm(final String title, final String message) { + public boolean askConfirm(final String title, final String message) { return JOptionPane.showConfirmDialog(this, message, title, JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.YES_OPTION; } @@ -235,11 +235,11 @@ * @param messageType type of message (see JOptionPane constants), defines * icon used */ - public final void showMessage(final String title, final String message, final int messageType) { + public void showMessage(final String title, final String message, final int messageType) { JOptionPane.showMessageDialog(this, message, title, messageType); } - public final void showMessage(final String title, final String message) { + public void showMessage(final String title, final String message) { JOptionPane.showMessageDialog(this, message, title, JOptionPane.INFORMATION_MESSAGE); } @@ -257,7 +257,7 @@ index = view.getSelectedIndex(); } - public final void stateChanged(final ChangeEvent e) { + public void stateChanged(final ChangeEvent e) { if (index != view.getSelectedIndex()) { // active selected tab has changed menuBar.refresh(); // refresh state of menus @@ -286,11 +286,11 @@ * Window closebox has been clicked. * @param e WindowEvent */ - @Override public final void windowClosing(final WindowEvent e) { + @Override public void windowClosing(final WindowEvent e) { control.closeAllTabs(); } - @Override public final void windowClosed(final WindowEvent e) { + @Override public void windowClosed(final WindowEvent e) { control.closeAllTabs(); // (just make sure tabs are removed...) } Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java 2006-11-11 15:46:16 UTC (rev 643) @@ -448,7 +448,7 @@ public static final class backspace implements ActionListener { /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); if (!textArea.isEditable()) { @@ -477,7 +477,7 @@ public static final class backspace_word implements ActionListener { /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); final int start = textArea.getSelectionStart(); if (start != textArea.getSelectionEnd()) { @@ -512,7 +512,7 @@ public static final class delete implements ActionListener { /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); if (!textArea.isEditable()) { @@ -541,7 +541,7 @@ public static final class delete_word implements ActionListener { /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); final int start = textArea.getSelectionStart(); if (start != textArea.getSelectionEnd()) { @@ -582,7 +582,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); int caret = textArea.getCaretPosition(); @@ -628,7 +628,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); if (select) { textArea.select(textArea.getMarkPosition(), textArea.getDocumentLength()); @@ -647,7 +647,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); int caret = textArea.getCaretPosition(); @@ -688,7 +688,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); if (select) { textArea.select(textArea.getMarkPosition(), 0); @@ -700,7 +700,7 @@ public static final class insert_break implements ActionListener { - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); if (!textArea.isEditable()) { @@ -715,7 +715,7 @@ public static final class insert_tab implements ActionListener { /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); if (!textArea.isEditable()) { @@ -737,7 +737,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); final int caret = textArea.getCaretPosition(); if (caret == textArea.getDocumentLength()) { @@ -762,7 +762,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); int caret = textArea.getCaretPosition(); final int line = textArea.getCaretLine(); @@ -796,7 +796,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); final int lineCount = textArea.getLineCount(); int firstLine = textArea.getFirstLine(); @@ -829,7 +829,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); int caret = textArea.getCaretPosition(); final int line = textArea.getCaretLine(); @@ -860,7 +860,7 @@ public static final class overwrite implements ActionListener { /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); textArea.setOverwriteEnabled( !textArea.isOverwriteEnabled()); @@ -876,7 +876,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); final int caret = textArea.getCaretPosition(); if (caret == 0) { @@ -901,7 +901,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); int caret = textArea.getCaretPosition(); final int line = textArea.getCaretLine(); @@ -935,7 +935,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); int firstLine = textArea.getFirstLine(); final int visibleLines = textArea.getVisibleLines(); @@ -965,7 +965,7 @@ } /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); int caret = textArea.getCaretPosition(); final int line = textArea.getCaretLine(); @@ -996,7 +996,7 @@ public static final class repeat implements ActionListener, InputHandler.NonRecordable { /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); textArea.getInputHandler().setRepeatEnabled(true); final String actionCommand = e.getActionCommand(); @@ -1009,7 +1009,7 @@ public static final class toggle_rect implements ActionListener { /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); textArea.setSelectionRectangular(!textArea.isSelectionRectangular()); } @@ -1018,7 +1018,7 @@ public static final class insert_char implements ActionListener, InputHandler.NonRepeatable { /** {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); final String str = e.getActionCommand(); final int repeatCount = textArea.getInputHandler().getRepeatCount(); @@ -1045,7 +1045,7 @@ * Copy current selection into the system clipboard. * {@inheritDoc} */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { // get the selected string final String text = getTextArea(e).getSelectedText(); if (text != null) { @@ -1067,7 +1067,7 @@ * Copy current selection into the system clipboard, then delete the * selected text. */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { // get the selected string final String text = getTextArea(e).getSelectedText(); if (text != null) { @@ -1090,7 +1090,7 @@ * {@inheritDoc} * Get content of the system clipboard and insert it at caret position. */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textarea = getTextArea(e); final StringBuffer buff = new StringBuffer(""); @@ -1147,7 +1147,7 @@ * {@inheritDoc} * Save the currently active tab */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { ScriptEditControl.getInstance().saveActiveTab(); } } @@ -1163,7 +1163,7 @@ * {@inheritDoc} * Get content of the system clipboard and insert it at caret position. */ - public final void actionPerformed(final ActionEvent e) { + public void actionPerformed(final ActionEvent e) { final JEditTextArea textarea = getTextArea(e); final int caretPos = textarea.getCaretPosition(); // caret position Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2006-11-11 15:18:20 UTC (rev 642) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2006-11-11 15:46:16 UTC (rev 643) @@ -212,17 +212,17 @@ * Set the TextArea font * @param f font */ - @Override public final void setFont(final Font f) { + @Override public void setFont(final Font f) { getPainter().setFont(f); } /** Returns the object responsible for painting this text area. */ - public final TextAreaPainter getPainter() { + public TextAreaPainter getPainter() { return painter; } /** Returns the input handler. */ - public final InputHandler getInputHandler() { + public InputHandler getInputHandler() { return inputHandler; } @@ -230,12 +230,12 @@ * Sets the input handler. * @param inputHandler the new input handler */ - public final void setInputHandler(final InputHandler inputHandler) { + public void setInputHandler(final InputHandler inputHandler) { this.inputHandler = inputHandler; } /** Returns true if the caret is blinking, false otherwise. */ - public final boolean isCaretBlinkEnabled() { + public boolean isCaretBlinkEnabled() { return caretBlinks; } @@ -243,7 +243,7 @@ * Toggles caret blinking. * @param caretBlinks true if the caret should blink, false otherwise */ - public final void setCaretBlinkEnabled(final boolean caretBlinks) { + public void setCaretBlinkEnabled(final boolean caretBlinks) { this.caretBlinks = caretBlinks; if (!caretBlinks) { blink = false; @@ -253,7 +253,7 @@ } /** Returns true if the caret is visible, false otherwise. */ - public final boolean isCaretVisible() { + public boolean isCaretVisible() { return (!caretBlinks || blink) && caretVisible; } @@ -261,7 +261,7 @@ * Sets if the caret should be visible. * @param caretVisible true if the caret should be visible, false otherwise */ - public final void setCaretVisible(final boolean caretVisible) { + public void setCaretVisible(final boolean caretVisible) { this.caretVisible = caretVisible; blink = true; @@ -269,7 +269,7 @@ } /** Blinks the caret. */ - public final void blinkCaret() { + public void blinkCaret() { if (caretBlinks) { blink = !blink; painter.invalidateSelectedLines(); @@ -282,7 +282,7 @@ * Returns the number of lines from the top and button of the text area * that are always visible. */ - public final int getElectricScroll() { + public int getElectricScroll() { return electricScroll; } @@ -292,7 +292,7 @@ * @param electricScroll the number of lines always visible from the top or * bottom */ - public final void setElectricScroll(final int electricScroll) { + public void setElectricScroll(final int electricScroll) { this.electricScroll = electricScroll; } @@ -301,7 +301,7 @@ * number of lines in the document changes, or when the size of the text * are changes. */ - public final void updateScrollBars() { + public void updateScrollBars() { if (vertical != null && visibleLines != 0) { vertical.setValues(firstLine, visibleLines, 0, getLineCount()); //vertical.setUnitIncrement(2); @@ -319,7 +319,7 @@ } /** Returns the line displayed at the text area's origin. */ - public final int getFirstLine() { + public int getFirstLine() { return firstLine; } @@ -327,7 +327,7 @@ * Sets the line displayed at the text area's origin without updating the * scroll bars. */ - public final void setFirstLine(final int firstLine) { + public void setFirstLine(final int firstLine) { if (firstLine == this.firstLine) { return; } @@ -340,7 +340,7 @@ } /** Returns the number of lines visible in this text area. */ - public final int getVisibleLines() { + public int getVisibleLines() { return visibleLines; } @@ -348,7 +348,7 @@ * Recalculates the number of visible lines. This should not be called * directly. */ - public final void recalculateVisibleLines() { + public void recalculateVisibleLines() { if (painter == null) { return; } @@ -368,7 +368,7 @@ } /** Returns the horizontal offset of drawn lines. */ - public final int getHorizontalOffset() { + public int getHorizontalOffset() { return horizontalOffset; } @@ -377,7 +377,7 @@ * horizontal scrolling. * @param horizontalOffset offset The new horizontal offset */ - public final void setHorizontalOffset(final int horizontalOffset) { + public void setHorizontalOffset(final int horizontalOffset) { if (horizontalOffset == this.horizontalOffset) { return; } @@ -396,7 +396,7 @@ * @param horizontalOffset the new horizontal offset * @return true if any of the values were changed, false otherwise */ - public final boolean setOrigin(final int firstLine, final int horizontalOffset) { + public boolean setOrigin(final int firstLine, final int horizontalOffset) { boolean changed = false; if (horizontalOffset != this.horizontalOffset) { @@ -423,7 +423,7 @@ * @return true if scrolling was actually performed, false if the caret was * already visible */ - public final boolean scrollToCaret() { + public boolean scrollToCaret() { final int line = getCaretLine(); final int lineStart = getLineStartOffset(line); final int offset = Math.max(0, Math.min(getLineLength(line) - 1, getCaretPosition() - lineStart)); @@ -436,7 +436,7 @@ * registered for keypress-events. The graphics context must be fully * initialized before calling this method. */ - public final void setEditingFocus() { + public void setEditingFocus() { try { requestFocus(); setCaretVisible(true); @@ -455,7 +455,7 @@ * @return true if scrolling was actually performed, false if the line and * offset was already visible */ - public final boolean scrollTo(final int line, final int offset) { + public boolean scrollTo(final int line, final int offset) { // visibleLines == 0 before the component is realized // we can't do any proper scrolling then, so we have // this hack... @@ -495,7 +495,7 @@ * Converts a line index to a y co-ordinate. * @param line the line */ - public final int lineToY(final int line) { + public int lineToY(final int line) { final FontMetrics fm = painter.getFontMetrics(); return (line - firstLine) * fm.getHeight() - (fm.getLeading() + fm.getMaxDescent()); } @@ -504,7 +504,7 @@ * Converts a y co-ordinate to a line index. * @param y the y co-ordinate */ - public final int yToLine(final int y) { + public int yToLine(final int y) { final FontMetrics fm = painter.getFontMetrics(); final int height = fm.getHeight(); return Math.max(0, Math.min(getLineCount() - 1, y / height + firstLine)); @@ -516,7 +516,7 @@ * @param line the line * @param offset the offset, from the start of the line */ - public final int offsetToX(final int line, final int offset) { + public int offsetToX(final int line, final int offset) { // don't use cached tokens painter.setCurrentLineTokens(null); return _offsetToX(line, offset); @@ -529,7 +529,7 @@ * @param line the line * @param offset the offset, from the start of the line */ - public final int _offsetToX(final int line, final int offset) { + public int _offsetToX(final int line, final int offset) { final TokenMarker tokenMarker = getTokenMarker(); /* Use painter's cached info for speed */ @@ -591,7 +591,7 @@ * @param line the line * @param x the x co-ordinate */ - public final int xToOffset(final int line, final int x) { + public int xToOffset(final int line, final int x) { final TokenMarker tokenMarker = getTokenMarker(); /* Use painter's cached info for speed */ @@ -690,14 +690,14 @@ * @param x the x co-ordinate of the point * @param y the y co-ordinate of the point */ - public final int xyToOffset(final int x, final int y) { + public int xyToOffset(final int x, final int y) { final int line = yToLine(y); final int start = getLineStartOffset(line); return start + xToOffset(line, x); } /** Returns the document this text area is editing. */ - public final SyntaxDocument getDocument() { + public SyntaxDocument getDocument() { return document; } @@ -705,7 +705,7 @@ * Sets the document this text area is editing. * @param document the document */ - public final void setDocument(final SyntaxDocument document) { + public void setDocument(final SyntaxDocument document) { if (this.document == document) { return; } @@ -727,7 +727,7 @@ * Returns the document's token marker. Equivalent to calling * <code>getDocument().getTokenMarker()</code>. */ - public final TokenMarker getTokenMarker() { + public TokenMarker getTokenMarker() { return document.getTokenMarker(); } @@ -736,7 +736,7 @@ * <code>getDocument().setTokenMarker()</code>. * @param tokenMarker the token marker */ - public final void setTokenMarker(final TokenMarker tokenMarker) { + public void setTokenMarker(final TokenMarker tokenMarker) { document.setTokenMarker(tokenMarker); } @@ -744,12 +744,12 @@ * Returns the length of the document. Equivalent to calling * <code>getDocument().getLength()</code>. */ - public final int getDocumentLength() { + public int getDocumentLength() { return document.getLength(); } /** Returns the number of lines in the document. */ - public final int getLineCount() { + public int getLineCount() { return document.getDefaultRootElement().getElementCount(); } @@ -757,7 +757,7 @@ * Returns the line containing the specified offset. * @param offset the offset */ - public final int getLineOfOffset(final int offset) { + public int getLineOfOffset(final int offset) { return document.getDefaultRootElement().getElementIndex(offset); } @@ -767,7 +767,7 @@ * @return the start offset of the specified line, or -1 if the line is * invalid */ - public final int getLineStartOffset(final int line) { + public int getLineStartOffset(final int line) { final Element lineElement = document.getDefaultRootElement().getElement(line); if (lineElement == null) { return -1; @@ -782,7 +782,7 @@ * @return the end offset of the specified line, or -1 if the line is * invalid */ - public final int getLineEndOffset(final int line) { + public int getLineEndOffset(final int line) { final Element lineElement = document.getDefaultRootElement().getElement(line); if (lineElement == null) { return -1; @@ -795,7 +795,7 @@ * Returns the length of the specified line. * @param line the line */ - public final int getLineLength(final int line) { + public int getLineLength(final int line) { final Element lineElement = document.getDefaultRootElement().getElement(line); if (lineElement == null) { return -1; @@ -807,7 +807,7 @@ /** * Returns the entire text of this text area. */ - @Nullable public final String getText() { + @Nullable public String getText() { try { return document.getText(0, document.getLength()); } catch (final BadLocationException bl) { @@ -819,7 +819,7 @@ /** * Sets the entire text of this text area. */ - public final void setText(final String text) { + public void setText(final String text) { try { SyntaxDocument.beginCompoundEdit(); document.remove(0, document.getLength()); @@ -837,7 +837,7 @@ * @param len the length of the substring * @return the substring, or null if the offsets are invalid */ - @Nullable public final String getText(final int start, final int len) { + @Nullable public String getText(final int start, final int len) { try { return document.getText(start, len); } catch (final BadLocationException bl) { @@ -853,7 +853,7 @@ * @param len the length of the substring * @param segment the segment */ - public final void getText(final int start, final int len, final Segment segment) { + public void getText(final int start, final int len, final Segment segment) { try { document.getText(start, len, segment); } catch (final BadLocationException bl) { @@ -867,7 +867,7 @@ * @param lineIndex the line * @return the text, or null if the line is invalid */ - public final String getLineText(final int lineIndex) { + public String getLineText(final int lineIndex) { final int start = getLineStartOffset(lineIndex); return getText(start, getLineEndOffset(lineIndex) - start - 1); } @@ -877,20 +877,20 @@ * invalid, the segment will contain a null string. * @param lineIndex the line */ - public final void getLineText(final int lineIndex, final Segment segment) { + public void getLineText(final int lineIndex, final Segment segment) { final int start = getLineStartOffset(lineIndex); getText(start, getLineEndOffset(lineIndex) - start - 1, segment); } /** Returns the selection start offset. */ - public final int getSelectionStart() { + public int getSelectionStart() { return selectionStart; } /** * Returns the offset where the selection starts on the specified line. */ - public final int getSelectionStart(final int line) { + public int getSelectionStart(final int line) { if (line == selectionStartLine) { return selectionStart; } else if (rectSelect) { @@ -907,7 +907,7 @@ } /** Returns the selection start line. */ - public final int getSelectionStartLine() { + public int getSelectionStartLine() { return selectionStartLine; } @@ -917,19 +917,19 @@ * @param selectionStart the selection start * @see #select(int, int) */ - public final void setSelectionStart(final int selectionStart) { + public void setSelectionStart(final int selectionStart) { select(selectionStart, selectionEnd); } /** Returns the selection end offset. */ - public final int getSelectionEnd() { + public int getSelectionEnd() { return selectionEnd; } /** * Returns the offset where the selection ends on the specified line. */ - public final int getSelectionEnd(final int line) { + public int getSelectionEnd(final int line) { if (line == selectionEndLine) { return selectionEnd; } else if (rectSelect) { @@ -946,7 +946,7 @@ } /** Returns the selection end line. */ - public final int getSelectionEndLine() { + public int getSelectionEndLine() { return selectionEndLine; } @@ -956,7 +956,7 @@ * @param selectionEnd the selection end * @see #select(int, int) */ - public final void setSelectionEnd(final int selectionEnd) { + public void setSelectionEnd(final int selectionEnd) { select(selectionStart, selectionEnd); } @@ -965,12 +965,12 @@ * the selection end, depending on which direction the selection was made * in. */ - public final int getCaretPosition() { + public int getCaretPosition() { return biasLeft ? selectionStart : selectionEnd; } /** Returns the caret line. */ - public final int getCaretLine() { + public int getCaretLine() { return biasLeft ? selectionStartLine : selectionEndLine; } @@ -979,12 +979,12 @@ * the caret position. * @see #getCaretPosition() */ - public final int getMarkPosition() { + public int getMarkPosition() { return biasLeft ? selectionEnd : selectionStart; } /** Returns the mark line. */ - public final int getMarkLine() { + public int getMarkLine() { return biasLeft ? selectionEndLine : selectionStartLine; } @@ -994,21 +994,21 @@ * @param caret the caret position * @see #select(int, int) */ - public final void setCaretPosition(final int caret) { + public void setCaretPosition(final int caret) { select(caret, caret); } /** * Selects all text in the document. */ - public final void selectAll() { + public void selectAll() { select(0, getDocumentLength()); } /** * Moves the mark to the caret position. */ - public final void selectNone() { + public void selectNone() { select(getCaretPosition(), getCaretPosition()); } @@ -1019,7 +1019,7 @@ * @param start the start offset * @param end the end offset */ - public final void select(final int start, final int end) { + public void select(final int start, final int end) { final int newStart; final int newEnd; final boolean newBias; @@ -1088,7 +1088,7 @@ /** * Returns the selected text, or null if no selection is active. */ - @Nullable public final String getSelectedText() { + @Nullable public String getSelectedText() { if (selectionStart == selectionEnd) { return null; } @@ -1138,7 +1138,7 @@ * Replaces the selection with the specified text. * @param selectedText the replacement text for the selection */ - public final void setSelectedText(final String selectedText) { + public void setSelectedText(final String selectedText) { if (!editable) { throw new InternalError("Text component read only"); } @@ -1208,7 +1208,7 @@ } /** Returns true if this text area is editable, false otherwise. */ - public final boolean isEditable() { + public boolean isEditable() { return editable; } @@ -1217,12 +1217,12 @@ * @param editable true if this text area should be editable, false * otherwise */ - public final void setEditable(final boolean editable) { + public void setEditable(final boolean editable) { this.editable = editable; } /** Returns the right click popup menu. */ - public final JPopupMenu getRightClickPopup() { + public JPopupMenu getRightClickPopup() { return popup; } @@ -1230,7 +1230,7 @@ * Sets the right click popup menu. * @param popup the popup */ - public final void setRightClickPopup(final JPopupMenu popup) { + public void setRightClickPopup(final JPopupMenu popup) { this.popup = popup; } @@ -1238,7 +1238,7 @@ * Returns the `magic' caret position. This can be used to preserve the * column position when moving up and down lines. */ - public final int getMagicCaretPosition() { + public int getMagicCaretPosition() { return magicCaret; } @@ -1247,7 +1247,7 @@ * position when moving up and down lines. * @param magicCaret the magic caret position */ - public final void setMagicCaretPosition(final int magicCaret) { + public void setMagicCaretPosition(final int magicCaret) { this.magicCaret = magicCaret; } @@ -1258,7 +1258,7 @@ * @see #setSelectedText(String) * @see #isOverwriteEnabled() */ - public final void overwriteSetSelectedText(final String str) { + public void overwriteSetSelectedText(final String str) { // Don't overstrike if there is a selection if (!overwrite || selectionStart != selectionEnd) { setSelectedText(str); @@ -1287,7 +1287,7 @@ } /** Returns true if overwrite mode is enabled, false otherwise. */ - public final boolean isOverwriteEnabled() { + public boolean isOverwriteEnabled() { return overwrite; } @@ -1296,13 +1296,13 @@ * @param overwrite true if overwrite mode should be enabled, false * otherwise */ - public final void setOverwriteEnabled(final boolean overwrite) { + public void setOverwriteEnabled(final boolean overwrite) { this.overwrite = overwrite; painter.invalidateSelectedLines(); } /** Returns true if the selection is rectangular, false otherwise. */ - public final boolean isSelectionRectangular() { + public boolean isSelectionRectangular() { return rectSelect; } @@ -1311,7 +1311,7 @@ * @param rectSelect true if the selection should be rectangular, false * otherwise */ - public final void setSelectionRectangular(final boolean rectSelect) { + public void setSelectionRectangular(final boolean rectSelect) { this.rectSelect = rectSelect; painter.invalidateSelectedLines(); } @@ -1320,7 +1320,7 @@ * Returns the position of the highlighted bracket (the bracket matching * the one before the caret). */ - public final int getBracketPosition() { + public int getBracketPosition() { return bracketPosition; } @@ -1328,7 +1328,7 @@ * Returns the line of the highlighted bracket (the bracket matching the * one before the caret). */ - public final int getBracketLine() { + public int getBracketLine() { return bracketLine; } @@ -1336,7 +1336,7 @@ * Adds a caret change listener to this text area. * @param listener the listener */ - public final void addCaretListener(final CaretListener listener) { + public void addCaretListener(final CaretListener listener) { listenerList.add(CaretListener.class, listener); } @@ -1344,7 +1344,7 @@ * Removes a caret change listener from this text area. * @param listener the listener */ - public final void removeCaretListener(final CaretListener listener) { + public void removeCaretListener(final CaretListener listener) { listenerList.remove(CaretListener.class, listener); } @@ -1352,7 +1352,7 @@ * Deletes the selected text from the text area and places it into the * clipboard. */ - public final void cut() { + public void cut() { if (editable) { copy(); setSelectedText(""); @@ -1360,7 +1360,7 @@ } /** Places the selected text into the clipboard. */ - public final void copy() { + public void copy() { if (selectionStart != selectionEnd) { final Clipboard clipboard = getToolkit().getSystemClipboard(); @@ -1379,7 +1379,7 @@ /** * Inserts the clipboard contents into the text. */ - public final void paste() { + public void paste() { if (editable) { final Clipboard clipboard = getToolkit().getSystemClipboard(); try { @@ -1405,7 +1405,7 @@ * Called by the AWT when this component is removed from it's parent. This * stops clears the currently focused component. */ - @Override public final void removeNotify() { + @Override public void removeNotify() { super.removeNotify(); if (focusedComponent == this) { focusedComponent = null; @@ -1416,7 +1416,7 @@ * Forwards key events directly to the input handler. This is slightly * faster than using a KeyListener because some Swing overhead is avoided. */ - @Override public final void processKeyEvent(final KeyEvent evt) { + @Override public void processKeyEvent(final KeyEvent evt) { if (inputHandler == null) { return; } @@ -1505,7 +1505,7 @@ protected boolean rectSelect; - protected final void fireCaretEvent() { + protected void fireCaretEvent() { final Object[] listeners = listenerList.getListenerList(); for (int i = listeners.length - 2; i >= 0; i--) { if (listeners[i] == CaretListener.class) { @@ -1514,7 +1514,7 @@ } } - protected final void updateBracketHighlight(final int newCaretPosition) { + protected void updateBracketHighlight(final int newCaretPosition) { if (newCaretPosition == 0) { bracketPosition = bracketLine = -1; return; @@ -1534,7 +1534,7 @@ bracketLine = bracketPosition = -1; } - protected final void documentChanged(final DocumentEvent evt) { + protected void documentChanged(final DocumentEvent evt) { final DocumentEvent.ElementChange ch = evt.getChange(document.getDefaultRootElement()); final int count; @@ -1559,7 +1559,7 @@ final class ScrollLayout implements LayoutManager { - public final void addLayoutComponent(final String name, final Component comp) { + public void addLayoutComponent(final String name, final Component comp) { if (name.equals(CENTER)) { center = comp; } else if (name.equals(RIGHT)) { @@ -1571,7 +1571,7 @@ } } - public final void removeLayoutComponent(final Component comp) { + public void removeLayoutComponent(final Component comp) { if (center == comp) { center = null; } @@ -1587,7 +1587,7 @@ } } - public final Dimension preferredLayoutSize(final Container parent) { + public Dimension preferredLayoutSize(final Container parent) { final Dimension dim = new Dimension(); final Insets insets = getInsets(); dim.width = insets.left + insets.right; @@ -1604,7 +1604,7 @@ return dim; } - public final Dimension minimumLayoutSize(final Container parent) { + public Dimension minimumLayoutSize(final Container parent) { final Dimension dim = new Dimension(); final Insets insets = getInsets(); dim.width = insets.left + insets.right; @@ -1621,7 +1621,7 @@ return dim; } - public final void layoutContainer(final Container parent) { + public void layoutContainer(final Container parent) { final Dimension size = parent.getS... [truncated message content] |
From: <chr...@us...> - 2006-11-11 17:25:13
|
Revision: 644 http://svn.sourceforge.net/gridarta/?rev=644&view=rev Author: christianhujer Date: 2006-11-11 09:24:41 -0800 (Sat, 11 Nov 2006) Log Message: ----------- Changed CMapFileEncode to Java I/O style. Unified CMapFileEncode and its usages. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/io/CMapFileEncode.java trunk/crossfire/src/cfeditor/map/MapArchObject.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/io/CMapFileEncode.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/io/AbstractMapFileDecode.java trunk/src/app/net/sf/gridarta/io/MapFileEncode.java trunk/src/app/net/sf/gridarta/map/MapArchObject.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/io/AbstractMapFileEncode.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-11 15:46:16 UTC (rev 643) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-11 17:24:41 UTC (rev 644) @@ -43,7 +43,6 @@ import java.util.Enumeration; import java.util.Iterator; import java.util.List; -import java.util.Random; import java.util.Vector; import javax.swing.ImageIcon; import javax.swing.JFileChooser; @@ -108,8 +107,6 @@ /** Bit field of edit types to show only. */ private int tileEdit; - private CMapFileEncode mapFileEncoder; - private ArchetypeParser archetypeParser; /** The Animation Objects. */ @@ -233,9 +230,6 @@ autoPopupDocu = false; } - // attach map encoder and decoder - mapFileEncoder = new CMapFileEncode(); - // our global object parser archetypeParser = new ArchetypeParser(this); animationObjects = new AnimationObjects(); @@ -931,7 +925,12 @@ public void encodeMapFile(@NotNull final File file, final MapModel mapModel) { final String fname = file.getAbsolutePath(); try { - mapFileEncoder.encodeMapFile(file, mapModel); + final CMapFileEncode mapFileEncoder = new CMapFileEncode(file); + try { + mapFileEncoder.encodeMapFile(mapModel); + } finally { + mapFileEncoder.close(); + } } catch (final FileNotFoundException e) { showMessage("Error Save Map", "Error writing file " + fname + "\n"); } catch (final IOException e) { Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-11-11 15:46:16 UTC (rev 643) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-11-11 17:24:41 UTC (rev 644) @@ -387,16 +387,6 @@ } /** - * Determine if this part is the head part. For single-part objects this is - * always true. - * - * @return <code>true</code> iff this part if a head part - */ - public boolean isHead() { - return getHead() == this; - } - - /** * Determine if this part is a tail part. For single-part objects this is * never true. * Modified: trunk/crossfire/src/cfeditor/io/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapFileEncode.java 2006-11-11 15:46:16 UTC (rev 643) +++ trunk/crossfire/src/cfeditor/io/CMapFileEncode.java 2006-11-11 17:24:41 UTC (rev 644) @@ -27,93 +27,47 @@ import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapModel; -import java.awt.Point; import java.io.BufferedReader; -import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; -import java.io.FileWriter; import java.io.IOException; import java.io.StringReader; import java.util.Arrays; import java.util.Comparator; import java.util.HashMap; import java.util.Map; -import net.sf.gridarta.Size2D; import net.sf.gridarta.gameobject.Archetype; -import net.sf.gridarta.io.MapFileEncode; +import net.sf.gridarta.io.AbstractMapFileEncode; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; /** - * The <code>CMapFileEncode</code> + * The <code>CMapFileEncode</code> is used to write a map to a file. * @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 CMapFileEncode implements MapFileEncode<MapModel> { +public final class CMapFileEncode extends AbstractMapFileEncode<GameObject, MapArchObject, MapModel> { private static final Logger log = Logger.getLogger(CMapFileEncode.class); - private BufferedWriter bufferedWriter; - - private String fname; - - /** Create a CMapFileEncode instance. */ - public CMapFileEncode() { + /** + * Create a CMapFileEncode instance. + * @param file File to open. + * @throws FileNotFoundException in case the file couldn't be opened for writing + */ + public CMapFileEncode(@NotNull final File file) throws FileNotFoundException { + super(file); } - /** {@inheritDoc} */ - public void encodeMapFile(@NotNull final File file, @NotNull final MapModel mapModel) throws FileNotFoundException, IOException { - final MapArchObject mapArch = mapModel.getMapArchObject(); - - try { - fname = file.getAbsolutePath(); - bufferedWriter = new BufferedWriter(new FileWriter(file)); - //GameObject multi; - - // write map header: map arch - mapArch.writeMapArch(bufferedWriter); - - // first, write all one tile parts - final Size2D mapSize = mapArch.getMapSize(); - final Point pos = new Point(); - for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { - for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { - for (final GameObject gameObject : mapModel.getMapSquare(pos)) { - // only non multi suckers - if (!gameObject.isMulti()) { - writeGameObject(gameObject, false); - } - } // node - } // y - } // x - - // second, we drop the multi part suckers out - for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { - for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { - for (final GameObject gameObject : mapModel.getMapSquare(pos)) { - // search only for heads! - if (gameObject.isMulti() && gameObject.isHead()) { - // only the heads get stored in the mapfile - // (that's much more efficient) - writeGameObject(gameObject, false); - } - } // node - } // y - } // x - } finally { - bufferedWriter.close(); - bufferedWriter = null; - } - } - /** - * Here the map arch gets written into the file. - * @param gameObject <code>GameObject</code> to be written into the map - * @param isInventory is 'arch' inside a container? true/false - * @return true if arch was written successfully + * Writes a single GameObject. + * @param gameObject <code>GameObject</code> to be written into the map + * @param x X position of gameObject (0 if <var>gameObject</var> is inside an inventory) + * @param y Y position of gameObject (0 if <var>gameObject</var> is inside an inventory) + * @throws IOException in case of I/O problems */ - void writeGameObject(final GameObject gameObject, final boolean isInventory) throws IOException { + protected void writeGameObject(final GameObject gameObject, final int x, final int y) throws IOException { final Archetype<GameObject> archetype = gameObject.getArchetype(); // Collect all fields to write. @@ -208,42 +162,37 @@ } } - if (!isInventory) { - // map coordinates only belong into map arches (not inventory arches) - final int x = gameObject.getMapX(); - if (x != 0) { - fields.put("x", Integer.toString(x)); - } - - final int y = gameObject.getMapY(); - if (y != 0) { - fields.put("y", Integer.toString(y)); - } + // map coordinates only belong into map arches (not inventory arches) + if (x != 0) { + fields.put("x", Integer.toString(x)); } + if (y != 0) { + fields.put("y", Integer.toString(y)); + } // Sort fields to match server/crossedit order. final String[] keys = (String[]) fields.keySet().toArray(new String[0]); Arrays.sort(keys, keyOrderComparator); // Actually write the fields. - bufferedWriter.write("arch " + gameObject.getArchetypeName() + "\n"); + append("arch " + gameObject.getArchetypeName() + "\n"); for (int i = 0; i < keys.length; i++) { final String value = (String) fields.get(keys[i]); if (value != null) { final String key = keys[i]; if (key.equals("msg") || key.equals("lore")) { - bufferedWriter.write(key + "\n" + value + "\n"); + append(key + "\n" + value + "\n"); } else { - bufferedWriter.write(key + " " + value + "\n"); + append(key + " " + value + "\n"); } } } for (final GameObject inventoryItem : gameObject) { - writeGameObject(inventoryItem, true); + writeGameObject(inventoryItem, 0, 0); } - bufferedWriter.write("end\n"); + append("end\n"); } /** Modified: trunk/crossfire/src/cfeditor/map/MapArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-11-11 15:46:16 UTC (rev 643) +++ trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-11-11 17:24:41 UTC (rev 644) @@ -26,7 +26,6 @@ import cfeditor.IGUIConstants; import java.io.BufferedReader; -import java.io.BufferedWriter; import java.io.IOException; import net.sf.gridarta.Size2D; import net.sf.gridarta.map.AbstractMapArchObject; @@ -494,104 +493,104 @@ /** * Writing the MapArchObject into the mapfile - * @param stream <code>BufferedWriter</code> to the mapfile + * @param appendable <code>BufferedWriter</code> to the mapfile * @throws java.io.FileNotFoundException the mapfile could not be found * @throws IOException an I/O error occured during writing to the file */ - public void writeMapArch(final BufferedWriter stream) throws IOException { + public void writeMapArch(final Appendable appendable) throws IOException { int i; - stream.append("arch map\n"); + appendable.append("arch map\n"); if (getMapName().length() > 0) { - stream.append("name ").append(getMapName()).append("\n"); + appendable.append("name ").append(getMapName()).append("\n"); } if (getSwapTime() > 0) { - stream.append("swap_time ").append(String.valueOf(getSwapTime())).append("\n"); + appendable.append("swap_time ").append(String.valueOf(getSwapTime())).append("\n"); } if (getResetTimeout() > 0) { - stream.append("reset_timeout ").append(String.valueOf(getResetTimeout())).append("\n"); + appendable.append("reset_timeout ").append(String.valueOf(getResetTimeout())).append("\n"); } if (isFixedReset()) { - stream.append("fixed_resettime 1\n"); + appendable.append("fixed_resettime 1\n"); } if (getDifficulty() > 0) { - stream.append("difficulty ").append(String.valueOf(getDifficulty())).append("\n"); + appendable.append("difficulty ").append(String.valueOf(getDifficulty())).append("\n"); } if (region.length() > 0) { - stream.append("region ").append(region).append("\n"); + appendable.append("region ").append(region).append("\n"); } if (shopitems.length() > 0) { - stream.append("shopitems ").append(shopitems).append("\n"); + appendable.append("shopitems ").append(shopitems).append("\n"); } if (shopgreed != 0) { - stream.append("shopgreed ").append(String.valueOf(shopgreed)).append("\n"); + appendable.append("shopgreed ").append(String.valueOf(shopgreed)).append("\n"); } if (shopmin != 0) { - stream.append("shopmin ").append(String.valueOf(shopmin)).append("\n"); + appendable.append("shopmin ").append(String.valueOf(shopmin)).append("\n"); } if (shopmax != 0) { - stream.append("shopmax ").append(String.valueOf(shopmax)).append("\n"); + appendable.append("shopmax ").append(String.valueOf(shopmax)).append("\n"); } if (shoprace.length() > 0) { - stream.append("shoprace ").append(shoprace).append("\n"); + appendable.append("shoprace ").append(shoprace).append("\n"); } if (getDarkness() > 0) { - stream.append("darkness ").append(String.valueOf(getDarkness())).append("\n"); + appendable.append("darkness ").append(String.valueOf(getDarkness())).append("\n"); } - stream.append("width ").append(String.valueOf(getMapSize().getWidth())).append("\n"); - stream.append("height ").append(String.valueOf(getMapSize().getHeight())).append("\n"); + appendable.append("width ").append(String.valueOf(getMapSize().getWidth())).append("\n"); + appendable.append("height ").append(String.valueOf(getMapSize().getHeight())).append("\n"); if (getEnterX() > 0) { - stream.append("enter_x ").append(String.valueOf(getEnterX())).append("\n"); + appendable.append("enter_x ").append(String.valueOf(getEnterX())).append("\n"); } if (getEnterY() > 0) { - stream.append("enter_y ").append(String.valueOf(getEnterY())).append("\n"); + appendable.append("enter_y ").append(String.valueOf(getEnterY())).append("\n"); } if (msgText.length() > 0 && msgText.toString().trim().length() > 0) { - stream.append(TAG_START_TEXT + "\n"); - stream.append(msgText.toString().trim()).append("\n"); - stream.append(TAG_END_TEXT + "\n"); + appendable.append(TAG_START_TEXT + "\n"); + appendable.append(msgText.toString().trim()).append("\n"); + appendable.append(TAG_END_TEXT + "\n"); } if (loreText.length() > 0 && loreText.toString().trim().length() > 0) { - stream.append(TAG_START_LORE + "\n"); - stream.append(loreText.toString().trim()).append("\n"); - stream.append(TAG_END_LORE + "\n"); + appendable.append(TAG_START_LORE + "\n"); + appendable.append(loreText.toString().trim()).append("\n"); + appendable.append(TAG_END_LORE + "\n"); } if (isUnique()) { - stream.append("unique 1\n"); + appendable.append("unique 1\n"); } if (template) { - stream.append("template 1\n"); + appendable.append("template 1\n"); } if (outdoor) { - stream.append("outdoor 1\n"); + appendable.append("outdoor 1\n"); } if (temp != 0) { - stream.append("temp ").append(String.valueOf(temp)).append("\n"); + appendable.append("temp ").append(String.valueOf(temp)).append("\n"); } if (pressure != 0) { - stream.append("pressure ").append(String.valueOf(pressure)).append("\n"); + appendable.append("pressure ").append(String.valueOf(pressure)).append("\n"); } if (humid != 0) { - stream.append("humid ").append(String.valueOf(humid)).append("\n"); + appendable.append("humid ").append(String.valueOf(humid)).append("\n"); } if (windspeed != 0) { - stream.append("windspeed ").append(String.valueOf(windspeed)).append("\n"); + appendable.append("windspeed ").append(String.valueOf(windspeed)).append("\n"); } if (winddir != 0) { - stream.append("winddir ").append(String.valueOf(winddir)).append("\n"); + appendable.append("winddir ").append(String.valueOf(winddir)).append("\n"); } if (sky != 0) { - stream.append("sky ").append(String.valueOf(sky)).append("\n"); + appendable.append("sky ").append(String.valueOf(sky)).append("\n"); } for (i = 0; i < MAX_TILE; i++) { if (tilePaths[i].length() > 0) { - stream.append("tile_path_").append(String.valueOf(i + 1)).append(" ").append(tilePaths[i]).append("\n"); + appendable.append("tile_path_").append(String.valueOf(i + 1)).append(" ").append(tilePaths[i]).append("\n"); } } if (nosmooth) { - stream.append("nosmooth 1\n"); + appendable.append("nosmooth 1\n"); } - stream.append("end\n"); + appendable.append("end\n"); } } // class MapArchObject Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-11-11 15:46:16 UTC (rev 643) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-11-11 17:24:41 UTC (rev 644) @@ -199,8 +199,6 @@ /** Bit field of edit types to show transparent. */ private int alphaType; - private CMapFileEncode mapFileEncoder; - private ArchetypeParser archetypeParser; /** The Animation Objects. */ @@ -421,9 +419,6 @@ autoPopupDocu = false; } - // attach map encoder and decoder - mapFileEncoder = new CMapFileEncode(); - // our global object parser archetypeParser = new ArchetypeParser(this); animationObjects = new AnimationObjects(ACTION_FACTORY.getString("nameOfAnimationObject")); @@ -1248,7 +1243,12 @@ */ public void encodeMapFile(final File file, final MapModel mapModel) { try { - mapFileEncoder.encodeMapFile(file, mapModel); + final CMapFileEncode mapFileEncoder = new CMapFileEncode(file); + try { + mapFileEncoder.encodeMapFile(mapModel); + } finally { + mapFileEncoder.close(); + } } catch (final FileNotFoundException e) { ACTION_FACTORY.showMessageDialog(mainView, "encodeMapFile", file); } catch (final IOException e) { Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-11-11 15:46:16 UTC (rev 643) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-11-11 17:24:41 UTC (rev 644) @@ -293,16 +293,6 @@ } /** - * Determine if this part is the head part. For single-part objects this is - * always true. - * - * @return <code>true</code> iff this part if a head part - */ - public boolean isHead() { - return getHead() == this; - } - - /** * Determine if this part is a tail part. For single-part objects this is * never true. * Modified: trunk/daimonin/src/daieditor/io/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/io/CMapFileEncode.java 2006-11-11 15:46:16 UTC (rev 643) +++ trunk/daimonin/src/daieditor/io/CMapFileEncode.java 2006-11-11 17:24:41 UTC (rev 644) @@ -34,10 +34,7 @@ import java.util.Formatter; import net.sf.gridarta.Size2D; import net.sf.gridarta.gameobject.Archetype; -import net.sf.gridarta.io.IOUtils; -import net.sf.gridarta.io.MapFileEncode; -import net.sf.gridarta.map.MapSquare; -import org.apache.log4j.Logger; +import net.sf.gridarta.io.AbstractMapFileEncode; import org.jetbrains.annotations.NotNull; /** @@ -47,70 +44,31 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ @SuppressWarnings({"HardcodedLineSeparator"}) -public final class CMapFileEncode implements MapFileEncode<MapModel> { +public final class CMapFileEncode extends AbstractMapFileEncode<GameObject, MapArchObject, MapModel> { - private static final Logger log = Logger.getLogger(CMapFileEncode.class); - /** * Formatter to use for writing maps. * @note use '\n' for line endings only. The fileformat requires Unix LF only. */ - private Formatter format; + private final Formatter format = new Formatter(this); - /** Create a CMapFileEncode instance. */ - public CMapFileEncode() { + /** + * Create a CMapFileEncode instance. + * @param file File to open. + * @throws FileNotFoundException in case the file couldn't be opened for writing + */ + public CMapFileEncode(@NotNull final File file) throws FileNotFoundException { + super(file); } - /** {@inheritDoc} */ - public void encodeMapFile(@NotNull final File file, @NotNull final MapModel mapModel) throws FileNotFoundException, IOException { - final MapArchObject mapArch = mapModel.getMapArchObject(); - try { - format = new Formatter(file, IOUtils.MAP_ENCODING); - //GameObject multi; - - // write map header: map arch - mapArch.writeMapArch(format.out()); // FIXME: It doesn't look like a good idea to mix Push and Pull - - // first, write all one tile parts - final Size2D mapSize = mapModel.getMapSize(); - final Point pos = new Point(); - for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { - for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { - for (final GameObject node : mapModel.getMapSquare(pos)) { - // only non multi suckers - if (!node.isMulti()) { - writeGameObject(node, pos.x, pos.y); - } - } // node - } // y - } // x - - for (final MapSquare<GameObject> square : mapModel) { - final int x = square.getMapX(); - final int y = square.getMapY(); - for (final GameObject node : square) { - // search only for heads! - if (node.isMulti() && node.isHead()) { - // only the heads get stored in the mapfile - // (that's much more efficient) - writeGameObject(node, x, y); - } // node - } // y - } // x - } finally { - format.close(); - format = null; - } - } - /** - * Here the map gameObject gets written into the file. - * @param gameObject <code>GameObject</code> to be written into the map - * @param x x position of gameObject (0 if <var>gameObject</var> is inside an inventory) - * @param y y position of gameObject (0 if <var>gameObject</var> is inside an inventory) + * Writes a single GameObject. + * @param gameObject <code>GameObject</code> to be written into the map + * @param x X position of gameObject (0 if <var>gameObject</var> is inside an inventory) + * @param y Y position of gameObject (0 if <var>gameObject</var> is inside an inventory) * @throws IOException in case of I/O problems */ - private void writeGameObject(final GameObject gameObject, final int x, final int y) throws IOException { + protected void writeGameObject(final GameObject gameObject, final int x, final int y) throws IOException { final Archetype<GameObject> archetype = gameObject.getArchetype(); // ok, we start with the standard parts... this is valid for all types Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-11-11 15:46:16 UTC (rev 643) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-11-11 17:24:41 UTC (rev 644) @@ -407,13 +407,13 @@ /** * Writing the MapArchObject into the mapfile - * @param stream <code>Appendable</code> to the mapfile + * @param appendable <code>Appendable</code> to the mapfile * @throws IOException an I/O error occured during appending or formatting */ - public void writeMapArch(@NotNull final Appendable stream) throws IOException { + public void writeMapArch(@NotNull final Appendable appendable) throws IOException { - final Formatter format = new Formatter(stream); - stream.append("arch map\n"); + final Formatter format = new Formatter(appendable); + appendable.append("arch map\n"); if (getMapName().length() > 0) { format.format("name %s\n", getMapName()); } @@ -443,41 +443,41 @@ format.format("darkness %d\n", getDarkness()); } if (isFixedReset()) { - stream.append("fixed_resettime 1\n"); + appendable.append("fixed_resettime 1\n"); } if (outdoor) { - stream.append("outdoor 1\n"); + appendable.append("outdoor 1\n"); } if (noSave) { - stream.append("no_save 1\n"); + appendable.append("no_save 1\n"); } if (noMagic) { - stream.append("no_magic 1\n"); + appendable.append("no_magic 1\n"); } if (noPriest) { - stream.append("no_priest 1\n"); + appendable.append("no_priest 1\n"); } if (noSummon) { - stream.append("no_summon 1\n"); + appendable.append("no_summon 1\n"); } if (noHarm) { - stream.append("no_harm 1\n"); + appendable.append("no_harm 1\n"); } if (fixedLogin) { - stream.append("fixed_login 1\n"); + appendable.append("fixed_login 1\n"); } if (permDeath) { - stream.append("perm_death 1\n"); + appendable.append("perm_death 1\n"); } if (ultraDeath) { - stream.append("ultra_death 1\n"); + appendable.append("ultra_death 1\n"); } if (ultimateDeath) { - stream.append("ultimate_death 1\n"); + appendable.append("ultimate_death 1\n"); } if (pvp) { - stream.append("pvp 1\n"); + appendable.append("pvp 1\n"); } // tilePaths @@ -494,7 +494,7 @@ } // end - stream.append("end\n"); + appendable.append("end\n"); } } // class MapArchObject Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-11-11 15:46:16 UTC (rev 643) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-11-11 17:24:41 UTC (rev 644) @@ -667,6 +667,16 @@ */ public abstract G getHead(); + /** + * Determine if this part is the head part. For single-part objects this is + * always true. + * + * @return <code>true</code> iff this part if a head part + */ + public boolean isHead() { + return getHead() == this; + } + /** {@inheritDoc} */ @Nullable public abstract G getMultiNext(); Modified: trunk/src/app/net/sf/gridarta/io/AbstractMapFileDecode.java =================================================================== --- trunk/src/app/net/sf/gridarta/io/AbstractMapFileDecode.java 2006-11-11 15:46:16 UTC (rev 643) +++ trunk/src/app/net/sf/gridarta/io/AbstractMapFileDecode.java 2006-11-11 17:24:41 UTC (rev 644) @@ -118,7 +118,7 @@ /** * Reads a single line. * @return line read - * @throws IOException when an I/O-error occured during file reading + * @throws IOException if an I/O-error occured during reading */ @Nullable protected final String readLine() throws IOException { return myInput.readLine(); Added: trunk/src/app/net/sf/gridarta/io/AbstractMapFileEncode.java =================================================================== --- trunk/src/app/net/sf/gridarta/io/AbstractMapFileEncode.java (rev 0) +++ trunk/src/app/net/sf/gridarta/io/AbstractMapFileEncode.java 2006-11-11 17:24:41 UTC (rev 644) @@ -0,0 +1,127 @@ +package net.sf.gridarta.io; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; +import java.awt.Point; +import net.sf.gridarta.map.MapModel; +import net.sf.gridarta.map.MapArchObject; +import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.Size2D; +import org.jetbrains.annotations.NotNull; + +/** + * Abstract base implementation of {@link MapFileEncode}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public abstract class AbstractMapFileEncode<G extends GameObject<G>, A extends MapArchObject, M extends MapModel<G, A>> implements Appendable, MapFileEncode<M> { + + /** The reader to read from. */ + private final PrintWriter myOutput; + + /** The uri to write to. */ + protected final String uri; + + /** + * Open a resource for reading it as a map. + * @param uri URI of resource to open. + * @throws FileNotFoundException in case the resource couldn't be opened for writing + */ + protected AbstractMapFileEncode(final String uri) throws FileNotFoundException { + this.uri = uri; + try { + myOutput = new PrintWriter(new OutputStreamWriter(new FileOutputStream(uri), IOUtils.MAP_ENCODING)); + } catch (final UnsupportedEncodingException e) { + assert false : IOUtils.MAP_ENCODING + " must be a valid encoding."; + throw new Error(IOUtils.MAP_ENCODING + " must be a valid encoding."); + } + } + + /** + * Open a file for reading it as a map. + * @param file File to open. + * @throws FileNotFoundException in case the file couldn't be opened for writing + */ + protected AbstractMapFileEncode(final File file) throws FileNotFoundException { + this.uri = file.toURI().toString(); + try { + myOutput = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file), IOUtils.MAP_ENCODING)); + } catch (final UnsupportedEncodingException e) { + assert false : IOUtils.MAP_ENCODING + " must be a valid encoding."; + throw new Error(IOUtils.MAP_ENCODING + " must be a valid encoding."); + } + } + + /** {@inheritDoc} */ + public final void encodeMapFile(@NotNull final M mapModel) throws IOException { + final MapArchObject mapArch = mapModel.getMapArchObject(); + + // write map header: map arch + mapArch.writeMapArch(this); // FIXME: It doesn't look like a good idea to mix Push and Pull + + // first, write all one tile parts + final Size2D mapSize = mapArch.getMapSize(); + final Point pos = new Point(); + for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { + for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { + for (final G gameObject : mapModel.getMapSquare(pos)) { + // only non multi suckers + if (!gameObject.isMulti()) { + writeGameObject(gameObject, pos.x, pos.y); + } + } // node + } // y + } // x + + // second, we drop the multi part suckers out + for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { + for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { + for (final G gameObject : mapModel.getMapSquare(pos)) { + // search only for heads! + if (gameObject.isMulti() && gameObject.isHead()) { + // only the heads get stored in the mapfile + // (that's much more efficient) + writeGameObject(gameObject, pos.x, pos.y); + } + } // node + } // y + } // x + } + + /** + * Writes a single GameObject. + * @param gameObject <code>GameObject</code> to be written into the map + * @param x X position of gameObject (0 if <var>gameObject</var> is inside an inventory) + * @param y Y position of gameObject (0 if <var>gameObject</var> is inside an inventory) + * @throws IOException in case of I/O problems + */ + protected abstract void writeGameObject(final G gameObject, final int x, final int y) throws IOException; + + /** {@inheritDoc} */ + public final void close() throws IOException { + myOutput.close(); + } + + /** {@inheritDoc} */ + public final Appendable append(final CharSequence csq) throws IOException { + myOutput.append(csq); + return this; + } + + /** {@inheritDoc} */ + public final Appendable append(final CharSequence csq, final int start, final int end) throws IOException { + myOutput.append(csq, start, end); + return this; + } + + /** {@inheritDoc} */ + public final Appendable append(final char c) throws IOException { + myOutput.append(c); + return this; + } + +} // class AbstractMapFileEncode Property changes on: trunk/src/app/net/sf/gridarta/io/AbstractMapFileEncode.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/io/MapFileEncode.java =================================================================== --- trunk/src/app/net/sf/gridarta/io/MapFileEncode.java 2006-11-11 15:46:16 UTC (rev 643) +++ trunk/src/app/net/sf/gridarta/io/MapFileEncode.java 2006-11-11 17:24:41 UTC (rev 644) @@ -1,22 +1,21 @@ package net.sf.gridarta.io; -import java.io.File; +import java.io.Closeable; import java.io.FileNotFoundException; import java.io.IOException; -import org.jetbrains.annotations.NotNull; import net.sf.gridarta.map.MapModel; +import org.jetbrains.annotations.NotNull; /** * A MapFileEncode writes a map file to a file. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public interface MapFileEncode<M extends MapModel> { +public interface MapFileEncode<M extends MapModel> extends Closeable { /** * Write the whole map-data into a file. - * @param file mapfile * @param mapModel the MapModel to encode */ - void encodeMapFile(@NotNull File file, @NotNull M mapModel) throws FileNotFoundException, IOException; + void encodeMapFile(@NotNull M mapModel) throws FileNotFoundException, IOException; } // interface MapFileEncode Modified: trunk/src/app/net/sf/gridarta/map/MapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapArchObject.java 2006-11-11 15:46:16 UTC (rev 643) +++ trunk/src/app/net/sf/gridarta/map/MapArchObject.java 2006-11-11 17:24:41 UTC (rev 644) @@ -163,4 +163,12 @@ */ boolean parseMapArch(BufferedReader reader, String fname) throws IOException; + /** + * Append this MapArchObject as text. + * This method can be used for writing a MapArchObject to a file. + * @param appendable <code>Appendable</code> to append to. + * @throws IOException if an I/O error occured during appending + */ + void writeMapArch(final Appendable appendable) throws IOException; + } // interface MapArchObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-11 17:30:35
|
Revision: 645 http://svn.sourceforge.net/gridarta/?rev=645&view=rev Author: christianhujer Date: 2006-11-11 09:29:44 -0800 (Sat, 11 Nov 2006) Log Message: ----------- Improved naming of map i/o classes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CPickmapPanel.java Added Paths: ----------- trunk/crossfire/src/cfeditor/io/CMapReader.java trunk/crossfire/src/cfeditor/io/CMapWriter.java trunk/daimonin/src/daieditor/io/CMapReader.java trunk/daimonin/src/daieditor/io/CMapWriter.java trunk/src/app/net/sf/gridarta/io/AbstractMapReader.java trunk/src/app/net/sf/gridarta/io/AbstractMapWriter.java trunk/src/app/net/sf/gridarta/io/MapReader.java trunk/src/app/net/sf/gridarta/io/MapWriter.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/io/CMapFileDecode.java trunk/crossfire/src/cfeditor/io/CMapFileEncode.java trunk/daimonin/src/daieditor/io/CMapFileDecode.java trunk/daimonin/src/daieditor/io/CMapFileEncode.java trunk/src/app/net/sf/gridarta/io/AbstractMapFileDecode.java trunk/src/app/net/sf/gridarta/io/AbstractMapFileEncode.java trunk/src/app/net/sf/gridarta/io/MapFileDecode.java trunk/src/app/net/sf/gridarta/io/MapFileEncode.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-11 17:24:41 UTC (rev 644) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-11 17:29:44 UTC (rev 645) @@ -28,8 +28,8 @@ import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import cfeditor.gameobject.anim.AnimationObjects; -import cfeditor.io.CMapFileDecode; -import cfeditor.io.CMapFileEncode; +import cfeditor.io.CMapReader; +import cfeditor.io.CMapWriter; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import cfeditor.map.MapModel; @@ -867,7 +867,7 @@ final List<GameObject> objects; final MapArchObject maparch; try { - final CMapFileDecode decoder = new CMapFileDecode(file); + final CMapReader decoder = new CMapReader(file); objects = decoder.decodeMapFile(); // parse mapfile maparch = decoder.getMapArch(); // get map arch } catch (final IOException e) { @@ -925,7 +925,7 @@ public void encodeMapFile(@NotNull final File file, final MapModel mapModel) { final String fname = file.getAbsolutePath(); try { - final CMapFileEncode mapFileEncoder = new CMapFileEncode(file); + final CMapWriter mapFileEncoder = new CMapWriter(file); try { mapFileEncoder.encodeMapFile(mapModel); } finally { Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-11-11 17:24:41 UTC (rev 644) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-11-11 17:29:44 UTC (rev 645) @@ -25,7 +25,7 @@ package cfeditor; import cfeditor.gameobject.GameObject; -import cfeditor.io.CMapFileDecode; +import cfeditor.io.CMapReader; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import java.io.File; @@ -135,7 +135,7 @@ final MapArchObject maparch; try { - final CMapFileDecode decoder = new CMapFileDecode(mapFile); + final CMapReader decoder = new CMapReader(mapFile); final List<GameObject> objects = decoder.decodeMapFile(); // parse mapfile maparch = decoder.getMapArch(); // get map arch Deleted: trunk/crossfire/src/cfeditor/io/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapFileDecode.java 2006-11-11 17:24:41 UTC (rev 644) +++ trunk/crossfire/src/cfeditor/io/CMapFileDecode.java 2006-11-11 17:29:44 UTC (rev 645) @@ -1,239 +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.io; - -import cfeditor.gameobject.GameObject; -import cfeditor.map.MapArchObject; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.List; -import net.sf.gridarta.io.AbstractMapFileDecode; -import org.apache.log4j.Logger; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * A MapFileDecoder reads a map file and provides access to the information read from the map file. - * This class handles the reading of a mapfile and parsing the data - * into a list of ArchObjects. - * @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 CMapFileDecode extends AbstractMapFileDecode<GameObject, MapArchObject> { - - private static final Logger log = Logger.getLogger(CMapFileDecode.class); - - /** - * The maximum x position of all data read from the file. - * It's used to automatically expand a map to the size of its contents in case of a map with wrongly set size. - */ - private int maxxlen; - - /** - * The maximum y position of all data read from the file. - * It's used to automatically expand a map to the size of its contents in case of a map with wrongly set size. - */ - private int maxylen; - - /** - * Open a resource for reading it as a map. - * @param uri URI of resource to open. - * @throws FileNotFoundException in case the resource was not found. - */ - public CMapFileDecode(final String uri) throws FileNotFoundException { - super(uri); - } - - /** - * Open a file for reading it as a map. - * @param file File to open. - * @throws FileNotFoundException in case the file was not found. - */ - public CMapFileDecode(final File file) throws FileNotFoundException { - super(file); - } - - /** {@inheritDoc} */ - protected MapArchObject createMapArchObject() { - return new MapArchObject(); - } - - /** - * Loading a map from the given mapfile. - * This method returns a list of GameObjects. - * @return first <code>GameObject</code> in the list - * @throws FileNotFoundException in case the requested map file was not found - * @throws IOException in case the file couldn't be read or is in wrong format - * @todo create a separate exception for the wrong format - */ - @NotNull public List<GameObject> decodeMapFile() throws IOException { - final List<GameObject> objects = super.decodeMapFile(); - // finally... here we go - // last action: if the map is bigger than the specified size in - // the maparch, we set the true size: the maxxlen/maxylen counters. - maparch.ensureMapSize(maxxlen + 1, maxylen + 1); - - return objects; // return first arch of the list - } - - /** - * Our recursive accessible arch reader. - * <p/> - * WARNING: this implementation should fail with multi head settings - * if there are multi part items in the inventory (but this is not yet - * included in CF!) - * @param thisLine first line of text, belonging to this new arch - * @return the new parsed <code>GameObject</code> - * @throws IOException when an I/O-error occured during file reading - * @fixme I'm too long, make me shorter. - * @todo Attributes not relevant during map parsing shouldn't be evaluated here, but in GameObject / ArchetypeParser instead. - * @todo Convince crossfire people of removing "More" as it seems to be pointless now. - * @todo Find out whether effectively also trimming msg contents didn't break anything. - */ - // Note for programmers from Daimonin: Crossfire still has to support "More" which was used for multipart objects in the past. - @Nullable protected GameObject readArch(String thisLine) throws IOException { - boolean msgflag = false; - boolean archflag = false; - boolean archmore = false; - GameObject gameObject = null; - do { - thisLine = thisLine.trim(); - - if (!archflag) { - if (thisLine.startsWith("More")) { - // All arches started with "More" are ignored. We load only - // the heads and expand them according to the defaults. - archmore = true; - } else // format violation for better diff - if (thisLine.startsWith("arch ")) { - archflag = true; // from now on we are inside an arch - - if (!archmore) { - gameObject = new GameObject(); // create a new instance - gameObject.setArchetypeName(thisLine.substring(5).trim()); - } - } - } else if (!archmore) { - // here we are inside of an arch object (but not "More")... - if (msgflag) { - if (thisLine.startsWith("endmsg")) { - msgflag = false; - } else { - gameObject.addMsgText(thisLine + '\n'); - } - } else if (thisLine.startsWith("arch ")) { - // ok, we had a full arch... don't care here about map or object - // now we test for a new arch - thats stuf in inventory - // or the end... thats the end of this shit - if (log.isDebugEnabled()) { - log.debug("GO INVENTORY: " + gameObject + " - " + thisLine); - } - gameObject.addLast(readArch(thisLine)); - if (log.isDebugEnabled()) { - log.debug("GO INVENTORY2: " + gameObject + " - " + thisLine); - } - } else if (thisLine.equals("end")) { - objects.add(gameObject); - archflag = false; - archmore = false; - - if (log.isDebugEnabled()) { - log.debug("LEAVE!: " + gameObject + " - " + thisLine); - } - return gameObject; - } else if (thisLine.startsWith("msg")) { - // gameObject.addArchText(thisLine + "\n"); - gameObject.addMsgText(""); // this init the msg text buffer - // in the case of msg/endmsg - // with no content to overrule def msg - msgflag = true; - // this is a MUST, because we overrule "anim" test - } else if (thisLine.startsWith("animation")) { - gameObject.addObjectText(thisLine); - } else if (thisLine.startsWith("anim_speed")) { - gameObject.addObjectText(thisLine); - } else if (thisLine.startsWith("event_")) { - // here's something about a scripted event - final int i = thisLine.indexOf("_plugin"); - final int k = thisLine.indexOf("_options"); - final int space = thisLine.indexOf(" "); - if (space > 0) { - if (i > 0) { - // expecting: "event_type_plugin Name" - final String type = thisLine.substring(6, i); - final String plname = thisLine.substring(space + 1).trim(); - gameObject.addEventPlugin(type, plname); - } else if (k > 0) { - // expecting: "event_type_options Name" - final String type = thisLine.substring(6, k); - final String eventopt = thisLine.substring(space + 1).trim(); - gameObject.addEventOptions(type, eventopt); - } else { - // expecting: "event_type filepath" - final String type = thisLine.substring(6, space); - final String path = thisLine.substring(space + 1).trim(); - gameObject.addEventScript(type, path); - } - } else { - log.warn("Arch " + gameObject.getArchetypeName() + " has incorrect event code '" + thisLine + "'"); - gameObject.addObjectText(thisLine); // keep line, it might have a meaning after all - } - } else if (thisLine.startsWith("x ")) { - final int temp = Integer.parseInt(thisLine.substring(2)); - if (temp > maxxlen) { - maxxlen = temp; - } - gameObject.setMapX(temp); - } else if (thisLine.startsWith("y ")) { - final int temp = Integer.parseInt(thisLine.substring(2)); - if (temp > maxylen) { - maxylen = temp; - } - gameObject.setMapY(temp); - } else if (thisLine.startsWith("type ")) { - // Arches in maps can override their default arch's type - gameObject.setArchTypNr(Integer.parseInt(thisLine.substring(5))); - // don't load it into the archtext! (why?) - } else if (thisLine.startsWith("face ")) { - gameObject.setFaceFlag(false); - gameObject.setFaceName(thisLine.substring(5).trim()); - } else { - gameObject.addObjectText(thisLine); - } - } else { - // We are in a multipart tail arch ("more"), so we skip it: - if (thisLine.regionMatches(0, "end", 0, 3)) { - archflag = false; - archmore = false; - } - } - } while ((thisLine = readLine()) != null); - - return null; // this happens when the file end is reached - } - -} // class CMapFileDecode Deleted: trunk/crossfire/src/cfeditor/io/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapFileEncode.java 2006-11-11 17:24:41 UTC (rev 644) +++ trunk/crossfire/src/cfeditor/io/CMapFileEncode.java 2006-11-11 17:29:44 UTC (rev 645) @@ -1,476 +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.io; - -import cfeditor.gameobject.GameObject; -import cfeditor.map.MapArchObject; -import cfeditor.map.MapModel; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.StringReader; -import java.util.Arrays; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Map; -import net.sf.gridarta.gameobject.Archetype; -import net.sf.gridarta.io.AbstractMapFileEncode; -import org.apache.log4j.Logger; -import org.jetbrains.annotations.NotNull; - -/** - * The <code>CMapFileEncode</code> is used to write a map to a file. - * @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 CMapFileEncode extends AbstractMapFileEncode<GameObject, MapArchObject, MapModel> { - - private static final Logger log = Logger.getLogger(CMapFileEncode.class); - - /** - * Create a CMapFileEncode instance. - * @param file File to open. - * @throws FileNotFoundException in case the file couldn't be opened for writing - */ - public CMapFileEncode(@NotNull final File file) throws FileNotFoundException { - super(file); - } - - /** - * Writes a single GameObject. - * @param gameObject <code>GameObject</code> to be written into the map - * @param x X position of gameObject (0 if <var>gameObject</var> is inside an inventory) - * @param y Y position of gameObject (0 if <var>gameObject</var> is inside an inventory) - * @throws IOException in case of I/O problems - */ - protected void writeGameObject(final GameObject gameObject, final int x, final int y) throws IOException { - final Archetype<GameObject> archetype = gameObject.getArchetype(); - - // Collect all fields to write. - final Map<String, String> fields = new HashMap<String, String>(); // String key -> String value - - final String name = gameObject.getObjName(); - if (name != null) { - fields.put("name", name); - } - - final String face = gameObject.getFaceName(); - if (face != null) { - fields.put("face", face); - } - - if (gameObject.isScripted()) { - final String events = gameObject.getMapArchEventData(); - if (!events.equals("")) { - final String[] tmp = events.split("\n"); - for (final String aTmp : tmp) { - final String[] line = aTmp.split(" +", 2); - if (line.length != 2) { - log.warn("writeMapArch: ignoring invalid event line: " + aTmp); - } else { - fields.put(line[0], line[1]); - } - } - } - } - - if (gameObject.getMsgText() != null && !gameObject.getMsgText().trim().equals((archetype == null || archetype.getMsgText() == null) ? "" : archetype.getMsgText().trim())) { - String msg = ""; - if (gameObject.getMsgText().trim().length() > 0) { - msg = gameObject.getMsgText(); - if (!msg.endsWith("\n")) { - msg += "\n"; - } - } - fields.put("msg", msg + "endmsg"); - } - - if (archetype != null && gameObject.getArchTypNr() != archetype.getArchTypNr()) { - // this arch has special type - if (gameObject.getObjectText().indexOf("type ") >= 0) { - // oh oh - there might also be a type in the archtext which - // is conflicting. remove the type from the archtext - - // open a reading stream for the archText - final StringReader sread = new StringReader(gameObject.getObjectText()); - final BufferedReader sstream = new BufferedReader(sread); - String newArchtext = ""; - - try { - for (String line; (line = sstream.readLine()) != null && line.length() > 0;) { - line = line.trim(); - - if (line.startsWith("type ")) { - // ommit this line - } else { - newArchtext += line + "\n"; // append this line - } - } - - // close streams - sstream.close(); - sread.close(); - - if (newArchtext.trim().length() == 0) { - gameObject.setObjectText(""); - } else { - gameObject.setObjectText(newArchtext.trim() + "\n"); - } - } catch (final IOException e) { - log.error("getSyntaxErrors: Cannot close StringReader"); - } - } - - // now append the type to the archtext - fields.put("type", Integer.toString(gameObject.getArchTypNr())); - } - - final String text = gameObject.getObjectText(); - if (!text.equals("")) { - final String[] tmp = text.split("\n"); - for (final String aTmp : tmp) { - final String[] line = aTmp.split(" +", 2); - if (line.length != 2) { - log.warn("writeMapArch: ignoring invalid arch line: " + aTmp); - } else { - fields.put(line[0], line[1]); - } - } - } - - // map coordinates only belong into map arches (not inventory arches) - if (x != 0) { - fields.put("x", Integer.toString(x)); - } - if (y != 0) { - fields.put("y", Integer.toString(y)); - } - - // Sort fields to match server/crossedit order. - final String[] keys = (String[]) fields.keySet().toArray(new String[0]); - Arrays.sort(keys, keyOrderComparator); - - // Actually write the fields. - append("arch " + gameObject.getArchetypeName() + "\n"); - for (int i = 0; i < keys.length; i++) { - final String value = (String) fields.get(keys[i]); - if (value != null) { - final String key = keys[i]; - if (key.equals("msg") || key.equals("lore")) { - append(key + "\n" + value + "\n"); - } else { - append(key + " " + value + "\n"); - } - } - } - - for (final GameObject inventoryItem : gameObject) { - writeGameObject(inventoryItem, 0, 0); - } - - append("end\n"); - } - - /** - * Comparator to compare two object fields. The comparator sorts the fields - * in the order in which they should be written to disk. - */ - private static final Comparator<String> keyOrderComparator = new Comparator<String>() { - - /** {@inheritDoc} */ - public int compare(final String o1, final String o2) { - final Integer i1 = keys.get(o1); - final Integer i2 = keys.get(o2); - final int v1 = i1 == null ? Integer.MAX_VALUE : i1.intValue(); - final int v2 = i2 == null ? Integer.MAX_VALUE : i2.intValue(); - if (v1 < v2) { - return -1; - } - if (v1 > v2) { - return +1; - } - assert v1 == v2; - return 0; - } - }; - - /** - * Determines the field order when writing objects to a file. The key is - * the field name, the value is an Integer that describes the order. Lower - * values are written first. - */ - private static final Map<String, Integer> keys = new HashMap<String, Integer>(); - - /* - * Initialize {@link keys} array. - * @todo this information should be read from a file. - */ - static { - addKey("name"); - addKey("name_pl"); - addKey("custom_name"); - addKey("title"); - addKey("race"); - addKey("slaying"); - addKey("skill"); - addKey("msg"); - addKey("lore"); - addKey("other_arch"); - addKey("face"); - addKey("animation"); - addKey("is_animated"); - addKey("Str"); - addKey("Dex"); - addKey("Con"); - addKey("Wis"); - addKey("Pow"); - addKey("Cha"); - addKey("Int"); - addKey("hp"); - addKey("maxhp"); - addKey("sp"); - addKey("maxsp"); - addKey("grace"); - addKey("maxgrace"); - addKey("exp"); - addKey("perm_exp"); - addKey("expmul"); - addKey("food"); - addKey("dam"); - addKey("luck"); - addKey("wc"); - addKey("ac"); - addKey("x"); - addKey("y"); - addKey("speed"); - addKey("speed_left"); - addKey("move_state"); - addKey("attack_movement"); - addKey("nrof"); - addKey("level"); - addKey("direction"); - addKey("type"); - addKey("subtype"); - addKey("attacktype"); - addKey("resist_physical"); - addKey("resist_magic"); - addKey("resist_fire"); - addKey("resist_electricity"); - addKey("resist_cold"); - addKey("resist_confusion"); - addKey("resist_acid"); - addKey("resist_drain"); - addKey("resist_weaponmagic"); - addKey("resist_ghosthit"); - addKey("resist_poison"); - addKey("resist_slow"); - addKey("resist_paralyze"); - addKey("resist_turn_undead"); - addKey("resist_fear"); - addKey("resist_cancellation"); - addKey("resist_deplete"); - addKey("resist_death"); - addKey("resist_chaos"); - addKey("resist_counterspell"); - addKey("resist_godpower"); - addKey("resist_holyword"); - addKey("resist_blind"); - addKey("resist_internal"); - addKey("resist_life_stealing"); - addKey("resist_disease"); - addKey("path_attuned"); - addKey("path_repelled"); - addKey("path_denied"); - addKey("material"); - addKey("materialname"); - addKey("value"); - addKey("carrying"); - addKey("weight"); - addKey("invisible"); - addKey("state"); - addKey("magic"); - addKey("last_heal"); - addKey("last_sp"); - addKey("last_grace"); - addKey("last_eat"); - addKey("connected"); - addKey("glow_radius"); - addKey("randomitems"); - addKey("npc_status"); - addKey("npc_program"); - addKey("run_away"); - addKey("pick_up"); - addKey("container"); - addKey("will_apply"); - addKey("smoothlevel"); - addKey("map_layer"); - addKey("current_weapon_script"); - addKey("weapontype"); - addKey("tooltype"); - addKey("elevation"); - addKey("client_type"); - addKey("item_power"); - addKey("duration"); - addKey("range"); - addKey("range_modifier"); - addKey("duration_modifier"); - addKey("dam_modifier"); - addKey("gen_sp_armour"); - addKey("move_type"); - addKey("move_block"); - addKey("move_allow"); - addKey("move_on"); - addKey("move_off"); - addKey("move_slow"); - addKey("move_slow_penalty"); - addKey("alive"); - addKey("wiz"); - addKey("was_wiz"); - addKey("applied"); - addKey("unpaid"); - addKey("can_use_shield"); - addKey("no_pick"); - addKey("walk_on"); - addKey("no_pass"); - addKey("is_animated"); - addKey("slow_move"); - addKey("flying"); - addKey("monster"); - addKey("friendly"); - addKey("generator"); - addKey("is_thrown"); - addKey("auto_apply"); - addKey("treasure"); - addKey("player sold"); - addKey("see_invisible"); - addKey("can_roll"); - addKey("overlay_floor"); - addKey("is_turnable"); - addKey("walk_off"); - addKey("fly_on"); - addKey("fly_off"); - addKey("is_used_up"); - addKey("identified"); - addKey("reflecting"); - addKey("changing"); - addKey("splitting"); - addKey("hitback"); - addKey("startequip"); - addKey("blocksview"); - addKey("undead"); - addKey("scared"); - addKey("unaggressive"); - addKey("reflect_missile"); - addKey("reflect_spell"); - addKey("no_magic"); - addKey("no_fix_player"); - addKey("is_lightable"); - addKey("tear_down"); - addKey("run_away"); - addKey("pass_thru"); - addKey("can_pass_thru"); - addKey("pick_up"); - addKey("unique"); - addKey("no_drop"); - addKey("wizcast"); - addKey("can_cast_spell"); - addKey("can_use_scroll"); - addKey("can_use_range"); - addKey("can_use_bow"); - addKey("can_use_armour"); - addKey("can_use_weapon"); - addKey("can_use_ring"); - addKey("has_ready_range"); - addKey("has_ready_bow"); - addKey("xrays"); - addKey("is_floor"); - addKey("lifesave"); - addKey("no_strength"); - addKey("sleep"); - addKey("stand_still"); - addKey("random_move"); - addKey("only_attack"); - addKey("confused"); - addKey("stealth"); - addKey("cursed"); - addKey("damned"); - addKey("see_anywhere"); - addKey("known_magical"); - addKey("known_cursed"); - addKey("can_use_skill"); - addKey("been_applied"); - addKey("has_ready_scroll"); - addKey("can_use_rod"); - addKey("can_use_horn"); - addKey("make_invisible"); - addKey("inv_locked"); - addKey("is_wooded"); - addKey("is_hilly"); - addKey("has_ready_skill"); - addKey("has_ready_weapon"); - addKey("no_skill_ident"); - addKey("is_blind"); - addKey("can_see_in_dark"); - addKey("is_cauldron"); - addKey("is_dust"); - addKey("no_steal"); - addKey("one_hit"); - addKey("berserk"); - addKey("neutral"); - addKey("no_attack"); - addKey("no_damage"); - addKey("activate_on_push"); - addKey("activate_on_release"); - addKey("is_water"); - addKey("use_content_on_gen"); - addKey("is_buildable"); - addKey("body_range"); - addKey("body_arm"); - addKey("body_torso"); - addKey("body_head"); - addKey("body_neck"); - addKey("body_skill"); - addKey("body_finger"); - addKey("body_shoulder"); - addKey("body_foot"); - addKey("body_hand"); - addKey("body_wrist"); - addKey("body_waist"); - } - - /** The next key added via {@link #addKey(String)} is assigned this id. */ - private static int idKey = 1; - - /** - * Add a new key to {@link #keys}. The order in which the keys are added is - * the order in which the objects fields are written out. - */ - private static void addKey(final String key) { - keys.put(key, idKey++); - } - -} // class CMapFileEncode Copied: trunk/crossfire/src/cfeditor/io/CMapReader.java (from rev 644, trunk/crossfire/src/cfeditor/io/CMapFileDecode.java) =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapReader.java (rev 0) +++ trunk/crossfire/src/cfeditor/io/CMapReader.java 2006-11-11 17:29:44 UTC (rev 645) @@ -0,0 +1,239 @@ +/* + * 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.io; + +import cfeditor.gameobject.GameObject; +import cfeditor.map.MapArchObject; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.List; +import net.sf.gridarta.io.AbstractMapReader; +import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * A MapFileDecoder reads a map file and provides access to the information read from the map file. + * This class handles the reading of a mapfile and parsing the data + * into a list of ArchObjects. + * @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 CMapReader extends AbstractMapReader<GameObject, MapArchObject> { + + private static final Logger log = Logger.getLogger(CMapReader.class); + + /** + * The maximum x position of all data read from the file. + * It's used to automatically expand a map to the size of its contents in case of a map with wrongly set size. + */ + private int maxxlen; + + /** + * The maximum y position of all data read from the file. + * It's used to automatically expand a map to the size of its contents in case of a map with wrongly set size. + */ + private int maxylen; + + /** + * Open a resource for reading it as a map. + * @param uri URI of resource to open. + * @throws FileNotFoundException in case the resource was not found. + */ + public CMapReader(final String uri) throws FileNotFoundException { + super(uri); + } + + /** + * Open a file for reading it as a map. + * @param file File to open. + * @throws FileNotFoundException in case the file was not found. + */ + public CMapReader(final File file) throws FileNotFoundException { + super(file); + } + + /** {@inheritDoc} */ + protected MapArchObject createMapArchObject() { + return new MapArchObject(); + } + + /** + * Loading a map from the given mapfile. + * This method returns a list of GameObjects. + * @return first <code>GameObject</code> in the list + * @throws FileNotFoundException in case the requested map file was not found + * @throws IOException in case the file couldn't be read or is in wrong format + * @todo create a separate exception for the wrong format + */ + @NotNull public List<GameObject> decodeMapFile() throws IOException { + final List<GameObject> objects = super.decodeMapFile(); + // finally... here we go + // last action: if the map is bigger than the specified size in + // the maparch, we set the true size: the maxxlen/maxylen counters. + maparch.ensureMapSize(maxxlen + 1, maxylen + 1); + + return objects; // return first arch of the list + } + + /** + * Our recursive accessible arch reader. + * <p/> + * WARNING: this implementation should fail with multi head settings + * if there are multi part items in the inventory (but this is not yet + * included in CF!) + * @param thisLine first line of text, belonging to this new arch + * @return the new parsed <code>GameObject</code> + * @throws IOException when an I/O-error occured during file reading + * @fixme I'm too long, make me shorter. + * @todo Attributes not relevant during map parsing shouldn't be evaluated here, but in GameObject / ArchetypeParser instead. + * @todo Convince crossfire people of removing "More" as it seems to be pointless now. + * @todo Find out whether effectively also trimming msg contents didn't break anything. + */ + // Note for programmers from Daimonin: Crossfire still has to support "More" which was used for multipart objects in the past. + @Nullable protected GameObject readArch(String thisLine) throws IOException { + boolean msgflag = false; + boolean archflag = false; + boolean archmore = false; + GameObject gameObject = null; + do { + thisLine = thisLine.trim(); + + if (!archflag) { + if (thisLine.startsWith("More")) { + // All arches started with "More" are ignored. We load only + // the heads and expand them according to the defaults. + archmore = true; + } else // format violation for better diff + if (thisLine.startsWith("arch ")) { + archflag = true; // from now on we are inside an arch + + if (!archmore) { + gameObject = new GameObject(); // create a new instance + gameObject.setArchetypeName(thisLine.substring(5).trim()); + } + } + } else if (!archmore) { + // here we are inside of an arch object (but not "More")... + if (msgflag) { + if (thisLine.startsWith("endmsg")) { + msgflag = false; + } else { + gameObject.addMsgText(thisLine + '\n'); + } + } else if (thisLine.startsWith("arch ")) { + // ok, we had a full arch... don't care here about map or object + // now we test for a new arch - thats stuf in inventory + // or the end... thats the end of this shit + if (log.isDebugEnabled()) { + log.debug("GO INVENTORY: " + gameObject + " - " + thisLine); + } + gameObject.addLast(readArch(thisLine)); + if (log.isDebugEnabled()) { + log.debug("GO INVENTORY2: " + gameObject + " - " + thisLine); + } + } else if (thisLine.equals("end")) { + objects.add(gameObject); + archflag = false; + archmore = false; + + if (log.isDebugEnabled()) { + log.debug("LEAVE!: " + gameObject + " - " + thisLine); + } + return gameObject; + } else if (thisLine.startsWith("msg")) { + // gameObject.addArchText(thisLine + "\n"); + gameObject.addMsgText(""); // this init the msg text buffer + // in the case of msg/endmsg + // with no content to overrule def msg + msgflag = true; + // this is a MUST, because we overrule "anim" test + } else if (thisLine.startsWith("animation")) { + gameObject.addObjectText(thisLine); + } else if (thisLine.startsWith("anim_speed")) { + gameObject.addObjectText(thisLine); + } else if (thisLine.startsWith("event_")) { + // here's something about a scripted event + final int i = thisLine.indexOf("_plugin"); + final int k = thisLine.indexOf("_options"); + final int space = thisLine.indexOf(" "); + if (space > 0) { + if (i > 0) { + // expecting: "event_type_plugin Name" + final String type = thisLine.substring(6, i); + final String plname = thisLine.substring(space + 1).trim(); + gameObject.addEventPlugin(type, plname); + } else if (k > 0) { + // expecting: "event_type_options Name" + final String type = thisLine.substring(6, k); + final String eventopt = thisLine.substring(space + 1).trim(); + gameObject.addEventOptions(type, eventopt); + } else { + // expecting: "event_type filepath" + final String type = thisLine.substring(6, space); + final String path = thisLine.substring(space + 1).trim(); + gameObject.addEventScript(type, path); + } + } else { + log.warn("Arch " + gameObject.getArchetypeName() + " has incorrect event code '" + thisLine + "'"); + gameObject.addObjectText(thisLine); // keep line, it might have a meaning after all + } + } else if (thisLine.startsWith("x ")) { + final int temp = Integer.parseInt(thisLine.substring(2)); + if (temp > maxxlen) { + maxxlen = temp; + } + gameObject.setMapX(temp); + } else if (thisLine.startsWith("y ")) { + final int temp = Integer.parseInt(thisLine.substring(2)); + if (temp > maxylen) { + maxylen = temp; + } + gameObject.setMapY(temp); + } else if (thisLine.startsWith("type ")) { + // Arches in maps can override their default arch's type + gameObject.setArchTypNr(Integer.parseInt(thisLine.substring(5))); + // don't load it into the archtext! (why?) + } else if (thisLine.startsWith("face ")) { + gameObject.setFaceFlag(false); + gameObject.setFaceName(thisLine.substring(5).trim()); + } else { + gameObject.addObjectText(thisLine); + } + } else { + // We are in a multipart tail arch ("more"), so we skip it: + if (thisLine.regionMatches(0, "end", 0, 3)) { + archflag = false; + archmore = false; + } + } + } while ((thisLine = readLine()) != null); + + return null; // this happens when the file end is reached + } + +} // class CMapFileDecode Property changes on: trunk/crossfire/src/cfeditor/io/CMapReader.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Copied: trunk/crossfire/src/cfeditor/io/CMapWriter.java (from rev 644, trunk/crossfire/src/cfeditor/io/CMapFileEncode.java) =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapWriter.java (rev 0) +++ trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-11-11 17:29:44 UTC (rev 645) @@ -0,0 +1,476 @@ +/* + * 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.io; + +import cfeditor.gameobject.GameObject; +import cfeditor.map.MapArchObject; +import cfeditor.map.MapModel; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.StringReader; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; +import net.sf.gridarta.gameobject.Archetype; +import net.sf.gridarta.io.AbstractMapWriter; +import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; + +/** + * The <code>CMapFileEncode</code> is used to write a map to a file. + * @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 CMapWriter extends AbstractMapWriter<GameObject, MapArchObject, MapModel> { + + private static final Logger log = Logger.getLogger(CMapWriter.class); + + /** + * Create a CMapFileEncode instance. + * @param file File to open. + * @throws FileNotFoundException in case the file couldn't be opened for writing + */ + public CMapWriter(@NotNull final File file) throws FileNotFoundException { + super(file); + } + + /** + * Writes a single GameObject. + * @param gameObject <code>GameObject</code> to be written into the map + * @param x X position of gameObject (0 if <var>gameObject</var> is inside an inventory) + * @param y Y position of gameObject (0 if <var>gameObject</var> is inside an inventory) + * @throws IOException in case of I/O problems + */ + protected void writeGameObject(final GameObject gameObject, final int x, final int y) throws IOException { + final Archetype<GameObject> archetype = gameObject.getArchetype(); + + // Collect all fields to write. + final Map<String, String> fields = new HashMap<String, String>(); // String key -> String value + + final String name = gameObject.getObjName(); + if (name != null) { + fields.put("name", name); + } + + final String face = gameObject.getFaceName(); + if (face != null) { + fields.put("face", face); + } + + if (gameObject.isScripted()) { + final String events = gameObject.getMapArchEventData(); + if (!events.equals("")) { + final String[] tmp = events.split("\n"); + for (final String aTmp : tmp) { + final String[] line = aTmp.split(" +", 2); + if (line.length != 2) { + log.warn("writeMapArch: ignoring invalid event line: " + aTmp); + } else { + fields.put(line[0], line[1]); + } + } + } + } + + if (gameObject.getMsgText() != null && !gameObject.getMsgText().trim().equals((archetype == null || archetype.getMsgText() == null) ? "" : archetype.getMsgText().trim())) { + String msg = ""; + if (gameObject.getMsgText().trim().length() > 0) { + msg = gameObject.getMsgText(); + if (!msg.endsWith("\n")) { + msg += "\n"; + } + } + fields.put("msg", msg + "endmsg"); + } + + if (archetype != null && gameObject.getArchTypNr() != archetype.getArchTypNr()) { + // this arch has special type + if (gameObject.getObjectText().indexOf("type ") >= 0) { + // oh oh - there might also be a type in the archtext which + // is conflicting. remove the type from the archtext + + // open a reading stream for the archText + final StringReader sread = new StringReader(gameObject.getObjectText()); + final BufferedReader sstream = new BufferedReader(sread); + String newArchtext = ""; + + try { + for (String line; (line = sstream.readLine()) != null && line.length() > 0;) { + line = line.trim(); + + if (line.startsWith("type ")) { + // ommit this line + } else { + newArchtext += line + "\n"; // append this line + } + } + + // close streams + sstream.close(); + sread.close(); + + if (newArchtext.trim().length() == 0) { + gameObject.setObjectText(""); + } else { + gameObject.setObjectText(newArchtext.trim() + "\n"); + } + } catch (final IOException e) { + log.error("getSyntaxErrors: Cannot close StringReader"); + } + } + + // now append the type to the archtext + fields.put("type", Integer.toString(gameObject.getArchTypNr())); + } + + final String text = gameObject.getObjectText(); + if (!text.equals("")) { + final String[] tmp = text.split("\n"); + for (final String aTmp : tmp) { + final String[] line = aTmp.split(" +", 2); + if (line.length != 2) { + log.warn("writeMapArch: ignoring invalid arch line: " + aTmp); + } else { + fields.put(line[0], line[1]); + } + } + } + + // map coordinates only belong into map arches (not inventory arches) + if (x != 0) { + fields.put("x", Integer.toString(x)); + } + if (y != 0) { + fields.put("y", Integer.toString(y)); + } + + // Sort fields to match server/crossedit order. + final String[] keys = (String[]) fields.keySet().toArray(new String[0]); + Arrays.sort(keys, keyOrderComparator); + + // Actually write the fields. + append("arch " + gameObject.getArchetypeName() + "\n"); + for (int i = 0; i < keys.length; i++) { + final String value = (String) fields.get(keys[i]); + if (value != null) { + final String key = keys[i]; + if (key.equals("msg") || key.equals("lore")) { + append(key + "\n" + value + "\n"); + } else { + append(key + " " + value + "\n"); + } + } + } + + for (final GameObject inventoryItem : gameObject) { + writeGameObject(inventoryItem, 0, 0); + } + + append("end\n"); + } + + /** + * Comparator to compare two object fields. The comparator sorts the fields + * in the order in which they should be written to disk. + */ + private static final Comparator<String> keyOrderComparator = new Comparator<String>() { + + /** {@inheritDoc} */ + public int compare(final String o1, final String o2) { + final Integer i1 = keys.get(o1); + final Integer i2 = keys.get(o2); + final int v1 = i1 == null ? Integer.MAX_VALUE : i1.intValue(); + final int v2 = i2 == null ? Integer.MAX_VALUE : i2.intValue(); + if (v1 < v2) { + return -1; + } + if (v1 > v2) { + return +1; + } + assert v1 == v2; + return 0; + } + }; + + /** + * Determines the field order when writing objects to a file. The key is + * the field name, the value is an Integer that describes the order. Lower + * values are written first. + */ + private static final Map<String, Integer> keys = new HashMap<String, Integer>(); + + /* + * Initialize {@link keys} array. + * @todo this information should be read from a file. + */ + static { + addKey("name"); + addKey("name_pl"); + addKey("custom_name"); + addKey("title"); + addKey("race"); + addKey("slaying"); + addKey("skill"); + addKey("msg"); + addKey("lore"); + addKey("other_arch"); + addKey("face"); + addKey("animation"); + addKey("is_animated"); + addKey("Str"); + addKey("Dex"); + addKey("Con"); + addKey("Wis"); + addKey("Pow"); + addKey("Cha"); + addKey("Int"); + addKey("hp"); + addKey("maxhp"); + addKey("sp"); + addKey("maxsp"); + addKey("grace"); + addKey("maxgrace"); + addKey("exp"); + addKey("perm_exp"); + addKey("expmul"); + addKey("food"); + addKey("dam"); + addKey("luck"); + addKey("wc"); + addKey("ac"); + addKey("x"); + addKey("y"); + addKey("speed"); + addKey("speed_left"); + addKey("move_state"); + addKey("attack_movement"); + addKey("nrof"); + addKey("level"); + addKey("direction"); + addKey("type"); + addKey("subtype"); + addKey("attacktype"); + addKey("resist_physical"); + addKey("resist_magic"); + addKey("resist_fire"); + addKey("resist_electricity"); + addKey("resist_cold"); + addKey("resist_confusion"); + addKey("resist_acid"); + addKey("resist_drain"); + addKey("resist_weaponmagic"); + addKey("resist_ghosthit"); + addKey("resist_poison"); + addKey("resist_slow"); + addKey("resist_paralyze"); + addKey("resist_turn_undead"); + addKey("resist_fear"); + addKey("resist_cancellation"); + addKey("resist_deplete"); + addKey("resist_death"); + addKey("resist_chaos"); + addKey("resist_counterspell"); + addKey("resist_godpower"); + addKey("resist_holyword"); + addKey("resist_blind"); + addKey("resist_internal"); + addKey("resist_life_stealing"); + addKey("resist_disease"); + addKey("path_attuned"); + addKey("path_repelled"); + addKey("path_denied"); + addKey("material"); + addKey("materialname"); + addKey("value"); + addKey("carrying"); + addKey("weight"); + addKey("invisible"); + addKey("state"); + addKey("magic"); + addKey("last_heal"); + addKey("last_sp"); + addKey("last_grace"); + addKey("last_eat"); + addKey("connected"); + addKey("glow_radius"); + addKey("randomitems"); + addKey("npc_status"); + addKey("npc_program"); + addKey("run_away"); + addKey("pick_up"); + addKey("container"); + addKey("will_apply"); + addKey("smoothlevel"); + addKey("map_layer"); + addKey("current_weapon_script"); + addKey("weapontype"); + addKey("tooltype"); + addKey("elevation"); + addKey("client_type"); + addKey("item_power"); + addKey("duration"); + addKey("range"); + addKey("range_modifier"); + addKey("duration_modifier"); + addKey("dam_modifier"); + addKey("gen_sp_armour"); + addKey("move_type"); + addKey("move_block"); + addKey("move_allow"); + addKey("move_on"); + addKey("move_off"); + addKey("move_slow"); + addKey("move_slow_penalty"); + addKey("alive"); + addKey("wiz"); + addKey("was_wiz"); + addKey("applied"); + addKey("unpaid"); + addKey("can_use_shield"); + addKey("no_pick"); + addKey("walk_on"); + addKey("no_pass"); + addKey("is_animated"); + addKey("slow_move"); + addKey("flying"); + addKey("monster"); + addKey("friendly"); + addKey("generator"); + addKey("is_thrown"); + addKey("auto_apply"); + addKey("treasure"); + addKey("player sold"); + addKey("see_invisible"); + addKey("can_roll"); + addKey("overlay_floor"); + addKey("is_turnable"); + addKey("walk_off"); + addKey("fly_on"); + addKey("fly_off"); + addKey("is_used_up"); + addKey("identified"); + addKey("reflecting"); + addKey("changing"); + addKey("splitting"); + addKey("hitback"); + addKey("startequip"); + addKey("blocksview"); + addKey("undead"); + addKey("scared"); + addKey("unaggressive"); + addKey("reflect_missile"); + addKey("reflect_spell"); + addKey("no_magic"); + addKey("no_fix_player"); + addKey("is_lightable"); + addKey("tear_down"); + addKey("run_away"); + addKey("pass_thru"); + addKey("can_pass_thru"); + addKey("pick_up"); + addKey("unique"); + addKey("no_drop"); + addKey("wizcast"); + addKey("can_cast_spell"); + addKey("can_use_scroll"); + addKey("can_use_range"); + addKey("can_use_bow"); + addKey("can_use_armour"); + addKey("can_use_weapon"); + addKey("can_use_ring"); + addKey("has_ready_range"); + addKey("has_ready_bow"); + addKey("xrays"); + addKey("is_floor"); + addKey("lifesave"); + addKey("no_strength"); + addKey("sleep"); + addKey("stand_still"); + addKey("random_move"); + addKey("only_attack"); + addKey("confused"); + addKey("stealth"); + addKey("cursed"); + addKey("damned"); + addKey("see_anywhere"); + addKey("known_magical"); + addKey("known_cursed"); + addKey("can_use_skill"); + addKey("been_applied"); + addKey("has_ready_scroll"); + addKey("can_use_rod"); + addKey("can_use_horn"); + addKey("make_invisible"); + addKey("inv_locked"); + addKey("is_wooded"); + addKey("is_hilly"); + addKey("has_ready_skill"); + addKey("has_ready_weapon"); + addKey("no_skill_ident"); + addKey("is_blind"); + addKey("can_see_in_dark"); + addKey("is_cauldron"); + addKey("is_dust"); + addKey("no_steal"); + addKey("one_hit"); + addKey("berserk"); + addKey("neutral"); + addKey("no_attack"); + addKey("no_damage"); + addKey("activate_on_push"); + addKey("activate_on_release"); + addKey("is_water"); + addKey("use_content_on_gen"); + addKey("is_buildable"); + addKey("body_range"); + addKey("body_arm"); + addKey("body_torso"); + addKey("body_head"); + addKey("body_neck"); + addKey("body_skill"); + addKey("body_finger"); + addKey("body_shoulder"); + addKey("body_foot"); + addKey("body_hand"); + addKey("body_wrist"); + addKey("body_waist"); + } + + /** The next key added via {@link #addKey(String)} is assigned this id. */ + private static int idKey = 1; + + /** + * Add a new key to {@link #keys}. The order in which the keys are added is + * the order in which the objects fields are written out. + */ + private static void addKey(final String key) { + keys.put(key, idKey++); + } + +} // class CMapFileEncode Property changes on: trunk/crossfire/src/cfeditor/io/CMapW... [truncated message content] |
From: <chr...@us...> - 2006-11-11 17:59:29
|
Revision: 646 http://svn.sourceforge.net/gridarta/?rev=646&view=rev Author: christianhujer Date: 2006-11-11 09:59:16 -0800 (Sat, 11 Nov 2006) Log Message: ----------- Added FAQ. Modified Paths: -------------- trunk/FAQ trunk/build.xml trunk/src/doc/start.xhtml Added Paths: ----------- trunk/src/doc/faq.xhtml Modified: trunk/FAQ =================================================================== --- trunk/FAQ 2006-11-11 17:29:44 UTC (rev 645) +++ trunk/FAQ 2006-11-11 17:59:16 UTC (rev 646) @@ -1,4 +1,14 @@ -FAQ ---- +Gridarta FAQ -No faq yet. +Note: This file is auto-generated from src/doc/faq.xhtml using src/doc/faq2txt.xslt. + If you want to change the faq, please make your changes in src/doc/faq.xhtml. + + +Question: +Will featurexyzbe implemented in Gridarta? + +Answer: +Please use ourfeature request tracker <https://sourceforge.net/tracker/?group_id=166996&atid=841185>. +Also take a look at ourTODO list <http://gridarta.sourceforge.net/dev/todo>. + + Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-11-11 17:29:44 UTC (rev 645) +++ trunk/build.xml 2006-11-11 17:59:16 UTC (rev 646) @@ -173,6 +173,19 @@ <xmlcatalog refid="commonDTDs" /> <transformation stylesheet="src/doc/xhtml2html.xslt" /> </megaxslt> + <megaxslt + srcdir="src/doc" + destdir="." + includes="faq.xhtml" + validatesource="true" + validatedest="false" + ending="" + transformerFactoryImplementationClassName="net.sf.saxon.TransformerFactoryImpl" + > + <xmlcatalog refid="commonDTDs" /> + <transformation stylesheet="src/doc/faq2txt.xslt" /> + </megaxslt> + <copy file="faq" tofile="FAQ" /> <copy todir="dest/doc" > Added: trunk/src/doc/faq.xhtml =================================================================== --- trunk/src/doc/faq.xhtml (rev 0) +++ trunk/src/doc/faq.xhtml 2006-11-11 17:59:16 UTC (rev 646) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id: start.xhtml,v 1.12 2006/03/29 22:20:33 christianhujer Exp $ --> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <meta name="Date" content="$Date$" /> + <title>Gridarta FAQ</title> + </head> + <body> + <h1>Gridarta FAQ</h1> + <dl> + <dt>Will feature <var>xyz</var> be implemented in Gridarta?</dt> + <dd> + Please use our <a href="https://sourceforge.net/tracker/?group_id=166996&atid=841185">feature request tracker</a>. + <p/> + Also take a look at our <a href="http://gridarta.sourceforge.net/dev/todo">TODO list</a>. + </dd> + </dl> + </body> +</html> Property changes on: trunk/src/doc/faq.xhtml ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:keywords + Date Name: svn:eol-style + LF Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2006-11-11 17:29:44 UTC (rev 645) +++ trunk/src/doc/start.xhtml 2006-11-11 17:59:16 UTC (rev 646) @@ -38,6 +38,7 @@ <h2>Gridarta Documentation</h2> <ul> <li><a href="news/">Gridarta Project News</a></li> + <li><a href="faq">Gridarta FAQ</a> (Frequently Asked Questions)</li> <li><a href="dev/">Gridarta Developer Documentation</a> Information for Gridarta Developers</li> <li><a href="subversion">Accessing Gridarta's Subversion Repository</a></li> <li><a href="history">History of Gridarta</a></li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-11 19:23:15
|
Revision: 647 http://svn.sourceforge.net/gridarta/?rev=647&view=rev Author: christianhujer Date: 2006-11-11 11:22:56 -0800 (Sat, 11 Nov 2006) Log Message: ----------- Some ArchetypeParser unification. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/src/app/net/sf/gridarta/gameobject/Archetype.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-11-11 17:59:16 UTC (rev 646) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-11-11 19:22:56 UTC (rev 647) @@ -30,11 +30,10 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; -import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; +import net.sf.gridarta.gameobject.AbstractArchetypeParser; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import net.sf.gridarta.io.IOUtils; import org.apache.log4j.Logger; @@ -54,7 +53,7 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ @SuppressWarnings({"HardcodedFileSeparator"}) -public final class ArchetypeParser implements net.sf.gridarta.gameobject.ArchetypeParser<GameObject> { +public final class ArchetypeParser extends AbstractArchetypeParser<GameObject> { /** Logger. */ private static final Logger log = Logger.getLogger(ArchetypeParser.class); @@ -168,295 +167,241 @@ } /** {@inheritDoc} */ - public void parseArchetypeFromStream(final BufferedReader in, final int index, final String fname) { - parseArchetypeFromStream(in, null, null, null, index, fname); - } - - /** {@inheritDoc} */ @Nullable - public GameObject parseArchetypeFromStream(final BufferedReader in, @Nullable final GameObject prototype, final String line, final String archName, int index, final String fname) { + public GameObject parseArchetypeFromStream(final BufferedReader in, @Nullable final GameObject prototype, final String line, final String archName, int index, final String fname) throws IOException { + // start with new clean GameObject instance + GameObject archetype; + GameObject archlast = null; + if (prototype == null) { + archetype = new GameObject(); + } else { + archetype = prototype.createClone(0, 0); + } + archetype.resetObjectText(); - //Open the file for reading - try { + String thisLine2; + if (line == null) { + thisLine2 = in.readLine(); + } else { + thisLine2 = line; // pre read "Object" from artifacts file loader + } - // start with new clean GameObject instance - GameObject archetype; - GameObject archlast = null; - if (prototype == null) { - archetype = new GameObject(); - } else { - archetype = prototype.createClone(0, 0); - } - archetype.resetObjectText(); + boolean msgflag = false; + boolean loreflag = false; + boolean animflag = false; + boolean parsearch = false; + boolean archmore = false; + String oldCat = "<xxx>"; + boolean isNewCategory = true; + GameObject firstArch = null; + String newCat = "no category info"; + int archmoreCount = 0; + while (thisLine2 != null) { + final String thisLine = thisLine2.trim(); - String thisLine2; - if (line == null) { + if (thisLine.startsWith("#")) { + // skip comments thisLine2 = in.readLine(); - } else { - thisLine2 = line; // pre read "Object" from artifacts file loader + continue; } - boolean msgflag = false; - boolean loreflag = false; - boolean animflag = false; - boolean parsearch = false; - boolean archmore = false; - String oldCat = "<xxx>"; - boolean isNewCategory = true; - GameObject firstArch = null; - String newCat = "no category info"; - int archmoreCount = 0; - while (thisLine2 != null) { - final String thisLine = thisLine2.trim(); + if (!parsearch) { - if (thisLine.startsWith("#")) { - // skip comments - thisLine2 = in.readLine(); - continue; - } + if (thisLine.startsWith("More")) { + if (firstArch == null) { + firstArch = archlast; + } + archmore = true; + } else if (thisLine.startsWith("Object")) { + if (archetype == null) { + archetype = new GameObject(); + } - if (!parsearch) { + parsearch = true; + if (!archmore) { + firstArch = null; + } - if (thisLine.startsWith("More")) { - if (firstArch == null) { - firstArch = archlast; + if (archName == null) { + archetype.setArchetypeName(thisLine.substring(7)); + } else { + archetype.setArchetypeName(archName); + } + } + } else { + if (msgflag) { + if (thisLine.startsWith("endmsg")) { + msgflag = false; + } else { + archetype.addMsgText(thisLine2 + "\n"); // thisLine2 allows leading whitespaces + } + } else if (animflag) { + if (thisLine.startsWith("mina")) { + try { + mainControl.getAnimationObjects().addAnimationObject(archetype.getArchetypeName(), archetype.getAnimText()); + } catch (final DuplicateAnimationException e) { + log.warn("Duplicate Animation " + archetype.getArchetypeName(), e); } - archmore = true; - } else if (thisLine.startsWith("Object")) { - if (archetype == null) { - archetype = new GameObject(); - } - parsearch = true; - if (!archmore) { - firstArch = null; - } - - if (archName == null) { - archetype.setArchetypeName(thisLine.substring(7)); - } else { - archetype.setArchetypeName(archName); - } + archetype.addObjectText("animation " + archetype.getArchetypeName()); + // here we must add this to AnimationObject + // and add Animation cmd here! + animflag = false; + } else { + archetype.addAnimText(thisLine + "\n"); } - } else { - if (msgflag) { - if (thisLine.startsWith("endmsg")) { - msgflag = false; - } else { - archetype.addMsgText(thisLine2 + "\n"); // thisLine2 allows leading whitespaces - } - } else if (animflag) { - if (thisLine.startsWith("mina")) { - try { - mainControl.getAnimationObjects().addAnimationObject(archetype.getArchetypeName(), archetype.getAnimText()); - } catch (final DuplicateAnimationException e) { - log.warn("Duplicate Animation " + archetype.getArchetypeName(), e); - } + } else if (loreflag) { + if (thisLine.startsWith("endlore")) { + loreflag = false; + } else { + archetype.addLoreText(thisLine + "\n"); + } + } else if (thisLine.startsWith("Object")) { + log.error("Find inventory Object in def arch: " + thisLine); + } else if (thisLine.startsWith("end")) { + //if (arch.getArchTypNr() == 0) { + if (log.isDebugEnabled()) { + log.debug("Arch " + archetype.getArchetypeName() + " has no type info!"); + } + //} + // we got full arch + parsearch = false; // we write this sucker - archetype.addObjectText("animation " + archetype.getArchetypeName()); - // here we must add this to AnimationObject - // and add Animation cmd here! - animflag = false; - } else { - archetype.addAnimText(thisLine + "\n"); - } - } else if (loreflag) { - if (thisLine.startsWith("endlore")) { - loreflag = false; - } else { - archetype.addLoreText(thisLine + "\n"); - } - } else if (thisLine.startsWith("Object")) { - log.error("Find inventory Object in def arch: " + thisLine); - } else if (thisLine.startsWith("end")) { - //if (arch.getArchTypNr() == 0) { - if (log.isDebugEnabled()) { - log.debug("Arch " + archetype.getArchetypeName() + " has no type info!"); - } - //} - // we got full arch - parsearch = false; // we write this sucker + if (firstArch != null) { + // add to head our x/y position so he can setup refmax + firstArch.addTailPart(archetype); + } else { + // add arch to the archpanel - only if it is not the map arch + if (!archetype.getArchetypeName().equals(STARTARCH_NAME)) { + if (!mainControl.getArchetypeSet().isLoadedFromArchive() || archName != null) { + // loading from individual files, so we simply add it to list + // ArchetypeSet.loadArchFromFiles() takes care of the panels + mainControl.addArchPanelArch(archetype.getArchetypeName(), index); + } else { + // loading from collected files, so we need process panels here + if (isNewCategory) { + String folder = newCat; // main folder of new category + if (newCat.indexOf("/") > 0) { + folder = newCat.substring(0, newCat.indexOf("/")); + } - if (firstArch != null) { - // add to head our x/y position so he can setup refmax - firstArch.addTailPart(archetype); - } else { - // add arch to the archpanel - only if it is not the map arch - if (!archetype.getArchetypeName().equals(STARTARCH_NAME)) { - if (!mainControl.getArchetypeSet().isLoadedFromArchive() || archName != null) { - // loading from individual files, so we simply add it to list - // ArchetypeSet.loadArchFromFiles() takes care of the panels - mainControl.addArchPanelArch(archetype.getArchetypeName(), index); - } else { - // loading from collected files, so we need process panels here - if (isNewCategory) { - String folder = newCat; // main folder of new category - if (newCat.indexOf("/") > 0) { - folder = newCat.substring(0, newCat.indexOf("/")); - } + if (!oldCat.startsWith(folder)) { + // an entire new panel must be opened + mainControl.addArchPanel(folder); + mainControl.addArchPanelCombo("show all"); + mainControl.addArchPanelCombo(folder); + index = 1; + } - if (!oldCat.startsWith(folder)) { - // an entire new panel must be opened - mainControl.addArchPanel(folder); - mainControl.addArchPanelCombo("show all"); - mainControl.addArchPanelCombo(folder); - index = 1; - } - - if (newCat.indexOf("/") > 0) { - folder = newCat.substring(newCat.indexOf("/") + 1); - if (newCat.startsWith(folder)) { - index = 1; // add to the base folder - } else if (!oldCat.endsWith(folder)) { - // a new JComboBox must be added - index = mainControl.addArchPanelCombo(folder); - } - } else { + if (newCat.indexOf("/") > 0) { + folder = newCat.substring(newCat.indexOf("/") + 1); + if (newCat.startsWith(folder)) { index = 1; // add to the base folder + } else if (!oldCat.endsWith(folder)) { + // a new JComboBox must be added + index = mainControl.addArchPanelCombo(folder); } - - isNewCategory = false; - oldCat = newCat; + } else { + index = 1; // add to the base folder } - mainControl.addArchPanelArch(archetype.getArchetypeName(), index); + + isNewCategory = false; + oldCat = newCat; } + mainControl.addArchPanelArch(archetype.getArchetypeName(), index); } } - postParseArchetype(archetype); - archetype.setIsArchetype(); - mainControl.getArchetypeSet().addArchetype(archetype); + } + postParseArchetype(archetype); + archetype.setIsArchetype(); + mainControl.getArchetypeSet().addArchetype(archetype); - archmore = false; // we assume this is last... but perhaps.. + archmore = false; // we assume this is last... but perhaps.. - // if this arch was from Artifacts file - return here: - if (archName != null) { - archetype.setArtifact(true); - // here we add all unchanged arch text lines from defArch back to arch - archetype.addObjectText(archetype.diffArchText(prototype.getObjectText(), true)); - return archetype; + // if this arch was from Artifacts file - return here: + if (archName != null) { + archetype.setArtifact(true); + // here we add all unchanged arch text lines from defArch back to arch + archetype.addObjectText(archetype.diffArchText(prototype.getObjectText(), true)); + return archetype; + } + archlast = archetype; + archetype = null; + } else { + if (thisLine.startsWith("msg")) { + msgflag = true; + } else if (thisLine.startsWith("animation")) { + archetype.addObjectText(thisLine); + } else if (thisLine.startsWith("anim_speed")) { + archetype.addObjectText(thisLine); + } else if (thisLine.startsWith("anim")) { + animflag = true; + } else if (thisLine.equals("lore")) { + loreflag = true; + } else if (thisLine.startsWith("visibility ")) { + if (log.isDebugEnabled()) { + log.debug("Remove visibility: " + archetype.getArchetypeName()); } - archlast = archetype; - archetype = null; - } else { - if (thisLine.startsWith("msg")) { - msgflag = true; - } else if (thisLine.startsWith("animation")) { + } else if (thisLine.startsWith("magicmap ")) { + if (log.isDebugEnabled()) { + log.debug("Remove magicmap: " + archetype.getArchetypeName()); + } + } else if (thisLine.startsWith("color_fg ")) { + if (log.isDebugEnabled()) { + log.debug("Remove color_fg: " + archetype.getArchetypeName()); + } + } else if (thisLine.startsWith("color_bg ")) { + if (log.isDebugEnabled()) { + log.debug("Remove color_bg: " + archetype.getArchetypeName()); + } + } else if (thisLine.startsWith("x ")) { + if (!archmore && !archetype.getArchetypeName().equals(STARTARCH_NAME)) { + log.warn("Find x cmd in single tile or head (add it to arch text): " + archetype.getArchetypeName()); archetype.addObjectText(thisLine); - } else if (thisLine.startsWith("anim_speed")) { + } + archetype.setMultiX(Integer.parseInt(thisLine.substring(2))); + } else if (thisLine.startsWith("y ")) { + if (!archmore && !archetype.getArchetypeName().equals(STARTARCH_NAME)) { + log.warn("Find y cmd in single tile or head (add it to arch text): " + archetype.getArchetypeName()); archetype.addObjectText(thisLine); - } else if (thisLine.startsWith("anim")) { - animflag = true; - } else if (thisLine.equals("lore")) { - loreflag = true; - } else if (thisLine.startsWith("visibility ")) { - if (log.isDebugEnabled()) { - log.debug("Remove visibility: " + archetype.getArchetypeName()); + } + archetype.setMultiY(Integer.parseInt(thisLine.substring(2))); + } else if (thisLine.startsWith("type ")) { + try { + final int i = Integer.parseInt(thisLine.substring(5)); + archetype.setArchTypNr(i); + if (i == 0) { + log.warn("Arch " + archetype.getArchetypeName() + " type number is zero. (" + thisLine.substring(5) + ")"); } - } else if (thisLine.startsWith("magicmap ")) { - if (log.isDebugEnabled()) { - log.debug("Remove magicmap: " + archetype.getArchetypeName()); + } catch (final Exception e) { + log.warn("Arch " + archetype.getArchetypeName() + " has a invalid type nr. (" + thisLine.substring(5) + ")"); + archetype.addObjectText(thisLine); + } + } else if (thisLine.startsWith("face ")) { + int x; + for (x = 4; x < thisLine.length(); x++) { + if (thisLine.charAt(x) != ' ') { + break; } - } else if (thisLine.startsWith("color_fg ")) { - if (log.isDebugEnabled()) { - log.debug("Remove color_fg: " + archetype.getArchetypeName()); - } - } else if (thisLine.startsWith("color_bg ")) { - if (log.isDebugEnabled()) { - log.debug("Remove color_bg: " + archetype.getArchetypeName()); - } - } else if (thisLine.startsWith("x ")) { - if (!archmore && !archetype.getArchetypeName().equals(STARTARCH_NAME)) { - log.warn("Find x cmd in single tile or head (add it to arch text): " + archetype.getArchetypeName()); - archetype.addObjectText(thisLine); - } - archetype.setMultiX(Integer.parseInt(thisLine.substring(2))); - } else if (thisLine.startsWith("y ")) { - if (!archmore && !archetype.getArchetypeName().equals(STARTARCH_NAME)) { - log.warn("Find y cmd in single tile or head (add it to arch text): " + archetype.getArchetypeName()); - archetype.addObjectText(thisLine); - } - archetype.setMultiY(Integer.parseInt(thisLine.substring(2))); - } else if (thisLine.startsWith("type ")) { - try { - final int i = Integer.parseInt(thisLine.substring(5)); - archetype.setArchTypNr(i); - if (i == 0) { - log.warn("Arch " + archetype.getArchetypeName() + " type number is zero. (" + thisLine.substring(5) + ")"); - } - } catch (final Exception e) { - log.warn("Arch " + archetype.getArchetypeName() + " has a invalid type nr. (" + thisLine.substring(5) + ")"); - archetype.addObjectText(thisLine); - } - } else if (thisLine.startsWith("face ")) { - int x; - for (x = 4; x < thisLine.length(); x++) { - if (thisLine.charAt(x) != ' ') { - break; - } - } - archetype.setFaceFlag(false); // we HAVE a face - archetype.setFaceName(thisLine.substring(x, thisLine.length())); - } else if (thisLine.startsWith("editor_folder ")) { - // the display category (= "folder" the arch belongs to) - newCat = thisLine.substring(14).trim(); - if (!newCat.equals(oldCat)) { - isNewCategory = true; // this arch has a new category - } } - archetype.addObjectText(thisLine); - if (log.isDebugEnabled()) { - log.debug("add String: " + thisLine); + archetype.setFaceFlag(false); // we HAVE a face + archetype.setFaceName(thisLine.substring(x, thisLine.length())); + } else if (thisLine.startsWith("editor_folder ")) { + // the display category (= "folder" the arch belongs to) + newCat = thisLine.substring(14).trim(); + if (!newCat.equals(oldCat)) { + isNewCategory = true; // this arch has a new category } } - } - thisLine2 = in.readLine(); - } // while loop ends here - } catch (final IOException e) { - log.error("Error: ", e); - } - return null; - } - - /** {@inheritDoc} */ - public void postParseArchetype(final GameObject archetype) { - final String text = archetype.getObjectText(); - archetype.resetObjectText(); - final int len = text.length(); - - // if no type was set, zero is taken - if (archetype.getArchTypNr() == GameObject.TYPE_UNSET) { - archetype.setArchTypNr(0); - } - - boolean scriptflag = false; - for (int i = 0, s = 0; i < len; i++) { - - if (text.charAt(i) == '\n') { - if (i - s > 0) { - if (scriptflag) { - archetype.addObjectText(text.substring(s, i)); - if (text.regionMatches(s, "end_script_", 0, 11)) { - scriptflag = false; - } - } else if (text.regionMatches(s, "start_script_", 0, 13)) { - archetype.addObjectText(text.substring(s, i)); - scriptflag = true; - } else if (text.regionMatches(s, "editable ", 0, 9)) { - archetype.setEditType(Integer.parseInt(text.substring(s + 9, i))); - } else if (text.regionMatches(s, "name ", 0, 5)) { - archetype.setObjName(text.substring(s + 5, i)); - } else { - archetype.addObjectText(text.substring(s, i)); + archetype.addObjectText(thisLine); + if (log.isDebugEnabled()) { + log.debug("add String: " + thisLine); } - } - s = i + 1; } - } - - // default arches don't get an editType (not worth the time) - // they get one assigned as soon as put on a map though. - archetype.setEditType(IGUIConstants.TILE_EDIT_NONE); + thisLine2 = in.readLine(); + } // while loop ends here + return null; } /** {@inheritDoc} */ @@ -520,44 +465,4 @@ } } - /** {@inheritDoc} */ - public void expandMulti(final GameObject gameObject, final List<GameObject> objects) { - // TODO: Couldn't we simply invoke archetype = gameObject.getArchetype() here? - final GameObject archetype = mainControl.getArchetype(gameObject.getArchetypeName()); - - // is it a multi head? - if (archetype != null && archetype.isMulti() && gameObject.getMultiRefCount() <= 1) { - // we have a multi head and need to insert his tail now - - // do insertion for all non-head parts of the multi - for (GameObject oldPart = archetype.getMultiNext(); oldPart != null; oldPart = oldPart.getMultiNext()) { - final GameObject newarch = oldPart.createArch(); - - gameObject.addTailPart(newarch); - objects.add(newarch); - - // set map position (x, y) - newarch.setMapX(gameObject.getMapX() + newarch.getMultiX()); - newarch.setMapY(gameObject.getMapY() + newarch.getMultiY()); - - // now attach the default arch and stuff - // (don't need edit type as we copy from head) - mainControl.getArchetypeParser().postParseGameObject(newarch, 0); - } - } - } - - /** {@inheritDoc} */ - public void sortTempList(final List<GameObject> objects) { - final Comparator<GameObject> sorter = new Comparator<GameObject>() { - /** {@inheritDoc} */ - public int compare(final GameObject o1, final GameObject o2) { - final boolean b1 = o1.isMulti(); - final boolean b2 = o2.isMulti(); - return b1 == b2 ? 0 : b2 ? -1 : 1; - } - }; - Collections.sort(objects, sorter); - } - } // class ArchetypeParser Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-11-11 17:59:16 UTC (rev 646) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-11-11 19:22:56 UTC (rev 647) @@ -26,7 +26,6 @@ package daieditor.gameobject; import daieditor.CMainControl; -import daieditor.IGUIConstants; import daieditor.MultiPositionData; import daieditor.io.PathManager; import java.io.BufferedReader; @@ -34,11 +33,9 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; -import static java.util.Collections.sort; -import java.util.Comparator; -import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +import net.sf.gridarta.gameobject.AbstractArchetypeParser; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import org.jetbrains.annotations.Nullable; @@ -51,7 +48,7 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ @SuppressWarnings({"HardcodedFileSeparator"}) -public final class ArchetypeParser implements net.sf.gridarta.gameobject.ArchetypeParser<GameObject> { +public final class ArchetypeParser extends AbstractArchetypeParser<GameObject> { /** Logger. */ private static final Logger log = Logger.getLogger("daieditor"); @@ -85,11 +82,6 @@ } /** {@inheritDoc} */ - public void parseArchetypeFromStream(final BufferedReader in, final int index, final String fname) throws IOException { - parseArchetypeFromStream(in, null, null, null, index, fname); - } - - /** {@inheritDoc} */ @Nullable @SuppressWarnings({"StringContatenationInLoop", "ObjectAllocationInLoop"}) public GameObject parseArchetypeFromStream(final BufferedReader in, @Nullable final GameObject prototype, @Nullable final String line, @Nullable final String archName, /* TODO: final*/ int index, final String fname) throws IOException { // start with new clean GameObject instance @@ -161,10 +153,10 @@ } parsearch = true; - if (archmore) { - // System.err.println("multi part object: part "+ archmore_count); - } else { + if (!archmore) { firstArch = null; + } else { + // System.err.println("multi part object: part "+ archmore_count); } if (archName == null) { @@ -396,49 +388,6 @@ } /** {@inheritDoc} */ - public void postParseArchetype(final GameObject archetype) { - final String text = archetype.getObjectText(); - archetype.resetObjectText(); - final int len = text.length(); - - // if no type was set, zero is taken - if (archetype.getArchTypNr() == GameObject.TYPE_UNSET) { - archetype.setArchTypNr(0); - } - - boolean scriptflag = false; - for (int i = 0, s = 0; i < len; i++) { - - if (text.charAt(i) == '\n') { - if (i - s > 0) { - if (scriptflag) { - archetype.addObjectText(text.substring(s, i)); - if (text.regionMatches(s, "end_script_", 0, 11)) { - scriptflag = false; - } - } else if (text.regionMatches(s, "start_script_", 0, 13)) { - archetype.addObjectText(text.substring(s, i)); - scriptflag = true; - } else if (text.regionMatches(s, "editable ", 0, 9)) { - archetype.setEditType(Integer.parseInt(text.substring(s + 9, i))); - } else if (text.regionMatches(s, "name ", 0, 5)) { - archetype.setObjName(text.substring(s + 5, i)); - } else { - archetype.addObjectText(text.substring(s, i)); - } - - } - s = i + 1; - } - } - - // default arches don't get an editType (not worth the time) - // they get one assigned as soon as put on a map though. - // TODO: This should be changed. - archetype.setEditType(IGUIConstants.TILE_EDIT_NONE); - } - - /** {@inheritDoc} */ public void postParseGameObject(final GameObject gameObject, final int editType) { if (!gameObject.hasArchetype()) { return; @@ -503,50 +452,6 @@ } } - /** {@inheritDoc} */ - public void expandMulti(final GameObject gameObject, final List<GameObject> objects) { - - if (gameObject.isInContainer()) { - return; - } - - final GameObject archetype = gameObject.getArchetype(); // default arch - - // is it a multi head? - if (archetype != null && archetype.isMulti() && gameObject.getMultiRefCount() <= 1) { - // we have a multi head and need to insert his tail now - - // do insertion for all non-head parts of the multi - for (GameObject oldPart = archetype.getMultiNext(); oldPart != null; oldPart = oldPart.getMultiNext()) { - final GameObject newarch = oldPart.createArch(); - - gameObject.addTailPart(newarch); - objects.add(newarch); - - // set map position (x, y) - newarch.setMapX(gameObject.getMapX() + newarch.getMultiX()); - newarch.setMapY(gameObject.getMapY() + newarch.getMultiY()); - - // now attach the default arch and stuff - // (don't need edit type as we copy from head) - postParseGameObject(newarch, 0); - } - } - } - - /** {@inheritDoc} */ - public void sortTempList(final List<GameObject> objects) { - final Comparator<GameObject> sorter = new Comparator<GameObject>() { - /** {@inheritDoc} */ - public int compare(final GameObject o1, final GameObject o2) { - final boolean b1 = o1.isMulti(); - final boolean b2 = o2.isMulti(); - return b1 == b2 ? 0 : b2 ? -1 : 1; - } - }; - sort(objects, sorter); - } - /** * Calculate the lowest part of this multi-arch. This lowest part is needed * because in ISO view, the big image is drawn for it's lowest part, in Added: trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java 2006-11-11 19:22:56 UTC (rev 647) @@ -0,0 +1,117 @@ +package net.sf.gridarta.gameobject; + +import java.io.BufferedReader; +import java.io.IOException; +import java.util.Comparator; +import java.util.List; +import java.util.Collections; +import org.apache.log4j.Logger; + +/** + * Abstract base implementation of {@link net.sf.gridarta.gameobject.ArchetypeParser}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public abstract class AbstractArchetypeParser<G extends GameObject<G>> implements ArchetypeParser<G> { + + /** Logger. */ + private static final Logger log = Logger.getLogger(AbstractArchetypeParser.class); + + /** + * Create an AbstractArchetypeParser. + */ + protected AbstractArchetypeParser() { + } + + /** {@inheritDoc} */ + public void parseArchetypeFromStream(final BufferedReader in, final int index, final String fname) throws IOException { + parseArchetypeFromStream(in, null, null, null, index, fname); + } + + /** {@inheritDoc} */ + public void postParseArchetype(final G archetype) { + final String text = archetype.getObjectText(); + archetype.resetObjectText(); + final int len = text.length(); + + // if no type was set, zero is taken + if (archetype.getArchTypNr() == GameObject.TYPE_UNSET) { + archetype.setArchTypNr(0); + } + + boolean scriptflag = false; + for (int i = 0, s = 0; i < len; i++) { + + if (text.charAt(i) == '\n') { + if (i - s > 0) { + if (scriptflag) { + archetype.addObjectText(text.substring(s, i)); + if (text.regionMatches(s, "end_script_", 0, 11)) { + scriptflag = false; + } + } else if (text.regionMatches(s, "start_script_", 0, 13)) { + archetype.addObjectText(text.substring(s, i)); + scriptflag = true; + } else if (text.regionMatches(s, "editable ", 0, 9)) { + archetype.setEditType(Integer.parseInt(text.substring(s + 9, i))); + } else if (text.regionMatches(s, "name ", 0, 5)) { + archetype.setObjName(text.substring(s + 5, i)); + } else { + archetype.addObjectText(text.substring(s, i)); + } + + } + s = i + 1; + } + } + + // default arches don't get an editType (not worth the time) + // they get one assigned as soon as put on a map though. + // TODO: This should be changed. + archetype.setEditType(0x10000 /*IGUIConstants.TILE_EDIT_NONE*/); + } + + /** {@inheritDoc} */ + public void expandMulti(final G gameObject, final List<G> objects) { + if (gameObject.isInContainer()) { + log.warn("Multipart expansion for a GameObject inside a container requested."); + return; + } + + final G archetype = gameObject.getArchetype(); + + // is it a multi head? + if (archetype != null && archetype.isMulti() && gameObject.getMultiRefCount() <= 1) { + // we have a multi head and need to insert his tail now + + // do insertion for all non-head parts of the multi + for (G oldPart = archetype.getMultiNext(); oldPart != null; oldPart = oldPart.getMultiNext()) { + final G newarch = oldPart.createArch(); + + gameObject.addTailPart(newarch); + objects.add(newarch); + + // set map position (x, y) + newarch.setMapX(gameObject.getMapX() + newarch.getMultiX()); + newarch.setMapY(gameObject.getMapY() + newarch.getMultiY()); + + // now attach the default arch and stuff + // (don't need edit type as we copy from head) + postParseGameObject(newarch, 0); + } + } + } + + /** {@inheritDoc} */ + public void sortTempList(final List<G> objects) { + final Comparator<G> sorter = new Comparator<G>() { + /** {@inheritDoc} */ + public int compare(final G o1, final G o2) { + final boolean b1 = o1.isMulti(); + final boolean b2 = o2.isMulti(); + return b1 == b2 ? 0 : b2 ? -1 : 1; + } + }; + Collections.sort(objects, sorter); + } + +} // class AbstractArchetypeParser Property changes on: trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-11-11 17:59:16 UTC (rev 646) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-11-11 19:22:56 UTC (rev 647) @@ -118,6 +118,12 @@ int getArchTypNr(); /** + * Sets the type number of this Archetype. + * @param typNr Type number of this Archetype. + */ + void setArchTypNr(int typNr); + + /** * CFEditor only: Returns the name of the face. * @return The name of the face of this Archetype. * @deprecated compatibility method Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-11-11 17:59:16 UTC (rev 646) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-11-11 19:22:56 UTC (rev 647) @@ -659,6 +659,8 @@ */ public abstract G createArch(); + public abstract void addTailPart(final G tail); + /** * Return the head part of a multi-part object. For single-part objects it * is the object itself. @@ -681,6 +683,13 @@ @Nullable public abstract G getMultiNext(); /** + * Returns number of parts for multipart heads. (*.getMultiRefCount() > 0) + * is often used as way to find multi-heads. + * @return number of parts + */ + public abstract int getMultiRefCount(); + + /** * {@inheritDoc} * Implementations must not provide substitute clones of a different class. * I.e. implementations MUST return an object created by super.clone() or their own constructor. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-11 21:16:25
|
Revision: 649 http://svn.sourceforge.net/gridarta/?rev=649&view=rev Author: christianhujer Date: 2006-11-11 13:16:10 -0800 (Sat, 11 Nov 2006) Log Message: ----------- Some more ArchetypeParser unification. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-11-11 21:15:26 UTC (rev 648) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-11-11 21:16:10 UTC (rev 649) @@ -186,27 +186,25 @@ thisLine2 = line; // pre read "Object" from artifacts file loader } - boolean msgflag = false; - boolean loreflag = false; - boolean animflag = false; - boolean parsearch = false; - boolean archmore = false; - String oldCat = "<xxx>"; boolean isNewCategory = true; + String oldCat = "<xxx>"; GameObject firstArch = null; + boolean archmore = false; + boolean parsearch = false; + boolean animflag = false; + boolean msgflag = false; + boolean loreflag = false; String newCat = "no category info"; - int archmoreCount = 0; while (thisLine2 != null) { final String thisLine = thisLine2.trim(); - if (thisLine.startsWith("#")) { - // skip comments + if (!msgflag && thisLine.startsWith("#")) { + // skip comments (only outside msges) thisLine2 = in.readLine(); continue; } if (!parsearch) { - if (thisLine.startsWith("More")) { if (firstArch == null) { firstArch = archlast; Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-11-11 21:15:26 UTC (rev 648) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-11-11 21:16:10 UTC (rev 649) @@ -120,6 +120,7 @@ } else { thisLine2 = line; // pre read "Object" from artifacts file loader } + boolean isNewCategory = true; String oldCat = null; String oldMainFolder = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-12 00:10:37
|
Revision: 656 http://svn.sourceforge.net/gridarta/?rev=656&view=rev Author: christianhujer Date: 2006-11-11 16:10:18 -0800 (Sat, 11 Nov 2006) Log Message: ----------- Optimized imports. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/daimonin/src/daieditor/gameobject/Collectable.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/src/app/net/sf/gridarta/MainControl.java trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java trunk/src/app/net/sf/gridarta/io/AbstractMapWriter.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-11-12 00:06:05 UTC (rev 655) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-11-12 00:10:18 UTC (rev 656) @@ -27,9 +27,9 @@ import cfeditor.filter.AttributeFilter; import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; +import cfeditor.gui.MapView; import cfeditor.map.MapControl; import cfeditor.map.MapModel; -import cfeditor.gui.MapView; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-11-12 00:06:05 UTC (rev 655) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-11-12 00:10:18 UTC (rev 656) @@ -25,10 +25,10 @@ package cfeditor; import cfeditor.gameobject.GameObject; +import cfeditor.gui.MapView; import cfeditor.map.MapControl; import cfeditor.menu.MenuHelper; import cfeditor.menu.MenuManager; -import cfeditor.gui.MapView; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Point; Modified: trunk/daimonin/src/daieditor/gameobject/Collectable.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/Collectable.java 2006-11-12 00:06:05 UTC (rev 655) +++ trunk/daimonin/src/daieditor/gameobject/Collectable.java 2006-11-12 00:10:18 UTC (rev 656) @@ -1,8 +1,8 @@ package daieditor.gameobject; +import java.io.File; +import java.io.IOException; import net.sf.japi.swing.Progress; -import java.io.IOException; -import java.io.File; import org.jetbrains.annotations.NotNull; /** Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2006-11-12 00:06:05 UTC (rev 655) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2006-11-12 00:10:18 UTC (rev 656) @@ -23,28 +23,28 @@ import daieditor.CMainControl; import daieditor.IGUIConstants; +import daieditor.gameobject.Collectable; import daieditor.gameobject.NamedObjects; -import daieditor.gameobject.Collectable; +import daieditor.icons.ArchFaceProvider; import daieditor.icons.DaimoninFaceProvider; -import daieditor.icons.ArchFaceProvider; +import java.io.BufferedOutputStream; import java.io.BufferedReader; +import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; -import java.io.BufferedWriter; -import java.io.FileOutputStream; -import java.io.BufferedOutputStream; -import java.io.FileWriter; -import java.io.DataOutputStream; import java.io.OutputStreamWriter; import java.util.logging.Level; import java.util.logging.Logger; +import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.Progress; -import net.sf.japi.swing.ActionFactory; import org.jetbrains.annotations.NotNull; /** Modified: trunk/src/app/net/sf/gridarta/MainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/MainControl.java 2006-11-12 00:06:05 UTC (rev 655) +++ trunk/src/app/net/sf/gridarta/MainControl.java 2006-11-12 00:10:18 UTC (rev 656) @@ -1,10 +1,10 @@ package net.sf.gridarta; +import java.util.Random; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gameobject.ArchetypeParser; import net.sf.gridarta.gameobject.ArchetypeSet; import org.jetbrains.annotations.NotNull; -import java.util.Random; /** * This interface is only for unification. Modified: trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java 2006-11-12 00:06:05 UTC (rev 655) +++ trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java 2006-11-12 00:10:18 UTC (rev 656) @@ -2,9 +2,9 @@ import java.io.BufferedReader; import java.io.IOException; +import java.util.Collections; import java.util.Comparator; import java.util.List; -import java.util.Collections; import org.apache.log4j.Logger; /** Modified: trunk/src/app/net/sf/gridarta/io/AbstractMapWriter.java =================================================================== --- trunk/src/app/net/sf/gridarta/io/AbstractMapWriter.java 2006-11-12 00:06:05 UTC (rev 655) +++ trunk/src/app/net/sf/gridarta/io/AbstractMapWriter.java 2006-11-12 00:10:18 UTC (rev 656) @@ -1,5 +1,6 @@ package net.sf.gridarta.io; +import java.awt.Point; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; @@ -7,11 +8,10 @@ import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; -import java.awt.Point; +import net.sf.gridarta.Size2D; +import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapModel; -import net.sf.gridarta.map.MapArchObject; -import net.sf.gridarta.gameobject.GameObject; -import net.sf.gridarta.Size2D; import org.jetbrains.annotations.NotNull; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-12 12:46:57
|
Revision: 658 http://svn.sourceforge.net/gridarta/?rev=658&view=rev Author: christianhujer Date: 2006-11-12 04:46:34 -0800 (Sun, 12 Nov 2006) Log Message: ----------- Made server data collection independent of ArchetypeSet and extracted it into a class of its own. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java Added Paths: ----------- trunk/daimonin/src/daieditor/gameobject/Collector.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-11-12 00:15:19 UTC (rev 657) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-11-12 12:46:34 UTC (rev 658) @@ -522,7 +522,9 @@ } } - /** {@inheritDoc} */ + /** + * Start collecting the Archetypes and other resource files to create an archive. + */ public void collectArchetypes() { collectCrossfireArchetypes(); } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-11-12 00:15:19 UTC (rev 657) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-11-12 12:46:34 UTC (rev 658) @@ -31,6 +31,8 @@ import daieditor.gameobject.ArchetypeParser; import daieditor.gameobject.ArchetypeSet; import daieditor.gameobject.GameObject; +import daieditor.gameobject.Collectable; +import daieditor.gameobject.Collector; import daieditor.gameobject.anim.AnimationObjects; import daieditor.gameobject.face.FaceFacade; import daieditor.gameobject.face.FaceObjects; @@ -515,7 +517,15 @@ /** Collect CF arches, animations and faces. */ @ActionMethod public void collectArches() { - archetypeSet.collectArchetypes(); + final List<Collectable> collectables = new ArrayList<Collectable>(); + final Collector collector = new Collector(); + collectables.add(getArchetypeSet()); + collectables.add(getAnimationObjects()); + collectables.add(getFaceObjects()); + collector.setCollectables(collectables); + collector.setParent(getMainView()); + collector.setDestDir(new File(getArchDefaultFolder())); + collector.start(); } /** Collect Spells. */ Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-11-12 00:15:19 UTC (rev 657) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-11-12 12:46:34 UTC (rev 658) @@ -55,7 +55,6 @@ import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.Progress; -import net.sf.japi.swing.ProgressDisplay; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -72,9 +71,6 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); - /** Size of the image buffer. */ - private static final int IMAGE_BUFFER_SIZE = 50 * 1024; - private final CMainControl mainControl; private int folderLevel; @@ -124,7 +120,7 @@ //throw new DuplicateArchetypeException(data); } - /** load the arches */ + /** {@inheritDoc} */ public void loadArchetypes() { final long timeStart = System.currentTimeMillis(); setLoadStatus(LoadStatus.LOADING); // status: loading @@ -457,37 +453,10 @@ } } - /** {@inheritDoc} */ - public void collectArchetypes() { - new Thread(archCollector).start(); - } - - /** Thread code for collecting the arches. */ - private final Runnable archCollector = new Runnable() { - /* - * Collect the existing arches and create archive-files for editor use as - * well as the Daimonin server. The arches also get a special path variable - * included which is used in the editor to categorize the arches. - * <p/> - * Output is: "archetypes", "daimonin.0", "animations", "bmaps" - */ - /** {@inheritDoc} */ - public void run() { - final Progress pbar = new ProgressDisplay(mainControl.getMainView(), ""/*FIXME*/, getArchetypeCount(), ACTION_FACTORY.getString("archCollectArches")); - final File dir = new File(mainControl.getArchDefaultFolder()); - for (final Collectable collectable : new Collectable[] { ArchetypeSet.this, mainControl.getAnimationObjects(), mainControl.getFaceObjects() }) { - try { - collectable.collect(pbar, dir); - } catch (final IOException e) { - ACTION_FACTORY.showMessageDialog(pbar.getParentComponent(), "archCollectErrorIOException", "arches, animations and animtree, images", e); - } - } - pbar.finished(); - mainControl.setStatusText(ACTION_FACTORY.getString("archCollectDone")); - } - }; // Runnable archCollector - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * Collects the Archetypes. + */ public void collect(@NotNull final Progress progress, @NotNull final File dir) throws IOException { final File dfile = new File(dir, IGUIConstants.ARCH_FILE); // now open the output-stream Added: trunk/daimonin/src/daieditor/gameobject/Collector.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/Collector.java (rev 0) +++ trunk/daimonin/src/daieditor/gameobject/Collector.java 2006-11-12 12:46:34 UTC (rev 658) @@ -0,0 +1,90 @@ +package daieditor.gameobject; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collection; +import java.io.File; +import java.io.IOException; +import javax.swing.JFrame; +import net.sf.japi.swing.Progress; +import net.sf.japi.swing.ProgressDisplay; +import net.sf.japi.swing.ActionFactory; + +/** + * A Collector is capable of iterating over a collection of {@link Collectable}s and collecting them in a separate Thread with a nice GUI. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class Collector implements Runnable { + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); + + /** The Collectables. */ + private List<Collectable> collectables = new ArrayList<Collectable>(); + + /** The Component to show the progress dialog on. */ + private JFrame parent; + + /** The destination directory to write files to. */ + private File destDir; + + /** + * Create a Collector. + */ + public Collector() { + } + + /** + * Sets the Collectables to collect. + * @param collectables Collectables to collect. + */ + public void setCollectables(final Collection<Collectable> collectables) { + this.collectables.clear(); + this.collectables.addAll(collectables); + } + + /** + * Sets the parent component to show the progress dialog on. + * @param parent Parent component. + */ + public void setParent(final JFrame parent) { + this.parent = parent; + } + + /** + * Sets the destination directory to write files to. + * @param destDir Destination directory to write files to. + */ + public void setDestDir(final File destDir) { + this.destDir = destDir; + } + + /** + * Starts collecting. + */ + public void start() { + new Thread(this).start(); + } + + /* + * Collect the existing arches and create archive-files for editor use as + * well as the Daimonin server. The arches also get a special path variable + * included which is used in the editor to categorize the arches. + * <p/> + * Output is: "archetypes", "daimonin.0", "animations", "bmaps" + */ + /** {@inheritDoc} */ + public void run() { + final Progress progress = new ProgressDisplay(parent, ""/*FIXME*/, 0, ACTION_FACTORY.getString("archCollectArches")); + for (final Collectable collectable : collectables) { + try { + collectable.collect(progress, destDir); + } catch (final IOException e) { + ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorIOException", "arches, animations and animtree, images", e); + } + } + progress.finished(); + //mainControl.setStatusText(ACTION_FACTORY.getString("archCollectDone")); + } + +} // class Collector Property changes on: trunk/daimonin/src/daieditor/gameobject/Collector.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-11-12 00:15:19 UTC (rev 657) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-11-12 12:46:34 UTC (rev 658) @@ -213,7 +213,12 @@ } } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * Collects the Animations. + * The animation data is written to "animations". + * The tree information for the editor is written to "animtree". + */ public void collect(@NotNull final Progress progress, @NotNull final File dir) throws IOException { final BufferedWriter animations = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(dir, "animations")), IOUtils.MAP_ENCODING)); try { Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2006-11-12 00:15:19 UTC (rev 657) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2006-11-12 12:46:34 UTC (rev 658) @@ -195,6 +195,11 @@ /** * {@inheritDoc} + * Collects the faces. + * The graphics information is written to "daimonin.0". + * The meta information (offsets etc.) is written to "bmaps". + * The tree information for the editor is written to "facetree". + * <p /> * Theoretically it would also be possible to recode the images. * But the Java image encoder isn't as good as that of gimp in many cases (yet much better as the old visualtek's). * @todo I/O handling sucks here, this could be nicer. Modified: trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java 2006-11-12 00:15:19 UTC (rev 657) +++ trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java 2006-11-12 12:46:34 UTC (rev 658) @@ -47,12 +47,7 @@ */ void loadArchetypes(); - /** - * Start collecting the Archetypes and other resource files to create an archive. - */ - void collectArchetypes(); - /** * The load status of the ArchetypeSet. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-12 18:20:23
|
Revision: 660 http://svn.sourceforge.net/gridarta/?rev=660&view=rev Author: christianhujer Date: 2006-11-12 10:14:12 -0800 (Sun, 12 Nov 2006) Log Message: ----------- Large unification of data stuff. Attention: This might have broken something. Modified Paths: -------------- trunk/crossfire/build.xml trunk/crossfire/resource/conf/archetypes trunk/crossfire/resource/conf/crossfire.0 trunk/crossfire/src/cfeditor/CArchPanelPan.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java Added Paths: ----------- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/Collectable.java trunk/src/app/net/sf/gridarta/gameobject/Collector.java trunk/src/app/net/sf/gridarta/gameobject/NamedObject.java trunk/src/app/net/sf/gridarta/gameobject/NamedObjects.java trunk/src/app/net/sf/gridarta/gameobject/NamedTreeNode.java trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObject.java trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java trunk/src/app/net/sf/gridarta/gameobject/face/ trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObject.java trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/face/FaceObject.java trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjects.java Removed Paths: ------------- trunk/daimonin/src/daieditor/gameobject/Collectable.java trunk/daimonin/src/daieditor/gameobject/Collector.java trunk/daimonin/src/daieditor/gameobject/NamedObject.java trunk/daimonin/src/daieditor/gameobject/NamedObjects.java trunk/daimonin/src/daieditor/gameobject/NamedTreeNode.java Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2006-11-12 18:07:57 UTC (rev 659) +++ trunk/crossfire/build.xml 2006-11-12 18:14:12 UTC (rev 660) @@ -128,6 +128,8 @@ <include name="net/sf/japi/util/filter/file/EndingFileFilter.class" /> <include name="net/sf/japi/swing/ActionFactory.class" /> <include name="net/sf/japi/swing/NamedActionMap.class" /> + <include name="net/sf/japi/swing/Progress.class" /> + <include name="net/sf/japi/swing/ProgressDisplay.class" /> </zipfileset> <!-- creating the manifest --> <manifest> Modified: trunk/crossfire/resource/conf/archetypes =================================================================== --- trunk/crossfire/resource/conf/archetypes 2006-11-12 18:07:57 UTC (rev 659) +++ trunk/crossfire/resource/conf/archetypes 2006-11-12 18:14:12 UTC (rev 660) @@ -1,10696 +1,15485 @@ -Object elvenboots -name elven boots -name_pl elven boots -client_type 290 -nrof 1 -face elvenboots.111 -value 30000 -weight 500 -type 99 -exp 3 -material 8 -stealth 1 -editable 5120 -item_power 3 -body_foot -2 -editor_folder armour/boots +Object door_0 +name door +face door_0.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 end -Object high_boots -name jack boots -name_pl jack boots -client_type 291 -face high_boots.111 -value 60 -weight 6500 -ac 1 -nrof 1 -resist_physical 4 -type 99 -material 8 -editable 1024 -body_foot -2 -gen_sp_armour 4 -editor_folder armour/boots +Object door_1_1 +name door +face door_1.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 end -Object high_boots_b -name jack boots -name_pl jack boots -client_type 291 -face high_boots_b.111 -value 1700 -weight 6500 -ac 1 -nrof 1 -Cha 1 -resist_death 1 -resist_physical 4 -type 99 -material 8 -materialname black leather -editable 1024 -body_foot -2 -gen_sp_armour 4 -editor_folder armour/boots +Object door_1_3 +name door +face door_2.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 end -Object high_boots_b_d -name jack boots -name_pl jack boots -client_type 291 -face high_boots_b.111 -title of death -value 30000 -weight 13000 -ac 1 -nrof 1 -Cha 1 -resist_death 25 -resist_physical 25 -type 99 +Object door_2_2_1 +name door +face door_3.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_1_2 +name door +face door_4.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_2_1_1 +name door +face door_5.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_2_2_2 +name door +face door_6.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_3_2 +name door +face door_7.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_1_4 +name door +face door_8.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_2_2_4 +name door +face door_9.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_2_1_2 +name door +face door_A.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_3_1 +name door +face door_B.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_2_2_3 +name door +face door_C.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_3_4 +name door +face door_D.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_3_3 +name door +face door_E.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_4 +name door +face door_F.111 +type 23 +editor_folder door/Door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object locked_door1 +name locked door +face ldoor1.111 +type 20 +editor_folder door/Locked +msg +You need the special key to open this door. +endmsg +slaying set_individual_value +no_pass 1 +no_pick 1 +no_magic 1 +damned 1 +end +Object locked_door2 +name locked door +face ldoor2.111 +type 20 +editor_folder door/Locked +msg +You need the special key to open this door. +endmsg +slaying set_individual_value +no_pass 1 +no_pick 1 +no_magic 1 +damned 1 +end +Object key2 +name strange key +face key2.111 +type 21 +editor_folder door/Locked +race keys +slaying set_individual_value +value 100 +weight 100 +name_pl strange keys +client_type 810 +end +Object odoor_2_fant_blue-green +name door +face odoor_2_fant_blue-green.111 +type 23 +editor_folder door/door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object odoor_2_fant_blue-yellow +name door +face odoor_2_fant_blue-yellow.111 +type 23 +editor_folder door/door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object odoor_2_fant_brown +name door +face odoor_2_fant_brown.111 +type 23 +editor_folder door/door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object odoor_2_fant_red-white +name door +face odoor_2_fant_red-white.111 +type 23 +editor_folder door/door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object odoor_2_fant_red-yellow +name door +face odoor_2_fant_red-yellow.111 +type 23 +editor_folder door/door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_1 +name door +face odoor_1.111 +type 23 +editor_folder door/door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_2 +name door +face odoor_2.111 +type 23 +editor_folder door/door +randomitems door +no_pass 1 +blocksview 1 +hp 400 +exp 1 +ac 10 +material 16 +no_pick 1 +alive 1 +level 1 +end +Object door_look_1 +name door +face wooddoor_1.111 +type 23 +editor_folder door/door +randomitems door +no_pass 1 +hp 400 +exp 1 +ac 10 material 2 -materialname black steel -editable 1024 -body_foot -2 -gen_sp_armour 4 -editor_folder armour/boots +no_pick 1 +alive 1 +level 1 +pass_thru 1 end -Object high_boots_w -name jack boots -name_pl jack boots -client_type 291 -face high_boots_w.111 -value 2000 -weight 6500 -ac 1 -nrof 1 -Cha 1 -resist_blind 1 -resist_physical 4 -type 99 -material 8 -materialname white leather -editable 1024 -body_foot -2 -gen_sp_armour 4 -editor_folder armour/boots +Object door_look_2 +name door +face wooddoor_2.111 +type 23 +editor_folder door/door +randomitems door +no_pass 1 +hp 400 +exp 1 +ac 10 +material 2 +no_pick 1 +alive 1 +level 1 +pass_thru 1 end -Object high_boots_w_l -name jack boots -name_pl jack boots -client_type 291 -face high_boots_w.111 -title of light -value 40000 -weight 13000 -ac 1 +Object key +face key1.111 +type 24 +editor_folder door/door +race keys nrof 1 -Cha 1 -resist_blind 25 -resist_physical 25 -type 99 material 2 -materialname white steel -editable 1024 -body_foot -2 -gen_sp_armour 4 -editor_folder armour/boots +value 10 +weight 10 +name_pl keys +client_type 801 end -Object idaten -name Idaten boots -name_pl Idaten boots -client_type 290 -nrof 1 -exp 5 -face idaten.111 -animation idaten +Object town_1 +name village +face jcity_0.111 +type 66 +editor_folder exit/Town +no_pick 1 +client_type 25012 +end +Object town_2 +name small town +face jcity_2.111 +type 66 +editor_folder exit/Town +no_pick 1 +client_type 25012 +end +More +Object town_2.2 +name small town +face jcity_8.111 +type 66 +no_pick 1 +x 1 +end +Object town_3 +name small town +face jcity_4.111 +type 66 +editor_folder exit/Town +no_pick 1 +client_type 25012 +end +More +Object town_3.2 +name small town +face jcity_1.111 +type 66 +no_pick 1 +y 1 +end +Object town_4 +name medium town +face jcity_6.111 +type 66 +editor_folder exit/Town +no_pick 1 +client_type 25012 +end +More +Object town_4.2 +name medium town +face jcity_C.111 +type 66 +no_pick 1 +x 1 +end +More +Object town_4.3 +name medium town +face jcity_3.111 +type 66 +no_pick 1 +y 1 +end +More +Object town_4.4 +name medium town +face jcity_9.111 +type 66 +no_pick 1 +x 1 +y 1 +end +Object town_5 +name city +face jcity_6.111 +type 66 +editor_folder exit/Town +no_pick 1 +client_type 25012 +end +More +Object town_5.2 +name city +face jcity_E.111 +type 66 +no_pick 1 +x 1 +end +More +Object town_5.3 +name city +face jcity_C.111 +type 66 +no_pick 1 +x 2 +end +More +Object town_5.4 +name city +face jcity_3.111 +type 66 +no_pick 1 +y 1 +end +More +Object town_5.5 +name city +face jcity_B.111 +type 66 +no_pick 1 +x 1 +y 1 +end +More +Object town_5.6 +name city +face jcity_9.111 +type 66 +no_pick 1 +x 2 +y 1 +end +Object town_6 +name city +face jcity_6.111 +type 66 +editor_folder exit/Town +no_pick 1 +client_type 25012 +end +More +Object town_6.2 +name city +face jcity_C.111 +type 66 +no_pick 1 +x 1 +end +More +Object town_6.3 +name city +face jcity_7.111 +type 66 +no_pick 1 +y 1 +end +More +Object town_6.4 +name city +face jcity_D.111 +type 66 +no_pick 1 +x 1 +y 1 +end +More +Object town_6.5 +name city +face jcity_3.111 +type 66 +no_pick 1 +y 2 +end +More +Object town_6.6 +name city +face jcity_9.111 +type 66 +no_pick 1 +x 1 +y 2 +end +Object town_7 +name large city +face jcity_6.111 +type 66 +editor_folder exit/Town +no_pick 1 +client_type 25012 +end +More +Object town_7.2 +name large city +face jcity_E.111 +type 66 +no_pick 1 +x 1 +end +More +Object town_7.3 +name large city +face jcity_C.111 +type 66 +no_pick 1 +x 2 +end +More +Object town_7.4 +name large city +face jcity_7.111 +type 66 +no_pick 1 +y 1 +end +More +Object town_7.5 +name large city +face jcity_F.111 +type 66 +no_pick 1 +x 1 +y 1 +end +More +Object town_7.6 +name large city +face jcity_D.111 +type 66 +no_pick 1 +x 2 +y 1 +end +More +Object town_7.7 +name large city +face jcity_3.111 +type 66 +no_pick 1 +y 2 +end +More +Object town_7.8 +name large city +face jcity_B.111 +type 66 +no_pick 1 +x 1 +y 2 +end +More +Object town_7.9 +name large city +face jcity_9.111 +type 66 +no_pick 1 +x 2 +y 2 +end +Object well +face well.111 +type 66 +editor_folder exit/exit +no_pick 1 +client_type 25012 +end +Object dforest_exit +face darkforest.111 +type 66 +editor_folder exit/exit +no_pick 1 +is_floor 1 +walk_on 1 +smoothface darkforest.111 darkforest_S.111 +smoothlevel 136 +client_type 25012 +end +Object invis_exit +face exit.113 +type 66 +editor_folder exit/exit +invisible 1 +no_pick 1 +walk_on 1 +fly_on 1 +client_type 25012 +end +Object oakdoor +face oakdoor.111 +type 66 +editor_folder exit/exit +no_pick 1 +client_type 25012 +end +Object volcano_high +name high volcano +face volcano_hi.111 +type 66 +editor_folder exit/exit +no_pick 1 +slow_move 20 +blocksview 1 +client_type 25012 +end +More +Object volcano_high_2 +name high volcano +face volcano_hi.211 +type 66 +no_pick 1 +slow_move 20 +blocksview 1 +x 1 +end +More +Object volcano_high_3 +name high volcano +face volcano_hi.311 +type 66 +no_pick 1 +slow_move 20 +blocksview 1 +y 1 +end +More +Object volcano_high_4 +name high volcano +face volcano_hi.411 +type 66 +no_pick 1 +slow_move 20 +blocksview 1 +x 1 +y 1 +end +Object ladder_down +name ladder going down +face ladder_down.111 +type 66 +editor_folder exit/Ladder +no_pick 1 +client_type 25012 +end +Object ladder_bi_up +name ladder going up +face ladder2_up.111 +type 66 +editor_folder exit/Ladder +no_pick 1 +client_type 25012 +end +Object ladder_up +name ladder going up +face ladder_up.111 +type 66 +editor_folder exit/Ladder +no_pick 1 +client_type 25012 +end +Object ladder_bi_down +name ladder going down +face ladder2_do.111 +type 66 +editor_folder exit/Ladder +no_pick 1 +client_type 25012 +end +Object volcano_low +name volcano +face volcano_lo.111 +type 66 +editor_folder exit/exit +no_pick 1 +slow_move 15 +blocksview 1 +client_type 25012 +end +More +Object volcano_low_2 +name volcano +face volcano_lo.211 +type 66 +no_pick 1 +slow_move 15 +blocksview 1 +x 1 +end +Object perm_magic_portal +name magic portal +face magic_portal.111 +type 66 +editor_folder exit/magic_portal +slaying /city/city +hp 15 +sp 19 speed 0.3 -exp 20 -value 50000 -weight 5000 -type 99 -material 8 -resist_physical 3 -editable 5120 -body_foot -2 -item_power 25 -editor_folder armour/boots +no_pick 1 +animation perm_magic_portal +client_type 25011 end -Object levitationboots -name levitation boots -name_pl levitation boots -client_type 290 -nrof 1 -face lev_boots.111 -value 35000 -weight 2500 -type 99 -material 8 -resist_physical 3 -flying 1 -editable 5120 -body_foot -2 -item_power 1 -map_layer item -editor_folder armour/boots +Object magic_portal +face magic_portal.11L +type 66 +editor_folder exit/magic_portal +slaying /city/city +hp 15 +sp 19 +speed 0.3 +no_pick 1 +animation magic_portal +is_used_up 1 +food 59 +changing 1 +client_type 25011 end -Object low_boots -name shoes -name_pl shoes -client_type 291 -face low_boots.111 -value 25 -weight 2000 -nrof 1 -ac 1 -resist_physical 1 -type 99 -material 8 -editable 1024 -body_foot -2 -gen_sp_armour 1 -editor_folder armour/boots +Object chole_1 +name hole in the ground +face chole_1.111 +type 66 +editor_folder exit/exit +no_pick 1 +client_type 25012 end -Object sandals -name sandals -name_pl sandals -client_type 291 -face sandals.111 -value 5 -weight 500 -resist_physical 1 -nrof 1 -type 99 -material 8 -editable 1024 -body_foot -2 -gen_sp_armour 1 -editor_folder armour/boots +Object chole_2 +name hole in the ground +face chole_2.111 +type 66 +editor_folder exit/exit +no_pick 1 +client_type 25012 end -Object speedboots -name speed boots -name_pl speed boots -client_type 290 -nrof 1 -exp 6 -face speedboots.111 -animation speedboots +Object whirlwind_exit +name whirl wind +face stalkergen.111 +type 66 +editor_folder exit/exit speed 0.2 -value 50000 -weight 5000 -type 99 -material 8 -resist_physical 3 -editable 5120 -body_foot -2 -item_power 6 -editor_folder armour/boots +no_pick 1 +animation whirlwind_exit +walk_on 1 +fly_on 1 +client_type 25012 end -Object bracers_ac -nrof 1 -name bracers -name_pl bracers -client_type 311 -type 104 -face bracers_ac.111 -ac 1 -value 1000 -material 2 -weight 3000 -editable 1024 -body_wrist -2 -editor_folder armour/bracers +Object fogexit +name mysterous fog +face fog.111 +type 66 +editor_folder exit/exit +speed 0.2 +no_pick 1 +animation fogexit +walk_on 1 +fly_on 1 +client_type 25012 end -Object bracers_dex -nrof 1 -name bracers -name_pl bracers -client_type 311 -title of dexterity -face bracersdex.111 -type 104 -Dex 2 -value 65000 -weight 3000 -editable 5120 -body_wrist -2 -item_power 2 -editor_folder armour/bracers +Object pentagram_111 +name pentagram +face pentagram.111 +type 41 +editor_folder exit/Pentagram +speed 0 +activate_on_push 1 +activate_on_release 1 +no_pick 1 end -Object cloak -name cloak -name_pl cloaks -client_type 281 -type 87 -face cloak.111 -ac 0 -weight 5000 -value 40 -material 136 -editable 1024 -nrof 1 -body_shoulder -1 -editor_folder armour/cloak +More +Object pentagram_112 +name pentagram +face pentagram.112 +type 41 +speed 0 +activate_on_push 1 +activate_on_release 1 +no_pick 1 +x 1 end -Object magic_resist -name Cloak of Magic Resistance -name_pl Cloaks of Magic Resistance -client_type 280 -nrof 1 -type 87 -face magic_resist.111 -ac 0 -weight 5000 -value 220000 -startequip 1 -no_steal 1 -material 128 -materialname astolare -resist_magic 95 -editable 5120 -body_shoulder -1 -item_power 4 -editor_folder armour/cloak +More +Object pentagram_113 +name pentagram +face pentagram.113 +type 41 +speed 0 +activate_on_push 1 +activate_on_release 1 +no_pick 1 +x 2 end -Object oilskin -name oilskin cloak -name_pl oilskin cloaks -client_type 280 -type 87 -face oilskin.111 -Dex -1 -ac 1 -resist_physical 3 -weight 1000 -value 120000 -material 8 -editable 5120 +More +Object pentagram_121 +name pentagram +face pentagram.121 +type 41 +speed 0 +activate_on_push 1 +activate_on_release 1 +no_pick 1 +y 1 +end +More +Object pentagram_122 +name pentagram +face pentagram.122 +type 41 +speed 0 +activate_on_push 1 +activate_on_release 1 +no_pick 1 +x 1 +y 1 +end +More +Object pentagram_123 +name pentagram +face pentagram.123 +type 41 +speed 0 +activate_on_push 1 +activate_on_release 1 +no_pick 1 +x 2 +y 1 +end +More +Object pentagram_131 +name pentagram +face pentagram.131 +type 41 +speed 0 +activate_on_push 1 +activate_on_release 1 +no_pick 1 +y 2 +end +More +Object pentagram_132 +name pentagram +face pentagram.132 +type 41 +speed 0 +activate_on_push 1 +activate_on_release 1 +no_pick 1 +x 1 +y 2 +end +More +Object pentagram_133 +name pentagram +face pentagram.133 +type 41 +speed 0 +activate_on_push 1 +activate_on_release 1 +no_pick 1 +x 2 +y 2 +end +Object hole +face hole1.111 +type 66 +editor_folder exit/exit +no_pick 1 +is_floor 1 +smoothlevel 10 +smoothface hole1.111 grass_S.111 +client_type 25012 +end +Object sewer_access +name sewer +face sewer_access.111 +type 66 +editor_folder exit/exit +msg +You open the sewer access +grid and jump down. +My god, you are stinking! +endmsg +no_pick 1 +client_type 25012 +end +Object sewer_access2 +name sewer +face sewer_access.112 +type 66 +editor_folder exit/exit +msg +You open the sewer access +grid and jump down. +My god, you are stinking! +endmsg +no_pick 1 +client_type 25012 +end +Object ruins +face ruins.111 +type 66 +editor_folder exit/exit +no_pick 1 +client_type 25012 +end +Object archway +face archwood.111 +type 66 +editor_folder exit/exit +no_pick 1 +client_type 25012 +end +Object archway_green +face archgreen.111 +type 66 +editor_folder exit/exit +no_pick 1 +client_type 25012 +end +Object archway_gold +face archgold.111 +type 66 +editor_folder exit/exit +no_pick 1 +client_type 25012 +end +Object archway_tree +face archtree.111 +type 66 +editor_folder exit/exit +no_pick 1 +client_type 25012 +end +Object exit +face exit.111 +type 66 +editor_folder exit/exit +speed 0.5 +no_pick 1 +animation exit +walk_on 1 +fly_on 1 +client_type 25012 +end +Object teleporter +face teleporter.111 +type 41 +editor_folder exit/exit +speed 0.1 +activate_on_push 1 +activate_on_release 1 +no_pick 1 +animation teleporter +end +Object stair3_ystone_up +name stairs going up +face stair3_ystone_up.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair_3_up +name stairs going up +face stair3_up.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair2_down +name stairs going down +face stair2_do.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair3_gstone_do +name stairs going down +face stair3_gstone_do.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair2_up +name stairs going up +face stair2_up.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair3_gstone_up +name stairs going up +face stair3_gstone_up.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair_down +name stairs going down +face stair_down.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair_up +name stairs going up +face stair_up.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair_up_1 +name stairs going up +face stair_up_1.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair_up_2 +name stairs going up +face stair_up_2.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair_up_3 +name stairs going up +face stair_up_3.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair_up_4 +name stairs going up +face stair_up_4.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair3_ystone_do +name stairs going down +face stair3_ystone_do.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair_3_down +name stairs going down +face stair3_do.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair_down_1 +name stairs going down +face stair_down_1.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair_down_2 +name stairs going down +face stair_down_2.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair_down_3 +name stairs going down +face stair_down_3.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object stair_down_4 +name stairs going down +face stair_down_4.111 +type 66 +editor_folder exit/Up_down +no_pick 1 +client_type 25012 +end +Object booze +face booze.111 +type 54 +editor_folder food/food +on_use_yield boozebottle_empty +food 100 nrof 1 -resist_acid 70 -magic -4 -damned 1 -body_shoulder -1 -editor_folder armour/cloak +material 32 +value 5 +weight 6500 +identified 1 +name_pl boozes +client_type 611 +slaying vial_poison:poison end -Object serp_cloak -name serpent cloak -name_pl serpent cloaks -client_type 280 -type 87 -face serp_cloak.111 -ac 1 -weight 700 -resist_poison 30 -value 900 -material 8 -materialname snakeskin -editable 5120 +Object apple_half +name apple halve +face apple_half.111 +type 6 +editor_folder food/food +name_pl apple halves +food 12 nrof 1 -body_shoulder -1 -item_power 2 -editor_folder armour/cloak +need_an 1 +material 32 +value 1 +weight 50 +identified 1 +client_type 601 +slaying b_slicingknife:2 apple_fourth end -Object b_gauntlets +Object apple_fourth +name apple fourth +face apple_fourth.111 +type 6 +editor_folder food/food +name_pl apple fourths +food 6 nrof 1 -name gauntlets -client_type 305 -face b_gauntlet_s.111 -type 100 -resist_physical 2 -value 6 -nrof 1 -material 2 -materialname bronze -weight 1800 -editable 1024 -body_hand -2 -editor_folder armour/gauntlets +need_an 1 +material 32 +value 1 +weight 25 +identified 1 +client_type 601 +slaying b_slicingknife:2 apple_eighth end -Object gauntlets +Object apple_eighth +name apple eighth +face apple_eighth.111 +type 6 +editor_folder food/food +name_pl apple eighths +food 3 nrof 1 -name gauntlets -client_type 305 -face gauntlet_s.111 -type 100 -resist_physical 3 -value 25 -nrof 1 -material 2 -weight 1800 -editable 1024 -body_hand -2 -editor_folder armour/gauntlets +need_an 1 +material 32 +value 1 +weight 12 +identified 1 +client_type 601 end -Object gauntlets_dex +Object cheeseburger +face ch_burger.111 +type 6 +editor_folder food/food +food 350 nrof 1 -name gauntlets -client_type 305 -title of dexterity -face gauntlet_s.111 -type 100 -Dex 2 -resist_physical 3 -value 65000 -material 2 -weight 1800 -editable 5120 -body_hand -2 -item_power 1 -editor_folder armour/gauntlets +material 32 +value 10 +weight 6500 +identified 1 +client_type 601 end -Object gauntlets_str +Object waybread +face waybread.111 +type 6 +editor_folder food/food +food 500 nrof 1 -name gauntlets -name_pl gauntlets -client_type 305 -title of strength -face gauntlet_s.111 -type 100 -Str 1 -resist_physical 3 -value 65000 -material 2 -weight 2000 -editable 5120 -body_hand -2 -item_power 0 -editor_folder armour/gauntlets +material 32 +value 30 +weight 1000 +identified 1 +name_pl waybreads +client_type 601 end -Object gloves +Object apple +face apple.111 +type 6 +editor_folder food/food +food 25 nrof 1 -name gloves -client_type 301 -face gloves.111 -type 100 -resist_physical 1 -nrof 1 -value 4 -material 8 +need_an 1 +material 32 +value 2 weight 100 -editable 1024 -body_hand -2 -editor_folder armour/gauntlets +identified 1 +name_pl apples +client_type 601 +slaying b_slicingknife:2 apple_half end -Object gloves_b +Object chocolate +face chocolate.111 +type 6 +editor_folder food/food +food 50 nrof 1 -name gloves -client_type 301 -face gloves_b.111 -type 100 -resist_physical 1 -nrof 1 -value 64 -material 8 -materialname black leather +material 32 +value 10 weight 100 -editable 1024 -body_hand -2 -editor_folder armour/gauntlets +identified 1 +name_pl chocolates +client_type 601 end -Object gloves_w +Object water +face water.111 +type 54 +editor_folder food/food +on_use_yield wbottle_empty +food 5 nrof 1 -name gloves -client_type 301 -face gloves_w.111 -type 100 -resist_physical 1 -Cha 1 -resist_blind 2 -nrof 1 -value 6000 -material 8 -materialname white leather -weight 100 -editable 1024 -body_hand -2 -editor_folder armour/gauntlets +material 32 +value 5 +weight 1500 +name_pl waters +client_type 611 +slaying vial_poison:water_poison end -Object gloves_w_l +Object orcchop +name orc chop +face orcchop.111 +type 6 +editor_folder food/food +need_an 1 +food 10 nrof 1 -name gloves -client_type 301 -face gloves_w.111 -type 100 -resist_physical 20 -Cha 1 -resist_blind 20 -title of light -nrof 1 -value 42000 -material 2 -materialname white steel -weight 200 -editable 1024 -body_hand -2 -editor_folder armour/gauntlets +material 32 +value 1 +weight 650 +identified 1 +name_pl orc chops +client_type 624 end -Object god_finger +Object food +face food.111 +type 6 +editor_folder food/food +food 200 nrof 1 -name God Finger -name_pl God Fingers -client_type 300 -type 100 -face god_finger.111 -animation god_finger -speed .1 -Str 2 -Dex -1 -resist_physical 3 -dam +3 -make_invisible 1 -value 120000 -material 2 -weight 1800 -editable 5120 -body_hand -2 -item_power 2 -editor_folder armour/gauntlets +material 32 +value 10 +weight 6500 +identified 1 +name_pl foods +client_type 601 end -Object shining_finger +Object leg_mutton +face food.111 +type 6 +editor_folder food/food +food 150 nrof 1 -name Shining Finger -name_pl Shining Fingers -client_type 300 -type 100 -face shining_finger.111 -animation shining_finger -speed .1 -Str 2 -resist_physical 3 -dam +3 -value 120000 -material 2 -weight 1800 -editable 5120 -body_hand -2 -item_power 1 -editor_folder armour/gauntlets +material 32 +value 50 +weight 1500 +identified 1 +name_pl legs of mutton +name_pl leg of mutton +client_type 601 end -Object girdle_strcon +Object cake +face cake.111 +type 6 +editor_folder food/food +food 125 nrof 1 -type 113 -name girdle -name_pl girdles -client_type 321 -title of fighting -face gir_strcon.111 -animation girdle_strcon -speed 0.1 -Str 1 -Con 1 -weight 2500 -value 75000 -material 8 -editable 5120 -body_waist -1 -item_power 1 -editor_folder armour/girdle +material 32 +value 8 +weight 3000 +identified 1 +name_pl cakes +client_type 601 end -Object girdle_con +Object s_weasel +name sizzling weasel on a stick +face s_weasel.111 +type 6 +editor_folder food/food +food 30 nrof 1 -type 113 -name girdle -name_pl girdles -client_type 321 -title of constitution -face girdle_con.111 -animation girdle_con -speed 0.1 -Con 2 -weight 2500 -value 85000 -material 8 -editable 5120 -body_waist -1 -item_power 1 -editor_folder armour/girdle +material 32 +value 5 +weight 10 +identified 1 +name_pl sizzling weasels on a stick +client_type 601 end -Object girdle_dam +Object blackroot +name blackroot +face blackroot.111 +type 6 +editor_folder food/food +food 15 nrof 1 -type 113 -name girdle -name_pl girdles -client_type 321 -title of damage -face girdle_dam.111 -animation girdle_dam -speed 0.1 -dam 10 -weight 2500 -value 70000 -material 8 -editable 5120 -body_waist -1 -item_power 1 -editor_folder armour/girdle +material 32 +value 300 +weight 300 +identified 1 +name_pl blackroot +client_type 601 end -Object girdle_str +Object uf6 +name uranium hexafluoride gas +face uf6.111 +type 54 +editor_folder food/food +on_use_yield wbottle_empty +food 1 nrof 1 -type 113 -name girdle -name_pl girdles -client_type 321 -title of strength -face girdle_str.111 -animation girdle_str -speed 0.1 -Str 2 -weight 2500 -value 80000 -material 8 -editable 5120 -body_waist -1 -item_power 1 -editor_folder armour/girdle +material 32 +value 155 +weight 11500 +name_pl uranium hexafluoride gas +client_type 611 end -Object a_helmet -name helmet -name_pl helmets -client_type 271 +Object bag_popcorn +name bag of popcorn +face bag_popcorn.111 +type 6 +editor_folder food/food +food 50 nrof 1 -type 34 -face a_helmet.111 -weight 5000 -ac 1 -resist_physical 5 -value 14 -material 2 -editable 1024 -body_head -1 -gen_sp_armour 5 -editor_folder armour/helmet +material 32 +value 6 +weight 250 +identified 1 +name_pl bags of popcorn +client_type 601 end -Object b_full_helmet +Object poison +name booze +face booze.111 +type 7 +editor_folder food/food +on_use_yield boozebottle_empty nrof 1 -name full helmet -name_pl full helmets -client_type 271 -type 34 -face b_fullhelmet.111 -ac 1 -resist_physical 5 -weight 12000 -value 4 -material 2 -materialname bronze -editable 1024 -body_head -1 -gen_sp_armour 10 -editor_folder armour/helmet +material 32 +weight 6500 +identified 0 +name_pl boozes +client_type 611 +cursed 1 +known_cursed 0 +title of poison end -Object b_helmet -name helmet -name_pl helmets -client_type 271 +Object wine_poison +name bottle of wine +face wine.111 +type 7 +editor_folder food/food +on_use_yield winebottle_empty +food 75 nrof 1 -type 34 -face b_helmet.111 -weight 5000 -ac 1 -resist_physical 3 -value 4 -material 2 -materialname bronze -editable 1024 -body_head -1 -gen_sp_armour 5 -editor_folder armour/helmet +material 36 +value 10 +weight 1000 +identified 0 +name_pl bottles of wine +client_type 611 +cursed 1 +known_cursed 0 +title of poison end -Object b_horned_helmet +Object w_glass_poison +name glass of wine +face w_glass.111 +type 7 +editor_folder food/food +food 10 nrof 1 -name horned helmet -name_pl horned helmets -client_type 271 -type 34 -face b_hornhelmet.111 -ac 1 -resist_physical 1 -weight 6000 -value 3 -material 18 -materialname bronze -editable 1024 -body_head -1 -gen_sp_armour 2 -editor_folder armour/helmet +material 36 +value 2 +weight 1000 +identified 0 +name_pl glasses of wine +client_type 611 +cursed 1 +known_cursed 0 +title of poison end -Object bighorned_helmet +Object water_poison +face water.111 +type 7 +editor_folder food/food +on_use_yield wbottle_empty +food 5 nrof 1 -name horned helmet -name_pl horned helmets -client_type 271 -type 34 -face bighorn_he.111 -ac 1 -resist_physical 5 -weight 10000 -value 22 -material 18 -editable 1024 -body_head -1 -gen_sp_armour 3 -editor_folder armour/helmet +material 32 +value 5 +weight 1500 +name_pl waters +client_type 611 +identified 0 +cursed 1 +known_cursed 0 +title of poison end -Object crown -name crown +Object tomato +name tomato +face tomato.111 +type 6 +editor_folder food/food +food 50 nrof 1 -face crown.111 -type 34 -material 2 -resist_physical 3 -weight 12300 -value 1700 -editable 128 -name_pl crowns -client_type 271 -body_head -1 -editor_folder armour/helmet +material 32 +value 7 +weight 1000 +identified 1 +name_pl tomatoes +client_type 601 end - -Object crown_r -name crown +Object tomato_big +name very large tomato +face tomato_big.111 +type 6 +editor_folder food/food +food 200 nrof 1 -face crown_r.111 -type 34 -material 2 -resist_physical 3 -weight 12300 -value 1700 -editable 128 -name_pl crowns -client_type 271 -body_head -1 -editor_folder armour/helmet +material 32 +value 14 +weight 1000 +identified 1 +name_pl very large tomatoes +client_type 601 end - -Object crown_gray -name crown +Object dragon_steak +name steak +face drag_steak.111 +type 72 +editor_folder food/food +food 400 nrof 1 -face crown_gray.111 -type 34 -material 2 -resist_physical 3 -weight 12300 -value 1700 -editable 128 -name_pl crowns -client_type 271 -body_head -1 -editor_folder armour/helmet +material 32 +value 10 +weight 5 +identified 1 +name_pl steaks +client_type 624 end - -Object crown_white -name crown +Object orange +name orange +face orange.111 +type 6 +editor_folder food/food +food 25 nrof 1 -face crown_white.111 -type 34 -material 2 -resist_physical 3 -weight 12300 -value 1700 -editable 128 -name_pl crowns -client_type 271 -body_head -1 -editor_folder armour/helmet +need_an 1 +material 32 +value 2 +weight 100 +identified 1 +name_pl oranges +client_type 601 end - -Object crown_dark -name crown +Object coffee +name cup of coffee +face coffee.111 +type 6 +editor_folder food/food +on_use_yield coffee_empty +food 10 nrof 1 -face crown_dark.111 -type 34 -material 2 -resist_physical 3 -weight 12300 -value 1700 -editable 128 -name_pl crowns -client_type 271 -body_head -1 -editor_folder armour/helmet +material 32 +value 1 +weight 100 +identified 1 +name_pl cups of coffee +client_type 601 end -Object eyeglasses +Object mint +name mint sprig +face mint.111 +type 6 +editor_folder food/food +food 5 nrof 1 -name eye glasses -client_type 275 -type 34 -face eyeglasses.111 -weight 120 -value 1000 -Dex 2 -Cha -2 -material 4 -materialname glass -editable 1024 -body_head -1 -editor_folder armour/helmet +material 32 +value 5 +weight 100 +name_pl mint sprigs +client_type 601 end -Object full_helmet +Object roast_bird +name roast bird +face roast_bird.111 +type 6 +editor_folder food/food +food 450 nrof 1 -name full helmet -name_pl full helmets -client_type 271 -type 34 -face fullhelmet.111 -ac 1 -resist_physical 10 -weight 12000 -value 16 -material 2 -editable 1024 -body_head -1 -gen_sp_armour 10 -editor_folder armour/helmet +material 32 +value 40 +weight 7500 +identified 1 +name_pl roast birds +client_type 601 end -Object helmet -name helmet -name_pl helmets -client_type 271 +Object rose_pink +name pink rose +face rose_pink.111 +type 6 +editor_folder food/food +food 5 nrof 1 -type 34 -face helmet.111 -weight 5000 -ac 1 -resist_physical 5 -value 14 -material 2 -editable 1024 -body_head -1 -gen_sp_armour 5 -editor_folder armour/helmet +material 32 +value 60 +weight 2 +name_pl pink roses +client_type 601 end -Object helmet_of_brilliance -name helmet -name_pl helmets -client_type 270 +Object rose_red +name red rose +face rose_red.111 +type 6 +editor_folder food/food +food 5 nrof 1 -title of brilliance -face helmet_bri.111 -type 34 -weight 7000 -ac 2 -resist_physical 5 -value 95000 -Int 2 -Pow 2 -sp 1 -editable 5120 -body_head -1 -item_power 5 -editor_folder armour/helmet +material 32 +value 80 +weight 2 +name_pl red roses +client_type 601 end -Object helmet_of_xrays -name helmet -name_pl helmets -client_type 270 +Object rose_white +name white rose +face rose_wh.111 +type 6 +editor_folder food/food +food 5 nrof 1 -title of xray vision -face helmetxray.111 -animation helmet_of_xrays -speed 0.05 -type 34 -weight 6000 -ac 2 -resist_physical 5 -value 70000 -material 2 -xrays 1 -editable 5120 -body_head -1 -item_power 3 -editor_folder armour/helmet +material 32 +value 45 +weight 2 +name_pl white roses +client_type 601 end -Object horned_helmet +Object rose_yellow +name yellow rose +face rose_yel.111 +type 6 +editor_folder food/food +food 5 nrof 1 -name horned helmet -name_pl horned helmets -client_type 271 -type 34 -face hornhelmet.111 -ac 1 -resist_physical 2 -weight 6000 -value 12 -material 18 -editable 1024 -body_head -1 -gen_sp_armour 2 -editor_folder armour/helmet +material 32 +value 45 +weight 2 +name_pl yellow roses +client_type 601 end -Object kog -name Kabuto of Geisya -name_pl Kabutos of Geisya -client_type 270 +Object rose_black +name black rose +face rose_black.111 +type 6 +editor_folder food/food +food 5 nrof 1 -type 34 -face kog.111 -Wis 1 -Cha 2 -Int 1 -weight 2000 -ac 3 -resist_physical 10 -value 100000 -material 2 -editable 1024 -body_head -1 -gen_sp_armour 5 -item_power 4 -editor_folder armour/helmet +material 32 +value 160 +weight 2 +name_pl black roses +client_type 601 end -Object turban -name turban -name_pl turbans -client_type 272 +Object mandrake_root +name mandrake root +face root.111 +type 6 +editor_folder food/food +food 15 nrof 1 -type 34 -face turban.111 -weight 500 -resist_physical 1 -value 8 -material 128 -editable 1024 -body_head -1 -gen_sp_armour 1 -editor_folder armour/helmet +material 32 +value 300 +weight 300 +identified 1 +name_pl mandrake roots +client_type 601 end -Object wig -name wig -name_pl wigs -client_type 273 +Object clover +face clover.111 +type 6 +editor_folder food/food +food 5 nrof 1 -type 34 -face wig.111 -weight 500 -Cha 1 -value 140 material 32 -editable 1024 -body_head -1 -editor_folder armour/helmet +value 5 +weight 100 +name_pl clovers +client_type 601 end -Object wiz_hat -name Wizard Hat -name_pl Wizard Hats -client_type 270 +Object wine +name bottle of wine +face wine.111 +type 54 +editor_folder food/food +on_use_yield winebottle_empty +food 75 nrof 1 -type 34 -face wiz_hat.111 -animation wiz_hat -speed 0.1 -last_sp 12 -ac 1 -Int 2 -sp 4 -resist_fire 15 -resist_cold 15 -resist_drain 30 -resist_slow 30 -resist_paralyze 30 +material 36 +value 10 weight 1000 -value 50000 -material 128 -editable 5120 -body_head -1 -item_power 10 -editor_folder armour/helmet +identified 1 +name_pl bottles of wine +client_type 611 +slaying vial_poison:wine_poison end -Object Pdragon_mail -name Power Dragon Mail -name_pl Power Dragon Mails -client_type 251 +Object loaf +name bread +face loaf.111 +type 6 +editor_folder food/food +food 100 nrof 1 -type 16 -face Pdragonmail.111 -animation Pdragon_mail -speed 0.2 -last_sp 13 -ac 8 -material 256 -resist_physical 60 -weight 40000 -value 990000 -exp 1 -resist_fire 50 -resist_electricity 30 -magic 4 -editable 5120 +material 32 +value 5 +weight 3000 identified 1 -body_torso -1 -gen_sp_armour 9 -item_power 12 -editor_folder armour/mail +name_pl breads +client_type 601 end -Object b_plate_mail +Object haggis +name haggis +face haggis.111 +type 6 +editor_folder food/food +food 500 nrof 1 -name plate mail -name_pl plate mails -client_type 252 -type 16 -face b_plate_mail.111 -last_sp 7 -material 2 -materialname bronze -ac 5 -resist_physical 20 -weight 100000 -value 25 -editable 1024 -body_torso -1 -gen_sp_armour 30 -editor_folder armour/mail +material 32 +value 80 +weight 8000 +identified 1 +name_pl haggises +client_type 601 end -Object b_scale_mail +Object mushroom_1 +name mushroom +face mushroom_1.111 +type 6 +editor_folder food/food +food 50 nrof 1 -name scale mail -name_pl scale mails -client_type 253 -type 16 -face b_scale_mail.111 -last_sp 9 -material 8 -materialname bronze -ac 3 -resist_physical 10 -weight 20000 -value 8 -editable 1024 -body_torso -1 -gen_sp_armour 10 -editor_folder armour/mail +material 32 +value 5 +weight 100 +name_pl mushrooms +client_type 601 end -Object chain_mail +Object mushroom_2 +name mushroom +face mushroom_2.111 +type 6 +editor_folder food/food nrof 1 -name chain mail -name_pl chain mails -client_type 253 -type 16 -face chainmail.111 -last_sp 10 -material 2 -ac 4 -resist_physical 30 -weight 60000 -value 75 -editable 1024 -body_torso -1 -gen_sp_armour 15 -editor_folder armour/mail +material 32 +value 6 +food 55 +weight 100 +name_pl mushrooms +client_type 601 end -Object dragon_mail -name dragon mail -name_pl dragon mails -client_type 251 +Object mushroom_3 +name mushroom +face mushroom_3.111 +type 6 +editor_folder food/food +food 60 nrof 1 -type 16 -face dragonmail.111 -last_sp 13 -ac 6 -resist_physical 50 -material 2048 -materialname dragonscale -weight 60000 -value 50000 -resist_fire 40 -magic 3 -editable 5120 -identified 1 -body_torso -1 -gen_sp_armour 9 -item_power 5 -editor_folder armour/mail +material 32 +value 7 +weight 50 +name_pl mushrooms +client_type 601 end -Object dress1 -name dress -name_pl dresses -client_type 255 +Object pear +face pear.111 +type 6 +editor_folder food/food +food 25 nrof 1 -type 16 -face dress1.111 -resist_physical 1 -last_sp 5 -Cha 2 -ac 1 -weight 10000 -value 10000 -material 128 -editable 1024 -body_torso -1 -editor_folder armour/mail +material 32 +value 2 +weight 100 +identified 1 +name_pl pears +client_type 601 end -Object dress2 -name dress -name_pl dresses -client_type 255 +Object pipeweed +name pipeweed +face pipeweed.111 +type 6 +editor_folder food/food +food 5 nrof 1 -type 16 -face dress2.111 -last_sp 8 -ac 1 -Cha 1 -weight 5000 -value 3000 -material 128 -editable 1024 -body_torso -1 -editor_folder armour/mail +material 32 +value 300 +weight 32 +name_pl pipeweed +client_type 601 end -Object dress3 -name dress -name_pl dresses -client_type 255 +Object cabbage +face cabbage.111 +type 6 +editor_folder food/food +food 80 nrof 1 -type 16 -face dress3.111 -last_sp 8 -Cha 1 -weight 4500 -value 1000 -material 128 -editable 1024 -body_torso -1 -editor_folder armour/mail +material 32 +value 4 +weight 1500 +identified 1 +name_pl cabbages +client_type 601 end -Object elven_robe -name Elven Robe -name_pl Elven Robes -client_type 256 +Object carrot +name carrots +face carrot.111 +type 6 +editor_folder food/food +food 20 nrof 1 -type 16 -face elven_robe.111 -last_sp 12 -ac 3 -stealth 1 -resist_confusion 60 -Dex 4 -magic 1 -food 4 -weight 5000 -value 3000 -material 128 -editable 5120 -body_torso -1 -item_power 13 -editor_folder armour/mail +material 32 +value 1 +weight 100 +identified 1 +name_pl carrots +client_type 601 end -Object gale -name Gale Armour -name_pl Gale Armours -client_type 250 +Object w_glass +name glass of wine +face w_glass.111 +type 54 +editor_folder food/food +on_use_yield w_glass_empty +food 10 nrof 1 -face gale.111 -Dex 2 -ac 4 -resist_physical 40 -speed 2.000000 -type 16 -resist_electricity 30 -material 8 -value 220000 -weight 10000 -last_sp 50 -editable 5120 -body_torso -1 -item_power 4 -editor_folder armour/mail +material 36 +value 2 +weight 1000 +identified 1 +name_pl glasses of wine +client_type 611 +slaying vial_poison:w_glass_poison end -Object lapron -name apron -name_pl aprons -client_type 257 +Object onion +name onion +face onion.111 +type 6 +editor_folder food/food +food 50 nrof 1 -type 16 -face lapron.111 -last_sp 11 -ac 1 -resist_physical 5 -weight 20000 -nrof 1 -value 10 -material 8 -editable 1024 -body_torso -1 -editor_folder armour/mail +need_an 1 +material 32 +value 2 +weight 100 +identified 1 +name_pl onions +client_type 601 end -Object leather_armour +Object potato +name potatoes +face potato.111 +type 6 +editor_folder food/food +food 200 nrof 1 -name armour -name_pl armours -client_type 254 -type 16 -face leather_ar.111 -last_sp 13 -ac 2 -resist_physical 10 -weight 20000 -value 40 -material 8 -editable 1024 -body_torso -1 -gen_sp_armour 8 -editor_folder armour/mail +material 32 +value 7 +weight 4000 +identified 1 +name_pl potatoes +client_type 601 end -Object mithril_chainmail +Object gen_mushroom +name mouldy patch +face gen_mushroom.111 +editor_folder food/food +randomitems random_mushroom +no_pick 1 +alive 1 +exp 1 +level 1 +ac 25 +hp 1 +maxhp 1 +speed -1.0 +invisible 1 +is_used_up 1 +end +Object fishfood +name fish +face fishfood.111 +type 6 +editor_folder food/food +food 100 nrof 1 -name mithril chainmail -name_pl mithril chainmails -client_type 250 -type 16 -material 2 -materialname mithril -face mithril_ar.111 -animation mithril_chainmail -speed 0.1 -ac 6 -resist_physical 35 -last_sp 18 -weight 15000 -value 8000 -editable 5120 -body_torso -1 -gen_sp_armour 5 -item_power 1 -editor_folder armour/mail +material 32 +value 4 +weight 3500 +identified 1 +name_pl fishes +client_type 601 end -Object mithril_ar_ele +Object devourers_avatar_info +name avatar +type 8 +editor_folder gods/supernatural +invisible 1 +other_arch devourers_avatar +end +Object Valriel +face archangel.115 +type 50 +editor_folder gods/supernatural +msg +Lord of Angels, Duke of the Heavens, Healer and Protector +endmsg +title Gorokh +slaying demon +race angel +animation archangle +Str 30 +Con 30 +Dex 30 +Int 30 +Wis 30 +Pow 30 +is_animated 1 +monster 1 +alive 1 +attacktype 4194304 +path_attuned 1025 +path_denied 393216 +resist_confusion 20 +resist_blind 100 +resist_fear 100 +ac -7 +wc -1 +hp 350 +maxhp 350 +dam 50 +level 15 +speed 0.25 +can_cast_spell 1 +can_use_armour 1 +can_use_weapon 1 +can_use_shield 1 +exp 1 +weight 100000 +randomitems Valriel +end +Object gorokh_general_info +name message +type 8 +editor_folder gods/supernatural +msg +You are filled with a desire to slay all +angels. +endmsg +invisible 1 +end +Object Gorokh +face devil.111 +type 50 +editor_folder gods/supernatural +msg +Demon King, Duke of Hell, Temptor and Tormentor +endmsg +title Valriel +slaying angel +race demon +animation devil +is_animated 1 +Str 30 +Con 30 +Dex 30 +Int 30 +Wis 30 +Pow 30 +monster 1 +alive 1 +attacktype 16384 +path_attuned 131072 +path_repelled 257 +resist_magic 30 +resist_cold -5 +resist_fear 100 +ac -5 +wc -3 +dam 50 +hp 350 +maxhp 350 +level 15 +speed 0.25 +luck -1 +last_heal -2 +last_sp -1 +can_cast_spell 1 +can_use_armour 1 +can_use_weapon 1 +can_use_shield 1 +exp 1 +weight 400000 +randomitems Gorokh +end +Object valriel_avatar_info +name avatar +type 8 +editor_folder gods/supernatural +invisible 1 +other_arch valriel_avatar +end +Object valriel_avatar +face archangel.115 +editor_folder gods/supernatural +slaying demon +race angel +animation archangle +Str 30 +Con 30 +Dex 30 +Int 30 +Wis 30 +Pow 30 +is_animated 1 +monster 1 +alive 1 +attacktype 4194305 +path_attuned 1025 +path_denied 393216 +resist_confusion 20 +resist_blind 100 +resist_fear 100 +resist_physical 50 +ac -7 +wc -1 +hp 350 +maxhp 350 +dam 40 +level 15 +speed 0.25 +can_cast_spell 1 +can_use_armour 1 +can_use_weapon 1 +can_use_shield 1 +exp 1 +weight 100000 +end +Object devourers_holy_servant_info +name holy servant +type 8 +editor_folder gods/supernatural +invisible 1 +other_arch wight +end +Object gorokh_avatar +face devil.111 +editor_folder gods/supernatural +slaying angel +race demon +animation devil +is_animated 1 +Str 30 +Con 30 +Dex 30 +Int 30 +Wis 30 +Pow 30 +monster 1 +alive 1 +attacktype 16385 +path_attuned 393216 +path_denied 1025 +resist_physical 50 +resist_fear 100 +resist_magic 20 +ac -5 +wc -3 +dam 40 +hp 350 +maxhp 350 +level 15 +speed 0.25 +can_cast_spell 1 +can_use_armour 1 +can_use_weapon 1 +can_use_shield 1 +exp 1 +weight 400000 +end +Object gorokh_avatar_info +name avatar +type 8 +editor_folder gods/supernatural +invisible 1 +other_arch gorokh_avatar +end +Object valriel_player_glow +name valriel's light +face archangel.115 +type 98 +editor_folder gods/supernatural +glow_radius 9 +startequip 1 +invisible 1 +end +Object devourers_general_info +name message +type 8 +editor_folder gods/supernatural +msg +You feel a bond with all things which are +undead. +endmsg +invisible 1 +end +Object Devourers +face grimreaper.112 +type 50 +editor_folder gods/supernatural +msg +Soul Eaters, Harbingers of Death, Nameless +Lords of the Tomb +endmsg +title Gaea +race undead +animation grimreaper +is_animated 1 +monster 1 +alive 1 +Str 30 +Con 30 +Dex 30 +Int 30 +Wis 30 +Pow 30 +attacktype 16973824 +path_attuned 393216 +path_denied 65536 +path_repelled 524547 +resist_drain 100 +resist_fear 100 +resist_deplete 100 +resist_death 100 +resist_ghosthit 50 +resist_poison 100 +resist_cold 15 +resist_fire -5 +ac -12 +wc -1 +hp 350 +maxhp 350 +dam 50 +last_eat 60 +last_heal -1 +level 15 +speed 0.35 +can_cast_spell 1 +can_use_weapon 1 +can_use_armour 1 +can_use_shield 1 +undead 1 +can_see_in_dark 1 +exp 1 +weight 1 +randomitems Devourers +end +Object valriel_general_info +name message +type 8 +editor_folder gods/supernatural +msg +You are filled with a desire to slay all +demons. +endmsg +invisible 1 +end +Object valriel_holy_servant_info +name holy servant +type 8 +editor_folder gods/supernatural +invisible 1 +other_arch angel +end +Object gorokh_holy_servant_info +name holy servant +type 8 +editor_folder gods/supernatural +invisible 1 +other_arch devil +end +Object devourers_avatar +face grimreaper.112 +editor_folder gods/supernatural +race undead +animation grimreaper +is_animated 1 +monster 1 +alive 1 +Str 30 +Con 30 +Dex 30 +Int 30 +Wis 30 +Pow 30 +attacktype 196752 +path_attuned 262144 +path_denied 590082 +path_repelled 129 +resist_death 100 +resist_deplete 100 +resist_fear 100 +resist_drain 100 +resist_fire -50 +resist_cold 50 +resist_physical 20 +ac -12 +wc -1 +hp 350 +maxhp 350 +dam 50 +last_eat -3 +last_heal -1 +level 15 +speed 0.35 +can_cast_spell 1 +can_use_weapon 1 +can_use_armour 1 +can_use_shield 1 +undead 1 +can_see_in_dark 1 +exp 1 +weight 1 +end +Object tear_gaea +name Gaea's tear +face tear.111 +type 5 +editor_folder gods/items +animation tear_gaea nrof 1 -name mithril chainmail of lightning -name_pl mithril chainmails of lightning -client_type 250 -type 16 -material 2 -materialname mithril +level 10 +speed 0.25 +sp 35 +weight 10 +name_pl Gaea's tears +client_type 650 +end +Object mithril_ar_ele_sorig +name mithril chainmail of lightning of Sorig face mithril_ar_ele.111 +type 16 +editor_folder gods/items +msg +Sorig has granted you this fine mail. It + grants great protection from electricity + and physical attacks without reducing your + mobility. Be warned that what Sorig gives, + Sorig can take away. +endmsg +nrof 1 animation mithril_ar_ele speed 0.3 ac 4 resist_physical 40 -resist_electricity 30 -Cha 1 +resist_electricity 40 +startequip 1 +Dex 1 Str 1 exp 1 -magic 3 +magic 5 +gen_sp_armour 2 last_sp 27 weight 15000 value 4000 -editable 5120 +name_pl mithril chainmails of lightning of Sorig +client_type 250 body_torso -1 -gen_sp_armour 2 -item_power 9 -editor_folder armour/mail +item_power 10 end -Object plate_mail -nrof 1 -name plate mail -name_pl plate mails -client_type 252 -type 16 +Object mail_mostrai +name Thorin's Plate Mail face plate_mail.111 -last_sp 7 -material 2 -ac 5 -resist_physical 40 -weight 100000 -value 100 -editable 1024 -body_torso -1 -gen_sp_armour 30 -editor_folder armour/mail -end -Object ring_mail -nrof 1 -name hauberk -name_pl hauberks -client_type 253 type 16 -face ring_mail.111 -last_sp 10 -material 2 -ac 4 -resist_physical 25 +editor_folder gods/items +msg +This shining plate mail is Mostrai's + gift to the bravest of his warriors. + It is highly enchanted, increasing the + strength of the wearer and protecting + against fire. +endmsg +name_pl Thorin's Plate Mails +client_type 250 +ac 3 +Str 1 +nrof 1 +startequip 1 +resist_physical 50 +resist_fire 30 weight 50000 -value 60 -editable 1024 +magic 2 +gen_sp_armour 9 +last_sp 13 body_torso -1 -gen_sp_armour 15 -editor_folder armour/mail +item_power 4 end -Object ring_mail2 +Object spear_ixalovh +name Ixalovh's spear +face spear_ixalovh.111 +type 15 +editor_folder gods/items nrof 1 -name ring mail -name_pl ring mails -client_type 253 -type 16 -face ring_mail2.111 -last_sp 11 -material 2 -ac 4 -resist_physical 20 -weight 40000 -value 85 -editable 1024 -body_torso -1 -gen_sp_armour 15 -editor_folder armour/mail +last_sp 9 +weapontype 5 +animation spear_ixalovh +speed -0.02 +Pow 1 +sp 1 +material 256 +dam 35 +weight 26500 +value 75000 +magic 12 +resist_magic 10 +resist_fire 15 +attacktype 17 +startequip 1 +name_pl Ixalovh's spears +client_type 136 +can_impale 1 +glow_radius 2 +body_arm -2 +item_power 20 +skill two handed weapons end -Object robe -name robe -name_pl robes -client_type 256 +Object shield_gaea +name Gaea's Shield of Earth +face earth_shield.111 +type 33 +editor_folder gods/items +msg +This shield is highly enchanted by the forces + of life and nature. It is a personal gift from + Gaea, to protect her beloved children. +endmsg +animation shield_gaea +is_animated 1 +ac 4 +speed 0.2 nrof 1 -type 16 -face robe.111 -last_sp 12 -ac 1 -weight 10000 -value 30 -material 128 -editable 1024 -body_torso -1 -editor_folder armour/mail +startequip 1 +resist_physical 15 +resist_fire 30 +resist_cold 30 +resist_electricity 30 +resist_ghosthit -20 +weight 20000 +name_pl Gaea's Shields of Earth +client_type 260 +body_arm -1 end -Object robe2 -name robe -name_pl robes -client_type 256 +Object bracers_gnarg +name bracers +face bracersdex.111 +type 104 +editor_folder gods/items +msg +An exceptional pair of bracers. Not only do + they provide the wearer with protection + from cold, they also increase the wearer's + damage and strength, and help heal the body + from damage. A mighty gift from Gnarg sent + to aid you in annihilating His enemies. +endmsg nrof 1 -type 16 -face robe2.111 -last_sp 12 -ac 1 -nrof 1 -weight 10000 -value 9 -material 128 -editable 1024 -body_torso -1 -editor_folder armour/mail -end -Object robe_midnight -name Midnight Robe -name_pl Midnight Robes -client_type 250 -nrof 1 -type 16 -face robe_midnight.111 -animation robe_midnight -speed 0.1 -ac 5 -Dex 1 -Int 2 -Pow 2 -resist_magic 30 -resist_fire 20 +title of strength of Wargs +Str 2 +resist_physical 30 resist_cold 20 -resist_drain 20 -resist_slow 20 -resist_paralyze 20 -resist_acid 75 -resist_ghosthit -100 -reflect_spell 1 -magic 5 -weight 5000 -value 100000 -material 128 -editable 5120 -body_torso -1 -item_power 25 -editor_folder armour/mail +Dam 15 +hp 1 +value 65000 +weight 9000 +startequip 1 +name_pl bracers +client_type 310 +body_wrist -2 end -Object scale_mail +Object glovesofsun +name Gloves of the Sun +face glovesofsun.111 +type 100 +editor_folder gods/items +msg +This pair of gloves will aid any of Gaea's + most faithful in seeing her will protected. +endmsg +name_pl Gloves of the Sun +client_type 300 nrof 1 -name scale mail -name_pl scale mails -client_type 253 -type 16 -face scale_mail.111 -last_sp 9 +animation glovesofsun +speed 0.25 material 8 +weight 900 +value 20000 +attacktype 5 +ac 1 +dam 2 +Dex 2 +wc 2 +magic 1 +startequip 1 +body_hand -2 +end +Object helmet_gnarg +name Gnarg's Orc Helmet +face bighorn_he.111 +type 34 +editor_folder gods/items +msg +This helmet good protection. From mighty + Gnarg it is. +endmsg +name_pl Gnarg's Orc Helmets +client_type 270 +Dex 1 ac 3 +nrof 1 +startequip 1 resist_physical 20 -weight 20000 -value 30 -editable 1024 -body_torso -1 -gen_sp_armour 10 -editor_folder armour/mail +resist_poison 30 +weight 7000 +gen_sp_armour 1 +body_head -1 end -Object tunic -name shirt -name_pl shirts -client_type 256 -nrof 1 -type 16 -face tunic.111 -last_sp 20 +Object horn_siren +name horn +face shellhorn1.111 +type 35 +editor_folder gods/items +msg +Putting this shell to your ear, you hear a + strange and haunting melody. +endmsg +title of the Sirens +randomitems horn_siren +level 40 +value 590 +weight 1500 +material 2 +hp 20 +maxhp 20 +speed 0.2 +name_pl horns +startequip 1 +client_type 721 +body_range -1 +end +Object pipe_lythander +name Lythander's pipe +face claypipe.111 +type 35 +editor_folder gods/items +msg +This pipe is the finest you have ever + seen. Imagine the smoke rings you + could blow with it... +endmsg +name_pl Lythander's pipes +randomitems pipe_lythander +luck 1 +material 256 +hp 60 +level 35 +maxhp 60 +speed 0.1 +value 58 +weight 40 +name_pl horns +client_type 721 +body_range -1 +startequip 1 +end +Object horn_waves +name horn +face shellhorn2.111 +type 35 +editor_folder gods/items +msg +Putting this shell to your ear, you hear + the crashing sound of ocean waves. +endmsg +title of Ocean Waves +randomitems horn_waves +level 30 +value 590 weight 1000 -nrof 1 -value 3 -material 128 -editable 1024 -body_torso -1 -editor_folder armour/mail +material 2 +hp 24 +maxhp 24 +speed 0.1 +name_pl horns +client_type 721 +startequip 1 +body_range -1 end -Object wdsm -name White Dragon Scale Mail -name_pl White Dragon Scale Mails -client_type 251 +Object burningtail +name Burning Tail of many lashings of Ruggilli +face burningtail.111 +type 15 +editor_folder gods/items nrof 1 -type 16 -face wdsm.111 -animation wdsm +last_sp 8 +weapontype 6 +animation burningtail speed 0.1 -last_sp 13 -cursed 1 +material 256 +dam 40 +weight 10000 +value 75000 +magic 15 +resist_cold 25 +resist_fire 15 +attacktype 4101 startequip 1 -no_steal 1 -ac 5 -resist_physical 45 -weight 5000 -value 220000 -resist_cold 30 -resist_fire 95 -magic -3 -editable 5120 -body_torso -1 -gen_sp_armour 9 -item_power 5 -editor_folder armour/mail +name_pl Burning Tails of many lashings of Ruggilli +client_type 100 +body_arm -1 +item_power 25 +glow_radius 3 +skill one handed weapons end -Object DShield -name Demonspawn Shield -name_pl Demonspawn Shields -client_type 260 +Object bow_lythander +name Lythander's Elven Bow +face elven_bow.111 +type 14 +editor_folder gods/items +msg +You look at this wonderful bow with + pride. It is only granted to the best + of Lythander's disciples. +endmsg +name_pl Lythander's Elven Bows +client_type 150 +race arrows +luck 1 +sp 70 +dam 30 +wc 3 nrof 1 -type 33 -material 256 -materialname abyssium -face DShield.111 -animation DShield -speed 0.2 +startequip 1 +attacktype 1 +weight 8000 +magic 5 +body_arm -2 +skill missile weapons +end +Object gaea_general_info +name message +type 8 +editor_folder gods/elemental msg - There is a evil spirit in the shield. +You are filled with a desire to slay all +undead and unnatural creatures. endmsg -Cha -3 -resist_fire 30 -resist_drain 100 -resist_ghosthit 70 -ac 3 -resist_physical 10 -weight 25000 -value 50000 -editable 5120 -body_arm -1 -item_power 5 -editor_folder armour/shield +invisible 1 ... [truncated message content] |
From: <chr...@us...> - 2006-11-12 23:56:01
|
Revision: 665 http://svn.sourceforge.net/gridarta/?rev=665&view=rev Author: christianhujer Date: 2006-11-12 15:55:36 -0800 (Sun, 12 Nov 2006) Log Message: ----------- Optimized imports. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java trunk/src/app/net/sf/gridarta/gameobject/Collector.java trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-12 23:53:21 UTC (rev 664) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-12 23:55:36 UTC (rev 665) @@ -27,8 +27,8 @@ import cfeditor.gameobject.ArchetypeParser; import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; +import cfeditor.gameobject.anim.AnimationObjects; import cfeditor.gameobject.face.FaceObjects; -import cfeditor.gameobject.anim.AnimationObjects; import cfeditor.io.CMapReader; import cfeditor.io.CMapWriter; import cfeditor.map.MapArchObject; @@ -55,8 +55,8 @@ import javax.swing.filechooser.FileFilter; import net.sf.gridarta.MainControl; import net.sf.gridarta.Size2D; +import net.sf.gridarta.gameobject.Collectable; import net.sf.gridarta.gameobject.Collector; -import net.sf.gridarta.gameobject.Collectable; import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-11-12 23:53:21 UTC (rev 664) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-11-12 23:55:36 UTC (rev 665) @@ -31,8 +31,6 @@ import static daieditor.gameobject.ArchAttribType.SPELL; import static daieditor.gameobject.ArchAttribType.ZSPELL; import daieditor.gameobject.GameObject; -import net.sf.gridarta.gameobject.NamedObject; -import net.sf.gridarta.gameobject.NamedObjects; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; @@ -95,6 +93,8 @@ import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; import net.sf.gridarta.gameobject.Archetype; +import net.sf.gridarta.gameobject.NamedObject; +import net.sf.gridarta.gameobject.NamedObjects; import net.sf.gridarta.help.Help; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-11-12 23:53:21 UTC (rev 664) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-11-12 23:55:36 UTC (rev 665) @@ -31,8 +31,6 @@ import daieditor.gameobject.ArchetypeParser; import daieditor.gameobject.ArchetypeSet; import daieditor.gameobject.GameObject; -import net.sf.gridarta.gameobject.Collectable; -import net.sf.gridarta.gameobject.Collector; import daieditor.gameobject.anim.AnimationObjects; import daieditor.gameobject.face.FaceFacade; import daieditor.gameobject.face.FaceObjects; @@ -113,6 +111,8 @@ import static javax.swing.KeyStroke.getKeyStroke; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.MainControl; +import net.sf.gridarta.gameobject.Collectable; +import net.sf.gridarta.gameobject.Collector; import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.gridarta.map.MapModelEvent; import net.sf.gridarta.map.MapModelListener; Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-11-12 23:53:21 UTC (rev 664) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-11-12 23:55:36 UTC (rev 665) @@ -49,7 +49,6 @@ import java.util.List; import javax.swing.ImageIcon; import net.sf.gridarta.gameobject.AbstractArchetypeSet; -import net.sf.gridarta.gameobject.Collectable; import net.sf.gridarta.gameobject.anim.AnimationParseException; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import net.sf.gridarta.io.IOUtils; Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java 2006-11-12 23:53:21 UTC (rev 664) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java 2006-11-12 23:55:36 UTC (rev 665) @@ -26,12 +26,12 @@ package daieditor.gameobject.anim; +import daieditor.gameobject.face.FaceFacade; import java.io.Serializable; import java.util.ArrayList; import java.util.List; +import javax.swing.ImageIcon; import net.sf.gridarta.gameobject.anim.AbstractAnimationObject; -import javax.swing.ImageIcon; -import daieditor.gameobject.face.FaceFacade; /** * A single animation object. Modified: trunk/src/app/net/sf/gridarta/gameobject/Collector.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Collector.java 2006-11-12 23:53:21 UTC (rev 664) +++ trunk/src/app/net/sf/gridarta/gameobject/Collector.java 2006-11-12 23:55:36 UTC (rev 665) @@ -1,14 +1,14 @@ package net.sf.gridarta.gameobject; -import java.util.List; +import java.io.File; +import java.io.IOException; import java.util.ArrayList; import java.util.Collection; -import java.io.File; -import java.io.IOException; +import java.util.List; import javax.swing.JFrame; +import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.Progress; import net.sf.japi.swing.ProgressDisplay; -import net.sf.japi.swing.ActionFactory; /** * A Collector is capable of iterating over a collection of {@link Collectable}s and collecting them in a separate Thread with a nice GUI. Modified: trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java 2006-11-12 23:53:21 UTC (rev 664) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java 2006-11-12 23:55:36 UTC (rev 665) @@ -1,7 +1,7 @@ package net.sf.gridarta.gameobject.anim; +import net.sf.gridarta.gameobject.NamedObject; import net.sf.gridarta.gameobject.NamedObjects; -import net.sf.gridarta.gameobject.NamedObject; import net.sf.japi.swing.ActionFactory; /** Modified: trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java 2006-11-12 23:53:21 UTC (rev 664) +++ trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java 2006-11-12 23:55:36 UTC (rev 665) @@ -1,8 +1,8 @@ package net.sf.gridarta.gameobject.face; -import net.sf.japi.swing.ActionFactory; import net.sf.gridarta.gameobject.NamedObject; import net.sf.gridarta.gameobject.NamedObjects; +import net.sf.japi.swing.ActionFactory; /** * Abstract base implementation of {@link FaceObjects}. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-13 22:48:04
|
Revision: 668 http://svn.sourceforge.net/gridarta/?rev=668&view=rev Author: christianhujer Date: 2006-11-13 14:47:26 -0800 (Mon, 13 Nov 2006) Log Message: ----------- Removed unused variables, unused variable initializes and unused variable assignments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/CAttribBitmask.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CScriptView.java trunk/crossfire/src/cfeditor/JarResources.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/io/CMapReader.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CMapArchPanel.java trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/io/CMapReader.java trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2006-11-13 22:47:26 UTC (rev 668) @@ -202,7 +202,7 @@ } // now do the joining in all four directions: - GameObject arch = null; + GameObject arch; if (map.isPointValid(x, y - 1)) { if ((arch = findArchOfJoinlist(map, x, y - 1)) != null) { newIndex = addDir(newIndex, NORTH); Modified: trunk/crossfire/src/cfeditor/CAttribBitmask.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribBitmask.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/CAttribBitmask.java 2006-11-13 22:47:26 UTC (rev 668) @@ -181,15 +181,14 @@ // is bitmask empty? if (value <= 0) { text += bitName[0]; - columns = text.length(); } else { // value too big? if (value > maxvalue) { log.warn("bitmask value " + value + " is too big."); } - boolean linebreak = false; - int linelength = 0; // length of last line + boolean linebreak; + int linelength; // length of last line for (int i = 1; i < bitName.length; i++) { if (isActive(i, value)) { Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-11-13 22:47:26 UTC (rev 668) @@ -78,8 +78,6 @@ */ CFArchTypeList() { CFArchType cfType = head; // index of CFArchType list - final boolean headLoaded = false; // true when the default type (=head) is loaded - // initialize the arrays of "special-data" bitmaskTable = new HashMap<String, CAttribBitmask>(); listTable = new HashMap<String, Vector>(); @@ -137,7 +135,7 @@ log.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': default_type element is missing!"); } else { // create a new CFArchType element - final CFArchType newType = new CFArchType(head); + new CFArchType(head); // attach the new CFArchType element to the list // if we manage to parse it properly from the file @@ -216,10 +214,8 @@ private Vector parseListFromElement(final Element root) { final Vector list = new Vector(); // list vector int num; // number for list element - String string; // string for list element Element elem; - Attribute a; final List entries = root.getChildren("entry"); for (int i = 0; entries != null && i < entries.size(); i++) { elem = (Element) entries.get(i); @@ -291,7 +287,6 @@ public void loadSpellsFromXML() { spellName = null; spellNum = null; - final int spnum = 0; // number of spells try { // open reading stream to the spells xml file @@ -305,7 +300,6 @@ // retrieve the spell data from the xml final Element root = doc.getRootElement(); Element spellElem; - Attribute a; if (root == null || !root.getName().equalsIgnoreCase("spells")) { log.warn("File '" + IGUIConstants.SPELL_FILE + "' lacks root element 'spells'."); } else { @@ -423,7 +417,7 @@ // reading spellnames one after the other, // this loop is terminated by an EOFException - int i = 0; // index for insertion in the vector + int i; // index for insertion in the vector for (int counter = 0; true; counter++) { IOUtils.readUntil(bufferedReader, "{", "}"); IOUtils.readUntil(bufferedReader, "\"", null); Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-11-13 22:47:26 UTC (rev 668) @@ -238,11 +238,9 @@ try { final String baseDir = IGUIConstants.CONFIG_DIR; final BufferedReader reader = IOUtils.createReader(baseDir, IGUIConstants.TREASURES_FILE); - String line = null; // read line of file - // read the whole file line by line TreasureTreeNode node = null; - while ((line = reader.readLine()) != null) { + for (String line; (line = reader.readLine()) != null;) { line = line.trim(); if (line.length() > 0 && !line.startsWith("#")) { // reading outside of treasurelist Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-13 22:47:26 UTC (rev 668) @@ -220,7 +220,7 @@ readGlobalSettings(); // initialize pickmap panel (needed early during the loading process) - final CPickmapPanel pickmappanel = new CPickmapPanel(); + new CPickmapPanel(); // initialize the script-editor pad ScriptEditControl.init(getMapDefaultFolder(), this); @@ -623,14 +623,14 @@ */ public void newLevelWanted(final String filename) { CMainStatusbar.getInstance().setText(" Creating new map..."); - final CNewMapDialog levelDialog = new CNewMapDialog(this, mainView, filename, CNewMapDialog.TYPE_CFMAP); + new CNewMapDialog(this, mainView, filename, CNewMapDialog.TYPE_CFMAP); CMainStatusbar.getInstance().setText(""); } /** Invoked when user wants to open a new pickmap */ public void newPickmapWanted() { CMainStatusbar.getInstance().setText(" Creating new pickmap..."); - final CNewMapDialog levelDialog = new CNewMapDialog(this, mainView, null, CNewMapDialog.TYPE_PICKMAP); + new CNewMapDialog(this, mainView, null, CNewMapDialog.TYPE_PICKMAP); CMainStatusbar.getInstance().setText(""); } @@ -930,7 +930,7 @@ // types.txt is missing! showMessage("File Missing", "The definitions-file \"types.txt\" is missing! The\nattribute interface doesn't work without that file."); } else if (arch != null && arch.getArchetypeName() != null) { - final CAttribDialog dwin = new CAttribDialog(typeList, arch, this); + new CAttribDialog(typeList, arch, this); } } @@ -1177,7 +1177,7 @@ */ void showMapProperties(final MapControl level) { if (level != null) { - final CMapPropertiesDialog dialog = new CMapPropertiesDialog(this, mainView, level); + new CMapPropertiesDialog(this, mainView, level); } } @@ -1193,7 +1193,7 @@ } void optionsWanted() { - final COptionDialog dialog = new COptionDialog(this, mainView); + new COptionDialog(this, mainView); } /** @@ -1525,7 +1525,7 @@ break; } - int rand = -1; + int rand; try { rand = Integer.parseInt(input); } catch (final NumberFormatException e) { Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-11-13 22:47:26 UTC (rev 668) @@ -767,7 +767,6 @@ * @param y map coordinates for the tile to draw */ public void paintTile(final int x, final int y) { - final int xstart, ystart, yoff; final Graphics grfx; if (isPickmap()) { grfx = getGraphics(); // graphics context for drawing in the mapview @@ -1110,14 +1109,12 @@ * @param event the occurred <code>MouseEvent</code> */ public void mouseMoved(final MouseEvent event) { - final int xstart, ystart, xp, yp, xt, yt; + final int xp, yp; final Point dragPoint = event.getPoint(); xp = (int) dragPoint.getX(); yp = (int) dragPoint.getY(); - final Point temp = renderer.getTileLocationAt(dragPoint); - // draw Mouse coordinates into the status bar (bottom of window) if (mapMousePos.x == -1 && mapMousePos.y == -1) { CMainStatusbar.getInstance().setText(" Mouse off Map"); @@ -1133,7 +1130,7 @@ * @param event the occurred <code>MouseEvent</code> */ public void mouseDragged(final MouseEvent event) { - final int xstart, ystart, xp, yp, xt, yt; + final int xp, yp; changedFlagNotify(); Point[] needRedraw = null; // array of tile coords which need to be redrawn Modified: trunk/crossfire/src/cfeditor/CScriptView.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptView.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/CScriptView.java 2006-11-13 22:47:26 UTC (rev 668) @@ -12,7 +12,6 @@ import cfeditor.gui.CloseableTabbedPane; import cfeditor.gui.ScriptManager; import java.awt.BorderLayout; -import java.awt.Component; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; @@ -251,8 +250,6 @@ dialog.setModal(true); dialog.setTitle(model.getName()); dialog.getContentPane().removeAll(); - final Component topLabel = panel; - final Component topTxtField = panel; //JTextField[] fields = new JTextField[model.getParametersCount()]; for (int i = 0; i < model.getParametersCount(); i++) { log.debug("adding parameter"); Modified: trunk/crossfire/src/cfeditor/JarResources.java =================================================================== --- trunk/crossfire/src/cfeditor/JarResources.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/JarResources.java 2006-11-13 22:47:26 UTC (rev 668) @@ -135,8 +135,8 @@ } final byte[] b = new byte[(int) size]; int rb = 0; - int chunk = 0; - while (((int) size - rb) > 0) { + int chunk; + while (size - rb > 0) { chunk = zis.read(b, rb, (int) size - rb); if (chunk == -1) { break; Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-11-13 22:47:26 UTC (rev 668) @@ -288,7 +288,6 @@ eventList.set(index, event); // save changes } else if (task == CMapArchPanel.SCRIPT_REMOVE) { // first ask for confirmation - final boolean breakpath = (event.getFilePath().length() > 15); if (JOptionPane.showConfirmDialog(panelList, "Are you sure you want to remove this \"" + eventType + "\" event which is\n" + "linked to the script: '" + event.getFilePath() + "'?\n" + "(The script file itself is not going to be deleted)", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { // remove this event from the GameObject eventList.remove(index); Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-11-13 22:47:26 UTC (rev 668) @@ -263,8 +263,6 @@ * @param fname filename */ private void parseDefFace(final String fname) { - final int x; - try { final BufferedReader myInput = new BufferedReader(new FileReader(fname)); try { @@ -276,7 +274,6 @@ while ((thisLine2 = myInput.readLine()) != null) { // hm, thats ugly, but i need to cut off the damn white spaces // for the names - String thisLine = thisLine2; /* if (thisLine2.length() > 1) { for (x = 0; x < thisLine2.length(); x++) { @@ -292,7 +289,7 @@ thisLine = thisLine2.substring(x, y+1); } */ - thisLine = thisLine2.trim(); + final String thisLine = thisLine2.trim(); // ignore all '#' lines as comment if (!thisLine.regionMatches(0, "#", 0, 1)) { @@ -466,7 +463,6 @@ */ private void addPNGFace(final String fname, final String name) { final File f = new File(fname); - final long size = f.length(); faceObjects[faceListCount] = new FaceObject(null, fname, 0, (int) f.length()); // generating the face name: @@ -540,7 +536,7 @@ } final byte[] b = new byte[1024 * 50]; - int numBytes = 0; + int numBytes; try { numBytes = fin1.read(b, 0, 50000); } catch (final IOException e) { @@ -560,7 +556,6 @@ // now write all pngs into the file progress.setLabel("Collecting Images...", faceListCount); for (int i = 0; i < faceListCount; i++) { - numBytes = 0; final FileInputStream fin2; try { Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-11-13 22:47:26 UTC (rev 668) @@ -483,7 +483,7 @@ } // Check line by line for comparison - String line = ""; + String line; String result = ""; int i; for (i = 0, j = 0; i < atxt.length(); i++) { @@ -539,16 +539,11 @@ if (!base.endsWith("\n")) { base = base.concat("\n"); // string should end with '\n' } - String line = ""; - if (!line.endsWith("\n")) { - line = line.concat("\n"); // string should end with '\n' - } - // Check line by line for comparison int i; 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 + final String line = base.substring(j, i).trim(); // get one line from base if (ignoreValues) { if (str.compareTo(line.substring(0, line.indexOf(" ") + 1)) == 0) { return line; @@ -814,7 +809,7 @@ log.debug("Applying type: " + type.getTypeName()); } - String line = null; + String line; do { line = sstream.readLine(); // read one line Modified: trunk/crossfire/src/cfeditor/io/CMapReader.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapReader.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/io/CMapReader.java 2006-11-13 22:47:26 UTC (rev 668) @@ -158,8 +158,8 @@ } } else if (thisLine.equals("end")) { objects.add(gameObject); - archflag = false; - archmore = false; + //archflag = false; + //archmore = false; if (log.isDebugEnabled()) { log.debug("LEAVE!: " + gameObject + " - " + thisLine); Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-11-13 22:47:26 UTC (rev 668) @@ -252,7 +252,7 @@ * @return true if insertion successful, false if not */ public boolean addArchToMap(String archName, final Point pos, final int intern, final boolean join, final boolean insertBelow) { - GameObject newarch, oldarch, startarch; // our new suckers (copys, not ref ptrs) + GameObject newarch; // our new suckers (copys, not ref ptrs) if (archName == null || !isPointValid(pos)) { // invalid parameter Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-11-13 22:47:26 UTC (rev 668) @@ -1076,8 +1076,6 @@ * @return true if the settings were applied, false if error occurred */ private boolean applySettings() { - final String oldArchText = gameObject.getObjectText(); // the old ArchText - final String oldMsg = gameObject.getMsgText(); // old gameObject msg final CFArchType typeStruct = typelist.getTypeOfArch(gameObject); // the type structure for this gameObject String newArchText = ""; Modified: trunk/daimonin/src/daieditor/CMapArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-11-13 22:47:26 UTC (rev 668) @@ -350,9 +350,6 @@ return; } - final String oldArchText = arch.getObjectText(); - final String oldmsg = arch.getMsgText(); - // We update all panels: name, face, msg and archText (more to come...) // the obj name: if (isNonwhitespaceText(archNameField.getText())) { // there is something in Modified: trunk/daimonin/src/daieditor/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/Spells.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/daimonin/src/daieditor/Spells.java 2006-11-13 22:47:26 UTC (rev 668) @@ -135,7 +135,7 @@ // --------- now write the "spells.def" file --------- if (spells.size() > 0) { // FIXME: This should use DOM for writing the file. - File dfile = null; + File dfile; // create new file for writing (replaces old one if existent) if (IGUIConstants.CONFIG_DIR != null && IGUIConstants.CONFIG_DIR.length() > 0) { final String baseDir = CMainControl.getInstance().getArchDefaultFolder() + File.separator + IGUIConstants.CONFIG_DIR; Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2006-11-13 22:47:26 UTC (rev 668) @@ -163,9 +163,7 @@ } finally { try { treeIn.close(); - } catch (final Exception e) { /* ignore */ } finally { - treeIn = null; - } + } catch (final Exception e) { /* ignore */ } } } Modified: trunk/daimonin/src/daieditor/io/CMapReader.java =================================================================== --- trunk/daimonin/src/daieditor/io/CMapReader.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/daimonin/src/daieditor/io/CMapReader.java 2006-11-13 22:47:26 UTC (rev 668) @@ -137,7 +137,7 @@ } } else if (thisLine.equals("end")) { objects.add(gameObject); - archflag = false; + //archflag = false; if (log.isDebugEnabled()) { log.debug("LEAVE!: " + gameObject + " - " + thisLine); Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2006-11-13 22:46:34 UTC (rev 667) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2006-11-13 22:47:26 UTC (rev 668) @@ -1115,10 +1115,9 @@ final Element lineElement = map.getElement(i); int lineStart = lineElement.getStartOffset(); final int lineEnd = lineElement.getEndOffset() - 1; - int lineLen = lineEnd - lineStart; lineStart = Math.min(lineStart + start, lineEnd); - lineLen = Math.min(end - start, lineEnd - lineStart); + int lineLen = Math.min(end - start, lineEnd - lineStart); getText(lineStart, lineLen, seg); buf.append(seg.array, seg.offset, seg.count); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-19 14:41:06
|
Revision: 671 http://svn.sourceforge.net/gridarta/?rev=671&view=rev Author: christianhujer Date: 2006-11-19 06:41:03 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Fixed bugs in comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/io/CMapReader.java trunk/crossfire/src/cfeditor/io/CMapWriter.java trunk/daimonin/src/daieditor/io/CMapReader.java trunk/daimonin/src/daieditor/io/CMapWriter.java Modified: trunk/crossfire/src/cfeditor/io/CMapReader.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapReader.java 2006-11-19 14:30:09 UTC (rev 670) +++ trunk/crossfire/src/cfeditor/io/CMapReader.java 2006-11-19 14:41:03 UTC (rev 671) @@ -31,12 +31,14 @@ import java.io.IOException; import java.util.List; import net.sf.gridarta.io.AbstractMapReader; +import net.sf.gridarta.io.MapReader; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** - * A MapFileDecoder reads a map file and provides access to the information read from the map file. + * {@link MapReader} implementation for Crossfire maps. + * A MapReader reads a map file and provides access to the information read from the map file. * This class handles the reading of a mapfile and parsing the data * into a list of ArchObjects. * @author <a href="mailto:mic...@no...">Michael Toennies</a> Modified: trunk/crossfire/src/cfeditor/io/CMapWriter.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-11-19 14:30:09 UTC (rev 670) +++ trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-11-19 14:41:03 UTC (rev 671) @@ -38,11 +38,12 @@ import java.util.Map; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.io.AbstractMapWriter; +import net.sf.gridarta.io.MapWriter; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; /** - * The <code>CMapFileEncode</code> is used to write a map to a file. + * {@link MapWriter} implementation for Crossfire maps. * @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> Modified: trunk/daimonin/src/daieditor/io/CMapReader.java =================================================================== --- trunk/daimonin/src/daieditor/io/CMapReader.java 2006-11-19 14:30:09 UTC (rev 670) +++ trunk/daimonin/src/daieditor/io/CMapReader.java 2006-11-19 14:41:03 UTC (rev 671) @@ -32,12 +32,14 @@ import java.io.IOException; import java.util.List; import net.sf.gridarta.io.AbstractMapReader; +import net.sf.gridarta.io.MapReader; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** - * A MapFileDecoder reads a map file and provides access to the information read from the map file. + * {@link MapReader} implementation for Daimonin maps. + * A MapReader reads a map file and provides access to the information read from the map file. * This class handles the reading of a mapfile and parsing the data * into a list of ArchObjects. * @author <a href="mailto:mic...@no...">Michael Toennies</a> Modified: trunk/daimonin/src/daieditor/io/CMapWriter.java =================================================================== --- trunk/daimonin/src/daieditor/io/CMapWriter.java 2006-11-19 14:30:09 UTC (rev 670) +++ trunk/daimonin/src/daieditor/io/CMapWriter.java 2006-11-19 14:41:03 UTC (rev 671) @@ -33,10 +33,11 @@ import java.util.Formatter; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.io.AbstractMapWriter; +import net.sf.gridarta.io.MapWriter; import org.jetbrains.annotations.NotNull; /** - * The <code>CMapFileEncode</code> is used to write a map to a file. + * {@link MapWriter} implementation for Daimonin maps. * @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> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-19 15:13:50
|
Revision: 673 http://svn.sourceforge.net/gridarta/?rev=673&view=rev Author: christianhujer Date: 2006-11-19 07:13:48 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Some MapControl unification. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/src/app/net/sf/gridarta/map/MapControl.java Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-11-19 14:54:50 UTC (rev 672) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-11-19 15:13:48 UTC (rev 673) @@ -111,22 +111,11 @@ mapView = new MapViewIFrame(mainControl, this, initial); } - /** - * Return flag that indicates whether this is a pickmap or not. - * @return flag that indicates whether this is a pickmap or not - */ + /** {@inheritDoc} */ public boolean isPickmap() { return isPickmap; } - public boolean isGridVisible() { - return mapView.isGridVisible(); - } - - public void setGridVisibility(final boolean fVisible) { - mapView.setGridVisibility(fVisible); - } - /** * Return contains the edit types that have already been (requested and) * calculated (edit types get calculated only when needed to save time) Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-11-19 14:54:50 UTC (rev 672) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-11-19 15:13:48 UTC (rev 673) @@ -154,10 +154,7 @@ } } - /** - * Return flag that indicates whether this is a pickmap or not. - * @return flag that indicates whether this is a pickmap or not - */ + /** {@inheritDoc} */ public boolean isPickmap() { return isPickmap; } Modified: trunk/src/app/net/sf/gridarta/map/MapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapControl.java 2006-11-19 14:54:50 UTC (rev 672) +++ trunk/src/app/net/sf/gridarta/map/MapControl.java 2006-11-19 15:13:48 UTC (rev 673) @@ -6,4 +6,10 @@ */ public interface MapControl { + /** + * Return flag that indicates whether this is a pickmap or not. + * @return flag that indicates whether this is a pickmap or not + */ + boolean isPickmap(); + } // interface MapControl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-19 18:09:53
|
Revision: 675 http://svn.sourceforge.net/gridarta/?rev=675&view=rev Author: christianhujer Date: 2006-11-19 10:09:54 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Removed daimonin only attribute direction from common code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/src/app/net/sf/gridarta/gameobject/Archetype.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-11-19 17:57:43 UTC (rev 674) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-11-19 18:09:54 UTC (rev 675) @@ -466,11 +466,6 @@ return null; } - /** {@inheritDoc} */ - public int getDirection() { - return 0; - } - /** * {@inheritDoc} * @todo this method is too slow - find a faster way Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-11-19 17:57:43 UTC (rev 674) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-11-19 18:09:54 UTC (rev 675) @@ -1306,7 +1306,7 @@ * because we have a better interface in the gameObject panel. * But we need to add when needed the gameObject text - we do it here. */ - if (gameObject.getDirection() != archetype.getDirection()) { + if (gameObject.getDirection() != ((GameObject) archetype).getDirection()) { newArchText = newArchText + "direction " + gameObject.getDirection() + '\n'; } // before we modify the archtext, we look for errors and save them. Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-11-19 17:57:43 UTC (rev 674) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-11-19 18:09:54 UTC (rev 675) @@ -150,13 +150,6 @@ @Deprecated String getAnimName(); /** - * DaiEditor only: Returns the direction. - * @return The direction. - * @deprecated compatibility method - */ - @Deprecated int getDirection(); - - /** * Returns the object text of this Archetype as String. * @return the object text */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-19 18:24:34
|
Revision: 677 http://svn.sourceforge.net/gridarta/?rev=677&view=rev Author: christianhujer Date: 2006-11-19 10:24:33 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Some Unification of CMapArchPanel. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/daimonin/src/daieditor/CMapArchPanel.java Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-11-19 18:13:08 UTC (rev 676) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-11-19 18:24:33 UTC (rev 677) @@ -308,8 +308,7 @@ // are taken instead: final GameObject gameObject = activeArch.getHead(); - // FIXME cher: shouldn't this be replaced by archetype = gameObject.getArchetype() ? - final GameObject archetype = mainControl.getArchetype(gameObject.getArchetypeName()); + final GameObject archetype = gameObject.getArchetype(); if (archetype == null) { // hm, this should NOT happen return; } @@ -626,10 +625,10 @@ /** * If an arch is selected, the MapArchPanels (bottom right windows) get * updated. - * @param activeArch the selected arch + * @param activeGameObject the selected arch */ - public void setMapArchPanelObject(final GameObject activeArch) { - selectedObject = activeArch; + public void setMapArchPanelObject(final GameObject activeGameObject) { + selectedObject = activeGameObject; // archObjNameText.setText("<html><font color=black>Name:</font></html>"); // reset panel archNameField.setText(""); @@ -643,7 +642,7 @@ // reset list archEdit.setEnabled(false); archEdit.setText(""); - if (activeArch == null) { + if (activeGameObject == null) { // an empty space has been selected - reset panel to empty state if (eventList != null && eventList.getModel() != null && eventList.getModel().getSize() > 0) { eventList.setModel(new DefaultListModel()); // clear script event list @@ -660,7 +659,7 @@ // If the active arch is part of a multi, the mutli-head's stats // are displayed (Only the head can store information!). - final GameObject gameObject = activeArch.getHead(); + final GameObject gameObject = activeGameObject.getHead(); // no text, we try to set the default text final boolean hasMessage; @@ -713,18 +712,24 @@ } // end ObjName // set hint for "specials": scripts/inventory/message - String specialText = ""; + final StringBuilder specialText = new StringBuilder(); final int i; if ((i = gameObject.countInvObjects()) > 0) { - specialText += "Inv: " + i; + specialText.append("Inv: ").append(Integer.toString(i)); } if (gameObject.isScripted()) { - specialText += specialText.length() > 0 ? ", Script" : "Script"; + if (specialText.length() > 0) { + specialText.append(", "); + } + specialText.append("Script"); } if (hasMessage) { - specialText += specialText.length() > 0 ? ", Msg" : "Msg"; + if (specialText.length() > 0) { + specialText.append(", "); + } + specialText.append("Msg"); } - archInvCount.setText(specialText); // set text to label + archInvCount.setText(specialText.toString()); // set text to label archMapPos.setText("Map: " + gameObject.getMapX() + ", " + gameObject.getMapY()); @@ -792,19 +797,20 @@ * script is triggered. */ public void editScriptWanted(final int task) { - GameObject arch = mainControl.getMainView().getMapTileSelection(); // get selected arch - if (arch != null) { - arch = arch.getHead(); + GameObject gameObject = mainControl.getMainView().getMapTileSelection(); // get selected gameObject + if (gameObject == null) { + return; } + gameObject = gameObject.getHead(); + // check for a valid selection in the event list - if (arch != null && eventList.getModel() != null && eventList.getModel().getSize() > 0 - && eventList.getSelectedIndex() >= 0) { + if (eventList.getModel() != null && eventList.getModel().getSize() > 0 && eventList.getSelectedIndex() >= 0) { // there String eventType = (String) eventList.getSelectedValue(); if (eventType != null && eventType.length() > 0) { eventType = eventType.trim(); - arch.modifyEventScript(eventType, task, eventList, this); + gameObject.modifyEventScript(eventType, task, eventList, this); } } } @@ -825,8 +831,7 @@ * @param pathButton * @param removeButton */ - public void setScriptPanelButtonState(final boolean newButton, final boolean modifyButton, - final boolean pathButton, final boolean removeButton) { + public void setScriptPanelButtonState(final boolean newButton, final boolean modifyButton, final boolean pathButton, final boolean removeButton) { s_new.setEnabled(newButton); s_modify.setEnabled(modifyButton); s_path.setEnabled(pathButton); Modified: trunk/daimonin/src/daieditor/CMapArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-11-19 18:13:08 UTC (rev 676) +++ trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-11-19 18:24:33 UTC (rev 677) @@ -752,9 +752,9 @@ /** * If an arch is selected, the MapArchPanels * (bottom right windows) get updated. - * @param activeArch the selected arch + * @param activeGameObject the selected arch */ - void setMapArchPanelObject(final GameObject activeArch) { + void setMapArchPanelObject(final GameObject activeGameObject) { // reset panel archNameField.setText(""); archFaceText.setText("Image:"); @@ -765,11 +765,11 @@ // reset list archEdit.setEnabled(false); archEdit.setText(""); - for (JToggleButton button : directionButtons) { + for (final JToggleButton button : directionButtons) { button.setBackground(null); } - if (activeArch == null) { + if (activeGameObject == null) { // an empty space has been selected - reset panel to empty state if (eventList != null && eventList.getModel() != null && eventList.getModel().getSize() > 0) { eventList.setModel(new DefaultListModel()); // clear script event list @@ -796,9 +796,9 @@ return; } - // If the active arch is part of a multi, the mutli-head's stats + // If the active gameObject is part of a multi, the mutli-head's stats // are displayed (Only the head can store information!). - final GameObject arch = activeArch.getHead(); + final GameObject gameObject = activeGameObject.getHead(); panelDesktop.setForegroundAt(0, blue); aInvChange.setEnabled(true); @@ -806,32 +806,32 @@ aSubmitChange.setEnabled(true); // atm we handle direction 0 not here - final boolean enableDirButtons = arch.isDirectionSet(); + final boolean enableDirButtons = gameObject.isDirectionSet(); directionButtons[0].setSelected(true); for (JToggleButton button : directionButtons) { button.setEnabled(enableDirButtons); } if (enableDirButtons) { - final JToggleButton button = directionButtons[arch.getDirection()]; + final JToggleButton button = directionButtons[gameObject.getDirection()]; button.setSelected(true); } - final GameObject defarch = arch.getArchetype(); + final GameObject archetype = gameObject.getArchetype(); // no text, we try to set the default text final boolean hasMessage; - if (arch.getMsgText() == null && defarch != null) { + if (gameObject.getMsgText() == null && archetype != null) { archTextArea.setForeground(black); - if (defarch.getMsgText() == null) { + if (archetype.getMsgText() == null) { archTextArea.setText(""); hasMessage = false; } else { - archTextArea.setText(defarch.getMsgText()); + archTextArea.setText(archetype.getMsgText()); hasMessage = true; } } else { archTextArea.setForeground(blue); - archTextArea.setText(arch.getMsgText()); + archTextArea.setText(gameObject.getMsgText()); hasMessage = true; } archTextArea.setCaretPosition(0); @@ -840,54 +840,54 @@ } // end msg text - if (arch.getAnimName() != null || defarch != null && defarch.getAnimName() != null) { + if (gameObject.getAnimName() != null || archetype != null && archetype.getAnimName() != null) { panelDesktop.setForegroundAt(3, blue); } // *** OBJECT NAME *** - if (arch.getObjName() == null && defarch != null) { + if (gameObject.getObjName() == null && archetype != null) { archNameField.setForeground(black); - if (defarch.getObjName() == null) { - // arch name - if (arch.getArchetypeName() != null) { - archNameField.setText(arch.getArchetypeName()); + if (archetype.getObjName() == null) { + // gameObject name + if (gameObject.getArchetypeName() != null) { + archNameField.setText(gameObject.getArchetypeName()); } else { archNameField.setText(""); } } else { // default name - archNameField.setText(defarch.getObjName()); + archNameField.setText(archetype.getObjName()); } } else { // object name ("special") archNameField.setForeground(blue); - archNameField.setText(arch.getObjName()); + archNameField.setText(gameObject.getObjName()); } // end ObjName /* - if(arch.getAnimName()!=null) + if(gameObject.getAnimName()!=null) - else if(arch.getAnimText()!=null) - archNameField.setText(arch.getAnimText()); + else if(gameObject.getAnimText()!=null) + archNameField.setText(gameObject.getAnimText()); else - archNameField.setText(mainControl.getArch(arch.getArchetypeName()).getAnimText()); + archNameField.setText(mainControl.getArch(gameObject.getArchetypeName()).getAnimText()); */ // set hint for "specials": scripts/inventory/message final StringBuilder specialText = new StringBuilder(); - specialText.append("Status: in node ").append(arch.getMapX()).append(", ").append(arch.getMapY()).append(' '); - if (arch.isScripted()) { + specialText.append("Status: in node ").append(gameObject.getMapX()).append(", ").append(gameObject.getMapY()).append(' '); + if (gameObject.isScripted()) { panelDesktop.setForegroundAt(2, blue); specialText.append("(script)"); } if (hasMessage) { specialText.append("(msg)"); } - final int invObjects = arch.countInvObjects(); + final int invObjects = gameObject.countInvObjects(); if (invObjects > 0) { specialText.append(" (inv: ").append(invObjects).append(')'); } - if (arch.isInContainer()) { - final GameObject cont = (GameObject) arch.getContainer(); + if (gameObject.isInContainer()) { + final GameObject cont = (GameObject) gameObject.getContainer(); if (cont.getArchetypeName() != null) { specialText.append(" (env: ").append(cont.getArchetypeName()).append(')'); } else { @@ -898,16 +898,16 @@ archMapPos.setText(specialText.toString()); final StringBuilder typeText = new StringBuilder(); - if (defarch != null) { - typeText.append("Type: ").append(mainControl.getTypeList().getArchTypeName(arch.getArchTypNr())).append(" (").append(arch.getArchTypNr()).append(") [").append(arch.getArchetypeName()).append(']'); + if (archetype != null) { + typeText.append("Type: ").append(mainControl.getTypeList().getArchTypeName(gameObject.getArchTypNr())).append(" (").append(gameObject.getArchTypNr()).append(") [").append(gameObject.getArchetypeName()).append(']'); } else { typeText.append("Type: <unknown>"); } // check for multi tile - if (arch.isMulti()) { + if (gameObject.isMulti()) { // multi: print size - typeText.append(" [").append(arch.getSizeX()).append('x').append(arch.getSizeY()).append(']'); + typeText.append(" [").append(gameObject.getSizeX()).append('x').append(gameObject.getSizeY()).append(']'); } else { // single typeText.append(" [single]"); @@ -916,11 +916,11 @@ archTypeText.setText(typeText.toString()); final StringBuilder faceText = new StringBuilder(); - if (arch.getFaceObjName() == null) { + if (gameObject.getFaceObjName() == null) { faceText.append("Image: >no face<"); } else { - final GameObject.FaceDesc desc = arch.getFaceObjDesc(); - faceText.append("Image: ").append(arch.getFaceObjName()).append(" ("); + final GameObject.FaceDesc desc = gameObject.getFaceObjDesc(); + faceText.append("Image: ").append(gameObject.getFaceObjName()).append(" ("); switch (desc) { case FACE_NOT_FOUND: faceText.append("face not found"); @@ -929,22 +929,22 @@ faceText.append("face"); break; case DEFARCH_FACE: - faceText.append("defarch face"); + faceText.append("archetype face"); break; case ANIM: faceText.append("anim"); break; case DEFARCH_ANIM: - faceText.append("defarch anim"); + faceText.append("archetype anim"); break; } } archFaceText.setText(faceText.toString()); - String animName = arch.getAnimName(); - if (animName == null && defarch != null) { - animName = defarch.getAnimName(); + String animName = gameObject.getAnimName(); + if (animName == null && archetype != null) { + animName = archetype.getAnimName(); } final StringBuilder animText = new StringBuilder("Animation: "); if (animName != null) { @@ -956,7 +956,7 @@ } archAnimText.setText(animText.toString()); - // drawing the arch's attributes in the text field (archEdit) at the bottom right + // drawing the gameObject's attributes in the text field (archEdit) at the bottom right archEdit.setEnabled(true); final Style currentAttributes = archEdit.getStyle(StyleContext.DEFAULT_STYLE); try { @@ -967,17 +967,17 @@ // blue: the "special" attributes, differ from the default archetype StyleConstants.setForeground(currentAttributes, blue); - if (arch.getObjectText() != null) { - document.insertString(document.getLength(), arch.getObjectText(), currentAttributes); + if (gameObject.getObjectText() != null) { + document.insertString(document.getLength(), gameObject.getObjectText(), currentAttributes); } - // document.insertString(document.getLength(), "ID#"+arch.getMyID()+ " inv#: "+arch.countInvObjects()+"\n", currentAttributes); + // document.insertString(document.getLength(), "ID#"+gameObject.getMyID()+ " inv#: "+gameObject.countInvObjects()+"\n", currentAttributes); // black: the attributes from the default archetype // that don't exist among the "special" ones StyleConstants.setForeground(currentAttributes, black); - if (arch.getObjectText() != null && defarch != null) { - document.insertString(document.getLength(), arch.diffArchText(defarch.getObjectText(), true), currentAttributes); + if (gameObject.getObjectText() != null && archetype != null) { + document.insertString(document.getLength(), gameObject.diffArchText(archetype.getObjectText(), true), currentAttributes); } } catch (final BadLocationException e) { // TODO @@ -985,9 +985,9 @@ archEdit.setCaretPosition(0); // ------ script panel ------ - if (arch.isScripted()) { + if (gameObject.isScripted()) { eventList.removeAll(); // clear event list - arch.addEventsToJList(eventList); // update JList to display all events + gameObject.addEventsToJList(eventList); // update JList to display all events aModify.setEnabled(true); aPath.setEnabled(true); @@ -1009,19 +1009,19 @@ * script is triggered. */ public void editScriptWanted(final int task) { - GameObject arch = mainControl.getMainView().getMapTileSelection(); // get selected arch - if (arch == null) { + GameObject gameObject = mainControl.getMainView().getMapTileSelection(); // get selected gameObject + if (gameObject == null) { return; } - arch = arch.getHead(); + gameObject = gameObject.getHead(); // check for a valid selection in the event list if (eventList.getModel() != null && eventList.getModel().getSize() > 0 && eventList.getSelectedIndex() >= 0) { // there final int index = eventList.getSelectedIndex(); if (index >= 0) { - if (arch.modifyEventScript(index, task, eventList, this)) { + if (gameObject.modifyEventScript(index, task, eventList, this)) { updateMapTileList(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-21 21:27:46
|
Revision: 679 http://svn.sourceforge.net/gridarta/?rev=679&view=rev Author: christianhujer Date: 2006-11-21 13:27:45 -0800 (Tue, 21 Nov 2006) Log Message: ----------- Fixed bug in build.xml: libraries taken for javadoc were wrong. Modified Paths: -------------- trunk/crossfire/build.xml trunk/daimonin/build.xml Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2006-11-19 19:15:54 UTC (rev 678) +++ trunk/crossfire/build.xml 2006-11-21 21:27:45 UTC (rev 679) @@ -177,7 +177,8 @@ link = "${user.javadoc.link}" > <classpath> - <fileset dir="${lib.dir}" includes="*.jar" /> + <fileset dir="${lib.dir}" includes="*.jar" excludes="LICENSE-*.jar" /> + <fileset dir="../lib/" includes="*.jar" excludes="LICENSE-*.jar" /> </classpath> <sourcepath path="${src.dir}" /> <packageset Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2006-11-19 19:15:54 UTC (rev 678) +++ trunk/daimonin/build.xml 2006-11-21 21:27:45 UTC (rev 679) @@ -220,7 +220,8 @@ link = "${user.javadoc.link}" > <classpath> - <fileset dir="${lib.dir}" includes="*.jar" /> + <fileset dir="${lib.dir}" includes="*.jar" excludes="LICENSE-*.jar" /> + <fileset dir="../lib/" includes="*.jar" excludes="LICENSE-*.jar" /> </classpath> <sourcepath path="${src.dir}" /> <packageset This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-24 19:24:37
|
Revision: 683 http://svn.sourceforge.net/gridarta/?rev=683&view=rev Author: akirschbaum Date: 2006-11-24 11:24:37 -0800 (Fri, 24 Nov 2006) Log Message: ----------- Do not crash in cut or delete when the region contains multi-part objects. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/daimonin/src/daieditor/CopyBuffer.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-11-24 18:29:30 UTC (rev 682) +++ trunk/crossfire/ChangeLog 2006-11-24 19:24:37 UTC (rev 683) @@ -1,5 +1,8 @@ -2006-11-24 Andreas Kirschbaum <kir...@my...> +2006-11-24 Andreas Kirschbaum + * Do not crash in cut or delete when the region contains + multi-part objects. + * Make pickmaps work again. 2006-11-02 Andreas Kirschbaum Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-24 18:29:30 UTC (rev 682) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-24 19:24:37 UTC (rev 683) @@ -31,8 +31,7 @@ import cfeditor.map.MapModel; import java.awt.Point; import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.List; +import java.util.HashSet; import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -180,7 +179,7 @@ // cycle through all tile coordinates which are highlighted: final Point pos = new Point(); mapControl.getMapModel().beginTransaction("Cut / Clear"); // TODO: I18N/L10N - final List<GameObject> gameObjectsToDelete = new ArrayList<GameObject>(); + final HashSet<GameObject> gameObjectsToDelete = new HashSet<GameObject>(); 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++) { // do the copying for one tile position: @@ -207,7 +206,7 @@ // For CUT we don't delete multi tails of multis which are left or // above the head (we would miss to copy them otherwise). if (mode == Mode.DO_CLEAR || (gameObject.getMultiX() >= 0 && gameObject.getMultiY() >= 0)) { - gameObjectsToDelete.add(gameObject); + gameObjectsToDelete.add(gameObject.getHead()); } } } Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-11-24 18:29:30 UTC (rev 682) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-11-24 19:24:37 UTC (rev 683) @@ -32,6 +32,7 @@ import java.awt.Point; import java.awt.Rectangle; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import net.sf.gridarta.Size2D; import net.sf.gridarta.map.MapSquare; @@ -152,7 +153,7 @@ final Point offset = selRec.getLocation(); mapControl.getMapModel().beginTransaction("Cut / Clear"); // TODO: I18N/L10N - final List<GameObject> gameObjectsToDelete = new ArrayList<GameObject>(); + final HashSet<GameObject> gameObjectsToDelete = new HashSet<GameObject>(); for (final MapSquare<GameObject> square : mapControl.getMapViewFrame().getView().getSelectedSquares()) { final int posx = square.getMapX(); final int posy = square.getMapY(); @@ -175,7 +176,7 @@ // For CUT we don't delete multi tails of multis which are left or // above the head (we would miss to copy them otherwise). if (mode == Mode.DO_CLEAR || (gameObject.getMultiX() >= 0 && gameObject.getMultiY() >= 0)) { - gameObjectsToDelete.add(gameObject); + gameObjectsToDelete.add(gameObject.getHead()); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 11:11:34
|
Revision: 689 http://svn.sourceforge.net/gridarta/?rev=689&view=rev Author: akirschbaum Date: 2006-11-26 03:11:34 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify ReplaceDialog calling code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-26 11:04:23 UTC (rev 688) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-26 11:11:34 UTC (rev 689) @@ -1541,12 +1541,12 @@ } /** "Replace" was selected from the Edit menu. */ - public void replaceWanted() { + public void replace() { if (currentMap == null || currentMap.getMapView() == null) { return; // this should never be possible, but I just wanna make sure... } - copybuffer.replace(currentMap); + ReplaceDialog.getInstance().display(currentMap); } /** Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-11-26 11:04:23 UTC (rev 688) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-11-26 11:11:34 UTC (rev 689) @@ -424,7 +424,7 @@ m_replace.addActionListener( new ActionListener() { public void actionPerformed(final ActionEvent event) { - mainControl.replaceWanted(); + mainControl.replace(); } }); menuManager.addMenuEntry("main.edit", m_replace); Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-26 11:04:23 UTC (rev 688) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-26 11:11:34 UTC (rev 689) @@ -367,14 +367,6 @@ } /** - * Replace objects on the map. - * @param mapControl MapControl of the active map where the action was invoked - */ - public void replace(final MapControl mapControl) { - ReplaceDialog.getInstance().display(mapControl); - } - - /** * Add an archetype to the destination map. Inserts a new object instance * for default archetypes, and a clone for non-default archetypes. */ Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-11-26 11:04:23 UTC (rev 688) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-11-26 11:11:34 UTC (rev 689) @@ -1871,11 +1871,12 @@ } } - /** "Replace" was selected from the Edit menu */ + /** "Replace" was selected from the Edit menu. */ public void replace() { if (currentMap == null || currentMap.getMapViewFrame() == null) { return; // this should never be possible, but I just wanna make sure... } + ReplaceDialog.getInstance().display(currentMap); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 11:26:19
|
Revision: 691 http://svn.sourceforge.net/gridarta/?rev=691&view=rev Author: akirschbaum Date: 2006-11-26 03:26:20 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify expression. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/daimonin/src/daieditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 11:13:51 UTC (rev 690) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 11:26:20 UTC (rev 691) @@ -267,8 +267,7 @@ colonLabel.setText(":"); // pack frame only if height of icon changed - if (alwaysPack || (oldIcon == null && iconLabel.getIcon() != null) || (oldIcon != null && iconLabel.getIcon() == null) || - (oldIcon != iconLabel.getIcon() && oldIcon.getIconHeight() != iconLabel.getIcon().getIconHeight())) { + if (alwaysPack || (oldIcon == null && iconLabel.getIcon() != null) || (oldIcon != null && iconLabel.getIcon() == null) || (oldIcon != iconLabel.getIcon() && oldIcon != null && oldIcon.getIconHeight() != iconLabel.getIcon().getIconHeight())) { pack(); } } else { Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 11:13:51 UTC (rev 690) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 11:26:20 UTC (rev 691) @@ -264,8 +264,7 @@ colonLabel.setText(":"); // pack frame only if height of icon changed - if (alwaysPack || oldIcon == null && iconLabel.getIcon() != null || oldIcon != null && iconLabel.getIcon() == null || oldIcon != iconLabel.getIcon() && oldIcon != null && oldIcon.getIconHeight() != iconLabel.getIcon().getIconHeight()) - { + if (alwaysPack || (oldIcon == null && iconLabel.getIcon() != null) || (oldIcon != null && iconLabel.getIcon() == null) || (oldIcon != iconLabel.getIcon() && oldIcon != null && oldIcon.getIconHeight() != iconLabel.getIcon().getIconHeight())) { dialog.pack(); } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 15:27:52
|
Revision: 700 http://svn.sourceforge.net/gridarta/?rev=700&view=rev Author: akirschbaum Date: 2006-11-26 07:27:51 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Remove static import statements; fix comment typos. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/daimonin/src/daieditor/CArchPanelPan.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFArchType.java trunk/daimonin/src/daieditor/CFJavaEditor.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/CMapTileList.java trunk/daimonin/src/daieditor/CNewMapDialog.java trunk/daimonin/src/daieditor/CPickmapPanel.java trunk/daimonin/src/daieditor/CPreview.java trunk/daimonin/src/daieditor/ProcessRunner.java trunk/daimonin/src/daieditor/ReplaceDialog.java trunk/daimonin/src/daieditor/ScriptArchData.java trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/Updater.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/gui/AboutDialog.java trunk/daimonin/src/daieditor/gui/MapFileFilter.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/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/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/daimonin/src/daieditor/map/validation/AbstractValidator.java trunk/daimonin/src/daieditor/map/validation/ValidationError.java trunk/src/app/net/sf/gridarta/gameobject/NamedObjects.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-26 15:27:51 UTC (rev 700) @@ -60,7 +60,6 @@ import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.filter.file.EndingFileFilter; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -73,8 +72,8 @@ */ public final class CMainControl implements MainControl { - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("cfeditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); /** Logger. */ private static final Logger log = Logger.getLogger(CMainControl.class); Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 15:27:51 UTC (rev 700) @@ -46,7 +46,6 @@ import javax.swing.WindowConstants; import net.sf.gridarta.Size2D; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * This dialog manages the replace action. @@ -57,8 +56,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("cfeditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); // matching criteria public static final int MATCH_ARCH_NAME = 0; Modified: trunk/daimonin/src/daieditor/CArchPanelPan.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-11-26 15:27:51 UTC (rev 700) @@ -46,7 +46,6 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -58,8 +57,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Controller of this subview. */ private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-11-26 15:27:51 UTC (rev 700) @@ -97,7 +97,6 @@ import net.sf.gridarta.gameobject.NamedObjects; import net.sf.gridarta.help.Help; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import static net.sf.japi.util.Arrays2.linearSearch; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -116,7 +115,7 @@ private static final long serialVersionUID = 1L; /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); // store width of input-textfields, then JChooseBoxes are set to this width too public static final int TEXTFIELD_COLUMNS = 18; // number of columns for textfields Modified: trunk/daimonin/src/daieditor/CFArchType.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchType.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CFArchType.java 2006-11-26 15:27:51 UTC (rev 700) @@ -29,7 +29,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static net.sf.japi.swing.ActionFactory.getFactory; +import net.sf.japi.swing.ActionFactory; import net.sf.japi.xml.NodeListIterator; import static net.sf.japi.xml.NodeListIterator.getFirstChild; import org.apache.log4j.Logger; @@ -397,7 +397,7 @@ * @return the full html-text to be (parsed and) displayed */ public String createHtmlDocu() { - return getFactory("daieditor").format("arcDoc.htmlText", typeName, desc != null ? desc.trim() : "", use != null ? use.trim() : ""); + return ActionFactory.getFactory("daieditor").format("arcDoc.htmlText", typeName, desc != null ? desc.trim() : "", use != null ? use.trim() : ""); } public CFArchAttrib[] getAttr() { Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-11-26 15:27:51 UTC (rev 700) @@ -33,7 +33,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import static java.util.prefs.Preferences.userNodeForPackage; -import static net.sf.japi.swing.ActionFactory.getFactory; +import net.sf.japi.swing.ActionFactory; /** * Main class, launches the level editor application. @@ -64,7 +64,7 @@ Locale.setDefault(new Locale(locName)); } // Now add prefs to the ActionFactory. - getFactory("daieditor").addPref(CMainControl.class); + ActionFactory.getFactory("daieditor").addPref(CMainControl.class); final SplashScreen splashScreen = new SplashScreen(); splashScreen.show(); final List<String> infiles = new ArrayList<String>(); // map file names to open initially Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-11-26 15:27:51 UTC (rev 700) @@ -120,7 +120,6 @@ import net.sf.gridarta.map.MapType; import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; import net.sf.japi.swing.TipOfTheDayManager; import net.sf.japi.swing.prefs.PreferencesGroup; @@ -141,8 +140,8 @@ */ public final class CMainControl implements ThrowableHandler, MapModelListener, MainControl { - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Logger. */ private static final Logger log = Logger.getLogger("daieditor"); Modified: trunk/daimonin/src/daieditor/CMainStatusbar.java =================================================================== --- trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-11-26 15:27:51 UTC (rev 700) @@ -40,7 +40,6 @@ import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** @@ -59,8 +58,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** The ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Controller of this statusbar view. */ private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-11-26 15:27:51 UTC (rev 700) @@ -61,7 +61,6 @@ import net.sf.gridarta.gui.GSplitPane; import net.sf.gridarta.help.Help; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.ThrowableHandler; import org.jetbrains.annotations.Nullable; @@ -76,7 +75,7 @@ public final class CMainView extends JFrame implements ErrorHandler, InternalFrameListener, ThrowableHandler, WindowListener { /** Action Factory to create Actions. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Serial Version UID. */ private static final long serialVersionUID = 1L; Modified: trunk/daimonin/src/daieditor/CMapArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-11-26 15:27:51 UTC (rev 700) @@ -69,7 +69,6 @@ import javax.swing.text.StyleContext; import net.sf.gridarta.gui.GSplitPane; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; /** @@ -84,8 +83,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** The ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); // constants for the 'task' parameter in editScriptWanted() public static final int SCRIPT_OPEN = 0; Modified: trunk/daimonin/src/daieditor/CMapTileList.java =================================================================== --- trunk/daimonin/src/daieditor/CMapTileList.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CMapTileList.java 2006-11-26 15:27:51 UTC (rev 700) @@ -55,7 +55,6 @@ import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; import org.jetbrains.annotations.NotNull; @@ -71,8 +70,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Controller of this subview. */ private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-11-26 15:27:51 UTC (rev 700) @@ -51,7 +51,6 @@ import net.sf.gridarta.Size2D; import net.sf.gridarta.map.MapType; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * Dialog used to ask the user the properties for the new level. Contains a @@ -66,8 +65,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** * Whether to use the default map size. Modified: trunk/daimonin/src/daieditor/CPickmapPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-11-26 15:27:51 UTC (rev 700) @@ -37,7 +37,6 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.apache.log4j.Logger; /** @@ -49,8 +48,8 @@ private static final Logger log = Logger.getLogger(CPickmapPanel.class); - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** static instance of this class */ private static CPickmapPanel instance; Modified: trunk/daimonin/src/daieditor/CPreview.java =================================================================== --- trunk/daimonin/src/daieditor/CPreview.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CPreview.java 2006-11-26 15:27:51 UTC (rev 700) @@ -45,7 +45,6 @@ import javax.swing.JScrollPane; import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; /** @@ -62,7 +61,7 @@ private static final long serialVersionUID = 1L; /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Original image. */ private final Image original; Modified: trunk/daimonin/src/daieditor/ProcessRunner.java =================================================================== --- trunk/daimonin/src/daieditor/ProcessRunner.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/ProcessRunner.java 2006-11-26 15:27:51 UTC (rev 700) @@ -45,7 +45,6 @@ import javax.swing.JToolBar; import javax.swing.SwingUtilities; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * Class to run an external process. @@ -57,7 +56,7 @@ private static final long serialVersionUID = 1L; /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** * The Dialog. Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 15:27:51 UTC (rev 700) @@ -46,7 +46,6 @@ import javax.swing.WindowConstants; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * This dialog manages the replace action. @@ -58,8 +57,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); // matching criteria public static final int MATCH_ARCH_NAME = 0; Modified: trunk/daimonin/src/daieditor/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/ScriptArchData.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/ScriptArchData.java 2006-11-26 15:27:51 UTC (rev 700) @@ -50,7 +50,6 @@ import static javax.swing.WindowConstants.HIDE_ON_CLOSE; import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.Arrays2; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -69,8 +68,8 @@ /** Serial Version. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); // popup frame to edit script paths: private static JDialog pathFrame; Modified: trunk/daimonin/src/daieditor/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/Spells.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/Spells.java 2006-11-26 15:27:51 UTC (rev 700) @@ -41,7 +41,6 @@ import javax.xml.parsers.DocumentBuilder; import net.sf.gridarta.io.IOUtils; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.filter.file.FilenameFileFilter; import net.sf.japi.xml.NodeListIterator; import org.w3c.dom.Document; @@ -55,8 +54,8 @@ */ public final class Spells { - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); private String[] spellNames; // array of spell names (these all begin with a ' ' space!) Modified: trunk/daimonin/src/daieditor/Updater.java =================================================================== --- trunk/daimonin/src/daieditor/Updater.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/Updater.java 2006-11-26 15:27:51 UTC (rev 700) @@ -46,7 +46,6 @@ import javax.swing.ProgressMonitor; import javax.swing.ProgressMonitorInputStream; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * This class handles updating the map editor. @@ -57,8 +56,8 @@ */ public final class Updater implements Runnable { - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Logger. */ private static final Logger log = Logger.getLogger("daieditor"); Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-11-26 15:27:51 UTC (rev 700) @@ -53,7 +53,6 @@ import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import net.sf.gridarta.io.IOUtils; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.Progress; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -69,7 +68,7 @@ private static final Logger log = Logger.getLogger(ArchetypeSet.class); /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2006-11-26 15:27:51 UTC (rev 700) @@ -42,7 +42,6 @@ import java.util.logging.Logger; import net.sf.gridarta.gameobject.face.AbstractFaceObjects; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.Progress; import org.jetbrains.annotations.NotNull; @@ -122,7 +121,7 @@ try { treeIn = new BufferedReader(new InputStreamReader(new FileInputStream(treeFile), "us-ascii")); } catch (final FileNotFoundException e) { - getFactory("daieditor").showMessageDialog(CMainControl.getInstance().getMainView(), "errCantLoadFaceTree"); + ActionFactory.getFactory("daieditor").showMessageDialog(CMainControl.getInstance().getMainView(), "errCantLoadFaceTree"); } final byte[] tag = "IMAGE ".getBytes(); // this is the starting string for a new png final StringBuilder faceB = new StringBuilder(); // face name of png Modified: trunk/daimonin/src/daieditor/gui/AboutDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/AboutDialog.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/AboutDialog.java 2006-11-26 15:27:51 UTC (rev 700) @@ -21,7 +21,6 @@ import javax.swing.JTabbedPane; import javax.swing.JTextArea; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * TODO Refactor to use less memory @@ -32,7 +31,7 @@ public class AboutDialog extends JPanel { /** Action Factory to create Actions. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Create an AboutDialog. */ public AboutDialog() { Modified: trunk/daimonin/src/daieditor/gui/MapFileFilter.java =================================================================== --- trunk/daimonin/src/daieditor/gui/MapFileFilter.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/MapFileFilter.java 2006-11-26 15:27:51 UTC (rev 700) @@ -28,7 +28,7 @@ import java.util.Map; import java.util.WeakHashMap; import java.util.prefs.Preferences; -import static net.sf.japi.swing.ActionFactory.getFactory; +import net.sf.japi.swing.ActionFactory; import net.sf.japi.util.filter.file.EndingFileFilter; /** @@ -56,7 +56,7 @@ /** Create a MapFileFilter. */ private MapFileFilter() { - super(true, true, getFactory("daieditor").getString("fileDialog.filter.maps"), new String[]{".lua", ".py", ".txt", ".text"}); + super(true, true, ActionFactory.getFactory("daieditor").getString("fileDialog.filter.maps"), new String[]{".lua", ".py", ".txt", ".text"}); } /** Modified: trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java 2006-11-26 15:27:51 UTC (rev 700) @@ -50,7 +50,6 @@ import javax.swing.SwingConstants; import javax.swing.filechooser.FileView; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ToggleAction; import org.jetbrains.annotations.Nullable; @@ -60,8 +59,8 @@ */ public class MapPreviewAccessory extends JComponent implements PropertyChangeListener { - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences prefs = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-11-26 15:27:51 UTC (rev 700) @@ -57,7 +57,6 @@ import net.sf.gridarta.Size2D; import net.sf.gridarta.help.Help; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.JFileChooserButton; /** @@ -71,8 +70,8 @@ /** Serial version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/gui/map/MapTilePane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-11-26 15:27:51 UTC (rev 700) @@ -60,7 +60,6 @@ import net.sf.gridarta.Size2D; import net.sf.gridarta.io.IOUtils; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** @@ -75,8 +74,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** The mainControl to use. */ private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -46,7 +46,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.JFileChooserButton; import net.sf.japi.swing.prefs.AbstractPrefs; @@ -57,8 +56,8 @@ */ public final class AppPrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -36,7 +36,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.prefs.AbstractPrefs; /** @@ -46,8 +45,8 @@ */ public final class DevPrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -43,7 +43,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.LocaleComparator; import net.sf.japi.swing.LocaleListCellRenderer; import net.sf.japi.swing.prefs.AbstractPrefs; @@ -55,8 +54,8 @@ */ public final class GUIPrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -40,7 +40,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.prefs.AbstractPrefs; /** @@ -50,8 +49,8 @@ */ public final class MapValidatorPrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -38,7 +38,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.prefs.AbstractPrefs; /** @@ -48,8 +47,8 @@ */ public final class MiscPrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -43,7 +43,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.prefs.AbstractPrefs; /** @@ -62,8 +61,8 @@ /** The preferences key for the type. */ private static final String NET_PREFS_KEY_PORT = "daieditor.proxy.port"; - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -43,7 +43,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.JFileChooserButton; import net.sf.japi.swing.prefs.AbstractPrefs; @@ -54,8 +53,8 @@ */ public final class ResPrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -36,7 +36,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.prefs.AbstractPrefs; /** @@ -46,8 +45,8 @@ */ public final class UpdatePrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-11-26 15:27:51 UTC (rev 700) @@ -36,7 +36,6 @@ import net.sf.gridarta.map.AbstractMapModel; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** @@ -56,7 +55,7 @@ public final class DefaultMapModel extends AbstractMapModel<GameObject, MapArchObject> implements MapModel { /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** * The CMainControl used for various operations. Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-11-26 15:27:51 UTC (rev 700) @@ -52,7 +52,6 @@ import net.sf.gridarta.map.MapModelListener; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** @@ -88,9 +87,9 @@ private File mapFile; /** - * ActionFactory. + * Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** * Reference to SimpleLevelRenderer, which is only used to get images. Modified: trunk/daimonin/src/daieditor/map/validation/AbstractValidator.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/AbstractValidator.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/map/validation/AbstractValidator.java 2006-11-26 15:27:51 UTC (rev 700) @@ -24,7 +24,7 @@ import daieditor.CMainControl; import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; -import static net.sf.japi.swing.ActionFactory.getFactory; +import net.sf.japi.swing.ActionFactory; /** * This is the base class for validators. @@ -57,7 +57,7 @@ } key = "Validator." + name.substring(0, name.indexOf("Checker")); enabled = prefs.getBoolean(key, false); - final String defaultEnabledString = getFactory("daieditor").getString(key + ".default"); + final String defaultEnabledString = ActionFactory.getFactory("daieditor").getString(key + ".default"); defaultEnabled = Boolean.parseBoolean(defaultEnabledString); } @@ -68,7 +68,7 @@ protected AbstractValidator(final String key) { this.key = key; enabled = prefs.getBoolean(key, false); - final String defaultEnabledString = getFactory("daieditor").getString(key + ".default"); + final String defaultEnabledString = ActionFactory.getFactory("daieditor").getString(key + ".default"); defaultEnabled = Boolean.parseBoolean(defaultEnabledString); } Modified: trunk/daimonin/src/daieditor/map/validation/ValidationError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/ValidationError.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/map/validation/ValidationError.java 2006-11-26 15:27:51 UTC (rev 700) @@ -28,7 +28,6 @@ import net.sf.gridarta.map.MapModel; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** @@ -39,7 +38,7 @@ public abstract class ValidationError { /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Key. */ private final String key; Modified: trunk/src/app/net/sf/gridarta/gameobject/NamedObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/NamedObjects.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/src/app/net/sf/gridarta/gameobject/NamedObjects.java 2006-11-26 15:27:51 UTC (rev 700) @@ -37,7 +37,6 @@ import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreePath; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; @@ -50,7 +49,7 @@ public abstract class NamedObjects<T extends NamedObject> implements Iterable<T> { /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("net.sf.gridarta"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); /** The localized name of the object type, e.g. used in dialogs. */ private final String name; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 16:01:10
|
Revision: 701 http://svn.sourceforge.net/gridarta/?rev=701&view=rev Author: akirschbaum Date: 2006-11-26 08:01:04 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify initialization code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/daimonin/src/daieditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 15:27:51 UTC (rev 700) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 16:01:04 UTC (rev 701) @@ -72,15 +72,15 @@ private final CMainControl mainControl; - private boolean isBuilt; + private boolean isBuilt = false; private MapControl mapControl; - private GameObject replaceArch; // objects will be replaced by this arch + private GameObject replaceArch = null; // objects will be replaced by this arch private JLabel rfHeading; - private JLabel rfArchName; + private JLabel rfArchName = null; private JLabel iconLabel; @@ -105,9 +105,6 @@ dialog.setModal(false); dialog.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); this.mainControl = mainControl; - isBuilt = false; - rfArchName = null; - replaceArch = null; } /** @return true when this frame has been fully built */ Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 15:27:51 UTC (rev 700) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 16:01:04 UTC (rev 701) @@ -73,11 +73,11 @@ private final CMainControl mainControl; - private boolean isBuilt; + private boolean isBuilt = false; private MapControl mapControl; - private GameObject replaceArch; // objects will be replaced by this arch + private GameObject replaceArch = null; // objects will be replaced by this arch private List<GameObject> replaceCopyBuffer; // objects in CopyBuffer @@ -85,7 +85,7 @@ private JLabel rfHeading; - private JLabel rfArchName; + private JLabel rfArchName = null; private JLabel iconLabel; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 16:11:15
|
Revision: 703 http://svn.sourceforge.net/gridarta/?rev=703&view=rev Author: akirschbaum Date: 2006-11-26 08:11:14 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify some comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/map/MapControl.java Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-11-26 16:06:35 UTC (rev 702) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-11-26 16:11:14 UTC (rev 703) @@ -62,8 +62,8 @@ private File mapFile; /** - * contains the edit types that have already been (requested and) - * calculated (edit types get calculated only when needed to save time) + * Contains the edit types that have already been (requested and) + * calculated (edit types get calculated only when needed to save time). */ private int activeEditType; @@ -117,9 +117,10 @@ } /** - * Return 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) + * Return the edit types that have already been (requested and) calculated + * (edit types get calculated only when needed to save time). + * + * @return the edit types that have already been calculated */ public int getActiveEditType() { return activeEditType; Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-11-26 16:06:35 UTC (rev 702) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-11-26 16:11:14 UTC (rev 703) @@ -96,8 +96,10 @@ */ private SoftReference<SimpleLevelRenderer> simpleLevelRendererReference; - // contains the edit types that have already been (requested and) calculated - // (edit types get calculated only when needed to save time) + /** + * Contains the edit types that have already been (requested and) + * calculated (edit types get calculated only when needed to save time). + */ private int activeEditType; /** @@ -158,6 +160,12 @@ return isPickmap; } + /** + * Return the edit types that have already been (requested and) calculated + * (edit types get calculated only when needed to save time). + * + * @return the edit types that have already been calculated + */ public int getActiveEditType() { return activeEditType; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 16:22:58
|
Revision: 706 http://svn.sourceforge.net/gridarta/?rev=706&view=rev Author: akirschbaum Date: 2006-11-26 08:22:58 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/daimonin/src/daieditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-26 16:19:13 UTC (rev 705) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-26 16:22:58 UTC (rev 706) @@ -142,8 +142,8 @@ final Point startp = mapControl.getMapViewFrame().getHighlightStart(); // start of highlighted rect final Point offset = mapControl.getMapViewFrame().getHighlightOffset(); // offset of rect from startp - if (!mapControl.getMapViewFrame().isHighlight()) { // should actually never happen - return; + if (!mapControl.getMapViewFrame().isHighlight()) { + return; // should actually never happen } // convert negative 'offset' into positive by flipping 'startp' @@ -230,8 +230,8 @@ public void paste(final MapControl mapControl) { final Point startp = mapControl.getMapViewFrame().getHighlightStart(); // start of highlighted rect - if (!mapControl.getMapViewFrame().isHighlight()) { // should actually never happen - return; + if (!mapControl.getMapViewFrame().isHighlight()) { + return; // should actually never happen } // cycle through all tile coordinates which are highlighted: @@ -290,8 +290,8 @@ final Point offset = mapControl.getMapViewFrame().getHighlightOffset(); // offset of rect from startp final Point pos = new Point(); - if (!mapControl.getMapViewFrame().isHighlight()) { // should actually never happen - return; + if (!mapControl.getMapViewFrame().isHighlight()) { + return; // should actually never happen } if (mainControl.getArchPanelSelection() == null) { // no selected arch to fill with Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-11-26 16:19:13 UTC (rev 705) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-11-26 16:22:58 UTC (rev 706) @@ -241,7 +241,7 @@ public void fill(final MapControl mapControl, final boolean fillBelow, final MapControl seed, final int rand) { if (!mapControl.getMapViewFrame().isHighlight()) { - return; // should actually never happen + return; // should actually never happen } final List<GameObject> archList; if (seed == null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 17:29:52
|
Revision: 711 http://svn.sourceforge.net/gridarta/?rev=711&view=rev Author: akirschbaum Date: 2006-11-26 09:29:48 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify logging statements. Modified Paths: -------------- trunk/crossfire/src/cfeditor/io/CMapWriter.java trunk/daimonin/src/daieditor/io/CMapWriter.java Modified: trunk/crossfire/src/cfeditor/io/CMapWriter.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-11-26 17:27:47 UTC (rev 710) +++ trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-11-26 17:29:48 UTC (rev 711) @@ -50,6 +50,7 @@ */ public final class CMapWriter extends AbstractMapWriter<GameObject, MapArchObject, MapModel> { + /** Logger. */ private static final Logger log = Logger.getLogger(CMapWriter.class); /** Modified: trunk/daimonin/src/daieditor/io/CMapWriter.java =================================================================== --- trunk/daimonin/src/daieditor/io/CMapWriter.java 2006-11-26 17:27:47 UTC (rev 710) +++ trunk/daimonin/src/daieditor/io/CMapWriter.java 2006-11-26 17:29:48 UTC (rev 711) @@ -45,6 +45,9 @@ @SuppressWarnings({"HardcodedLineSeparator"}) public final class CMapWriter extends AbstractMapWriter<GameObject, MapArchObject, MapModel> { + /** Logger. */ + private static final Logger log = Logger.getLogger(CMapWriter.class); + /** * Formatter to use for writing maps. * @note use '\n' for line endings only. The fileformat requires Unix LF only. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |