From: <aki...@us...> - 2007-02-03 10:20:24
|
Revision: 1760 http://svn.sourceforge.net/gridarta/?rev=1760&view=rev Author: akirschbaum Date: 2007-02-03 02:20:25 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Replace compareTo() with equals(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-03 10:12:05 UTC (rev 1759) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-03 10:20:25 UTC (rev 1760) @@ -494,7 +494,7 @@ continue; } - if (arch.getArchetypeName().compareTo(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME) == 0) { + if (arch.getArchetypeName().equals(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME)) { // process map arch out.append("Object ").append(arch.getArchetypeName()).append('\n'); @@ -502,7 +502,7 @@ // map object hack: x/y is normally a reference for multi // part arches - i include this hack until we rework the // arch objects with more useful script names - if (arch.getArchetypeName().compareTo(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME) == 0) { + if (arch.getArchetypeName().equals(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME)) { out.append("x ").append(Integer.toString(arch.getMultiX())).append('\n'); out.append("y ").append(Integer.toString(arch.getMultiY())).append('\n'); } Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 10:12:05 UTC (rev 1759) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 10:20:25 UTC (rev 1760) @@ -510,7 +510,7 @@ if (arch.isUndefinedArchetype()) { continue; } - if (arch.getArchetypeName().compareTo(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME) == 0) { + if (arch.getArchetypeName().equals(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME)) { // process map arch out.append("Object ").append(arch.getArchetypeName()).append('\n'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-03 10:25:47
|
Revision: 1761 http://svn.sourceforge.net/gridarta/?rev=1761&view=rev Author: akirschbaum Date: 2007-02-03 02:25:48 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-03 10:20:25 UTC (rev 1760) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-03 10:25:48 UTC (rev 1761) @@ -551,7 +551,7 @@ out.append("end\n"); - // if multi-head, we must attach the tails + // process the multipart tails: for (GameObject tail = arch.getMultiNext(); tail != null; tail = tail.getMultiNext()) { out.append("More\n"); Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 10:20:25 UTC (rev 1760) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 10:25:48 UTC (rev 1761) @@ -537,6 +537,7 @@ if (arch.getObjectText().lastIndexOf(0x0a) != arch.getObjectText().length() - 1) { out.append('\n'); } + out.append("end\n"); } else { if (arch.isTail()) { @@ -578,66 +579,65 @@ if (arch.getObjectText().lastIndexOf('\n') != arch.getObjectText().length() - 1) { out.append('\n'); } + out.append("end\n"); - // if multi-head, we must attach the tail - if (arch.isMulti()) { - // process the multipart tail: - for (GameObject tail = arch.getMultiNext(); tail != null; tail = tail.getMultiNext()) { + // process the multipart tails: + for (GameObject tail = arch.getMultiNext(); tail != null; tail = tail.getMultiNext()) { - if (tail.isHead()) { - ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectWarningMultipartTooShort"); - } + if (tail.isHead()) { + ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectWarningMultipartTooShort"); + } - out.append("More\n"); + out.append("More\n"); - out.append("Object ").append(tail.getArchetypeName()).append('\n'); + out.append("Object ").append(tail.getArchetypeName()).append('\n'); - if (tail.getObjName() != null) { - out.append("name ").append(tail.getObjName()).append('\n'); - } - //if(arch.getFaceName() != null) { - // out.append("face ").append(arch.getFaceName()).append('\n'); - //} - if (tail.getArchTypNr() > 0) { - out.append("type ").append(Integer.toString(tail.getArchTypNr())).append('\n'); - } - if (tail.getMultiShapeID() > 0) { - out.append("mpart_id ").append(Integer.toString(tail.getMultiShapeID())).append('\n'); - } - if (tail.getMultiPartNr() > 0) { - out.append("mpart_nr ").append(Integer.toString(tail.getMultiPartNr())).append('\n'); - } + if (tail.getObjName() != null) { + out.append("name ").append(tail.getObjName()).append('\n'); + } + //if(arch.getFaceName() != null) { + // out.append("face ").append(arch.getFaceName()).append('\n'); + //} + if (tail.getArchTypNr() > 0) { + out.append("type ").append(Integer.toString(tail.getArchTypNr())).append('\n'); + } + if (tail.getMultiShapeID() > 0) { + out.append("mpart_id ").append(Integer.toString(tail.getMultiShapeID())).append('\n'); + } + if (tail.getMultiPartNr() > 0) { + out.append("mpart_nr ").append(Integer.toString(tail.getMultiPartNr())).append('\n'); + } - if (tail.getMsgText() != null) { - out.append("msg\n"); - if (tail.getMsgText().length() > 1) { - out.append(tail.getMsgText()); - if (tail.getMsgText().lastIndexOf('\n') != tail.getMsgText().length() - 1) { - out.append('\n'); - } + if (tail.getMsgText() != null) { + out.append("msg\n"); + if (tail.getMsgText().length() > 1) { + out.append(tail.getMsgText()); + if (tail.getMsgText().lastIndexOf('\n') != tail.getMsgText().length() - 1) { + out.append('\n'); } - out.append("endmsg\n"); } + out.append("endmsg\n"); + } - out.append(tail.getObjectText()); - if (tail.getObjectText().lastIndexOf(0x0a) != tail.getObjectText().length() - 1) { - out.append('\n'); - } + out.append(tail.getObjectText()); + if (tail.getObjectText().lastIndexOf(0x0a) != tail.getObjectText().length() - 1) { + out.append('\n'); + } - // position of multi relative to head - if (tail.getMultiX() != 0) { - out.append("x ").append(Integer.toString(tail.getMultiX())).append('\n'); - } - if (tail.getMultiY() != 0) { - out.append("y ").append(Integer.toString(tail.getMultiY())).append('\n'); - } - out.append("end\n"); + // position of multi relative to head + if (tail.getMultiX() != 0) { + out.append("x ").append(Integer.toString(tail.getMultiX())).append('\n'); + } + if (tail.getMultiY() != 0) { + out.append("y ").append(Integer.toString(tail.getMultiY())).append('\n'); + } - count++; - if (count % 100 == 0) { - progress.setValue(count); - } + out.append("end\n"); + + count++; + if (count % 100 == 0) { + progress.setValue(count); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-03 10:38:08
|
Revision: 1762 http://svn.sourceforge.net/gridarta/?rev=1762&view=rev Author: akirschbaum Date: 2007-02-03 02:38:08 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Unify whitespace and comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/action.properties trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java Modified: trunk/crossfire/src/cfeditor/action.properties =================================================================== --- trunk/crossfire/src/cfeditor/action.properties 2007-02-03 10:25:48 UTC (rev 1761) +++ trunk/crossfire/src/cfeditor/action.properties 2007-02-03 10:38:08 UTC (rev 1762) @@ -66,6 +66,7 @@ exit.icon=EmptySmallIcon + clear.icon=general/Remove16 cut.icon=general/Cut16 Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-03 10:25:48 UTC (rev 1761) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-03 10:38:08 UTC (rev 1762) @@ -175,7 +175,6 @@ // load all arches mainControl.getArchetypeParser().parseArchetypeFromStream(stream, "default", "default", null); } finally { - // close filestream stream.close(); } loadAllCrossfirePNGFromCollect(); @@ -579,6 +578,7 @@ if (tail.getMultiY() != 0) { out.append("y ").append(Integer.toString(tail.getMultiY())).append('\n'); } + out.append("end\n"); count++; Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-02-03 10:25:48 UTC (rev 1761) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-02-03 10:38:08 UTC (rev 1762) @@ -463,7 +463,6 @@ clone.archType = archType; // type attribute of the arch clone.script = new ScriptArchData(clone); - // set coords: clone.setMapX(posx); clone.setMapY(posy); @@ -480,6 +479,7 @@ for (GameObject tmp = getArchetype().getMultiNext(); tmp != null; tmp = tmp.getMultiNext()) { newHead.addTailPart(tmp.createClone(posx + tmp.getMultiX(), posy + tmp.getMultiY())); } + return newHead; } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-02-03 10:25:48 UTC (rev 1761) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-02-03 10:38:08 UTC (rev 1762) @@ -978,6 +978,7 @@ } else { setCurrentLevel(null); } + mapControl.levelCloseNotify(); } refreshMenusAndToolbars(); Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2007-02-03 10:25:48 UTC (rev 1761) +++ trunk/daimonin/src/daieditor/action.properties 2007-02-03 10:38:08 UTC (rev 1762) @@ -153,6 +153,7 @@ prevWindow.icon=navigation/Back16 + onlineHelp.icon=general/Help16 tod.icon=general/TipOfTheDay16 Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 10:25:48 UTC (rev 1761) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 10:38:08 UTC (rev 1762) @@ -127,6 +127,7 @@ if (face == null) { face = CMainControl.getUnknownTileIcon(); } + return face; } @@ -510,6 +511,7 @@ if (arch.isUndefinedArchetype()) { continue; } + if (arch.getArchetypeName().equals(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME)) { // process map arch Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-02-03 10:25:48 UTC (rev 1761) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-02-03 10:38:08 UTC (rev 1762) @@ -212,7 +212,6 @@ event.editParameters(); } else if (task == GameObjectAttributesPanel.SCRIPT_REMOVE) { // first ask for confirmation - //boolean breakpath = (event.getScriptPath().length() > 15); if (JOptionPane.showConfirmDialog(panelList, "Are you sure you want to remove this \"" + typeName(event.getEventType()) + "\" event which is\n" + "linked to the script: '" + event.getScriptPath() + "'?\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 oldEvent.remove(); Modified: trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java 2007-02-03 10:25:48 UTC (rev 1761) +++ trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java 2007-02-03 10:38:08 UTC (rev 1762) @@ -320,7 +320,6 @@ * @param activeArch the currently selected arch */ public void applyArchPanelChanges(final GameObject activeArch) { - if (activeArch == null) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-03 10:49:02
|
Revision: 1763 http://svn.sourceforge.net/gridarta/?rev=1763&view=rev Author: akirschbaum Date: 2007-02-03 02:48:58 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/filter/NamedFilterList.java trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java trunk/crossfire/src/cfeditor/parameter/ArchParameterView.java trunk/crossfire/src/cfeditor/parameter/FilterParameterView.java trunk/crossfire/src/cfeditor/parameter/MapParameterView.java trunk/crossfire/src/cfeditor/parameter/StringParameterView.java trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gui/ReplaceDialog.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -465,8 +465,7 @@ // split display: tree/buttons final JPanel buttonPanel = buildButtonPanel(); - final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, - scrollPane, buttonPanel); + final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, buttonPanel); splitPane.setOneTouchExpandable(false); splitPane.setDividerLocation(frame.getHeight() - buttonPanel.getMinimumSize().height - 4); Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -169,8 +169,7 @@ } setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); - addWindowListener( - new WindowAdapter() { + addWindowListener(new WindowAdapter() { @Override public void windowClosing(final WindowEvent e) { mainControl.exit(); } Modified: trunk/crossfire/src/cfeditor/filter/NamedFilterList.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/NamedFilterList.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/crossfire/src/cfeditor/filter/NamedFilterList.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -410,9 +410,7 @@ for (final FilterComponent fc : components) { log.debug("set sub filter enabled(), calling on " + event.getFilterName()); config.setSubFilterEnabled(event.getFilterName(), event.getFilter(), false); - fc.addFilter(event.getFilterName(), - event.getFilter(), - config.getConfig(event.getFilterName())); + fc.addFilter(event.getFilterName(), event.getFilter(), config.getConfig(event.getFilterName())); } } else if (event.getType() == NamedFilterEventType.REMOVE) { for (final FilterComponent fc : components) { Modified: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -51,8 +51,7 @@ /* try { mainControl.setStatusText("Collect Archfile: write animations"); - final DataOutputStream out = new DataOutputStream( - new BufferedOutputStream(new FileOutputStream("animations"))); + final DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("animations"))); final int count = mainControl.animationObject.getAnimObjectCounter(); Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -388,12 +388,7 @@ /* This is the only method defined by ListCellRenderer. We just * reconfigure the Jlabel each time we're called. */ - @Override public Component getListCellRendererComponent(final JList list, - final Object value, // value to display - final int index, // cell index - final boolean isSelected, // is the cell selected - final boolean cellHasFocus) { // the list and the cell have the focus - + @Override public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { if (SIZE_TESTER.equals(value)) { return editor.getEditorComponent(); } Modified: trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -176,7 +176,8 @@ final JLabel label2 = new JLabel(ACTION_FACTORY.getString("replaceBy")); line3.add(label2); line3.add(Box.createVerticalStrut(5)); - replaceWithBox = new JComboBox(new String[]{ACTION_FACTORY.getString("replaceByObject"), + replaceWithBox = new JComboBox(new String[]{ + ACTION_FACTORY.getString("replaceByObject"), ACTION_FACTORY.getString("replaceByPickmap"), ACTION_FACTORY.getString("replaceByNothing")}); if (replaceArch == null) { Modified: trunk/crossfire/src/cfeditor/parameter/ArchParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/ArchParameterView.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/crossfire/src/cfeditor/parameter/ArchParameterView.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -42,8 +42,7 @@ private final ArchParameter parameter; - public JComponent getConfigComponent(final Object config, - final PluginParameter parameter) { + public JComponent getConfigComponent(final Object config, final PluginParameter parameter) { return this.config; } Modified: trunk/crossfire/src/cfeditor/parameter/FilterParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/FilterParameterView.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/crossfire/src/cfeditor/parameter/FilterParameterView.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -48,8 +48,7 @@ /* (non-Javadoc) * @see cfeditor.PluginParameterView#getConfigComponent(java.lang.Object, cfeditor.PluginParameter) */ - public JComponent getConfigComponent(final Object config, - final PluginParameter parameter) { + public JComponent getConfigComponent(final Object config, final PluginParameter parameter) { return new JPanel(); } Modified: trunk/crossfire/src/cfeditor/parameter/MapParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -85,8 +85,7 @@ /* (non-Javadoc) * @see cfeditor.PluginParameterView#getConfigComponent(java.lang.Object, cfeditor.PluginParameter) */ - public JComponent getConfigComponent(final Object config, - final PluginParameter parameter) { + public JComponent getConfigComponent(final Object config, final PluginParameter parameter) { return this.config; } @@ -94,8 +93,7 @@ private static final long serialVersionUID = 1L; - @Override public Component getListCellRendererComponent(final JList list, final Object value, - final int index, final boolean isSelected, final boolean cellHasFocus) { + @Override public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { final String newVal; if (! (value instanceof MapControl)) { String currentMapName = ""; Modified: trunk/crossfire/src/cfeditor/parameter/StringParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/StringParameterView.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/crossfire/src/cfeditor/parameter/StringParameterView.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -46,8 +46,7 @@ private final StringParameter linkedParameter; - public JComponent getConfigComponent(final Object config, - final PluginParameter parameter) { + public JComponent getConfigComponent(final Object config, final PluginParameter parameter) { return new JPanel(); } Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -310,8 +310,7 @@ final int i; if (line.startsWith("treasure") && (i = line.indexOf(" ")) != -1) { // start of a new treasure section - node = new TreasureTreeNode(line.substring(i).trim(), - line.startsWith("treasureone") ? TreasureObj.TREASUREONE_LIST : TreasureObj.TREASURE_LIST); + node = new TreasureTreeNode(line.substring(i).trim(), line.startsWith("treasureone") ? TreasureObj.TREASUREONE_LIST : TreasureObj.TREASURE_LIST); tmpList.add(node); // put this node to tmplist vector treasureTable.put(node.getTreasureObj().getName(), node); // put it into hashtable tListCount++; @@ -483,8 +482,7 @@ // split display: tree/buttons final JPanel buttonPanel = buildButtonPanel(); - final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, - scrollPane, buttonPanel); + final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, buttonPanel); splitPane.setOneTouchExpandable(false); splitPane.setDividerLocation(frame.getHeight() - buttonPanel.getMinimumSize().height - 4); Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -335,8 +335,7 @@ setLoadedFromArchive(true); // load from the collected files try { - mainControl.getAnimationObjects().loadAnimTree( - new File(new File(mainControl.getArchDefaultFolder(), IGUIConstants.CONFIG_DIR), IGUIConstants.ANIMTREE_FILE)); + mainControl.getAnimationObjects().loadAnimTree(new File(new File(mainControl.getArchDefaultFolder(), IGUIConstants.CONFIG_DIR), IGUIConstants.ANIMTREE_FILE)); loadAllDaimoninAnimationsFromCollect(); // open the resource file final String baseDir = CMainControl.getInstance().getArchDefaultFolder(); @@ -344,9 +343,7 @@ try { // load all arches mainControl.getArchetypeParser().parseArchetypeFromStream(stream, "default", "default", IGUIConstants.ARCH_FILE); - mainControl.getFaceObjects().loadFacesCollection( - new File(mainControl.getArchDefaultFolder(), IGUIConstants.PNG_FILE), - new File(new File(mainControl.getArchDefaultFolder(), IGUIConstants.CONFIG_DIR), IGUIConstants.FACETREE_FILE) + mainControl.getFaceObjects().loadFacesCollection(new File(mainControl.getArchDefaultFolder(), IGUIConstants.PNG_FILE), new File(new File(mainControl.getArchDefaultFolder(), IGUIConstants.CONFIG_DIR), IGUIConstants.FACETREE_FILE) ); } finally { stream.close(); Modified: trunk/daimonin/src/daieditor/gui/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/ReplaceDialog.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/daimonin/src/daieditor/gui/ReplaceDialog.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -180,7 +180,8 @@ final JLabel label2 = new JLabel(ACTION_FACTORY.getString("replaceBy")); line3.add(label2); line3.add(Box.createVerticalStrut(5)); - replaceWithBox = new JComboBox(new String[]{ACTION_FACTORY.getString("replaceByObject"), + replaceWithBox = new JComboBox(new String[]{ + ACTION_FACTORY.getString("replaceByObject"), ACTION_FACTORY.getString("replaceByCopyBuffer"), ACTION_FACTORY.getString("replaceByPickmap"), ACTION_FACTORY.getString("replaceByNothing")}); Modified: trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -419,9 +419,7 @@ mapSize = new Size2D(width, height); /* if (fieldDarkness > 1000) { - mainControl.showMessage( - "Illegal Value", - "Darkness level must be in range 0-1000." ); + mainControl.showMessage("Illegal Value", "Darkness level must be in range 0-1000." ); return false; }*/ if (mapName.getText().length() == 0) { Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -867,8 +867,7 @@ /** {@inheritDoc} */ public void actionPerformed(final ActionEvent e) { final JEditTextArea textArea = getTextArea(e); - textArea.setOverwriteEnabled( - !textArea.isOverwriteEnabled()); + textArea.setOverwriteEnabled(!textArea.isOverwriteEnabled()); } } Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2007-02-03 10:38:08 UTC (rev 1762) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2007-02-03 10:48:58 UTC (rev 1763) @@ -1631,17 +1631,9 @@ final int centerWidth = size.width - rightWidth - ileft - iright; final int centerHeight = size.height - bottomHeight - itop - ibottom; - center.setBounds( - ileft, - itop, - centerWidth, - centerHeight); + center.setBounds(ileft, itop, centerWidth, centerHeight); - right.setBounds( - ileft + centerWidth, - itop, - rightWidth, - centerHeight); + right.setBounds(ileft + centerWidth, itop, rightWidth, centerHeight); // Lay out all status components, in order for (Component comp : leftOfScrollBar) { @@ -1650,11 +1642,7 @@ ileft += dim.width; } - bottom.setBounds( - ileft, - itop + centerHeight, - size.width - rightWidth - ileft - iright, - bottomHeight); + bottom.setBounds(ileft, itop + centerHeight, size.width - rightWidth - ileft - iright, bottomHeight); } // private members This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-03 11:02:34
|
Revision: 1764 http://svn.sourceforge.net/gridarta/?rev=1764&view=rev Author: akirschbaum Date: 2007-02-03 03:02:35 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Remove redundant calls to super() constructor. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CResourceLoader.java trunk/crossfire/src/cfeditor/CScriptController.java trunk/crossfire/src/cfeditor/CScriptModel.java trunk/crossfire/src/cfeditor/CScriptView.java trunk/crossfire/src/cfeditor/gui/ScriptEditor.java trunk/crossfire/src/cfeditor/parameter/ArchParameter.java trunk/crossfire/src/cfeditor/parameter/ArchParameterView.java trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java trunk/crossfire/src/cfeditor/parameter/FilterParameter.java trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java trunk/crossfire/src/cfeditor/parameter/MapParameter.java trunk/crossfire/src/cfeditor/parameter/MapParameterView.java trunk/crossfire/src/cfeditor/parameter/ParameterDescriptionEditor.java trunk/crossfire/src/cfeditor/parameter/ParameterNameEditor.java trunk/crossfire/src/cfeditor/parameter/StringParameterView.java trunk/src/app/net/sf/gridarta/ArchTypeParseException.java Modified: trunk/crossfire/src/cfeditor/CResourceLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/CResourceLoader.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/CResourceLoader.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -87,7 +87,6 @@ * @param checkJAR Enable check for resource in JAR */ public CResourceLoader(String filename, final boolean checkCurrent, final boolean checkHome, final boolean checkJAR) { - super(); this.filename = filename; /*First, try current directory*/ if (checkCurrent) { Modified: trunk/crossfire/src/cfeditor/CScriptController.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptController.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/CScriptController.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -75,7 +75,6 @@ private final CResourceLoader scriptRsc; public CScriptController(final CMainControl mainControl) { - super(); view = new CScriptView(this); addChangeListener(view); this.mainControl = mainControl; Modified: trunk/crossfire/src/cfeditor/CScriptModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptModel.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/CScriptModel.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -71,7 +71,6 @@ private final CScriptController ctrl; public CScriptModel(final CScriptController ctrl) { - super(); this.ctrl = ctrl; } Modified: trunk/crossfire/src/cfeditor/CScriptView.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptView.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/CScriptView.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -85,7 +85,6 @@ * @warning Creating a view from a controller instead of a model is error prone. */ public CScriptView(final CScriptController controller) { - super(); this.ctrl = controller; } Modified: trunk/crossfire/src/cfeditor/gui/ScriptEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -127,7 +127,6 @@ * @param script the script object to edit */ public ScriptEditor(final CScriptModel script) { - super(); this.script = script; final JTabbedPane tabs = new JTabbedPane(); this.setLayout(new BorderLayout()); Modified: trunk/crossfire/src/cfeditor/parameter/ArchParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/ArchParameter.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/parameter/ArchParameter.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -39,7 +39,6 @@ private String valueString; public ArchParameter() { - super(); parameterType = getParameterType(); } Modified: trunk/crossfire/src/cfeditor/parameter/ArchParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/ArchParameterView.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/parameter/ArchParameterView.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -51,7 +51,6 @@ } public ArchParameterView(final ArchParameter param) { - super(); parameter = param; value.setSelectedItem(param.getValue()); value.addItemListener(new ItemListener() { Modified: trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -126,7 +126,6 @@ private static final long serialVersionUID = 1L; private TooltipSpinner() { - super(); } private TooltipSpinner(final SpinnerModel model) { Modified: trunk/crossfire/src/cfeditor/parameter/FilterParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/FilterParameter.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/parameter/FilterParameter.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -35,7 +35,6 @@ public class FilterParameter extends PluginParameter { public FilterParameter() { - super(); parameterType = getParameterType(); } Modified: trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -122,7 +122,6 @@ private static final long serialVersionUID = -797350272052837471L; private TooltipSpinner() { - super(); } private TooltipSpinner(final SpinnerModel model) { Modified: trunk/crossfire/src/cfeditor/parameter/MapParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/MapParameter.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/parameter/MapParameter.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -35,7 +35,6 @@ public class MapParameter extends PluginParameter { public MapParameter() { - super(); parameterType = getParameterType(); } Modified: trunk/crossfire/src/cfeditor/parameter/MapParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -52,7 +52,6 @@ private final JComboBox value; public MapParameterView(final MapParameter param) { - super(); this.parameter = param; value = new JComboBox(); final MyComboBoxModel myModel = new MyComboBoxModel(); Modified: trunk/crossfire/src/cfeditor/parameter/ParameterDescriptionEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/ParameterDescriptionEditor.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/parameter/ParameterDescriptionEditor.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -38,7 +38,6 @@ private static final long serialVersionUID = 1L; public ParameterDescriptionEditor(final PluginParameter param) { - super(); parameter = param; setText(param.getDescription()); getDocument().addDocumentListener(new DocumentListener() { Modified: trunk/crossfire/src/cfeditor/parameter/ParameterNameEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/ParameterNameEditor.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/parameter/ParameterNameEditor.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -38,7 +38,6 @@ private static final long serialVersionUID = 1L; public ParameterNameEditor(final PluginParameter param) { - super(); parameter = param; setText(param.getName()); getDocument().addDocumentListener(new DocumentListener() { Modified: trunk/crossfire/src/cfeditor/parameter/StringParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/StringParameterView.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/crossfire/src/cfeditor/parameter/StringParameterView.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -63,7 +63,6 @@ } public StringParameterView(final StringParameter parameter) { - super(); linkedParameter = parameter; final Document d = value.getDocument(); d.addDocumentListener(new DocumentListener() { Modified: trunk/src/app/net/sf/gridarta/ArchTypeParseException.java =================================================================== --- trunk/src/app/net/sf/gridarta/ArchTypeParseException.java 2007-02-03 10:48:58 UTC (rev 1763) +++ trunk/src/app/net/sf/gridarta/ArchTypeParseException.java 2007-02-03 11:02:35 UTC (rev 1764) @@ -31,7 +31,6 @@ * Create an ArchTypeParseException. */ public ArchTypeParseException() { - super(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-03 12:06:51
|
Revision: 1765 http://svn.sourceforge.net/gridarta/?rev=1765&view=rev Author: akirschbaum Date: 2007-02-03 04:06:44 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Unify text messages. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/crossfire/src/cfeditor/messages_fr.properties trunk/crossfire/src/cfeditor/messages_sv.properties trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-02-03 11:02:35 UTC (rev 1764) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-02-03 12:06:44 UTC (rev 1765) @@ -812,7 +812,7 @@ /** Invoked when user wants to open a file. */ public void open() { final JFileChooser fileChooser = new JFileChooser(); - fileChooser.setDialogTitle("Open Map File"); + fileChooser.setDialogTitle(ACTION_FACTORY.getString("fileDialog.title")); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); fileChooser.setMultiSelectionEnabled(false); Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-02-03 11:02:35 UTC (rev 1764) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-02-03 12:06:44 UTC (rev 1765) @@ -610,7 +610,8 @@ view.moveToFront(); view.show(); return; - } catch (final PropertyVetoException cantUniconify) { + } catch (final PropertyVetoException e) { + log.warn(ACTION_FACTORY.format("logUnexpectedException", e)); } } } else { Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-02-03 11:02:35 UTC (rev 1764) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-02-03 12:06:44 UTC (rev 1765) @@ -27,6 +27,7 @@ import java.io.IOException; import net.sf.gridarta.gameobject.AbstractArchetypeParser; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; +import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -45,6 +46,9 @@ /** Logger. */ private static final Logger log = Logger.getLogger(ArchetypeParser.class); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + private final CMainControl mainControl; /** @@ -66,7 +70,7 @@ in.close(); } } catch (final FileNotFoundException e) { - log.error("Archfile " + fname + " could not be found"); + log.warn(ACTION_FACTORY.format("logArchfileNotFound", fname)); } catch (final IOException e) { log.error("IOException in parseDefArch!"); } @@ -143,7 +147,7 @@ try { mainControl.getAnimationObjects().addAnimationObject(archetype.getArchetypeName(), archetype.getAnimText()); } catch (final DuplicateAnimationException e) { - log.warn("Duplicate Animation " + archetype.getArchetypeName(), e); + log.warn(ACTION_FACTORY.format("logDuplicateAnimation", e)); } archetype.addObjectText("animation " + archetype.getArchetypeName()); @@ -160,7 +164,7 @@ archetype.addLoreText(thisLine + "\n"); } } else if (thisLine.startsWith("Object")) { - log.error("Find inventory Object in def arch: " + thisLine); + log.warn(ACTION_FACTORY.format("logInventoryInDefArch", thisLine)); } else if (thisLine.startsWith("end")) { // we got full arch parsearch = false; // we write this sucker @@ -188,7 +192,7 @@ archetype.setEditorFolder(panel+"/"+folder); } else { archetype.setEditorFolder("intern"); - } + } } postParseArchetype(archetype); archetype.setIsArchetype(); @@ -236,13 +240,13 @@ } } 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()); + log.warn(ACTION_FACTORY.format("logFoundCoordInDefArchSingleTileOrHead", "x", 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()); + log.warn(ACTION_FACTORY.format("logFoundCoordInDefArchSingleTileOrHead", "y", archetype.getArchetypeName())); archetype.addObjectText(thisLine); } archetype.setMultiY(Integer.parseInt(thisLine.substring(2))); @@ -251,10 +255,10 @@ 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) + ")"); + log.warn(ACTION_FACTORY.format("logDefArchWithZeroType", archetype.getArchetypeName())); } - } catch (final Exception e) { - log.warn("Arch " + archetype.getArchetypeName() + " has a invalid type nr. (" + thisLine.substring(5) + ")"); + } catch (final NumberFormatException e) { + log.warn(ACTION_FACTORY.format("logDefArchWithInvalidTypeNr", archetype.getArchetypeName(), thisLine.substring(5))); archetype.addObjectText(thisLine); } } else if (thisLine.startsWith("face ")) { Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-03 11:02:35 UTC (rev 1764) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-03 12:06:44 UTC (rev 1765) @@ -41,6 +41,7 @@ import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import net.sf.gridarta.gameobject.face.DuplicateFaceException; import net.sf.gridarta.io.IOUtils; +import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.misc.Progress; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -55,6 +56,9 @@ private static final Logger log = Logger.getLogger(ArchetypeSet.class); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + private final CMainControl mainControl; /** @@ -143,9 +147,7 @@ // print message if no arches were found if (getArchetypeCount() == 0) { setLoadStatus(LoadStatus.EMPTY); // status: stack is empty - mainControl.showMessage("No Archfiles", "No archfiles could be found. If you have no archfiles\n" + - "yet, you need to download them. If you do, make sure\n" + - "the path is correct under menu 'File->Options'.\n"); + ACTION_FACTORY.showMessageDialog(mainControl.getMainView(), "loadArchesNoArchfiles"); } else { // display the time it took to load arches: setLoadStatus(LoadStatus.COMPLETE); // status: stack completed @@ -596,7 +598,7 @@ // check if we still missed any arches if (count - getArchetypeCount() != 0) { - log.warn((getArchetypeCount() - count) + " archetypes have been missed during collect!"); + ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectWarningMissed", getArchetypeCount() - count); } progress.setValue(count); } finally { Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2007-02-03 11:02:35 UTC (rev 1764) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2007-02-03 12:06:44 UTC (rev 1765) @@ -31,6 +31,7 @@ import java.util.Iterator; import net.sf.gridarta.gameobject.face.AbstractFaceObjects; import net.sf.gridarta.gameobject.face.DuplicateFaceException; +import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.misc.Progress; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -44,6 +45,9 @@ /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(FaceObjects.class); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + /** * Adds a new face object. * @param faceName name of face, e.g. <samp>"robe.101"</samp> @@ -83,11 +87,12 @@ } final FaceObject faceObject1 = it.next(); + final String path1 = faceObject1.getPath(); final FileInputStream fin1; try { - fin1 = new FileInputStream(faceObject1.getPath()); + fin1 = new FileInputStream(path1); } catch (final FileNotFoundException e) { - log.warn("Could not open input file " + faceObject1.getPath()); + ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorFileNotFound", path1); return; } @@ -96,12 +101,12 @@ try { numBytes = fin1.read(b, 0, 50000); } catch (final IOException e) { - log.error("Unexpected exception: ", e); + ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorIOException", path1, e); return; } if (numBytes == -1) { - log.error("Unexpected EOF: " + faceObject1.getPath() + " >> " + numBytes); + ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorFileUnexpectedEOF", path1); return; } @@ -110,19 +115,22 @@ out.write(b, 0, numBytes); // now write all pngs into the file - progress.setLabel("Collecting Images...", size()); + final int numOfFaceObjects = size(); + progress.setLabel(ACTION_FACTORY.getString("archCollectImages"), numOfFaceObjects); for (int i = 0; it.hasNext(); i++) { final FaceObject faceObject2 = it.next(); + final String path2 = faceObject2.getPath(); + final FileInputStream fin2; try { // try to open the png image file - fin2 = new FileInputStream(faceObject2.getPath()); + fin2 = new FileInputStream(path2); } catch (final ArrayIndexOutOfBoundsException e) { log.warn("You have to give me the name of a file to open."); return; } catch (final FileNotFoundException e) { - log.warn("Could not open input file " + faceObject2.getPath()); + ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorFileNotFound", path2); return; } @@ -130,12 +138,12 @@ // read size and byte-data from png file numBytes = fin2.read(b, 0, 50000); } catch (final IOException e) { - log.error("Unexpected exception ", e); + ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorIOException", path2, e); return; } if (numBytes == -1) { - log.warn("Unexpected EOF: " + faceObject2.getPath() + " >> " + numBytes); + ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorFileUnexpectedEOF", path2); return; } Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2007-02-03 11:02:35 UTC (rev 1764) +++ trunk/crossfire/src/cfeditor/messages.properties 2007-02-03 12:06:44 UTC (rev 1765) @@ -58,6 +58,8 @@ enterExitNotSaved.title=Map not saved enterExitNotSaved.message=You must save the map first to follow a relative path. +loadArchesNoArchfiles.title=No archfiles +loadArchesNoArchfiles.message=No archfiles could be found. If you have no archfiles\nyet, you need to download them. If you do, make sure\nthe path is correct under menu ''File->Options''. openScriptNotFound.title=Script file not found openScriptNotFound.message=The file ''{0}'' does not exist.\nPlease correct the path. @@ -100,11 +102,22 @@ optionsImageSet=Image Set +archCollectImages=Collecting Images... + +archCollectWarningMissed.title=Collect warning +archCollectWarningMissed.message=Collect Warning: {0} arches have been missed during collect! +archCollectErrorFileNotFound.title=Collect error +archCollectErrorFileNotFound.message=Collect Error: Cannot open input file\n{0} +archCollectErrorFileUnexpectedEOF.title=Collect error +archCollectErrorFileUnexpectedEOF.message=Collect Error: Unexpected EOF in\n{0} + + ####### # File file.text=File file.mnemonic=F +fileDialog.title=Open map or script files createNew.text=New... createNew.shortdescription=Create new map @@ -484,3 +497,13 @@ moveTileUp.shortdescription=Move Object up in Square moveTileDown.shortdescription=Move Object down in Square moveTileBottom.shortdescription=Move Object to bottom of Square + + +####################### +# Various Log Messages +logArchfileNotFound=Archfile {0} could not be found +logDuplicateAnimation=Duplicate Animation: {0} +logInventoryInDefArch=Found inventory Object in def arch: {0} +logFoundCoordInDefArchSingleTileOrHead=Found {0} cmd in single tile or head (add it to arch text): {0} +logDefArchWithZeroType=Arch {0} type number is zero. +logDefArchWithInvalidTypeNr=Arch {0} has an invalid type nr: {1} Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2007-02-03 11:02:35 UTC (rev 1764) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2007-02-03 12:06:44 UTC (rev 1765) @@ -53,6 +53,8 @@ enterExitNotSaved.title=Karte nicht gesichert enterExitNotSaved.message=Der Ausgang verwendet einen relativen Dateinamen. Um ihm zu folgen m\xFCssen Sie die Karte vorher sichern. +loadArchesNoArchfiles.title=Keine Archetypen gefunden +loadArchesNoArchfiles.message=Es konnten keine Archetypen gefunden werden.\nBitte stellen Sie sicher, dass der Pfad\nunter ''Datei->Optionen...'' korrekt ist. openScriptNotFound.title=Script-Datei nicht gefunden openScriptNotFound.message=Die Datei ''{0}'' existiert nicht.\nBitte geben sie einen g\xFCltigen Dateinamen an. @@ -95,11 +97,22 @@ optionsImageSet=Image Set +archCollectImages=Sammle Bilder... + +archCollectWarningMissed.title=Fehler beim Sammeln +archCollectWarningMissed.message=Warnung: Beim Sammeln der Archetypen sind wurden {0} Archetypen nicht gefunden. +archCollectErrorFileNotFound.title=Fehler beim Sammeln +archCollectErrorFileNotFound.message=Kann Eingabedatei nicht \xF6ffnen:\n{0} +archCollectErrorFileUnexpectedEOF.title=Fehler beim Sammeln +archCollectErrorFileUnexpectedEOF.message=Unerwartetes Dateiende erreicht in\n{0} + + ####### # File file.text=Datei file.mnemonic=D +fileDialog.title=Karten- oder Script-Dateien \xF6ffnen createNew.text=Neu... createNew.shortdescription=Erzeuge neue Karte Modified: trunk/crossfire/src/cfeditor/messages_fr.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_fr.properties 2007-02-03 11:02:35 UTC (rev 1764) +++ trunk/crossfire/src/cfeditor/messages_fr.properties 2007-02-03 12:06:44 UTC (rev 1765) @@ -54,6 +54,8 @@ #enterExitNotSaved.title= #enterExitNotSaved.message= +#loadArchesNoArchfiles.title= +#loadArchesNoArchfiles.message= #openScriptNotFound.title= #openScriptNotFound.message= @@ -96,11 +98,22 @@ #optionsImageSet= +#archCollectImages= + +#archCollectWarningMissed.title= +#archCollectWarningMissed.message= +#archCollectErrorFileNotFound.title= +#archCollectErrorFileNotFound.message= +#archCollectErrorFileUnexpectedEOF.title= +#archCollectErrorFileUnexpectedEOF.message= + + ####### # File file.text=Fichier file.mnemonic=F +fileDialog.title=Ouvrir fichier carte ou script createNew.text=Nouveau createNew.shortdescription=Cr\xE9er une nouvelle carte Modified: trunk/crossfire/src/cfeditor/messages_sv.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_sv.properties 2007-02-03 11:02:35 UTC (rev 1764) +++ trunk/crossfire/src/cfeditor/messages_sv.properties 2007-02-03 12:06:44 UTC (rev 1765) @@ -54,6 +54,8 @@ #enterExitNotSaved.title= #enterExitNotSaved.message= +loadArchesNoArchfiles.title=Inga arketypfiler +loadArchesNoArchfiles.message=Inga arketypfiler kunde hittas. Om du saknar arketypfiler\n m\xE5ste du ladda hem dom. Om du g\xF6r detta, se till\natt s\xF6kv\xE4gen under ''Arkiv->Inst\xE4llningar'' \xE4r korrekt. openScriptNotFound.title=Kunde inte hitta scriptfil openScriptNotFound.message=Filen ''{0}'' finns inte.\nV\xE4r v\xE4nlig korrigera s\xF6kv\xE4gen. @@ -96,11 +98,22 @@ #optionsImageSet= +archCollectImages=Sammanst\xE4ller bilder... + +archCollectWarningMissed.title=Varning under sammanst\xE4llning +archCollectWarningMissed.message=Varning under sammanst\xE4llning: {0} arketyper saknades under sammanst\xE4llningen! +archCollectErrorFileNotFound.title=Fel under sammanst\xE4llning +archCollectErrorFileNotFound.message=Fel under sammanst\xE4llning: kan inte \xF6ppna fil\n{0} +archCollectErrorFileUnexpectedEOF.title=Fel under sammanst\xE4llning +archCollectErrorFileUnexpectedEOF.message=Fel under sammanst\xE4llning: ov\xE4ntat filslut i\n{0} + + ####### # File file.text=Arkiv file.mnemonic=A +fileDialog.title=\xD6ppna kart- eller scriptfiler createNew.text=Ny createNew.shortdescription=Ny karta Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-02-03 11:02:35 UTC (rev 1764) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-02-03 12:06:44 UTC (rev 1765) @@ -73,7 +73,7 @@ in.close(); } } catch (final FileNotFoundException e) { - log.warn(ACTION_FACTORY.format("archfileNotFound", fname)); + log.warn(ACTION_FACTORY.format("logArchfileNotFound", fname)); } catch (final IOException e) { // TODO } @@ -172,7 +172,7 @@ mainControl.getAnimationObjects().addAnimationObject(archetype.getArchetypeName(), animText.toString()); } catch (final DuplicateAnimationException e) { // TODO: Report to the user - log.warn(ACTION_FACTORY.format("duplicateAnimation", e)); + log.warn(ACTION_FACTORY.format("logDuplicateAnimation", e)); } archetype.addObjectText("animation " + archetype.getArchetypeName()); @@ -185,7 +185,7 @@ animText.append(thisLine).append("\n"); } } else if (thisLine.startsWith("Object")) { - log.warn(ACTION_FACTORY.format("inventoryInDefArch", thisLine)); + log.warn(ACTION_FACTORY.format("logInventoryInDefArch", thisLine)); } else if (thisLine.startsWith("end")) { // we got full arch parsearch = false; // we write this sucker @@ -198,7 +198,7 @@ if (firstArch.getMultiRefCount() == 2) { firstArch.setMultiShapeID(multiShapeID); } else if (multiShapeID != firstArch.getMultiShapeID()) { - log.warn(ACTION_FACTORY.format("defArchWithInvalidMpartNr", archetype.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID()))); + log.warn(ACTION_FACTORY.format("logDefArchWithInvalidMpartNr", archetype.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID()))); } } else { // add arch to the archpanel - only if it is not the map arch and not in the intern folder @@ -273,14 +273,14 @@ } } else if (thisLine.startsWith("x ")) { if (!archmore && !archetype.getArchetypeName().equals(STARTARCH_NAME)) { - log.warn(ACTION_FACTORY.format("foundCoordInDefArchSingleTileOrHead", "x", archetype.getArchetypeName())); + log.warn(ACTION_FACTORY.format("logFoundCoordInDefArchSingleTileOrHead", "x", archetype.getArchetypeName())); archetype.addObjectText(thisLine); } else { archetype.setMultiX(Integer.parseInt(thisLine.substring(2))); } } else if (thisLine.startsWith("y ")) { if (!archmore && !archetype.getArchetypeName().equals(STARTARCH_NAME)) { - log.warn(ACTION_FACTORY.format("foundCoordInDefArchSingleTileOrHead", "y", archetype.getArchetypeName())); + log.warn(ACTION_FACTORY.format("logFoundCoordInDefArchSingleTileOrHead", "y", archetype.getArchetypeName())); archetype.addObjectText(thisLine); } else { archetype.setMultiY(Integer.parseInt(thisLine.substring(2))); @@ -290,17 +290,17 @@ final int i = Integer.parseInt(thisLine.substring(5)); archetype.setArchTypNr(i); if (i == 0) { - log.warn(ACTION_FACTORY.format("defArchWithZeroType", archetype.getArchetypeName())); + log.warn(ACTION_FACTORY.format("logDefArchWithZeroType", archetype.getArchetypeName())); } } catch (final NumberFormatException e) { - log.warn(ACTION_FACTORY.format("defArchWithInvalidTypeNr", archetype.getArchetypeName(), thisLine.substring(5))); + log.warn(ACTION_FACTORY.format("logDefArchWithInvalidTypeNr", archetype.getArchetypeName(), thisLine.substring(5))); archetype.addObjectText(thisLine); } } else if (thisLine.startsWith("direction ")) { try { archetype.setDirection(Integer.parseInt(thisLine.substring(10))); } catch (final NumberFormatException e) { - log.warn(ACTION_FACTORY.format("defArchWithInvalidDirection", archetype.getArchetypeName(), thisLine.substring(10))); + log.warn(ACTION_FACTORY.format("logDefArchWithInvalidDirection", archetype.getArchetypeName(), thisLine.substring(10))); } archetype.addObjectText(thisLine); } else if (thisLine.startsWith("face ")) { Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2007-02-03 11:02:35 UTC (rev 1764) +++ trunk/daimonin/src/daieditor/messages.properties 2007-02-03 12:06:44 UTC (rev 1765) @@ -821,15 +821,15 @@ canonIOE=IOException while canonizing path: {0} exitWithExit=Exiting with System.exit(). exitWithoutExit=Trying to exit without System.exit(). -archfileNotFound=Archfile {0} could not be found +logArchfileNotFound=Archfile {0} could not be found faceObjectWithoutOriginalName=No originalName for {0}! -duplicateAnimation=Duplicate Animation: {0} -inventoryInDefArch=Found inventory Object in def arch: {0} -foundCoordInDefArchSingleTileOrHead=Found {0} cmd in single tile or head (add it to arch text): {0} -defArchWithZeroType=Arch {0} type number is zero. -defArchWithInvalidTypeNr=Arch {0} has an invalid type nr: {1} -defArchWithInvalidDirection=Arch {0} has an invalid direction: {1} -defArchWithInvalidMpartNr=Arch part {0} has mpart_nr {2}, but head part {1} has mpart_nr {3} +logDuplicateAnimation=Duplicate Animation: {0} +logInventoryInDefArch=Found inventory Object in def arch: {0} +logFoundCoordInDefArchSingleTileOrHead=Found {0} cmd in single tile or head (add it to arch text): {0} +logDefArchWithZeroType=Arch {0} type number is zero. +logDefArchWithInvalidTypeNr=Arch {0} has an invalid type nr: {1} +logDefArchWithInvalidDirection=Arch {0} has an invalid direction: {1} +logDefArchWithInvalidMpartNr=Arch part {0} has mpart_nr {2}, but head part {1} has mpart_nr {3} ################ Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2007-02-03 11:02:35 UTC (rev 1764) +++ trunk/daimonin/src/daieditor/messages_de.properties 2007-02-03 12:06:44 UTC (rev 1765) @@ -131,8 +131,8 @@ #importSpellsSuccess.message= #importSpellsFailed.title= #importSpellsFailed.message= -#loadArchesNoArchfiles.title= -#loadArchesNoArchfiles.message= +loadArchesNoArchfiles.title=Keine Archetypen gefunden +loadArchesNoArchfiles.message=Es konnten keine Archetypen gefunden werden.\nBitte stellen Sie sicher, dass der Pfad\nunter ''Datei->Optionen...'' korrekt ist. #openScriptNotFound.title= #openScriptNotFound.message= #newMapDifficultyNotANumber.title= @@ -237,15 +237,15 @@ #archCollectArches= #archCollectAnimations= -#archCollectImages= +archCollectImages=Sammle Bilder... #archCollectDone= #archCollectWarningMultipartTailInPanel.title= #archCollectWarningMultipartTailInPanel.message= #archCollectWarningMultipartTooShort.title= #archCollectWarningMultipartTooShort.message= -#archCollectWarningMissed.title= -#archCollectWarningMissed.message= +archCollectWarningMissed.title=Fehler beim Sammeln +archCollectWarningMissed.message=Warnung: Beim Sammeln der Archetypen sind wurden {0} Archetypen nicht gefunden. #archCollectErrorFileNotFound.title= #archCollectErrorFileNotFound.message= #archCollectErrorFileUnexpectedEOF.title= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-03 12:30:04
|
Revision: 1773 http://svn.sourceforge.net/gridarta/?rev=1773&view=rev Author: christianhujer Date: 2007-02-03 04:30:03 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Unified javadoc comment of Logger declarations. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFJavaEditor.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CGUIUtils.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CResourceLoader.java trunk/crossfire/src/cfeditor/CScriptController.java trunk/crossfire/src/cfeditor/CScriptModel.java trunk/crossfire/src/cfeditor/CScriptView.java trunk/crossfire/src/cfeditor/CSettings.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/PluginParameterFactory.java trunk/crossfire/src/cfeditor/Spells.java trunk/crossfire/src/cfeditor/filter/AttributeFilter.java trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java trunk/crossfire/src/cfeditor/filter/NamedFilterList.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/ArchetypeChooser.java trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java trunk/crossfire/src/cfeditor/gui/ScriptEditor.java trunk/crossfire/src/cfeditor/gui/ScriptManager.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java trunk/crossfire/src/cfeditor/io/CMapReader.java trunk/crossfire/src/cfeditor/io/CMapWriter.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java trunk/crossfire/src/cfeditor/parameter/MapParameterView.java trunk/crossfire/src/cfeditor/parameter/StringParameter.java trunk/crossfire/src/cfeditor/parameter/StringParameterView.java trunk/daimonin/src/daieditor/CFArchTypeList.java trunk/daimonin/src/daieditor/CFJavaEditor.java trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CGUIUtils.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/MultiPositionData.java trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java trunk/daimonin/src/daieditor/io/CMapReader.java trunk/daimonin/src/daieditor/io/CMapWriter.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/app/net/sf/gridarta/CAttribBitmask.java trunk/src/app/net/sf/gridarta/CFArchAttrib.java trunk/src/app/net/sf/gridarta/CFArchType.java trunk/src/app/net/sf/gridarta/CFArchTypeList.java trunk/src/app/net/sf/gridarta/Spells.java trunk/src/app/net/sf/gridarta/data/NamedTreeNode.java trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/connectionview/Connection.java trunk/src/app/net/sf/gridarta/help/HtmlPane.java trunk/src/app/net/sf/gridarta/map/AbstractMapModel.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java trunk/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.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/TextAreaPainter.java Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -38,6 +38,7 @@ */ public final class AutojoinList { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(AutojoinList.class); private static final String FILENAME = "autojoin.txt"; // file with autojoin lists Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -25,10 +25,7 @@ import java.awt.Component; import java.util.HashSet; import javax.xml.parsers.ParserConfigurationException; -import net.sf.gridarta.CFArchType; import org.apache.log4j.Logger; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * This class handles all the CFArchTypes and makes them conveniently @@ -38,6 +35,7 @@ */ public final class CFArchTypeList extends net.sf.gridarta.CFArchTypeList<GameObject, MapArchObject, Archetype> { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CFArchTypeList.class); private final Spells spells = new Spells(); Modified: trunk/crossfire/src/cfeditor/CFJavaEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/CFJavaEditor.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CFJavaEditor.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -38,6 +38,7 @@ */ public final class CFJavaEditor { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CFJavaEditor.class); /** Prevent instantiation (UtilityClass). */ Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -67,6 +67,7 @@ */ public final class CFTreasureListTree extends net.sf.gridarta.CFTreasureListTree { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CFTreasureListTree.class); /** Action Factory. */ Modified: trunk/crossfire/src/cfeditor/CGUIUtils.java =================================================================== --- trunk/crossfire/src/cfeditor/CGUIUtils.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CGUIUtils.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -43,6 +43,7 @@ */ public final class CGUIUtils { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CGUIUtils.class); private static final Map<String, ImageIcon> imageCache = new HashMap<String, ImageIcon>(); Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -88,7 +88,7 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CMainControl.class); /** Singleton instance reference. */ Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -76,7 +76,7 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CMainView.class); /** The key used to store the selected L'n'F to INI file. */ Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -30,10 +30,6 @@ import cfeditor.map.MapModel; import java.awt.Point; import java.awt.Rectangle; -import java.awt.event.InputEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseMotionListener; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -78,6 +74,7 @@ */ public final class CMapViewBasic extends JScrollPane implements MapModelListener<GameObject, MapArchObject, Archetype>, MapCursorListener { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CMapViewBasic.class); /** Serial Version UID. */ Modified: trunk/crossfire/src/cfeditor/CResourceLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/CResourceLoader.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CResourceLoader.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -53,6 +53,7 @@ */ public final class CResourceLoader { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CResourceLoader.class); /** The current working directory location. */ Modified: trunk/crossfire/src/cfeditor/CScriptController.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptController.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CScriptController.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -62,6 +62,7 @@ */ public final class CScriptController { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CScriptController.class); private final LinkedHashMap<String, CScriptModel> scripts = new LinkedHashMap<String, CScriptModel>(); Modified: trunk/crossfire/src/cfeditor/CScriptModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptModel.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CScriptModel.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -44,6 +44,7 @@ */ public final class CScriptModel { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CScriptModel.class); public static final int PLUGIN_AUTOBOOT = 1; Modified: trunk/crossfire/src/cfeditor/CScriptView.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptView.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CScriptView.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -31,7 +31,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; @@ -49,7 +48,6 @@ import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; -import javax.swing.JSeparator; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.filechooser.FileFilter; @@ -67,6 +65,7 @@ /** Action Factory to create Actions. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CScriptView.class); private final CScriptController ctrl; Modified: trunk/crossfire/src/cfeditor/CSettings.java =================================================================== --- trunk/crossfire/src/cfeditor/CSettings.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CSettings.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -42,6 +42,7 @@ */ @Deprecated public final class CSettings { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CSettings.class); /** The properties object that contains the settings. */ Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -44,6 +44,7 @@ */ public final class CopyBuffer extends net.sf.gridarta.CopyBuffer { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CopyBuffer.class); /** Reference to main control. */ Modified: trunk/crossfire/src/cfeditor/PluginParameterFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/PluginParameterFactory.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/PluginParameterFactory.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -44,6 +44,7 @@ */ public final class PluginParameterFactory { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(PluginParameterFactory.class); private static final LinkedHashMap<String, Class<? extends PluginParameter>> parameterTypes; Modified: trunk/crossfire/src/cfeditor/Spells.java =================================================================== --- trunk/crossfire/src/cfeditor/Spells.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/Spells.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -42,6 +42,7 @@ */ public final class Spells extends net.sf.gridarta.Spells { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(Spells.class); /** Modified: trunk/crossfire/src/cfeditor/filter/AttributeFilter.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/AttributeFilter.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/filter/AttributeFilter.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -52,6 +52,7 @@ /** Action Factory to create Actions. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(AttributeFilter.class); /** Modified: trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -36,6 +36,7 @@ @SuppressWarnings({"AbstractClassWithoutAbstractMethods"}) public abstract class BasicFilterConfig implements FilterConfig { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(BasicFilterConfig.class); private boolean enabled = false; Modified: trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -41,6 +41,7 @@ private final Map<String, FilterConfig> map = new HashMap<String, FilterConfig>(); + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(NamedFilterConfig.class); public NamedFilterConfig(final NamedFilterList owner) { Modified: trunk/crossfire/src/cfeditor/filter/NamedFilterList.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/NamedFilterList.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/filter/NamedFilterList.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -58,6 +58,7 @@ */ public class NamedFilterList implements Filter { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(NamedFilterList.class); private final Map<String, Filter> subFilters; Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -43,7 +43,7 @@ @SuppressWarnings({"HardcodedFileSeparator"}) public final class ArchetypeParser extends AbstractArchetypeParser<GameObject, MapArchObject, Archetype> { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ArchetypeParser.class); /** Action Factory. */ Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -54,6 +54,7 @@ */ public final class ArchetypeSet extends AbstractArchetypeSet<GameObject, MapArchObject, Archetype> { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ArchetypeSet.class); /** Action Factory. */ Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -39,7 +39,7 @@ */ public class GameObject extends net.sf.gridarta.gameobject.GameObject<GameObject, MapArchObject, Archetype> implements Archetype, Cloneable, Iterable<GameObject> { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(GameObject.class); private String faceName; // face name : 1 Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -35,7 +35,7 @@ */ public final class FaceObject extends AbstractFaceObject { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(FaceObject.class); //private ImageIcon face; Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -60,7 +60,7 @@ */ public final class ScriptArchData { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ScriptArchData.class); /** Action Factory. */ Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -46,7 +46,7 @@ */ public final class ScriptedEvent { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ScriptedEvent.class); /** Action Factory. */ Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -60,6 +60,7 @@ public class ArchComboBox extends JComboBox { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ArchComboBox.class); private final CMainControl mainControl; Modified: trunk/crossfire/src/cfeditor/gui/ArchetypeChooser.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchetypeChooser.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gui/ArchetypeChooser.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -37,6 +37,7 @@ */ public final class ArchetypeChooser extends net.sf.gridarta.gui.ArchetypeChooser<GameObject, MapArchObject, Archetype> { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ArchetypeChooser.class); /** Serial Version UID. */ Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -50,7 +50,7 @@ */ public final class GameObjectAttributesDialog extends AbstractGameObjectAttributesDialog<GameObject, MapArchObject, Archetype> { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(GameObjectAttributesDialog.class); /** Serial Version UID. */ Modified: trunk/crossfire/src/cfeditor/gui/ScriptEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -65,6 +65,7 @@ public class ScriptEditor extends JPanel { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ScriptEditor.class); private final JPanel paramTable; Modified: trunk/crossfire/src/cfeditor/gui/ScriptManager.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -53,6 +53,7 @@ public class ScriptManager extends JFrame { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ScriptManager.class); //TODO fix a memory leak. If a script is remove, it stays in hashmap along with it's visual component Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -55,6 +55,7 @@ */ public final class DefaultLevelRenderer extends LevelRenderer { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(DefaultLevelRenderer.class); /** Serial Version UID. */ Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -48,6 +48,7 @@ */ public final class PickmapChooserControl { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(PickmapChooserControl.class); /** Action Factory. */ Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -35,6 +35,7 @@ */ public final class PickmapChooserView { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(PickmapChooserView.class); /** Action Factory. */ Modified: trunk/crossfire/src/cfeditor/io/CMapReader.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapReader.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/io/CMapReader.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -42,7 +42,7 @@ */ public final class CMapReader extends AbstractMapReader<GameObject, MapArchObject, Archetype> { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CMapReader.class); /** Modified: trunk/crossfire/src/cfeditor/io/CMapWriter.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapWriter.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/io/CMapWriter.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -45,7 +45,7 @@ */ public final class CMapWriter extends AbstractMapWriter<GameObject, MapArchObject, Archetype, MapModel> { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CMapWriter.class); /** Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -23,10 +23,6 @@ import cfeditor.CFArchTypeList; import cfeditor.CMainControl; import cfeditor.IGUIConstants; -import cfeditor.filter.Filter; -import cfeditor.filter.FilterConfig; -import cfeditor.filter.NamedFilterConfig; -import cfeditor.filter.NamedFilterList; import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import java.awt.Point; @@ -43,7 +39,7 @@ */ public final class DefaultMapModel extends AbstractMapModel<GameObject, MapArchObject, Archetype> implements MapModel { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(DefaultMapModel.class); /** Modified: trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -43,6 +43,7 @@ public class DoubleParameterView implements PluginParameterView, ActionListener { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(DoubleParameterView.class); private final JSpinner value; Modified: trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -43,6 +43,7 @@ public class IntegerParameterView implements PluginParameterView, ActionListener { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(IntegerParameterView.class); private final JSpinner value; Modified: trunk/crossfire/src/cfeditor/parameter/MapParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -43,6 +43,7 @@ public class MapParameterView implements PluginParameterView { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(MapParameterView.class); private final MapParameter parameter; Modified: trunk/crossfire/src/cfeditor/parameter/StringParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/StringParameter.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/parameter/StringParameter.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -33,6 +33,7 @@ public class StringParameter extends PluginParameter { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(StringParameter.class); @Override public void fromXML(final Element e) { Modified: trunk/crossfire/src/cfeditor/parameter/StringParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/StringParameterView.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/crossfire/src/cfeditor/parameter/StringParameterView.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -38,6 +38,7 @@ public class StringParameterView implements PluginParameterView { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(StringParameterView.class); private final JTextField value = new JTextField(); Modified: trunk/daimonin/src/daieditor/CFArchTypeList.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchTypeList.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/CFArchTypeList.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -33,11 +33,8 @@ import java.util.Map; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPathExpressionException; -import net.sf.gridarta.CFArchType; import net.sf.japi.xml.NodeListIterator; import org.apache.log4j.Logger; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; @@ -50,6 +47,7 @@ */ public final class CFArchTypeList extends net.sf.gridarta.CFArchTypeList<GameObject, MapArchObject, Archetype> { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CFArchTypeList.class); private final Spells spells = new Spells(); Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -43,6 +43,7 @@ @SuppressWarnings({"UtilityClass", "UseOfSystemOutOrSystemErr"}) public final class CFJavaEditor { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CFJavaEditor.class); /** Prevent instantiation (UtilityClass). */ Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -69,6 +69,7 @@ */ public final class CFTreasureListTree extends net.sf.gridarta.CFTreasureListTree { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CFTreasureListTree.class); /** Action Factory. */ Modified: trunk/daimonin/src/daieditor/CGUIUtils.java =================================================================== --- trunk/daimonin/src/daieditor/CGUIUtils.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/CGUIUtils.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -36,6 +36,7 @@ */ public final class CGUIUtils { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CGUIUtils.class); /** Do not subclass. */ Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -135,7 +135,7 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CMainControl.class); /** Preferences. */ Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/CMainView.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -79,7 +79,7 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CMainView.class); /** Preferences. */ Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -82,6 +82,7 @@ */ public final class CMapViewBasic extends JScrollPane implements ErrorHandler, MapModelListener<GameObject, MapArchObject, Archetype>, MapCursorListener { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CMapViewBasic.class); /** Serial Version UID. */ Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -44,6 +44,7 @@ */ public final class CopyBuffer extends net.sf.gridarta.CopyBuffer { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CopyBuffer.class); /** Reference to main control. */ Modified: trunk/daimonin/src/daieditor/MultiPositionData.java =================================================================== --- trunk/daimonin/src/daieditor/MultiPositionData.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/MultiPositionData.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -33,6 +33,7 @@ */ public final class MultiPositionData { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(MultiPositionData.class); /** Number of columns in the array. */ Modified: trunk/daimonin/src/daieditor/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/Spells.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/Spells.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -42,6 +42,7 @@ */ public final class Spells extends net.sf.gridarta.Spells { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(Spells.class); /** Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -46,7 +46,7 @@ @SuppressWarnings({"HardcodedFileSeparator"}) public final class ArchetypeParser extends AbstractArchetypeParser<GameObject, MapArchObject, Archetype> { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ArchetypeParser.class); /** Action Factory. */ Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -66,6 +66,7 @@ */ public final class ArchetypeSet extends AbstractArchetypeSet<GameObject, MapArchObject, Archetype> { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ArchetypeSet.class); /** Action Factory. */ Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -50,7 +50,7 @@ */ public class GameObject /*extends AbstractNamedObject*/ extends net.sf.gridarta.gameobject.GameObject<GameObject, MapArchObject, Archetype> implements Archetype, Cloneable, Serializable { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(GameObject.class); /** Serial Version. */ Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -39,7 +39,7 @@ */ public class FaceObject extends AbstractFaceObject { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(FaceObject.class); /** The face name. */ Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -194,7 +194,7 @@ /** Size of the image buffer. */ private static final int IMAGE_BUFFER_SIZE = 50 * 1024; - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(FaceObjects.class); /** Action Factory. */ Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -62,7 +62,7 @@ */ public final class ScriptArchData implements Serializable { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ScriptArchData.class); /** Serial Version. */ Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -45,7 +45,7 @@ */ public final class ScriptedEvent { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ScriptedEvent.class); /** Action Factory. */ Modified: trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java =================================================================== --- trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -40,6 +40,7 @@ */ public final class ArchetypeChooser extends net.sf.gridarta.gui.ArchetypeChooser<GameObject, MapArchObject, Archetype> { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ArchetypeChooser.class); /** Serial Version UID. */ Modified: trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -51,7 +51,7 @@ */ public final class GameObjectAttributesDialog extends AbstractGameObjectAttributesDialog<GameObject, MapArchObject, Archetype> { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(GameObjectAttributesDialog.class); /** Serial Version UID. */ Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -48,6 +48,7 @@ */ public final class PickmapChooserControl { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(PickmapChooserControl.class); /** Action Factory. */ Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -35,6 +35,7 @@ */ public final class PickmapChooserView { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(PickmapChooserView.class); /** Action Factory. */ Modified: trunk/daimonin/src/daieditor/io/CMapReader.java =================================================================== --- trunk/daimonin/src/daieditor/io/CMapReader.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/io/CMapReader.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -44,7 +44,7 @@ */ public final class CMapReader extends AbstractMapReader<GameObject, MapArchObject, Archetype> { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CMapReader.class); /** Modified: trunk/daimonin/src/daieditor/io/CMapWriter.java =================================================================== --- trunk/daimonin/src/daieditor/io/CMapWriter.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/daimonin/src/daieditor/io/CMapWriter.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -41,7 +41,7 @@ @SuppressWarnings({"HardcodedLineSeparator"}) public final class CMapWriter extends AbstractMapWriter<GameObject, MapArchObject, Archetype, MapModel> { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CMapWriter.class); /** Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -38,7 +38,7 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(AbstractMainControl.class); /** Swing FileFilter for png graphics. */ Modified: trunk/src/app/net/sf/gridarta/CAttribBitmask.java =================================================================== --- trunk/src/app/net/sf/gridarta/CAttribBitmask.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/CAttribBitmask.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -41,6 +41,7 @@ */ public final class CAttribBitmask { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CAttribBitmask.class); /** Modified: trunk/src/app/net/sf/gridarta/CFArchAttrib.java =================================================================== --- trunk/src/app/net/sf/gridarta/CFArchAttrib.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/CFArchAttrib.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -31,6 +31,7 @@ */ public final class CFArchAttrib implements Cloneable { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CFArchAttrib.class); // XML tag names Modified: trunk/src/app/net/sf/gridarta/CFArchType.java =================================================================== --- trunk/src/app/net/sf/gridarta/CFArchType.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/CFArchType.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -23,8 +23,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import net.sf.gridarta.gameobject.ArchAttribType; import net.sf.gridarta.gameobject.Archetype; -import net.sf.gridarta.gameobject.ArchAttribType; import net.sf.gridarta.gameobject.GameObject; import net.sf.gridarta.map.MapArchObject; import net.sf.japi.swing.ActionFactory; @@ -45,7 +45,7 @@ */ public class CFArchType { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CFArchType.class); /** Action Factory. */ Modified: trunk/src/app/net/sf/gridarta/CFArchTypeList.java =================================================================== --- trunk/src/app/net/sf/gridarta/CFArchTypeList.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/CFArchTypeList.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -40,7 +40,6 @@ import net.sf.japi.xml.NodeListIterator; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -52,6 +51,7 @@ */ public abstract class CFArchTypeList<G extends GameObject<G, A, R>, A extends MapArchObject, R extends Archetype<G, A, R>> implements Iterable<CFArchType> { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CFArchTypeList.class); /** DocumentBuilder. */ Modified: trunk/src/app/net/sf/gridarta/Spells.java =================================================================== --- trunk/src/app/net/sf/gridarta/Spells.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/Spells.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -44,7 +44,7 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(Spells.class); private String[] spellNames; // array of spell names (these all begin with a ' ' space!) Modified: trunk/src/app/net/sf/gridarta/data/NamedTreeNode.java =================================================================== --- trunk/src/app/net/sf/gridarta/data/NamedTreeNode.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/data/NamedTreeNode.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -40,7 +40,7 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(NamedTreeNode.class); /** Modified: trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -34,7 +34,7 @@ */ public abstract class AbstractArchetypeParser<G extends GameObject<G, A, R>, A extends MapArchObject, R extends Archetype<G, A, R>> implements ArchetypeParser<G, A, R> { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(AbstractArchetypeParser.class); /** Modified: trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -105,7 +105,7 @@ */ public abstract class AbstractGameObjectAttributesDialog<G extends GameObject<G, A, R>, A extends MapArchObject, R extends Archetype<G, A, R>> extends JOptionPane implements FocusListener { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(AbstractGameObjectAttributesDialog.class); /** Action Factory. */ Modified: trunk/src/app/net/sf/gridarta/gui/connectionview/Connection.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/connectionview/Connection.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/gui/connectionview/Connection.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -35,7 +35,7 @@ public class Connection implements Iterable<GameObject> { /** The Logger for printing log messages. */ - private static final Logger _log = Logger.getLogger(Connection.class); + private static final Logger log = Logger.getLogger(Connection.class); /** * The connection number. Modified: trunk/src/app/net/sf/gridarta/help/HtmlPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/help/HtmlPane.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/help/HtmlPane.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -42,7 +42,7 @@ */ final class HtmlPane extends JScrollPane implements HyperlinkListener { - /** Logger for logging what's going on here. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger("HtmlPane.class"); /** Serial Version UID. */ Modified: trunk/src/app/net/sf/gridarta/map/AbstractMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/AbstractMapModel.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/map/AbstractMapModel.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -42,7 +42,7 @@ */ public abstract class AbstractMapModel<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements MapModel<G, A, R> { - /** Logger. */ + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(AbstractMapModel.class); /** Sync Lock Object. */ Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -43,6 +43,7 @@ */ public final class ScriptEditControl { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ScriptEditControl.class); // static instance of this class (there's only one controller and max. one open window) Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -55,6 +55,7 @@ */ public final class ScriptEditView extends JFrame { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ScriptEditView.class); /** Serial Version UID. */ Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -32,6 +32,7 @@ private Map<KeyStroke, Union> currentBindings; + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(DefaultInputHandler.class); /** Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -45,6 +45,7 @@ */ public abstract class InputHandler extends KeyAdapter { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(InputHandler.class); /** Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -93,6 +93,7 @@ */ public final class JEditTextArea extends JComponent { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(JEditTextArea.class); /** Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java 2007-02-03 12:28:36 UTC (rev 1772) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java 2007-02-03 12:30:03 UTC (rev 1773) @@ -36,6 +36,7 @@ */ public final class TextAreaPainter extends JComponent implements TabExpander { + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(TextAreaPainter.class); /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-03 12:39:50
|
Revision: 1775 http://svn.sourceforge.net/gridarta/?rev=1775&view=rev Author: akirschbaum Date: 2007-02-03 04:39:46 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2007-02-03 12:38:56 UTC (rev 1774) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2007-02-03 12:39:46 UTC (rev 1775) @@ -54,12 +54,12 @@ /** * Adds a new face object. - * @param faceName name of face, e.g. <samp>"robe.101"</samp> - * @param pathName original filename, e.g. <samp>"arch/objects/misc/robe.101.png"</samp> or <code>null</code> - * @param resourceDirectory directory of the resource, e.g. <samp>"resource/conf"</samp> - * @param resourceName actual filename, e.g. <samp>"crossfire.0"</samp> - * @param dataStartIndex offset in the file denoted by <var>actualFilename</var>, e.g. <samp>148676</samp> - * @param dataSize size in the file denoted by <var>actualFilename</var>, e.g. <samp>567</samp>, + * @param faceName name of face, e.g. <samp>"robe.101"</samp> + * @param pathName original filename, e.g. <samp>"arch/objects/misc/robe.101.png"</samp> or <code>null</code> + * @param resourceDirectory directory of the resource, e.g. <samp>"resource/conf"</samp> + * @param resourceName actual filename, e.g. <samp>"crossfire.0"</samp> + * @param dataStartIndex offset in the file denoted by <var>actualFilename</var>, e.g. <samp>148676</samp> + * @param dataSize size in the file denoted by <var>actualFilename</var>, e.g. <samp>567</samp>, * @throws DuplicateFaceException in case the face was not unique */ public void addFaceObject(final String faceName, final String pathName, final String resourceDirectory, final String resourceName, final long dataStartIndex, final int dataSize) throws DuplicateFaceException { @@ -124,7 +124,6 @@ final FaceObject faceObject2 = it.next(); final String path2 = faceObject2.getPath(); - try { // try to open the png image file final InputStream fin = new FileInputStream(path2); Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-02-03 12:38:56 UTC (rev 1774) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-02-03 12:39:46 UTC (rev 1775) @@ -202,8 +202,8 @@ /** * Adds a new face object. - * @param faceName name of face, e.g. <samp>"robe.101"</samp> - * @param originalFilename original filename, e.g. <samp>"arch/objects/misc/robe.101.png"</samp> + * @param faceName name of face, e.g. <samp>"robe.101"</samp> + * @param originalFilename original filename, e.g. <samp>"arch/objects/misc/robe.101.png"</samp> * @throws DuplicateFaceException in case the face was not unique */ public void addFaceObject(final String faceName, final String originalFilename) throws DuplicateFaceException { @@ -212,11 +212,11 @@ /** * Adds a new face object. - * @param faceName name of face, e.g. <samp>"robe.101"</samp> - * @param originalFilename original filename, e.g. <samp>"arch/objects/misc/robe.101.png"</samp> - * @param actualFilename actual filename, e.g. <samp>"arch/daimonin.0"</samp> - * @param offset offset in the file denoted by <var>actualFilename</var>, e.g. <samp>148676</samp> - * @param size size in the file denoted by <var>actualFilename</var>, e.g. <samp>567</samp>, + * @param faceName name of face, e.g. <samp>"robe.101"</samp> + * @param originalFilename original filename, e.g. <samp>"arch/objects/misc/robe.101.png"</samp> + * @param actualFilename actual filename, e.g. <samp>"arch/daimonin.0"</samp> + * @param offset offset in the file denoted by <var>actualFilename</var>, e.g. <samp>148676</samp> + * @param size size in the file denoted by <var>actualFilename</var>, e.g. <samp>567</samp>, * @throws DuplicateFaceException in case the face was not unique */ public void addFaceObject(final String faceName, final String originalFilename, final String actualFilename, final int offset, final int size) throws DuplicateFaceException { @@ -353,7 +353,7 @@ final String num = Integer.toString(0); final String def = "00000"; final String numstring = def.substring(0, 5 - num.length()) + num; - int numBytes = 0; + int numBytes; final String path1 = dir + "/dev/editor/bug.101.png"; // XXX: This code limits image support to an image size of 1024 * 50 bytes = 50k @@ -377,7 +377,8 @@ ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorFileUnexpectedEOF", path1); return; } - binFile.writeBytes("IMAGE " + numstring + ' ' + numBytes + " bug.101\n"); + + binFile.writeBytes("IMAGE " + numstring + " " + numBytes + " bug.101\n"); binFile.write(imgBuffer, 0, numBytes); textFile.write(numstring + " bug.101\n"); treeFile.append("/dev/editor/bug.101.png\n"); @@ -420,10 +421,9 @@ // pname = pname.substring(0, pname.lastIndexOf("/")+1); // now write this png data into the big collected png file - // binFile.writeBytes("IMAGE "+numstring2+" "+numBytes+" "+pname+faceObjects[i].getName()+'\n'); - binFile.writeBytes("IMAGE " + numstring2 + ' ' + numBytes + ' ' + face + '\n'); + binFile.writeBytes("IMAGE " + numstring2 + " " + numBytes + " " + face + "\n"); binFile.write(imgBuffer, 0, numBytes); - textFile.write(numstring2 + ' ' + face + '\n'); + textFile.write(numstring2 + " " + face + "\n"); treeFile.append(path2.substring(stripPath, path2.length() - 4).replace('\\', '/')).append('\n'); if (i % 100 == 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-03 12:47:27
|
Revision: 1778 http://svn.sourceforge.net/gridarta/?rev=1778&view=rev Author: christianhujer Date: 2007-02-03 04:47:28 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Optimized imports. Modified Paths: -------------- trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/crossfire/src/cfeditor/gui/map/MapUserListener.java trunk/daimonin/src/daieditor/MapViewIFrame.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapModel.java trunk/src/app/net/sf/gridarta/gui/StatusBar.java Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-02-03 12:44:51 UTC (rev 1777) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-02-03 12:47:28 UTC (rev 1778) @@ -31,10 +31,8 @@ import java.io.File; import java.io.IOException; import javax.swing.AbstractAction; -import javax.swing.AbstractButton; import javax.swing.JInternalFrame; import javax.swing.JViewport; -import javax.swing.MenuElement; import static javax.swing.KeyStroke.getKeyStroke; import net.sf.gridarta.Menu; import net.sf.gridarta.gui.map.MapCursorListener; Modified: trunk/crossfire/src/cfeditor/gui/map/MapUserListener.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapUserListener.java 2007-02-03 12:44:51 UTC (rev 1777) +++ trunk/crossfire/src/cfeditor/gui/map/MapUserListener.java 2007-02-03 12:47:28 UTC (rev 1778) @@ -32,7 +32,6 @@ import java.awt.event.MouseMotionListener; import net.sf.gridarta.gui.map.MapCursor; import net.sf.gridarta.gui.map.MapGrid; -import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; /** Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-02-03 12:44:51 UTC (rev 1777) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-02-03 12:47:28 UTC (rev 1778) @@ -30,12 +30,10 @@ import java.io.File; import java.io.IOException; import javax.swing.AbstractAction; -import javax.swing.AbstractButton; import static javax.swing.Action.SMALL_ICON; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JInternalFrame; -import javax.swing.MenuElement; import static javax.swing.KeyStroke.getKeyStroke; import net.sf.gridarta.Menu; import net.sf.gridarta.gui.map.MapCursorListener; Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2007-02-03 12:44:51 UTC (rev 1777) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2007-02-03 12:47:28 UTC (rev 1778) @@ -28,7 +28,6 @@ import java.awt.Toolkit; import java.util.List; import net.sf.gridarta.map.AbstractMapModel; -import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; Modified: trunk/daimonin/src/daieditor/map/MapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapModel.java 2007-02-03 12:44:51 UTC (rev 1777) +++ trunk/daimonin/src/daieditor/map/MapModel.java 2007-02-03 12:47:28 UTC (rev 1778) @@ -23,7 +23,6 @@ import daieditor.gameobject.GameObject; import java.awt.Point; import java.io.Serializable; -import net.sf.gridarta.map.MapSquare; import org.jetbrains.annotations.Nullable; /** Modified: trunk/src/app/net/sf/gridarta/gui/StatusBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/StatusBar.java 2007-02-03 12:44:51 UTC (rev 1777) +++ trunk/src/app/net/sf/gridarta/gui/StatusBar.java 2007-02-03 12:47:28 UTC (rev 1778) @@ -31,13 +31,10 @@ import javax.swing.border.BevelBorder; import net.sf.gridarta.MainControl; import net.sf.gridarta.MainControlListener; -import net.sf.gridarta.gameobject.Archetype; -import net.sf.gridarta.gameobject.GameObject; import net.sf.gridarta.gui.map.LevelRenderer; import net.sf.gridarta.gui.map.MapCursor; import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapCursorListener; -import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapControl; import net.sf.japi.swing.ActionFactory; import org.jetbrains.annotations.NotNull; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-03 13:07:47
|
Revision: 1783 http://svn.sourceforge.net/gridarta/?rev=1783&view=rev Author: akirschbaum Date: 2007-02-03 05:07:47 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Move PREFS_LANGUAGE key to common MainControl interface. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFJavaEditor.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java trunk/daimonin/src/daieditor/CFJavaEditor.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java trunk/src/app/net/sf/gridarta/MainControl.java Modified: trunk/crossfire/src/cfeditor/CFJavaEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/CFJavaEditor.java 2007-02-03 12:57:57 UTC (rev 1782) +++ trunk/crossfire/src/cfeditor/CFJavaEditor.java 2007-02-03 13:07:47 UTC (rev 1783) @@ -19,7 +19,6 @@ package cfeditor; -import static cfeditor.CMainControl.PREFS_LANGUAGE; import cfeditor.map.MapControl; import java.io.BufferedReader; import java.io.File; @@ -29,6 +28,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; +import net.sf.gridarta.MainControl; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; @@ -51,7 +51,7 @@ */ public static void main(final String... args) { // Make sure the locale is set before any ActionFactory is used. - final String locName = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(PREFS_LANGUAGE, null); + final String locName = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(MainControl.PREFS_LANGUAGE, null); if (locName != null) { Locale.setDefault(new Locale(locName)); } Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-02-03 12:57:57 UTC (rev 1782) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-02-03 13:07:47 UTC (rev 1783) @@ -100,9 +100,6 @@ public static final String LOAD_ARCH_COLL = "loadArchFromCollection"; - /** Preferences key for language. */ - public static final String PREFS_LANGUAGE = "language"; - /** The main view. */ private final CMainView mainView; Modified: trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java 2007-02-03 12:57:57 UTC (rev 1782) +++ trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java 2007-02-03 13:07:47 UTC (rev 1783) @@ -20,7 +20,6 @@ package cfeditor.gui.prefs; import cfeditor.CMainControl; -import static cfeditor.CMainControl.PREFS_LANGUAGE; import static cfeditor.CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT; import static cfeditor.CMainView.MAP_TILE_LIST_BOTTOM_KEY; import cfeditor.CSettings; @@ -40,6 +39,7 @@ import javax.swing.border.Border; import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; +import net.sf.gridarta.MainControl; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.misc.LocaleListCellRenderer; import net.sf.japi.swing.prefs.AbstractPrefs; @@ -97,9 +97,9 @@ public void apply() { final Locale loc = (Locale) localeBox.getSelectedItem(); if (loc != null) { - CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(PREFS_LANGUAGE, loc.getLanguage()); + CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(MainControl.PREFS_LANGUAGE, loc.getLanguage()); } else { - CSettings.getInstance(IGUIConstants.APP_NAME).clearProperty(PREFS_LANGUAGE); + CSettings.getInstance(IGUIConstants.APP_NAME).clearProperty(MainControl.PREFS_LANGUAGE); } CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(MAP_TILE_LIST_BOTTOM_KEY, mapPanelBottom.isSelected() ? "true" : "false"); mainControl.readGlobalSettings(); @@ -108,7 +108,7 @@ /** {@inheritDoc} */ public void revert() { - final String current = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(PREFS_LANGUAGE, null); + final String current = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(MainControl.PREFS_LANGUAGE, null); localeBox.setSelectedIndex(binarySearch(locales, current != null ? new Locale(current) : null, comp)); mapPanelBottom.setSelected(Boolean.valueOf(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(MAP_TILE_LIST_BOTTOM_KEY, Boolean.toString(MAP_TILE_LIST_BOTTOM_DEFAULT)))); } @@ -122,7 +122,7 @@ /** {@inheritDoc} */ public boolean isChanged() { final Locale loc = (Locale) localeBox.getSelectedItem(); - final String currentName = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(PREFS_LANGUAGE, null); + final String currentName = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(MainControl.PREFS_LANGUAGE, null); final Locale current = currentName != null ? new Locale(currentName) : null; return !( (loc == null ? loc == current : loc.equals(current)) @@ -150,7 +150,7 @@ localeBox = new JComboBox(locales); // set "content" localeBox.setRenderer(new LocaleListCellRenderer()); //localeBox.setPreferredSize(new Dimension(150, 25)); - final String current = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(PREFS_LANGUAGE, null); + final String current = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(MainControl.PREFS_LANGUAGE, null); localeBox.setSelectedIndex(binarySearch(locales, current != null ? new Locale(current) : null, comp)); lineLayout.add(localeBox); Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2007-02-03 12:57:57 UTC (rev 1782) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2007-02-03 13:07:47 UTC (rev 1783) @@ -19,7 +19,6 @@ package daieditor; -import static daieditor.CMainControl.PREFS_LANGUAGE; import daieditor.map.MapControl; import java.io.BufferedReader; import java.io.File; @@ -32,6 +31,7 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; import static java.util.prefs.Preferences.userNodeForPackage; +import net.sf.gridarta.MainControl; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; @@ -64,7 +64,7 @@ log.warn ("No build number found:", e); } // Make sure the locale is set before any ActionFactory is used. - final String locName = userNodeForPackage(CMainControl.class).get(PREFS_LANGUAGE, null); + final String locName = userNodeForPackage(CMainControl.class).get(MainControl.PREFS_LANGUAGE, null); if (locName != null) { Locale.setDefault(new Locale(locName)); } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-02-03 12:57:57 UTC (rev 1782) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-02-03 13:07:47 UTC (rev 1783) @@ -154,9 +154,6 @@ /** Preferences default value for username. */ public static final String PREFS_USERNAME_DEFAULT = System.getProperty("user.name"); - /** Preferences key for language. */ - public static final String PREFS_LANGUAGE = "language"; - /** Preferences key for using System.exit(). */ public static final String PREFS_SYSTEM_EXIT = "systemExit"; Modified: trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2007-02-03 12:57:57 UTC (rev 1782) +++ trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2007-02-03 13:07:47 UTC (rev 1783) @@ -20,7 +20,6 @@ package daieditor.gui.prefs; import daieditor.CMainControl; -import static daieditor.CMainControl.PREFS_LANGUAGE; import static daieditor.CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT; import static daieditor.CMainView.MAP_TILE_LIST_BOTTOM_KEY; import static daieditor.IGUIConstants.DIALOG_BORDER; @@ -40,6 +39,7 @@ import javax.swing.border.Border; import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; +import net.sf.gridarta.MainControl; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.misc.LocaleListCellRenderer; import net.sf.japi.swing.prefs.AbstractPrefs; @@ -95,16 +95,16 @@ public void apply() { final Locale loc = (Locale) localeBox.getSelectedItem(); if (loc != null) { - PREFS.put(PREFS_LANGUAGE, loc.getLanguage()); + PREFS.put(MainControl.PREFS_LANGUAGE, loc.getLanguage()); } else { - PREFS.remove(PREFS_LANGUAGE); + PREFS.remove(MainControl.PREFS_LANGUAGE); } PREFS.putBoolean(MAP_TILE_LIST_BOTTOM_KEY, mapPanelBottom.isSelected()); } /** {@inheritDoc} */ public void revert() { - final String current = userNodeForPackage(CMainControl.class).get(PREFS_LANGUAGE, null); + final String current = userNodeForPackage(CMainControl.class).get(MainControl.PREFS_LANGUAGE, null); localeBox.setSelectedIndex(binarySearch(locales, current != null ? new Locale(current) : null, comp)); mapPanelBottom.setSelected(PREFS.getBoolean(MAP_TILE_LIST_BOTTOM_KEY, MAP_TILE_LIST_BOTTOM_DEFAULT)); } @@ -118,7 +118,7 @@ /** {@inheritDoc} */ public boolean isChanged() { final Locale loc = (Locale) localeBox.getSelectedItem(); - final String currentName = userNodeForPackage(CMainControl.class).get(PREFS_LANGUAGE, null); + final String currentName = userNodeForPackage(CMainControl.class).get(MainControl.PREFS_LANGUAGE, null); final Locale current = currentName != null ? new Locale(currentName) : null; return !( (loc == null ? current == null : loc.equals(current)) @@ -147,7 +147,7 @@ localeBox = new JComboBox(locales); // set "content" localeBox.setRenderer(new LocaleListCellRenderer()); //localeBox.setPreferredSize(new Dimension(150, 25)); - final String current = userNodeForPackage(CMainControl.class).get(PREFS_LANGUAGE, null); + final String current = userNodeForPackage(CMainControl.class).get(MainControl.PREFS_LANGUAGE, null); localeBox.setSelectedIndex(binarySearch(locales, current != null ? new Locale(current) : null, comp)); lineLayout.add(localeBox); Modified: trunk/src/app/net/sf/gridarta/MainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/MainControl.java 2007-02-03 12:57:57 UTC (rev 1782) +++ trunk/src/app/net/sf/gridarta/MainControl.java 2007-02-03 13:07:47 UTC (rev 1783) @@ -39,6 +39,9 @@ */ public interface MainControl<G extends GameObject<G, A, R>, A extends MapArchObject, R extends Archetype<G, A, R>, C extends MapControl<G, A, R>> { + /** Preferences key for language. */ + String PREFS_LANGUAGE = "language"; + /** * Global random number generator. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-03 13:36:30
|
Revision: 1784 http://svn.sourceforge.net/gridarta/?rev=1784&view=rev Author: akirschbaum Date: 2007-02-03 05:36:29 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-02-03 13:07:47 UTC (rev 1783) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-02-03 13:36:29 UTC (rev 1784) @@ -759,7 +759,6 @@ * @return <code>true</code> if the level was successfully closed, otherwise <code>false</code> */ public boolean closeLevel(final MapControl mapControl, final boolean forced) { - if (mapControl == null) { ACTION_FACTORY.showMessageDialog(mainView, "closeLevelNullLevel", levels.size(), currentMap); return false; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-02-03 13:07:47 UTC (rev 1783) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-02-03 13:36:29 UTC (rev 1784) @@ -936,7 +936,6 @@ * @return <code>true</code> if the level was successfully closed, otherwise <code>false</code> */ public boolean closeLevel(final MapControl mapControl, final boolean forced) { - if (mapControl == null) { ACTION_FACTORY.showMessageDialog(mainView, "closeLevelNullLevel", levels.size(), currentMap); return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-03 17:05:50
|
Revision: 1787 http://svn.sourceforge.net/gridarta/?rev=1787&view=rev Author: christianhujer Date: 2007-02-03 09:05:50 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Refactored Daimonin FaceObjects to not use so much code for the exceptional face bug.101. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObject.java Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 15:30:31 UTC (rev 1786) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 17:05:50 UTC (rev 1787) @@ -159,6 +159,7 @@ FaceObjects.setNormal(new ArchFaceProvider()); setLoadedFromArchive(false); // don't load from the collected files animFiles = new ArrayList<File>(); + addPNGFace(new File(mainControl.getArchDefaultFolder(), "dev/editor/bug.101.png").getAbsolutePath(), "bug.101.png"); loadArchetypesFromFiles(new File(mainControl.getArchDefaultFolder()), 0, "default", "default", false); // load arches & images from individual files loadAnimsFromFiles(); if (!duplicateArches.isEmpty()) { Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-02-03 15:30:31 UTC (rev 1786) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-02-03 17:05:50 UTC (rev 1787) @@ -334,7 +334,6 @@ * <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. */ public void collect(@NotNull final Progress progress, @NotNull final File dir) throws IOException { collectTreeFile(progress, dir); @@ -354,45 +353,18 @@ final int stripPath = dir.getAbsolutePath().length(); try { - // write number 0 dummy entry - final String num = Integer.toString(0); final String def = "00000"; - final String numstring = def.substring(0, 5 - num.length()) + num; int numBytes; - - final String path1 = dir + "/dev/editor/bug.101.png"; // XXX: This code limits image support to an image size of 1024 * 50 bytes = 50k final byte[] imgBuffer = new byte[IMAGE_BUFFER_SIZE]; - try { - final InputStream fin = new FileInputStream(path1); - try { - numBytes = fin.read(imgBuffer, 0, IMAGE_BUFFER_SIZE); - } finally { - fin.close(); - } - } catch (final FileNotFoundException e) { - ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorFileNotFound", path1); - return; - } catch (final IOException e) { - ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorIOException", path1, e); - return; - } - if (numBytes == -1) { - ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorFileUnexpectedEOF", path1); - return; - } - - binFile.writeBytes("IMAGE " + numstring + " " + numBytes + " bug.101\n"); - binFile.write(imgBuffer, 0, numBytes); - // now write all pngs into the file final int numOfFaceObjects = size(); progress.setLabel(ACTION_FACTORY.getString("archCollectImages"), numOfFaceObjects); int i = 0; for (final FaceObject faceObject : this) { final String face = faceObject.getFaceName(); - final String num2 = Integer.toString(++i); + final String num2 = Integer.toString(i); final String numstring2 = def.substring(0, 5 - num2.length()) + num2; final String path2 = ((ArchFaceProvider) FaceObjects.normal).getFilename(face); @@ -426,7 +398,7 @@ binFile.writeBytes("IMAGE " + numstring2 + " " + numBytes + " " + face + "\n"); binFile.write(imgBuffer, 0, numBytes); - if (i % 100 == 0) { + if (i++ % 100 == 0) { progress.setValue(i); } } @@ -446,14 +418,12 @@ final int stripPath = dir.getAbsolutePath().length(); final BufferedWriter treeFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(new File(dir, IGUIConstants.CONFIG_DIR), IGUIConstants.FACETREE_FILE)), "us-ascii")); try { - treeFile.append("/dev/editor/bug.101.png\n"); int i = 0; for (final FaceObject faceObject : this) { - i++; final String face = faceObject.getFaceName(); final String path2 = ((ArchFaceProvider) FaceObjects.normal).getFilename(face); treeFile.append(path2.substring(stripPath, path2.length() - 4).replace('\\', '/')).append('\n'); - if (i % 100 == 0) { + if (i++ % 100 == 0) { progress.setValue(i); } } @@ -471,13 +441,11 @@ private void collectBmapsFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { final PrintWriter textFile = new PrintWriter(new BufferedWriter(new FileWriter(new File(dir, IGUIConstants.BMAPS_FILE)))); try { - textFile.format("00000 bug.101\n"); int i = 0; for (final FaceObject faceObject : this) { - i++; final String face = faceObject.getFaceName(); textFile.format("%05d %s\n", i, face); - if (i % 100 == 0) { + if (i++ % 100 == 0) { progress.setValue(i); } } Modified: trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObject.java 2007-02-03 15:30:31 UTC (rev 1786) +++ trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObject.java 2007-02-03 17:05:50 UTC (rev 1787) @@ -20,6 +20,7 @@ package net.sf.gridarta.gameobject.face; import net.sf.gridarta.data.AbstractNamedObject; +import net.sf.gridarta.data.NamedObject; /** * Abstract base implementation of {@link FaceObject}. @@ -35,4 +36,26 @@ super(path); } + /** + * {@inheritDoc} + * Overridden to sort bug.101 and bug.111 before all other faces. + */ + @Override public int compareTo(final NamedObject o) { + if (o instanceof FaceObject) { + final FaceObject other = (FaceObject) o; + final boolean iAmBug = getName().equals("bug.111") || getName().equals("bug.101"); + final boolean otherIsBug = other.getName().equals("bug.111") || other.getName().equals("bug.101"); + if (iAmBug && otherIsBug) { + return 0; + } + if (iAmBug) { + return -1; + } + if (otherIsBug) { + return 1; + } + } + return super.compareTo(o); //To change body of overridden methods use File | Settings | File Templates. + } + } // class AbstractFaceObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-04 13:11:43
|
Revision: 1791 http://svn.sourceforge.net/gridarta/?rev=1791&view=rev Author: christianhujer Date: 2007-02-04 05:11:19 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Unified FaceObjects. Crossfire FaceObjects will now create bmaps.paths and bmaps along with crossfire.0. Modified Paths: -------------- trunk/crossfire/src/cfeditor/IGUIConstants.java trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java Modified: trunk/crossfire/src/cfeditor/IGUIConstants.java =================================================================== --- trunk/crossfire/src/cfeditor/IGUIConstants.java 2007-02-03 18:44:21 UTC (rev 1790) +++ trunk/crossfire/src/cfeditor/IGUIConstants.java 2007-02-04 13:11:19 UTC (rev 1791) @@ -122,7 +122,8 @@ String TREASURES_FILE = "treasures"; // treasurelists file - String BMAPS_FILE = ""; // dummy (only used for iso view) + String BMAPS_FILE = "bmaps"; + String FACETREE_FILE = "bmaps.paths"; String ARCHDEF_FILE = ""; Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2007-02-03 18:44:21 UTC (rev 1790) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2007-02-04 13:11:19 UTC (rev 1791) @@ -22,13 +22,17 @@ import cfeditor.CMainControl; import cfeditor.IGUIConstants; import java.io.BufferedOutputStream; +import java.io.BufferedWriter; 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.InputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; import java.util.Iterator; import net.sf.gridarta.gameobject.face.AbstractFaceObjects; import net.sf.gridarta.gameobject.face.DuplicateFaceException; @@ -71,7 +75,7 @@ } /** {@inheritDoc} */ - public void collect(@NotNull final Progress progress, @NotNull final File dir) throws IOException { + @Override protected void collectImageFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { DataOutputStream binFile = null; try { final File dfile = new File(dir, IGUIConstants.PNG_FILE); @@ -181,4 +185,40 @@ } } + /** {@inheritDoc} */ + @Override protected void collectTreeFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { + final int stripPath = dir.getAbsolutePath().length(); + final PrintWriter treeFile = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(new File(dir, IGUIConstants.CONFIG_DIR), IGUIConstants.FACETREE_FILE)), "us-ascii")), false); + try { + int i = 0; + for (final FaceObject faceObject : this) { + final String face = faceObject.getFaceName(); + final String path = faceObject.getPath(); + treeFile.format("\\%05d %s\n", i, path.substring(stripPath, path.length() - 4).replace('\\', '/')); + if (i++ % 100 == 0) { + progress.setValue(i); + } + } + } finally { + treeFile.close(); + } + } + + /** {@inheritDoc} */ + @Override protected void collectBmapsFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { + final PrintWriter textFile = new PrintWriter(new BufferedWriter(new FileWriter(new File(dir, IGUIConstants.BMAPS_FILE))), false); + try { + int i = 0; + for (final FaceObject faceObject : this) { + final String face = faceObject.getFaceName(); + textFile.format("%05d %s\n", i, face); + if (i++ % 100 == 0) { + progress.setValue(i); + } + } + } finally { + textFile.close(); + } + } + } // class FaceObjects Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-02-03 18:44:21 UTC (rev 1790) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-02-04 13:11:19 UTC (rev 1791) @@ -321,32 +321,8 @@ } } - /** - * {@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). - */ - public void collect(@NotNull final Progress progress, @NotNull final File dir) throws IOException { - final int numOfFaceObjects = size(); - progress.setLabel(ACTION_FACTORY.getString("archCollectImages"), numOfFaceObjects); - collectTreeFile(progress, dir); - collectBmapsFile(progress, dir); - collectImageFile(progress, dir); - progress.setValue(numOfFaceObjects); - } - - /** - * Creates the image file. - * @param progress Progress to report progress to. - * @param dir Destination directory to collect data to. - * @throws IOException in case of I/O problems during collection - */ - private void collectImageFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { + /** {@inheritDoc} */ + @Override protected void collectImageFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { final File dfile = new File(dir, IGUIConstants.PNG_FILE); final FileOutputStream fout = new FileOutputStream(dfile); final FileChannel outChannel = fout.getChannel(); @@ -383,13 +359,8 @@ } } - /** - * Creates the tree file. - * @param progress Progress to report progress to. - * @param dir Destination directory to collect data to. - * @throws IOException in case of I/O problems during collection - */ - private void collectTreeFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { + /** {@inheritDoc} */ + @Override protected void collectTreeFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { final int stripPath = dir.getAbsolutePath().length(); final BufferedWriter treeFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(new File(dir, IGUIConstants.CONFIG_DIR), IGUIConstants.FACETREE_FILE)), "us-ascii")); try { @@ -407,13 +378,8 @@ } } - /** - * Creates the bmaps file. - * @param progress Progress to report progress to. - * @param dir Destination directory to collect data to. - * @throws IOException in case of I/O problems during collection - */ - private void collectBmapsFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { + /** {@inheritDoc} */ + @Override protected void collectBmapsFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { final PrintWriter textFile = new PrintWriter(new BufferedWriter(new FileWriter(new File(dir, IGUIConstants.BMAPS_FILE))), false); try { int i = 0; Modified: trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java 2007-02-03 18:44:21 UTC (rev 1790) +++ trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java 2007-02-04 13:11:19 UTC (rev 1791) @@ -19,8 +19,12 @@ package net.sf.gridarta.gameobject.face; +import java.io.File; +import java.io.IOException; import net.sf.gridarta.data.AbstractNamedObjects; import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.misc.Progress; +import org.jetbrains.annotations.NotNull; /** * Abstract base implementation of {@link FaceObjects}. @@ -38,4 +42,47 @@ super(ACTION_FACTORY.getString("nameOfFaceObject")); } + /** + * {@inheritDoc} + * Collects the faces. + * The graphics information is written to "crossfire.0" resp. "daimonin.0". + * The meta information (offsets etc.) is written to "bmaps". + * The tree information for the editor is written to "bmaps.paths" resp. "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). + */ + public void collect(@NotNull final Progress progress, @NotNull final File dir) throws IOException { + final int numOfFaceObjects = size(); + progress.setLabel(ACTION_FACTORY.getString("archCollectImages"), numOfFaceObjects); + collectTreeFile(progress, dir); + collectBmapsFile(progress, dir); + collectImageFile(progress, dir); + progress.setValue(numOfFaceObjects); + } + + /** + * Creates the image file. + * @param progress Progress to report progress to. + * @param dir Destination directory to collect data to. + * @throws IOException in case of I/O problems during collection + */ + protected abstract void collectImageFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException; + + /** + * Creates the tree file. + * @param progress Progress to report progress to. + * @param dir Destination directory to collect data to. + * @throws IOException in case of I/O problems during collection + */ + protected abstract void collectTreeFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException; + + /** + * Creates the bmaps file. + * @param progress Progress to report progress to. + * @param dir Destination directory to collect data to. + * @throws IOException in case of I/O problems during collection + */ + protected abstract void collectBmapsFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException; + } // class AbstractFaceObjects This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-04 13:48:37
|
Revision: 1793 http://svn.sourceforge.net/gridarta/?rev=1793&view=rev Author: akirschbaum Date: 2007-02-04 05:48:35 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java trunk/daimonin/src/daieditor/gui/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-02-04 13:11:53 UTC (rev 1792) +++ trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-02-04 13:48:35 UTC (rev 1793) @@ -312,10 +312,12 @@ final MapView mapViewIFrame = mapControl.getMapViewFrame(); assert mapViewIFrame != null; int replaceCount = 0; - final ArrayList<GameObject> objectsToReplace = new ArrayList<GameObject>(); + final List<GameObject> objectsToReplace = new ArrayList<GameObject>(); final int replaceListSize = replaceList == null ? 0 : replaceList.size(); mapControl.getMapModel().beginTransaction("Replace"); // TODO: I18N/L10N for (final MapSquare<GameObject, MapArchObject, Archetype> square : entireMap ? mapControl.getMapModel() : mapViewIFrame.getView().getSelectedSquares()) { + // Operate on a copy of the nodes to prevent ConcurrentModificationException + // find objects to replace objectsToReplace.clear(); for (final GameObject node : square) { Modified: trunk/daimonin/src/daieditor/gui/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/ReplaceDialog.java 2007-02-04 13:11:53 UTC (rev 1792) +++ trunk/daimonin/src/daieditor/gui/ReplaceDialog.java 2007-02-04 13:48:35 UTC (rev 1793) @@ -317,34 +317,39 @@ final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); assert mapViewIFrame != null; int replaceCount = 0; + final List<GameObject> objectsToReplace = new ArrayList<GameObject>(); final int replaceListSize = replaceList == null ? 0 : replaceList.size(); mapControl.getMapModel().beginTransaction("Replace"); // TODO: I18N/L10N for (final MapSquare<GameObject, MapArchObject, Archetype> square : entireMap ? mapControl.getMapModel() : mapViewIFrame.getView().getSelectedSquares()) { // Operate on a copy of the nodes to prevent ConcurrentModificationException - final List<GameObject> nodes = new ArrayList<GameObject>(); + + // find objects to replace + objectsToReplace.clear(); for (final GameObject node : square) { - nodes.add(node); + if (!node.isMulti() && (matchCriteria == MATCH_ARCH_NAME && node.getArchetypeName() != null && node.getArchetypeName().equalsIgnoreCase(matchString) || matchCriteria == MATCH_OBJ_NAME && node.getBestName().equalsIgnoreCase(matchString))) { + objectsToReplace.add(node); + } } - for (final GameObject node : nodes) { - if (!node.isMulti() && (matchCriteria == MATCH_ARCH_NAME && node.getArchetypeName() != null && node.getArchetypeName().equalsIgnoreCase(matchString) || matchCriteria == MATCH_OBJ_NAME && node.getBestName().equalsIgnoreCase(matchString))) { - if (replaceListSize > 0 && !deleteOnly) { - GameObject randomArch; - if (replaceListSize == 1) { - randomArch = replaceList.get(0); - } else { - randomArch = replaceList.get(MainControl.rnd.nextInt(replaceList.size())); - } - if (randomArch.isMulti()) { - // multi's cannot be inserted properly, so we just put them ontop - randomArch = randomArch.getHead(); - } - randomArch = randomArch.createArch(); - node.replace(randomArch); + + // actually replace the objects + for (final GameObject node : objectsToReplace) { + if (replaceListSize > 0 && !deleteOnly) { + GameObject randomArch; + if (replaceListSize == 1) { + randomArch = replaceList.get(0); } else { - node.remove(); + randomArch = replaceList.get(MainControl.rnd.nextInt(replaceList.size())); } - replaceCount++; + if (randomArch.isMulti()) { + // multi's cannot be inserted properly, so we just put them ontop + randomArch = randomArch.getHead(); + } + randomArch = randomArch.createArch(); + node.replace(randomArch); + } else { + node.remove(); } + replaceCount++; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-04 13:50:21
|
Revision: 1794 http://svn.sourceforge.net/gridarta/?rev=1794&view=rev Author: christianhujer Date: 2007-02-04 05:50:21 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Unified writing of bmaps file. Modified Paths: -------------- trunk/crossfire/src/cfeditor/IGUIConstants.java trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/IGUIConstants.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/src/app/net/sf/gridarta/CommonConstants.java trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java Modified: trunk/crossfire/src/cfeditor/IGUIConstants.java =================================================================== --- trunk/crossfire/src/cfeditor/IGUIConstants.java 2007-02-04 13:48:35 UTC (rev 1793) +++ trunk/crossfire/src/cfeditor/IGUIConstants.java 2007-02-04 13:50:21 UTC (rev 1794) @@ -122,7 +122,6 @@ String TREASURES_FILE = "treasures"; // treasurelists file - String BMAPS_FILE = "bmaps"; String FACETREE_FILE = "bmaps.paths"; String ARCHDEF_FILE = ""; Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2007-02-04 13:48:35 UTC (rev 1793) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2007-02-04 13:50:21 UTC (rev 1794) @@ -28,7 +28,6 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; -import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; @@ -204,21 +203,4 @@ } } - /** {@inheritDoc} */ - @Override protected void collectBmapsFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { - final PrintWriter textFile = new PrintWriter(new BufferedWriter(new FileWriter(new File(dir, IGUIConstants.BMAPS_FILE))), false); - try { - int i = 0; - for (final FaceObject faceObject : this) { - final String face = faceObject.getFaceName(); - textFile.format("%05d %s\n", i, face); - if (i++ % 100 == 0) { - progress.setValue(i); - } - } - } finally { - textFile.close(); - } - } - } // class FaceObjects Modified: trunk/daimonin/src/daieditor/IGUIConstants.java =================================================================== --- trunk/daimonin/src/daieditor/IGUIConstants.java 2007-02-04 13:48:35 UTC (rev 1793) +++ trunk/daimonin/src/daieditor/IGUIConstants.java 2007-02-04 13:50:21 UTC (rev 1794) @@ -134,8 +134,6 @@ String PNG_FILE = "daimonin.0"; // file with all pngs - String BMAPS_FILE = "bmaps"; // file with list of face names - /** File to store the face tree information after arch collection. */ String FACETREE_FILE = "facetree"; Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-02-04 13:48:35 UTC (rev 1793) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-02-04 13:50:21 UTC (rev 1794) @@ -30,12 +30,10 @@ 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.OutputStreamWriter; import java.io.PrintStream; -import java.io.PrintWriter; import java.nio.channels.FileChannel; import javax.swing.GrayFilter; import net.sf.gridarta.gameobject.face.AbstractFaceObjects; @@ -378,21 +376,4 @@ } } - /** {@inheritDoc} */ - @Override protected void collectBmapsFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { - final PrintWriter textFile = new PrintWriter(new BufferedWriter(new FileWriter(new File(dir, IGUIConstants.BMAPS_FILE))), false); - try { - int i = 0; - for (final FaceObject faceObject : this) { - final String face = faceObject.getFaceName(); - textFile.format("%05d %s\n", i, face); - if (i++ % 100 == 0) { - progress.setValue(i); - } - } - } finally { - textFile.close(); - } - } - } // class FaceObjects Modified: trunk/src/app/net/sf/gridarta/CommonConstants.java =================================================================== --- trunk/src/app/net/sf/gridarta/CommonConstants.java 2007-02-04 13:48:35 UTC (rev 1793) +++ trunk/src/app/net/sf/gridarta/CommonConstants.java 2007-02-04 13:50:21 UTC (rev 1794) @@ -50,6 +50,11 @@ public static final String TYPEDEF_FILE = "types.xml"; /** + * Name of the file that contains the list of faces. + */ + public static final String BMAPS_FILE = "bmaps"; + + /** * Don't instanciate. */ private CommonConstants() { Modified: trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java 2007-02-04 13:48:35 UTC (rev 1793) +++ trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java 2007-02-04 13:50:21 UTC (rev 1794) @@ -19,8 +19,12 @@ package net.sf.gridarta.gameobject.face; +import java.io.BufferedWriter; import java.io.File; +import java.io.FileWriter; import java.io.IOException; +import java.io.PrintWriter; +import net.sf.gridarta.CommonConstants; import net.sf.gridarta.data.AbstractNamedObjects; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.misc.Progress; @@ -83,6 +87,20 @@ * @param dir Destination directory to collect data to. * @throws IOException in case of I/O problems during collection */ - protected abstract void collectBmapsFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException; + protected void collectBmapsFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { + final PrintWriter textFile = new PrintWriter(new BufferedWriter(new FileWriter(new File(dir, CommonConstants.BMAPS_FILE))), false); + try { + int i = 0; + for (final FaceObject faceObject : this) { + final String face = faceObject.getFaceName(); + textFile.format("%05d %s\n", i, face); + if (i++ % 100 == 0) { + progress.setValue(i); + } + } + } finally { + textFile.close(); + } + } } // class AbstractFaceObjects This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-04 13:51:22
|
Revision: 1795 http://svn.sourceforge.net/gridarta/?rev=1795&view=rev Author: akirschbaum Date: 2007-02-04 05:51:23 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Rename variable names. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java trunk/daimonin/src/daieditor/gui/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-02-04 13:50:21 UTC (rev 1794) +++ trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-02-04 13:51:23 UTC (rev 1795) @@ -327,14 +327,14 @@ } // actually replace the objects - for (final GameObject objectToDelete : objectsToReplace) { + for (final GameObject objectToReplace : objectsToReplace) { final Iterator<GameObject> it = square.iterator(); GameObject prevArch = null; GameObject node = null; while (it.hasNext()) { node = it.next(); - if (node == objectToDelete) { + if (node == objectToReplace) { break; } Modified: trunk/daimonin/src/daieditor/gui/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/ReplaceDialog.java 2007-02-04 13:50:21 UTC (rev 1794) +++ trunk/daimonin/src/daieditor/gui/ReplaceDialog.java 2007-02-04 13:51:23 UTC (rev 1795) @@ -332,7 +332,7 @@ } // actually replace the objects - for (final GameObject node : objectsToReplace) { + for (final GameObject objectToReplace : objectsToReplace) { if (replaceListSize > 0 && !deleteOnly) { GameObject randomArch; if (replaceListSize == 1) { @@ -345,9 +345,9 @@ randomArch = randomArch.getHead(); } randomArch = randomArch.createArch(); - node.replace(randomArch); + objectToReplace.replace(randomArch); } else { - node.remove(); + objectToReplace.remove(); } replaceCount++; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-04 15:18:45
|
Revision: 1803 http://svn.sourceforge.net/gridarta/?rev=1803&view=rev Author: christianhujer Date: 2007-02-04 07:18:37 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Documented nullability of facename. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/GameObject.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 2007-02-04 14:48:58 UTC (rev 1802) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-02-04 15:18:37 UTC (rev 1803) @@ -42,7 +42,7 @@ /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(GameObject.class); - private String faceName; // face name : 1 + @Nullable private String faceName; // face name : 1 private StringBuffer animText; // anim text buffer @@ -286,7 +286,7 @@ squareChanged(); } - public String getFaceName() { + @Nullable public String getFaceName() { return faceName; } Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2007-02-04 14:48:58 UTC (rev 1802) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2007-02-04 15:18:37 UTC (rev 1803) @@ -231,7 +231,7 @@ } /** {@inheritDoc} */ - public String getFaceName() { + @Nullable public String getFaceName() { return null; } Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2007-02-04 14:48:58 UTC (rev 1802) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2007-02-04 15:18:37 UTC (rev 1803) @@ -148,10 +148,9 @@ * CFEditor only: Returns the name of the face. * @return The name of the face of this Archetype. * @deprecated compatibility method - * @todo document nullability * @todo check whether this isn't the same as {@link #getFaceRealName()}. */ - @Deprecated String getFaceName(); + @Deprecated @Nullable String getFaceName(); /** * DaiEditor only: Returns the real name of the face. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-04 15:33:16
|
Revision: 1804 http://svn.sourceforge.net/gridarta/?rev=1804&view=rev Author: christianhujer Date: 2007-02-04 07:33:12 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Renamed Daimonin's realFaceName to faceName to unify it with Crossfire. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java trunk/daimonin/src/daieditor/io/CMapReader.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 2007-02-04 15:18:37 UTC (rev 1803) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-02-04 15:33:12 UTC (rev 1804) @@ -291,11 +291,6 @@ } /** {@inheritDoc} */ - public String getFaceRealName() { - return null; - } - - /** {@inheritDoc} */ @Nullable public String getAnimName() { return null; } Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-02-04 15:18:37 UTC (rev 1803) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-02-04 15:33:12 UTC (rev 1804) @@ -310,7 +310,7 @@ break; } } - archetype.setFaceRealName(thisLine.substring(x, thisLine.length())); + archetype.setFaceName(thisLine.substring(x, thisLine.length())); archetype.addObjectText(thisLine); } else if (thisLine.startsWith("editor_folder ")) { editorFolder = thisLine.substring(14).trim(); @@ -378,7 +378,7 @@ if (gameObject.getDirection() == -1) { // still the invalid direction! gameObject.setDirection(archetype.getDirection()); } - gameObject.setRealFace(gameObject.getFaceRealName()); + gameObject.setRealFace(gameObject.getFaceName()); // if the type is still unset, then we take the default one if (gameObject.getArchTypNr() == net.sf.gridarta.gameobject.GameObject.TYPE_UNSET) { gameObject.setArchTypNr(archetype.getArchTypNr()); Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-04 15:18:37 UTC (rev 1803) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-04 15:33:12 UTC (rev 1804) @@ -110,12 +110,12 @@ /** {@inheritDoc} */ @NotNull public ImageIcon getFace(@NotNull final Archetype archetype) { - return getFace(archetype.getFaceRealName()); + return getFace(archetype.getFaceName()); } /** {@inheritDoc} */ @NotNull public ImageIcon getFace(@NotNull final GameObject gameObject) { - return getFace(gameObject.getFaceRealName()); + return getFace(gameObject.getFaceName()); } /** Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2007-02-04 15:18:37 UTC (rev 1803) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2007-02-04 15:33:12 UTC (rev 1804) @@ -58,12 +58,12 @@ /** * Face name, can be from animation or face. - * This is determined by taking {@link #faceRealName} or {@link #animName} and takes {@link #direction} into account. + * This is determined by taking {@link #faceName} or {@link #animName} and takes {@link #direction} into account. */ private String faceObjName; /** Object face name <code>face <var>name</var></code>. */ - private String faceRealName; + @Nullable private String faceName; /** Object animation <code>animation <var>animName</var></code>. */ private String animName; @@ -230,11 +230,6 @@ return archType; } - /** {@inheritDoc} */ - @Nullable public String getFaceName() { - return null; - } - public void setArchTypNr(final int typNr) { if (archType == typNr) { return; @@ -302,20 +297,21 @@ } // face name - public void setFaceRealName(final String faceRealName) { - final String newFaceRealName = faceRealName != null ? faceRealName.intern() : null; + public void setFaceName(@Nullable final String faceName) { + final String newFaceName = faceName != null ? faceName.intern() : null; // Using == on these Strings is okay, they are both interned. //noinspection StringEquality - if (this.faceRealName == newFaceRealName) { + if (this.faceName == newFaceName) { return; } - this.faceRealName = newFaceRealName; + this.faceName = newFaceName; squareChanged(); } - public String getFaceRealName() { - return faceRealName; + /** {@inheritDoc} */ + @Nullable public String getFaceName() { + return faceName; } /** @@ -353,15 +349,15 @@ * @param name Real face name. */ public void setRealFace(final String name) { - final String face = getArchetype().getFaceRealName(); + final String face = getArchetype().getFaceName(); /* no name? we always use def arch face */ if (name == null || name.trim().length() == 0) { - setFaceRealName(null); + setFaceName(null); } else if (face != null && face.equals(name)) { /* same as def arch */ - setFaceRealName(null); + setFaceName(null); } else { - setFaceRealName(name); + setFaceName(name); } } @@ -400,12 +396,12 @@ effectiveFaceObjName = null; } } else { // ok, we fallback to the face picture - effectiveFaceObjName = faceRealName; + effectiveFaceObjName = faceName; faceobjdesc = FaceDesc.FACE; if (effectiveFaceObjName == null) { faceobjdesc = FaceDesc.DEFARCH_FACE; if (hasArchetype()) { - effectiveFaceObjName = getArchetype().getFaceRealName(); + effectiveFaceObjName = getArchetype().getFaceName(); } } } @@ -735,7 +731,7 @@ @Override public boolean isEqual(@NotNull final GameObject gameObject) { return super.isEqual(gameObject) && (gameObject.faceObjName == null ? faceObjName == null : gameObject.faceObjName.equals(faceObjName)) - && (gameObject.faceRealName == null ? faceRealName == null : gameObject.faceRealName.equals(faceRealName)) + && (gameObject.faceName == null ? faceName == null : gameObject.faceName.equals(faceName)) && (gameObject.animName == null ? animName == null : gameObject.animName.equals(animName)) && gameObject.multiPartNr == multiPartNr && gameObject.isLowestPart == isLowestPart Modified: trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java =================================================================== --- trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java 2007-02-04 15:18:37 UTC (rev 1803) +++ trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java 2007-02-04 15:33:12 UTC (rev 1804) @@ -94,7 +94,7 @@ if (archetype.hasFaceObject()) { setIcon(CMainControl.getNofaceTileIcon()); } else { - final ImageIcon icon = CMainControl.getInstance().getArchetypeSet().getFace(archetype.getFaceRealName()); + final ImageIcon icon = CMainControl.getInstance().getArchetypeSet().getFace(archetype.getFaceName()); setIcon(icon); } Modified: trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java 2007-02-04 15:18:37 UTC (rev 1803) +++ trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java 2007-02-04 15:33:12 UTC (rev 1804) @@ -130,10 +130,10 @@ /** {@inheritDoc} */ @Override protected String getFaceName(@NotNull final GameObject gameObject) { - if (gameObject.getFaceRealName() != null && gameObject.getFaceRealName().length() > 0) { - return gameObject.getFaceRealName(); + if (gameObject.getFaceName() != null && gameObject.getFaceName().length() > 0) { + return gameObject.getFaceName(); } else { - return gameObject.getArchetype().getFaceRealName(); + return gameObject.getArchetype().getFaceName(); } } @@ -254,7 +254,7 @@ if (inline.length() > 0) { // decide we have to add a "face <name>" string to the gameObject text // Note, that the realFaceName itself is set below - if (archetype.getFaceRealName() == null || archetype.getFaceRealName().compareTo(inline.trim()) != 0) { + if (archetype.getFaceName() == null || archetype.getFaceName().compareTo(inline.trim()) != 0) { newArchText.append(attr.ref.getNameOld()).append(" ").append(inline).append("\n"); } } Modified: trunk/daimonin/src/daieditor/io/CMapReader.java =================================================================== --- trunk/daimonin/src/daieditor/io/CMapReader.java 2007-02-04 15:18:37 UTC (rev 1803) +++ trunk/daimonin/src/daieditor/io/CMapReader.java 2007-02-04 15:33:12 UTC (rev 1804) @@ -152,7 +152,7 @@ gameObject.setDirection(Integer.parseInt(thisLine.substring(10))); gameObject.addObjectText(thisLine); } else if (thisLine.startsWith("face ")) { - gameObject.setFaceRealName(thisLine.substring(5).trim()); + gameObject.setFaceName(thisLine.substring(5).trim()); gameObject.addObjectText(thisLine); } else { gameObject.addObjectText(thisLine); Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2007-02-04 15:18:37 UTC (rev 1803) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2007-02-04 15:33:12 UTC (rev 1804) @@ -145,23 +145,12 @@ void setArchTypNr(int typNr); /** - * CFEditor only: Returns the name of the face. - * @return The name of the face of this Archetype. - * @deprecated compatibility method - * @todo check whether this isn't the same as {@link #getFaceRealName()}. + * Returns the name of the face of this Archetype or GameObject. + * @return The name of the face of this Archetype or GameObject. */ - @Deprecated @Nullable String getFaceName(); + @Nullable String getFaceName(); /** - * DaiEditor only: Returns the real name of the face. - * @return The real name of the face of this Archetype. - * @deprecated compatibility method - * @todo document nullability - * @todo check whether this isn't the same as {@link #getFaceName()}. - */ - @Deprecated String getFaceRealName(); - - /** * DaiEditor only: Returns the name of the animation. * @return The name of the animation. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-04 16:24:13
|
Revision: 1808 http://svn.sourceforge.net/gridarta/?rev=1808&view=rev Author: akirschbaum Date: 2007-02-04 08:24:10 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Mark map as changed if a game object's message, lore or animation was changed. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-02-04 16:15:41 UTC (rev 1807) +++ trunk/crossfire/ChangeLog 2007-02-04 16:24:10 UTC (rev 1808) @@ -1,3 +1,8 @@ +2007-02-04 Andreas Kirschbaum + + * Mark map as changed if a game object's message, lore or + animation was changed. + 2007-02-02 Andreas Kirschbaum * Create correct "editor_folder" entries when collecting Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-02-04 16:15:41 UTC (rev 1807) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-02-04 16:24:10 UTC (rev 1808) @@ -385,11 +385,21 @@ // ANIMText! public void addAnimText(final String text) { + boolean isChanged = false; + if (animText == null) { animText = new StringBuffer(""); + isChanged = true; } - animText.append(text); + if (text.length() > 0) { + animText.append(text); + isChanged = true; + } + + if (isChanged) { + squareChanged(); + } } @Nullable public String getAnimText() { @@ -406,11 +416,21 @@ } public void addLoreText(final String text) { + boolean isChanged = false; + if (loreText == null) { loreText = new StringBuffer(""); + isChanged = true; } - loreText.append(text); + if (text.length() > 0) { + loreText.append(text); + isChanged = true; + } + + if (isChanged) { + squareChanged(); + } } // number of string line in text buffer of this arch Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-02-04 16:15:41 UTC (rev 1807) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-02-04 16:24:10 UTC (rev 1808) @@ -629,16 +629,24 @@ /** Delete message text by nullification. */ public void deleteMsgText() { + if (msgText == null) { + return; + } + // FIXME, see addMsgText for information msgText = null; + squareChanged(); } /** Delete message text by emptying. */ public void resetMsgText() { - if (msgText != null) { - //noinspection ConstantConditions - msgText.delete(0, msgText.length()); + if (msgText == null || msgText.length() == 0) { + return; } + + //noinspection ConstantConditions + msgText.delete(0, msgText.length()); + squareChanged(); } /** @@ -648,16 +656,24 @@ * @param text text to append to message text */ public void addMsgText(@Nullable final String text) { + boolean isChanged = false; + // It's intentional that if text == null, msgText still is created if it's empty. // FIXME: Though it's intentional, it's not nice, search for users and fix this. // (Also look at deleteMsgText() and getMsgText() then) if (msgText == null) { msgText = new StringBuffer(); + isChanged = true; } - if (text != null) { + if (text != null && text.length() > 0) { msgText.append(text); + isChanged = true; } + + if (isChanged) { + squareChanged(); + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-04 16:56:01
|
Revision: 1809 http://svn.sourceforge.net/gridarta/?rev=1809&view=rev Author: christianhujer Date: 2007-02-04 08:56:00 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Unified pickmap chooser Actions. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/crossfire/src/cfeditor/messages_fr.properties trunk/crossfire/src/cfeditor/messages_sv.properties trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/src/app/net/sf/gridarta/map/MapControl.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Actions.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java 2007-02-04 16:56:00 UTC (rev 1809) @@ -22,317 +22,35 @@ import cfeditor.CSettings; import cfeditor.IGUIConstants; import cfeditor.map.MapControl; -import javax.swing.Action; -import net.sf.gridarta.map.MapControlListener; -import net.sf.japi.swing.ActionFactory; -import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * The class <code>Actions</code> encapsulates functionality related to actions * used by the pickmap chooser. * * @author Andreas Kirschbaum + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public class Actions { +public class Actions extends net.sf.gridarta.gui.pickmapchooser.Actions<MapControl> { - /** The Logger for printing log messages. */ - private static final Logger log = Logger.getLogger(Actions.class); - - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); - - /** The control to forward to. */ - @NotNull private final PickmapChooserControl control; - - /** Action called for "add new pickmap". */ - private final Action aAddNewPickmap = ACTION_FACTORY.createAction(true, "addNewPickmap", this); - - /** Action called for "open active pickmap as map". */ - private final Action aOpenPickmapMap = ACTION_FACTORY.createAction(true, "openPickmapMap", this); - - /** Action called for "close active pickmap". */ - private final Action aClosePickmap = ACTION_FACTORY.createAction(true, "closePickmap", this); - - /** Action called for "save active pickmap". */ - private final Action aSavePickmap = ACTION_FACTORY.createAction(true, "savePickmap", this); - - /** Action called for "revert active pickmap". */ - private final Action aRevertPickmap = ACTION_FACTORY.createAction(true, "revertPickmap", this); - - /** The current active pickmap ontop. */ - private MapControl currentPickmap = null; - - /** Set if pickmap loading has completed. */ - private boolean loadComplete = false; // true when all pickmaps have been loaded (at least one) - - /** Set if all pickmaps are locked. */ - private boolean lockAllPickmaps = false; - /** - * The map control listener which is registered to the selected pickmap. - */ - private final MapControlListener<MapControl> mapControlListener = new MapControlListener<MapControl>() { - - /** {@inheritDoc} */ - public void modifiedChanged(@NotNull final MapControl mapControl) { - refresh(); - } - - /** {@inheritDoc} */ - public void mapFileNameChanged(@NotNull final MapControl mapControl) { - // ignore - } - - }; - - /** * Create a new instance. * * @param control the control to forward to */ public Actions(@NotNull final PickmapChooserControl control) { - this.control = control; - lockAllPickmaps = Boolean.valueOf(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(CSettings.PICKMAPS_LOCKED, "false")); - ACTION_FACTORY.createToggles(true, this, "lockAllPickmaps"); + super(control); } - /** - * Finish instance creation. This function must be called once before any - * other function is called. - */ - void init() { - refresh(); + /** {@inheritDoc} */ + @Override protected boolean getLockAllPickmapsFromPrefs() { + return Boolean.valueOf(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(CSettings.PICKMAPS_LOCKED, "false")); } - /** Invoked when user wants to open a new pickmap. */ - public void addNewPickmap() { - if (isAddNewPickmapEnabled()) { - control.addNewPickmap(); - } - } - - /** Open active pickmap as normal map for extensive editing. */ - public void openPickmapMap() { - final MapControl pickmap = getOpenPickmapMap(); - if(pickmap != null) { - control.openPickmapMap(pickmap); - } - } - - /** Invoked when the user wants to close the active pickmap. */ - public void closePickmap() { - final MapControl pickmap = getClosePickmap(); - if (pickmap != null) { - control.closePickmapWanted(pickmap); - } - } - - /** Save current active pickmap. */ - public void savePickmap() { - final MapControl pickmap = getSavePickmap(); - if (pickmap != null) { - control.savePickmap(pickmap); - } - } - - /** Invoked when user wants to revert the current pickmap to previously saved state. */ - public void revertPickmap() { - final MapControl pickmap = getRevertPickmap(); - if (pickmap != null) { - control.revertPickmap(pickmap); - } - } - - /** - * Determine if "add new pickmap" is enabled. - * - * @return <code>true</code> if "add new pickmap" is enabled, - * <code>false</code> otherwise - */ - private boolean isAddNewPickmapEnabled() { - return !control.isLockAllPickmaps() && isLoadComplete() && control.isPickmapActive(); - } - - /** - * Determine if "open pickmap as map" is enabled. - * - * @return the pickmap to open as map, or <code>null</code> if "open - * pickmap as map" is disabled - */ - @Nullable private MapControl getOpenPickmapMap() { - if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { - return null; - } - - final MapControl pickmap = control.getCurrentPickmap(); - if (pickmap == null) { - return null; - } - - return pickmap; - } - - /** - * Determine if "close active pickmap" is enabled. - * - * @return the pickmap to close, or <code>null</code> if "close active - * pickmap" is disabled - */ - @Nullable private MapControl getClosePickmap() { - if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { - return null; - } - - final MapControl pickmap = control.getCurrentPickmap(); - if (pickmap == null) { - return null; - } - - return pickmap; - } - - /** - * Determine if "save active pickmap" is enabled. - * - * @return the pickmap to save, or <code>null</code> if "save active - * pickmap" is disabled - */ - @Nullable private MapControl getSavePickmap() { - if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { - return null; - } - - final MapControl pickmap = control.getCurrentPickmap(); - if (pickmap == null || !pickmap.isModified()) { - return null; - } - - return pickmap; - } - - /** - * Determine if "revert active pickmap" is enabled. - * - * @return the pickmap to revert, or <code>null</code> if "revert active - * pickmap" is disabled - */ - @Nullable private MapControl getRevertPickmap() { - if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { - return null; - } - - final MapControl pickmap = control.getCurrentPickmap(); - if (pickmap == null || !pickmap.isModified() || !pickmap.getMapFile().exists()) { - return null; - } - - return pickmap; - } - - /** - * Update the actions' states. - */ - private void refresh() { - aAddNewPickmap.setEnabled(isAddNewPickmapEnabled()); - aOpenPickmapMap.setEnabled(getOpenPickmapMap() != null); - aClosePickmap.setEnabled(getClosePickmap() != null); - aSavePickmap.setEnabled(getSavePickmap() != null); - aRevertPickmap.setEnabled(getRevertPickmap() != null); - } - - /** - * Return the currently active pickmap. If there is no currently active - * pickmap, this method returns <code>null</code>. - * - * @return the currently active pickmap or <code>null</code> if there is no pickmap - */ - @Nullable MapControl getCurrentPickmap() { - return currentPickmap; - } - - /** - * Set the currently active pickmap. - * - * @param currentPickmap the currently active pickmap - */ - void setCurrentPickmap(@Nullable final MapControl currentPickmap) { - if (this.currentPickmap == currentPickmap) { - return; - } - - if (this.currentPickmap != null) { - this.currentPickmap.removeMapControlListener(mapControlListener); - } - - this.currentPickmap = currentPickmap; - - if (this.currentPickmap != null) { - this.currentPickmap.addMapControlListener(mapControlListener); - } - - refresh(); - } - - /** - * Return whether loading of pickmaps is complete and at least one pickmap is available. - * - * @return <code>true</code> if loading of pickmaps is complete and at - * least one pickmap is available, otherwise <code>false</code> - * - * @todo check whether this method returns <code>true</code> or - * <code>false</code> if the loading process is complete but no pickmaps - * are availbale. - */ - boolean isLoadComplete() { - return loadComplete; - } - - /** - * Set whether loading of pickmaps is complete. - * - * @param loadComplete <code>true</code> if loading of pickmaps is complete - */ - void setLoadComplete(final boolean loadComplete) { - if (this.loadComplete == loadComplete) { - return; - } - - this.loadComplete = loadComplete; - refresh(); - } - - /** - * Callback function: <code>control.isPickmapActive()</code> has changed. - */ - void pickmapActiveChanged() { - refresh(); - } - - /** - * Return whether all pickmaps are locked. - * - * @return <code>true</code> if all pickmaps are locked - */ - public boolean isLockAllPickmaps() { - return lockAllPickmaps; - } - - /** - * Set whether all pickmaps are locked. - * - * @param lockAllPickmaps <code>true</code> if all pickmaps are locked - */ - public void setLockAllPickmaps(final boolean lockAllPickmaps) { - if (this.lockAllPickmaps == lockAllPickmaps) { - return; - } - - this.lockAllPickmaps = lockAllPickmaps; + /** {@inheritDoc} */ + @Override public void setLockAllPickmaps(final boolean lockAllPickmaps) { + super.setLockAllPickmaps(lockAllPickmaps); CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(CSettings.PICKMAPS_LOCKED, isLockAllPickmaps() ? "true" : "false"); - - refresh(); } } // class Actions Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 16:56:00 UTC (rev 1809) @@ -46,7 +46,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author Andreas Kirschbaum */ -public final class PickmapChooserControl { +public final class PickmapChooserControl extends net.sf.gridarta.gui.pickmapchooser.PickmapChooserControl<MapControl> { /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(PickmapChooserControl.class); @@ -88,11 +88,8 @@ return actions.isLoadComplete(); } - /** - * Return the currently active pickmap. - * @return the currently active pickmap or <code>null</code> if there is no pickmap - */ - @Nullable public MapControl getCurrentPickmap() { + /** {@inheritDoc} */ + @Nullable @Override public MapControl getCurrentPickmap() { return actions.getCurrentPickmap(); } @@ -268,35 +265,23 @@ actions.pickmapActiveChanged(); } - /** - * Determine whether a pickmap is active. - * - * @return <code>true</code> if a pickmap is active - */ - boolean isPickmapActive() { + /** {@inheritDoc} */ + @Override public boolean isPickmapActive() { return mainControl.isPickmapActive(); } - /** - * Return whether all pickmaps are locked. - * - * @return <code>true</code> if all pickmaps are locked - */ - public boolean isLockAllPickmaps() { + /** {@inheritDoc} */ + @Override public boolean isLockAllPickmaps() { return actions.isLockAllPickmaps(); } - /** Invoked when user wants to open a new pickmap. */ - public void addNewPickmap() { + /** {@inheritDoc} */ + @Override public void addNewPickmap() { NewMapDialog.showNewMapDialog(mainControl, mainControl.getMainView(), null, MapType.PICKMAP); } - /** - * Open a pickmap as a normal map for extensive editing. - * - * @param pickmap the pickmap to open as a map - */ - public void openPickmapMap(@NotNull final MapControl pickmap) { + /** {@inheritDoc} */ + @Override public void openPickmapMap(@NotNull final MapControl pickmap) { final File pickmapFile = pickmap.getMapFile(); if (!pickmapFile.exists()) { if (!ACTION_FACTORY.showQuestionDialog(mainControl.getMainView(), "confirmCreatePickmap", pickmap.getMapFileName())) { @@ -309,12 +294,8 @@ mainControl.openFile(pickmapFile); } - /** - * Close a pickmap. - * - * @param pickmap the pickmap to close - */ - public void closePickmapWanted(@NotNull final MapControl pickmap) { + /** {@inheritDoc} */ + @Override public void closePickmapWanted(@NotNull final MapControl pickmap) { // if pickmap was modified, ask for confirmation: if (pickmap.isModified() && !ACTION_FACTORY.showQuestionDialog(mainControl.getMainView(), "confirmClosePickmap", pickmap.getMapFileName())) { return; @@ -330,21 +311,13 @@ } } - /** - * Save a pickmap. - * - * @param pickmap the pickmap to save - */ - public void savePickmap(@NotNull final MapControl pickmap) { + /** {@inheritDoc} */ + @Override public void savePickmap(@NotNull final MapControl pickmap) { pickmap.save(); } - /** - * Revert a pickmap. - * - * @param pickmap the pickmap to revert - */ - public void revertPickmap(@NotNull final MapControl pickmap) { + /** {@inheritDoc} */ + @Override public void revertPickmap(@NotNull final MapControl pickmap) { if (pickmap.isModified() && !ACTION_FACTORY.showQuestionDialog(mainControl.getMainView(), "confirmRevertPickmap", pickmap.getMapFileName())) { return; } Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/crossfire/src/cfeditor/messages.properties 2007-02-04 16:56:00 UTC (rev 1809) @@ -298,31 +298,6 @@ archAttributes.accel=ENTER -########### -# Pickmaps - -pickmaps.text=Pickmaps -pickmaps.mnemonic=P - -lockAllPickmaps.text=Lock All Pickmaps -lockAllPickmaps.mnemonic=L - -addNewPickmap.text=Add New Pickmap -addNewPickmap.mnemonic=N - -closePickmap.text=Close Active Pickmap -closePickmap.mnemonic=C - -openPickmapMap.text=Open Active Pickmap as Map -openPickmapMap.mnemonic=O - -savePickmap.text=Save Active Pickmap -savePickmap.mnemonic=S - -revertPickmap.text=Revert Active Pickmap -revertPickmap.mnemonic=R - - ############ # Resources Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2007-02-04 16:56:00 UTC (rev 1809) @@ -293,31 +293,6 @@ archAttributes.accel=ENTER -########### -# Pickmaps - -pickmaps.text=Pickmaps -pickmaps.mnemonic=P - -lockAllPickmaps.text=Alle Pickmaps sperren -lockAllPickmaps.mnemonic=P - -addNewPickmap.text=Pickmap hinzuf\xFCgen -addNewPickmap.mnemonic=H - -closePickmap.text=Aktive Pickmap schlie\xDFen -closePickmap.mnemonic=S - -openPickmapMap.text=Aktive Pickmap als Karte \xF6ffnen -openPickmapMap.mnemonic=F - -savePickmap.text=Aktive Pickmap speichern -savePickmap.mnemonic=S - -revertPickmap.text=Aktive Pickmap zur\xFCcksetzen -revertPickmap.mnemonic=Z - - ############ # Resources Modified: trunk/crossfire/src/cfeditor/messages_fr.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_fr.properties 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/crossfire/src/cfeditor/messages_fr.properties 2007-02-04 16:56:00 UTC (rev 1809) @@ -294,31 +294,6 @@ archAttributes.accel=ENTER -########### -# Pickmaps - -pickmaps.text=Assortiments -pickmaps.mnemonic=S - -lockAllPickmaps.text=Verrouiller les assortiments -lockAllPickmaps.mnemonic=V - -addNewPickmap.text=Nouvel assortiment -addNewPickmap.mnemonic=N - -closePickmap.text=Fermer assortiment actif -closePickmap.mnemonic=F - -openPickmapMap.text=Ouvrir assortiment actif comme carte -openPickmapMap.mnemonic=O - -savePickmap.text=Enregistrer assortiment actif -savePickmap.mnemonic=E - -revertPickmap.text=Restaurer assortiment actif -revertPickmap.mnemonic=R - - ############ # Resources Modified: trunk/crossfire/src/cfeditor/messages_sv.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_sv.properties 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/crossfire/src/cfeditor/messages_sv.properties 2007-02-04 16:56:00 UTC (rev 1809) @@ -294,31 +294,6 @@ archAttributes.accel=ENTER -########### -# Pickmaps - -pickmaps.text=Plockkartor -pickmaps.mnemonic=P - -lockAllPickmaps.text=L\xE5s alla plockkartor -lockAllPickmaps.mnemonic=L - -addNewPickmap.text=L\xE4gg till ny plockkarta -addNewPickmap.mnemonic=N - -closePickmap.text=St\xE4ng aktiv plockkarta -closePickmap.mnemonic=T - -openPickmapMap.text=\xD6ppna aktiv plockkarta som karta -openPickmapMap.mnemonic=P - -savePickmap.text=Spara aktiv plockkarta -savePickmap.mnemonic=S - -revertPickmap.text=\xC5terst\xE4ll plockkarta -revertPickmap.mnemonic=R - - ############ # Resources Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-02-04 16:56:00 UTC (rev 1809) @@ -23,325 +23,43 @@ import daieditor.map.MapControl; import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; -import javax.swing.Action; -import net.sf.gridarta.map.MapControlListener; -import net.sf.japi.swing.ActionFactory; -import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * The class <code>Actions</code> encapsulates functionality related to actions * used by the pickmap chooser. * * @author Andreas Kirschbaum + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public class Actions { +public class Actions extends net.sf.gridarta.gui.pickmapchooser.Actions<MapControl> { - /** The Logger for printing log messages. */ - private static final Logger log = Logger.getLogger(Actions.class); - /** Preferences. */ private static final Preferences prefs = userNodeForPackage(CMainControl.class); - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - - /** The control to forward to. */ - @NotNull private final PickmapChooserControl control; - - /** Action called for "add new pickmap". */ - private final Action aAddNewPickmap = ACTION_FACTORY.createAction(true, "addNewPickmap", this); - - /** Action called for "open active pickmap as map". */ - private final Action aOpenPickmapMap = ACTION_FACTORY.createAction(true, "openPickmapMap", this); - - /** Action called for "close active pickmap". */ - private final Action aClosePickmap = ACTION_FACTORY.createAction(true, "closePickmap", this); - - /** Action called for "save active pickmap". */ - private final Action aSavePickmap = ACTION_FACTORY.createAction(true, "savePickmap", this); - - /** Action called for "revert active pickmap". */ - private final Action aRevertPickmap = ACTION_FACTORY.createAction(true, "revertPickmap", this); - - /** The current active pickmap ontop. */ - private MapControl currentPickmap = null; - - /** Set if pickmap loading has completed. */ - private boolean loadComplete = false; // true when all pickmaps have been loaded (at least one) - - /** Set if all pickmaps are locked. */ - private boolean lockAllPickmaps = false; - /** * Key for "all pickmaps are locked". */ public static final String PICKMAPS_LOCKED = "pickmapsLocked"; /** - * The map control listener which is registered to the selected pickmap. - */ - private final MapControlListener<MapControl> mapControlListener = new MapControlListener<MapControl>() { - - /** {@inheritDoc} */ - public void modifiedChanged(@NotNull final MapControl mapControl) { - refresh(); - } - - /** {@inheritDoc} */ - public void mapFileNameChanged(@NotNull final MapControl mapControl) { - // ignore - } - - }; - - /** * Create a new instance. * * @param control the control to forward to */ public Actions(@NotNull final PickmapChooserControl control) { - this.control = control; - lockAllPickmaps = prefs.getBoolean(PICKMAPS_LOCKED, false); - ACTION_FACTORY.createToggles(true, this, "lockAllPickmaps"); + super(control); } - /** - * Finish instance creation. This function must be called once before any - * other function is called. - */ - void init() { - refresh(); + /** {@inheritDoc} */ + @Override protected boolean getLockAllPickmapsFromPrefs() { + return prefs.getBoolean(PICKMAPS_LOCKED, false); } - /** Invoked when user wants to open a new pickmap. */ - public void addNewPickmap() { - if (isAddNewPickmapEnabled()) { - control.addNewPickmap(); - } - } - - /** Open active pickmap as normal map for extensive editing. */ - public void openPickmapMap() { - final MapControl pickmap = getOpenPickmapMap(); - if(pickmap != null) { - control.openPickmapMap(pickmap); - } - } - - /** Invoked when the user wants to close the active pickmap. */ - public void closePickmap() { - final MapControl pickmap = getClosePickmap(); - if (pickmap != null) { - control.closePickmapWanted(pickmap); - } - } - - /** Save current active pickmap. */ - public void savePickmap() { - final MapControl pickmap = getSavePickmap(); - if (pickmap != null) { - control.savePickmap(pickmap); - } - } - - /** Invoked when user wants to revert the current pickmap to previously saved state. */ - public void revertPickmap() { - final MapControl pickmap = getRevertPickmap(); - if (pickmap != null) { - control.revertPickmap(pickmap); - } - } - - /** - * Determine if "add new pickmap" is enabled. - * - * @return <code>true</code> if "add new pickmap" is enabled, - * <code>false</code> otherwise - */ - private boolean isAddNewPickmapEnabled() { - return !control.isLockAllPickmaps() && isLoadComplete() && control.isPickmapActive(); - } - - /** - * Determine if "open pickmap as map" is enabled. - * - * @return the pickmap to open as map, or <code>null</code> if "open - * pickmap as map" is disabled - */ - @Nullable private MapControl getOpenPickmapMap() { - if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { - return null; - } - - final MapControl pickmap = control.getCurrentPickmap(); - if (pickmap == null) { - return null; - } - - return pickmap; - } - - /** - * Determine if "close active pickmap" is enabled. - * - * @return the pickmap to close, or <code>null</code> if "close active - * pickmap" is disabled - */ - @Nullable private MapControl getClosePickmap() { - if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { - return null; - } - - final MapControl pickmap = control.getCurrentPickmap(); - if (pickmap == null) { - return null; - } - - return pickmap; - } - - /** - * Determine if "save active pickmap" is enabled. - * - * @return the pickmap to save, or <code>null</code> if "save active - * pickmap" is disabled - */ - @Nullable private MapControl getSavePickmap() { - if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { - return null; - } - - final MapControl pickmap = control.getCurrentPickmap(); - if (pickmap == null || !pickmap.isModified()) { - return null; - } - - return pickmap; - } - - /** - * Determine if "revert active pickmap" is enabled. - * - * @return the pickmap to revert, or <code>null</code> if "revert active - * pickmap" is disabled - */ - @Nullable private MapControl getRevertPickmap() { - if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { - return null; - } - - final MapControl pickmap = control.getCurrentPickmap(); - if (pickmap == null || !pickmap.isModified() || !pickmap.getMapFile().exists()) { - return null; - } - - return pickmap; - } - - /** - * Update the actions' states. - */ - private void refresh() { - aAddNewPickmap.setEnabled(isAddNewPickmapEnabled()); - aOpenPickmapMap.setEnabled(getOpenPickmapMap() != null); - aClosePickmap.setEnabled(getClosePickmap() != null); - aSavePickmap.setEnabled(getSavePickmap() != null); - aRevertPickmap.setEnabled(getRevertPickmap() != null); - } - - /** - * Return the currently active pickmap. If there is no currently active - * pickmap, this method returns <code>null</code>. - * - * @return the currently active pickmap or <code>null</code> if there is no pickmap - */ - @Nullable MapControl getCurrentPickmap() { - return currentPickmap; - } - - /** - * Set the currently active pickmap. - * - * @param currentPickmap the currently active pickmap - */ - void setCurrentPickmap(@Nullable final MapControl currentPickmap) { - if (this.currentPickmap == currentPickmap) { - return; - } - - if (this.currentPickmap != null) { - this.currentPickmap.removeMapControlListener(mapControlListener); - } - - this.currentPickmap = currentPickmap; - - if (this.currentPickmap != null) { - this.currentPickmap.addMapControlListener(mapControlListener); - } - - refresh(); - } - - /** - * Return whether loading of pickmaps is complete and at least one pickmap is available. - * - * @return <code>true</code> if loading of pickmaps is complete and at - * least one pickmap is available, otherwise <code>false</code> - * - * @todo check whether this method returns <code>true</code> or - * <code>false</code> if the loading process is complete but no pickmaps - * are availbale. - */ - boolean isLoadComplete() { - return loadComplete; - } - - /** - * Set whether loading of pickmaps is complete. - * - * @param loadComplete <code>true</code> if loading of pickmaps is complete - */ - void setLoadComplete(final boolean loadComplete) { - if (this.loadComplete == loadComplete) { - return; - } - - this.loadComplete = loadComplete; - refresh(); - } - - /** - * Callback function: <code>control.isPickmapActive()</code> has changed. - */ - void pickmapActiveChanged() { - refresh(); - } - - /** - * Return whether all pickmaps are locked. - * - * @return <code>true</code> if all pickmaps are locked - */ - public boolean isLockAllPickmaps() { - return lockAllPickmaps; - } - - /** - * Set whether all pickmaps are locked. - * - * @param lockAllPickmaps <code>true</code> if all pickmaps are locked - */ - public void setLockAllPickmaps(final boolean lockAllPickmaps) { - if (this.lockAllPickmaps == lockAllPickmaps) { - return; - } - - this.lockAllPickmaps = lockAllPickmaps; + /** {@inheritDoc} */ + @Override public void setLockAllPickmaps(final boolean lockAllPickmaps) { + super.setLockAllPickmaps(lockAllPickmaps); prefs.putBoolean(PICKMAPS_LOCKED, isLockAllPickmaps()); - - refresh(); } } // class Actions Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 16:56:00 UTC (rev 1809) @@ -46,7 +46,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author Andreas Kirschbaum */ -public final class PickmapChooserControl { +public final class PickmapChooserControl extends net.sf.gridarta.gui.pickmapchooser.PickmapChooserControl<MapControl> { /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(PickmapChooserControl.class); @@ -87,11 +87,8 @@ return actions.isLoadComplete(); } - /** - * Return the currently active pickmap. - * @return the currently active pickmap or <code>null</code> if there is no pickmap - */ - @Nullable public MapControl getCurrentPickmap() { + /** {@inheritDoc} */ + @Nullable @Override public MapControl getCurrentPickmap() { return actions.getCurrentPickmap(); } @@ -268,35 +265,23 @@ actions.pickmapActiveChanged(); } - /** - * Determine whether a pickmap is active. - * - * @return <code>true</code> if a pickmap is active - */ - boolean isPickmapActive() { + /** {@inheritDoc} */ + @Override public boolean isPickmapActive() { return mainControl.isPickmapActive(); } - /** - * Return whether all pickmaps are locked. - * - * @return <code>true</code> if all pickmaps are locked - */ - public boolean isLockAllPickmaps() { + /** {@inheritDoc} */ + @Override public boolean isLockAllPickmaps() { return actions.isLockAllPickmaps(); } - /** Invoked when user wants to open a new pickmap. */ - public void addNewPickmap() { + /** {@inheritDoc} */ + @Override public void addNewPickmap() { NewMapDialog.showNewMapDialog(mainControl, mainControl.getMainView(), null, MapType.PICKMAP); } - /** - * Open a pickmap as a normal map for extensive editing. - * - * @param pickmap the pickmap to open as a map - */ - public void openPickmapMap(@NotNull final MapControl pickmap) { + /** {@inheritDoc} */ + @Override public void openPickmapMap(@NotNull final MapControl pickmap) { final File pickmapFile = pickmap.getMapFile(); if (!pickmapFile.exists()) { if (!ACTION_FACTORY.showQuestionDialog(mainControl.getMainView(), "confirmCreatePickmap", pickmap.getMapFileName())) { @@ -309,12 +294,8 @@ mainControl.openFile(pickmapFile); } - /** - * Close a pickmap. - * - * @param pickmap the pickmap to close - */ - public void closePickmapWanted(@NotNull final MapControl pickmap) { + /** {@inheritDoc} */ + @Override public void closePickmapWanted(@NotNull final MapControl pickmap) { // if pickmap was modified, ask for confirmation: if (pickmap.isModified() && !ACTION_FACTORY.showQuestionDialog(mainControl.getMainView(), "confirmClosePickmap", pickmap.getMapFileName())) { return; @@ -330,21 +311,13 @@ } } - /** - * Save a pickmap. - * - * @param pickmap the pickmap to save - */ - public void savePickmap(@NotNull final MapControl pickmap) { + /** {@inheritDoc} */ + @Override public void savePickmap(@NotNull final MapControl pickmap) { pickmap.save(); } - /** - * Revert a pickmap. - * - * @param pickmap the pickmap to revert - */ - public void revertPickmap(@NotNull final MapControl pickmap) { + /** {@inheritDoc} */ + @Override public void revertPickmap(@NotNull final MapControl pickmap) { if (pickmap.isModified() && !ACTION_FACTORY.showQuestionDialog(mainControl.getMainView(), "confirmRevertPickmap", pickmap.getMapFileName())) { return; } Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/daimonin/src/daieditor/messages.properties 2007-02-04 16:56:00 UTC (rev 1809) @@ -456,31 +456,6 @@ archAttributes.accel=ENTER -########### -# Pickmaps - -pickmaps.text=Pickmaps -pickmaps.mnemonic=P - -lockAllPickmaps.text=Lock All Pickmaps -lockAllPickmaps.mnemonic=L - -addNewPickmap.text=Add New Pickmap -addNewPickmap.mnemonic=N - -closePickmap.text=Close Active Pickmap -closePickmap.mnemonic=C - -openPickmapMap.text=Open Active Pickmap as Map -openPickmapMap.mnemonic=O - -savePickmap.text=Save Active Pickmap -savePickmap.mnemonic=S - -revertPickmap.text=Revert Active Pickmap -revertPickmap.mnemonic=R - - ############ # Resources Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/daimonin/src/daieditor/messages_de.properties 2007-02-04 16:56:00 UTC (rev 1809) @@ -456,31 +456,6 @@ archAttributes.accel=ENTER -########### -# Pickmaps - -pickmaps.text=Pickmaps -pickmaps.mnemonic=P - -lockAllPickmaps.text=Alle Pickmaps sperren -lockAllPickmaps.mnemonic=P - -addNewPickmap.text=Pickmap hinzuf\xFCgen -addNewPickmap.mnemonic=H - -closePickmap.text=Aktive Pickmap schlie\xDFen -closePickmap.mnemonic=S - -openPickmapMap.text=Aktive Pickmap als Karte \xF6ffnen -openPickmapMap.mnemonic=F - -savePickmap.text=Aktive Pickmap speichern -savePickmap.mnemonic=S - -revertPickmap.text=Aktive Pickmap zur\xFCcksetzen -revertPickmap.mnemonic=Z - - ############ # Resources Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2007-02-04 16:56:00 UTC (rev 1809) @@ -456,31 +456,6 @@ archAttributes.accel=ENTER -########### -# Pickmaps - -pickmaps.text=Assortiments -pickmaps.mnemonic=S - -lockAllPickmaps.text=Verrouiller les assortiments -lockAllPickmaps.mnemonic=V - -addNewPickmap.text=Nouvel assortiment -addNewPickmap.mnemonic=N - -closePickmap.text=Fermer assortiment actif -closePickmap.mnemonic=F - -openPickmapMap.text=Ouvrir assortiment actif comme carte -openPickmapMap.mnemonic=O - -savePickmap.text=Enregistrer assortiment actif -savePickmap.mnemonic=E - -revertPickmap.text=Restaurer assortiment actif -revertPickmap.mnemonic=R - - ############ # Resources Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2007-02-04 16:56:00 UTC (rev 1809) @@ -460,31 +460,6 @@ archAttributes.accel=ENTER -########### -# Pickmaps - -pickmaps.text=Plockkartor -pickmaps.mnemonic=P - -lockAllPickmaps.text=L\xE5s alla plockkartor -lockAllPickmaps.mnemonic=L - -addNewPickmap.text=L\xE4gg till ny plockkarta -addNewPickmap.mnemonic=N - -closePickmap.text=St\xE4ng aktiv plockkarta -closePickmap.mnemonic=T - -openPickmapMap.text=\xD6ppna aktiv plockkarta som karta -openPickmapMap.mnemonic=P - -savePickmap.text=Spara aktiv plockkarta -savePickmap.mnemonic=S - -revertPickmap.text=\xC5terst\xE4ll plockkarta -revertPickmap.mnemonic=R - - ############ # Resources Added: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Actions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Actions.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Actions.java 2007-02-04 16:56:00 UTC (rev 1809) @@ -0,0 +1,341 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.pickmapchooser; + +import javax.swing.Action; +import net.sf.gridarta.map.MapControl; +import net.sf.gridarta.map.MapControlListener; +import net.sf.japi.swing.ActionFactory; +import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * The class <code>Actions</code> encapsulates functionality related to actions + * used by the pickmap chooser. + * + * @author Andreas Kirschbaum + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public abstract class Actions<C extends MapControl> { + + /** The Logger for printing log messages. */ + private static final Logger log = Logger.getLogger(Actions.class); + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); + + /** Action called for "add new pickmap". */ + private final Action aAddNewPickmap = ACTION_FACTORY.createAction(true, "addNewPickmap", this); + + /** Action called for "open active pickmap as map". */ + private final Action aOpenPickmapMap = ACTION_FACTORY.createAction(true, "openPickmapMap", this); + + /** Action called for "close active pickmap". */ + private final Action aClosePickmap = ACTION_FACTORY.createAction(true, "closePickmap", this); + + /** Action called for "save active pickmap". */ + private final Action aSavePickmap = ACTION_FACTORY.createAction(true, "savePickmap", this); + + /** Action called for "revert active pickmap". */ + private final Action aRevertPickmap = ACTION_FACTORY.createAction(true, "revertPickmap", this); + + /** The control to forward to. */ + @NotNull private final PickmapChooserControl<C> control; + + /** The current active pickmap ontop. */ + private C currentPickmap = null; + + /** Set if pickmap loading has completed. */ + private boolean loadComplete = false; // true when all pickmaps have been loaded (at least one) + + /** Set if all pickmaps are locked. */ + private boolean lockAllPickmaps = false; + + /** + * The map control listener which is registered to the selected pickmap. + */ + private final MapControlListener<C> mapControlListener = new MapControlListener<C>() { + + /** {@inheritDoc} */ + public void modifiedChanged(@NotNull final C mapControl) { + refresh(); + } + + /** {@inheritDoc} */ + public void mapFileNameChanged(@NotNull final C mapControl) { + // ignore + } + + }; + + /** + * Create a new instance. + * + * @param control the control to forward to + */ + protected Actions(@NotNull final PickmapChooserControl<C> control) { + this.control = control; + //noinspection AbstractMethodCallInConstructor + lockAllPickmaps = getLockAllPickmapsFromPrefs(); + ACTION_FACTORY.createToggles(true, this, "lockAllPickmaps"); + } + + /** + * Returns the preferences value for locking all pickmaps. + * @return The preferences value for locking all pickmaps. + */ + protected abstract boolean getLockAllPickmapsFromPrefs(); + + /** + * Finish instance creation. This function must be called once before any + * other function is called. + */ + public void init() { + refresh(); + } + + /** Invoked when user wants to open a new pickmap. */ + public void addNewPickmap() { + if (isAddNewPickmapEnabled()) { + control.addNewPickmap(); + } + } + + /** Open active pickmap as normal map for extensive editing. */ + public void openPickmapMap() { + final C pickmap = getOpenPickmapMap(); + if(pickmap != null) { + control.openPickmapMap(pickmap); + } + } + + /** Invoked when the user wants to close the active pickmap. */ + public void closePickmap() { + final C pickmap = getClosePickmap(); + if (pickmap != null) { + control.closePickmapWanted(pickmap); + } + } + + /** Save current active pickmap. */ + public void savePickmap() { + final C pickmap = getSavePickmap(); + if (pickmap != null) { + control.savePickmap(pickmap); + } + } + + /** Invoked when user wants to revert the current pickmap to previously saved state. */ + public void revertPickmap() { + final C pickmap = getRevertPickmap(); + if (pickmap != null) { + control.revertPickmap(pickmap); + } + } + + /** + * Determine if "add new pickmap" is enabled. + * + * @return <code>true</code> if "add new pickmap" is enabled, + * <code>false</code> otherwise + */ + private boolean isAddNewPickmapEnabled() { + return !control.isLockAllPickmaps() && isLoadComplete() && control.isPickmapActive(); + } + + /** + * Determine if "open pickmap as map" is enabled. + * + * @return the pickmap to open as map, or <code>null</code> if "open + * pickmap as map" is disabled + */ + @Nullable private C getOpenPickmapMap() { + if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { + return null; + } + + final C pickmap = control.getCurrentPickmap(); + if (pickmap == null) { + return null; + } + + return pickmap; + } + + /** + * Determine if "close active pickmap" is enabled. + * + * @return the pickmap to close, or <code>null</code> if "close active + * pickmap" is disabled + */ + @Nullable private C getClosePickmap() { + if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { + return null; + } + + final C pickmap = control.getCurrentPickmap(); + if (pickmap == null) { + return null; + } + + return pickmap; + } + + /** + * Determine if "save active pickmap" is enabled. + * + * @return the pickmap to save, or <code>null</code> if "save active + * pickmap" is disabled + */ + @Nullable private C getSavePickmap() { + if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { + return null; + } + + final C pickmap = control.getCurrentPickmap(); + if (pickmap == null || !pickmap.isModified()) { + return null; + } + + return pickmap; + } + + /** + * Determine if "revert active pickmap" is enabled. + * + * @return the pickmap to revert, or <code>null</code> if "revert active + * pickmap" is disabled + */ + @Nullable private C getRevertPickmap() { + if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { + return null; + } + + final C pickmap = control.getCurrentPickmap(); + if (pickmap == null || !pickmap.isModified() || !pickmap.getMapFile().exists()) { + return null; + } + + return pickmap; + } + + /** + * Return the currently active pickmap. If there is no currently active + * pickmap, this method returns <code>null</code>. + * + * @return the currently active pickmap or <code>null</code> if there is no pickmap + */ + @Nullable public C getCurrentPickmap() { + return currentPickmap; + } + + /** + * Set the currently active pickmap. + * + * @param currentPickmap the currently active pickmap + */ + public void setCurrentPickmap(@Nullable final C currentPickmap) { + if (this.currentPickmap == currentPickmap) { + return; + } + + if (this.currentPickmap != null) { + this.currentPickmap.removeMapControlListener(mapControlListener); + } + + this.currentPickmap = currentPickmap; + + if (this.currentPickmap != null) { + this.currentPickmap.addMapControlListener(mapControlListener); + } + + refresh(); + } + + /** + * Return whether loading of pickmaps is complete and at least one pickmap is available. + * + * @return <code>true</code> if loading of pickmaps is complete and at + * least one pickmap is available, otherwise <code>false</code> + * + * @todo check whether this method returns <code>true</code> or + * <code>false</code> if the loading process is complete but no pickmaps + * are availbale. + */ + public boolean isLoadComplete() { + return loadComplete; + } + + /** + * Set whether loading of pickmaps is complete. + * + * @param loadComplete <code>true</code> if loading of pickmaps is complete + */ + public void setLoadComplete(final boolean loadComplete) { + if (this.loadComplete == loadComplete) { + return; + } + + this.loadComplete = loadComplete; + refresh(); + } + + /** + * Callback function: <code>control.isPickmapActive()</code> has changed. + */ + public void pickmapActiveChanged() { + refresh(); + } + + /** + * Return whether all pickmaps are locked. + * + * @return <code>true</code> if all pickmaps are locked + */ + public boolean isLockAllPickmaps() { + return lockAllPickmaps; + } + /** + * Set whether all pickmaps are locked. + * + * @param lockAllPickmaps <code>true</code> if all pickmaps are locked + */ + public void setLockAllPickmaps(final boolean lockAllPickmaps) { + if (this.lockAllPickmaps == lockAllPickmaps) { + return; + } + + this.lockAllPickmaps = lockAllPickmaps; + refresh(); + } + + /** + * Update the actions' states. + */ + protected void refresh() { + aAddNewPickmap.setEnabled(isAddNewPickmapEnabled()); + aOpenPickmapMap.setEnabled(getOpenPickmapMap() != null); + aClosePickmap.setEnabled(getClosePickmap() != null); + aSavePickmap.setEnabled(getSavePickmap() != null); + aRevertPickmap.setEnabled(getRevertPickmap() != null); + } + +} // class Actions Property changes on: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Actions.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 16:56:00 UTC (rev 1809) @@ -0,0 +1,86 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.pickmapchooser; + +import net.sf.gridarta.map.MapControl; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * The <code>PickmapChooserControl</code> manages the pickmap panel + * and most pickmap-related code in general. + * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author Andreas Kirschbaum + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public abstract class PickmapChooserControl<C extends MapControl> { + + /** + * Return the currently active pickmap. + * @return the currently active pickmap or <code>null</code> if there is no pickmap + */ + @Nullable public abstract C getCurrentPickmap(); + + /** Invoked when user wants to open a new pickmap. */ + public abstract void addNewPickmap(); + + /** + * Open a pickmap as a normal map for extensive editing. + * + * @param pickmap the pickmap to open as a map + */ + public abstract void openPickmapMap(@NotNull final C pickmap); + + /** + * Close a pickmap. + * + * @param pickmap the pickmap to close + */ + public abstract void closePickmapWanted(@NotNull final C pickmap); + + /** + * Save a pickmap. + * + * @param pickmap the pickmap to save + */ + public abstract void savePickmap(@NotNull final C pickmap); + + /** + * Revert a pickmap. + * + * @param pickmap the pickmap to revert + */ + public abstract void revertPickmap(@NotNull final C pickmap); + + /** + * Determine whether a pickmap is active. + * + * @return <code>true</code> if a pickmap is active + */ + public abstract boolean isPickmapActive(); + + /** + * Return whether all pickmaps are locked. + * + * @return <code>true</code> if all pickmaps are locked + */ + public abstract boolean isLockAllPickmaps(); + +} // class PickmapChooserControl Property changes on: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/map/MapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapControl.java 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/src/app/net/sf/gridarta/map/MapControl.java 2007-02-04 16:56:00 UTC (rev 1809) @@ -20,11 +20,13 @@ package net.sf.gridarta.map; import java.awt.Point; +import java.io.File; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; import net.sf.gridarta.gui.map.MapCursor; import net.sf.gridarta.gui.map.MapGrid; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Currently nothing more than a marker interface for unification. @@ -124,6 +126,12 @@ void setMapFileName(@NotNull String mapFileName); /** + * Returns the map file. + * @return The map file + */ + @Nullable File getMapFile(); + + /** * Return whether the level can be just saved (true) or does it need to be * saved as (false). * @return <code>true</code> if level can be just saved, <code>false</code> Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/src/app/net/sf/gridarta/messages.properties 2007-02-04 16:56:00 UTC (rev 1809) @@ -262,6 +262,31 @@ scriptRemove.text=Remove Script +########### +# Pickmaps + +pickmaps.text=Pickmaps +pickmaps.mnemonic=P + +lockAllPickmaps.text=Lock All Pickmaps +lockAllPickmaps.mnemonic=L + +addNewPickmap.text=Add New Pickmap +addNewPickmap.mnemonic=N + +closePickmap.text=Close Active Pickmap +closePickmap.mnemonic=C + +openPickmapMap.text=Open Active Pickmap as Map +openPickmapMap.mnemonic=O + +savePickmap.text=Save Active Pickmap +savePickmap.mnemonic=S + +revertPickmap.text=Revert Active Pickmap +revertPickmap.mnemonic=R + + ##################### # Preference Modules Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2007-02-04 16:56:00 UTC (rev 1809) @@ -255,6 +255,31 @@ scriptRemove.text=Script l\xF6schen +########### +# Pickmaps + +pickmaps.text=Pickmaps +pickmaps.mnemonic=P + +lockAllPickmaps.text=Alle Pickmaps sperren +lockAllPickmaps.mnemonic=P + +addNewPickmap.text=Pickmap hinzuf\xFCgen +addNewPickmap.mnemonic=H + +closePickmap.text=Aktive Pickmap schlie\xDFen +closePickmap.mnemonic=S + +openPickmapMap.text=Aktive Pickmap als Karte \xF6ffnen +openPickmapMap.mnemonic=F + +savePickmap.text=Aktive Pickmap speichern +savePickmap.mnemonic=S + +revertPickmap.text=Aktive Pickmap zur\xFCcksetzen +revertPickmap.mnemonic=Z + + ##################### # Preference Modules Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2007-02-04 16:56:00 UTC (rev 1809) @@ -254,6 +254,31 @@ #scriptRemove.text= +########### +# Pickmaps + +pickmaps.text=Assortiments +pickmaps.mnemonic=S + +lockAllPickmaps.text=Verrouiller les assortiments +lockAllPickmaps.mnemonic=V + +addNewPickmap.text=Nouvel assortiment +addNewPickmap.mnemonic=N + +closePickmap.text=Fermer assortiment actif +closePickmap.mnemonic=F + +openPickmapMap.text=Ouvrir assortiment actif comme carte +openPickmapMap.mnemonic=O + +savePickmap.text=Enregistrer assortiment actif +savePickmap.mnemonic=E + +revertPickmap.text=Restaurer assortiment actif +revertPickmap.mnemonic=R + + ##################### # Preference Modules Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2007-02-04 16:24:10 UTC (rev 1808) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2007-02-04 16:56:00 UTC (rev 1809) @@ -254,6 +254,31 @@ scriptRemove.text=Ta bort script +########### +# Pickmaps + +pickmaps.text=Plockkartor +pickmaps.mnemonic=P + +lockAllPickmaps.text=L\xE5s alla plockkartor +lockAllPickmaps.mnemonic=L + +addNewPickmap.text=L\xE4gg till ny plockkarta +addNewPickmap.mnemonic=N + +closePickmap.text=St\xE4ng aktiv plockkarta +closePickmap.mnemonic=T + +openPickmapMap.text=\xD6ppna aktiv plockkarta som karta +openPickmapMap.mnemonic=P + +savePickmap.text=Spara aktiv plockkarta +savePickmap.mnemonic=S + +revertPickmap.text=\xC5terst\xE4ll plockkarta +revertPickmap.mnemonic=R + + #################### # Preference Module This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-04 17:00:33
|
Revision: 1810 http://svn.sourceforge.net/gridarta/?rev=1810&view=rev Author: christianhujer Date: 2007-02-04 09:00:25 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Declared common setPickmapActive method in common MainView baseclass. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/ArchNPickChangeListener.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/gui/pickmapchooser/ArchNPickChangeListener.java trunk/src/app/net/sf/gridarta/gui/MainView.java Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-02-04 16:56:00 UTC (rev 1809) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-02-04 17:00:25 UTC (rev 1810) @@ -283,13 +283,8 @@ new Help(this, null).setVisible(true); } - /** - * Set whether a pickmap is active. - * - * @param pickmapActive <code>true</code> if a pickmap is active, - * <code>false</code> if no pickmap is active - */ - public void setPickmapActive(final boolean pickmapActive) { + /** {@inheritDoc} */ + @Override public void setPickmapActive(final boolean pickmapActive) { if (this.pickmapActive == pickmapActive) { return; } Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/ArchNPickChangeListener.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/ArchNPickChangeListener.java 2007-02-04 16:56:00 UTC (rev 1809) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/ArchNPickChangeListener.java 2007-02-04 17:00:25 UTC (rev 1810) @@ -19,10 +19,10 @@ package cfeditor.gui.pickmapchooser; -import cfeditor.CMainView; import javax.swing.JTabbedPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import net.sf.gridarta.gui.MainView; /** * In the left-side panel, archlist and pickmaps are exclusive @@ -33,7 +33,7 @@ */ public final class ArchNPickChangeListener implements ChangeListener { - private final CMainView mainView; // main view + private final MainView mainView; // main view private final JTabbedPane tabpane; // parent pane for archlist & pickmaps @@ -44,7 +44,7 @@ * @param mainView the main view * @param pane the JTabbedPane containing both archlist and pickmaps */ - public ArchNPickChangeListener(final CMainView mainView, final JTabbedPane pane) { + public ArchNPickChangeListener(final MainView mainView, final JTabbedPane pane) { this.mainView = mainView; tabpane = pane; selectedIndex = tabpane.getSelectedIndex(); Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2007-02-04 16:56:00 UTC (rev 1809) +++ trunk/daimonin/src/daieditor/CMainView.java 2007-02-04 17:00:25 UTC (rev 1810) @@ -246,13 +246,8 @@ new Help(this, null).setVisible(true); } - /** - * Set whether a pickmap is active. - * - * @param pickmapActive <code>true</code> if a pickmap is active, - * <code>false</code> if no pickmap is active - */ - public void setPickmapActive(final boolean pickmapActive) { + /** {@inheritDoc} */ + @Override public void setPickmapActive(final boolean pickmapActive) { if (this.pickmapActive == pickmapActive) { return; } Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/ArchNPickChangeListener.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/ArchNPickChangeListener.java 2007-02-04 16:56:00 UTC (rev 1809) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/ArchNPickChangeListener.java 2007-02-04 17:00:25 UTC (rev 1810) @@ -19,10 +19,10 @@ package daieditor.gui.pickmapchooser; -import daieditor.CMainView; import javax.swing.JTabbedPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import net.sf.gridarta.gui.MainView; /** * In the left-side panel, archlist and pickmaps are exclusive @@ -33,7 +33,7 @@ */ public final class ArchNPickChangeListener implements ChangeListener { - private final CMainView mainView; // main view + private final MainView mainView; // main view private final JTabbedPane tabpane; // parent pane for archlist & pickmaps @@ -44,7 +44,7 @@ * @param mainView the main view * @param pane the JTabbedPane containing both archlist and pickmaps */ - public ArchNPickChangeListener(final CMainView mainView, final JTabbedPane pane) { + public ArchNPickChangeListener(final MainView mainView, final JTabbedPane pane) { this.mainView = mainView; tabpane = pane; selectedIndex = tabpane.getSelectedIndex(); Modified: trunk/src/app/net/sf/gridarta/gui/MainView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/MainView.java 2007-02-04 16:56:00 UTC (rev 1809) +++ trunk/src/app/net/sf/gridarta/gui/MainView.java 2007-02-04 17:00:25 UTC (rev 1810) @@ -43,4 +43,12 @@ */ public abstract void refreshMapArchPanel(); + /** + * Set whether a pickmap is active. + * + * @param pickmapActive <code>true</code> if a pickmap is active, + * <code>false</code> if no pickmap is active + */ + public abstract void setPickmapActive(final boolean pickmapActive); + } // class MainView This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-04 17:03:56
|
Revision: 1811 http://svn.sourceforge.net/gridarta/?rev=1811&view=rev Author: christianhujer Date: 2007-02-04 09:03:56 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Moved common ArchNPickChangeListener class to gridarta. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/ArchNPickChangeListener.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/gui/pickmapchooser/ArchNPickChangeListener.java trunk/daimonin/src/daieditor/gui/pickmapchooser/ArchNPickChangeListener.java Deleted: trunk/crossfire/src/cfeditor/gui/pickmapchooser/ArchNPickChangeListener.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/ArchNPickChangeListener.java 2007-02-04 17:00:25 UTC (rev 1810) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/ArchNPickChangeListener.java 2007-02-04 17:03:56 UTC (rev 1811) @@ -1,66 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package cfeditor.gui.pickmapchooser; - -import javax.swing.JTabbedPane; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import net.sf.gridarta.gui.MainView; - -/** - * In the left-side panel, archlist and pickmaps are exclusive - * (only the one being displayed is active). - * This listener gets to know which of them is active and - * keeps the main view informed whenever the state changes. - * @author Andreas Kirschbaum - */ -public final class ArchNPickChangeListener implements ChangeListener { - - private final MainView mainView; // main view - - private final JTabbedPane tabpane; // parent pane for archlist & pickmaps - - private int selectedIndex; // current state of selection - - /** - * Create an ArchNPickChangeListener. - * @param mainView the main view - * @param pane the JTabbedPane containing both archlist and pickmaps - */ - public ArchNPickChangeListener(final MainView mainView, final JTabbedPane pane) { - this.mainView = mainView; - tabpane = pane; - selectedIndex = tabpane.getSelectedIndex(); - } - - public void stateChanged(final ChangeEvent e) { - if (tabpane.getSelectedIndex() != selectedIndex) { - // the state has changed, user has switched panels - if (tabpane.getSelectedIndex() == 0) { - mainView.setPickmapActive(false); - } else { - mainView.setPickmapActive(true); - } - - selectedIndex = tabpane.getSelectedIndex(); // save new state - } - } - -} // class ArchNPickChangeListener Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 17:00:25 UTC (rev 1810) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 17:03:56 UTC (rev 1811) @@ -34,6 +34,7 @@ import java.util.Arrays; import java.util.List; import javax.swing.JTabbedPane; +import net.sf.gridarta.gui.pickmapchooser.ArchNPickChangeListener; import net.sf.gridarta.map.MapType; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; Deleted: trunk/daimonin/src/daieditor/gui/pickmapchooser/ArchNPickChangeListener.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/ArchNPickChangeListener.java 2007-02-04 17:00:25 UTC (rev 1810) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/ArchNPickChangeListener.java 2007-02-04 17:03:56 UTC (rev 1811) @@ -1,66 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package daieditor.gui.pickmapchooser; - -import javax.swing.JTabbedPane; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import net.sf.gridarta.gui.MainView; - -/** - * In the left-side panel, archlist and pickmaps are exclusive - * (only the one being displayed is active). - * This listener gets to know which of them is active and - * keeps the main view informed whenever the state changes. - * @author Andreas Kirschbaum - */ -public final class ArchNPickChangeListener implements ChangeListener { - - private final MainView mainView; // main view - - private final JTabbedPane tabpane; // parent pane for archlist & pickmaps - - private int selectedIndex; // current state of selection - - /** - * Create an ArchNPickChangeListener. - * @param mainView the main view - * @param pane the JTabbedPane containing both archlist and pickmaps - */ - public ArchNPickChangeListener(final MainView mainView, final JTabbedPane pane) { - this.mainView = mainView; - tabpane = pane; - selectedIndex = tabpane.getSelectedIndex(); - } - - public void stateChanged(final ChangeEvent e) { - if (tabpane.getSelectedIndex() != selectedIndex) { - // the state has changed, user has switched panels - if (tabpane.getSelectedIndex() == 0) { - mainView.setPickmapActive(false); - } else { - mainView.setPickmapActive(true); - } - - selectedIndex = tabpane.getSelectedIndex(); // save new state - } - } - -} // class ArchNPickChangeListener Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 17:00:25 UTC (rev 1810) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 17:03:56 UTC (rev 1811) @@ -34,6 +34,7 @@ import java.util.Arrays; import java.util.List; import javax.swing.JTabbedPane; +import net.sf.gridarta.gui.pickmapchooser.ArchNPickChangeListener; import net.sf.gridarta.map.MapType; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; Copied: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/ArchNPickChangeListener.java (from rev 1810, trunk/crossfire/src/cfeditor/gui/pickmapchooser/ArchNPickChangeListener.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/ArchNPickChangeListener.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/ArchNPickChangeListener.java 2007-02-04 17:03:56 UTC (rev 1811) @@ -0,0 +1,66 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.pickmapchooser; + +import javax.swing.JTabbedPane; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import net.sf.gridarta.gui.MainView; + +/** + * In the left-side panel, archlist and pickmaps are exclusive + * (only the one being displayed is active). + * This listener gets to know which of them is active and + * keeps the main view informed whenever the state changes. + * @author Andreas Kirschbaum + */ +public final class ArchNPickChangeListener implements ChangeListener { + + private final MainView mainView; // main view + + private final JTabbedPane tabpane; // parent pane for archlist & pickmaps + + private int selectedIndex; // current state of selection + + /** + * Create an ArchNPickChangeListener. + * @param mainView the main view + * @param pane the JTabbedPane containing both archlist and pickmaps + */ + public ArchNPickChangeListener(final MainView mainView, final JTabbedPane pane) { + this.mainView = mainView; + tabpane = pane; + selectedIndex = tabpane.getSelectedIndex(); + } + + public void stateChanged(final ChangeEvent e) { + if (tabpane.getSelectedIndex() != selectedIndex) { + // the state has changed, user has switched panels + if (tabpane.getSelectedIndex() == 0) { + mainView.setPickmapActive(false); + } else { + mainView.setPickmapActive(true); + } + + selectedIndex = tabpane.getSelectedIndex(); // save new state + } + } + +} // class ArchNPickChangeListener Property changes on: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/ArchNPickChangeListener.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-04 17:07:27
|
Revision: 1812 http://svn.sourceforge.net/gridarta/?rev=1812&view=rev Author: christianhujer Date: 2007-02-04 09:07:28 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Unified a constant. Modified Paths: -------------- trunk/crossfire/src/cfeditor/IGUIConstants.java trunk/crossfire/src/cfeditor/gui/InsertionObjectChooser.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java trunk/daimonin/src/daieditor/IGUIConstants.java trunk/daimonin/src/daieditor/gui/InsertionObjectChooser.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java trunk/src/app/net/sf/gridarta/CommonConstants.java Modified: trunk/crossfire/src/cfeditor/IGUIConstants.java =================================================================== --- trunk/crossfire/src/cfeditor/IGUIConstants.java 2007-02-04 17:03:56 UTC (rev 1811) +++ trunk/crossfire/src/cfeditor/IGUIConstants.java 2007-02-04 17:07:28 UTC (rev 1812) @@ -77,12 +77,6 @@ @SuppressWarnings({"ConstantNamingConvention"}) int SPACE_BETWEEN_BUTTON_AREA_AND_MAIN_DIALOG = 7; - /** - * The height of rigid area between the two tab-panes on the pickmap- and - * arch-panel. - */ - int SPACE_PICKARCH_TOP = 10; - /** The amount of space to be left around the dialog borders. */ int DIALOG_INSETS = 4; Modified: trunk/crossfire/src/cfeditor/gui/InsertionObjectChooser.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/InsertionObjectChooser.java 2007-02-04 17:03:56 UTC (rev 1811) +++ trunk/crossfire/src/cfeditor/gui/InsertionObjectChooser.java 2007-02-04 17:07:28 UTC (rev 1812) @@ -35,6 +35,7 @@ import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import net.sf.gridarta.CommonConstants; import net.sf.gridarta.gui.GSplitPane; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -84,7 +85,7 @@ super(new BorderLayout()); this.mainControl = mainControl; - tabDesktop.setBorder(BorderFactory.createEmptyBorder(IGUIConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); + tabDesktop.setBorder(BorderFactory.createEmptyBorder(CommonConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); archQuickPanel = new ObjectChoiceDisplay(mainControl); // archAndPickPane is the panel containing both archpanel and pickmaps Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java 2007-02-04 17:03:56 UTC (rev 1811) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java 2007-02-04 17:07:28 UTC (rev 1812) @@ -19,12 +19,12 @@ package cfeditor.gui.pickmapchooser; -import cfeditor.IGUIConstants; import java.awt.Component; import javax.swing.BorderFactory; import javax.swing.JTabbedPane; import javax.swing.SwingConstants; import javax.swing.event.ChangeListener; +import net.sf.gridarta.CommonConstants; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -46,7 +46,7 @@ public PickmapChooserView() { pickmapPanel.setComponentPopupMenu(ACTION_FACTORY.createPopupMenu(true, "pickmaps")); - pickmapPanel.setBorder(BorderFactory.createEmptyBorder(IGUIConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); + pickmapPanel.setBorder(BorderFactory.createEmptyBorder(CommonConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); } void addChangeListener(@NotNull final ChangeListener changeListener) { Modified: trunk/daimonin/src/daieditor/IGUIConstants.java =================================================================== --- trunk/daimonin/src/daieditor/IGUIConstants.java 2007-02-04 17:03:56 UTC (rev 1811) +++ trunk/daimonin/src/daieditor/IGUIConstants.java 2007-02-04 17:07:28 UTC (rev 1812) @@ -91,12 +91,6 @@ */ int[] ALL_TILE_PATHS = {TILE_PATH_NORTH, TILE_PATH_EAST, TILE_PATH_SOUTH, TILE_PATH_WEST, TILE_PATH_NORTHEAST, TILE_PATH_SOUTHEAST, TILE_PATH_SOUTHWEST, TILE_PATH_NORTHWEST}; - /** - * The height of rigid area between the two tab-panes on the pickmap- and - * arch-panel. - */ - int SPACE_PICKARCH_TOP = 10; - /** The Border object to be used when creating dialogs. */ Border DIALOG_BORDER = new EmptyBorder(new Insets(4, 4, 4, 4)); Modified: trunk/daimonin/src/daieditor/gui/InsertionObjectChooser.java =================================================================== --- trunk/daimonin/src/daieditor/gui/InsertionObjectChooser.java 2007-02-04 17:03:56 UTC (rev 1811) +++ trunk/daimonin/src/daieditor/gui/InsertionObjectChooser.java 2007-02-04 17:07:28 UTC (rev 1812) @@ -20,7 +20,6 @@ package daieditor.gui; import daieditor.CMainControl; -import daieditor.IGUIConstants; import daieditor.gameobject.Archetype; import daieditor.gameobject.GameObject; import daieditor.gui.map.tools.ToolPalette; @@ -38,6 +37,7 @@ import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import net.sf.gridarta.CommonConstants; import net.sf.gridarta.gui.GSplitPane; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ActionMethod; @@ -100,7 +100,7 @@ super(new BorderLayout()); this.mainControl = mainControl; - tabDesktop.setBorder(BorderFactory.createEmptyBorder(IGUIConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); + tabDesktop.setBorder(BorderFactory.createEmptyBorder(CommonConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); archQuickPanel = new ObjectChoiceDisplay(mainControl); archPane.add(tabDesktop); Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java 2007-02-04 17:03:56 UTC (rev 1811) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java 2007-02-04 17:07:28 UTC (rev 1812) @@ -19,12 +19,12 @@ package daieditor.gui.pickmapchooser; -import daieditor.IGUIConstants; import java.awt.Component; import javax.swing.BorderFactory; import javax.swing.JTabbedPane; import javax.swing.SwingConstants; import javax.swing.event.ChangeListener; +import net.sf.gridarta.CommonConstants; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -46,7 +46,7 @@ public PickmapChooserView() { pickmapPanel.setComponentPopupMenu(ACTION_FACTORY.createPopupMenu(true, "pickmaps")); - pickmapPanel.setBorder(BorderFactory.createEmptyBorder(IGUIConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); + pickmapPanel.setBorder(BorderFactory.createEmptyBorder(CommonConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); } void addChangeListener(@NotNull final ChangeListener changeListener) { Modified: trunk/src/app/net/sf/gridarta/CommonConstants.java =================================================================== --- trunk/src/app/net/sf/gridarta/CommonConstants.java 2007-02-04 17:03:56 UTC (rev 1811) +++ trunk/src/app/net/sf/gridarta/CommonConstants.java 2007-02-04 17:07:28 UTC (rev 1812) @@ -55,6 +55,12 @@ public static final String BMAPS_FILE = "bmaps"; /** + * The height of rigid area between the two tab-panes on the pickmap- and + * arch-panel. + */ + public static final int SPACE_PICKARCH_TOP = 10; + + /** * Don't instanciate. */ private CommonConstants() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-04 17:19:27
|
Revision: 1814 http://svn.sourceforge.net/gridarta/?rev=1814&view=rev Author: christianhujer Date: 2007-02-04 09:19:20 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Moved PickmapChooserView to gridarta. Modified Paths: -------------- trunk/crossfire/src/cfeditor/action.properties trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/action.properties Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserView.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java Modified: trunk/crossfire/src/cfeditor/action.properties =================================================================== --- trunk/crossfire/src/cfeditor/action.properties 2007-02-04 17:15:25 UTC (rev 1813) +++ trunk/crossfire/src/cfeditor/action.properties 2007-02-04 17:19:20 UTC (rev 1814) @@ -31,8 +31,8 @@ file.menu=createNew open close - save saveAs revert createImage - options - exit edit.menu=undo redo - clear cut copy paste - replace fillAbove fillBelow randFillAbove randFillBelow floodfill - selectAll map.menu=autoJoin - gridVisible enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterUpperMap enterLowerMap tileShow - mapProperties -cursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes -pickmaps.menu=lockAllPickmaps - addNewPickmap closePickmap - openPickmapMap - savePickmap revertPickmap +cursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes# +#pickmaps.menu: See gridarta resources.menu=collectArches collectSpells - viewTreasurelists tools.menu=gc analyze.menu= @@ -96,17 +96,6 @@ moveCursor.menu=goNorth goEast goSouth goWest goNorthEast goSouthEast goSouthWest goNorthWest -addNewPickmap.icon=general/New16 - -closePickmap.icon=EmptySmallIcon - -openPickmapMap.icon=general/Open16 - -savePickmap.icon=general/Save16 - -revertPickmap.icon=general/Refresh16 - - collectArches.icon=development/Jar16 gc.icon=general/Delete16 Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 17:15:25 UTC (rev 1813) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 17:19:20 UTC (rev 1814) @@ -35,6 +35,7 @@ import java.util.List; import javax.swing.JTabbedPane; import net.sf.gridarta.gui.pickmapchooser.ArchNPickChangeListener; +import net.sf.gridarta.gui.pickmapchooser.PickmapChooserView; import net.sf.gridarta.map.MapType; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; Deleted: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java 2007-02-04 17:15:25 UTC (rev 1813) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java 2007-02-04 17:19:20 UTC (rev 1814) @@ -1,80 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package cfeditor.gui.pickmapchooser; - -import java.awt.Component; -import javax.swing.BorderFactory; -import javax.swing.JTabbedPane; -import javax.swing.SwingConstants; -import javax.swing.event.ChangeListener; -import net.sf.gridarta.CommonConstants; -import net.sf.japi.swing.ActionFactory; -import org.apache.log4j.Logger; -import org.jetbrains.annotations.NotNull; - -/** - * A View for choosing pickmaps. - * @author Andreas Kirschbaum - */ -public final class PickmapChooserView { - - /** The Logger for printing log messages. */ - private static final Logger log = Logger.getLogger(PickmapChooserView.class); - - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); - - /** Panel with pickmaps. */ - private final JTabbedPane pickmapPanel = new JTabbedPane(SwingConstants.TOP); - - public PickmapChooserView() { - pickmapPanel.setComponentPopupMenu(ACTION_FACTORY.createPopupMenu(true, "pickmaps")); - pickmapPanel.setBorder(BorderFactory.createEmptyBorder(CommonConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); - } - - void addChangeListener(@NotNull final ChangeListener changeListener) { - pickmapPanel.addChangeListener(changeListener); - } - - void addPanel(final String name, final Component mapView, final int index) { - pickmapPanel.insertTab(name, null, mapView, null, index); - } - - void removePanel(final int index) { - pickmapPanel.remove(index); - } - - void selectPanel(final int index) { - pickmapPanel.setSelectedIndex(index); - } - - int getSelectedPanel() { - return pickmapPanel.getSelectedIndex(); - } - - /** - * Returns the JTabbedPane with all pickmaps. - * @return the JTabbedPane with all pickmaps - */ - public JTabbedPane getPickmapPanel() { - return pickmapPanel; - } - -} // class PickmapChooserView Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2007-02-04 17:15:25 UTC (rev 1813) +++ trunk/daimonin/src/daieditor/action.properties 2007-02-04 17:19:20 UTC (rev 1814) @@ -31,8 +31,7 @@ edit.menu=undo redo - clear cut copy paste - replace fillAbove fillBelow randFillAbove randFillBelow floodfill - selectAll map.menu=enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties cursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes - -pickmaps.menu=lockAllPickmaps - addNewPickmap closePickmap - openPickmapMap - savePickmap revertPickmap +#pickmaps.menu: See gridarta resources.menu=collectArches collectSpells - reloadFaces - viewTreasurelists tools.menu=newScript editScript - controlServer controlClient - validateMap cleanCompletelyBlockedSquares - zoom gc #view.menu=+lafs - changeFont - showMonsters showExits showBackground showDoorsKeys showWall showEquipment showTreasure showConnected resetShow @@ -116,19 +115,6 @@ moveCursor.menu=goNorth goEast goSouth goWest goNorthEast goSouthEast goSouthWest goNorthWest -lockAllPickmaps.icon=EmptySmallIcon - -addNewPickmap.icon=general/New16 - -closePickmap.icon=EmptySmallIcon - -openPickmapMap.icon=general/Open16 - -savePickmap.icon=general/Save16 - -revertPickmap.icon=general/Refresh16 - - collectArches.icon=development/Jar16 newScript.icon=general/New16 Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 17:15:25 UTC (rev 1813) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-02-04 17:19:20 UTC (rev 1814) @@ -35,6 +35,7 @@ import java.util.List; import javax.swing.JTabbedPane; import net.sf.gridarta.gui.pickmapchooser.ArchNPickChangeListener; +import net.sf.gridarta.gui.pickmapchooser.PickmapChooserView; import net.sf.gridarta.map.MapType; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; Deleted: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java 2007-02-04 17:15:25 UTC (rev 1813) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java 2007-02-04 17:19:20 UTC (rev 1814) @@ -1,80 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package daieditor.gui.pickmapchooser; - -import java.awt.Component; -import javax.swing.BorderFactory; -import javax.swing.JTabbedPane; -import javax.swing.SwingConstants; -import javax.swing.event.ChangeListener; -import net.sf.gridarta.CommonConstants; -import net.sf.japi.swing.ActionFactory; -import org.apache.log4j.Logger; -import org.jetbrains.annotations.NotNull; - -/** - * A View for choosing pickmaps. - * @author Andreas Kirschbaum - */ -public final class PickmapChooserView { - - /** The Logger for printing log messages. */ - private static final Logger log = Logger.getLogger(PickmapChooserView.class); - - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - - /** Panel with pickmaps. */ - private final JTabbedPane pickmapPanel = new JTabbedPane(SwingConstants.TOP); - - public PickmapChooserView() { - pickmapPanel.setComponentPopupMenu(ACTION_FACTORY.createPopupMenu(true, "pickmaps")); - pickmapPanel.setBorder(BorderFactory.createEmptyBorder(CommonConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); - } - - void addChangeListener(@NotNull final ChangeListener changeListener) { - pickmapPanel.addChangeListener(changeListener); - } - - void addPanel(final String name, final Component mapView, final int index) { - pickmapPanel.insertTab(name, null, mapView, null, index); - } - - void removePanel(final int index) { - pickmapPanel.remove(index); - } - - void selectPanel(final int index) { - pickmapPanel.setSelectedIndex(index); - } - - int getSelectedPanel() { - return pickmapPanel.getSelectedIndex(); - } - - /** - * Returns the JTabbedPane with all pickmaps. - * @return the JTabbedPane with all pickmaps - */ - public JTabbedPane getPickmapPanel() { - return pickmapPanel; - } - -} // class PickmapChooserView Modified: trunk/src/app/net/sf/gridarta/action.properties =================================================================== --- trunk/src/app/net/sf/gridarta/action.properties 2007-02-04 17:15:25 UTC (rev 1813) +++ trunk/src/app/net/sf/gridarta/action.properties 2007-02-04 17:19:20 UTC (rev 1814) @@ -36,3 +36,11 @@ undo.icon=general/Undo16 redo.icon=general/Redo16 + +pickmaps.menu=lockAllPickmaps - addNewPickmap closePickmap - openPickmapMap - savePickmap revertPickmap +lockAllPickmaps.icon=EmptySmallIcon +addNewPickmap.icon=general/New16 +closePickmap.icon=EmptySmallIcon +openPickmapMap.icon=general/Open16 +savePickmap.icon=general/Save16 +revertPickmap.icon=general/Refresh16 Copied: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserView.java (from rev 1812, trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserView.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserView.java 2007-02-04 17:19:20 UTC (rev 1814) @@ -0,0 +1,80 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.pickmapchooser; + +import java.awt.Component; +import javax.swing.BorderFactory; +import javax.swing.JTabbedPane; +import javax.swing.SwingConstants; +import javax.swing.event.ChangeListener; +import net.sf.gridarta.CommonConstants; +import net.sf.japi.swing.ActionFactory; +import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; + +/** + * A View for choosing pickmaps. + * @author Andreas Kirschbaum + */ +public final class PickmapChooserView { + + /** The Logger for printing log messages. */ + private static final Logger log = Logger.getLogger(PickmapChooserView.class); + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + + /** Panel with pickmaps. */ + private final JTabbedPane pickmapPanel = new JTabbedPane(SwingConstants.TOP); + + public PickmapChooserView() { + pickmapPanel.setComponentPopupMenu(ACTION_FACTORY.createPopupMenu(true, "pickmaps")); + pickmapPanel.setBorder(BorderFactory.createEmptyBorder(CommonConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); + } + + public void addChangeListener(@NotNull final ChangeListener changeListener) { + pickmapPanel.addChangeListener(changeListener); + } + + public void addPanel(final String name, final Component mapView, final int index) { + pickmapPanel.insertTab(name, null, mapView, null, index); + } + + public void removePanel(final int index) { + pickmapPanel.remove(index); + } + + public void selectPanel(final int index) { + pickmapPanel.setSelectedIndex(index); + } + + public int getSelectedPanel() { + return pickmapPanel.getSelectedIndex(); + } + + /** + * Returns the JTabbedPane with all pickmaps. + * @return the JTabbedPane with all pickmaps + */ + public JTabbedPane getPickmapPanel() { + return pickmapPanel; + } + +} // class PickmapChooserView Property changes on: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserView.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-04 17:27:38
|
Revision: 1816 http://svn.sourceforge.net/gridarta/?rev=1816&view=rev Author: christianhujer Date: 2007-02-04 09:27:38 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Documented nullability of mapFile in MapControl implementations. 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 2007-02-04 17:21:37 UTC (rev 1815) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2007-02-04 17:27:38 UTC (rev 1816) @@ -62,7 +62,7 @@ */ private final MapViewIFrame mapViewFrame; - private File mapFile; + @Nullable private File mapFile; /** The filename of this map. */ // TODO: Rename because the filename is a URI now. @@ -276,7 +276,8 @@ mapFile = file; } - public File getMapFile() { + /** {@inheritDoc} */ + @Nullable public File getMapFile() { return mapFile; } Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2007-02-04 17:21:37 UTC (rev 1815) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2007-02-04 17:27:38 UTC (rev 1816) @@ -79,7 +79,7 @@ */ private final List<MapViewIFrame> mapViewIFrames = new LinkedList<MapViewIFrame>(); - private File mapFile; + @Nullable private File mapFile; /** The filename of this map. */ // TODO: Rename because the filename is a URI now. @@ -344,7 +344,8 @@ mapFile = file; } - public File getMapFile() { + /** {@inheritDoc} */ + @Nullable public File getMapFile() { return mapFile; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |