You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <aki...@us...> - 2006-10-28 14:22:35
|
Revision: 585 http://svn.sourceforge.net/gridarta/?rev=585&view=rev Author: akirschbaum Date: 2006-10-28 07:22:27 -0700 (Sat, 28 Oct 2006) Log Message: ----------- Unify logging statements. Modified Paths: -------------- trunk/daimonin/src/daieditor/CFTreasureListTree.java Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-10-28 14:17:23 UTC (rev 584) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-10-28 14:22:27 UTC (rev 585) @@ -66,6 +66,7 @@ import net.sf.gridarta.help.Help; import net.sf.gridarta.io.IOUtils; import net.sf.japi.util.EnumerationIterator; +import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; /** @@ -75,6 +76,8 @@ */ public final class CFTreasureListTree extends JTree { + private static final Logger log = Logger.getLogger(CFTreasureListTree.class); + /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -282,10 +285,12 @@ needSecondLink = null; if (errorLog.toString().trim().length() > 0) { - System.err.println("Syntax errors in treasurelist file:"); - System.err.print(errorLog.toString()); + log.warn("Syntax errors in treasurelist file:"); + log.warn(errorLog.toString()); } - System.err.println(tListCount + " treasurelists loaded."); + if (log.isInfoEnabled()) { + log.info(tListCount + " treasurelists loaded."); + } // free unused memory specialTreasureLists = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-28 14:17:26
|
Revision: 584 http://svn.sourceforge.net/gridarta/?rev=584&view=rev Author: akirschbaum Date: 2006-10-28 07:17:23 -0700 (Sat, 28 Oct 2006) Log Message: ----------- Unify logging statements. Modified Paths: -------------- trunk/daimonin/src/daieditor/CFArchTypeList.java Modified: trunk/daimonin/src/daieditor/CFArchTypeList.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchTypeList.java 2006-10-28 14:08:50 UTC (rev 583) +++ trunk/daimonin/src/daieditor/CFArchTypeList.java 2006-10-28 14:17:23 UTC (rev 584) @@ -43,6 +43,7 @@ import net.sf.japi.swing.JSAXErrorHandler; import net.sf.japi.xml.NodeListIterator; import static net.sf.japi.xml.NodeListIterator.getFirstChild; +import org.apache.log4j.Logger; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -56,6 +57,8 @@ */ public final class CFArchTypeList implements Iterable<CFArchType> { + private static final Logger log = Logger.getLogger(CFArchTypeList.class); + /** * Map with arch object matchers and their IDs. * @todo turn static field into instance field @@ -124,7 +127,7 @@ // read GameObjectMatchers. FIXME: this is not the best place to do this. readArchObjectMatchers(); } catch (final ParserConfigurationException e) { - System.err.println("Cannot create XML parser:\n" + e.getMessage()); + log.error("Cannot create XML parser: " + e.getMessage()); } ignoreListTable = null; // this was only needed during load phase } @@ -163,28 +166,26 @@ parseDefaultType(root); parseTypes(root); - System.err.println("Loaded " + archTypeList.size() + " types from '" + IGUIConstants.TYPEDEF_FILE + '\''); + if (log.isInfoEnabled()) { + log.info("Loaded " + archTypeList.size() + " types from '" + IGUIConstants.TYPEDEF_FILE + '\''); + } } catch (final SAXException e) { - System.err.println("Parsing error in '" + IGUIConstants.TYPEDEF_FILE + "':\n" + e.getMessage() + '\n'); + log.error("Parsing error in '" + IGUIConstants.TYPEDEF_FILE + "':\n" + e.getMessage()); } catch (final IOException e) { - System.err.println("Cannot read file '" + IGUIConstants.TYPEDEF_FILE + "'!"); + log.error("Cannot read file '" + IGUIConstants.TYPEDEF_FILE + "'!"); } catch (final XPathExpressionException e) { - System.err.println("XPath error: " + e); + log.error("XPath error: " + e.getMessage()); } } private void parseBitmasks(final Element root) throws XPathExpressionException { - //System.err.println("parsing bitmasks from " + root); for (final Element elem : new NodeListIterator<Element>(xpath, root, "bitmask|bitmasks/bitmask")) { - //System.err.println("Parsing bitmask: " + elem.getAttribute("name")); bitmaskTable.put(elem.getAttribute("name"), new CAttribBitmask(xpath, elem)); } } private void parseLists(final Element root) throws XPathExpressionException { - //System.err.println("parsing lists from " + root); for (final Element elem : new NodeListIterator<Element>(xpath, root, "list|lists/list")) { - //System.err.println("Parsing list: " + elem.getAttribute("name")); if (elem.getAttribute("name") == null) { throw new RuntimeException("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load list element without 'name'."); } else { @@ -216,9 +217,7 @@ } private void parseIgnoreLists(final Element root) throws XPathExpressionException { - //System.err.println("parsing ignorelists from " + root); for (final Element elem : new NodeListIterator<Element>(xpath, root, "ignore_list|ignorelists/ignore_list")) { - //System.err.println("Parsing ignorelist: " + elem.getAttribute("name")); if (elem.getAttribute("name") == null) { throw new RuntimeException("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load ignore_list element without 'name'."); } else { @@ -280,7 +279,9 @@ archObjectMatchersByIds.put(archObjectMatcher.getID(), archObjectMatcher); } } - System.err.println("Loaded " + archObjectMatchers.size() + " GameObjectMatchers from 'GameObjectMatchers.xml'."); + if (log.isInfoEnabled()) { + log.info("Loaded " + archObjectMatchers.size() + " GameObjectMatchers from 'GameObjectMatchers.xml'."); + } // TODO: Do something with archObjectMatchers } catch (final SAXException e) { e.printStackTrace(); //TODO @@ -382,7 +383,9 @@ final int numArgs = (int) (tmp.getTypeAttr().length / 2.0); boolean match = true; - //System.err.println("# type: "+tmp.getTypeName()); + if (log.isDebugEnabled()) { + log.debug("# type: " + tmp.getTypeName()); + } for (int t = 0, l = numArgs << 1; t < l && match; t += 2) { final String archvalue = arch.getAttributeString(tmp.getTypeAttr()[t], true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-28 14:08:58
|
Revision: 583 http://svn.sourceforge.net/gridarta/?rev=583&view=rev Author: akirschbaum Date: 2006-10-28 07:08:50 -0700 (Sat, 28 Oct 2006) Log Message: ----------- Unify logging statements. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFArchType.java trunk/daimonin/src/daieditor/CFArchType.java Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-10-28 14:00:13 UTC (rev 582) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-10-28 14:08:50 UTC (rev 583) @@ -136,7 +136,9 @@ typenr = -1; typeName = "default"; - log.debug("type: default"); + if (log.isDebugEnabled()) { + log.debug("type: default"); + } } else { try { // parse the type name Modified: trunk/daimonin/src/daieditor/CFArchType.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchType.java 2006-10-28 14:00:13 UTC (rev 582) +++ trunk/daimonin/src/daieditor/CFArchType.java 2006-10-28 14:08:50 UTC (rev 583) @@ -32,6 +32,7 @@ import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.xml.NodeListIterator; import static net.sf.japi.xml.NodeListIterator.getFirstChild; +import org.apache.log4j.Logger; import org.w3c.dom.Attr; import org.w3c.dom.Element; import static org.w3c.dom.Node.ELEMENT_NODE; @@ -45,6 +46,8 @@ */ public final class CFArchType { + private static final Logger log = Logger.getLogger(CFArchType.class); + /** Attribute Element Name. */ public static final String XML_ATTRIBUTE = "attribute"; @@ -123,7 +126,9 @@ typenr = -1; typeName = "default"; - //System.err.println("type: default"); + if (log.isDebugEnabled()) { + log.debug("type: default"); + } } else { try { // parse the type name @@ -132,7 +137,9 @@ // parse the type number typenr = Integer.parseInt(root.getAttribute("number").trim()); - //System.err.println("reading type: "+typeName+", "+typenr); + if (log.isDebugEnabled()) { + log.debug("reading type: " + typeName + ", " + typenr); + } // parse 'required' attributes final Element required = getFirstChild(root, XML_REQUIRED); @@ -314,13 +321,17 @@ // first put in the references to the default attribs: for (int k = numDef; k > 0; k--) { attr[numDef - k] = defList[numDef - k]; - //System.err.println("*** ("+(numDef-k)+") "+attr[numDef-k].getNameNew()); + if (log.isDebugEnabled()) { + log.debug("*** (" + (numDef - k) + ") " + attr[numDef - k].getNameNew()); + } } // next put in the references of imported arches (at end of array) for (int k = 0; k < importNum; k++) { attr[j - importNum + k] = importList[k]; - //System.err.println("*** ("+(j-importNum + k)+") "+attr[j-importNum + k].getNameNew()); + if (log.isDebugEnabled()) { + log.debug("*** (" + (j - importNum + k) + ") " + attr[j - importNum + k].getNameNew()); + } } } else { attr = new CFArchAttrib[j]; // create array of appropriate size @@ -374,10 +385,10 @@ attrib.setSection(1, "Special"); } - /* - final Attr a = elem.getAttribute("arch"); - System.err.println("attribute "+(a==null? "null" : a.getValue())+", section "+attrib.getSecId()+" = '"+attrib.getSecName()+"'"); - */ + if (log.isDebugEnabled()) { + final Attr a = elem.getAttributeNode("arch"); + log.debug("attribute " + (a == null ? "null" : a.getValue()) + ", section " + attrib.getSecId() + " = '" + attrib.getSecName() + "'"); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-28 14:00:22
|
Revision: 582 http://svn.sourceforge.net/gridarta/?rev=582&view=rev Author: akirschbaum Date: 2006-10-28 07:00:13 -0700 (Sat, 28 Oct 2006) Log Message: ----------- Unify logging statements. Modified Paths: -------------- trunk/daimonin/src/daieditor/CFArchAttrib.java Modified: trunk/daimonin/src/daieditor/CFArchAttrib.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-10-28 13:51:39 UTC (rev 581) +++ trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-10-28 14:00:13 UTC (rev 582) @@ -41,6 +41,7 @@ import static daieditor.gameobject.ArchAttribType.TEXT; import static daieditor.gameobject.ArchAttribType.TREASURE; import static daieditor.gameobject.ArchAttribType.ZSPELL; +import org.apache.log4j.Logger; import org.w3c.dom.Attr; import org.w3c.dom.Element; @@ -50,6 +51,8 @@ */ public final class CFArchAttrib implements Cloneable { + private static final Logger log = Logger.getLogger(CFArchAttrib.class); + // XML tag names public static final String XML_KEY_ARCH = "arch"; @@ -125,7 +128,7 @@ atype = a1.getValue().trim(); } else { // error: no type - System.err.println("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has attribute missing '" + XML_ATTR_TYPE + "'."); + log.error("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has attribute missing '" + XML_ATTR_TYPE + "'."); return false; } @@ -134,7 +137,7 @@ try { inputLength = Integer.parseInt(a1.getValue()); } catch (final NumberFormatException de) { - System.err.println("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has attribute with invalid length '" + a1.getValue() + "' (must be a number)."); + log.error("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has attribute with invalid length '" + a1.getValue() + "' (must be a number)."); } } @@ -149,7 +152,7 @@ a1 = root.getAttributeNode("true"); final Attr a2 = root.getAttributeNode("false"); if (a1 == null || a2 == null) { - System.err.println("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has bool_special attribute missing 'true' or 'false' value."); + log.error("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has bool_special attribute missing 'true' or 'false' value."); return false; } else { misc = new String[2]; // 'misc' string contains the values @@ -181,7 +184,7 @@ if (nameOld == null || nameOld.length() == 0 || endingOld == null || endingOld.length() == 0) { - System.err.println("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has text attribute missing '" + XML_KEY_ARCH_BEGIN + "' or '" + XML_KEY_ARCH_END + "'."); + log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has text attribute missing '" + XML_KEY_ARCH_BEGIN + "' or '" + XML_KEY_ARCH_END + "'."); return false; } } else if ("fixed".equalsIgnoreCase(atype)) { @@ -190,7 +193,7 @@ if ((a1 = root.getAttributeNode("value")) != null) { nameNew = a1.getValue().trim(); } else { - System.err.println("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has fixed attribute missing 'value'."); + log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has fixed attribute missing 'value'."); return false; } } else if ("spell".equalsIgnoreCase(atype)) { @@ -217,22 +220,21 @@ misc = new String[1]; misc[0] = bitmaskName; // store bitmask name in misc[0] } else { - System.err.println("In '" + IGUIConstants.TYPEDEF_FILE + "', type " + typeName + ": Bitmask \"" + bitmaskName + "\" is undefined."); + log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "', type " + typeName + ": Bitmask \"" + bitmaskName + "\" is undefined."); } } else if (atype.startsWith("list")) { // got a bitmask attribute final String listName = atype.substring(5).trim(); - //System.err.println("Looking for list " + listName); if (tlist.getListTable().containsKey(listName)) { // the list is well defined dataType = LIST; misc = new String[1]; misc[0] = listName; // store list name in misc[0] } else { - System.err.println("In '" + IGUIConstants.TYPEDEF_FILE + "', type " + typeName + ": List \"" + listName + "\" is undefined."); - System.err.println("Size of tlist: " + tlist.getListTable().size()); + log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "', type " + typeName + ": List \"" + listName + "\" is undefined."); + log.error("Size of tlist: " + tlist.getListTable().size()); for (final String key : tlist.getListTable().keySet()) { - System.err.println(key); + log.error(key); } } } else if (atype.startsWith("doublelist")) { @@ -241,7 +243,7 @@ final int seppos = listNames.indexOf(','); if (seppos == -1 || seppos == listNames.length() - 1) { - System.err.println("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + ", double list: '" + atype + "' does not contain two comma-separated lists."); + log.error("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + ", double list: '" + atype + "' does not contain two comma-separated lists."); return false; } @@ -256,13 +258,13 @@ misc[0] = listName1; // store list name in misc[0] misc[1] = listName2; // store list name in misc[1] } else { - System.err.println("In '" + IGUIConstants.TYPEDEF_FILE + "', type " + typeName + ": List \"" + listName1 + "\" or \"" + listName2 + "\" is undefined."); + log.error("In '" + IGUIConstants.TYPEDEF_FILE + "', type " + typeName + ": List \"" + listName1 + "\" or \"" + listName2 + "\" is undefined."); } } else if ("treasurelist".equalsIgnoreCase(atype)) { dataType = TREASURE; } else { // unknown type - System.err.println("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has an attribute with unknown type: '" + atype + "'."); + log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has an attribute with unknown type: '" + atype + "'."); return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-28 13:51:44
|
Revision: 581 http://svn.sourceforge.net/gridarta/?rev=581&view=rev Author: akirschbaum Date: 2006-10-28 06:51:39 -0700 (Sat, 28 Oct 2006) Log Message: ----------- Unify logging statements. Modified Paths: -------------- trunk/daimonin/src/daieditor/CAttribBitmask.java Modified: trunk/daimonin/src/daieditor/CAttribBitmask.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribBitmask.java 2006-10-28 13:47:59 UTC (rev 580) +++ trunk/daimonin/src/daieditor/CAttribBitmask.java 2006-10-28 13:51:39 UTC (rev 581) @@ -35,6 +35,7 @@ import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpressionException; import net.sf.japi.xml.NodeListIterator; +import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; import org.w3c.dom.Element; @@ -47,6 +48,8 @@ */ public final class CAttribBitmask { + private static final Logger log = Logger.getLogger(CAttribBitmask.class); + /** * Maximum number of characters in a line before linebreak (see {@link * #getText(int)}). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-28 13:48:06
|
Revision: 580 http://svn.sourceforge.net/gridarta/?rev=580&view=rev Author: akirschbaum Date: 2006-10-28 06:47:59 -0700 (Sat, 28 Oct 2006) Log Message: ----------- Unify logging statements. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CArchPanelPan.java trunk/daimonin/src/daieditor/CArchPanelPan.java Modified: trunk/crossfire/src/cfeditor/CArchPanelPan.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-10-28 13:41:44 UTC (rev 579) +++ trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-10-28 13:47:59 UTC (rev 580) @@ -44,7 +44,7 @@ public final class CArchPanelPan extends JPanel { - private static final Logger log = Logger.getLogger(CArchPanel.class); + private static final Logger log = Logger.getLogger(CArchPanelPan.class); /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -197,7 +197,6 @@ for (int i = 0; i < (int) (list.length() / 50.0); i++) { numList[i] = list.substring(50 * i, 45 + 50 * i).trim(); - //log.debug(CMainControl.getInstance().getArchObjectStack().getArch(numList[i]).getArchetypeName()); } return numList; Modified: trunk/daimonin/src/daieditor/CArchPanelPan.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-10-28 13:41:44 UTC (rev 579) +++ trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-10-28 13:47:59 UTC (rev 580) @@ -47,11 +47,14 @@ import javax.swing.event.ListSelectionListener; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; +import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; public final class CArchPanelPan extends JPanel { + private static final Logger log = Logger.getLogger(CArchPanelPan.class); + /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -215,7 +218,7 @@ final int index = p.getIndex(); catList[i++] = jbox.getItemAt(index).toString().trim(); } catch (final NullPointerException e) { - System.err.println("Nullpointer in getListCategoryArray()!"); + log.warn("Nullpointer in getListCategoryArray()!", e); } } return catList; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-28 13:41:51
|
Revision: 579 http://svn.sourceforge.net/gridarta/?rev=579&view=rev Author: akirschbaum Date: 2006-10-28 06:41:44 -0700 (Sat, 28 Oct 2006) Log Message: ----------- Unify logging statements. Modified Paths: -------------- trunk/daimonin/src/daieditor/CAttribDialog.java Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-28 13:34:21 UTC (rev 578) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-28 13:41:44 UTC (rev 579) @@ -99,6 +99,7 @@ import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import static net.sf.japi.util.Arrays2.linearSearch; +import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; /** @@ -109,6 +110,8 @@ */ public final class CAttribDialog extends JOptionPane implements FocusListener { + private static final Logger log = Logger.getLogger(CAttribDialog.class); + /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -227,18 +230,26 @@ final int numArgs = (int) (tmp.getTypeAttr().length / 2.0); boolean match = true; - //System.err.println("# type: "+tmp.getTypeName()); + if (log.isDebugEnabled()) { + log.debug("# type: " + tmp.getTypeName()); + } 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]+"'"); + if (log.isDebugEnabled()) { + log.debug(" arch: '" + attrValue + "', type: '" + tmp.getTypeAttr()[t + 1] + "'"); + } if (!attrValue.equals(tmp.getTypeAttr()[t + 1]) && !("0".equals(tmp.getTypeAttr()[t + 1]) && attrValue.length() == 0)) { match = false; - // //System.err.println("-> attr: " + tmp.getTypeAttr()[t] + " NO match"); - //} else { - // //System.err.println("-> attr: " + tmp.getTypeAttr()[t] + " YES match"); + if (log.isDebugEnabled()) { + log.debug("-> attr: " + tmp.getTypeAttr()[t] + " NO match"); + } + } else { + if (log.isDebugEnabled()) { + log.debug("-> attr: " + tmp.getTypeAttr()[t] + " YES match"); + } } } @@ -1040,7 +1051,7 @@ } } } catch (final BadLocationException e) { - System.err.println("toggleSummary: Bad Location in Document!"); + log.error("toggleSummary: Bad Location in Document!", e); } summaryTP.setCaretPosition(0); // this prevents the document from scrolling down This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-24 20:26:41
|
Revision: 577 http://svn.sourceforge.net/gridarta/?rev=577&view=rev Author: christianhujer Date: 2006-10-24 13:26:18 -0700 (Tue, 24 Oct 2006) Log Message: ----------- Moved unique MapArchObject feature from Gridarta to Crossfire (and thus effectively removed it from Daimonin). Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/MapArchObject.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java trunk/src/app/net/sf/gridarta/map/MapArchObject.java Modified: trunk/crossfire/src/cfeditor/map/MapArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-10-23 21:39:16 UTC (rev 576) +++ trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-10-24 20:26:18 UTC (rev 577) @@ -52,6 +52,9 @@ private final StringBuffer loreText = new StringBuffer(""); // lore text buffer + /** If set, this entire map is unique. */ + private boolean unique; + /** If set, this entire map is a template map. */ private boolean template; @@ -135,6 +138,22 @@ setMapSize(mapSize); } + /** + * Get whether this map is unique. + * @return whether this map is unique + */ + public boolean isUnique() { + return unique; + } + + /** + * Set whether this map is unique. + * @param unique whether this map should be unique + */ + public void setUnique(final boolean unique) { + this.unique = unique; + } + public boolean isTemplate() { return template; } Modified: trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-10-23 21:39:16 UTC (rev 576) +++ trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-10-24 20:26:18 UTC (rev 577) @@ -89,8 +89,6 @@ private final JFormattedTextField levelHeightField = new JFormattedTextField(); // len y - private final JCheckBox checkboxUnique = new JCheckBox(); // map unique - private final JCheckBox checkboxOutdoor = new JCheckBox(); // map outdoor private final JFormattedTextField fieldEnterX = new JFormattedTextField(); // enter x @@ -304,7 +302,6 @@ gbc.weightx = 1.0; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.NONE; - p2.add(createPanelCBox(checkboxUnique, map.isUnique(), "mapUnique"), gbc); p2.add(createPanelCBox(checkboxOutdoor, map.isOutdoor(), "mapOutdoor"), gbc); gbc.gridwidth = GridBagConstraints.REMAINDER; p2.add(createPanelCBox(fixedReset, map.isFixedReset(), "mapFixedReset"), gbc); @@ -452,7 +449,6 @@ mapArch.setDifficulty(difficulty); mapArch.setFixedReset(fixedReset.isSelected()); mapArch.setDarkness(darkness); - mapArch.setUnique(checkboxUnique.isSelected()); mapArch.setOutdoor(checkboxOutdoor.isSelected()); // these flags are for daimonin only @@ -508,7 +504,6 @@ fieldDarkness.setText(Integer.toString(map.getDarkness())); fieldDifficulty.setText(Integer.toString(map.getDifficulty())); - checkboxUnique.setSelected(map.isUnique()); checkboxOutdoor.setSelected(map.isOutdoor()); fixedReset.setSelected(map.isFixedReset()); Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-10-23 21:39:16 UTC (rev 576) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-10-24 20:26:18 UTC (rev 577) @@ -310,10 +310,6 @@ if (getLineValue(line) != 0) { setFixedReset(true); } - } else if (line.startsWith("unique ")) { - if (getLineValue(line) != 0) { - setUnique(true); - } } else if (line.startsWith("outdoor ")) { if (getLineValue(line) != 0) { outdoor = true; @@ -449,9 +445,6 @@ if (isFixedReset()) { stream.append("fixed_resettime 1\n"); } - if (isUnique()) { - stream.append("unique 1\n"); - } if (outdoor) { stream.append("outdoor 1\n"); } Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2006-10-23 21:39:16 UTC (rev 576) +++ trunk/daimonin/src/daieditor/messages.properties 2006-10-24 20:26:18 UTC (rev 577) @@ -181,7 +181,6 @@ mapSound=Background sound mapWidth=Width mapHeight=Height -mapUnique=Unique mapOutdoor=Outdoor mapFixedReset=Fixed Reset mapOptions=Options Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2006-10-23 21:39:16 UTC (rev 576) +++ trunk/daimonin/src/daieditor/messages_de.properties 2006-10-24 20:26:18 UTC (rev 577) @@ -38,7 +38,6 @@ mapName=Name mapWidth=Breite mapHeight=H\xF6he -mapUnique=Unique mapOutdoor=Im Freien mapFixedReset=Fixer Reset mapOptions=Optionen Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2006-10-23 21:39:16 UTC (rev 576) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2006-10-24 20:26:18 UTC (rev 577) @@ -173,7 +173,6 @@ mapSound=Bakgrundsljud mapWidth=Bredd mapHeight=H\xF6jd -mapUnique=Unik mapOutdoor=Utomhus mapFixedReset=Fixerad \xE5terst\xE4llning mapOptions=Inst\xE4llningar Modified: trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java 2006-10-23 21:39:16 UTC (rev 576) +++ trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java 2006-10-24 20:26:18 UTC (rev 577) @@ -49,9 +49,6 @@ */ private int darkness; - /** If set, this entire map is unique. */ - private boolean unique; - /** * Create an AbstractMapArchObject. */ @@ -158,14 +155,4 @@ this.darkness = darkness; } - /** {@inheritDoc} */ - public boolean isUnique() { - return unique; - } - - /** {@inheritDoc} */ - public void setUnique(final boolean unique) { - this.unique = unique; - } - } // class AbstractMapArchObject Modified: trunk/src/app/net/sf/gridarta/map/MapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapArchObject.java 2006-10-23 21:39:16 UTC (rev 576) +++ trunk/src/app/net/sf/gridarta/map/MapArchObject.java 2006-10-24 20:26:18 UTC (rev 577) @@ -150,16 +150,4 @@ */ void setDarkness(int darkness); - /** - * Get whether this map is unique. - * @return whether this map is unique - */ - boolean isUnique(); - - /** - * Set whether this map is unique. - * @param unique whether this map should be unique - */ - void setUnique(boolean unique); - } // interface MapArchObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-23 21:39:22
|
Revision: 576 http://svn.sourceforge.net/gridarta/?rev=576&view=rev Author: christianhujer Date: 2006-10-23 14:39:16 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Removed unused ISO-rendering cursor selection grid. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-10-23 21:14:14 UTC (rev 575) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-10-23 21:39:16 UTC (rev 576) @@ -101,8 +101,6 @@ private boolean showMapGrid; // this is needed to check the diamond tile areas and convert rectangles to diamond - private final String[] gridMapMask = new String[23]; - private final Point mapMousePos = new Point(); private final Point mapMouseRightPos = new Point(); // coordinates of selected tile on the map @@ -151,30 +149,6 @@ mapMousePosOff.x = -1; mapMousePosOff.y = -1; - gridMapMask[0] = "000000000000000000000011112222222222222222222222"; - gridMapMask[1] = "000000000000000000001111111122222222222222222222"; - gridMapMask[2] = "000000000000000000111111111111222222222222222222"; - gridMapMask[3] = "000000000000000011111111111111112222222222222222"; - gridMapMask[4] = "000000000000001111111111111111111122222222222222"; - gridMapMask[5] = "000000000000111111111111111111111111222222222222"; - gridMapMask[6] = "000000000011111111111111111111111111112222222222"; - gridMapMask[7] = "000000001111111111111111111111111111111122222222"; - gridMapMask[8] = "000000111111111111111111111111111111111111222222"; - gridMapMask[9] = "000011111111111111111111111111111111111111112222"; - gridMapMask[10] = "001111111111111111111111111111111111111111111122"; - gridMapMask[11] = "111111111111111111111111111111111111111111111111"; - gridMapMask[12] = "331111111111111111111111111111111111111111111144"; - gridMapMask[13] = "333311111111111111111111111111111111111111114444"; - gridMapMask[14] = "333333111111111111111111111111111111111111444444"; - gridMapMask[15] = "333333331111111111111111111111111111111144444444"; - gridMapMask[16] = "333333333311111111111111111111111111114444444444"; - gridMapMask[17] = "333333333333111111111111111111111111444444444444"; - gridMapMask[18] = "333333333333331111111111111111111144444444444444"; - gridMapMask[19] = "333333333333333311111111111111114444444444444444"; - gridMapMask[20] = "333333333333333333111111111111444444444444444444"; - gridMapMask[21] = "333333333333333333331111111144444444444444444444"; - gridMapMask[22] = "333333333333333333333311114444444444444444444444"; - if (isPickmap()) { setBackground(IGUIConstants.BG_COLOR); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-23 21:14:21
|
Revision: 575 http://svn.sourceforge.net/gridarta/?rev=575&view=rev Author: christianhujer Date: 2006-10-23 14:14:14 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Removed unused fields. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-10-23 21:04:12 UTC (rev 574) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-10-23 21:14:14 UTC (rev 575) @@ -103,8 +103,6 @@ // this is needed to check the diamond tile areas and convert rectangles to diamond private final String[] gridMapMask = new String[23]; - private final int[][] gridMapOffset = {{-1, 0}, {0, 0}, {0, -1}, {0, +1}, {+1, 0},}; - private final Point mapMousePos = new Point(); private final Point mapMouseRightPos = new Point(); // coordinates of selected tile on the map @@ -120,8 +118,6 @@ // to be updated when mousebutton is released private int drawInternCount; - private int drawInternDrag; - // interface for the mapview frame private final MapView frame; @@ -145,7 +141,6 @@ needMpanelUpdate[0] = false; needMpanelUpdate[1] = false; needMpanelUpdate[2] = false; - drawInternDrag = -1; drawInternCount = 0; mapMousePos.x = -1; mapMousePos.y = -1; @@ -1171,7 +1166,6 @@ final int xstart, ystart, xp, yp, xt, yt; changedFlagNotify(); - drawInternDrag = drawInternCount; Point[] needRedraw = null; // array of tile coords which need to be redrawn final Point dragPoint = event.getPoint(); // Mouse pointer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-23 21:04:23
|
Revision: 574 http://svn.sourceforge.net/gridarta/?rev=574&view=rev Author: christianhujer Date: 2006-10-23 14:04:12 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Changed CMapViewBasic to use SUN ImageIO for saving the PNG. VisualTek is not needed any longer - removed. Modified Paths: -------------- trunk/crossfire/build.xml trunk/crossfire/src/cfeditor/CMapViewBasic.java Removed Paths: ------------- trunk/crossfire/lib/visualtek.jar Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2006-10-23 20:55:10 UTC (rev 573) +++ trunk/crossfire/build.xml 2006-10-23 21:04:12 UTC (rev 574) @@ -87,8 +87,6 @@ <!-- create JAR file --> <target name="jar" depends="compile" description="compiles source and creates jar."> <!-- extract classes from jar files into the build dir --> - <!--unjar src="${lib.dir}/png.jar" dest="${build.dir}" /--> - <unjar src="${lib.dir}/visualtek.jar" dest="${build.dir}" /> <unjar src="${lib.dir}/jdom.jar" dest="${build.dir}" /> <unjar src="${lib.dir}/crimson.jar" dest="${build.dir}" /> <unjar src="${lib.dir}/bsh-core.jar" dest="${build.dir}" /> Deleted: trunk/crossfire/lib/visualtek.jar =================================================================== (Binary files differ) Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-10-23 20:55:10 UTC (rev 573) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-10-23 21:04:12 UTC (rev 574) @@ -29,8 +29,6 @@ import cfeditor.gameobject.GameObject; import cfeditor.map.MapControl; import cfeditor.map.MapModel; -import com.visualtek.png.PNGEncoder; -import com.visualtek.png.PNGException; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; @@ -45,15 +43,17 @@ import java.awt.geom.AffineTransform; import java.awt.geom.NoninvertibleTransformException; import java.awt.image.BufferedImage; +import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.Vector; +import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.JScrollPane; import javax.swing.JViewport; -import net.sf.gridarta.Size2D; import net.sf.gridarta.EditOperation; +import net.sf.gridarta.Size2D; import net.sf.gridarta.gui.MapView; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -347,14 +347,7 @@ * @param filename the file to write to */ public void printFullImage(final String filename) throws IOException { - try { - // create instance of PNGencoder: - final PNGEncoder pngEnc = new PNGEncoder(renderer.getFullImage(), filename); - pngEnc.encode(); // encode image -> create file - } catch (PNGException e) { - mapControl.showMessage("Png Error", "The image could not be created."); - log.error("png error in printFullImage(" + filename + ")", e); - } + ImageIO.write(renderer.getFullImage(), "png", new File(filename)); } /** Refreshes the data in the view from the model. */ @@ -551,7 +544,7 @@ void updateLookAndFeel(); - Image getFullImage(); + BufferedImage getFullImage(); void paintTile(int x, int y); @@ -651,7 +644,7 @@ } /** @return an image of the entire mapview */ - public Image getFullImage() { + public BufferedImage getFullImage() { final int storeOffset; // tmp. storage to save map offset final Size2D mapSize = getMapControl().getMapSize(); @@ -659,7 +652,7 @@ final int mapHeight = 32 * mapSize.getHeight(); // first create a storing place for the image - final Image bufImage = new BufferedImage(mapWidth, mapHeight, BufferedImage.TYPE_INT_ARGB); + final BufferedImage bufImage = new BufferedImage(mapWidth, mapHeight, BufferedImage.TYPE_INT_ARGB); final Graphics bufGrfx = bufImage.getGraphics(); bufGrfx.setColor(Color.white); bufGrfx.setColor(Color.white); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-23 20:55:18
|
Revision: 573 http://svn.sourceforge.net/gridarta/?rev=573&view=rev Author: christianhujer Date: 2006-10-23 13:55:10 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Removed unused png.jar. Modified Paths: -------------- trunk/crossfire/build.xml Removed Paths: ------------- trunk/crossfire/lib/png.jar Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2006-10-23 20:52:51 UTC (rev 572) +++ trunk/crossfire/build.xml 2006-10-23 20:55:10 UTC (rev 573) @@ -87,7 +87,7 @@ <!-- create JAR file --> <target name="jar" depends="compile" description="compiles source and creates jar."> <!-- extract classes from jar files into the build dir --> - <unjar src="${lib.dir}/png.jar" dest="${build.dir}" /> + <!--unjar src="${lib.dir}/png.jar" dest="${build.dir}" /--> <unjar src="${lib.dir}/visualtek.jar" dest="${build.dir}" /> <unjar src="${lib.dir}/jdom.jar" dest="${build.dir}" /> <unjar src="${lib.dir}/crimson.jar" dest="${build.dir}" /> Deleted: trunk/crossfire/lib/png.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-23 20:52:55
|
Revision: 572 http://svn.sourceforge.net/gridarta/?rev=572&view=rev Author: christianhujer Date: 2006-10-23 13:52:51 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Replaced sixlegs loader with SUN's. Fixed bug in loading: result of read() was ignored. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2006-10-23 19:47:59 UTC (rev 571) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2006-10-23 20:52:51 UTC (rev 572) @@ -24,10 +24,7 @@ package cfeditor.gameobject.face; -import com.sixlegs.image.png.PngImage; -import java.awt.Toolkit; -import java.io.ByteArrayInputStream; -import java.io.InputStream; +import java.io.DataInputStream; import java.lang.ref.Reference; import java.lang.ref.SoftReference; import javax.swing.ImageIcon; @@ -98,16 +95,14 @@ if (log.isDebugEnabled()) { log.debug("Lazy loading " + name); } - final InputStream fi = IOUtils.createStream(ressourceDirectory, ressourceName); + final DataInputStream fi = new DataInputStream(IOUtils.createStream(ressourceDirectory, ressourceName)); try { if (dataStartIndex > 0) { fi.skip(dataStartIndex); // FIXME: result of skip is ignored. } final byte[] data = new byte[dataSize]; - fi.read(data); // FIXME: result of read is ignored. - final PngImage png = new PngImage(new ByteArrayInputStream(data)); // read png data from bytestream - png.setFlushAfterNextProduction(true); - final ImageIcon im = new ImageIcon(Toolkit.getDefaultToolkit().createImage(png)); + fi.readFully(data); + final ImageIcon im = new ImageIcon(data); setFace(im); return im; } finally { @@ -158,4 +153,5 @@ public void setIndex(final int i) { index = i; } -} + +} // class FaceObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-23 19:48:12
|
Revision: 571 http://svn.sourceforge.net/gridarta/?rev=571&view=rev Author: christianhujer Date: 2006-10-23 12:47:59 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Moved FaceObject to a package of its own (for unification). Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java Added Paths: ----------- trunk/crossfire/src/cfeditor/gameobject/face/ trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/FaceObject.java Deleted: trunk/crossfire/src/cfeditor/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/FaceObject.java 2006-10-22 13:16:29 UTC (rev 570) +++ trunk/crossfire/src/cfeditor/FaceObject.java 2006-10-23 19:47:59 UTC (rev 571) @@ -1,161 +0,0 @@ -/* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package cfeditor; - -import com.sixlegs.image.png.PngImage; -import java.awt.Toolkit; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.lang.ref.Reference; -import java.lang.ref.SoftReference; -import javax.swing.ImageIcon; -import net.sf.gridarta.io.IOUtils; -import org.apache.log4j.Logger; -import org.jetbrains.annotations.Nullable; - -/** - * The <code>FaceObject</code> - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - */ -public final class FaceObject { - - private static final Logger log = Logger.getLogger(FaceObject.class); - - //private ImageIcon face; - private Object face; - - private String name = new String(""); // name of face - - private String path; - - private int index; - - private int dataSize; - - private long dataStartIndex; - - private String ressourceName; - - private String ressourceDirectory; - - private boolean isLazyLoading = false; - - public FaceObject() { - face = null; - index = -1; - } - - /** FaceObject with informations on how to localize ressource (lazy loading) */ - public FaceObject(final String directory, final String ressource, final long position, final int size) { - ressourceDirectory = directory; - ressourceName = ressource; - dataStartIndex = position; - dataSize = size; - isLazyLoading = true; - } - - public ImageIcon getFace() { - if (isLazyLoading) { - return loadFace(); - } else { - return (ImageIcon) face; - } - } - - @Nullable private synchronized ImageIcon loadFace() { - if (log.isDebugEnabled()) { - log.debug("Getting soft reference to " + name); - } - if (face != null) { - final ImageIcon icon = ((Reference<ImageIcon>) face).get(); - if (icon != null) { - return icon; - } - } - try { - if (log.isDebugEnabled()) { - log.debug("Lazy loading " + name); - } - final InputStream fi = IOUtils.createStream(ressourceDirectory, ressourceName); - try { - if (dataStartIndex > 0) { - fi.skip(dataStartIndex); // FIXME: result of skip is ignored. - } - final byte[] data = new byte[dataSize]; - fi.read(data); // FIXME: result of read is ignored. - final PngImage png = new PngImage(new ByteArrayInputStream(data)); // read png data from bytestream - png.setFlushAfterNextProduction(true); - final ImageIcon im = new ImageIcon(Toolkit.getDefaultToolkit().createImage(png)); - setFace(im); - return im; - } finally { - fi.close(); - } - } catch (final Exception e) { - log.warn("Problem lazy loading face " + name, e); - return null; - } - } - - /* - public void setFace(final Image im) { - face = new ImageIcon(); - face.setImage(im); - im = null; - } - */ - - public void setFace(final ImageIcon im) { - if (isLazyLoading) { - face = new SoftReference<ImageIcon>(im); - } else { - face = im; - } - } - - public String getPath() { - return path; - } - - public void setPath(final String text) { - path = text; - } - - public String getName() { - return name; - } - - public void setName(final String text) { - name = new String(text); - } - - public int getIndex() { - return index; - } - - public void setIndex(final int i) { - index = i; - } -} Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-10-22 13:16:29 UTC (rev 570) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-10-23 19:47:59 UTC (rev 571) @@ -31,7 +31,7 @@ import cfeditor.CMainStatusbar; import cfeditor.CPickmapPanel; import cfeditor.CSettings; -import cfeditor.FaceObject; +import cfeditor.gameobject.face.FaceObject; import cfeditor.IGUIConstants; import java.awt.Color; import java.awt.GridLayout; Copied: trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java (from rev 570, trunk/crossfire/src/cfeditor/FaceObject.java) =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java (rev 0) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2006-10-23 19:47:59 UTC (rev 571) @@ -0,0 +1,161 @@ +/* + * Crossfire Java Editor. + * Copyright (C) 2000 Michael Toennies + * Copyright (C) 2001 Andreas Vogl + * + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package cfeditor.gameobject.face; + +import com.sixlegs.image.png.PngImage; +import java.awt.Toolkit; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.lang.ref.Reference; +import java.lang.ref.SoftReference; +import javax.swing.ImageIcon; +import net.sf.gridarta.io.IOUtils; +import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; + +/** + * The <code>FaceObject</code> + * @author <a href="mailto:mic...@no...">Michael Toennies</a> + */ +public final class FaceObject { + + private static final Logger log = Logger.getLogger(FaceObject.class); + + //private ImageIcon face; + private Object face; + + private String name = new String(""); // name of face + + private String path; + + private int index; + + private int dataSize; + + private long dataStartIndex; + + private String ressourceName; + + private String ressourceDirectory; + + private boolean isLazyLoading = false; + + public FaceObject() { + face = null; + index = -1; + } + + /** FaceObject with informations on how to localize ressource (lazy loading) */ + public FaceObject(final String directory, final String ressource, final long position, final int size) { + ressourceDirectory = directory; + ressourceName = ressource; + dataStartIndex = position; + dataSize = size; + isLazyLoading = true; + } + + public ImageIcon getFace() { + if (isLazyLoading) { + return loadFace(); + } else { + return (ImageIcon) face; + } + } + + @Nullable private synchronized ImageIcon loadFace() { + if (log.isDebugEnabled()) { + log.debug("Getting soft reference to " + name); + } + if (face != null) { + final ImageIcon icon = ((Reference<ImageIcon>) face).get(); + if (icon != null) { + return icon; + } + } + try { + if (log.isDebugEnabled()) { + log.debug("Lazy loading " + name); + } + final InputStream fi = IOUtils.createStream(ressourceDirectory, ressourceName); + try { + if (dataStartIndex > 0) { + fi.skip(dataStartIndex); // FIXME: result of skip is ignored. + } + final byte[] data = new byte[dataSize]; + fi.read(data); // FIXME: result of read is ignored. + final PngImage png = new PngImage(new ByteArrayInputStream(data)); // read png data from bytestream + png.setFlushAfterNextProduction(true); + final ImageIcon im = new ImageIcon(Toolkit.getDefaultToolkit().createImage(png)); + setFace(im); + return im; + } finally { + fi.close(); + } + } catch (final Exception e) { + log.warn("Problem lazy loading face " + name, e); + return null; + } + } + + /* + public void setFace(final Image im) { + face = new ImageIcon(); + face.setImage(im); + im = null; + } + */ + + public void setFace(final ImageIcon im) { + if (isLazyLoading) { + face = new SoftReference<ImageIcon>(im); + } else { + face = im; + } + } + + public String getPath() { + return path; + } + + public void setPath(final String text) { + path = text; + } + + public String getName() { + return name; + } + + public void setName(final String text) { + name = new String(text); + } + + public int getIndex() { + return index; + } + + public void setIndex(final int i) { + index = i; + } +} Property changes on: trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.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-22 13:16:37
|
Revision: 570 http://svn.sourceforge.net/gridarta/?rev=570&view=rev Author: christianhujer Date: 2006-10-22 06:16:29 -0700 (Sun, 22 Oct 2006) Log Message: ----------- Changed mimetype so diff is possible, minor transform improvements. Modified Paths: -------------- trunk/metrics/metrics2html.xslt Property Changed: ---------------- trunk/metrics/metrics2html.xslt Modified: trunk/metrics/metrics2html.xslt =================================================================== (Binary files differ) Property changes on: trunk/metrics/metrics2html.xslt ___________________________________________________________________ Name: svn:mime-type - application/xslt+xml + text/xslt+xml 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. |
From: <chr...@us...> - 2006-10-22 00:22:08
|
Revision: 568 http://svn.sourceforge.net/gridarta/?rev=568&view=rev Author: christianhujer Date: 2006-10-21 17:22:03 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Clarified comment. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 20:05:35 UTC (rev 567) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-22 00:22:03 UTC (rev 568) @@ -115,7 +115,7 @@ * supplied <var>reader</var> with a BufferedReader if the supplied reader * isn't already a BufferedReader itself. * @param reader Reader to load animations from - * @param path Path relative to the arch directory + * @param path Path relative to the arch directory, used to create tree information * @throws IOException in case of I/O errors * @throws AnimationParseException in case parsing the animation reveals errors * @throws DuplicateAnimationException in case an animation was not unique @@ -127,7 +127,6 @@ String animName = null; final StringBuilder animText = new StringBuilder(); String line; - //noinspection ForLoopThatDoesntUseLoopVariable int lineNumber; for (lineNumber = 1; (line = in.readLine()) != null; lineNumber++) { if (line.startsWith("#")) { 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-21 19:17:43
|
Revision: 566 http://svn.sourceforge.net/gridarta/?rev=566&view=rev Author: christianhujer Date: 2006-10-21 12:17:35 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Fixed bug. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 17:47:27 UTC (rev 565) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 19:17:35 UTC (rev 566) @@ -152,7 +152,7 @@ animText.append(line).append('\n'); } } - if (!inAnim) { + if (inAnim) { throw new AnimationParseException("mina", null, lineNumber); } } 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: <chr...@us...> - 2006-10-21 16:41:40
|
Revision: 564 http://svn.sourceforge.net/gridarta/?rev=564&view=rev Author: christianhujer Date: 2006-10-21 09:41:32 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Added Ohloh link to homepage. Modified Paths: -------------- trunk/src/doc/start.xhtml Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2006-10-21 16:30:37 UTC (rev 563) +++ trunk/src/doc/start.xhtml 2006-10-21 16:41:32 UTC (rev 564) @@ -57,6 +57,7 @@ <li><a href="http://sourceforge.net/projects/gridarta/">Gridarta SourceForge Project Page</a> (Forum, Bug Tracker, Feature Request Tracker, Web access to the SVN repository and more)</li> <li><a href="http://freshmeat.net/projects/gridarta/">Gridarta FreshMeat Project Page</a></li> <li><a href="http://cia.navi.cx/stats/project/gridarta">Gridarta CIA project page</a></li> + <li><a href="http://ohloh.net/projects/3284">Gridarta Ohloh project page</a></li> </ul> </body> </html> 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 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: <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 14:34:40
|
Revision: 560 http://svn.sourceforge.net/gridarta/?rev=560&view=rev Author: christianhujer Date: 2006-10-21 07:34:35 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Improved error behaviour. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 14:26:58 UTC (rev 559) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 14:34:35 UTC (rev 560) @@ -48,6 +48,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ +@SuppressWarnings({"HardcodedFileSeparator"}) public final class AnimationObjects extends NamedObjects<AnimationObject> implements net.sf.gridarta.gameobject.anim.AnimationObjects<AnimationObject> { /** @@ -127,7 +128,8 @@ final StringBuilder animText = new StringBuilder(); String line; //noinspection ForLoopThatDoesntUseLoopVariable - for (int lineNumber = 1; (line = in.readLine()) != null; lineNumber++) { + int lineNumber; + for (lineNumber = 1; (line = in.readLine()) != null; lineNumber++) { if (line.startsWith("#")) { /* ignore comment lines. */ } else if (line.startsWith("anim ")) { @@ -150,7 +152,9 @@ animText.append(line).append('\n'); } } - assert !inAnim; + if (!inAnim) { + throw new AnimationParseException("mina", null, lineNumber); + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |