From: <chr...@us...> - 2006-10-09 07:57:57
|
Revision: 511 http://svn.sourceforge.net/gridarta/?rev=511&view=rev Author: christianhujer Date: 2006-10-09 00:57:45 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Set ignore properties. Property Changed: ---------------- trunk/crossfire/ trunk/daimonin/ trunk/daimonin/resource/toolbarButtonGraphics/misc/ trunk/daimonin/resource/toolbarButtonGraphics/navigation/ Property changes on: trunk/crossfire ___________________________________________________________________ Name: svn:ignore + developer.properties build.properties classes tags Property changes on: trunk/daimonin ___________________________________________________________________ Name: svn:ignore + tags classes update.properties build.properties developer.properties DaimoninEditor.jar Property changes on: trunk/daimonin/resource/toolbarButtonGraphics/misc ___________________________________________________________________ Name: svn:ignore + .xvpics Property changes on: trunk/daimonin/resource/toolbarButtonGraphics/navigation ___________________________________________________________________ Name: svn:ignore + .xvpics This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 08:17:13
|
Revision: 512 http://svn.sourceforge.net/gridarta/?rev=512&view=rev Author: christianhujer Date: 2006-10-09 01:17:02 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Fixed bogus naming. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/daimonin/src/daieditor/CMapFileDecode.java Modified: trunk/crossfire/src/cfeditor/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-10-09 07:57:45 UTC (rev 511) +++ trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-10-09 08:17:02 UTC (rev 512) @@ -118,7 +118,7 @@ */ @Nullable private GameObject readArch(final BufferedReader myInput, String thisLine, final GameObject container) throws IOException { - GameObject arch; + GameObject gameObject; String thisLine2; boolean archflag, archmore, msgflag, animflag, scriptflag; final int y; @@ -129,7 +129,7 @@ msgflag = false; animflag = false; - arch = null; + gameObject = null; try { thisLine2 = thisLine; @@ -158,14 +158,14 @@ archflag = true; // from now on we are inside an arch if (!archmore) { - arch = new GameObject(); // create a new instance + gameObject = new GameObject(); // create a new instance // our arch! it has a name! - arch.setArchetypeName(thisLine.substring(x, thisLine.length())); + gameObject.setArchetypeName(thisLine.substring(x, thisLine.length())); // ok, we have setup our arch, now check for inventory if (container != null) { - container.addLast(arch); + container.addLast(gameObject); } } } @@ -175,46 +175,46 @@ if (thisLine.regionMatches(0, "endmsg", 0, 6)) { msgflag = false; } else { - arch.addMsgText(thisLine2 + "\n"); + gameObject.addMsgText(thisLine2 + "\n"); } } else if (animflag) { //arch.addArchText(thisLine + "\n"); if (thisLine.regionMatches(0, "mina", 0, 4)) { animflag = false; } else { // we not include anim yet in panel - arch.addAnimText(thisLine + "\n"); + gameObject.addAnimText(thisLine + "\n"); } // ok, we had a full arch... don't care here about map or object // now we test for a new arch - thats stuf in inventory // or the end... thats the end of this shit } else if (thisLine.startsWith("arch ")) { if (log.isDebugEnabled()) { - log.debug("GO INVENTORY: " + arch + " - " + thisLine); + log.debug("GO INVENTORY: " + gameObject + " - " + thisLine); } - readArch(myInput, thisLine, arch); + readArch(myInput, thisLine, gameObject); if (log.isDebugEnabled()) { - log.debug("GO INVENTORY2: " + arch + " - " + thisLine); + log.debug("GO INVENTORY2: " + gameObject + " - " + thisLine); } } else if (thisLine.startsWith("end")) { - objects.add(arch); + objects.add(gameObject); archflag = false; archmore = false; if (log.isDebugEnabled()) { - log.debug("LEAVE!: " + arch + " - " + thisLine); + log.debug("LEAVE!: " + gameObject + " - " + thisLine); } - return arch; + return gameObject; } else if (thisLine.regionMatches(0, "msg", 0, 3)) { // arch.addArchText(thisLine + "\n"); - arch.addMsgText(""); // this init the msg text buffer + gameObject.addMsgText(""); // this init the msg text buffer // in the case of msg/endmsg // with no content to overrule def msg msgflag = true; // this is a MUST, because we overrule "anim" test } else if (thisLine.regionMatches(0, "animation", 0, 9)) { - arch.addObjectText(thisLine + "\n"); + gameObject.addObjectText(thisLine + "\n"); } else if (thisLine.regionMatches(0, "anim_speed", 0, 10)) { - arch.addObjectText(thisLine + "\n"); + gameObject.addObjectText(thisLine + "\n"); } else if (thisLine.regionMatches(0, "anim", 0, 4)) { //arch.addArchText(thisLine + "\n"); animflag = true; @@ -228,37 +228,37 @@ // expecting: "event_type_plugin Name" final String type = thisLine.substring(6, i); final String plname = thisLine.substring(space + 1).trim(); - arch.addEventPlugin(type, plname); + gameObject.addEventPlugin(type, plname); } else if (k > 0) { // expecting: "event_type_options Name" final String type = thisLine.substring(6, k); final String eventopt = thisLine.substring(space + 1).trim(); - arch.addEventOptions(type, eventopt); + gameObject.addEventOptions(type, eventopt); } else { // expecting: "event_type filepath" final String type = thisLine.substring(6, space); final String path = thisLine.substring(space + 1).trim(); - arch.addEventScript(type, path); + gameObject.addEventScript(type, path); } } else { - log.warn("Arch " + arch.getArchetypeName() + " has incorrect event code '" + thisLine + "'"); - arch.addObjectText(thisLine + "\n"); // keep line, it might have a meaning after all + log.warn("Arch " + gameObject.getArchetypeName() + " has incorrect event code '" + thisLine + "'"); + gameObject.addObjectText(thisLine + "\n"); // keep line, it might have a meaning after all } } else if (thisLine.regionMatches(0, "x ", 0, 2)) { final int temp = Integer.parseInt(thisLine.substring(2)); if (temp > maxxlen) { maxxlen = temp; } - arch.setMapX(temp); + gameObject.setMapX(temp); } else if (thisLine.regionMatches(0, "y ", 0, 2)) { final int temp = Integer.parseInt(thisLine.substring(2)); if (temp > maxylen) { maxylen = temp; } - arch.setMapY(temp); + gameObject.setMapY(temp); // MT: there should be here no type or? - AV: WRONG, there defenitly should be! } else if (thisLine.startsWith("type ")) { - arch.setArchTypNr(Integer.parseInt(thisLine.substring(5))); + gameObject.setArchTypNr(Integer.parseInt(thisLine.substring(5))); // don't load it into the archtext! } else if (thisLine.regionMatches(0, "face ", 0, 5)) { int x; @@ -267,10 +267,10 @@ break; } } - arch.setFaceFlag(false); - arch.setFaceName(thisLine.substring(x, thisLine.length())); + gameObject.setFaceFlag(false); + gameObject.setFaceName(thisLine.substring(x, thisLine.length())); } else { - arch.addObjectText(thisLine + "\n"); + gameObject.addObjectText(thisLine + "\n"); } } else { // We are in a multipart tail arch ("more"), so we skip it: Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-10-09 07:57:45 UTC (rev 511) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-10-09 08:17:02 UTC (rev 512) @@ -38,7 +38,6 @@ import java.util.Arrays; import java.util.Comparator; import java.util.HashMap; -import java.util.Iterator; import java.util.Map; import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; @@ -85,10 +84,10 @@ final Point pos = new Point(); for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { - for (final GameObject node : mapModel.getMapSquare(pos)) { + for (final GameObject gameObject : mapModel.getMapSquare(pos)) { // only non multi suckers - if (!node.isMulti()) { - if (!writeMapArch(node, false)) { + if (!gameObject.isMulti()) { + if (!writeMapArch(gameObject, false)) { return; } } @@ -99,12 +98,12 @@ // second, we drop the multi part suckers out for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { - for (final GameObject node : mapModel.getMapSquare(pos)) { + for (final GameObject gameObject : mapModel.getMapSquare(pos)) { // search only for heads! - if (node.isMulti() && node.isHead()) { + if (gameObject.isMulti() && gameObject.isHead()) { // only the heads get stored in the mapfile // (that's much more efficient) - if (!writeMapArch(node, false)) { + if (!writeMapArch(gameObject, false)) { return; } } @@ -119,38 +118,38 @@ /** * Walk through the inventory of an arch and write everything into the file. - * @param start the container arch whose inventory is to be written + * @param container the container arch whose inventory is to be written */ - private void browseInvObjects(final GameObject start) { - for (final GameObject arch : start) { - writeMapArch(arch, true); + private void browseInvObjects(final GameObject container) { + for (final GameObject gameObject : container) { + writeMapArch(gameObject, true); } } /** * Here the map arch gets written into the file. - * @param arch <code>GameObject</code> to be written into the map + * @param gameObject <code>GameObject</code> to be written into the map * @param isInventory is 'arch' inside a container? true/false * @return true if arch was written successfully */ - boolean writeMapArch(final GameObject arch, final boolean isInventory) { - final GameObject defarch = arch.getArchetype(); + boolean writeMapArch(final GameObject gameObject, final boolean isInventory) { + final GameObject archetype = gameObject.getArchetype(); // Collect all fields to write. final Map<String, String> fields = new HashMap<String, String>(); // String key -> String value - final String name = arch.getObjName(); + final String name = gameObject.getObjName(); if (name != null) { fields.put("name", name); } - final String face = arch.getFaceName(); + final String face = gameObject.getFaceName(); if (face != null) { fields.put("face", face); } - if (arch.isScripted()) { - final String events = arch.getMapArchEventData(); + if (gameObject.isScripted()) { + final String events = gameObject.getMapArchEventData(); if (!events.equals("")) { final String[] tmp = events.split("\n"); for (final String aTmp : tmp) { @@ -164,10 +163,10 @@ } } - if (arch.getMsgText() != null && !arch.getMsgText().trim().equals((defarch == null || defarch.getMsgText() == null) ? "" : defarch.getMsgText().trim())) { + if (gameObject.getMsgText() != null && !gameObject.getMsgText().trim().equals((archetype == null || archetype.getMsgText() == null) ? "" : archetype.getMsgText().trim())) { String msg = ""; - if (arch.getMsgText().trim().length() > 0) { - msg = arch.getMsgText(); + if (gameObject.getMsgText().trim().length() > 0) { + msg = gameObject.getMsgText(); if (!msg.endsWith("\n")) { msg += "\n"; } @@ -175,14 +174,14 @@ fields.put("msg", msg + "endmsg"); } - if (defarch != null && arch.getArchTypNr() != defarch.getArchTypNr()) { + if (archetype != null && gameObject.getArchTypNr() != archetype.getArchTypNr()) { // this arch has special type - if (arch.getObjectText().indexOf("type ") >= 0) { + if (gameObject.getObjectText().indexOf("type ") >= 0) { // oh oh - there might also be a type in the archtext which // is conflicting. remove the type from the archtext // open a reading stream for the archText - final StringReader sread = new StringReader(arch.getObjectText().toString()); + final StringReader sread = new StringReader(gameObject.getObjectText().toString()); final BufferedReader sstream = new BufferedReader(sread); String newArchtext = ""; @@ -208,9 +207,9 @@ sread.close(); if (newArchtext.trim().length() == 0) { - arch.setObjectText(""); + gameObject.setObjectText(""); } else { - arch.setObjectText(newArchtext.trim() + "\n"); + gameObject.setObjectText(newArchtext.trim() + "\n"); } } catch (final IOException e) { log.error("getSyntaxErrors: Cannot close StringReader"); @@ -218,10 +217,10 @@ } // now append the type to the archtext - fields.put("type", Integer.toString(arch.getArchTypNr())); + fields.put("type", Integer.toString(gameObject.getArchTypNr())); } - final String text = arch.getObjectText(); + final String text = gameObject.getObjectText(); if (!text.equals("")) { final String[] tmp = text.split("\n"); for (final String aTmp : tmp) { @@ -236,12 +235,12 @@ if (!isInventory) { // map coordinates only belong into map arches (not inventory arches) - final int x = arch.getMapX(); + final int x = gameObject.getMapX(); if (x != 0) { fields.put("x", Integer.toString(x)); } - final int y = arch.getMapY(); + final int y = gameObject.getMapY(); if (y != 0) { fields.put("y", Integer.toString(y)); } @@ -253,7 +252,7 @@ // Actually write the fields. try { - bufferedWriter.write("arch " + arch.getArchetypeName() + "\n"); + bufferedWriter.write("arch " + gameObject.getArchetypeName() + "\n"); for (int i = 0; i < keys.length; i++) { final String value = (String) fields.get(keys[i]); if (value != null) { @@ -266,7 +265,7 @@ } } - browseInvObjects(arch); // write his inventory inside this arch + browseInvObjects(gameObject); // write his inventory inside this arch bufferedWriter.write("end\n"); } catch (final IOException e) { Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-10-09 07:57:45 UTC (rev 511) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-10-09 08:17:02 UTC (rev 512) @@ -121,19 +121,19 @@ @Nullable private GameObject readArch(final BufferedReader myInput, String thisLine) throws IOException { boolean msgflag = false; boolean archflag = false; - GameObject arch = null; + GameObject gameObject = null; do { thisLine = thisLine.trim(); if (!archflag) { if (thisLine.startsWith("arch ")) { archflag = true; // from now on we are inside an arch - arch = new GameObject(); // create a new instance + gameObject = new GameObject(); // create a new instance // if this is still -1 in the post parse, we have no direction command loaded - arch.setDirection(-1); + gameObject.setDirection(-1); // our arch! it has a name! - arch.setArchetypeName(thisLine.substring("arch ".length()).trim()); + gameObject.setArchetypeName(thisLine.substring("arch ".length()).trim()); } } else { @@ -142,41 +142,41 @@ if (thisLine.startsWith("endmsg")) { msgflag = false; } else { - arch.addMsgText(thisLine + '\n'); + gameObject.addMsgText(thisLine + '\n'); } } else if (thisLine.startsWith("arch ")) { // ok, we had a full arch... don't care here about map or object // now we test for a new arch - thats stuf in inventory // or the end... thats the end of this shit //System.err.println("GO INVENTORY: " + arch + " - " + thisLine); - arch.addLast(readArch(myInput, thisLine)); + gameObject.addLast(readArch(myInput, thisLine)); //System.err.println("GO INVENTORY2: " + arch + " - " + thisLine); } else if (thisLine.startsWith("end")) { // chain this to temp list - objects.add(arch); + objects.add(gameObject); archflag = false; // System.err.println("LEAVE!: " + arch + " - " + thisLine); - return arch; + return gameObject; } else if (thisLine.startsWith("msg")) { - arch.addMsgText(""); + gameObject.addMsgText(""); msgflag = true; } else if (thisLine.startsWith("x ")) { - arch.setMapX(Integer.parseInt(thisLine.substring(2))); + gameObject.setMapX(Integer.parseInt(thisLine.substring(2))); } else if (thisLine.startsWith("y ")) { - arch.setMapY(Integer.parseInt(thisLine.substring(2))); + gameObject.setMapY(Integer.parseInt(thisLine.substring(2))); } else if (thisLine.startsWith("type ")) { // Arches in maps can override their default arch's type - arch.setArchTypNr(Integer.parseInt(thisLine.substring(5))); + gameObject.setArchTypNr(Integer.parseInt(thisLine.substring(5))); // don't load it into the archtext! (why?) } else if (thisLine.startsWith("direction ")) { - arch.setDirection(Integer.parseInt(thisLine.substring(10))); - arch.addObjectText(thisLine + '\n'); + gameObject.setDirection(Integer.parseInt(thisLine.substring(10))); + gameObject.addObjectText(thisLine + '\n'); } else if (thisLine.startsWith("face ")) { - arch.setFaceRealName(thisLine.substring("face ".length()).trim()); - arch.addObjectText(thisLine + '\n'); + gameObject.setFaceRealName(thisLine.substring("face ".length()).trim()); + gameObject.addObjectText(thisLine + '\n'); } else { - arch.addObjectText(thisLine + '\n'); + gameObject.addObjectText(thisLine + '\n'); } } } while ((thisLine = myInput.readLine()) != null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 08:34:24
|
Revision: 515 http://svn.sourceforge.net/gridarta/?rev=515&view=rev Author: christianhujer Date: 2006-10-09 01:34:08 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Merged objName. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 08:27:10 UTC (rev 514) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 08:34:08 UTC (rev 515) @@ -63,9 +63,6 @@ /** Archetype name. */ private String archetypeName = null; - /** The name of this object. */ - private String objName; - private StringBuffer animText; // anim text buffer private StringBuffer loreText; // lore text buffer @@ -512,22 +509,6 @@ return "???"; // this case should actually never happen } - /** - * Sets the name of this object. - * @param objName the name of this object. - */ - public void setObjName(final String objName) { - this.objName = objName != null ? objName.intern() : null; - } - - /** - * Returns the name of this object. - * @return the name of this object. - */ - public String getObjName() { - return objName; - } - // face name public void setFaceName(final String name) { faceName = name != null ? name.intern() : null; Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 08:27:10 UTC (rev 514) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 08:34:08 UTC (rev 515) @@ -71,9 +71,6 @@ /** Archetype name. */ private String archetypeName = null; - /** The name of this object. */ - private String objName; - /** Object animation <code>animation <var>animName</var></code>. */ private String animName; @@ -457,22 +454,6 @@ return "???"; // this case should actually never happen } - /** - * Sets the name of this object. - * @param objName the name of this object. - */ - public void setObjName(final String objName) { - this.objName = objName != null ? objName.intern() : null; - } - - /** - * Returns the name of this object. - * @return the name of this object. - */ - public String getObjName() { - return objName; - } - // face name private void setFaceObjName(final String faceObjName) { if (faceObjName != null) { Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:27:10 UTC (rev 514) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:34:08 UTC (rev 515) @@ -37,6 +37,9 @@ /** The Archetype of this GameObject. */ @NotNull private G archetype; + /** The name of this object. */ + @Nullable protected String objName; + /** * The objectText with the differences from the Archetype. * @note Every line in the objectText must end on '\n', including the last line. @@ -661,6 +664,22 @@ } /** + * Returns the name of this object. + * @return the name of this object. + */ + @Nullable public String getObjName() { + return objName; + } + + /** + * Sets the name of this object. + * @param objName the name of this object. + */ + public void setObjName(@Nullable final String objName) { + this.objName = objName != null ? objName.intern() : null; + } + + /** * Returns the object text of this GameObject as String. * @return the object text */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 08:43:16
|
Revision: 517 http://svn.sourceforge.net/gridarta/?rev=517&view=rev Author: christianhujer Date: 2006-10-09 01:43:02 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Merged archetypeName. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 08:36:43 UTC (rev 516) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 08:43:02 UTC (rev 517) @@ -60,9 +60,6 @@ private String faceName; // face name : 1 - /** Archetype name. */ - private String archetypeName = null; - private StringBuffer animText; // anim text buffer private StringBuffer loreText; // lore text buffer @@ -477,19 +474,6 @@ } /** - * Set the archetype name. - * @param archetypeName the archetype name - */ - public void setArchetypeName(final String archetypeName) { - this.archetypeName = archetypeName != null ? archetypeName.intern() : null; - } - - /** {@inheritDoc} */ - public String getArchetypeName() { - return archetypeName; - } - - /** * Name which is best appropriate to describe this arch. (This can be * arch/object name or default arch/object name) * @return best suitable descriptive name Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 08:36:43 UTC (rev 516) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 08:43:02 UTC (rev 517) @@ -68,9 +68,6 @@ /** Object face name <code>face <var>name</var></code>. */ private String faceRealName; - /** Archetype name. */ - private String archetypeName = null; - /** Object animation <code>animation <var>animName</var></code>. */ private String animName; @@ -422,19 +419,6 @@ } /** - * Set the archetype name. - * @param archetypeName the archetype name - */ - public void setArchetypeName(final String archetypeName) { - this.archetypeName = archetypeName != null ? archetypeName.intern() : null; - } - - /** {@inheritDoc} */ - public String getArchetypeName() { - return archetypeName; - } - - /** * Name which is best appropriate to describe this arch. (This can be * arch/object name or default arch/object name) * @return best suitable descriptive name Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:36:43 UTC (rev 516) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:43:02 UTC (rev 517) @@ -37,6 +37,9 @@ /** The Archetype of this GameObject. */ @NotNull private G archetype; + /** The name of the Archetype associated with this GameObject or the Archetypes name itself if this GameObject is an Archetype. */ + @Nullable protected String archetypeName; + /** The name of this object. */ @Nullable protected String objName; @@ -487,9 +490,19 @@ * For an Archetype this method simply returns its name. * @return the name of the Archetype this GameObject is based on */ - @NotNull public abstract String getArchetypeName(); + @Nullable public String getArchetypeName() { + return archetypeName; + } /** + * Set the archetype name. + * @param archetypeName the archetype name + */ + public void setArchetypeName(final String archetypeName) { + this.archetypeName = archetypeName != null ? archetypeName.intern() : null; + } + + /** * Returns whether this GameObject is an Artifact. * Artifacts are special forms of Archetypes, and they are excluded from Archetypes collection. * @return <code>true</code> if this GameObject is an Artifact, otherwise <code>false</code>. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 08:46:20
|
Revision: 518 http://svn.sourceforge.net/gridarta/?rev=518&view=rev Author: christianhujer Date: 2006-10-09 01:46:03 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Pulled getBestName() up. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 08:43:02 UTC (rev 517) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 08:46:03 UTC (rev 518) @@ -473,26 +473,6 @@ noface = flag; } - /** - * Name which is best appropriate to describe this arch. (This can be - * arch/object name or default arch/object name) - * @return best suitable descriptive name - */ - public String getBestName() { - final GameObject archetype = getArchetype(); - if (objName != null && objName.length() > 0) { - return objName; - } else if (archetype != null && archetype.objName != null && archetype.objName.length() > 0) { - return archetype.objName; - } else if (archetypeName != null && archetypeName.length() > 0) { - return archetypeName; - } else if (archetype != null && archetype.archetypeName != null) { - return archetype.archetypeName; - } - - return "???"; // this case should actually never happen - } - // face name public void setFaceName(final String name) { faceName = name != null ? name.intern() : null; Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 08:43:02 UTC (rev 517) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 08:46:03 UTC (rev 518) @@ -418,26 +418,6 @@ return faceobjdesc; } - /** - * Name which is best appropriate to describe this arch. (This can be - * arch/object name or default arch/object name) - * @return best suitable descriptive name - */ - public String getBestName() { - final GameObject archetype = getArchetype(); - if (objName != null && objName.length() > 0) { - return objName; - } else if (archetype != null && archetype.objName != null && archetype.objName.length() > 0) { - return archetype.objName; - } else if (archetypeName != null && archetypeName.length() > 0) { - return archetypeName; - } else if (archetype != null && archetype.archetypeName != null) { - return archetype.archetypeName; - } - - return "???"; // this case should actually never happen - } - // face name private void setFaceObjName(final String faceObjName) { if (faceObjName != null) { Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:43:02 UTC (rev 517) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:46:03 UTC (rev 518) @@ -687,6 +687,25 @@ } /** + * Name which is best appropriate to describe this arch. (This can be + * arch/object name or default arch/object name) + * @return best suitable descriptive name + */ + public String getBestName() { + final GameObject archetype = getArchetype(); + if (objName != null && objName.length() > 0) { + return objName; + } else if (archetype != null && archetype.objName != null && archetype.objName.length() > 0) { + return archetype.objName; + } else if (archetypeName != null && archetypeName.length() > 0) { + return archetypeName; + } else if (archetype != null && archetype.archetypeName != null) { + return archetype.archetypeName; + } + return "???"; // this case should actually never happen + } + + /** * Returns the object text of this GameObject as String. * @return the object text */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 10:24:34
|
Revision: 522 http://svn.sourceforge.net/gridarta/?rev=522&view=rev Author: christianhujer Date: 2006-10-09 03:24:17 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Pulled editType up to gridarta GameObject and documented its deprecation. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 10:17:56 UTC (rev 521) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 10:24:17 UTC (rev 522) @@ -92,9 +92,6 @@ private int archType; // CF object type of the arch - /** Edit Type. */ - private int editType; // for view settings - private AutojoinList join; // if nonzero, pointing to the list of autojoining archetypes /** Create an GameObject. */ @@ -116,7 +113,6 @@ editflag = false; join = null; // no autojoin list per default archType = TYPE_UNSET; // type must be set - editType = 0; } public static void setTypeList(final CFArchTypeList tlist) { @@ -124,16 +120,6 @@ } /** {@inheritDoc} */ - public int getEditType() { - return editType; - } - - /** {@inheritDoc} */ - public void setEditType(final int editType) { - this.editType = editType; - } - - /** {@inheritDoc} */ public int calculateEditType(final int checkType) { // ATTENTION! BE VERY CAREFUL WHEN YOU TRY TO UNIFY MORE OF THIS WITH DAIMONIN! /* if one of the types in checkType already is in editType, Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 10:17:56 UTC (rev 521) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 10:24:17 UTC (rev 522) @@ -107,9 +107,6 @@ private int archType; // CF object type of the arch - /** Edit Type. */ - private int editType; // for view settings - /** Editor Folder. */ private String editorFolder; @@ -130,16 +127,6 @@ typeList = tlist; } - /** {@inheritDoc} */ - public int getEditType() { - return editType; - } - - /** {@inheritDoc} */ - public void setEditType(final int editType) { - this.editType = editType; - } - /** * {@inheritDoc} * @deprecated use arch object matchers, this method will be removed Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 10:17:56 UTC (rev 521) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 10:24:17 UTC (rev 522) @@ -84,6 +84,14 @@ protected int multiY = 0; /** + * Edit Type. + * @deprecated bad design for multiple reasons: + * * Data is knowing view information (that's not nice) + * * Not extensible + */ + @Deprecated protected int editType; + + /** * Constructor. */ protected GameObject() { @@ -546,7 +554,9 @@ * @see #calculateEditType(int) * @see #setEditType(int) */ - public abstract int getEditType(); + public int getEditType() { + return editType; + } /** * Sets the edit type of this GameObject. @@ -554,7 +564,9 @@ * @see #calculateEditType(int) * @see #getEditType() */ - public abstract void setEditType(int editType); + public void setEditType(final int editType) { + this.editType = editType; + } /** Delete message text by nullification. */ public void deleteMsgText() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 10:47:08
|
Revision: 527 http://svn.sourceforge.net/gridarta/?rev=527&view=rev Author: christianhujer Date: 2006-10-09 03:46:57 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Added FaceName for temporary compatibility. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/Archetype.java Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 10:41:55 UTC (rev 526) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 10:46:57 UTC (rev 527) @@ -367,6 +367,11 @@ return archType; } + /** {@inheritDoc} */ + public String getFaceName() { + return null; + } + public void setArchTypNr(final int type) { archType = type; } Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 10:41:55 UTC (rev 526) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 10:46:57 UTC (rev 527) @@ -63,4 +63,12 @@ // TODO documentation int getArchTypNr(); + /** + * CFEditor only: Returns the name of the face. + * @return The name of the face of this Archetype. + * @deprecated compatibility method + * @todo document nullability + */ + @Deprecated String getFaceName(); + } // interface Archetype This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 10:56:42
|
Revision: 528 http://svn.sourceforge.net/gridarta/?rev=528&view=rev Author: christianhujer Date: 2006-10-09 03:56:31 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Added faceRealName, animName and direction for temporary compatibility. Modified Paths: -------------- trunk/crossfire/src/cfeditor/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 2006-10-09 10:46:57 UTC (rev 527) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 10:56:31 UTC (rev 528) @@ -466,6 +466,21 @@ return faceName; } + /** {@inheritDoc} */ + public String getFaceRealName() { + return null; + } + + /** {@inheritDoc} */ + public String getAnimName() { + return null; + } + + /** {@inheritDoc} */ + public int getDirection() { + return 0; + } + /** * {@inheritDoc} * @todo this method is too slow - find a faster way Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 10:46:57 UTC (rev 527) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 10:56:31 UTC (rev 528) @@ -31,6 +31,8 @@ * @param attributeName Name of the attribute value to return. * @return Attribute value or <code>""</code> (empty String) if not found. * @see #getAttributeInt(String) + * @see #getAttributeLong(String) + * @see #getAttributeDouble(String) */ String getAttributeString(@NotNull String attributeName); @@ -43,6 +45,22 @@ int getAttributeInt(@NotNull String attributeName); /** + * Returns an attribute value of this Archetype as long. + * @param attributeName Name of the attribute value to return. + * @return Attribute value or <code>0</code> (zero) if not found. + * @see #getAttributeString(String) + */ + long getAttributeLong(@NotNull String attributeName); + + /** + * Returns an attribute value of this Archetype as double. + * @param attributeName Name of the attribute value to return. + * @return Attribute value or <code>0.0</code> (zero) if not found. + * @see #getAttributeString(String) + */ + double getAttributeDouble(@NotNull String attributeName); + + /** * Returns the name of the object as shown to the player. * @return The name of the object as shown to the player. */ @@ -68,7 +86,32 @@ * @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(); + /** + * 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. + * @deprecated compatibility method + * @todo document nullability + */ + @Deprecated String getAnimName(); + + /** + * DaiEditor only: Returns the direction. + * @return The direction. + * @deprecated compatibility method + */ + @Deprecated int getDirection(); + } // interface Archetype This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 10:57:20
|
Revision: 529 http://svn.sourceforge.net/gridarta/?rev=529&view=rev Author: christianhujer Date: 2006-10-09 03:57:09 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Changed CAttribDialogs to use Archetype instead of GameObject for the Archetype. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/daimonin/src/daieditor/CAttribDialog.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-09 10:56:31 UTC (rev 528) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-09 10:57:09 UTC (rev 529) @@ -67,6 +67,7 @@ import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; import net.sf.gridarta.help.Help; +import net.sf.gridarta.gameobject.Archetype; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -122,7 +123,7 @@ private final GameObject gameObject; - private final GameObject archetype; + private final Archetype<GameObject> archetype; private CFArchType type; // reference to the type data @@ -1169,7 +1170,7 @@ if (dType == CFArchAttrib.T_BOOL) { // a boolean attribute (flag) if (((BoolAttrib) attr).input.isSelected() != - (archetype.getAttributeInt(attr.ref.getNameOld(), false) == 1)) { + (archetype.getAttributeInt(attr.ref.getNameOld()) == 1)) { newArchText = newArchText + attr.ref.getNameOld() + " " + (((BoolAttrib) attr).input.isSelected() ? 1 : 0) + "\n"; } @@ -1182,31 +1183,31 @@ valString = attr.ref.getMisc()[1]; // false string } // now see if we need to write it into the archtext or not - if ((valString.equals("0") && !(archetype.getAttributeString(attr.ref.getNameOld(), false).length() == 0)) || (!valString.equals("0") && !archetype.getAttributeString(attr.ref.getNameOld(), false).equals(valString))) { + if ((valString.equals("0") && !(archetype.getAttributeString(attr.ref.getNameOld()).length() == 0)) || (!valString.equals("0") && !archetype.getAttributeString(attr.ref.getNameOld()).equals(valString))) { newArchText = newArchText + attr.ref.getNameOld() + " " + valString + "\n"; } } else if (dType == CFArchAttrib.T_INT || dType == CFArchAttrib.T_FLOAT) { // an int attribute if (dType == CFArchAttrib.T_INT && ((IntAttrib) attr).input.getText().trim().length() == 0) { - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != 0) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; } } else if (dType == CFArchAttrib.T_FLOAT && ((FloatAttrib) attr).input.getText().trim().length() == 0) { - if (archetype.getAttributeString(attr.ref.getNameOld(), false).length() > 0) { + if (archetype.getAttributeString(attr.ref.getNameOld()).length() > 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0.0\n"; } } else { try { if (dType == CFArchAttrib.T_INT) { final int value = Integer.parseInt(((IntAttrib) attr).input.getText().trim()); - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != value) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + " " + value + "\n"; } } else { // try to parse floating point final double value = Double.parseDouble(((FloatAttrib) attr).input.getText().trim()); - final String defValueStr = archetype.getAttributeString(attr.ref.getNameOld(), false).trim(); + final String defValueStr = archetype.getAttributeString(attr.ref.getNameOld()).trim(); final double defValue; if (defValueStr.length() > 0) { defValue = Double.parseDouble(defValueStr); @@ -1252,7 +1253,7 @@ newFace = ""; } } else { - if (!inline.equals(archetype.getAttributeString(attr.ref.getNameOld(), false))) { + if (!inline.equals(archetype.getAttributeString(attr.ref.getNameOld()))) { newArchText = newArchText + attr.ref.getNameOld() + " " + inline + "\n"; } } @@ -1278,19 +1279,19 @@ if (attrVal == -1 || (attrVal == 0 && dType != CFArchAttrib.T_SPELL && dType != CFArchAttrib.T_ZSPELL)) { - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != 0) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; } } else if (attrVal == 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; - } else if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != attrVal) { + } else if (archetype.getAttributeInt(attr.ref.getNameOld()) != attrVal) { newArchText = newArchText + attr.ref.getNameOld() + " " + attrVal + "\n"; } } else if (dType == CFArchAttrib.T_BITMASK) { // a bitmask attribute (similar to integer, but easier because no parsing needed) final int value = ((BitmaskAttrib) attr).getValue(); // get bitmask value - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != value) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + " " + value + "\n"; } } else if (dType == CFArchAttrib.T_TREASURE) { @@ -1301,7 +1302,7 @@ final boolean isNone = inline.equals(CFTreasureListTree.NONE_SYM) || inline.length() == 0; if (!isNone && !CFTreasureListTree.getInstance().containsTreasureList(inline) && - !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld(), false))) { + !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld()))) { // The user has specified a WRONG treasurelist name, and it does not come // from the default gameObject. -> Error and out. JOptionPane.showMessageDialog(this, "In attribute '" + attr.ref.getNameNew() + "':\n" + @@ -1310,8 +1311,8 @@ throw new GridderException(""); // bail out } - if (!inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld(), false)) - && !(isNone && archetype.getAttributeString(attr.ref.getNameOld(), false).length() == 0)) { + if (!inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld())) + && !(isNone && archetype.getAttributeString(attr.ref.getNameOld()).length() == 0)) { if (isNone) { newArchText = newArchText + attr.ref.getNameOld() + " none\n"; } else { @@ -1325,7 +1326,7 @@ // Also write all the 'fixed' attributes into the archtext for (int i = 0; type.getAttr().length > i; i++) { if (type.getAttr()[i].getDataType() == CFArchAttrib.T_FIXED) { - final String defaultValue = archetype.getAttributeString(type.getAttr()[i].getNameOld(), false); + final String defaultValue = archetype.getAttributeString(type.getAttr()[i].getNameOld()); if (defaultValue.length() == 0 || (gameObject.getArchTypNr() != archetype.getArchTypNr() && !defaultValue.equalsIgnoreCase(type.getAttr()[i].getNameNew()))) { // usually, fixed attributes are only applied when *not* defined in the archetype. Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-09 10:56:31 UTC (rev 528) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-09 10:57:09 UTC (rev 529) @@ -106,6 +106,7 @@ import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; import net.sf.gridarta.help.Help; +import net.sf.gridarta.gameobject.Archetype; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import static net.sf.japi.util.Arrays2.linearSearch; @@ -144,7 +145,7 @@ private final GameObject gameObject; - private final GameObject archetype; + private final Archetype<GameObject> archetype; private CFArchType type; // reference to the type data @@ -1044,7 +1045,7 @@ // TODO: switch case if (dType == BOOL) { // a boolean attribute (flag) - if (((DialogAttrib<JCheckBox>) attr).input.isSelected() != (archetype.getAttributeInt(attr.ref.getNameOld(), false) == 1)) { + if (((DialogAttrib<JCheckBox>) attr).input.isSelected() != (archetype.getAttributeInt(attr.ref.getNameOld()) == 1)) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + (((DialogAttrib<JCheckBox>) attr).input.isSelected() ? 1 : 0) + '\n'; } } else if (dType == BOOL_SPEC) { @@ -1056,31 +1057,31 @@ valString = attr.ref.getMisc()[1]; // false string } // now see if we need to write it into the archtext or not - if ("0".equals(valString) && !(archetype.getAttributeString(attr.ref.getNameOld(), false).length() == 0) || !valString.equals("0") && !archetype.getAttributeString(attr.ref.getNameOld(), false).equals(valString)) + if ("0".equals(valString) && !(archetype.getAttributeString(attr.ref.getNameOld()).length() == 0) || !valString.equals("0") && !archetype.getAttributeString(attr.ref.getNameOld()).equals(valString)) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + valString + '\n'; } } else if (dType == INT || dType == LONG || dType == FLOAT) { // an int attribute if ("0".equals(((DialogAttrib<JFormattedTextField>) attr).input.getText())) { - if (archetype.getAttributeDouble(attr.ref.getNameOld(), false) != 0) { + if (archetype.getAttributeDouble(attr.ref.getNameOld()) != 0) { newArchText = newArchText + attr.ref.getNameOld() + " " + (dType == FLOAT ? "0.0" : "0") + "\n"; } } else { try { if (dType == INT) { final int value = ((Number) ((DialogAttrib<JFormattedTextField>) attr).input.getValue()).intValue(); - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != value) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + value + '\n'; } } else if (dType == LONG) { final long value = ((Number) ((DialogAttrib<JFormattedTextField>) attr).input.getValue()).longValue(); - if (archetype.getAttributeLong(attr.ref.getNameOld(), false) != value) { + if (archetype.getAttributeLong(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + value + '\n'; } } else { final double value = ((Number) ((DialogAttrib<JFormattedTextField>) attr).input.getValue()).doubleValue(); - if (archetype.getAttributeDouble(attr.ref.getNameOld(), false) != value) { + if (archetype.getAttributeDouble(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + value + '\n'; } } @@ -1109,7 +1110,7 @@ newName = ""; } } else if ("animation".equalsIgnoreCase(attr.ref.getNameOld())) { - if (inline.length() > 0 && !inline.equals(archetype.getAttributeString(attr.ref.getNameOld(), false))) { + if (inline.length() > 0 && !inline.equals(archetype.getAttributeString(attr.ref.getNameOld()))) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + inline + '\n'; gameObject.setAnimName(inline); } else { @@ -1125,7 +1126,7 @@ } newFace = inline; } else { - if (!inline.equals(archetype.getAttributeString(attr.ref.getNameOld(), false))) { + if (!inline.equals(archetype.getAttributeString(attr.ref.getNameOld()))) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + inline + '\n'; } } @@ -1148,12 +1149,12 @@ } if (attrVal == -1 || attrVal == 0 && dType != SPELL && dType != ZSPELL) { - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != 0) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; } } else if (attrVal == 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; - } else if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != attrVal) { + } else if (archetype.getAttributeInt(attr.ref.getNameOld()) != attrVal) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + attrVal + '\n'; } } else if (dType == DBLLIST) { @@ -1162,14 +1163,14 @@ final int val2 = (Integer) typelist.getListTable().get(attr.ref.getMisc()[1]).get(2 * ((JComboBox[]) attr.input)[1].getSelectedIndex()); final int combinedVal = val1 + val2; - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != combinedVal) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != combinedVal) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + combinedVal + '\n'; } } else if (dType == BITMASK) { // a bitmask attribute (similar to integer, but easier because no parsing needed) final int value = ((BitmaskAttrib) attr).getValue(); // get bitmask value - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != value) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + value + '\n'; } } else if (dType == TREASURE) { @@ -1180,15 +1181,15 @@ final boolean isNone = inline.equals(CFTreasureListTree.NONE_SYM) || inline.length() == 0; if (!isNone && !CFTreasureListTree.containsTreasureList(inline) - && !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld(), false))) { + && !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld()))) { // The user has specified a WRONG treasurelist name, and it does not come // from the default gameObject. -> Error and out. showMessageDialog(this, "In attribute '" + attr.ref.getNameNew() + "':\n" + '\'' + inline + "' is not a known treasurelist name!", "Input Error", ERROR_MESSAGE); return false; } - if (!inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld(), false)) - && !(isNone && archetype.getAttributeString(attr.ref.getNameOld(), false).length() == 0)) { + if (!inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld())) + && !(isNone && archetype.getAttributeString(attr.ref.getNameOld()).length() == 0)) { if (isNone) { newArchText = newArchText + attr.ref.getNameOld() + " none\n"; } else { @@ -1203,7 +1204,7 @@ for (int i = 0; type.getAttr().length > i; i++) { // ### TODO: for changed types, copy fixed attributes over default arches ### if (type.getAttr()[i].getDataType() == FIXED) { - final String defaultValue = archetype.getAttributeString(type.getAttr()[i].getNameOld(), false); + final String defaultValue = archetype.getAttributeString(type.getAttr()[i].getNameOld()); if (defaultValue.length() == 0 || gameObject.getArchTypNr() != archetype.getArchTypNr() && !defaultValue.equalsIgnoreCase(type.getAttr()[i].getNameNew())) { // usually, fixed attributes are only applied when *not* defined in the archetype. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 12:11:01
|
Revision: 532 http://svn.sourceforge.net/gridarta/?rev=532&view=rev Author: christianhujer Date: 2006-10-09 05:10:51 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Changed CMapFileEncode to use Archetype instead of GameObject for archetypes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/daimonin/src/daieditor/CMapFileEncode.java Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-10-09 12:07:06 UTC (rev 531) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-10-09 12:10:51 UTC (rev 532) @@ -40,6 +40,7 @@ import java.util.HashMap; import java.util.Map; import net.sf.gridarta.Size2D; +import net.sf.gridarta.gameobject.Archetype; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -133,7 +134,7 @@ * @return true if arch was written successfully */ boolean writeMapArch(final GameObject gameObject, final boolean isInventory) { - final GameObject archetype = gameObject.getArchetype(); + final Archetype<GameObject> archetype = gameObject.getArchetype(); // Collect all fields to write. final Map<String, String> fields = new HashMap<String, String>(); // String key -> String value Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-10-09 12:07:06 UTC (rev 531) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-10-09 12:10:51 UTC (rev 532) @@ -33,6 +33,7 @@ import java.io.IOException; import java.util.Formatter; import net.sf.gridarta.Size2D; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.map.MapSquare; import net.sf.gridarta.io.IOUtils; @@ -109,7 +110,7 @@ * @throws IOException in case of I/O problems */ private void writeGameObject(final GameObject gameObject, final int x, final int y) throws IOException { - final GameObject archetype = gameObject.getArchetype(); + final Archetype<GameObject> archetype = gameObject.getArchetype(); // ok, we start with the standard parts... this is valid for all types format.format("arch %s\n", gameObject.getArchetypeName()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 12:57:24
|
Revision: 535 http://svn.sourceforge.net/gridarta/?rev=535&view=rev Author: christianhujer Date: 2006-10-09 05:57:11 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Fixed bogus variable naming; Changed GameObject to Archetype where used as an Archetype in CArchQuickView. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CArchQuickView.java trunk/daimonin/src/daieditor/CArchQuickView.java Modified: trunk/crossfire/src/cfeditor/CArchQuickView.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-10-09 12:15:54 UTC (rev 534) +++ trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-10-09 12:57:11 UTC (rev 535) @@ -34,6 +34,7 @@ import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.ScrollPaneConstants; +import net.sf.gridarta.gameobject.Archetype; /** * The <code>CArchQuickView</code> holds the tile palette. @@ -108,11 +109,11 @@ /** * Show quick info for an object. * - * @param archPart the object to show; this may be any part of a multi-part + * @param gameObjectPart the object to show; this may be any part of a multi-part * object */ - void showArchPanelQuickObject(final GameObject archPart) { - if (archPart == null) { + void showArchPanelQuickObject(final GameObject gameObjectPart) { + if (gameObjectPart == null) { archArchNameText.setText("<html><font color=black>Arch:</font></html>"); archObjNameText.setText("<html><font color=black>Name:</font></html>"); archTypeText.setText("<html><font color=black>Type:</font></html>"); @@ -120,34 +121,34 @@ return; } - final GameObject arch = archPart.getHead(); - archArchNameText.setText("<html><font color=black>Arch: " + arch.getArchetypeName() + "</font></html>"); - if (arch.getObjName() == null || arch.getObjName().length() <= 0) { - final GameObject def = arch.getArchetype(); - if (def == null || def == arch) { + final GameObject gameObject = gameObjectPart.getHead(); + archArchNameText.setText("<html><font color=black>Arch: " + gameObject.getArchetypeName() + "</font></html>"); + if (gameObject.getObjName() == null || gameObject.getObjName().length() <= 0) { + final Archetype<GameObject> archetype = gameObject.getArchetype(); + if (archetype == null || archetype == gameObject) { archObjNameText.setText("<html><font color=black>Name: -none- </font></html>"); - } else if (def.getObjName() != null && def.getObjName().length() > 0) { - archObjNameText.setText("<html><font color=black>Name: " + def.getObjName() + "</font></html>"); - } else if (def.getArchetypeName() != null && def.getArchetypeName().length() > 0) { - archObjNameText.setText("<html><font color=black>Name: " + def.getArchetypeName() + "</font></html>"); + } else if (archetype.getObjName() != null && archetype.getObjName().length() > 0) { + archObjNameText.setText("<html><font color=black>Name: " + archetype.getObjName() + "</font></html>"); + } else if (archetype.getArchetypeName() != null && archetype.getArchetypeName().length() > 0) { + archObjNameText.setText("<html><font color=black>Name: " + archetype.getArchetypeName() + "</font></html>"); } else { archObjNameText.setText("<html><font color=black>Name: -none- </font></html>"); } } else { - archObjNameText.setText("<html><font color=black>Name: " + arch.getObjName() + "</font></html>"); + archObjNameText.setText("<html><font color=black>Name: " + gameObject.getObjName() + "</font></html>"); } - archTypeText.setText("<html><font color=black>Type: " + mainControl.getArchetypeParser().getArchTypeName(arch.getArchTypNr()) + " (" + arch.getArchTypNr() + ") </font></html>"); + archTypeText.setText("<html><font color=black>Type: " + mainControl.getArchetypeParser().getArchTypeName(gameObject.getArchTypNr()) + " (" + gameObject.getArchTypNr() + ") </font></html>"); - if (arch.isMulti()) { - archTileText.setText("<html><font color=black>Tile: </font><font color=green> multi</font><font color=black> (" + arch.getMultiRefCount() + " parts) (" + arch.getSizeX() + "," + arch.getSizeY() + ")</font></html>"); + if (gameObject.isMulti()) { + archTileText.setText("<html><font color=black>Tile: </font><font color=green> multi</font><font color=black> (" + gameObject.getMultiRefCount() + " parts) (" + gameObject.getSizeX() + "," + gameObject.getSizeY() + ")</font></html>"); } else { archTileText.setText("<html><font color=black>Tile: single" + "</font></html>"); } // notify ReplaceDialog if (ReplaceDialog.isBuilt() && ReplaceDialog.getInstance().isShowing()) { - ReplaceDialog.getInstance().updateArchSelection(arch, false); + ReplaceDialog.getInstance().updateArchSelection(gameObject, false); } } Modified: trunk/daimonin/src/daieditor/CArchQuickView.java =================================================================== --- trunk/daimonin/src/daieditor/CArchQuickView.java 2006-10-09 12:15:54 UTC (rev 534) +++ trunk/daimonin/src/daieditor/CArchQuickView.java 2006-10-09 12:57:11 UTC (rev 535) @@ -30,6 +30,7 @@ import java.awt.GridBagLayout; import javax.swing.JLabel; import javax.swing.JPanel; +import net.sf.gridarta.gameobject.Archetype; /** * The <code>CArchQuickView</code> holds the tile palette. @@ -90,11 +91,11 @@ /** * Show quick info for an object. * - * @param archPart the object to show; this may be any part of a multi-part + * @param gameObjectPart the object to show; this may be any part of a multi-part * object */ - void showArchPanelQuickObject(final GameObject archPart) { - if (archPart == null) { + void showArchPanelQuickObject(final GameObject gameObjectPart) { + if (gameObjectPart == null) { if (mainControl.getMainView().isPickmapActive()) { archObjNameText.setText(" -random pick- "); archObjNameText.setForeground(Color.BLUE); @@ -105,14 +106,14 @@ archTypeText.setText(null); archTileText.setText(null); } else { - final GameObject arch = archPart.getHead(); - String objName = arch.getObjName(); + final GameObject gameObject = gameObjectPart.getHead(); + String objName = gameObject.getObjName(); if (objName == null || objName.length() == 0) { - final GameObject def = arch.getArchetype(); - if (def == null || def == arch) { + final Archetype<GameObject> archetype = gameObject.getArchetype(); + if (archetype == null || archetype == gameObject) { objName = null; - } else if ((objName = def.getObjName()) != null && objName.length() != 0) { - } else if ((objName = def.getArchetypeName()) != null && objName.length() != 0) { + } else if ((objName = archetype.getObjName()) != null && objName.length() != 0) { + } else if ((objName = archetype.getArchetypeName()) != null && objName.length() != 0) { } else { objName = null; } @@ -125,19 +126,19 @@ } archObjNameText.setText(objName); - archArchNameText.setText(arch.getArchetypeName()); + archArchNameText.setText(gameObject.getArchetypeName()); - archTypeText.setText(mainControl.getTypeList().getArchTypeName(arch.getArchTypNr()) + " (" + arch.getArchTypNr() + ')'); + archTypeText.setText(mainControl.getTypeList().getArchTypeName(gameObject.getArchTypNr()) + " (" + gameObject.getArchTypNr() + ')'); - if (arch.isMulti()) { - archTileText.setText("<html><span style=\"color:green;\"> multi</span> (" + arch.getMultiRefCount() + " parts) (" + arch.getSizeX() + ',' + arch.getSizeY() + ")</html>"); + if (gameObject.isMulti()) { + archTileText.setText("<html><span style=\"color:green;\"> multi</span> (" + gameObject.getMultiRefCount() + " parts) (" + gameObject.getSizeX() + ',' + gameObject.getSizeY() + ")</html>"); } else { archTileText.setText("single"); } // notify ReplaceDialog if (ReplaceDialog.isBuilt() && ReplaceDialog.getInstance().isShowing()) { - ReplaceDialog.getInstance().updateArchSelection(arch, false); + ReplaceDialog.getInstance().updateArchSelection(gameObject, false); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 14:03:14
|
Revision: 544 http://svn.sourceforge.net/gridarta/?rev=544&view=rev Author: christianhujer Date: 2006-10-09 07:02:58 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Replaced GameObject with Archetype where already possible. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2006-10-09 14:00:33 UTC (rev 543) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2006-10-09 14:02:58 UTC (rev 544) @@ -32,6 +32,7 @@ import java.io.IOException; import java.io.BufferedReader; import net.sf.gridarta.io.IOUtils; +import net.sf.gridarta.gameobject.Archetype; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -142,11 +143,11 @@ } else if (count < 16) { // add a new archid to the buffer - final GameObject arch = archstack.getArchetype(line); - if (arch != null) { + final Archetype<GameObject> archetype = archstack.getArchetype(line); + if (archetype != null) { nbuf[count] = line; - if (!arch.isMulti()) { + if (!archetype.isMulti()) { count++; // no multipart, this one's okay } else { log.warn("In file " + filename + ": Arch '" + line + "' is a multipart."); Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-10-09 14:00:33 UTC (rev 543) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-10-09 14:02:58 UTC (rev 544) @@ -59,6 +59,7 @@ import javax.swing.SwingConstants; import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.gameobject.AbstractArchetypeSet; +import net.sf.gridarta.gameobject.Archetype; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -560,7 +561,7 @@ // loop through all existing ArchPanels and find all arches // along with their display-category - GameObject archetype; + Archetype<GameObject> archetype; for (CArchPanel.PanelNode node = CArchPanel.getStartPanelNode(); node != null; node = node.next) { @@ -648,7 +649,7 @@ } // finally we need to get the "map"-arch, which is not in the panels - final GameObject maparch = getArchetype(ArchetypeParser.STARTARCH_NAME); + final Archetype<GameObject> maparch = getArchetype(ArchetypeParser.STARTARCH_NAME); if (maparch != null) { count++; Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-10-09 14:00:33 UTC (rev 543) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-10-09 14:02:58 UTC (rev 544) @@ -38,6 +38,7 @@ import java.util.NoSuchElementException; import javax.swing.event.EventListenerList; import net.sf.gridarta.Size2D; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; @@ -219,7 +220,7 @@ /** {@inheritDoc} */ public boolean isMultiArchFittingToMap(final String archName, final Point pos, final boolean allowDouble) { - final GameObject head = getArchetype(archName); + final Archetype<GameObject> head = getArchetype(archName); final Point mapH = new Point(head.getMultiX(), head.getMultiY()); mapH.translate(pos.x, pos.y); if (!isPointValid(mapH)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 14:10:21
|
Revision: 545 http://svn.sourceforge.net/gridarta/?rev=545&view=rev Author: christianhujer Date: 2006-10-09 07:10:07 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Added missing {@inheritDoc}. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/MapModel.java trunk/daimonin/src/daieditor/map/MapModel.java Modified: trunk/crossfire/src/cfeditor/map/MapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapModel.java 2006-10-09 14:02:58 UTC (rev 544) +++ trunk/crossfire/src/cfeditor/map/MapModel.java 2006-10-09 14:10:07 UTC (rev 545) @@ -63,6 +63,7 @@ /** {@inheritDoc} */ void squareChanged(@NotNull MapSquare<GameObject> square); + /** {@inheritDoc} */ MapArchObject getMapArchObject(); /** Modified: trunk/daimonin/src/daieditor/map/MapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapModel.java 2006-10-09 14:02:58 UTC (rev 544) +++ trunk/daimonin/src/daieditor/map/MapModel.java 2006-10-09 14:10:07 UTC (rev 545) @@ -98,6 +98,7 @@ */ void clearMap(); + /** {@inheritDoc} */ MapArchObject getMapArchObject(); /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-11 19:12:39
|
Revision: 546 http://svn.sourceforge.net/gridarta/?rev=546&view=rev Author: christianhujer Date: 2006-10-11 12:12:24 -0700 (Wed, 11 Oct 2006) Log Message: ----------- Bug: newly created CF GameObjects were treated like Archetypes. Fixed. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-10-09 14:10:07 UTC (rev 545) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-10-11 19:12:24 UTC (rev 546) @@ -320,6 +320,7 @@ } } postParseDefArch(arch); + arch.setIsArchetype(); mainControl.getArchetypeSet().addArchetype(arch); archmore = false; // we assume this is last... but perhaps.. Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 14:10:07 UTC (rev 545) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-11 19:12:24 UTC (rev 546) @@ -96,7 +96,6 @@ /** Create an GameObject. */ public GameObject() { - setArchetype(this); script = null; // this object stays 'null' unless there are events defined myId = myIdCounter++; // increase ID counter for every new arch created Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-10-09 14:10:07 UTC (rev 545) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-10-11 19:12:24 UTC (rev 546) @@ -277,7 +277,6 @@ } } postParseDefArch(arch); - // TODO cher: check whether the arch always is an Archetype and if so remove the method below. arch.setIsArchetype(); arch.setEditorFolder(newCat); mainControl.getArchetypeSet().addArchetype(arch); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-13 21:54:06
|
Revision: 552 http://svn.sourceforge.net/gridarta/?rev=552&view=rev Author: christianhujer Date: 2006-10-13 14:53:52 -0700 (Fri, 13 Oct 2006) Log Message: ----------- Added fixme comments about multi arch objects in removal from map squares. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-10-13 21:43:08 UTC (rev 551) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-10-13 21:53:52 UTC (rev 552) @@ -345,6 +345,7 @@ /** * Cleans all completely blocked squares of a map. * @param mapModel Map Model to search for completely blocked squares + * @fixme this implementation does not take care of multi square objects. */ @ActionMethod public void cleanCompletelyBlockedSquares() { final MapModel mapModel = currentMap.getMapModel(); Modified: trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java 2006-10-13 21:43:08 UTC (rev 551) +++ trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java 2006-10-13 21:53:52 UTC (rev 552) @@ -35,6 +35,7 @@ /** * A SquareValidator to assert that a square that's blocked and nopass is not surrounded by blocked and nopass only. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @fixme this implementation does not take care of multi square objects. */ public class BlockedSquareChecker extends AbstractValidator implements MapValidator { Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java 2006-10-13 21:43:08 UTC (rev 551) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java 2006-10-13 21:53:52 UTC (rev 552) @@ -170,6 +170,7 @@ * Remove a GameObject from this container. * @param gameObject GameObject to remove * @throws IllegalArgumentException if <var>gameObject</var> isn't in this container + * @fixme this implementation does not take care of multi square objects. */ public final void remove(@NotNull final G gameObject) { // keep this in sync with iterator() @@ -180,7 +181,10 @@ squareChanged(); } - /** Remove all GameObjects from this container. */ + /** + * Removes all GameObjects from this container. + * @fixme this implementation does not take care of multi square objects. + */ public final void removeAll() { if (contents.size() <= 0) { return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-19 19:13:02
|
Revision: 553 http://svn.sourceforge.net/gridarta/?rev=553&view=rev Author: akirschbaum Date: 2006-10-19 12:12:47 -0700 (Thu, 19 Oct 2006) Log Message: ----------- Unify ArchAttribType. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchAttrib.java trunk/crossfire/src/cfeditor/CFArchType.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFArchAttrib.java Added Paths: ----------- trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-13 21:53:52 UTC (rev 552) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-19 19:12:47 UTC (rev 553) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.gameobject.ArchAttribType; import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import java.awt.BorderLayout; @@ -360,7 +361,7 @@ // do we have "none" spell? int active; - if (spnum == 0 && (gameObject.getAttributeString(attr.getNameOld()).length() == 0 || attr.getDataType() == CFArchAttrib.T_ZSPELL)) { + if (spnum == 0 && (gameObject.getAttributeString(attr.getNameOld()).length() == 0 || attr.getDataType() == ArchAttribType.ZSPELL)) { active = 0; } else { // now look up the spell-number in the array of spells @@ -386,7 +387,7 @@ } /** - * Construct the Combo box for arrays of "list data" (this is used for T_LIST). + * Construct the Combo box for arrays of "list data" (this is used for ArchAttribType.LIST). * @param attr list attribute * @param listData Vector with list items and corresponding values * @return the completed <code>JComboBox</code> @@ -422,7 +423,7 @@ } /** - * Construct the Panel for bitmask values (this is used for T_BITMASK) + * Construct the Panel for bitmask values (this is used for ArchAttribType.BITMASK) * @param attr spell-attribute * @param guiAttr the gui-instance of the bitmask attribute * @param bitmask the bitmask data for this attribute @@ -578,11 +579,11 @@ for (int i = 0; type.getAttr().length > i; i++) { if (type.getAttr()[i].getSecId() == secId) { // count number of attributes - if (type.getAttr()[i].getDataType() != CFArchAttrib.T_FIXED) { + if (type.getAttr()[i].getDataType() != ArchAttribType.FIXED) { number++; } // check for bitmask attributes - if (!hasBitmask && type.getAttr()[i].getDataType() == CFArchAttrib.T_BITMASK) { + if (!hasBitmask && type.getAttr()[i].getDataType() == ArchAttribType.BITMASK) { hasBitmask = true; } } @@ -608,9 +609,9 @@ // now create the attribute-GUI-instance DialogAttrib newAttr = null; - final int dType = type.getAttr()[i].getDataType(); // data type of the attribute + final ArchAttribType dType = type.getAttr()[i].getDataType(); // data type of the attribute - if (dType == CFArchAttrib.T_TEXT) { + if (dType == ArchAttribType.TEXT) { // special case: we've got a text section isText = true; // text section (need special embedding without additional scrollbars) newAttr = new TextAttrib(); @@ -651,14 +652,14 @@ fullPanel = splitPane; // return the splitpane } - if (dType == CFArchAttrib.T_BOOL || - dType == CFArchAttrib.T_BOOL_SPEC) { + if (dType == ArchAttribType.BOOL || + dType == ArchAttribType.BOOL_SPEC) { // create an attribute line for BOOL panel2 = new JPanel(new BorderLayout()); // need this layout for consistent resize-behaviour final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.LEFT)); newAttr = new BoolAttrib(); final JCheckBox input; - if (dType == CFArchAttrib.T_BOOL) { + if (dType == ArchAttribType.BOOL) { // normal bool input = new JCheckBox(" " + type.getAttr()[i].getNameNew(), (gameObject.getAttributeInt(type.getAttr()[i].getNameOld()) == 1)); } else { @@ -685,7 +686,7 @@ panel2.add(panel3, BorderLayout.WEST); ((BoolAttrib) newAttr).input = input; - } else if (dType == CFArchAttrib.T_INT) { + } else if (dType == ArchAttribType.INT) { // create an attribute line for INT panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -723,8 +724,8 @@ panel2.add(panel3, BorderLayout.EAST); panel2.add(panel4, BorderLayout.WEST); ((IntAttrib) newAttr).input = input; - } else if (dType == CFArchAttrib.T_STRING || - dType == CFArchAttrib.T_FLOAT) { + } else if (dType == ArchAttribType.STRING || + dType == ArchAttribType.FLOAT) { // create an attribute line for STRING panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -732,7 +733,7 @@ final JLabel label = new JLabel(type.getAttr()[i].getNameNew() + ": "); - if (dType == CFArchAttrib.T_STRING) { + if (dType == ArchAttribType.STRING) { newAttr = new StringAttrib(); label.setForeground(Color.black); } else { @@ -782,14 +783,14 @@ panel2.add(panel3, BorderLayout.EAST); panel2.add(panel4, BorderLayout.WEST); - if (dType == CFArchAttrib.T_STRING) { + if (dType == ArchAttribType.STRING) { ((StringAttrib) newAttr).input = input; } else { ((FloatAttrib) newAttr).input = input; } - } else if (dType == CFArchAttrib.T_SPELL || - dType == CFArchAttrib.T_ZSPELL || - dType == CFArchAttrib.T_LIST) { + } else if (dType == ArchAttribType.SPELL || + dType == ArchAttribType.ZSPELL || + dType == ArchAttribType.LIST) { // create an attribute line for a combo box entry panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -804,9 +805,9 @@ // create ComboBox with parsed selection final JComboBox input; - if (dType == CFArchAttrib.T_SPELL || dType == CFArchAttrib.T_ZSPELL) { + if (dType == ArchAttribType.SPELL || dType == ArchAttribType.ZSPELL) { input = buildSpellBox(type.getAttr()[i]); - } else if (dType == CFArchAttrib.T_LIST) { + } else if (dType == ArchAttribType.LIST) { if (type.getAttr()[i].getMisc() != null && typelist.getListTable().containsKey((String) (type.getAttr()[i].getMisc()[0]))) { // build the list from vector data input = buildArrayBox(type.getAttr()[i], (Vector) (typelist.getListTable().get((String) (type.getAttr()[i].getMisc()[0])))); @@ -831,7 +832,7 @@ panel2.add(panel3, BorderLayout.EAST); panel2.add(panel4, BorderLayout.WEST); ((ListAttrib) newAttr).input = input; - } else if (dType == CFArchAttrib.T_BITMASK) { + } else if (dType == ArchAttribType.BITMASK) { // create an attribute entry for a bitmask panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -863,7 +864,7 @@ panel2.add(panel3, BorderLayout.EAST); panel2.add(panel4, BorderLayout.WEST); //((BitmaskAttrib)newAttr).input = input; - } else if (dType == CFArchAttrib.T_TREASURE) { + } else if (dType == ArchAttribType.TREASURE) { // create an attribute entry for a treasurelist panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -1067,21 +1068,21 @@ // now loop through all attributes and write out nonzero ones for (DialogAttrib attr = attrHead; attr != null; attr = attr.next) { - if (attr.ref.getDataType() == CFArchAttrib.T_BOOL || - attr.ref.getDataType() == CFArchAttrib.T_BOOL_SPEC) { + if (attr.ref.getDataType() == ArchAttribType.BOOL || + attr.ref.getDataType() == ArchAttribType.BOOL_SPEC) { final boolean value = ((BoolAttrib) attr).input.isSelected(); // true/false if (value) { doc.insertString(doc.getLength(), "<" + attr.ref.getNameNew() + ">\n", docStyle); } } - if (attr.ref.getDataType() == CFArchAttrib.T_INT) { + if (attr.ref.getDataType() == ArchAttribType.INT) { final String value = ((IntAttrib) attr).input.getText(); // the attrib value if (value != null && value.length() > 0 && !value.equals("0")) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } - if (attr.ref.getDataType() == CFArchAttrib.T_FLOAT) { + if (attr.ref.getDataType() == ArchAttribType.FLOAT) { final String value = ((FloatAttrib) attr).input.getText(); // the attrib value if (value != null && value.length() > 0) { try { @@ -1095,30 +1096,30 @@ } } } - if (attr.ref.getDataType() == CFArchAttrib.T_STRING) { + if (attr.ref.getDataType() == ArchAttribType.STRING) { final String value = ((StringAttrib) attr).input.getText(); // the attrib value if (value != null && value.length() > 0) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } - if (attr.ref.getDataType() == CFArchAttrib.T_SPELL || - attr.ref.getDataType() == CFArchAttrib.T_ZSPELL || - attr.ref.getDataType() == CFArchAttrib.T_LIST) { + if (attr.ref.getDataType() == ArchAttribType.SPELL || + attr.ref.getDataType() == ArchAttribType.ZSPELL || + attr.ref.getDataType() == ArchAttribType.LIST) { final String value = ((ListAttrib) attr).input.getSelectedItem().toString().trim(); // the attrib value if (value != null && value.length() > 0 && !value.startsWith("<")) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } - if (attr.ref.getDataType() == CFArchAttrib.T_BITMASK) { + if (attr.ref.getDataType() == ArchAttribType.BITMASK) { final String value = ((BitmaskAttrib) attr).text.getText().trim(); if (value != null && value.length() > 0 && !value.startsWith("<")) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } - if (attr.ref.getDataType() == CFArchAttrib.T_TREASURE) { + if (attr.ref.getDataType() == ArchAttribType.TREASURE) { final String value = ((StringAttrib) attr).input.getText().trim(); // the attrib value if (value != null && value.length() > 0 && !value.equals(CFTreasureListTree.NONE_SYM)) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + @@ -1165,16 +1166,16 @@ String newFace = null; String newMsg = null; for (DialogAttrib attr = attrHead; attr != null; attr = attr.next) { - final int dType = attr.ref.getDataType(); + final ArchAttribType dType = attr.ref.getDataType(); - if (dType == CFArchAttrib.T_BOOL) { + if (dType == ArchAttribType.BOOL) { // a boolean attribute (flag) if (((BoolAttrib) attr).input.isSelected() != (archetype.getAttributeInt(attr.ref.getNameOld()) == 1)) { newArchText = newArchText + attr.ref.getNameOld() + " " + (((BoolAttrib) attr).input.isSelected() ? 1 : 0) + "\n"; } - } else if (dType == CFArchAttrib.T_BOOL_SPEC) { + } else if (dType == ArchAttribType.BOOL_SPEC) { // a boolean attribute with customized true/false values final String valString; // value-string to apply if (((BoolAttrib) attr).input.isSelected()) { @@ -1186,20 +1187,20 @@ if ((valString.equals("0") && !(archetype.getAttributeString(attr.ref.getNameOld()).length() == 0)) || (!valString.equals("0") && !archetype.getAttributeString(attr.ref.getNameOld()).equals(valString))) { newArchText = newArchText + attr.ref.getNameOld() + " " + valString + "\n"; } - } else if (dType == CFArchAttrib.T_INT || - dType == CFArchAttrib.T_FLOAT) { + } else if (dType == ArchAttribType.INT || + dType == ArchAttribType.FLOAT) { // an int attribute - if (dType == CFArchAttrib.T_INT && ((IntAttrib) attr).input.getText().trim().length() == 0) { + if (dType == ArchAttribType.INT && ((IntAttrib) attr).input.getText().trim().length() == 0) { if (archetype.getAttributeInt(attr.ref.getNameOld()) != 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; } - } else if (dType == CFArchAttrib.T_FLOAT && ((FloatAttrib) attr).input.getText().trim().length() == 0) { + } else if (dType == ArchAttribType.FLOAT && ((FloatAttrib) attr).input.getText().trim().length() == 0) { if (archetype.getAttributeString(attr.ref.getNameOld()).length() > 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0.0\n"; } } else { try { - if (dType == CFArchAttrib.T_INT) { + if (dType == ArchAttribType.INT) { final int value = Integer.parseInt(((IntAttrib) attr).input.getText().trim()); if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + " " + value + "\n"; @@ -1226,7 +1227,7 @@ throw new GridderException(""); // bail out } } - } else if (dType == CFArchAttrib.T_STRING) { + } else if (dType == ArchAttribType.STRING) { // a String attribute final String inline = ((StringAttrib) attr).input.getText().trim(); @@ -1258,17 +1259,17 @@ } } } - } else if (dType == CFArchAttrib.T_TEXT) { + } else if (dType == ArchAttribType.TEXT) { // a String attribute if (attr.ref.getNameOld().equalsIgnoreCase("msg") && ((TextAttrib) attr).input.getText().trim().length() > 0) { newMsg = ((TextAttrib) attr).input.getText().trim(); } - } else if (dType == CFArchAttrib.T_SPELL || dType == CFArchAttrib.T_ZSPELL || - dType == CFArchAttrib.T_LIST) { + } else if (dType == ArchAttribType.SPELL || dType == ArchAttribType.ZSPELL || + dType == ArchAttribType.LIST) { // get attribute value that should go into the gameObject final int attrVal; // attribute value - if (dType == CFArchAttrib.T_SPELL || dType == CFArchAttrib.T_ZSPELL) { + if (dType == ArchAttribType.SPELL || dType == ArchAttribType.ZSPELL) { attrVal = typelist.getSpellNum()[((ListAttrib) attr).input.getSelectedIndex()]; } else { // get selected index of ComboBox @@ -1277,8 +1278,8 @@ attrVal = (Integer) ((Vector) (typelist.getListTable().get(attr.ref.getMisc()[0]))).elementAt(2 * attrValTmp); } - if (attrVal == -1 || (attrVal == 0 && dType != CFArchAttrib.T_SPELL - && dType != CFArchAttrib.T_ZSPELL)) { + if (attrVal == -1 || (attrVal == 0 && dType != ArchAttribType.SPELL + && dType != ArchAttribType.ZSPELL)) { if (archetype.getAttributeInt(attr.ref.getNameOld()) != 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; } @@ -1287,14 +1288,14 @@ } else if (archetype.getAttributeInt(attr.ref.getNameOld()) != attrVal) { newArchText = newArchText + attr.ref.getNameOld() + " " + attrVal + "\n"; } - } else if (dType == CFArchAttrib.T_BITMASK) { + } else if (dType == ArchAttribType.BITMASK) { // a bitmask attribute (similar to integer, but easier because no parsing needed) final int value = ((BitmaskAttrib) attr).getValue(); // get bitmask value if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + " " + value + "\n"; } - } else if (dType == CFArchAttrib.T_TREASURE) { + } else if (dType == ArchAttribType.TREASURE) { // a treasurelist attribute final String inline = ((StringAttrib) attr).input.getText().trim(); // input string @@ -1325,7 +1326,7 @@ // Also write all the 'fixed' attributes into the archtext for (int i = 0; type.getAttr().length > i; i++) { - if (type.getAttr()[i].getDataType() == CFArchAttrib.T_FIXED) { + if (type.getAttr()[i].getDataType() == ArchAttribType.FIXED) { final String defaultValue = archetype.getAttributeString(type.getAttr()[i].getNameOld()); if (defaultValue.length() == 0 || (gameObject.getArchTypNr() != archetype.getArchTypNr() && !defaultValue.equalsIgnoreCase(type.getAttr()[i].getNameNew()))) { Modified: trunk/crossfire/src/cfeditor/CFArchAttrib.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-10-13 21:53:52 UTC (rev 552) +++ trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-10-19 19:12:47 UTC (rev 553) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.gameobject.ArchAttribType; import java.io.BufferedReader; import java.io.EOFException; import java.io.IOException; @@ -54,49 +55,25 @@ public static final String XML_INPUT_LENGTH = "length"; - // possible data types for attribute "values": - public static final int T_BOOL = 1; // bool (-> Checkbox) - - public static final int T_BOOL_SPEC = 2; // bool with customized true/false values - - public static final int T_INT = 3; // int (-> Textfield) - - public static final int T_FLOAT = 4; // float (-> Textfield) - - public static final int T_STRING = 5; // string (-> Textfield) - - public static final int T_TEXT = 6; // text (-> Textarea) - - public static final int T_FIXED = 7; // fixed string (no input) - - public static final int T_SPELL = 8; // spell number (-> ComboBox) - - public static final int T_ZSPELL = 9; // (like T_SPELL, except 0 is always 0, not magic bullet) - - public static final int T_BITMASK = 10; // Bitmask (-> Special input with popup frame) - - public static final int T_LIST = 11; // List (-> ComboBox) - - public static final int T_TREASURE = 12; // treasurelist (-> Textfield and Tree) - private CFArchAttrib next; // next element in the list (/array) private String nameOld; // original attr. name (from the CF arches) - private String endingOld; // for dataType = 'T_TEXT' this is the terminating string + private String endingOld; // for dataType = 'ArchAttribType.TEXT' this is the terminating string // (example: 'endmsg' for arch message) private String nameNew; // new attr. name (for the user-friendly GUI) - private int dataType; // type of attribute data (T_BOOL/T_INT/...) + private ArchAttribType dataType; // type of attribute data private String text; // descrption of this attr. private int inputLength; // optional attribute: set length for input JTextFields private String[] misc; // string array for misc. use - // T_BOOL_SPEC uses misc[0]=true value, misc[1]=false value - // T_BITMASK uses misc[0] = bitmask name, T_LIST uses misc[0] = list name + // ArchAttribType.BOOL_SPEC uses misc[0] = true value, misc[1] = false value + // ArchAttribType.BITMASK uses misc[0] = bitmask name + // ArchAttribType.LIST uses misc[0] = list name private int secId; // identifier of the section this attribute is in @@ -155,10 +132,10 @@ // which type of attribute is it? if (atype.equalsIgnoreCase("bool")) { - dataType = T_BOOL; // normal bool + dataType = ArchAttribType.BOOL; // normal bool } else if (atype.equalsIgnoreCase("bool_special")) { // customized boolean type: - dataType = T_BOOL_SPEC; + dataType = ArchAttribType.BOOL_SPEC; // parse true and false values: a1 = root.getAttribute("true"); @@ -172,13 +149,13 @@ misc[0] = a1.getValue().trim(); // string for true misc[1] = a2.getValue().trim(); // string for false } else if (atype.equalsIgnoreCase("int")) { - dataType = T_INT; + dataType = ArchAttribType.INT; } else if (atype.equalsIgnoreCase("float")) { - dataType = T_FLOAT; + dataType = ArchAttribType.FLOAT; } else if (atype.equalsIgnoreCase("string")) { - dataType = T_STRING; + dataType = ArchAttribType.STRING; } else if (atype.equalsIgnoreCase("text")) { - dataType = T_TEXT; + dataType = ArchAttribType.TEXT; // for text data, the terminating string has to be read too if ((a1 = root.getAttribute(XML_KEY_ARCH_BEGIN)) != null) { nameOld = a1.getValue().trim(); @@ -195,7 +172,7 @@ } } else if ("fixed".equalsIgnoreCase(atype)) { // fixed attribute - dataType = T_FIXED; + dataType = ArchAttribType.FIXED; if ((a1 = root.getAttribute("value")) != null) { nameNew = a1.getValue().trim(); } else { @@ -205,16 +182,16 @@ } else if ("spell".equalsIgnoreCase(atype)) { // spell attribute if (tlist.getSpellNum() == null) { - dataType = T_INT; // if we have no spells, use an INT field instead + dataType = ArchAttribType.INT; // if we have no spells, use an INT field instead } else { - dataType = T_SPELL; + dataType = ArchAttribType.SPELL; } } else if ("nz_spell".equalsIgnoreCase(atype)) { // spell attribute if (tlist.getSpellNum() == null) { - dataType = T_INT; // if we have no spells, use an INT field instead + dataType = ArchAttribType.INT; // if we have no spells, use an INT field instead } else { - dataType = T_ZSPELL; + dataType = ArchAttribType.ZSPELL; } } else if (atype.startsWith("bitmask")) { // got a bitmask attribute @@ -222,7 +199,7 @@ if (tlist.getBitmaskTable().containsKey(bitmaskName)) { // the bitmask is well defined - dataType = T_BITMASK; + dataType = ArchAttribType.BITMASK; misc = new String[1]; misc[0] = bitmaskName; // store bitmask name in misc[0] } else { @@ -234,14 +211,14 @@ if (tlist.getListTable().containsKey(listName)) { // the list is well defined - dataType = T_LIST; + dataType = ArchAttribType.LIST; misc = new String[1]; misc[0] = listName; // store list name in misc[0] } else { log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "', type " + typeName + ": List \"" + listName + "\" is undefined."); } } else if ("treasurelist".equalsIgnoreCase(atype)) { - dataType = T_TREASURE; + dataType = ArchAttribType.TREASURE; } else { // unknown type log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has an attribute with unknown type: '" + atype + "'."); @@ -355,7 +332,7 @@ return nameNew; } - public int getDataType() { + public ArchAttribType getDataType() { return dataType; } Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-10-13 21:53:52 UTC (rev 552) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-10-19 19:12:47 UTC (rev 553) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.gameobject.ArchAttribType; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; @@ -389,7 +390,7 @@ attrList.add(attrib); // parsing succeeded, now assign this attribute to a section - if (attrib.getDataType() == CFArchAttrib.T_TEXT) { + if (attrib.getDataType() == ArchAttribType.TEXT) { // text attributes all have their own section attrib.setSection(sectionNum, attrib.getNameNew()); sectionNum++; @@ -441,7 +442,7 @@ // create table with attributes text += "<br><br><TABLE BORDER>"; for (int i = 0; i < attr.length; i++) { - if (attr[i].getDataType() != CFArchAttrib.T_FIXED && + if (attr[i].getDataType() != ArchAttribType.FIXED && !attr[i].getSecName().equalsIgnoreCase("general")) { text += "<TR><B>"+attr[i].getNameNew()+":</B><br>"+attr[i].getText()+"</TR>"; } Added: trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java (rev 0) +++ trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java 2006-10-19 19:12:47 UTC (rev 553) @@ -0,0 +1,66 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package cfeditor.gameobject; + +/** + * Enumeration for Archetype Attribute Types. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public enum ArchAttribType { + + /** Boolean -> Checkbox. */ + BOOL, + + /** Boolean -> Checkbox, with customized true/false values. */ + BOOL_SPEC, + + /** Integer -> Textfield. */ + INT, + + /** Float -> Textfield. */ + FLOAT, + + /** String -> Textfield. */ + STRING, + + /** Text -> Textarea. */ + TEXT, + + /** Fixed String -> (No input). */ + FIXED, + + /** Spell -> Spell number (Combobox). */ + SPELL, + + /** ZSpell -> Spell number (except that 0 is always 0, not magic bullet). */ + ZSPELL, + + /** Bitmask -> Special input with popup frame. */ + BITMASK, + + /** List -> Combobox. */ + LIST, + + /** Treasure -> treasurelist (Textfield and Tree). */ + TREASURE, + +} // enum ArchAttribType Property changes on: trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-13 21:53:52 UTC (rev 552) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-19 19:12:47 UTC (rev 553) @@ -381,7 +381,7 @@ } /** - * Construct the Combo box for arrays of "list data" (this is used for T_LIST). + * Construct the Combo box for arrays of "list data" (this is used for LIST). * @param attr list attribute * @param listData List with list items and corresponding values, that means the types are altering: String,Integer * @return the completed <code>JComboBox</code> Modified: trunk/daimonin/src/daieditor/CFArchAttrib.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-10-13 21:53:52 UTC (rev 552) +++ trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-10-19 19:12:47 UTC (rev 553) @@ -67,20 +67,21 @@ private String nameOld; // original attr. name (from the CF arches) - private String endingOld; // for dataType = 'T_TEXT' this is the terminating string + private String endingOld; // for dataType = 'TEXT' this is the terminating string // (example: 'endmsg' for arch message) private String nameNew; // new attr. name (for the user-friendly GUI) - private ArchAttribType dataType; // type of attribute data (T_BOOL/T_INT/...) + private ArchAttribType dataType; // type of attribute data private String text; // descrption of this attr. private int inputLength; // optional attribute: set length for input JTextFields private String[] misc; // string array for misc. use - // T_BOOL_SPEC uses misc[0]=true value, misc[1]=false value - // T_BITMASK uses misc[0] = bitmask name, T_LIST uses misc[0] = list name + // BOOL_SPEC uses misc[0] = true value, misc[1] = false value + // BITMASK uses misc[0] = bitmask name + // LIST uses misc[0] = list name private int secId; // identifier of the section this attribute is in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-19 20:28:56
|
Revision: 556 http://svn.sourceforge.net/gridarta/?rev=556&view=rev Author: akirschbaum Date: 2006-10-19 13:28:33 -0700 (Thu, 19 Oct 2006) Log Message: ----------- Unify expression. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/daimonin/src/daieditor/CAttribDialog.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-19 20:22:26 UTC (rev 555) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-19 20:28:33 UTC (rev 556) @@ -207,7 +207,7 @@ log.debug("# type: " + tmp.getTypeName()); } - for (int t = 0; t < numArgs * 2; t += 2) { + for (int t = 0, l = numArgs * 2; t < l; t += 2) { attrValue = this.gameObject.getAttributeString(tmp.getTypeAttr()[t]); if (log.isDebugEnabled()) { Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-19 20:22:26 UTC (rev 555) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-19 20:28:33 UTC (rev 556) @@ -240,7 +240,7 @@ //System.err.println("# type: "+tmp.getTypeName()); - for (int t = 0, l = numArgs << 1; t < l; t += 2) { + for (int t = 0, l = numArgs * 2; t < l; t += 2) { final String attrValue = this.gameObject.getAttributeString(tmp.getTypeAttr()[t], true); //System.err.println(" arch: '"+attrValue+"', type: '"+tmp.getTypeAttr()[t+1]+"'"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-21 12:52:39
|
Revision: 558 http://svn.sourceforge.net/gridarta/?rev=558&view=rev Author: christianhujer Date: 2006-10-21 05:52:04 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Unified AnimationObject(s). Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/anim/ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java trunk/src/app/net/sf/gridarta/gameobject/anim/DuplicateAnimationException.java Removed Paths: ------------- trunk/daimonin/src/daieditor/gameobject/anim/DuplicateAnimationException.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-10-21 12:52:04 UTC (rev 558) @@ -1726,7 +1726,7 @@ return archetypeParser; } - public AnimationObjects getAnimationObject() { + public AnimationObjects getAnimationObjects() { return animationObjects; } Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-10-21 12:52:04 UTC (rev 558) @@ -36,6 +36,7 @@ import java.util.List; import java.util.Map; import net.sf.gridarta.io.IOUtils; +import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import org.apache.log4j.Logger; import org.jdom.DataConversionException; import org.jdom.Document; @@ -52,14 +53,12 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ +@SuppressWarnings({"HardcodedFileSeparator"}) public final class ArchetypeParser implements net.sf.gridarta.gameobject.ArchetypeParser<GameObject> { /** Logger. */ private static final Logger log = Logger.getLogger(ArchetypeParser.class); - // name of the system-arch containing path of starting map - public static final String STARTARCH_NAME = "map"; - // table with type numbers as keys (Integer), and type names as values (String) private Map<Integer,String> archTypeNumbers; @@ -248,7 +247,11 @@ } } else if (animflag) { if (thisLine.startsWith("mina")) { - mainControl.getAnimationObject().addAnimObject(arch.getArchetypeName(), arch.getAnimText()); + try { + mainControl.getAnimationObjects().addAnimationObject(arch.getArchetypeName(), arch.getAnimText()); + } catch (final DuplicateAnimationException e) { + log.warn("Duplicate Animation " + arch.getArchetypeName(), e); + } arch.addObjectText("animation " + arch.getArchetypeName() + "\n"); // here we must add this to AnimationObject Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-10-21 12:52:04 UTC (rev 558) @@ -60,6 +60,7 @@ import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.gameobject.AbstractArchetypeSet; import net.sf.gridarta.gameobject.Archetype; +import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -310,7 +311,11 @@ if (log.isDebugEnabled()) { log.debug("We found this>> name: >" + animName + " \n>" + animText + "<\n"); } - mainControl.getAnimationObject().addAnimObject(animName, animText); + try { + mainControl.getAnimationObjects().addAnimationObject(animName, animText); + } catch (DuplicateAnimationException e) { + log.warn("Duplicate Animation " + animName, e); + } } else { animText = "" + animText + thisLine + "\n"; } Modified: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java 2006-10-21 12:52:04 UTC (rev 558) @@ -29,7 +29,7 @@ * A single animation object. * An animation object holds the name and the framelist of an animation. */ -public final class AnimationObject implements Comparable<AnimationObject> { +public final class AnimationObject implements Comparable<AnimationObject>, net.sf.gridarta.gameobject.anim.AnimationObject { /** The name of this animation. */ private final String animName; @@ -50,19 +50,12 @@ this.animList = animList; } - /** - * Get the animName, which is the name of the animation as usable by the "animations" attribute. - * @return the name of this animation. - */ + /** {@inheritDoc} */ public String getAnimName() { return animName; } - /** - * Returns the animation list of this animation. - * The individual entries are all postfixed with '\n'. - * @return the animation list of this animation. - */ + /** {@inheritDoc} */ public String getAnimList() { return animList; } Modified: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2006-10-21 12:52:04 UTC (rev 558) @@ -29,15 +29,14 @@ import java.util.Iterator; import java.util.List; import java.util.TreeSet; +import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; /** * The <code>AnimationObject</code>. - * <p/> - * WARNING: This class uses two indexes which are independent of each other: - * index of animation object and index of animation name. * @author <a href="mailto:mic...@no...">Michael Toennies</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public class AnimationObjects implements Iterable<AnimationObject> { +public class AnimationObjects implements net.sf.gridarta.gameobject.anim.AnimationObjects<AnimationObject> { /** The animation objects. */ private final List<AnimationObject> animObjects = new ArrayList<AnimationObject>(); @@ -51,21 +50,9 @@ return new TreeSet<AnimationObject>(animObjects).iterator(); } - /** - * Add an animation object. - * @param name name of the animation object - * @param list list with individual frames - */ - public void addAnimObject(final String name, final String list) { + /** {@inheritDoc} */ + public void addAnimationObject(final String name, final String list) throws DuplicateAnimationException { animObjects.add(new AnimationObject(name, list)); } - /** - * Returns number of animation objects created. - * @return number of animation objects created. - */ - public int getNumAnimObjects() { - return animObjects.size(); - } - } // class AnimationObjects Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-10-21 12:52:04 UTC (rev 558) @@ -29,7 +29,7 @@ import daieditor.IGUIConstants; import daieditor.MultiPositionData; import daieditor.PathManager; -import daieditor.gameobject.anim.DuplicateAnimationException; +import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; @@ -50,14 +50,12 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ +@SuppressWarnings({"HardcodedFileSeparator"}) public final class ArchetypeParser implements net.sf.gridarta.gameobject.ArchetypeParser<GameObject> { /** Logger. */ private static final Logger log = Logger.getLogger("daieditor"); - // name of the system-arch containing path of starting map - public static final String STARTARCH_NAME = "map"; - private final CMainControl mainControl; /** Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-10-21 12:52:04 UTC (rev 558) @@ -33,7 +33,7 @@ import daieditor.gameobject.anim.AnimationObject; import daieditor.gameobject.anim.AnimationObjects; import daieditor.gameobject.anim.AnimationParseException; -import daieditor.gameobject.anim.DuplicateAnimationException; +import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import daieditor.gameobject.face.DuplicateFaceException; import daieditor.gameobject.face.FaceFacade; import daieditor.gameobject.face.FaceObject; Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java 2006-10-21 12:52:04 UTC (rev 558) @@ -40,7 +40,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class AnimationObject extends NamedObject implements Serializable { +public final class AnimationObject extends NamedObject implements Serializable, net.sf.gridarta.gameobject.anim.AnimationObject { /** Serial Version. */ private static final long serialVersionUID = 1L; @@ -147,19 +147,14 @@ } /** - * Get the animName, which is the name of the animation as usable by the "animations" attribute. - * @return the name of this animation. + * {@inheritDoc} * @see #getName() */ public String getAnimName() { return animName; } - /** - * Returns the animation list of this animation. - * The individual entries are all postfixed with '\n'. - * @return the animation list of this animation. - */ + /** {@inheritDoc} */ public String getAnimList() { return animList; } Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 12:52:04 UTC (rev 558) @@ -37,6 +37,7 @@ import java.util.HashMap; import java.util.Map; import net.sf.gridarta.io.IOUtils; +import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import org.jetbrains.annotations.Nullable; @@ -46,7 +47,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class AnimationObjects extends NamedObjects<AnimationObject> { +public final class AnimationObjects extends NamedObjects<AnimationObject> implements net.sf.gridarta.gameobject.anim.AnimationObjects<AnimationObject> { /** * This Map holds (anim object name, path to arc file) pairs. @@ -62,12 +63,7 @@ super(name); } - /** - * Adds a new animation object. - * @param animName name of the animation object to add - * @param list String with animation list data - * @throws DuplicateAnimationException in case the animation was not unique - */ + /** {@inheritDoc} */ public void addAnimationObject(final String animName, final String list) throws DuplicateAnimationException { addAnimationObject(animName, list, null); } Deleted: trunk/daimonin/src/daieditor/gameobject/anim/DuplicateAnimationException.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/DuplicateAnimationException.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/daimonin/src/daieditor/gameobject/anim/DuplicateAnimationException.java 2006-10-21 12:52:04 UTC (rev 558) @@ -1,51 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2005 Christian Hujer - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package daieditor.gameobject.anim; - -/** - * Exception that's thrown in case an animation name was not unique. - * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> - * @serial exclude - */ -public class DuplicateAnimationException extends Exception { - - /** AnimationObject causing the problem. */ - private final AnimationObject duplicate; - - /** - * Create a DuplicateAnimationException. - * @param duplicate Duplicate animation that's the cause - */ - public DuplicateAnimationException(final AnimationObject duplicate) { - super("Non-unique animation " + duplicate.getAnimName()); - this.duplicate = duplicate; - } - - /** - * Get the duplicate that caused this exception. - * @return duplicate - */ - public AnimationObject getDuplicate() { - return duplicate; - } - -} // class DuplicateAnimationException Modified: trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java 2006-10-21 12:52:04 UTC (rev 558) @@ -12,6 +12,11 @@ public interface ArchetypeParser<G extends GameObject<G>> { /** + * Name of the system-arch containing path of starting map. + */ + String STARTARCH_NAME = "map"; + + /** * If the given arch is a multipart head, we generate the appropriate * tail (from the arch stack) and attach it. The new arches get added * to the temp list, not a map. This method should only be called Added: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java 2006-10-21 12:52:04 UTC (rev 558) @@ -0,0 +1,22 @@ +package net.sf.gridarta.gameobject.anim; + +/** + * An AnimationObject reflects the animation ("<code>anim\n</code>" ... "<code>mina\n</code>") of a GameObject or Archetype. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public interface AnimationObject { + + /** + * Get the animName, which is the name of the animation as usable by the "animations" attribute. + * @return the name of this animation. + */ + public String getAnimName(); + + /** + * Returns the animation list of this animation. + * The individual entries are all postfixed with '\n'. + * @return the animation list of this animation. + */ + public String getAnimList(); + +} // interface AnimationObject Property changes on: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java 2006-10-21 12:52:04 UTC (rev 558) @@ -0,0 +1,17 @@ +package net.sf.gridarta.gameobject.anim; + +/** + * AnimationObjects is a container for {@link AnimationObject}s. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public interface AnimationObjects<T extends AnimationObject> extends Iterable<T> { + + /** + * Add an animation object. + * @param name name of the animation object + * @param list list with individual frames + * @throws DuplicateAnimationException in case the animation was not unique + */ + void addAnimationObject(String name, String list) throws DuplicateAnimationException; + +} // interface AnimationObjects Property changes on: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Copied: trunk/src/app/net/sf/gridarta/gameobject/anim/DuplicateAnimationException.java (from rev 556, trunk/daimonin/src/daieditor/gameobject/anim/DuplicateAnimationException.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/DuplicateAnimationException.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/DuplicateAnimationException.java 2006-10-21 12:52:04 UTC (rev 558) @@ -0,0 +1,51 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package net.sf.gridarta.gameobject.anim; + +/** + * Exception that's thrown in case an animation name was not unique. + * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> + * @serial exclude + */ +public class DuplicateAnimationException extends Exception { + + /** AnimationObject causing the problem. */ + private final AnimationObject duplicate; + + /** + * Create a DuplicateAnimationException. + * @param duplicate Duplicate animation that's the cause + */ + public DuplicateAnimationException(final AnimationObject duplicate) { + super("Non-unique animation " + duplicate.getAnimName()); + this.duplicate = duplicate; + } + + /** + * Get the duplicate that caused this exception. + * @return duplicate + */ + public AnimationObject getDuplicate() { + return duplicate; + } + +} // class DuplicateAnimationException Property changes on: trunk/src/app/net/sf/gridarta/gameobject/anim/DuplicateAnimationException.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-21 14:27:23
|
Revision: 559 http://svn.sourceforge.net/gridarta/?rev=559&view=rev Author: christianhujer Date: 2006-10-21 07:26:58 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Moved AnimationParseException to gridarta. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java Removed Paths: ------------- trunk/daimonin/src/daieditor/gameobject/anim/AnimationParseException.java Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-10-21 12:52:04 UTC (rev 558) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-10-21 14:26:58 UTC (rev 559) @@ -32,7 +32,7 @@ import daieditor.IGUIConstants; import daieditor.gameobject.anim.AnimationObject; import daieditor.gameobject.anim.AnimationObjects; -import daieditor.gameobject.anim.AnimationParseException; +import net.sf.gridarta.gameobject.anim.AnimationParseException; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import daieditor.gameobject.face.DuplicateFaceException; import daieditor.gameobject.face.FaceFacade; Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 12:52:04 UTC (rev 558) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 14:26:58 UTC (rev 559) @@ -38,6 +38,7 @@ import java.util.Map; import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; +import net.sf.gridarta.gameobject.anim.AnimationParseException; import org.jetbrains.annotations.Nullable; Deleted: trunk/daimonin/src/daieditor/gameobject/anim/AnimationParseException.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationParseException.java 2006-10-21 12:52:04 UTC (rev 558) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationParseException.java 2006-10-21 14:26:58 UTC (rev 559) @@ -1,85 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2005 Christian Hujer - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package daieditor.gameobject.anim; - -import java.io.File; - -/** - * This exception is thrown when parsing an animation definition file (<code>arch/animations</code> and <code>arch/**.anim</code>) revealed that such - * a file contains an error. - * In future, it might as well be used if a user defines or changes an animation. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class AnimationParseException extends Exception { - - /** - * The file that caused the error. - * @serial include - */ - private final File file; - - /** - * The line number that caused the error. - * @serial include - */ - private final int lineNumber; - - /** - * Create an AnimationParseException. - * @param expected expected parse element - * @param actual actual parse element that gave the error - * @param lineNumber number of erraneous line - */ - public AnimationParseException(final String expected, final String actual, final int lineNumber) { - super("Excpected \"" + expected + "\", got \"" + actual + "\" in line " + lineNumber); - file = null; - this.lineNumber = lineNumber; - } - - /** - * Create an AnimationParseException. - * @param cause Exception causing this exception - * @param file File containint the error - */ - public AnimationParseException(final AnimationParseException cause, final File file) { - super(cause.getMessage() + " of file " + file, cause); - this.file = file; - lineNumber = cause.lineNumber; - } - - /** - * Get the number of the erraneous line. - * @return number of erraneous line - */ - public int getLineNumber() { - return lineNumber; - } - - /** - * Get the file that was erraneous. - * @return erraneous file or <code>null</code> if file unknown - */ - public File getFile() { - return file; - } - -} // class AnimationParseException Copied: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java (from rev 556, trunk/daimonin/src/daieditor/gameobject/anim/AnimationParseException.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java 2006-10-21 14:26:58 UTC (rev 559) @@ -0,0 +1,85 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package net.sf.gridarta.gameobject.anim; + +import java.io.File; + +/** + * This exception is thrown when parsing an animation definition file (<code>arch/animations</code> and <code>arch/**.anim</code>) revealed that such + * a file contains an error. + * In future, it might as well be used if a user defines or changes an animation. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class AnimationParseException extends Exception { + + /** + * The file that caused the error. + * @serial include + */ + private final File file; + + /** + * The line number that caused the error. + * @serial include + */ + private final int lineNumber; + + /** + * Create an AnimationParseException. + * @param expected expected parse element + * @param actual actual parse element that gave the error + * @param lineNumber number of erraneous line + */ + public AnimationParseException(final String expected, final String actual, final int lineNumber) { + super("Excpected \"" + expected + "\", got \"" + actual + "\" in line " + lineNumber); + file = null; + this.lineNumber = lineNumber; + } + + /** + * Create an AnimationParseException. + * @param cause Exception causing this exception + * @param file File containint the error + */ + public AnimationParseException(final AnimationParseException cause, final File file) { + super(cause.getMessage() + " of file " + file, cause); + this.file = file; + lineNumber = cause.lineNumber; + } + + /** + * Get the number of the erraneous line. + * @return number of erraneous line + */ + public int getLineNumber() { + return lineNumber; + } + + /** + * Get the file that was erraneous. + * @return erraneous file or <code>null</code> if file unknown + */ + public File getFile() { + return file; + } + +} // class AnimationParseException Property changes on: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-21 14:35:28
|
Revision: 561 http://svn.sourceforge.net/gridarta/?rev=561&view=rev Author: christianhujer Date: 2006-10-21 07:35:14 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Unified parameter names for addAnimationObject(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java Modified: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2006-10-21 14:34:35 UTC (rev 560) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2006-10-21 14:35:14 UTC (rev 561) @@ -51,8 +51,8 @@ } /** {@inheritDoc} */ - public void addAnimationObject(final String name, final String list) throws DuplicateAnimationException { - animObjects.add(new AnimationObject(name, list)); + public void addAnimationObject(final String animName, final String list) throws DuplicateAnimationException { + animObjects.add(new AnimationObject(animName, list)); } } // class AnimationObjects Modified: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java 2006-10-21 14:34:35 UTC (rev 560) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java 2006-10-21 14:35:14 UTC (rev 561) @@ -8,10 +8,10 @@ /** * Add an animation object. - * @param name name of the animation object + * @param animName name of the animation object * @param list list with individual frames * @throws DuplicateAnimationException in case the animation was not unique */ - void addAnimationObject(String name, String list) throws DuplicateAnimationException; + void addAnimationObject(String animName, String list) throws DuplicateAnimationException; } // interface AnimationObjects This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-21 15:54:54
|
Revision: 562 http://svn.sourceforge.net/gridarta/?rev=562&view=rev Author: christianhujer Date: 2006-10-21 08:54:40 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Changed AnimationParseException to use URI instead of File for specifying the bogus resource. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-10-21 14:35:14 UTC (rev 561) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-10-21 15:54:40 UTC (rev 562) @@ -400,7 +400,7 @@ } catch (final IOException e) { mainControl.handleThrowable(e); } catch (final AnimationParseException e) { - mainControl.handleThrowable(new AnimationParseException(e, animFile)); + mainControl.handleThrowable(new AnimationParseException(e, animFile.toURI())); } } animFiles = null; @@ -422,7 +422,7 @@ } catch (final IOException e) { mainControl.handleThrowable(e); } catch (final AnimationParseException e) { - mainControl.handleThrowable(new AnimationParseException(e, new File("animations"))); + mainControl.handleThrowable(new AnimationParseException(e, new File("animations").toURI())); } } Modified: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java 2006-10-21 14:35:14 UTC (rev 561) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java 2006-10-21 15:54:40 UTC (rev 562) @@ -21,7 +21,7 @@ package net.sf.gridarta.gameobject.anim; -import java.io.File; +import java.net.URI; /** * This exception is thrown when parsing an animation definition file (<code>arch/animations</code> and <code>arch/**.anim</code>) revealed that such @@ -32,10 +32,10 @@ public class AnimationParseException extends Exception { /** - * The file that caused the error. + * The resource that caused the error. * @serial include */ - private final File file; + private final URI uri; /** * The line number that caused the error. @@ -51,18 +51,18 @@ */ public AnimationParseException(final String expected, final String actual, final int lineNumber) { super("Excpected \"" + expected + "\", got \"" + actual + "\" in line " + lineNumber); - file = null; + uri = null; this.lineNumber = lineNumber; } /** * Create an AnimationParseException. * @param cause Exception causing this exception - * @param file File containint the error + * @param uri Resource containint the error */ - public AnimationParseException(final AnimationParseException cause, final File file) { - super(cause.getMessage() + " of file " + file, cause); - this.file = file; + public AnimationParseException(final AnimationParseException cause, final URI uri) { + super(cause.getMessage() + " of resource " + uri, cause); + this.uri = uri; lineNumber = cause.lineNumber; } @@ -78,8 +78,8 @@ * Get the file that was erraneous. * @return erraneous file or <code>null</code> if file unknown */ - public File getFile() { - return file; + public URI getURI() { + return uri; } } // class AnimationParseException This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-21 16:30:49
|
Revision: 563 http://svn.sourceforge.net/gridarta/?rev=563&view=rev Author: akirschbaum Date: 2006-10-21 09:30:37 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Make variables 'final'. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/daimonin/src/daieditor/CAttribDialog.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-21 15:54:40 UTC (rev 562) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-21 16:30:37 UTC (rev 563) @@ -201,14 +201,13 @@ // check if all the type-attributes match final int numArgs = (int) (tmp.getTypeAttr().length / 2.0); boolean match = true; - String attrValue; if (log.isDebugEnabled()) { log.debug("# type: " + tmp.getTypeName()); } for (int t = 0, l = numArgs * 2; t < l; t += 2) { - attrValue = this.gameObject.getAttributeString(tmp.getTypeAttr()[t]); + final String attrValue = this.gameObject.getAttributeString(tmp.getTypeAttr()[t]); if (log.isDebugEnabled()) { log.debug(" arch: '" + attrValue + "', type: '" + tmp.getTypeAttr()[t + 1] + "'"); @@ -607,7 +606,7 @@ JPanel panel2 = null; // tmp. Panel for the layout // now create the attribute-GUI-instance - DialogAttrib newAttr = null; + final DialogAttrib newAttr; final ArchAttribType dType = type.getAttr()[i].getDataType(); // data type of the attribute if (dType == ArchAttribType.TEXT) { @@ -649,10 +648,7 @@ ((TextAttrib) newAttr).input = input; fullPanel = splitPane; // return the splitpane - } - - if (dType == ArchAttribType.BOOL || - dType == ArchAttribType.BOOL_SPEC) { + } else if (dType == ArchAttribType.BOOL || dType == ArchAttribType.BOOL_SPEC) { // create an attribute line for BOOL panel2 = new JPanel(new BorderLayout()); // need this layout for consistent resize-behaviour final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.LEFT)); @@ -842,10 +838,9 @@ // create bitmask-entry in the gui //JButton input = null; - CAttribBitmask bitmask = null; if (type.getAttr()[i].getMisc() != null && typelist.getBitmaskTable().containsKey((String) (type.getAttr()[i].getMisc()[0]))) { // fetch the bitmask data, then build the attribute panel - bitmask = (CAttribBitmask) (typelist.getBitmaskTable().get((String) (type.getAttr()[i].getMisc()[0]))); + final CAttribBitmask bitmask = (CAttribBitmask) (typelist.getBitmaskTable().get((String) (type.getAttr()[i].getMisc()[0]))); buildBitmask(type.getAttr()[i], (BitmaskAttrib) newAttr, bitmask, panel3); } else { // error: bitmask data is missing or corrupt @@ -899,6 +894,8 @@ panel2.add(panel4, BorderLayout.WEST); ((StringAttrib) newAttr).input = input; + } else { + newAttr = null; } if (newAttr != null) { Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-21 15:54:40 UTC (rev 562) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-21 16:30:37 UTC (rev 563) @@ -584,7 +584,7 @@ JComponent cGlue = null; // now create the attribute-GUI-instance - DialogAttrib<?> newAttr = null; + final DialogAttrib<?> newAttr; switch (dType) { case TEXT: { @@ -649,7 +649,7 @@ final NumberFormatter formatter = new NumberFormatter(format); final DefaultFormatterFactory factory = new DefaultFormatterFactory(formatter); // parse value from gameObject - Number value = null; + final Number value; switch (dType) { case INT: value = gameObject.getAttributeInt(nameOld, true); @@ -660,6 +660,10 @@ case FLOAT: value = gameObject.getAttributeDouble(nameOld, true); break; + default: + value = null; + assert false; + break; } final JFormattedTextField input = new JFormattedTextField(factory, value); input.setColumns(fieldLength); @@ -713,7 +717,7 @@ cLabel.setForeground(IGUIConstants.INT_COLOR); newAttr = new DialogAttrib<JComboBox>(attrib); // create ComboBox with parsed selection - JComboBox input = null; + final JComboBox input; if (dType == SPELL || dType == ZSPELL) { input = buildSpellBox(attrib); } else if (dType == LIST) { @@ -723,7 +727,10 @@ } else { // error: list data is missing or corrupt cComp = new JLabel("Error: Undefined List"); + input = null; } + } else { + input = null; } if (input != null) { cComp = input; @@ -799,6 +806,7 @@ } break; default: + newAttr = null; assert false; } // switch (dType) assert newAttr != null; @@ -1226,8 +1234,7 @@ } // before we modify the archtext, we look for errors and save them. // later the user must confirm whether to keep or dump those errors - String errors = null; - errors = gameObject.getSyntaxErrors(typeStruct); + final String errors = gameObject.getSyntaxErrors(typeStruct); // --- parsing succeeded, now we write it into the gameObject/map --- gameObject.setObjectText(newArchText); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-21 17:47:51
|
Revision: 565 http://svn.sourceforge.net/gridarta/?rev=565&view=rev Author: christianhujer Date: 2006-10-21 10:47:27 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Increased net.sf.gridarta javadoc comment coverage to 100%. (Excluding net.sf.gridarta.textedit.*). 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 trunk/src/app/net/sf/gridarta/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gui/map/MapCursor.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-21 16:41:32 UTC (rev 564) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-21 17:47:27 UTC (rev 565) @@ -406,6 +406,7 @@ return getHead() != this; } + /** {@inheritDoc} */ @Nullable public GameObject getMultiNext() { return multi != null ? multi.getNext(this) : null; } Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-21 16:41:32 UTC (rev 564) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-21 17:47:27 UTC (rev 565) @@ -312,6 +312,7 @@ return getHead() != this; } + /** {@inheritDoc} */ @Nullable public GameObject getMultiNext() { return multi != null ? multi.getNext(this) : null; } Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-21 16:41:32 UTC (rev 564) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-21 17:47:27 UTC (rev 565) @@ -74,12 +74,17 @@ */ @Nullable String getMsgText(); - // TODO add documentation - // TODO check whether this should return G or Archetype<G> + /** + * Get the next of this multi part object. + * @return next of this multipart object or <code>null</code> if this isn't a multipart object or this is the last part of a multipart object. + * @todo check whether this should return G or Archetype<G> + */ @Nullable G getMultiNext(); - // TODO proper documentation - /** @return true if 'this' arch is part of a multisquare object */ + /** + * Returns whether this Archetype is a multipart object. + * @return <code>true</code> if this Archetype is a multipart object, otherwise <code>false</code>. + */ boolean isMulti(); /** @@ -106,7 +111,10 @@ */ boolean isTail(); - // TODO documentation + /** + * Returns the type number of this Archetype. + * @return The type number of this Archetype. + */ int getArchTypNr(); /** Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-21 16:41:32 UTC (rev 564) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-21 17:47:27 UTC (rev 565) @@ -432,7 +432,7 @@ head.container.remove(head); } - // TODO documentation + /** {@inheritDoc} */ public abstract int getArchTypNr(); /** @@ -665,7 +665,7 @@ */ public abstract G getHead(); - // TODO add documentation + /** {@inheritDoc} */ @Nullable public abstract G getMultiNext(); /** Modified: trunk/src/app/net/sf/gridarta/gui/map/MapCursor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapCursor.java 2006-10-21 16:41:32 UTC (rev 564) +++ trunk/src/app/net/sf/gridarta/gui/map/MapCursor.java 2006-10-21 17:47:27 UTC (rev 565) @@ -76,6 +76,10 @@ {-1, -1} // NW }; + /** + * Temporary point used in some methods. + * Placed as instance var to prevent creation of temporary objects. + */ private final Point tmpPoint = new Point(); /** The MapCursorListeners to inform of changes. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-21 20:05:46
|
Revision: 567 http://svn.sourceforge.net/gridarta/?rev=567&view=rev Author: akirschbaum Date: 2006-10-21 13:05:35 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Replace if statements with switch statements. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/daimonin/src/daieditor/CAttribDialog.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-21 19:17:35 UTC (rev 566) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-21 20:05:35 UTC (rev 567) @@ -609,7 +609,8 @@ final DialogAttrib newAttr; final ArchAttribType dType = type.getAttr()[i].getDataType(); // data type of the attribute - if (dType == ArchAttribType.TEXT) { + switch (dType) { + case TEXT: { // special case: we've got a text section isText = true; // text section (need special embedding without additional scrollbars) newAttr = new TextAttrib(); @@ -648,16 +649,21 @@ ((TextAttrib) newAttr).input = input; fullPanel = splitPane; // return the splitpane - } else if (dType == ArchAttribType.BOOL || dType == ArchAttribType.BOOL_SPEC) { + } + break; + case BOOL: + case BOOL_SPEC: { // create an attribute line for BOOL panel2 = new JPanel(new BorderLayout()); // need this layout for consistent resize-behaviour final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.LEFT)); newAttr = new BoolAttrib(); final JCheckBox input; - if (dType == ArchAttribType.BOOL) { + switch (dType) { + case BOOL: // normal bool input = new JCheckBox(" " + type.getAttr()[i].getNameNew(), (gameObject.getAttributeInt(type.getAttr()[i].getNameOld()) == 1)); - } else { + break; + case BOOL_SPEC: { // parse values for customized bool final String trueVal = type.getAttr()[i].getMisc()[0]; @@ -668,6 +674,12 @@ input = new JCheckBox(" " + type.getAttr()[i].getNameNew(), (gameObject.getAttributeString(type.getAttr()[i].getNameOld()).equals(trueVal))); } } + break; + default: + assert false; + input = null; + break; + } newAttr.helpButton = new JButton("?"); newAttr.ref = type.getAttr()[i]; @@ -681,7 +693,9 @@ panel2.add(panel3, BorderLayout.WEST); ((BoolAttrib) newAttr).input = input; - } else if (dType == ArchAttribType.INT) { + } + break; + case INT: { // create an attribute line for INT panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -719,8 +733,10 @@ panel2.add(panel3, BorderLayout.EAST); panel2.add(panel4, BorderLayout.WEST); ((IntAttrib) newAttr).input = input; - } else if (dType == ArchAttribType.STRING || - dType == ArchAttribType.FLOAT) { + } + break; + case STRING: + case FLOAT: { // create an attribute line for STRING panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -728,12 +744,19 @@ final JLabel label = new JLabel(type.getAttr()[i].getNameNew() + ": "); - if (dType == ArchAttribType.STRING) { + switch (dType) { + case STRING: newAttr = new StringAttrib(); label.setForeground(Color.black); - } else { + break; + case FLOAT: newAttr = new FloatAttrib(); label.setForeground(IGUIConstants.FLOAT_COLOR); + break; + default: + assert false; + newAttr = null; + break; } panel3.add(label); // add label @@ -778,14 +801,22 @@ panel2.add(panel3, BorderLayout.EAST); panel2.add(panel4, BorderLayout.WEST); - if (dType == ArchAttribType.STRING) { + switch (dType) { + case STRING: ((StringAttrib) newAttr).input = input; - } else { + break; + case FLOAT: ((FloatAttrib) newAttr).input = input; + break; + default: + assert false; + break; } - } else if (dType == ArchAttribType.SPELL || - dType == ArchAttribType.ZSPELL || - dType == ArchAttribType.LIST) { + } + break; + case SPELL: + case ZSPELL: + case LIST: { // create an attribute line for a combo box entry panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -800,9 +831,12 @@ // create ComboBox with parsed selection final JComboBox input; - if (dType == ArchAttribType.SPELL || dType == ArchAttribType.ZSPELL) { + switch (dType) { + case SPELL: + case ZSPELL: input = buildSpellBox(type.getAttr()[i]); - } else if (dType == ArchAttribType.LIST) { + break; + case LIST: if (type.getAttr()[i].getMisc() != null && typelist.getListTable().containsKey((String) (type.getAttr()[i].getMisc()[0]))) { // build the list from vector data input = buildArrayBox(type.getAttr()[i], (Vector) (typelist.getListTable().get((String) (type.getAttr()[i].getMisc()[0])))); @@ -812,8 +846,10 @@ panel3.add(Box.createHorizontalStrut(50)); input = null; // XXX: is later added to panel3 } - } else { + break; + default: input = null; // XXX: is later added to panel3 + break; } panel3.add(input); // add spellbox @@ -827,7 +863,9 @@ panel2.add(panel3, BorderLayout.EAST); panel2.add(panel4, BorderLayout.WEST); ((ListAttrib) newAttr).input = input; - } else if (dType == ArchAttribType.BITMASK) { + } + break; + case BITMASK: { // create an attribute entry for a bitmask panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -858,7 +896,9 @@ panel2.add(panel3, BorderLayout.EAST); panel2.add(panel4, BorderLayout.WEST); //((BitmaskAttrib)newAttr).input = input; - } else if (dType == ArchAttribType.TREASURE) { + } + break; + case TREASURE: { // create an attribute entry for a treasurelist panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -894,9 +934,13 @@ panel2.add(panel4, BorderLayout.WEST); ((StringAttrib) newAttr).input = input; - } else { + } + break; + default: { newAttr = null; } + break; + } if (newAttr != null) { if (newAttr.helpButton != null) { @@ -1064,20 +1108,23 @@ // now loop through all attributes and write out nonzero ones for (DialogAttrib attr = attrHead; attr != null; attr = attr.next) { - if (attr.ref.getDataType() == ArchAttribType.BOOL || - attr.ref.getDataType() == ArchAttribType.BOOL_SPEC) { + switch (attr.ref.getDataType()) { + case BOOL: + case BOOL_SPEC: { final boolean value = ((BoolAttrib) attr).input.isSelected(); // true/false if (value) { doc.insertString(doc.getLength(), "<" + attr.ref.getNameNew() + ">\n", docStyle); } } - if (attr.ref.getDataType() == ArchAttribType.INT) { + break; + case INT: { final String value = ((IntAttrib) attr).input.getText(); // the attrib value if (value != null && value.length() > 0 && !value.equals("0")) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } - if (attr.ref.getDataType() == ArchAttribType.FLOAT) { + break; + case FLOAT: { final String value = ((FloatAttrib) attr).input.getText(); // the attrib value if (value != null && value.length() > 0) { try { @@ -1090,32 +1137,38 @@ } } } - if (attr.ref.getDataType() == ArchAttribType.STRING) { + break; + case STRING: { final String value = ((StringAttrib) attr).input.getText(); // the attrib value if (value != null && value.length() > 0) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } - if (attr.ref.getDataType() == ArchAttribType.SPELL || - attr.ref.getDataType() == ArchAttribType.ZSPELL || - attr.ref.getDataType() == ArchAttribType.LIST) { + break; + case SPELL: + case ZSPELL: + case LIST: { final String value = ((ListAttrib) attr).input.getSelectedItem().toString().trim(); // the attrib value if (value != null && value.length() > 0 && !value.startsWith("<")) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } - if (attr.ref.getDataType() == ArchAttribType.BITMASK) { + break; + case BITMASK: { final String value = ((BitmaskAttrib) attr).text.getText().trim(); if (value != null && value.length() > 0 && !value.startsWith("<")) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } - if (attr.ref.getDataType() == ArchAttribType.TREASURE) { + break; + case TREASURE: { final String value = ((StringAttrib) attr).input.getText().trim(); // the attrib value if (value != null && value.length() > 0 && !value.equals(CFTreasureListTree.NONE_SYM)) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } + break; + } } } catch (final BadLocationException e) { log.error("toggleSummary: Bad Location in Document!", e); @@ -1158,13 +1211,16 @@ for (DialogAttrib attr = attrHead; attr != null; attr = attr.next) { final ArchAttribType dType = attr.ref.getDataType(); - if (dType == ArchAttribType.BOOL) { + switch (dType) { + case BOOL: { // a boolean attribute (flag) if (((BoolAttrib) attr).input.isSelected() != (archetype.getAttributeInt(attr.ref.getNameOld()) == 1)) { newArchText = newArchText + attr.ref.getNameOld() + " " + (((BoolAttrib) attr).input.isSelected() ? 1 : 0) + "\n"; } - } else if (dType == ArchAttribType.BOOL_SPEC) { + } + break; + case BOOL_SPEC: { // a boolean attribute with customized true/false values final String valString; // value-string to apply if (((BoolAttrib) attr).input.isSelected()) { @@ -1176,8 +1232,10 @@ if ((valString.equals("0") && !(archetype.getAttributeString(attr.ref.getNameOld()).length() == 0)) || (!valString.equals("0") && !archetype.getAttributeString(attr.ref.getNameOld()).equals(valString))) { newArchText = newArchText + attr.ref.getNameOld() + " " + valString + "\n"; } - } else if (dType == ArchAttribType.INT || - dType == ArchAttribType.FLOAT) { + } + break; + case INT: + case FLOAT: { // an int attribute if (dType == ArchAttribType.INT && ((IntAttrib) attr).input.getText().trim().length() == 0) { if (archetype.getAttributeInt(attr.ref.getNameOld()) != 0) { @@ -1215,7 +1273,9 @@ throw new GridderException(""); // bail out } } - } else if (dType == ArchAttribType.STRING) { + } + break; + case STRING: { // a String attribute final String inline = ((StringAttrib) attr).input.getText().trim(); @@ -1246,22 +1306,35 @@ } } } - } else if (dType == ArchAttribType.TEXT) { + } + break; + case TEXT: { // a String attribute if (attr.ref.getNameOld().equalsIgnoreCase("msg") && ((TextAttrib) attr).input.getText().trim().length() > 0) { newMsg = ((TextAttrib) attr).input.getText().trim(); } - } else if (dType == ArchAttribType.SPELL || dType == ArchAttribType.ZSPELL || - dType == ArchAttribType.LIST) { + } + break; + case SPELL: + case ZSPELL: + case LIST: { // get attribute value that should go into the gameObject final int attrVal; // attribute value - if (dType == ArchAttribType.SPELL || dType == ArchAttribType.ZSPELL) { + switch (dType) { + case SPELL: + case ZSPELL: attrVal = typelist.getSpellNum()[((ListAttrib) attr).input.getSelectedIndex()]; - } else { + break; + case LIST: // get selected index of ComboBox final int attrValTmp = ((ListAttrib) attr).input.getSelectedIndex(); // fetch value according to this list entry: attrVal = (Integer) ((Vector) (typelist.getListTable().get(attr.ref.getMisc()[0]))).elementAt(2 * attrValTmp); + break; + default: + assert false; + attrVal = 0; + break; } if (attrVal == -1 || (attrVal == 0 && dType != ArchAttribType.SPELL @@ -1274,14 +1347,18 @@ } else if (archetype.getAttributeInt(attr.ref.getNameOld()) != attrVal) { newArchText = newArchText + attr.ref.getNameOld() + " " + attrVal + "\n"; } - } else if (dType == ArchAttribType.BITMASK) { + } + break; + case BITMASK: { // a bitmask attribute (similar to integer, but easier because no parsing needed) final int value = ((BitmaskAttrib) attr).getValue(); // get bitmask value if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + " " + value + "\n"; } - } else if (dType == ArchAttribType.TREASURE) { + } + break; + case TREASURE: { // a treasurelist attribute final String inline = ((StringAttrib) attr).input.getText().trim(); // input string @@ -1306,6 +1383,8 @@ } } } + break; + } } // Also write all the 'fixed' attributes into the archtext Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-21 19:17:35 UTC (rev 566) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-21 20:05:35 UTC (rev 567) @@ -25,21 +25,10 @@ package daieditor; import daieditor.gameobject.ArchAttribType; -import static daieditor.gameobject.ArchAttribType.ANIMNAME; import static daieditor.gameobject.ArchAttribType.BITMASK; -import static daieditor.gameobject.ArchAttribType.BOOL; -import static daieditor.gameobject.ArchAttribType.BOOL_SPEC; -import static daieditor.gameobject.ArchAttribType.DBLLIST; -import static daieditor.gameobject.ArchAttribType.FACENAME; import static daieditor.gameobject.ArchAttribType.FIXED; import static daieditor.gameobject.ArchAttribType.FLOAT; -import static daieditor.gameobject.ArchAttribType.INT; -import static daieditor.gameobject.ArchAttribType.LIST; -import static daieditor.gameobject.ArchAttribType.LONG; import static daieditor.gameobject.ArchAttribType.SPELL; -import static daieditor.gameobject.ArchAttribType.STRING; -import static daieditor.gameobject.ArchAttribType.TEXT; -import static daieditor.gameobject.ArchAttribType.TREASURE; import static daieditor.gameobject.ArchAttribType.ZSPELL; import daieditor.gameobject.GameObject; import daieditor.gameobject.NamedObject; @@ -613,11 +602,12 @@ case BOOL_SPEC: { newAttr = new DialogAttrib<JCheckBox>(attrib); final JCheckBox input; - if (dType == BOOL) { + switch (dType) { + case BOOL: // normal bool input = new JCheckBox(attrib.getNameNew(), gameObject.getAttributeInt(nameOld, true) == 1); - } else { - assert dType == BOOL_SPEC; + break; + case BOOL_SPEC: { // parse values for customized bool final String trueVal = attrib.getMisc()[0]; if ("0".equals(trueVal)) { @@ -627,6 +617,12 @@ input = new JCheckBox(attrib.getNameNew(), gameObject.getAttributeString(nameOld, true).equals(trueVal)); } } + break; + default: + assert false; + input = null; + break; + } ((DialogAttrib<JCheckBox>) newAttr).input = input; cRow = input; } @@ -639,11 +635,19 @@ newAttr = new DialogAttrib<JFormattedTextField>(attrib); final int fieldLength = attrib.getInputLength() == 0 ? TEXTFIELD_COLUMNS : attrib.getInputLength(); final NumberFormat format; - if (dType == FLOAT) { + switch (dType) { + case INT: + case LONG: + format = NumberFormat.getIntegerInstance(); + break; + case FLOAT: format = NumberFormat.getInstance(); format.setMaximumFractionDigits(10); - } else { - format = NumberFormat.getIntegerInstance(); + break; + default: + assert false; + format = null; + break; } format.setGroupingUsed(false); final NumberFormatter formatter = new NumberFormatter(format); @@ -693,18 +697,31 @@ dtxt = gameObject.getAttributeString(nameOld, true); } final JTextField input = new JTextField(dtxt, TEXTFIELD_COLUMNS); - if (dType == STRING) { + switch (dType) { + case STRING: cLabel = new JLabel(attrib.getNameNew() + ": "); newAttr = new DialogAttrib<JTextField>(attrib); - } else { - assert dType == FACENAME || dType == ANIMNAME; + break; + case FACENAME: + case ANIMNAME: newAttr = new DialogAttrib<JTextField>(attrib); - if (dType == FACENAME) { + switch (dType) { + case FACENAME: cLabel = new JButton(new TreeChooseAction(attrib.getNameNew() + ": ", input, mainControl.getFaceObjects())); - } else { - assert dType == ANIMNAME; + break; + case ANIMNAME: cLabel = new JButton(new TreeChooseAction(attrib.getNameNew() + ": ", input, mainControl.getAnimationObjects())); + break; + default: + assert false; + cLabel = null; + break; } + break; + default: + assert false; + newAttr = null; + break; } cComp = input; ((DialogAttrib<JTextField>) newAttr).input = input; @@ -718,9 +735,12 @@ newAttr = new DialogAttrib<JComboBox>(attrib); // create ComboBox with parsed selection final JComboBox input; - if (dType == SPELL || dType == ZSPELL) { + switch (dType) { + case SPELL: + case ZSPELL: input = buildSpellBox(attrib); - } else if (dType == LIST) { + break; + case LIST: if (attrib.getMisc() != null && typelist.getListTable().containsKey(attrib.getMisc()[0])) { // build the list from vector data input = buildArrayBox(attrib, typelist.getListTable().get(attrib.getMisc()[0])); @@ -729,8 +749,11 @@ cComp = new JLabel("Error: Undefined List"); input = null; } - } else { + break; + default: + assert false; input = null; + break; } if (input != null) { cComp = input; @@ -1050,13 +1073,15 @@ for (final DialogAttrib attr : dialogAttribs) { final ArchAttribType dType = attr.ref.getDataType(); - // TODO: switch case - if (dType == BOOL) { + switch (dType) { + case BOOL: { // a boolean attribute (flag) if (((DialogAttrib<JCheckBox>) attr).input.isSelected() != (archetype.getAttributeInt(attr.ref.getNameOld()) == 1)) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + (((DialogAttrib<JCheckBox>) attr).input.isSelected() ? 1 : 0) + '\n'; } - } else if (dType == BOOL_SPEC) { + } + break; + case BOOL_SPEC: { // a boolean attribute with customized true/false values final String valString; // value-string to apply if (((DialogAttrib<JCheckBox>) attr).input.isSelected()) { @@ -1069,7 +1094,11 @@ { newArchText = newArchText + attr.ref.getNameOld() + ' ' + valString + '\n'; } - } else if (dType == INT || dType == LONG || dType == FLOAT) { + } + break; + case INT: + case LONG: + case FLOAT: { // an int attribute if ("0".equals(((DialogAttrib<JFormattedTextField>) attr).input.getText())) { if (archetype.getAttributeDouble(attr.ref.getNameOld()) != 0) { @@ -1077,29 +1106,43 @@ } } else { try { - if (dType == INT) { + switch (dType) { + case INT: { final int value = ((Number) ((DialogAttrib<JFormattedTextField>) attr).input.getValue()).intValue(); if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + value + '\n'; } - } else if (dType == LONG) { + } + break; + case LONG: { final long value = ((Number) ((DialogAttrib<JFormattedTextField>) attr).input.getValue()).longValue(); if (archetype.getAttributeLong(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + value + '\n'; } - } else { + } + break; + case FLOAT: { final double value = ((Number) ((DialogAttrib<JFormattedTextField>) attr).input.getValue()).doubleValue(); if (archetype.getAttributeDouble(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + value + '\n'; } } + break; + default: + assert false; + break; + } } catch (final NumberFormatException e) { // parsing failed: wrong entry!! showMessageDialog(this, "Attribute '" + attr.ref.getNameNew() + "' must be a number!", "Input Error", ERROR_MESSAGE); return false; } } - } else if (dType == STRING || dType == FACENAME || dType == ANIMNAME) { + } + break; + case STRING: + case FACENAME: + case ANIMNAME: { // a String attribute final String inline = ((DialogAttrib<JTextField>) attr).input.getText().trim(); @@ -1139,21 +1182,35 @@ } } } - } else if (dType == TEXT) { + } + break; + case TEXT: { // a String attribute if ("msg".equalsIgnoreCase(attr.ref.getNameOld()) && ((DialogAttrib<JTextArea>) attr).input.getText().trim().length() > 0) { newMsg = ((DialogAttrib<JTextArea>) attr).input.getText().trim(); } - } else if (dType == SPELL || dType == ZSPELL || dType == LIST) { + } + break; + case SPELL: + case ZSPELL: + case LIST: { // get attribute value that should go into the gameObject final int attrVal; // attribute value - if (dType == SPELL || dType == ZSPELL) { + switch (dType) { + case SPELL: + case ZSPELL: attrVal = CFArchTypeList.getSpells().getSpellNumbers()[((DialogAttrib<JComboBox>) attr).input.getSelectedIndex()]; - } else { + break; + case LIST: // get selected index of ComboBox final int attrValTmp = ((JComboBox) attr.input).getSelectedIndex(); // fetch value according to this list entry: attrVal = (Integer) typelist.getListTable().get(attr.ref.getMisc()[0]).get(2 * attrValTmp); + break; + default: + assert false; + attrVal = 0; + break; } if (attrVal == -1 || attrVal == 0 && dType != SPELL && dType != ZSPELL) { @@ -1165,7 +1222,9 @@ } else if (archetype.getAttributeInt(attr.ref.getNameOld()) != attrVal) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + attrVal + '\n'; } - } else if (dType == DBLLIST) { + } + break; + case DBLLIST: { final int val1 = (Integer) typelist.getListTable().get(attr.ref.getMisc()[0]).get(2 * ((JComboBox[]) attr.input)[0].getSelectedIndex()); final int val2 = (Integer) typelist.getListTable().get(attr.ref.getMisc()[1]).get(2 * ((JComboBox[]) attr.input)[1].getSelectedIndex()); @@ -1174,14 +1233,18 @@ if (archetype.getAttributeInt(attr.ref.getNameOld()) != combinedVal) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + combinedVal + '\n'; } - } else if (dType == BITMASK) { + } + break; + case BITMASK: { // a bitmask attribute (similar to integer, but easier because no parsing needed) final int value = ((BitmaskAttrib) attr).getValue(); // get bitmask value if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + value + '\n'; } - } else if (dType == TREASURE) { + } + break; + case TREASURE: { // a treasurelist attribute final String inline = ((JTextComponent) attr.input).getText().trim(); // input string @@ -1206,6 +1269,8 @@ } } } + break; + } } // Also write all the 'fixed' attributes into the archtext This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-22 12:04:50
|
Revision: 569 http://svn.sourceforge.net/gridarta/?rev=569&view=rev Author: christianhujer Date: 2006-10-22 05:04:44 -0700 (Sun, 22 Oct 2006) Log Message: ----------- Added metrics directory with stylesheet for processing IntelliJ IDEA metrics files to XHTML 1.1. Added Paths: ----------- trunk/metrics/ trunk/metrics/metrics2html.xslt Added: trunk/metrics/metrics2html.xslt =================================================================== (Binary files differ) Property changes on: trunk/metrics/metrics2html.xslt ___________________________________________________________________ Name: svn:mime-type + application/xslt+xml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |