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-09-30 10:39:23
|
Revision: 434 http://svn.sourceforge.net/gridarta/?rev=434&view=rev Author: akirschbaum Date: 2006-09-30 03:39:11 -0700 (Sat, 30 Sep 2006) Log Message: ----------- Unify GameObject instantiation. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/gameobject/ArchObjectParser.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-09-29 22:23:07 UTC (rev 433) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-09-30 10:39:11 UTC (rev 434) @@ -278,7 +278,7 @@ final GameObject invnew; if (arch.isArchetype()) { // create a new copy of a default arch - invnew = mainControl.getArchObjectStack().newArchObjectInstance(arch.getArchetypeName()); + invnew = arch.createArch(); } else { // create clone from a pickmap invnew = arch.createClone(inv.getMapX(), inv.getMapY()); Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-09-29 22:23:07 UTC (rev 433) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-09-30 10:39:11 UTC (rev 434) @@ -362,19 +362,14 @@ } else { newHead = arch.createClone(pos.x, pos.y); for (GameObject tmp = arch.getArchetype().getMultiNext(); tmp != null; tmp = tmp.getMultiNext()) { - final GameObject newTail = mainControl.getArchObjectStack().newArchObjectInstance(tmp.getArchetypeName()); + final Point mapPos = new Point(pos.x + tmp.getMultiX(), pos.y + tmp.getMultiY()); - final Point mapPos = new Point(pos.x + newTail.getMultiX(), pos.y + newTail.getMultiY()); - if (!mapControl.isPointValid(mapPos)) { // outside map return; } - newTail.setMultiX(tmp.getMultiX()); - newTail.setMultiY(tmp.getMultiY()); - newTail.setMapX(mapPos.x); - newTail.setMapY(mapPos.y); + final GameObject newTail = tmp.createClone(mapPos.x, mapPos.y); newHead.addTailPart(newTail); } Modified: trunk/crossfire/src/cfeditor/gameobject/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchObjectParser.java 2006-09-29 22:23:07 UTC (rev 433) +++ trunk/crossfire/src/cfeditor/gameobject/ArchObjectParser.java 2006-09-30 10:39:11 UTC (rev 434) @@ -567,9 +567,8 @@ // do insertion for all non-head parts of the multi for (GameObject oldPart = defarch.getMultiNext(); oldPart != null; oldPart = oldPart.getMultiNext()) { - final GameObject newarch = mainControl.getArchObjectStack().newArchObjectInstance(oldPart.getArchetypeName()); + final GameObject newarch = oldPart.createArch(); - assert newarch != null; arch.addTailPart(newarch); objects.add(newarch); Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-09-29 22:23:07 UTC (rev 433) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-09-30 10:39:11 UTC (rev 434) @@ -175,38 +175,13 @@ * @return default GameObject for <var>archname</var> or <code>null</code> * if no such GameObject exists * - * @see #newArchObjectInstance(String) for a similar method that instantiates. + * @see GameObject#createArch() for a similar method that instantiates. */ @Nullable public GameObject getArch(final String archname) { return arches.get(archname); } /** - * Create a GameObject for the specified archetype name. - * - * @param archname the archetype name - * - * @return GameObject instantiated from the specified archetype - */ - @Nullable public GameObject newArchObjectInstance(final String archname) { - final GameObject template = getArch(archname); - if (template == null) { - return null; - } - - final GameObject arch = new GameObject(); - arch.setArchetypeName(template.getArchetypeName()); - if (!template.getFaceFlag()) { - arch.setFaceNr(template.getFaceNr()); - } - - arch.setArchetypeName(template.getArchetypeName()); - arch.setMultiX(template.getMultiX()); - arch.setMultiY(template.getMultiY()); - return arch; - } - - /** * Adds an GameObject to the stack. * Only invoke this method if the GameObject is an Archetype. * Do not invoke this method on map arches. Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-09-29 22:23:07 UTC (rev 433) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-09-30 10:39:11 UTC (rev 434) @@ -1447,6 +1447,26 @@ } } + /** + * Create a new GameObject from this Archetype. + * If this GameObject is not an Archetype, this method recursively forwards to its Archetype. + * @return new GameObject + */ + public GameObject createArch() { + if (!isArchetype()) { + return archetype.createArch(); + } + final GameObject arch = new GameObject(); + arch.setArchetypeName(archetypeName); + arch.setArchetype(this); + if (!getFaceFlag()) { + arch.setFaceNr(getFaceNr()); + } + arch.setMultiX(multiX); + arch.setMultiY(multiY); + return arch; + } + private void setCachedAttributeValue(final String name, final String value) { cachedAttribute.put(name, value); } Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-29 22:23:07 UTC (rev 433) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-30 10:39:11 UTC (rev 434) @@ -488,7 +488,7 @@ GameObject newHead = null; for (GameObject oldPart = newarch; oldPart != null; oldPart = oldPart.getMultiNext()) { - final GameObject newPart = mainControl.getArchObjectStack().newArchObjectInstance(oldPart.getArchetypeName()); + final GameObject newPart = oldPart.createArch(); if (oldPart == newarch) { newHead = newPart; } else { @@ -602,7 +602,7 @@ archname = newarch.getArchetypeName(); } // create a new copy of a default arch - invnew = mainControl.getArchObjectStack().newArchObjectInstance(archname); + invnew = getDefaultArch(archname).createArch(); } else { // create clone from a pickmap if (!newarch.isMulti()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-29 22:23:39
|
Revision: 433 http://svn.sourceforge.net/gridarta/?rev=433&view=rev Author: akirschbaum Date: 2006-09-29 15:23:07 -0700 (Fri, 29 Sep 2006) Log Message: ----------- Replace node number by archetype name for unique identification key of archetypes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/CArchPanel.java trunk/crossfire/src/cfeditor/CArchPanelPan.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/crossfire/src/cfeditor/gameobject/ArchObjectParser.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/map/MapModel.java trunk/crossfire/src/cfeditor/parameter/ArchParameter.java trunk/daimonin/src/daieditor/CArchPanelPan.java trunk/daimonin/src/daieditor/CMapArchPanel.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapModel.java Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2006-09-29 22:23:07 UTC (rev 433) @@ -44,7 +44,7 @@ private static final String filename = "autojoin.txt"; // file with autojoin lists - // bitmask constants for nodenr index + // bitmask constants for archnames index private static final int NORTH = 1; private static final int EAST = 2; @@ -61,13 +61,13 @@ //index: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 //means: 0, N, E, NE, S, NS, ES, NES, W, WN, WE, WNE, SW, SWN, ESW, NESW // (0 = no connection, N = north, E = east, S = south, W = west) - private int[] nodenr; + private String[] archnames; /** Konstructor */ public AutojoinList() { stack = null; // pointer to stack of default arches next = null; // pointer to next element - nodenr = null; // this array gets initialized in loadList (when needed) + archnames = null; // this array gets initialized in loadList (when needed) } /** @@ -88,7 +88,7 @@ try { String line; // line of file boolean sectionFlag = false; // true while section (start ... end) read - final int[] nbuf = new int[16]; // buffer for nodenumbers of 16 arches + final String[] nbuf = new String[16]; // buffer for archetype names of 16 arches int count = 0; // counter index AutojoinList jlist = this; // index of the linked list of AutojoinLists // (starting at 'this') @@ -120,12 +120,12 @@ } jlist.stack = archstack; // set link to arch stack - jlist.nodenr = new int[16]; // array to store the nodenrs. + jlist.archnames = new String[16]; // array to store the archetype names for (int i = 0; i < 16; i++) { - jlist.nodenr[i] = nbuf[i]; // store nodenr. in the list + jlist.archnames[i] = nbuf[i]; // store archetype name in the list archstack.getArch(nbuf[i]).setJoinList(jlist); // set the link in the def. arch if (log.isDebugEnabled()) { - log.debug("(" + i + ") arch: '" + archstack.getArch(nbuf[i]).getArchetypeName() + "' -> nr: (" + nbuf[i] + ")"); + log.debug("(" + i + ") arch: '" + archstack.getArch(nbuf[i]).getArchetypeName() + "' -> (" + nbuf[i] + ")"); } } @@ -139,12 +139,11 @@ } else if (count < 16) { // add a new archid to the buffer - // try to parse the arch node_nr from the hashtable - final int entry = ArchetypeSet.getArchetypeIndex(line); - if (entry != -1) { - nbuf[count] = entry; + final GameObject arch = archstack.getArch(line); + if (arch != null) { + nbuf[count] = line; - if (!archstack.getArch(nbuf[count]).isMulti()) { + if (!arch.isMulti()) { count++; // no multipart, this one's okay } else { log.warn("In file " + filename + ": Arch '" + line + "' is a multipart."); @@ -181,21 +180,21 @@ /** * Do autojoining on insertion of a default arch on the map. * All arches around the insert point get adjusted, and the - * node_nr of the correct arch to be inserted is returned. + * archetype name of the correct arch to be inserted is returned. * This method must be called from the appropriate element of the * AutojoinList, best use the link from the default arch. * @param x Location of the insert point on the map * @param y Location of the insert point on the map * @param map Data model of the map - * @return node_nr of the (def.) arch to be inserted at x, y - * -1 if there's already an arch of this list on x, y + * @return the archetype name of the (default) arch to be inserted at x, y + * <code>null</code> if there's already an arch of this list on x, y */ - public int joinInsert(final MapModel map, final int x, final int y) { + public String joinInsert(final MapModel map, final int x, final int y) { int newIndex = 0; // return value, see above // if there already is an arch of this list at x, y -> abort if (findArchOfJoinlist(map, x, y) != null) { - return -1; // we don't want same arches over each other + return null; // we don't want same arches over each other } // now do the joining in all four directions: @@ -203,32 +202,32 @@ if (map.isPointValid(x, y - 1)) { if ((arch = findArchOfJoinlist(map, x, y - 1)) != null) { newIndex = addDir(newIndex, NORTH); - connectArch(arch, nodenr[addDir(getIndex(arch.getNodeNr()), SOUTH)]); + connectArch(arch, archnames[addDir(getIndex(arch.getArchetypeName()), SOUTH)]); } } if (map.isPointValid(x + 1, y)) { if ((arch = findArchOfJoinlist(map, x + 1, y)) != null) { newIndex = addDir(newIndex, EAST); - connectArch(arch, nodenr[addDir(getIndex(arch.getNodeNr()), WEST)]); + connectArch(arch, archnames[addDir(getIndex(arch.getArchetypeName()), WEST)]); } } if (map.isPointValid(x, y + 1)) { if ((arch = findArchOfJoinlist(map, x, y + 1)) != null) { newIndex = addDir(newIndex, SOUTH); - connectArch(arch, nodenr[addDir(getIndex(arch.getNodeNr()), NORTH)]); + connectArch(arch, archnames[addDir(getIndex(arch.getArchetypeName()), NORTH)]); } } if (map.isPointValid(x - 1, y)) { if ((arch = findArchOfJoinlist(map, x - 1, y)) != null) { newIndex = addDir(newIndex, WEST); - connectArch(arch, nodenr[addDir(getIndex(arch.getNodeNr()), EAST)]); + connectArch(arch, archnames[addDir(getIndex(arch.getArchetypeName()), EAST)]); } } - return nodenr[newIndex]; + return archnames[newIndex]; } /** @@ -246,47 +245,45 @@ // do the joining in all four directions: if (map.isPointValid(x, y - 1)) { if ((arch = findArchOfJoinlist(map, x, y - 1)) != null) { - connectArch(arch, nodenr[removeDir(getIndex(arch.getNodeNr()), SOUTH)]); + connectArch(arch, archnames[removeDir(getIndex(arch.getArchetypeName()), SOUTH)]); } } if (map.isPointValid(x + 1, y)) { if ((arch = findArchOfJoinlist(map, x + 1, y)) != null) { - connectArch(arch, nodenr[removeDir(getIndex(arch.getNodeNr()), WEST)]); + connectArch(arch, archnames[removeDir(getIndex(arch.getArchetypeName()), WEST)]); } } if (map.isPointValid(x, y + 1)) { if ((arch = findArchOfJoinlist(map, x, y + 1)) != null) { - connectArch(arch, nodenr[removeDir(getIndex(arch.getNodeNr()), NORTH)]); + connectArch(arch, archnames[removeDir(getIndex(arch.getArchetypeName()), NORTH)]); } } if (map.isPointValid(x - 1, y)) { if ((arch = findArchOfJoinlist(map, x - 1, y)) != null) { - connectArch(arch, nodenr[removeDir(getIndex(arch.getNodeNr()), EAST)]); + connectArch(arch, archnames[removeDir(getIndex(arch.getArchetypeName()), EAST)]); } } } /** - * Looking up the given node in the nodenr-array of this class. + * Looking up the given node in the archnames-array of this class. * @param node node to lookup * @return index of the node in the array. */ - private int getIndex(final int node) { + private int getIndex(final String archname) { int i; - for (i = 0; i < 16 && node != nodenr[i]; i++) { - ; + for (i = 0; i < 16; i++) { + if (archnames[i].equals(archname)) { + return i; + } } - if (node != nodenr[i]) { - log.warn("Error in AutojoinList.get_index: index not found"); - return 0; - } - - return i; + log.warn("Error in AutojoinList.get_index: index not found"); + return 0; } /** Checks if the index (=bitmask) contains the following direction */ @@ -316,7 +313,7 @@ GameObject tmpArch = map.getTopArchObject(x, y); // we look through the arches at the given location (top to bottom): for (; tmpArch != null; tmpArch = tmpArch.getPrev()) { - if (stack.getArch(tmpArch.getNodeNr()).getJoinList() == this) { + if (stack.getArch(tmpArch.getArchetypeName()).getJoinList() == this) { return tmpArch; // we found an arch } } @@ -328,13 +325,12 @@ * Add/remove a certain connection of the given arch * by changing archtype and face. */ - private void connectArch(final GameObject arch, final int newNodenr) { - final GameObject defarch = stack.getArch(newNodenr); // new default arch + private void connectArch(final GameObject arch, final String archname) { + final GameObject defarch = stack.getArch(archname); // new default arch - if (arch.getNodeNr() != newNodenr) { + if (!arch.getArchetypeName().equals(archname)) { // set new archtype - arch.setNodeNr(newNodenr); - arch.setArchetypeName(defarch.getArchetypeName()); + arch.setArchetypeName(archname); // set face of new default arch arch.setFaceNr(defarch.getFaceNr()); Modified: trunk/crossfire/src/cfeditor/CArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanel.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/CArchPanel.java 2006-09-29 22:23:07 UTC (rev 433) @@ -56,7 +56,7 @@ /** The "Import..." button. */ - private int selectedArch; + private String selectedArch; /** Panel holding both archlist and pickmaps. */ private final JTabbedPane archAndPickPane; @@ -85,7 +85,7 @@ public CArchPanel(final CMainControl mainControl) { this.mainControl = mainControl; final CSettings settings = CSettings.getInstance(IGUIConstants.APP_NAME); - selectedArch = -1; + selectedArch = null; setLayout(new BorderLayout()); tabDesktop = new JTabbedPane(SwingConstants.TOP); @@ -161,8 +161,8 @@ return selectedPanel.addArchPanelCombo(name); } - public void addArchPanelArch(final int archnr, final int index) { - selectedPanel.addArchPanelArch(archnr, index); + public void addArchPanelArch(final String archname, final int index) { + selectedPanel.addArchPanelArch(archname, index); } public void disableTabPane() { @@ -223,12 +223,12 @@ settings.setProperty(ARCHPANEL_LOCATION_KEY, String.valueOf(splitPane.getDividerLocation())); } - public int getPanelArch() { + public String getPanelArch() { return selectedArch; } - public void setPanelArch(final int arch) { - selectedArch = arch; + public void setPanelArch(final String archname) { + selectedArch = archname; } void refresh() { Modified: trunk/crossfire/src/cfeditor/CArchPanelPan.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-09-29 22:23:07 UTC (rev 433) @@ -125,8 +125,8 @@ int index = theList.getSelectedIndex(); if (index != -1) { - index = Integer.parseInt(theList.getSelectedValue().toString()); - arch = mainControl.getArchObjectStack().getArch(index); + final String archname = theList.getSelectedValue().toString(); + arch = mainControl.getArchObjectStack().getArch(archname); } return arch; } @@ -136,8 +136,8 @@ if (index != -1) { try { - index = Integer.parseInt(theList.getSelectedValue().toString()); - arch = mainControl.getArchObjectStack().getArch(index); + final String archname = theList.getSelectedValue().toString(); + arch = mainControl.getArchObjectStack().getArch(archname); } catch (final NullPointerException e) { /* log.info("NullPointerException in showArchListObject()!", e); @@ -153,17 +153,18 @@ /** * Add this arch to list of (this) Jlist list. - * @param archnr nr of the arch to add - * @param index index of subdir where to add + * @param archname name of the arch to add + * @param index index of subdir where to add */ - public void addArchPanelArch(final int archnr, final int index) { - final String def = "00000"; - String num = Integer.toString(archnr); + public void addArchPanelArch(final String archname, final int index) { + final String def = " "; + assert def.length() == 45; + assert archname.length() <= def.length(); - list.append(def.substring(0, 5 - num.length())); - list.append(num); + list.append(archname); + list.append(def.substring(0, 45 - archname.length())); - num = Integer.toString(index); + final String num = Integer.toString(index); list.append(def.substring(0, 5 - num.length())); list.append(num); @@ -194,11 +195,11 @@ * to know to which categories the arches belong to: * @return an array of nodenumbers from all arches in this panel */ - public int[] getListNodeNrArray() { - final int[] numList = new int[(int) (list.length() / 10.0)]; + public String[] getListArchNameArray() { + final String[] numList = new String[(int) (list.length() / 50.0)]; - for (int i = 0; i < (int) (list.length() / 10.0); i++) { - numList[i] = Integer.parseInt(list.substring(10 * i, 5 + 10 * i)); + 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()); } @@ -209,14 +210,14 @@ * this is only needed when arche collection is run, so we want * to know to which categories the arches belong to: * @return an array of the categories of all arches in this panel<br> - * note that the same indices are used for same arches in 'getListNodeNrArray()' + * note that the same indices are used for same arches in 'getListArchNameArray()' */ public String[] getListCategoryArray() { - final String[] catList = new String[(int) (list.length() / 10.0)]; + final String[] catList = new String[(int) (list.length() / 50.0)]; - for (int i = 0; i < (int) (list.length() / 10.0); i++) { + for (int i = 0; i < (int) (list.length() / 50.0); i++) { try { - final int index = Integer.parseInt(list.substring(5 + 10 * i, 10 + 10 * i)); + final int index = Integer.parseInt(list.substring(45 + 50 * i, 50 + 50 * i)); catList[i] = jbox.getItemAt(index).toString().trim(); } catch (final NullPointerException e) { log.warn("Nullpointer in getListCategoryArray()!", e); @@ -239,15 +240,15 @@ for (int i = 0; i < listcounter; i++) { if (index >= 0) { if (index == 0) { - // this.model.addElement(this.list.substring(offset, offset+5)+" I:"+this.list.substring(offset+5, offset+10)); - model.addElement(list.substring(offset, offset + 5)); + // this.model.addElement(this.list.substring(offset, offset+5)+" I:"+this.list.substring(offset+45, offset+50)); + model.addElement(list.substring(offset, offset + 45).trim()); } else { - if (index == Integer.parseInt(list.substring(offset + 5, offset + 10))) { - model.addElement(list.substring(offset, offset + 5)); + if (index == Integer.parseInt(list.substring(offset + 45, offset + 50))) { + model.addElement(list.substring(offset, offset + 45).trim()); } } } - offset += 10; + offset += 50; } } @@ -271,10 +272,10 @@ /* We additionally set the JLabels icon property here. */ - final GameObject arch = mainControl.getArchObjectStack().getArch(Integer.parseInt(value.toString())); + final GameObject arch = mainControl.getArchObjectStack().getArch(value.toString()); if (isSelected) { - archPanel.setPanelArch(Integer.parseInt(value.toString())); - mainControl.setStatusText(" " + value.toString() + " "); + archPanel.setPanelArch(value.toString()); + mainControl.setStatusText(" " + value + " "); } mainControl.setPlainFont(this); setText(arch.getArchetypeName()); Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-09-29 22:23:07 UTC (rev 433) @@ -982,9 +982,9 @@ } } else if (content.getType() != TreasureObj.FOLDER) { // normal arch: display the face icon - final int num = ArchetypeSet.getArchetypeIndex(content.getName()); - if (num != -1 && ArchetypeSet.getLoadStatus() == ArchetypeSet.IS_COMPLETE) { - final GameObject arch = CMainControl.getInstance().getArch(num); + if (ArchetypeSet.getLoadStatus() == ArchetypeSet.IS_COMPLETE) { + final String archname = content.getName(); + final GameObject arch = CMainControl.getInstance().getArch(archname); if (arch != null) { if (!arch.getFaceFlag()) { setIcon(CMainControl.getInstance().getFace(arch.getFaceNr())); Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-29 22:23:07 UTC (rev 433) @@ -407,8 +407,8 @@ return archList.getArchCount(); } - public GameObject getArch(final int i) { - return archList.getArch(i); + public GameObject getArch(final String archname) { + return archList.getArch(archname); } public CopyBuffer getCopyBuffer() { @@ -590,12 +590,12 @@ return JFontChooser.msgToHtml(msg, getPlainFont()); } - boolean addArchToMap(final int archnr, final Point pos, final int intern, final boolean join) { - return currentMap.addArchToMap(archnr, pos, intern, join); + boolean addArchToMap(final String archname, final Point pos, final int intern, final boolean join) { + return currentMap.addArchToMap(archname, pos, intern, join); } - boolean insertArchToMap(final GameObject newarch, final int archnr, final GameObject next, final Point pos, final boolean join) { - return currentMap.insertArchToMap(newarch, archnr, next, pos, join); + boolean insertArchToMap(final GameObject newarch, final String archname, final GameObject next, final Point pos, final boolean join) { + return currentMap.insertArchToMap(newarch, archname, next, pos, join); } public void deleteMapArch(final int index, final Point pos, final boolean refreshMap, final boolean join) { @@ -626,12 +626,12 @@ return mainView.addArchPanelCombo(name); } - public void addArchPanelArch(final int archnr, final int index) { - mainView.addArchPanelArch(archnr, index); + public void addArchPanelArch(final String archname, final int index) { + mainView.addArchPanelArch(archname, index); } // selected arch in arch panel - public int getPanelArch() { + public String getPanelArch() { return mainView.getPanelArch(); } @@ -1017,7 +1017,7 @@ if (typelist.isEmpty()) { // types.txt is missing! showMessage("File Missing", "The definitions-file \"types.txt\" is missing! The\nattribute interface doesn't work without that file."); - } else if (arch != null && arch.getNodeNr() != -1) { + } else if (arch != null && arch.getArchetypeName() != null) { final CAttribDialog dwin = new CAttribDialog(typelist, arch, this); } } @@ -1047,13 +1047,13 @@ // first: attach our map sucker to a default arch we have loaded for (final Iterator<GameObject> it = objects.iterator(); it.hasNext();) { final GameObject arch = it.next(); - final int index1 = ArchetypeSet.getArchetypeIndex(arch.getArchetypeName()); - if (index1 == -1) { + final GameObject defarch = archList.getArch(arch.getArchetypeName()); + if (defarch == null) { // we had an unknown arch here!! // showMessage("Error Loading Map File "+file.getName(), "\n Found Unknown Arch < "+arch.getArchetypeName()+" >"); // return false; } else { - arch.setNodeNr(index1); // our default arch! + arch.setArchetype(defarch); } // 2nd: attach the right face... // if there was no special face added in map, get it from def object @@ -1324,10 +1324,10 @@ return; } - final String path = exit.getAttributeString("slaying", getArch(exit.getNodeNr())); + final String path = exit.getAttributeString("slaying", getArch(exit.getArchetypeName())); final Point exitPos = new Point(); - exitPos.x = exit.getAttributeInt("hp", getArch(exit.getNodeNr())); - exitPos.y = exit.getAttributeInt("sp", getArch(exit.getNodeNr())); + exitPos.x = exit.getAttributeInt("hp", getArch(exit.getArchetypeName())); + exitPos.y = exit.getAttributeInt("sp", getArch(exit.getArchetypeName())); if (path.length() == 0 || (currentMap.getMapFile() != null && path.equals(currentMap.getMapFile().getName()))) { @@ -1897,4 +1897,8 @@ return null; } + public GameObject[] getArchList() { + return archList.getArchList(); + } + } // class CMainControl Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-09-29 22:23:07 UTC (rev 433) @@ -370,12 +370,12 @@ return archPanel.addArchPanelCombo(name); } - public void addArchPanelArch(final int archnr, final int index) { - archPanel.addArchPanelArch(archnr, index); + public void addArchPanelArch(final String archname, final int index) { + archPanel.addArchPanelArch(archname, index); } // selected arch in arch panel - public int getPanelArch() { + public String getPanelArch() { return archPanel.getPanelArch(); } Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-09-29 22:23:07 UTC (rev 433) @@ -278,7 +278,7 @@ final GameObject invnew; if (arch.isArchetype()) { // create a new copy of a default arch - invnew = mainControl.getArchObjectStack().newArchObjectInstance(arch.getNodeNr()); + invnew = mainControl.getArchObjectStack().newArchObjectInstance(arch.getArchetypeName()); } else { // create clone from a pickmap invnew = arch.createClone(inv.getMapX(), inv.getMapY()); @@ -308,7 +308,7 @@ // are taken instead: final GameObject arch = activeArch.getHead(); - final GameObject defarch = mainControl.getArch(arch.getNodeNr()); + final GameObject defarch = mainControl.getArch(arch.getArchetypeName()); if (defarch == null) { // hm, this should NOT happen return; } @@ -700,13 +700,13 @@ // no text, we try to set the default text final boolean hasMessage; - if (arch.getMsgText() == null && arch.getNodeNr() != -1) { + if (arch.getMsgText() == null && arch.getArchetypeName() != null) { archTextArea.setForeground(Color.black); - if (mainControl.getArch(arch.getNodeNr()).getMsgText() == null) { + if (mainControl.getArch(arch.getArchetypeName()).getMsgText() == null) { archTextArea.setText(""); hasMessage = false; } else { - archTextArea.setText(mainControl.getArch(arch.getNodeNr()).getMsgText()); + archTextArea.setText(mainControl.getArch(arch.getArchetypeName()).getMsgText()); hasMessage = true; } } else { @@ -723,15 +723,15 @@ } else if (arch.getFaceName() != null) { // custom face archFaceField.setForeground(Color.blue); archFaceField.setText(arch.getFaceName()); - } else if (arch.getNodeNr() != -1) { + } else if (arch.getArchetypeName() != null) { archFaceField.setForeground(Color.black); - archFaceField.setText(mainControl.getArch(arch.getNodeNr()).getFaceName()); + archFaceField.setText(mainControl.getArch(arch.getArchetypeName()).getFaceName()); } // end face // *** OBJECT NAME *** - if (arch.getObjName() == null && arch.getNodeNr() != -1) { + if (arch.getObjName() == null && arch.getArchetypeName() != null) { archNameField.setForeground(Color.black); - if (mainControl.getArch(arch.getNodeNr()).getObjName() == null) { + if (mainControl.getArch(arch.getArchetypeName()).getObjName() == null) { // arch name if (arch.getArchetypeName() != null) { archNameField.setText(arch.getArchetypeName()); @@ -740,7 +740,7 @@ } } else { // default name - archNameField.setText(mainControl.getArch(arch.getNodeNr()).getObjName()); + archNameField.setText(mainControl.getArch(arch.getArchetypeName()).getObjName()); } } else { // object name ("special") @@ -764,7 +764,7 @@ archMapPos.setText("Map: " + arch.getMapX() + ", " + arch.getMapY()); - if (arch.getNodeNr() != -1) { + if (arch.getArchetypeName() != null) { archTypeText.setText("Type: " + mainControl.getArchObjectParser().getArchTypeName(arch.getArchTypNr()) + " (" + arch.getArchTypNr() + ") [" + arch.getArchetypeName() + "]"); } else { @@ -800,8 +800,8 @@ // black: the attributes from the default archetype // that don't exist among the "special" ones StyleConstants.setForeground(currentAttributes, Color.black); - if (arch.getObjectText() != null && mainControl.getArchObjectStack().getArch(arch.getNodeNr()) != null) { - doc.insertString(doc.getLength(), arch.diffArchText(mainControl.getArchObjectStack().getArch(arch.getNodeNr()).getObjectText(), true), currentAttributes); + if (arch.getObjectText() != null && mainControl.getArchObjectStack().getArch(arch.getArchetypeName()) != null) { + doc.insertString(doc.getLength(), arch.diffArchText(mainControl.getArchObjectStack().getArch(arch.getArchetypeName()).getObjectText(), true), currentAttributes); } } catch (final BadLocationException e) { // TODO Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-09-29 22:23:07 UTC (rev 433) @@ -360,10 +360,10 @@ /** * Add inventory objects to an arch in the MapTileList recursively. * @param node the arch where the inventory gets added - * @param archid nodeNr of the highlighted arch (?) + * @param archid object id of the highlighted arch (?) * @param indent indentation; 1=minimal indentation */ - public void addInvObjects(final GameObject node, final int archid, final int indent) { + private void addInvObjects(final GameObject node, final int archid, final int indent) { final String indentStr = Integer.toString(indent); final Iterator it = node.getHead().iterator(); @@ -425,7 +425,7 @@ this.setBackground(IGUIConstants.BG_COLOR); } - if (arch.getNodeNr() == -1) { + if (arch.getArchetypeName() == null) { setIcon(mainControl.getNoarchTileIcon()); } else if (arch.getFaceFlag()) { setIcon(mainControl.getNofaceTileIcon()); @@ -443,8 +443,8 @@ setText(arch.getObjName()); // special name } else { final String defname; - if (arch.getNodeNr() != -1) { - defname = mainControl.getArch(arch.getNodeNr()).getObjName(); + if (arch.getArchetypeName() != null) { + defname = mainControl.getArch(arch.getArchetypeName()).getObjName(); } else { defname = null; } Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-09-29 22:23:07 UTC (rev 433) @@ -414,7 +414,7 @@ final Point[] redraw; // return value (coords needing redraw) - if (mainControl.getAutojoin() && mainControl.getArch(arch.getNodeNr()).getJoinList() != null) { + if (mainControl.getAutojoin() && mainControl.getArch(arch.getArchetypeName()).getJoinList() != null) { // this arch does autojoining: // first look how many we need @@ -737,7 +737,7 @@ continue; } if (mainControl.isTileEdit(node.getEditType()) || mainControl.getTileEdit() == 0 || isPickmap) { - if (node.getNodeNr() == -1) { + if (node.getArchetypeName() == null) { mainControl.getNoarchTileIconX().paintIcon(this, grfx, x * 32 + bOffset, y * 32 + bOffset); } else if (node.getFaceFlag()) { mainControl.getNofaceTileIconX().paintIcon(this, grfx, x * 32 + bOffset, y * 32 + bOffset); @@ -844,7 +844,7 @@ continue; } if (mainControl.isTileEdit(node.getEditType()) || mainControl.getTileEdit() == 0) { - if (node.getNodeNr() == -1) { + if (node.getArchetypeName() == null) { mainControl.getNoarchTileIconX().paintIcon(this, tmpGrfx, 0, 0); } else if (node.getFaceFlag()) { mainControl.getNofaceTileIconX().paintIcon(this, tmpGrfx, 0, 0); @@ -1429,7 +1429,7 @@ final Iterator it = mapControl.getArchObjects(pos); while (it.hasNext()) { final GameObject t = (GameObject) it.next(); - if (t.getNodeNr() == newarch.getNodeNr() && + if (t.getArchetypeName().equals(newarch.getArchetypeName()) && t.getArchTypNr() == newarch.getArchTypNr()) { insertAllowed = false; // there's a match - don't insert a second one } @@ -1446,7 +1446,7 @@ // insert multi tile from pickmap: newarch = newarch.getHead(); // first insert default arch from archlist - if (!mapControl.addArchToMap(newarch.getNodeNr(), pos, allowMany ? -1 : drawInternCount, MapModel.JOIN_DISABLE)) { + if (!mapControl.addArchToMap(newarch.getArchetypeName(), pos, allowMany ? -1 : drawInternCount, MapModel.JOIN_DISABLE)) { // do nothing } else { // insertion successful, now get redraw info @@ -1512,7 +1512,7 @@ } // first insert default arch from archlist - if (!allSpacesFree || !mapControl.addArchToMap(newarch.getNodeNr(), pos, -1, MapModel.JOIN_DISABLE)) { + if (!allSpacesFree || !mapControl.addArchToMap(newarch.getArchetypeName(), pos, -1, MapModel.JOIN_DISABLE)) { // do nothing } else { // insertion successful, now get redraw info Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-09-29 22:23:07 UTC (rev 433) @@ -358,11 +358,11 @@ private void addArchToMap(final MapControl mapControl, final GameObject arch, final Point pos, final int intern, final boolean fillBelow) { final GameObject newHead; if (arch.isArchetype()) { - mapControl.addArchToMap(arch.getNodeNr(), pos, intern, false, fillBelow); + mapControl.addArchToMap(arch.getArchetypeName(), pos, intern, false, fillBelow); } else { newHead = arch.createClone(pos.x, pos.y); for (GameObject tmp = arch.getArchetype().getMultiNext(); tmp != null; tmp = tmp.getMultiNext()) { - final GameObject newTail = mainControl.getArchObjectStack().newArchObjectInstance(tmp.getNodeNr()); + final GameObject newTail = mainControl.getArchObjectStack().newArchObjectInstance(tmp.getArchetypeName()); final Point mapPos = new Point(pos.x + newTail.getMultiX(), pos.y + newTail.getMultiY()); Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-09-29 22:23:07 UTC (rev 433) @@ -342,11 +342,11 @@ if (replaceArch.isMulti()) { // multi's cannot be inserted properly, so we just put them ontop replaceArch = replaceArch.getHead(); - mapControl.addArchToMap(replaceArch.getNodeNr(), pos, 0, false); + mapControl.addArchToMap(replaceArch.getArchetypeName(), pos, 0, false); // TODO: if from pickmap it could have special attributes -> copy them } else { - mapControl.insertArchToMap(replaceArch, 0, prevArch, pos, false); + mapControl.insertArchToMap(replaceArch, null, prevArch, pos, false); } } replaceCount++; Modified: trunk/crossfire/src/cfeditor/gameobject/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchObjectParser.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/gameobject/ArchObjectParser.java 2006-09-29 22:23:07 UTC (rev 433) @@ -296,7 +296,7 @@ if (!ArchetypeSet.isLoadedFromArchive() || archName != null) { // loading from individual files, so we simply add it to list // ArchetypeSet.loadArchFromFiles() takes care of the panels - mainControl.addArchPanelArch(mainControl.getArchCount(), index); + mainControl.addArchPanelArch(arch.getArchetypeName(), index); } else { // loading from collected files, so we need process panels here if (isNewCategory) { @@ -328,7 +328,7 @@ isNewCategory = false; oldCat = newCat; } - mainControl.addArchPanelArch(mainControl.getArchCount(), index); + mainControl.addArchPanelArch(arch.getArchetypeName(), index); } } } @@ -492,13 +492,13 @@ * @param editType edit type(s) to be calculated for the arch */ public void postParseMapArch(final GameObject arch, final int editType) { - if (arch.getNodeNr() == -1) { + if (arch.getArchetypeName() == null) { return; } final String text = arch.getObjectText(); final int len = text.length(); - final GameObject defarch = mainControl.getArch(arch.getNodeNr()); + final GameObject defarch = mainControl.getArch(arch.getArchetypeName()); arch.resetArchText(); for (int i = 0, s = 0; i < len; i++) { @@ -559,7 +559,7 @@ * @param arch multipart head that needs tail attached */ public void expandMulti(final GameObject arch, final List<GameObject> objects) { - final GameObject defarch = mainControl.getArch(arch.getNodeNr()); // default arch + final GameObject defarch = mainControl.getArch(arch.getArchetypeName()); // default arch // is it a multi head? if (defarch != null && defarch.isMulti() && arch.getMultiRefCount() <= 1) { @@ -567,7 +567,7 @@ // do insertion for all non-head parts of the multi for (GameObject oldPart = defarch.getMultiNext(); oldPart != null; oldPart = oldPart.getMultiNext()) { - final GameObject newarch = mainControl.getArchObjectStack().newArchObjectInstance(oldPart.getNodeNr()); + final GameObject newarch = mainControl.getArchObjectStack().newArchObjectInstance(oldPart.getArchetypeName()); assert newarch != null; arch.addTailPart(newarch); Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-09-29 22:23:07 UTC (rev 433) @@ -48,6 +48,7 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; +import java.util.TreeMap; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JDialog; @@ -84,8 +85,8 @@ */ private static boolean loadedFromArchive = false; - // this is the static part.. i want fast access later - private final ArchtypeNode[] archNodeList = new ArchtypeNode[10000]; + /** The defined default arches. */ + private final TreeMap<String, GameObject> arches = new TreeMap<String, GameObject>(); private final FaceObject[] faceObjects = new FaceObject[10000]; @@ -94,10 +95,6 @@ // in the table is faster than in the static arrays, we can change this private static final Map<String, Integer> faceMap = new HashMap<String, Integer>(); - private static final Map<String, Integer> archetypeMap = new HashMap<String, Integer>(); - - private int archetypeNodeListCount; // ALL default arches loaded - private int archObjCount; // all objects, multi tile arches = 1 object private int faceListCount; // all loaded face pictures @@ -112,7 +109,6 @@ */ public ArchetypeSet(final CMainControl mainControl) { this.mainControl = mainControl; - archetypeNodeListCount = 0; faceListCount = 0; archObjCount = 0; GameObject.setArchetypeSet(this); // add static reference to GameObject @@ -147,15 +143,6 @@ return faceMap.containsKey(faceName) ? faceMap.get(faceName) : -1; } - /** Returns the index of an arch in the arch map or -1. - * @param archetypeName name of arch to get index for - * @return index of arch in map or -1 if arch is not in map - * @deprecated the index system is slow and unmaintainable and therefore will be removed - */ - @Deprecated public static int getArchetypeIndex(final String archetypeName) { - return archetypeMap.containsKey(archetypeName) ? archetypeMap.get(archetypeName) : -1; - } - @Nullable public ImageIcon getFace(final int i) { if (i >= 0 && i < faceListCount) { return faceObjects[i].getFace(); @@ -173,59 +160,47 @@ } public int getArchCount() { - return archetypeNodeListCount; + return arches.size(); } public int getFaceCount() { return faceListCount; } - @Nullable public ArchtypeNode getNextNode(final ArchtypeNode node) { - if (node == null) { - return archNodeList[0]; - } - - final int i = node.archtypeData.getNodeNr(); - if (i + 1 < archetypeNodeListCount) { - return archNodeList[i + 1]; - } - - return null; - } - /** - * Get the Archetype with the specified internal index as GameObject (not yet instanciated). - * @param i internal Archetype index - * @return GameObject with Archetype information - * @see #newArchObjectInstance(int) for a similar method that instanciates. + * Get a default GameObject by its archetype name. + * + * @param archname name of default archetype GameObject to get + * + * @return default GameObject for <var>archname</var> or <code>null</code> + * if no such GameObject exists + * + * @see #newArchObjectInstance(String) for a similar method that instantiates. */ - @Nullable public GameObject getArch(final int i) { - if (i >= 0 && i < archetypeNodeListCount) { - return archNodeList[i].archtypeData; - } - - return null; + @Nullable public GameObject getArch(final String archname) { + return arches.get(archname); } /** - * Create a GameObject for the specified Archetype internal index. - * @param i internal Archetype index - * @return GameObject instanciated from the specified Archetype + * Create a GameObject for the specified archetype name. + * + * @param archname the archetype name + * + * @return GameObject instantiated from the specified archetype */ - @Nullable public GameObject newArchObjectInstance(final int i) { - if (i < 0 && i >= archetypeNodeListCount) { + @Nullable public GameObject newArchObjectInstance(final String archname) { + final GameObject template = getArch(archname); + if (template == null) { return null; } - final GameObject template = archNodeList[i].archtypeData; - final GameObject arch = new GameObject(); arch.setArchetypeName(template.getArchetypeName()); if (!template.getFaceFlag()) { arch.setFaceNr(template.getFaceNr()); } - arch.setNodeNr(template.getNodeNr()); + arch.setArchetypeName(template.getArchetypeName()); arch.setMultiX(template.getMultiX()); arch.setMultiY(template.getMultiY()); return arch; @@ -239,11 +214,11 @@ * @todo check whether the GameObject is a default arch and reject no default arches with an exception */ public void addArchToList(final GameObject data) { - final ArchtypeNode newnode = new ArchtypeNode(data); - archetypeMap.put(data.getArchetypeName(), archetypeNodeListCount); - archNodeList[archetypeNodeListCount++] = newnode; - newnode.archtypeData.setNodeNr(archetypeNodeListCount - 1); - assert newnode.archtypeData.isArchetype(); + if (arches.containsKey(data.getArchetypeName())) { + log.warn("addArchToList: duplicate archetype '" + data.getArchetypeName() + "'"); + } else { + arches.put(data.getArchetypeName(), data); + } } /** load the arches */ @@ -626,17 +601,15 @@ } public void connectFaces() { - int i, s; - // run through arches - for (s = 0; s < archetypeNodeListCount; s++) { - final String aname = archNodeList[s].archtypeData.getFaceName(); - if (aname != null) { - final Integer num = (Integer) faceMap.get(aname); + for (final GameObject arch : arches.values()) { + final String faceName = arch.getFaceName(); + if (faceName != null) { + final Integer num = (Integer) faceMap.get(faceName); if (num != null) { - archNodeList[s].archtypeData.setFaceNr(num); + arch.setFaceNr(num); } - archNodeList[s].archtypeData.setFaceFlag(false); + arch.setFaceFlag(false); } } } @@ -689,11 +662,9 @@ for (CArchPanel.PanelNode node = CArchPanel.getStartPanelNode(); node != null; node = node.next) { - final int[] numList = node.data.getListNodeNrArray(); // list of nodenumbers + final String[] numList = node.data.getListArchNameArray(); final String[] catList = node.data.getListCategoryArray(); // list of category strings - int multiparts = 0; - // process every arch in this panel for (int i = 0; i < numList.length; i++) { @@ -734,97 +705,77 @@ pbar.setValue(count); } - // if multi-head, we must attach the tail - if (arch.isMulti()) { - // process the multipart tail: - multiparts = arch.getMultiRefCount(); - for (int j = 1; j <= multiparts; j++) { - final GameObject tail = mainControl.getArch(numList[i] + j); + // if multi-head, we must attach the tails + for (GameObject tail = arch.getMultiNext(); tail != null; tail = tail.getMultiNext()) { + out.writeBytes("More\n"); - if (tail.isHead()) { - log.warn("Multipart object is too short!"); - final GameObject before = mainControl.getArch(numList[i]); - if (before != null) { - log.warn("-> " + multiparts + " tails expected for multipart: '" + before.getArchetypeName() + "',"); - log.warn(" but arch '" + tail.getArchetypeName() + "' follows on position " + j + " and it's not a tail."); - } - } + out.writeBytes("Object " + tail.getArchetypeName() + "\n"); - out.writeBytes("More\n"); + if (tail.getObjName() != null) { + out.writeBytes("name " + tail.getObjName() + "\n"); + } + if (tail.getFaceName() != null) { + out.writeBytes("face " + tail.getFaceName() + "\n"); + } + if (tail.getArchTypNr() > 0) { + out.writeBytes("type " + tail.getArchTypNr() + "\n"); + } - out.writeBytes("Object " + tail.getArchetypeName() + "\n"); + // special: add a string-attribute with the display-category + //out.writeBytes("editor_folder "+node.getTitle()+"/"+catList[i]+"\n"); - if (tail.getObjName() != null) { - out.writeBytes("name " + tail.getObjName() + "\n"); - } - if (tail.getFaceName() != null) { - out.writeBytes("face " + tail.getFaceName() + "\n"); - } - if (tail.getArchTypNr() > 0) { - out.writeBytes("type " + tail.getArchTypNr() + "\n"); - } + out.writeBytes(tail.getObjectText()); + if (tail.getObjectText().lastIndexOf(0x0a) != tail.getObjectText().length() - 1) { + out.writeBytes("\n"); + } - // special: add a string-attribute with the display-category - //out.writeBytes("editor_folder "+node.getTitle()+"/"+catList[i]+"\n"); - - out.writeBytes(tail.getObjectText()); - if (tail.getObjectText().lastIndexOf(0x0a) != tail.getObjectText().length() - 1) { - out.writeBytes("\n"); - } - - // position of multi relative to head - if (tail.getMultiX() != 0) { - out.writeBytes("x " + tail.getMultiX() + "\n"); - } - if (tail.getMultiY() != 0) { - out.writeBytes("y " + tail.getMultiY() + "\n"); - } - out.writeBytes("end\n"); - count++; - if (count % 100 == 0) { - pbar.setValue(count); - } + // position of multi relative to head + if (tail.getMultiX() != 0) { + out.writeBytes("x " + tail.getMultiX() + "\n"); } + if (tail.getMultiY() != 0) { + out.writeBytes("y " + tail.getMultiY() + "\n"); + } + out.writeBytes("end\n"); + count++; + if (count % 100 == 0) { + pbar.setValue(count); + } } } } // finally we need to get the "map"-arch, which is not in the panels - boolean maparchFound = false; - for (int i = 0; i < mainControl.getArchCount() && !maparchFound; i++) { - arch = mainControl.getArch(i); - if (arch.getArchetypeName().compareTo(ArchObjectParser.STARTARCH_NAME) == 0) { - // process map arch - maparchFound = true; - count++; + final GameObject maparch = mainControl.getArch(ArchObjectParser.STARTARCH_NAME); + if (maparch != null) { + count++; - out.writeBytes("Object " + arch.getArchetypeName() + "\n"); + out.writeBytes("Object " + maparch.getArchetypeName() + "\n"); - // map object hack: x/y is normally a reference for multi - // part arches - i include this hack until we rework the - // arch objects with more useful script names - if (arch.getArchetypeName().compareTo(ArchObjectParser.STARTARCH_NAME) == 0) { - out.writeBytes("x " + arch.getMultiX() + "\n"); - out.writeBytes("y " + arch.getMultiY() + "\n"); - } + // map object hack: x/y is normally a reference for multi + // part arches - i include this hack until we rework the + // arch objects with more useful script names + if (maparch.getArchetypeName().compareTo(ArchObjectParser.STARTARCH_NAME) == 0) { + out.writeBytes("x " + maparch.getMultiX() + "\n"); + out.writeBytes("y " + maparch.getMultiY() + "\n"); + } - if (arch.getObjName() != null) { - out.writeBytes("name " + arch.getObjName() + "\n"); - } - if (arch.getFaceName() != null) { - out.writeBytes("face " + arch.getFaceName() + "\n"); - } - if (arch.getArchTypNr() > 0) { - out.writeBytes("type " + arch.getArchTypNr() + "\n"); - } + if (maparch.getObjName() != null) { + out.writeBytes("name " + maparch.getObjName() + "\n"); + } + if (maparch.getFaceName() != null) { + out.writeBytes("face " + maparch.getFaceName() + "\n"); + } + if (maparch.getArchTypNr() > 0) { + out.writeBytes("type " + maparch.getArchTypNr() + "\n"); + } - out.writeBytes(arch.getObjectText()); - if (arch.getObjectText().lastIndexOf(0x0a) != arch.getObjectText().length() - 1) { - out.writeBytes("\n"); - } - - out.writeBytes("end\n"); + out.writeBytes(maparch.getObjectText()); + if (maparch.getObjectText().lastIndexOf(0x0a) != maparch.getObjectText().length() - 1) { + out.writeBytes("\n"); } + + out.writeBytes("end\n"); } // check if we still missed any arches @@ -977,6 +928,10 @@ CMainStatusbar.getInstance().setText("Collect Archetypes: done."); } + public GameObject[] getArchList() { + return arches.values().toArray(new GameObject[arches.size()]); + } + /** * Inner class: CollectProgressBar is a popup dialog for the mainview * which displays a process bar while arches are collected @@ -1064,17 +1019,4 @@ } } // class CollectProgressBar - public class ArchtypeNode { - - final GameObject archtypeData; - - final ArchtypeNode next; - - public ArchtypeNode(final GameObject data) { - this.archtypeData = data; - this.next = null; - } - - } // class ArchtypeNode - } // class ArchetypeSet Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-09-29 18:56:05 UTC (rev 432) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-09-29 22:23:07 UTC (rev 433) @@ -69,11 +69,8 @@ private String faceName; // face name : 1 - /** - * The name of the Archetype this GameObject is based on. - * It is the String value of the attribute <code>arch</code> that also starts a GameObject. - */ - private String archetypeName; // arch Name + /** Archetype name. */ + private String archetypeName = null; /** The name of this object. */ private String objName; @@ -98,11 +95,8 @@ private int archTextCount; // lines inserted in ArchText - private int nodenr; // we are (internal) arch nr in node list - // the nodenr determines the (default) archetype - /** The Archetype of this GameObject. */ - @NotNull private GameObject archetype; + @NotNull private GameObject archetype = this; /** Map x position if on map. */ private int mapx; @@ -178,7 +172,6 @@ myId = myIdCounter++; // increase ID counter for every new arch created - archetypeName = null; objectText = new StringBuffer(""); msgText = animText = loreText = null; archTextCount = 0; // lines inserted in objectText @@ -195,7 +188,6 @@ editflag = false; join = null; // no autojoin list per default archType = TYPE_UNSET; // type must be set - nodenr = -1; // as default we are not in a node list next = null; prev = null; mapx = 0; @@ -897,28 +889,17 @@ noface = flag; } - /* Set Node number. Node... [truncated message content] |
From: <aki...@us...> - 2006-09-29 18:56:12
|
Revision: 432 http://svn.sourceforge.net/gridarta/?rev=432&view=rev Author: akirschbaum Date: 2006-09-29 11:56:05 -0700 (Fri, 29 Sep 2006) Log Message: ----------- Make deletion of inventory objects from map tile panel work. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/map/DefaultMapModel.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-09-27 19:13:23 UTC (rev 431) +++ trunk/crossfire/ChangeLog 2006-09-29 18:56:05 UTC (rev 432) @@ -1,3 +1,7 @@ +2006-09-29 Andreas Kirschbaum + + * Make deletion of inventory objects from map tile panel work. + 2006-09-27 Andreas Kirschbaum * Fix #1539117 (Enter Exit not working for random maps). Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-27 19:13:23 UTC (rev 431) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-29 18:56:05 UTC (rev 432) @@ -703,7 +703,7 @@ } // no, lets check his inventory - final GameObject temp = findInvObject(node.getHead(), id); + final GameObject temp = findInvObject(node, id); if (temp != null) { return temp; } @@ -719,7 +719,7 @@ * @return the specified arch, or null if not found */ @Nullable public GameObject findInvObject(@NotNull final GameObject node, final int id) { - for (final GameObject arch : node) { + for (final GameObject arch : node.getHead()) { if (arch.getMyID() == id) { return arch; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-27 19:13:34
|
Revision: 431 http://svn.sourceforge.net/gridarta/?rev=431&view=rev Author: akirschbaum Date: 2006-09-27 12:13:23 -0700 (Wed, 27 Sep 2006) Log Message: ----------- Fix #1539117 (Enter Exit not working for random maps). Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-09-27 18:52:04 UTC (rev 430) +++ trunk/crossfire/ChangeLog 2006-09-27 19:13:23 UTC (rev 431) @@ -1,5 +1,7 @@ 2006-09-27 Andreas Kirschbaum + * Fix #1539117 (Enter Exit not working for random maps). + * When saving, insert "map_layer" object attribute in same order as crossfire server. Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-27 18:52:04 UTC (rev 430) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-27 19:13:23 UTC (rev 431) @@ -1342,7 +1342,15 @@ } else { // path points to a different map final File newfile; // new mapfile to open - if (path.startsWith(File.pathSeparator) || path.startsWith("/")) { + if (path.equals("/!")) { + // destination is a random map; extract the final non-random map + final String destinationMap = getRandomMapParameter(exit, "final_map"); + if (destinationMap == null) { + showMessage("Destination Invalid", "The destination of this exit is a random map."); + return; + } + newfile = new File(mapDir.getAbsolutePath(), destinationMap); + } else if (path.startsWith(File.pathSeparator) || path.startsWith("/")) { // we have an absolute path: newfile = new File(mapDir.getAbsolutePath(), path.substring(1)); } else { @@ -1862,4 +1870,31 @@ return mapFileDecoder; } + /** + * Extract a parameter value for an exit to a random map. + * + * @param exit the exit object containing the parameters + * + * @param parameterName the parameter name to use + * + * @return the value of the given parameter name, or <code>null</code> if + * the parameter does not exist + */ + private static String getRandomMapParameter(final GameObject exit, final String parameterName) { + final String msg = exit.getMsgText(); + if (msg == null) { + return null; + } + + final String[] lines = msg.split("[\r\n]+"); + for (final String line : lines) { + final String[] tmp = line.split(" +", 2); + if (tmp.length == 2 && tmp[0].equals(parameterName)) { + return tmp[1]; + } + } + + return null; + } + } // class CMainControl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-27 18:52:10
|
Revision: 430 http://svn.sourceforge.net/gridarta/?rev=430&view=rev Author: akirschbaum Date: 2006-09-27 11:52:04 -0700 (Wed, 27 Sep 2006) Log Message: ----------- Update installation instructions. Modified Paths: -------------- trunk/crossfire/INSTALL.txt Modified: trunk/crossfire/INSTALL.txt =================================================================== --- trunk/crossfire/INSTALL.txt 2006-09-27 18:29:28 UTC (rev 429) +++ trunk/crossfire/INSTALL.txt 2006-09-27 18:52:04 UTC (rev 430) @@ -17,80 +17,30 @@ How to build the CFJavaEditor from sources: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -If you have checked out the CFJavaEditor sources from CVS, or +If you have checked out the Gridarta sources from CVS, or downloaded a "developer version", then you've got the java sources. Now you can modify the java code, you can add classes, but please don't move or rename any directories. -When you find yourself in the position that you want to compile -the java sources for the editor, you have mainly two options: +When you find yourself in the position that you want to compile the +java sources for the editor, you need Apache Ant. Visit +<http://ant.apache.org/> for more information about Ant. -1. compile using Apache Ant -2. compile "by hand" via commandline -I strongly recommed using Ant. It works on any reasonable platform -and comes pre-installed on most Linux/Unix systems today. -Visit <http://ant.apache.org/> for more information about Ant. - - -Compiling the sources with Apache Ant: -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Compiling the sources: +^^^^^^^^^^^^^^^^^^^^^ Install Ant on your system. Make sure both the JAVA_HOME and ANT_HOME environment variables are set correctly. - -Change into the CFJavaEditor main directory. + +Change into the crossfire subdirectory or the Gridarta directory. On the console type "ant" - that's all. (Note that, if you want, you can also run the editor with ant by typing "ant run". This does exactly the same as -"java -jar -Xmx128m CFJavaEditor.jar".) +"java -jar CFJavaEditor.jar".) -Compiling the sources with pure commandline: -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following steps are demonstrated in unix command-shell -style. It can also be done in windows if you know the transition -between unix and windows commands. - -(Let me recommed: Installing Ant would go faster than -typing all this stuff...) - - -1. Cd into the "CFJavaEditor" directory - -2. create a "class" directory if not already existing: - > mkdir class - -3. compile the sources (classes appear in the "class" dir): - > javac -d class -classpath lib/png.jar:lib/visualtek.jar:lib/jdom.jar:lib/crimson.jar src/cfeditor/*.java src/cfeditor/textedit/textarea/*.java src/cfeditor/textedit/scripteditor/*.java - -4. run the compiled java classes: - > java -classpath class/:lib/png.jar:lib/visualtek.jar:lib/jdom.jar:lib/crimson.jar cfeditor.CFJavaEditor - -It is also possible to build a jar archive that contains all -compiled classes and resources. This is an optional step: - -5. > cp -r resource/HelpFiles/ resource/conf/* resource/icons/ - resource/system/ class/ - (Delete all CVS directorys that made it into the "class" dir - or any of it's sub-directorys!) - > cd class - > jar xvf ../lib/png.jar - > jar xvf ../lib/visualtek.jar - > jar xvf ../lib/jdom.jar - > jar xvf ../lib/crimson.jar - > rm -f -r META-INF - > jar cfm ../CFJavaEditor.jar ../manifest.txt ./* - > cd .. - -6. If you got it right, you can now run the new jar file: - > java -jar CFJavaEditor.jar - - The jar file should be able to run stand-alone, even - when moved to different locations. - - How to create a CFJavaEditor release package: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A "release" version is meant to be a complete running version of @@ -103,26 +53,25 @@ 1. Run Ant to create the jar file "CFJavaEditor.jar" (see above). 2. Assemble jar file and pickmaps in the following directory tree: - + CFJavaEditor/ resource/ pickmaps/ [all pickmap files] CFJavaEditor.jar CHANGES.txt - + 3. Zip the package in a widely available compression format. - Preferably use tar.gz as this is available both on unix/linux + Preferably use tar.gz as this is available both on Unix/Linux and windows (winzip). - + System requirements & Supported Java Versions: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You need at least 128 MB of system RAM and 400 MHz CPU speed in order to run the CFJavaEditor. It has been reported to work on systems with lesser specs, but the speed was very slow. -The editor has been developed and tested for Java SDK 1.3, 1.4 and -1.5 from SUN. It will not run on Java versions 1.2 and lower. -It has been successfully tested on multiple platforms -including windows (98/2k/XP), linux and unix (solaris). +The editor needs Java 1.5. It will not run on Java versions below +1.5. It has been successfully tested on multiple platforms including +windows (98/2k/XP), Linux and Unix (Solaris). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-27 18:29:37
|
Revision: 429 http://svn.sourceforge.net/gridarta/?rev=429&view=rev Author: akirschbaum Date: 2006-09-27 11:29:28 -0700 (Wed, 27 Sep 2006) Log Message: ----------- When saving, insert map_layer object attribute in same order as crossfire server. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMapFileEncode.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-09-27 18:21:23 UTC (rev 428) +++ trunk/crossfire/ChangeLog 2006-09-27 18:29:28 UTC (rev 429) @@ -1,5 +1,8 @@ 2006-09-27 Andreas Kirschbaum + * When saving, insert "map_layer" object attribute in same order + as crossfire server. + * Make map grid display work correctly. * Fix object attributes dialog: do not ignore changed string Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-09-27 18:21:23 UTC (rev 428) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-09-27 18:29:28 UTC (rev 429) @@ -411,6 +411,7 @@ addKey("container"); addKey("will_apply"); addKey("smoothlevel"); + addKey("map_layer"); addKey("current_weapon_script"); addKey("weapontype"); addKey("tooltype"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-27 18:21:30
|
Revision: 428 http://svn.sourceforge.net/gridarta/?rev=428&view=rev Author: akirschbaum Date: 2006-09-27 11:21:23 -0700 (Wed, 27 Sep 2006) Log Message: ----------- Make map grid display work correctly. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMapViewBasic.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-09-27 17:39:43 UTC (rev 427) +++ trunk/crossfire/ChangeLog 2006-09-27 18:21:23 UTC (rev 428) @@ -1,5 +1,7 @@ 2006-09-27 Andreas Kirschbaum + * Make map grid display work correctly. + * Fix object attributes dialog: do not ignore changed string attributes if old and new value only differs in case. Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-09-27 17:39:43 UTC (rev 427) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-09-27 18:21:23 UTC (rev 428) @@ -884,9 +884,9 @@ // if grid is active, draw grid lines (right and bottom) if (showMapGrid) { // horizontal: - grfx.drawLine(x * 32 + bOffset, y * 32 + bOffset, x * 32 + bOffset, y * 32 + 32 + bOffset); + grfx.drawLine(x * 32, y * 32, x * 32, y * 32 + 32); // vertical: - grfx.drawLine(x * 32 + bOffset, y * 32 + bOffset, x * 32 + 32 + bOffset, y * 32 + bOffset); + grfx.drawLine(x * 32, y * 32, x * 32 + 32, y * 32); } // if tile is highlighted, draw the highlight icon This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-27 17:39:52
|
Revision: 427 http://svn.sourceforge.net/gridarta/?rev=427&view=rev Author: akirschbaum Date: 2006-09-27 10:39:43 -0700 (Wed, 27 Sep 2006) Log Message: ----------- Fix object attributes dialog: do not ignore changed string attributes if old and new value only differs in case. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/daimonin/src/daieditor/CAttribDialog.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-09-27 17:34:32 UTC (rev 426) +++ trunk/crossfire/ChangeLog 2006-09-27 17:39:43 UTC (rev 427) @@ -1,5 +1,8 @@ 2006-09-27 Andreas Kirschbaum + * Fix object attributes dialog: do not ignore changed string + attributes if old and new value only differs in case. + * Remove spurious error message ("Wrong formatted HTML!") when displaying help. Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-09-27 17:34:32 UTC (rev 426) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-09-27 17:39:43 UTC (rev 427) @@ -1257,12 +1257,12 @@ if (attr.ref.getNameOld().equalsIgnoreCase("name")) { // special case #1: "name"-textfield if (defarch.getObjName() != null && defarch.getObjName().length() > 0) { - if (!inline.equalsIgnoreCase(defarch.getObjName())) { + if (!inline.equals(defarch.getObjName())) { newName = inline; } else { newName = ""; } - } else if (!inline.equalsIgnoreCase(defarch.getArchetypeName())) { + } else if (!inline.equals(defarch.getArchetypeName())) { newName = inline; } else { newName = ""; @@ -1270,13 +1270,13 @@ } else if (attr.ref.getNameOld().equalsIgnoreCase("face")) { // special case #2: "face"-textfield if (defarch.getFaceName() != null && defarch.getFaceName().length() > 0 && - !inline.equalsIgnoreCase(defarch.getFaceName())) { + !inline.equals(defarch.getFaceName())) { newFace = inline; } else { newFace = ""; } } else { - if (!inline.equalsIgnoreCase(defarch.getAttributeString(attr.ref.getNameOld(), null))) { + if (!inline.equals(defarch.getAttributeString(attr.ref.getNameOld(), null))) { newArchText = newArchText + attr.ref.getNameOld() + " " + inline + "\n"; } } Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-09-27 17:34:32 UTC (rev 426) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-09-27 17:39:43 UTC (rev 427) @@ -1098,18 +1098,18 @@ if ("name".equalsIgnoreCase(attr.ref.getNameOld())) { // special case #1: "name"-textfield if (defarch.getObjName() != null && defarch.getObjName().length() > 0) { - if (!inline.equalsIgnoreCase(defarch.getObjName())) { + if (!inline.equals(defarch.getObjName())) { newName = inline; } else { newName = ""; } - } else if (!inline.equalsIgnoreCase(defarch.getArchetypeName())) { + } else if (!inline.equals(defarch.getArchetypeName())) { newName = inline; } else { newName = ""; } } else if ("animation".equalsIgnoreCase(attr.ref.getNameOld())) { - if (inline.length() > 0 && !inline.equalsIgnoreCase(defarch.getAttributeString(attr.ref.getNameOld(), false))) { + if (inline.length() > 0 && !inline.equals(defarch.getAttributeString(attr.ref.getNameOld(), false))) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + inline + '\n'; arch.setAnimName(inline); } else { @@ -1125,7 +1125,7 @@ } newFace = inline; } else { - if (!inline.equalsIgnoreCase(defarch.getAttributeString(attr.ref.getNameOld(), false))) { + if (!inline.equals(defarch.getAttributeString(attr.ref.getNameOld(), false))) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + inline + '\n'; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-27 17:34:41
|
Revision: 426 http://svn.sourceforge.net/gridarta/?rev=426&view=rev Author: akirschbaum Date: 2006-09-27 10:34:32 -0700 (Wed, 27 Sep 2006) Log Message: ----------- Remove spurious error message ("Wrong formatted HTML!") when displaying help. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/src/app/net/sf/gridarta/help/Help.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-09-26 18:39:02 UTC (rev 425) +++ trunk/crossfire/ChangeLog 2006-09-27 17:34:32 UTC (rev 426) @@ -1,3 +1,8 @@ +2006-09-27 Andreas Kirschbaum + + * Remove spurious error message ("Wrong formatted HTML!") when + displaying help. + 2006-09-26 Andreas Kirschbaum * Make inventory display of multi-part objects in map tile panel Modified: trunk/src/app/net/sf/gridarta/help/Help.java =================================================================== --- trunk/src/app/net/sf/gridarta/help/Help.java 2006-09-26 18:39:02 UTC (rev 425) +++ trunk/src/app/net/sf/gridarta/help/Help.java 2006-09-27 17:34:32 UTC (rev 426) @@ -68,10 +68,7 @@ fname = "start.html"; } final HtmlPane html; - if (fname.startsWith("<HTML>") || fname.startsWith("<html")) { - if (fname.startsWith("<HTML")) { - System.err.println("Wrong formatted HTML!"); - } + if (fname.startsWith("<HTML>") || fname.startsWith("<html>")) { html = new HtmlPane("text/html", fname); // direct text } else { html = new HtmlPane(fname); // read html file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-26 18:39:11
|
Revision: 425 http://svn.sourceforge.net/gridarta/?rev=425&view=rev Author: akirschbaum Date: 2006-09-26 11:39:02 -0700 (Tue, 26 Sep 2006) Log Message: ----------- Make inventory display of multi-part objects in map tile panel work. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-09-25 22:17:46 UTC (rev 424) +++ trunk/crossfire/ChangeLog 2006-09-26 18:39:02 UTC (rev 425) @@ -1,3 +1,8 @@ +2006-09-26 Andreas Kirschbaum + + * Make inventory display of multi-part objects in map tile panel + work. + 2006-09-24 Andreas Kirschbaum * Do not crash when pasting multi-part objects to the edge of a Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-09-25 22:17:46 UTC (rev 424) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-09-26 18:39:02 UTC (rev 425) @@ -455,9 +455,11 @@ setText(arch.getArchetypeName()); // arch name } } - - setBorder(BorderFactory.createEmptyBorder(0, Math.max(0, indent - 1) * 16, 0, 0)); // indentation + } else { + setIcon(mainControl.getUnknownTileIcon()); + setText("?"); } + setBorder(BorderFactory.createEmptyBorder(0, Math.max(0, indent - 1) * 16, 0, 0)); // indentation return this; } Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-25 22:17:46 UTC (rev 424) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-26 18:39:02 UTC (rev 425) @@ -694,23 +694,22 @@ } // first, try to find the tile we had selected - GameObject node = null; final Iterator it = getArchObjects(pos); while (it.hasNext()) { - node = (GameObject) it.next(); + final GameObject node = (GameObject) it.next(); if (node.getMyID() == id) { // is it this map tile - break; + return node; } // no, lets check his inventory - final GameObject temp = findInvObject(node, id); + final GameObject temp = findInvObject(node.getHead(), id); if (temp != null) { return temp; } } - return node; + return null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-25 22:17:54
|
Revision: 424 http://svn.sourceforge.net/gridarta/?rev=424&view=rev Author: christianhujer Date: 2006-09-25 15:17:46 -0700 (Mon, 25 Sep 2006) Log Message: ----------- Added missing Arrays2 class. Modified Paths: -------------- trunk/crossfire/build.xml Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2006-09-25 08:41:50 UTC (rev 423) +++ trunk/crossfire/build.xml 2006-09-25 22:17:46 UTC (rev 424) @@ -123,6 +123,7 @@ <zipfileset src="../lib/japi.jar"> <include name="net/sf/japi/swing/DisposeAction.class" /> + <include name="net/sf/japi/util/Arrays2.class" /> <include name="net/sf/japi/util/filter/file/AbstractFileFilter.class" /> <include name="net/sf/japi/util/filter/file/FileFilter.class" /> <include name="net/sf/japi/util/filter/Filter.class" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-25 08:42:18
|
Revision: 423 http://svn.sourceforge.net/gridarta/?rev=423&view=rev Author: akirschbaum Date: 2006-09-25 01:41:50 -0700 (Mon, 25 Sep 2006) Log Message: ----------- Use generics where possible. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFArchType.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainToolbar.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CScriptController.java trunk/crossfire/src/cfeditor/CScriptModel.java trunk/crossfire/src/cfeditor/CScriptView.java trunk/crossfire/src/cfeditor/FaceObject.java trunk/crossfire/src/cfeditor/JFontChooser.java trunk/crossfire/src/cfeditor/JarResources.java trunk/crossfire/src/cfeditor/PluginParameter.java trunk/crossfire/src/cfeditor/PluginParameterFactory.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/ScriptEditor.java trunk/crossfire/src/cfeditor/gui/ScriptManager.java trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java trunk/crossfire/src/cfeditor/menu/MenuManager.java trunk/crossfire/src/cfeditor/menu/SimpleMenuLocation.java Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-09-25 08:41:50 UTC (rev 423) @@ -120,13 +120,13 @@ */ public boolean load(final Element root, final CFArchTypeList tlist) { // this vector is used to store a temporare linked list of attributes - final Vector attrList = new Vector(); + final Vector<CFArchAttrib> attrList = new Vector<CFArchAttrib>(); // for internal section handling: - final Vector secNames = new Vector(); // list of section names - final Hashtable ignoreTable = new Hashtable(); // ignore list + final Vector<String> secNames = new Vector<String>(); // list of section names + final Hashtable<String, String> ignoreTable = new Hashtable<String, String>(); // ignore list - List children; // list of children elements + List<Element> children; // list of children elements Element elem; // xml element Attribute a1; @@ -154,7 +154,7 @@ children = required.getChildren(XML_ATTRIBUTE); final List<String> tmp = new ArrayList<String>(); for (int i = 0; children != null && i < children.size(); i++) { - elem = (Element) children.get(i); + elem = children.get(i); a1 = elem.getAttribute(CFArchAttrib.XML_KEY_ARCH); final Attribute a2 = elem.getAttribute(XML_VALUE); if (a1 == null || a2 == null) { @@ -182,7 +182,7 @@ // load all attributes in the ignore section children = signore.getChildren(XML_ATTRIBUTE); for (int i = 0; children != null && i < children.size(); i++) { - elem = (Element) children.get(i); + elem = children.get(i); a1 = elem.getAttribute(CFArchAttrib.XML_KEY_ARCH); if (a1 == null) { log.error("In '" + XML_IGNORE + "' section of type " + typeName + ": " + XML_ATTRIBUTE + " missing '" + CFArchAttrib.XML_KEY_ARCH + "'."); @@ -194,15 +194,15 @@ // load attributes from ignore lists children = signore.getChildren("ignore_list"); for (int i = 0; children != null && i < children.size(); i++) { - elem = (Element) children.get(i); + elem = children.get(i); a1 = elem.getAttribute("name"); if (a1 == null) { log.error("In '" + XML_IGNORE + "' section of type " + typeName + ": ignore_list missing 'name'."); } else if (tlist.getIgnoreListTable().containsKey(a1.getValue().trim())) { // just copy everything from ignorelist to this ignore section - final Vector ignlist = (Vector) (tlist.getIgnoreListTable().get(a1.getValue().trim())); + final Vector<String> ignlist = tlist.getIgnoreListTable().get(a1.getValue().trim()); for (int k = 0; k < ignlist.size(); k++) { - ignoreTable.put((String) (ignlist.elementAt(k)), ""); + ignoreTable.put(ignlist.elementAt(k), ""); } } else { log.error("In '" + XML_IGNORE + "' section of type " + typeName + ": ignore_list with name \"" + a1.getValue() + "\" is undefined."); @@ -237,7 +237,7 @@ boolean inSection; String section = "?"; for (int i = 0; children != null && i < children.size(); i++) { - elem = (Element) children.get(i); + elem = children.get(i); // attribute directly in type element if (elem.getName().equalsIgnoreCase(XML_ATTRIBUTE)) { parseAttribute(elem, secNames, false, null, attrList, tlist); @@ -258,9 +258,9 @@ } // parse all attributes in the section - final List schildren = elem.getChildren(); + final List<Element> schildren = elem.getChildren(); for (int k = 0; schildren != null && k < schildren.size(); k++) { - elem = (Element) schildren.get(k); + elem = schildren.get(k); if (elem.getName().equalsIgnoreCase(XML_ATTRIBUTE)) { // got an attribute element possibly in a section parseAttribute(elem, secNames, inSection, section, attrList, tlist); @@ -359,7 +359,7 @@ // put the list of the (non-default) CFArchAttribs into an array: for (int i = 0; numDef < j && i < attrList.size(); numDef++, i++) { - attr[numDef] = (CFArchAttrib) (attrList.elementAt(i)); + attr[numDef] = attrList.elementAt(i); } return true; // archtype was parsed correctly @@ -376,7 +376,7 @@ * @param attrList linked list of attributes * @param tlist arch type list */ - private void parseAttribute(final Element elem, final Vector secNames, final boolean inSection, final String section, final Vector attrList, final CFArchTypeList tlist) { + private void parseAttribute(final Element elem, final Vector<String> secNames, final boolean inSection, final String section, final Vector<CFArchAttrib> attrList, final CFArchTypeList tlist) { // create new instance final CFArchAttrib attrib = new CFArchAttrib(); @@ -384,7 +384,7 @@ if (attrib.load(elem, tlist, typeName)) { // add this attribute to the list: if (attrList.size() > 0) { - ((CFArchAttrib) (attrList.get(attrList.size() - 1))).setNext(attrib); + attrList.get(attrList.size() - 1).setNext(attrib); } attrList.add(attrib); Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-09-25 08:41:50 UTC (rev 423) @@ -64,11 +64,11 @@ private int[] spellNum; // array of spell numbers - private Map bitmaskTable; // table with CAttrBitmask objects (value) sorted by name (key) + private Map<String, CAttribBitmask> bitmaskTable; // table with CAttribBitmask objects (value) sorted by name (key) - private Map listTable; // table with Vector objects for lists (value) sorted by name (key) + private Map<String, Vector> listTable; // table with Vector objects for lists (value) sorted by name (key) - private Map ignoreListTable; // table with Vector objects for ignore_lists (value) sorted by name (key) + private Map<String, Vector<String>> ignoreListTable; // table with Vector objects for ignore_lists (value) sorted by name (key) private int length = 0; // Number of types in the list @@ -81,9 +81,9 @@ final boolean headLoaded = false; // true when the default type (=head) is loaded // initialize the arrays of "special-data" - bitmaskTable = new HashMap(); - listTable = new HashMap(); - ignoreListTable = new HashMap(); + bitmaskTable = new HashMap<String, CAttribBitmask>(); + listTable = new HashMap<String, Vector>(); + ignoreListTable = new HashMap<String, Vector<String>>(); loadSpellsFromXML(); // load spells from file @@ -105,11 +105,11 @@ if (root == null || !root.getName().equalsIgnoreCase("types")) { log.warn("File '" + IGUIConstants.TYPEDEF_FILE + "' lacks root element 'types'."); } else { - List children; + List<Element> children; // parse all bitmask elements children = root.getChildren("bitmask"); for (int i = 0; children != null && i < children.size(); i++) { - elem = (Element) children.get(i); + elem = children.get(i); if (elem.getAttribute("name") == null) { log.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load bitmask element without 'name'."); } else { @@ -120,7 +120,7 @@ // parse all list elements children = root.getChildren("list"); for (int i = 0; children != null && i < children.size(); i++) { - elem = (Element) children.get(i); + elem = children.get(i); if (elem.getAttribute("name") == null) { log.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load list element without 'name'."); } else { @@ -150,17 +150,17 @@ // parse ignore lists children = root.getChildren("ignore_list"); for (int i = 0; children != null && i < children.size(); i++) { - elem = (Element) children.get(i); + elem = children.get(i); if (elem.getAttribute("name") == null) { log.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load ignore_list element without 'name'."); } else { final String lname = elem.getAttribute("name").getValue().trim(); - final List children2 = elem.getChildren(CFArchType.XML_ATTRIBUTE); + final List<Element> children2 = elem.getChildren(CFArchType.XML_ATTRIBUTE); if (children2 != null && children2.size() > 0) { // load all attribute entries - final Vector content = new Vector(); + final Vector<String> content = new Vector<String>(); for (int k = 0; k < children2.size(); k++) { - elem = (Element) children2.get(k); + elem = children2.get(k); if ((a = elem.getAttribute(CFArchAttrib.XML_KEY_ARCH)) != null) { content.addElement(a.getValue().trim()); } else { @@ -176,7 +176,7 @@ // parse all type elements children = root.getChildren("type"); for (int i = 0; children != null && i < children.size(); i++) { - elem = (Element) children.get(i); + elem = children.get(i); if (elem.getAttribute("name") == null || elem.getAttribute("number") == null) { log.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': found type element without 'name' or 'number'."); } else { @@ -265,15 +265,15 @@ return spellNum; } - public Map getBitmaskTable() { + public Map<String, CAttribBitmask> getBitmaskTable() { return bitmaskTable; } - public Map getListTable() { + public Map<String, Vector> getListTable() { return listTable; } - public Map getIgnoreListTable() { + public Map<String, Vector<String>> getIgnoreListTable() { return ignoreListTable; } @@ -396,14 +396,14 @@ * @return number of successfully collected spells */ private int importSpells(final File spellfile) { - Vector list = null; // growable array of spellnames+numbers + Vector<String> list = null; // growable array of spellnames+numbers String tmp; // tmp String for spell names final FileWriter fileWriter; // file writer for "spells.def" final BufferedWriter bufferedWriter; // buffered writer if (spellfile.getName().equalsIgnoreCase("spellist.h")) { - list = new Vector(); + list = new Vector<String>(); FileReader fileReader = null; BufferedReader bufferedReader = null; @@ -426,7 +426,7 @@ name = name.trim(); // now insert this string lexographically into the vector for (i = 0; i < list.size(); i++) { - tmp = (String) list.elementAt(i); + tmp = list.elementAt(i); tmp = tmp.substring(tmp.indexOf(" ") + 1); if (name.compareTo(tmp) < 0) { Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-09-25 08:41:50 UTC (rev 423) @@ -79,16 +79,16 @@ private static final DefaultMutableTreeNode root = new DefaultMutableTreeNode("Treasurelists:"); // hashtable containing references to all treasurelists (tree nodes) - private static Hashtable treasureTable = null; + private static Hashtable<String, TreasureTreeNode> treasureTable = null; // hashtable temporarily containing names of special treasurelists (like gods' lists) // as keys and folder-nodes where to put these treasurelists as values - private Hashtable specialTreasureLists = null; + private Hashtable<String, TreasureTreeNode> specialTreasureLists = null; // all syntax-errors encountered during datafile-parsing get written in this log private StringBuffer errorLog = null; - private Vector needSecondLink; + private Vector<TreasureTreeNode> needSecondLink; private boolean processSecondLinking; @@ -134,7 +134,7 @@ // font CMainControl.getInstance().setPlainFont(this); - needSecondLink = new Vector(); + needSecondLink = new Vector<TreasureTreeNode>(); processSecondLinking = false; // set special cell renderer @@ -160,7 +160,7 @@ * TODO: It would be nice to read this information from a simple datafile. */ public synchronized void initSpecialTreasureLists() { - specialTreasureLists = new Hashtable(); + specialTreasureLists = new Hashtable<String, TreasureTreeNode>(); final TreasureTreeNode godFolder = new TreasureTreeNode("God Intervention", TreasureObj.FOLDER); root.add(godFolder); @@ -240,9 +240,9 @@ * has been parsed. False when there is no data and tree remains empty. */ private boolean parseTreasures() { - final Vector tmpList = new Vector(); // tmp. container for all treasurelists - final Vector needLink = new Vector(); // all sub-treasurelist nodes that need linking - treasureTable = new Hashtable(); // hashtable for all treasureTreeNodes + final Vector<TreasureTreeNode> tmpList = new Vector<TreasureTreeNode>(); // tmp. container for all treasurelists + final Vector<TreasureTreeNode> needLink = new Vector<TreasureTreeNode>(); // all sub-treasurelist nodes that need linking + treasureTable = new Hashtable<String, TreasureTreeNode>(); // hashtable for all treasureTreeNodes // first step: parsing datafile, adding all treasurelists to the tmpList vector try { @@ -285,14 +285,14 @@ // Loop through all treasureone lists and calculate the real ratio // of chances (Summed up to be 100%). Also attach lists to tree model. for (int i = 0; i < tmpList.size(); i++) { - final TreasureTreeNode realNode = (TreasureTreeNode) tmpList.elementAt(i); + final TreasureTreeNode realNode = tmpList.elementAt(i); if (realNode.getTreasureObj().getType() == TreasureObj.TREASUREONE_LIST) { recalculateChances(realNode); } // check for special treasurelists, which are put in subfolders if (specialTreasureLists.containsKey(realNode.getTreasureObj().getName())) { - ((TreasureTreeNode) (specialTreasureLists.get(realNode.getTreasureObj().getName()))).add(realNode); + specialTreasureLists.get(realNode.getTreasureObj().getName()).add(realNode); } else { root.add(realNode); // normal treasurelist - attach to root node } @@ -301,10 +301,10 @@ // link the sub-lists first time for (int i = 0; i < needLink.size(); i++) { // 'node' is a sub-treasurelist which needs to be linked to it's content - final TreasureTreeNode node = (TreasureTreeNode) needLink.elementAt(i); + final TreasureTreeNode node = needLink.elementAt(i); // 'realNode' is the real instance of that treasurelist - final TreasureTreeNode realNode = (TreasureTreeNode) treasureTable.get(node.getTreasureObj().getName()); + final TreasureTreeNode realNode = treasureTable.get(node.getTreasureObj().getName()); if (realNode != null) { // set accurate type of treausrelist (one/multi) @@ -321,10 +321,10 @@ final int x = needSecondLink.size(); for (int i = 0; i < x; i++) { // 'node' is a sub-treasurelist which needs to be linked to it's content - final TreasureTreeNode node = (TreasureTreeNode) needSecondLink.elementAt(i); + final TreasureTreeNode node = needSecondLink.elementAt(i); // 'realNode' is the real instance of that treasurelist - final TreasureTreeNode realNode = (TreasureTreeNode) treasureTable.get(node.getTreasureObj().getName()); + final TreasureTreeNode realNode = treasureTable.get(node.getTreasureObj().getName()); if (realNode != null) { // set accurate type of treausrelist (one/multi) @@ -386,12 +386,12 @@ * is bubblesort because the expected number of objects is low (~300). * @param v Vector to be sorted */ - private void sortVector(final Vector v) { + private void sortVector(final Vector<TreasureTreeNode> v) { for (int j = 0; j < v.size() + 1; j++) { for (int i = 0; i < v.size() - 1; i++) { - if (((TreasureTreeNode) v.elementAt(i)).getTreasureObj().getName().compareToIgnoreCase( - ((TreasureTreeNode) v.elementAt(i + 1)).getTreasureObj().getName()) > 0) { - final Object node = v.elementAt(i); + if (v.elementAt(i).getTreasureObj().getName().compareToIgnoreCase( + v.elementAt(i + 1).getTreasureObj().getName()) > 0) { + final TreasureTreeNode node = v.elementAt(i); v.setElementAt(v.elementAt(i + 1), i); v.setElementAt(node, i + 1); } @@ -404,7 +404,7 @@ * @param parentNode parent treenode * @param needLink vector containing all sub-treasurelist nodes which need linking */ - private void readInsideList(final TreasureTreeNode parentNode, final BufferedReader reader, final Vector needLink) throws IOException { + private void readInsideList(final TreasureTreeNode parentNode, final BufferedReader reader, final Vector<TreasureTreeNode> needLink) throws IOException { String line; // read line of file TreasureTreeNode node = null; // tmp. treenode @@ -574,7 +574,7 @@ // set the position of the scrollbar final DefaultMutableTreeNode[] nnode = new DefaultMutableTreeNode[2]; nnode[0] = root; - nnode[1] = (DefaultMutableTreeNode) treasureTable.get(listName); + nnode[1] = treasureTable.get(listName); final TreePath tpath = new TreePath(nnode); expandPath(tpath); // expand pre-selected treasurelist setSelectionPath(tpath); // select it too Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-25 08:41:50 UTC (rev 423) @@ -145,7 +145,7 @@ private final ArchetypeSet archList; // the one and only arch list /** All open maps. */ - private final Vector levels = new Vector(1, 2); + private final Vector<MapControl> levels = new Vector<MapControl>(1, 2); /** The current top map we are working with */ private MapControl currentMap; @@ -367,8 +367,8 @@ */ void selectEditType(final int newType) { // calculate the new type for all opened maps: - for (Enumeration enu = levels.elements(); enu.hasMoreElements();) { - final MapControl level = (MapControl) enu.nextElement(); + for (Enumeration<MapControl> enu = levels.elements(); enu.hasMoreElements();) { + final MapControl level = enu.nextElement(); level.addEditType(newType); // calculate new type } @@ -666,8 +666,8 @@ // update the look and feel for all open map views if (levels.size() > 0) { - for (final Enumeration enu = levels.elements(); enu.hasMoreElements();) { - final MapControl level = (MapControl) enu.nextElement(); + for (final Enumeration<MapControl> enu = levels.elements(); enu.hasMoreElements();) { + final MapControl level = enu.nextElement(); level.getMapView().updateLookAndFeel(); if (log.isDebugEnabled()) { log.debug("map " + level.getMapName()); @@ -847,8 +847,8 @@ if (levels.size() > 0) { // get next open map we can find and set it to currentMap - for (final Enumeration enu = levels.elements(); enu.hasMoreElements();) { - currentMap = (MapControl) enu.nextElement(); + for (final Enumeration<MapControl> enu = levels.elements(); enu.hasMoreElements();) { + currentMap = enu.nextElement(); } } } @@ -1301,8 +1301,8 @@ /** Invoked when user wants to exit from the program. */ void exitWanted() { if (levels.size() > 0) { - for (final Enumeration enu = levels.elements(); enu.hasMoreElements();) { - final MapControl level = (MapControl) enu.nextElement(); + for (final Enumeration<MapControl> enu = levels.elements(); enu.hasMoreElements();) { + final MapControl level = enu.nextElement(); closeLevel(level, false); } } @@ -1827,7 +1827,7 @@ } public MapControl[] getOpenedMaps() { - return (MapControl[]) levels.toArray(new MapControl[levels.size()]); + return levels.toArray(new MapControl[levels.size()]); } public MapControl getCurrentMap() { Modified: trunk/crossfire/src/cfeditor/CMainToolbar.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-09-25 08:41:50 UTC (rev 423) @@ -143,7 +143,7 @@ setMargin(new Insets(IGUIConstants.DIALOG_INSETS, 0, IGUIConstants.DIALOG_INSETS, IGUIConstants.DIALOG_INSETS)); - final Vector buttons = new Vector(10, 2); + final Vector<JButton> buttons = new Vector<JButton>(10, 2); m_new = new CFancyButton( checkLabel("New"), "New Map", @@ -265,14 +265,14 @@ // If icons and labels are visible make buttons square shaped if (m_eIconAndLabelVisibility == SHOW_ICONS_AND_LABELS) { int maxWidth = 16; - for (Enumeration enu = buttons.elements(); + for (Enumeration<JButton> enu = buttons.elements(); enu.hasMoreElements();) { - final JButton button = (JButton) enu.nextElement(); + final JButton button = enu.nextElement(); maxWidth = Math.max(maxWidth, button.getWidth()); } - for (final Enumeration enu = buttons.elements(); enu.hasMoreElements();) { - final JButton button = (JButton) enu.nextElement(); + for (final Enumeration<JButton> enu = buttons.elements(); enu.hasMoreElements();) { + final JButton button = enu.nextElement(); final Dimension size = new Dimension(maxWidth, maxWidth); button.setSize(size); button.setMinimumSize(size); Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-09-25 08:41:50 UTC (rev 423) @@ -716,7 +716,7 @@ grfx.fillRect(0, 0, getWidth(), getHeight()); // ---------- draw rectangular map -------------- // this vector contains all heads of multi-tiles with oversized images - final Vector oversizedMultiHeads = new Vector(); + final Vector<GameObject> oversizedMultiHeads = new Vector<GameObject>(); final CFilterControl filter = mainControl.getFilterControl(); for (int y = 0; y < mapSize.getHeight(); y++) { for (int x = 0; x < mapSize.getWidth(); x++) { @@ -771,7 +771,7 @@ } // at the end, we have to draw the oversized multipart images on top of the rest for (int i = 0; i < oversizedMultiHeads.size(); i++) { - final GameObject node = (GameObject) (oversizedMultiHeads.elementAt(i)); + final GameObject node = oversizedMultiHeads.elementAt(i); archlist.getFace(node.getFaceNr()).paintIcon(this, grfx, node.getMapX() * 32 + bOffset, node.getMapY() * 32 + bOffset); } Modified: trunk/crossfire/src/cfeditor/CScriptController.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptController.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/CScriptController.java 2006-09-25 08:41:50 UTC (rev 423) @@ -46,11 +46,11 @@ private static final Logger log = Logger.getLogger(CScriptController.class); - private final LinkedHashMap scripts = new LinkedHashMap(); + private final LinkedHashMap<String, CScriptModel> scripts = new LinkedHashMap<String, CScriptModel>(); private final CScriptView view; - private final HashSet listeners = new HashSet(); + private final HashSet<ChangeListener> listeners = new HashSet<ChangeListener>(); private final CMainControl mainControl; @@ -66,7 +66,7 @@ } public String[] listScript() { - return (String[]) (scripts.keySet().toArray(new String[]{})); + return scripts.keySet().toArray(new String[]{}); } public void addScript(final CScriptModel script) { @@ -175,8 +175,8 @@ public void exportXML(final OutputStream destination) { final Element root = new Element("scripts"); final Document d = new Document(root); - for (Iterator i = scripts.values().iterator(); i.hasNext();) { - final CScriptModel sm = (CScriptModel) i.next(); + for (Iterator<CScriptModel> i = scripts.values().iterator(); i.hasNext();) { + final CScriptModel sm = i.next(); root.addContent(sm.toXML()); } final XMLOutputter out = new XMLOutputter(); @@ -262,7 +262,7 @@ } public void runScript(final String name) { - final CScriptModel model = (CScriptModel) scripts.get(name); + final CScriptModel model = scripts.get(name); runScript(model); } @@ -282,10 +282,10 @@ } @Nullable public CScriptModel getScript(int index) { - final Iterator i = scripts.values().iterator(); + final Iterator<CScriptModel> i = scripts.values().iterator(); CScriptModel m = null; while (i.hasNext() && index-- >= 0) { - m = (CScriptModel) i.next(); + m = i.next(); } if (index >= 0) { return null; @@ -295,7 +295,7 @@ } public CScriptModel getScript(final String name) { - return (CScriptModel) scripts.get(name); + return scripts.get(name); } public int getScriptCount() { @@ -312,7 +312,7 @@ private void notifyListeners() { final ChangeEvent e = new ChangeEvent(this); - for (Iterator i = listeners.iterator(); i.hasNext(); ((ChangeListener) i.next()).stateChanged(e)) { + for (Iterator<ChangeListener> i = listeners.iterator(); i.hasNext(); i.next().stateChanged(e)) { ; } } Modified: trunk/crossfire/src/cfeditor/CScriptModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptModel.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/CScriptModel.java 2006-09-25 08:41:50 UTC (rev 423) @@ -49,7 +49,7 @@ private int scriptType; - private final HashSet listeners = new HashSet(); + private final HashSet<ChangeListener> listeners = new HashSet<ChangeListener>(); private final CScriptController ctrl; @@ -234,14 +234,14 @@ } public String[] getParameters() { - final ArrayList l = new ArrayList(); - for (Iterator it = params.iterator(); it.hasNext();) { - final PluginParameter p = (PluginParameter) it.next(); + final ArrayList<String> l = new ArrayList<String>(); + for (Iterator<PluginParameter> it = params.iterator(); it.hasNext();) { + final PluginParameter p = it.next(); if (!l.contains(p.getName())) { l.add(p.getName()); } } - return (String[]) l.toArray(new String[]{}); + return l.toArray(new String[]{}); } private int locateParam(final String name) { @@ -285,7 +285,7 @@ /** Tell all listeners plugged on this CScriptModel its content has changed. */ private void notifyListeners() { final ChangeEvent e = new ChangeEvent(this); - for (Iterator i = listeners.iterator(); i.hasNext(); ((ChangeListener) i.next()).stateChanged(e)) { + for (Iterator<ChangeListener> i = listeners.iterator(); i.hasNext(); i.next().stateChanged(e)) { ; } } @@ -392,9 +392,9 @@ if (mode == null) { scriptType = PLUGIN_SCRIPT; } else { - final List modes = mode.getChildren(); - for (Iterator i = modes.iterator(); i.hasNext();) { - final Element m = (Element) i.next(); + final List<Element> modes = mode.getChildren(); + for (Iterator<Element> i = modes.iterator(); i.hasNext();) { + final Element m = i.next(); final boolean b = Boolean.valueOf(m.getTextTrim()).booleanValue(); final String name = m.getName(); if ("autoboot".equalsIgnoreCase(name) && b) { @@ -406,10 +406,10 @@ } } } - final List params = node.getChildren("parameter"); + final List<Element> params = node.getChildren("parameter"); if (params != null && !params.isEmpty()) { for (int j = 0; j < params.size(); j++) { - final Element parameter = (Element) params.get(j); + final Element parameter = params.get(j); final PluginParameter p = PluginParameterFactory.createParameter(parameter); addParameter(p); } @@ -444,7 +444,7 @@ } root.addContent(modes); - for (Iterator i = params.iterator(); i.hasNext(); root.addContent(((PluginParameter) i.next()).toXML())) { + for (Iterator<PluginParameter> i = params.iterator(); i.hasNext(); root.addContent(i.next().toXML())) { ; } return root; Modified: trunk/crossfire/src/cfeditor/CScriptView.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptView.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/CScriptView.java 2006-09-25 08:41:50 UTC (rev 423) @@ -112,7 +112,7 @@ menu.setToolTipText("Manage and use beanshell plugins"); } final String[] scripts = ctrl.listScript(); - final ArrayList visibleScripts = new ArrayList(); + final ArrayList<JMenuItem> visibleScripts = new ArrayList<JMenuItem>(); for (int i = 0; i < scripts.length; i++) { if (!ctrl.getScript(scripts[i]).isBash()) { continue; @@ -125,7 +125,7 @@ menu.add(item); visibleScripts.add(item); } - entryScript = (JMenuItem[]) visibleScripts.toArray(new JMenuItem[0]); + entryScript = visibleScripts.toArray(new JMenuItem[0]); if (entryScript.length == 0) { final JMenuItem def = new JMenuItem("no scripts available"); def.setEnabled(false); Modified: trunk/crossfire/src/cfeditor/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/FaceObject.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/FaceObject.java 2006-09-25 08:41:50 UTC (rev 423) @@ -88,7 +88,7 @@ log.debug("Getting soft reference to " + name); } if (face != null) { - final ImageIcon icon = (ImageIcon) ((Reference) face).get(); + final ImageIcon icon = ((Reference<ImageIcon>) face).get(); if (icon != null) { return icon; } @@ -124,7 +124,7 @@ public void setFace(final ImageIcon im) { if (isLazyLoading) { - face = new SoftReference(im); + face = new SoftReference<ImageIcon>(im); } else { face = im; } Modified: trunk/crossfire/src/cfeditor/JFontChooser.java =================================================================== --- trunk/crossfire/src/cfeditor/JFontChooser.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/JFontChooser.java 2006-09-25 08:41:50 UTC (rev 423) @@ -244,7 +244,7 @@ } protected void updateFont() { - final Map fontAttrs = new HashMap(); + final Map<TextAttribute, Object> fontAttrs = new HashMap<TextAttribute, Object>(); fontAttrs.put(TextAttribute.FAMILY, (String) familyCombo.getSelectedItem()); fontAttrs.put(TextAttribute.SIZE, new Float((String) sizeCombo.getSelectedItem())); Modified: trunk/crossfire/src/cfeditor/JarResources.java =================================================================== --- trunk/crossfire/src/cfeditor/JarResources.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/JarResources.java 2006-09-25 08:41:50 UTC (rev 423) @@ -55,9 +55,9 @@ private static final Logger log = Logger.getLogger(JarResources.class); // jar resource mapping tables - private final Hashtable htSizes = new Hashtable(); + private final Hashtable<String, Integer> htSizes = new Hashtable<String, Integer>(); - private final Hashtable htJarContents = new Hashtable(); + private final Hashtable<String, byte[]> htJarContents = new Hashtable<String, byte[]>(); // a jar file private String jarFileName; @@ -97,7 +97,7 @@ * @return array of bytes */ public byte[] getResource(final String name) { - return (byte[]) htJarContents.get(name); + return htJarContents.get(name); } /** initializes internal hash tables with Jar file resources. */ @@ -105,9 +105,9 @@ try { // extracts just sizes only. final ZipFile zf = new ZipFile(jarFileName); - final Enumeration e = zf.entries(); + final Enumeration<? extends ZipEntry> e = zf.entries(); while (e.hasMoreElements()) { - final ZipEntry ze = (ZipEntry) e.nextElement(); + final ZipEntry ze = e.nextElement(); if (log.isDebugEnabled()) { log.debug(dumpZipEntry(ze)); } @@ -131,7 +131,7 @@ int size = (int) ze.getSize(); // -1 means unknown size. if (size == -1) { - size = ((Integer) htSizes.get(ze.getName())).intValue(); + size = htSizes.get(ze.getName()).intValue(); } final byte[] b = new byte[(int) size]; int rb = 0; Modified: trunk/crossfire/src/cfeditor/PluginParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/PluginParameter.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/PluginParameter.java 2006-09-25 08:41:50 UTC (rev 423) @@ -29,7 +29,7 @@ private String name; - private final HashSet listeners = new HashSet(); + private final HashSet<ChangeListener> listeners = new HashSet<ChangeListener>(); protected String parameterType; @@ -104,7 +104,7 @@ protected void fireDataChanged() { final ChangeEvent e = new ChangeEvent(this); - for (Iterator i = listeners.iterator(); i.hasNext(); ((ChangeListener) i.next()).stateChanged(e)) { + for (Iterator<ChangeListener> i = listeners.iterator(); i.hasNext(); i.next().stateChanged(e)) { ; } } Modified: trunk/crossfire/src/cfeditor/PluginParameterFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/PluginParameterFactory.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/PluginParameterFactory.java 2006-09-25 08:41:50 UTC (rev 423) @@ -29,10 +29,10 @@ private static final Logger log = Logger.getLogger(PluginParameterFactory.class); - private static final LinkedHashMap parameterTypes; + private static final LinkedHashMap<String, Class<? extends PluginParameter>> parameterTypes; static { - parameterTypes = new LinkedHashMap(); + parameterTypes = new LinkedHashMap<String, Class<? extends PluginParameter>>(); parameterTypes.put(StringParameter.getParameterType(), StringParameter.class); parameterTypes.put(IntegerParameter.getParameterType(), IntegerParameter.class); parameterTypes.put(DoubleParameter.getParameterType(), DoubleParameter.class); @@ -55,7 +55,7 @@ type = "java.lang.String"; } - final Class c = (Class) parameterTypes.get(type); + final Class<? extends PluginParameter> c = parameterTypes.get(type); if (c == null) { return null; } @@ -65,7 +65,7 @@ log.debug("trying to instance a class of type " + c.getName()); } - final PluginParameter p = (PluginParameter) c.newInstance(); + final PluginParameter p = c.newInstance(); return p; } catch (final Exception e) { e.printStackTrace(); @@ -78,13 +78,13 @@ type = "java.lang.String"; } - final Class c = (Class) parameterTypes.get(type); + final Class<? extends PluginParameter> c = parameterTypes.get(type); if (c == null) { return null; } try { - final PluginParameter p = (PluginParameter) c.newInstance(); + final PluginParameter p = c.newInstance(); p.fromXML(parameterNode); return p; } catch (Exception e) { @@ -98,6 +98,6 @@ } public static String[] getTypes() { - return (String[]) parameterTypes.keySet().toArray(new String[parameterTypes.size()]); + return parameterTypes.keySet().toArray(new String[parameterTypes.size()]); } } Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-09-25 08:41:50 UTC (rev 423) @@ -170,7 +170,7 @@ private AutojoinList join; // if nonzero, pointing to the list of autojoining archetypes - private final HashMap cachedAttribute = new HashMap(); + private final HashMap<String, String> cachedAttribute = new HashMap<String, String>(); /** Create an GameObject. */ public GameObject() { @@ -610,7 +610,7 @@ } if (inv == Collections.EMPTY_LIST) { - inv = new LinkedList(); + inv = new LinkedList<GameObject>(); } inv.add(arch); @@ -1480,7 +1480,7 @@ } private String getCachedAttributeValue(final String name) { - return (String) cachedAttribute.get(name); + return cachedAttribute.get(name); } /** {@inheritDoc} */ Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-09-25 08:41:50 UTC (rev 423) @@ -303,7 +303,7 @@ private String currentFilter = ""; - private ArrayList subFilters = new ArrayList(); + private ArrayList<GameObject[]> subFilters = new ArrayList<GameObject[]>(); private static final long serialVersionUID = 1L; @@ -312,9 +312,9 @@ for (int i = 0; i < mainControl.getArchCount(); i++) { archList[i] = mainControl.getArch(i); } - Arrays.sort(archList, new Comparator() { - public int compare(final Object o1, final Object o2) { - return ((GameObject) o1).getArchetypeName().toLowerCase().compareTo(((GameObject) o2).getArchetypeName().toLowerCase()); + Arrays.sort(archList, new Comparator<GameObject>() { + public int compare(final GameObject o1, final GameObject o2) { + return o1.getArchetypeName().toLowerCase().compareTo(o2.getArchetypeName().toLowerCase()); } }); subFilters.add(archList); @@ -366,7 +366,7 @@ } private GameObject getNearsetMatch(final String name) { - int pos = Arrays.binarySearch(archList, name, new Comparator() { + int pos = Arrays.binarySearch(archList, name, new Comparator<Object>() { public int compare(final Object o1, final Object o2) { final String s1; final String s2; Modified: trunk/crossfire/src/cfeditor/gui/ScriptEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-09-25 08:41:50 UTC (rev 423) @@ -73,13 +73,13 @@ private String uuid = null; - private final Hashtable paramNameEditors = new Hashtable(); + private final Hashtable<PluginParameter, ParameterNameEditor> paramNameEditors = new Hashtable<PluginParameter, ParameterNameEditor>(); - private final Hashtable paramDescriptionEditors = new Hashtable(); + private final Hashtable<PluginParameter, ParameterDescriptionEditor> paramDescriptionEditors = new Hashtable<PluginParameter, ParameterDescriptionEditor>(); - private final Hashtable paramTypeEditors = new Hashtable(); + private final Hashtable<PluginParameter, ParameterTypeEditor> paramTypeEditors = new Hashtable<PluginParameter, ParameterTypeEditor>(); - private final Hashtable paramViews = new Hashtable(); + private final Hashtable<PluginParameter, PluginParameterView> paramViews = new Hashtable<PluginParameter, PluginParameterView>(); private int selectedRow = -1; @@ -318,7 +318,7 @@ log.debug("Doing " + param); } - ParameterNameEditor o = (ParameterNameEditor) paramNameEditors.get(param); + ParameterNameEditor o = paramNameEditors.get(param); if (o != null) { return o; } @@ -330,7 +330,7 @@ } private ParameterDescriptionEditor getParameterDescriptionEditor(final PluginParameter param) { - ParameterDescriptionEditor o = (ParameterDescriptionEditor) paramDescriptionEditors.get(param); + ParameterDescriptionEditor o = paramDescriptionEditors.get(param); if (o != null) { return o; } @@ -342,7 +342,7 @@ } private ParameterTypeEditor getParameterTypeEditor(final PluginParameter param) { - ParameterTypeEditor o = (ParameterTypeEditor) paramTypeEditors.get(param); + ParameterTypeEditor o = paramTypeEditors.get(param); if (o != null) { return o; } @@ -354,7 +354,7 @@ } private PluginParameterView getParameterView(final PluginParameter param) { - PluginParameterView o = (PluginParameterView) paramViews.get(param); + PluginParameterView o = paramViews.get(param); if (o != null) { return o; } Modified: trunk/crossfire/src/cfeditor/gui/ScriptManager.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-09-25 08:41:50 UTC (rev 423) @@ -51,7 +51,7 @@ private final CScriptController ctrl; - private final HashMap components = new HashMap(); + private final HashMap<CScriptModel, ScriptEditor> components = new HashMap<CScriptModel, ScriptEditor>(); private static final long serialVersionUID = 1L; @@ -158,7 +158,7 @@ return; } - ScriptEditor c = (ScriptEditor) components.get(model); + ScriptEditor c = components.get(model); if (c == null) { c = new ScriptEditor(model); components.put(model, c); @@ -168,7 +168,7 @@ } private void removeScript(final CScriptModel model) { - final ScriptEditor c = (ScriptEditor) components.get(model); + final ScriptEditor c = components.get(model); if (c != null) { components.remove(model); scriptPanel.remove(c); Modified: trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java 2006-09-25 08:41:50 UTC (rev 423) @@ -77,7 +77,7 @@ * List of handled submenus as AggregateMenuLocation.WrappedMenuLocation * objects. */ - private final LinkedHashMap subMenus; + private final LinkedHashMap<String, WrappedMenuLocation> subMenus; private String name; @@ -85,7 +85,7 @@ public AggregateMenuLocation(final String name) { super(name); - subMenus = new LinkedHashMap(); + subMenus = new LinkedHashMap<String, WrappedMenuLocation>(); } public void addMenuLocation(final MenuLocation location) { @@ -108,7 +108,7 @@ * AggregateMenuLocation name as parent. It is a relative path. */ @Nullable public MenuLocation getMenuLocation(final String location) { - final WrappedMenuLocation wml = (WrappedMenuLocation) subMenus.get(location); + final WrappedMenuLocation wml = subMenus.get(location); if (wml != null) { return wml.getLocation(); } else { @@ -121,8 +121,8 @@ return true; } - for (Iterator i = subMenus.values().iterator(); i.hasNext();) { - if (((MenuLocation) i.next()).contains(entry)) { + for (Iterator<WrappedMenuLocation> i = subMenus.values().iterator(); i.hasNext();) { + if (i.next().contains(entry)) { return true; } } @@ -140,8 +140,8 @@ } this.menuManager = menuManager; if (!subMenus.isEmpty()) { - for (Iterator i = subMenus.values().iterator(); i.hasNext();) { - menuManager.addMenuLocation((MenuLocation) i.next()); + for (Iterator<WrappedMenuLocation> i = subMenus.values().iterator(); i.hasNext();) { + menuManager.addMenuLocation(i.next()); } } } Modified: trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-09-25 08:41:50 UTC (rev 423) @@ -35,11 +35,11 @@ private char mnemonic; - private final ArrayList listeners = new ArrayList(); + private final ArrayList<ActionListener> listeners = new ArrayList<ActionListener>(); - private final ArrayList refs = new ArrayList(); + private final ArrayList<WeakReference<JComponent>> refs = new ArrayList<WeakReference<JComponent>>(); - private final ReferenceQueue componentQueue = new ReferenceQueue(); + private final ReferenceQueue<JComponent> componentQueue = new ReferenceQueue<JComponent>(); private String name; @@ -88,10 +88,10 @@ return action; } - private void referenceItem(final Object item) { + private void referenceItem(final JComponent item) { log.debug("referenceMenuItem()"); synchronized (refs) { - refs.add(new WeakReference(item, componentQueue)); + refs.add(new WeakReference<JComponent>(item, componentQueue)); } } @@ -118,9 +118,9 @@ public void actionPerformed(final ActionEvent e) { synchronized (listeners) { - for (Iterator i = listeners.iterator(); i.hasNext();) { + for (Iterator<ActionListener> i = listeners.iterator(); i.hasNext();) { log.debug("One more actionPerformed Listerner"); - ((ActionListener) i.next()).actionPerformed(e); + i.next().actionPerformed(e); } } log.debug("Acton performed done"); @@ -136,9 +136,9 @@ update(); cleanUpQueue(componentQueue); synchronized (refs) { - for (Iterator i = refs.iterator(); i.hasNext();) { - final WeakReference wf = (WeakReference) i.next(); - final JComponent item = (JComponent) wf.get(); + for (Iterator<WeakReference<JComponent>> i = refs.iterator(); i.hasNext();) { + final WeakReference<JComponent> wf = i.next(); + final JComponent item = wf.get(); if (log.isDebugEnabled()) { log.debug("Updating item: " + item); } Modified: trunk/crossfire/src/cfeditor/menu/MenuManager.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/MenuManager.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/menu/MenuManager.java 2006-09-25 08:41:50 UTC (rev 423) @@ -17,9 +17,9 @@ private final Logger log = Logger.getLogger(MenuManager.class); - private final HashMap locations = new HashMap(); + private final HashMap<String, MenuLocation> locations = new HashMap<String, MenuLocation>(); - private final HashMap listeners = new HashMap(); + private final HashMap<String, Set<MenuListener>> listeners = new HashMap<String, Set<MenuListener>>(); private static final MenuManager theManager = new MenuManager(); @@ -34,7 +34,7 @@ * @param entry the MenuEntry to add to the location */ public void addMenuEntry(final String location, final MenuEntry entry) { /** lock-end */ - final MenuLocation loc = (MenuLocation) locations.get(location); + final MenuLocation loc = locations.get(location); if (loc == null) { log.warn("Location " + location + " was not found to add a menu entry"); } else { @@ -46,11 +46,11 @@ * i wrote this code without thinking *** - Iterator i = locations.keySet().iterator(); + Iterator<String> i = locations.keySet().iterator(); for (; i.hasNext(); ) { Object o = i.next(); if (location.equals(o)) { - ((MenuLocation)locations.get(o)).addMenuEntry(entry); + locations.get(o).addMenuEntry(entry); return; } } @@ -65,9 +65,9 @@ */ public void removeMenuEntry(final MenuEntry entry) { log.debug("Removing all instance of a menu entry"); - final Iterator i = locations.values().iterator(); + final Iterator<MenuLocation> i = locations.values().iterator(); for (; i.hasNext();) { - ((MenuLocation) i.next()).removeMenuEntry(entry); + i.next().removeMenuEntry(entry); } } @@ -81,7 +81,7 @@ log.debug("removing MenuEntry " + entry + " from " + location); } - final MenuLocation loc = (MenuLocation) locations.get(location); + final MenuLocation loc = locations.get(location); if (loc == null) { log.warn("Location " + location + " was not found to remove a menu entry"); } else { @@ -119,17 +119,17 @@ log.debug("GetMenuLocation called for " + location); } } - return (MenuLocation) locations.get(location); + return locations.get(location); } - private Set getListeners(final String location) { + private Set<MenuListener> getListeners(final String location) { if (log.isDebugEnabled()) { log.debug("returning Listeners for " + location); } - Set listeners = (Set) this.listeners.get(location); + Set<MenuListener> listeners = this.listeners.get(location); if (listeners == null) { - listeners = new HashSet(); + listeners = new HashSet<MenuListener>(); this.listeners.put(location, listeners); } return listeners; @@ -151,7 +151,7 @@ log.warn("Adding a Listener to an inexistent Location: " + location); } - final Set listeners = getListeners(location); + final Set<MenuListener> listeners = getListeners(location); listeners.add(listener); } @@ -164,8 +164,8 @@ log.debug("Removing listener " + listener + " from all locations"); } - for (Iterator i = listeners.values().iterator(); i.hasNext();) { - final Set s = (Set) i.next(); + for (Iterator<Set<MenuListener>> i = listeners.values().iterator(); i.hasNext();) { + final Set<MenuListener> s = i.next(); s.remove(listener); } } @@ -183,12 +183,12 @@ log.debug("fireMenuEntryChange(" + location + ", " + entry + ", " + type); } - final MenuLocation loc = (MenuLocation) locations.get(location); + final MenuLocation loc = locations.get(location); if (loc != null) { - final Set s = getListeners(location); + final Set<MenuListener> s = getListeners(location); final MenuChangeEvent e = new MenuChangeEvent(loc, entry, type); - for (Iterator i = s.iterator(); i.hasNext();) { - ((MenuListener) (i.next())).menuChanged(e); + for (Iterator<MenuListener> i = s.iterator(); i.hasNext();) { + i.next().menuChanged(e); } } else { log.warn("Tried to notify a change to unknown location " + location); @@ -207,9 +207,9 @@ log.debug("fireMenuEntryChange(" + entry + ", " + type); } - final HashSet l = new HashSet(); - for (Iterator i = locations.values().iterator(); i.hasNext();) { - final MenuLocation ml = ((MenuLocation) i.next()); + final HashSet<MenuListener> l = new HashSet<MenuListener>(); + for (Iterator<MenuLocation> i = locations.values().iterator(); i.hasNext();) { + final MenuLocation ml = i.next(); if (!ml.contains(entry)) { continue; } @@ -221,8 +221,8 @@ * ensure each listener is notified only once. */ final MenuChangeEvent e = new MenuChangeEvent(null, entry, type); - for (Iterator i = l.iterator(); i.hasNext();) { - ((MenuListener) i.next()).menuChanged(e); + for (Iterator<MenuListener> i = l.iterator(); i.hasNext();) { + i.next().menuChanged(e); } } Modified: trunk/crossfire/src/cfeditor/menu/SimpleMenuLocation.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/SimpleMenuLocation.java 2006-09-24 23:04:34 UTC (rev 422) +++ trunk/crossfire/src/cfeditor/menu/SimpleMenuLocation.java 2006-09-25 08:41:50 UTC (rev 423) @@ -18,7 +18,7 @@ */ public class SimpleMenuLocation implements MenuLocation { - private final LinkedHashSet entries; + private final LinkedHashSet<MenuEntry> entries; private final String name; @@ -28,7 +28,7 @@ */ public SimpleMenuLocation(final String name) { super(); - entries = new LinkedHashSet(); + entries = new LinkedHashSet<MenuEntry>(); this.name = name; } @@ -57,9 +57,9 @@ } /** @see MenuLocation#getMenuEntries() */ - public Set getMenuEntries() { + public Set<MenuEntry> getMenuEntries() { synchronized (entries) { - return (Set) entries.clone(); + return (Set<MenuEntry>) entries.clone(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-24 23:05:53
|
Revision: 422 http://svn.sourceforge.net/gridarta/?rev=422&view=rev Author: christianhujer Date: 2006-09-24 16:04:34 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Ran IntelliJ IDEA import optimization over all .java files. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CFilterControl.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/crossfire/src/cfeditor/FaceObject.java trunk/crossfire/src/cfeditor/MultiPositionData.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/gameobject/ArchObjectParser.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/parameter/ArchParameter.java trunk/daimonin/src/daieditor/CArchPanel.java trunk/daimonin/src/daieditor/CArchPanelPan.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/CMapArchPanel.java trunk/daimonin/src/daieditor/CMapFileDecode.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/CNewMapDialog.java trunk/daimonin/src/daieditor/CPreview.java trunk/daimonin/src/daieditor/MultiPositionData.java trunk/daimonin/src/daieditor/ScriptArchData.java trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/GameObjectContainer.java trunk/daimonin/src/daieditor/gameobject/NamedObject.java trunk/daimonin/src/daieditor/gameobject/RecursiveGameObjectIterator.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java trunk/daimonin/src/daieditor/gui/DirectionLayout.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/daimonin/src/daieditor/map/MapModel.java trunk/daimonin/src/daieditor/map/validation/checks/MapDifficultyChecker.java trunk/src/app/net/sf/gridarta/io/CFileReader.java trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java trunk/src/app/net/sf/gridarta/map/MapArchObject.java trunk/src/app/net/sf/gridarta/map/MapModel.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java trunk/src/test/net/sf/gridarta/Size2DTest.java trunk/src/test/net/sf/gridarta/gui/HideFileFilterProxyTest.java Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2006-09-24 23:04:34 UTC (rev 422) @@ -24,14 +24,14 @@ package cfeditor; +import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; -import cfeditor.gameobject.ArchetypeSet; import cfeditor.map.MapModel; import java.io.FileNotFoundException; import java.io.IOException; +import net.sf.gridarta.io.CFileReader; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; -import net.sf.gridarta.io.CFileReader; /** * The <code>AutojoinList</code> class contains a list of (typically wall-)arches which Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-09-24 23:04:34 UTC (rev 422) @@ -24,8 +24,8 @@ package cfeditor; -import cfeditor.gameobject.GameObject; import cfeditor.gameobject.ArchetypeSet; +import cfeditor.gameobject.GameObject; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -66,7 +66,6 @@ import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; -import cfeditor.GridderException; import net.sf.gridarta.help.Help; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-09-24 23:04:34 UTC (rev 422) @@ -39,6 +39,7 @@ import java.util.Vector; import javax.swing.JFileChooser; import javax.swing.filechooser.FileFilter; +import net.sf.gridarta.io.CFileReader; import org.apache.log4j.Logger; import org.jdom.Attribute; import org.jdom.DataConversionException; @@ -46,7 +47,6 @@ import org.jdom.Element; import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; -import net.sf.gridarta.io.CFileReader; /** * This class handles all the CFArchTypes and makes them conveniently Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-09-24 23:04:34 UTC (rev 422) @@ -24,8 +24,8 @@ package cfeditor; -import cfeditor.gameobject.GameObject; import cfeditor.gameobject.ArchetypeSet; +import cfeditor.gameobject.GameObject; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -52,7 +52,6 @@ import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreePath; -import cfeditor.GridderException; import net.sf.gridarta.help.Help; import net.sf.gridarta.io.CFileReader; import org.apache.log4j.Logger; Modified: trunk/crossfire/src/cfeditor/CFilterControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CFilterControl.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/CFilterControl.java 2006-09-24 23:04:34 UTC (rev 422) @@ -7,7 +7,6 @@ package cfeditor; -import cfeditor.gameobject.GameObject; import cfeditor.filter.ConfigEvent; import cfeditor.filter.ConfigListener; import cfeditor.filter.Filter; @@ -15,6 +14,7 @@ import cfeditor.filter.NamedFilterEvent; import cfeditor.filter.NamedFilterList; import cfeditor.filter.NamedFilterListener; +import cfeditor.gameobject.GameObject; import cfeditor.map.MapControl; import cfeditor.menu.BasicMenuEntry; import javax.swing.JComponent; Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-24 23:04:34 UTC (rev 422) @@ -24,9 +24,9 @@ package cfeditor; -import cfeditor.gameobject.GameObject; import cfeditor.gameobject.ArchObjectParser; import cfeditor.gameobject.ArchetypeSet; +import cfeditor.gameobject.GameObject; import cfeditor.gameobject.anim.AnimationObjects; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; @@ -36,8 +36,8 @@ import java.awt.Rectangle; import java.awt.Toolkit; import java.io.File; -import java.io.IOException; import java.io.FileNotFoundException; +import java.io.IOException; import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator; @@ -53,18 +53,17 @@ import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.filechooser.FileFilter; -import cfeditor.GridderException; -import net.sf.gridarta.Size2D; -import net.sf.gridarta.MainControl; import net.sf.gridarta.CUndoStack; -import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; +import net.sf.gridarta.MainControl; +import net.sf.gridarta.Size2D; import net.sf.gridarta.gui.HideFileFilterProxy; +import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.filter.file.EndingFileFilter; import org.apache.log4j.Logger; -import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * The main controller of the level editor. Basically the main application. Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-09-24 23:04:34 UTC (rev 422) @@ -24,8 +24,8 @@ package cfeditor; +import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; -import cfeditor.gameobject.ArchetypeSet; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; Modified: trunk/crossfire/src/cfeditor/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-09-24 23:04:34 UTC (rev 422) @@ -28,15 +28,15 @@ import cfeditor.map.MapArchObject; import java.io.BufferedReader; import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; -import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.List; +import net.sf.gridarta.io.CFileReader; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; -import net.sf.gridarta.io.CFileReader; /** * This class handles the reading of a mapfile and parsing the data Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-09-24 23:04:34 UTC (rev 422) @@ -52,7 +52,6 @@ import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; -import cfeditor.GridderException; import net.sf.gridarta.Size2D; import net.sf.gridarta.help.Help; Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-09-24 23:04:34 UTC (rev 422) @@ -24,9 +24,9 @@ package cfeditor; +import cfeditor.filter.AttributeFilter; +import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; -import cfeditor.gameobject.ArchetypeSet; -import cfeditor.filter.AttributeFilter; import cfeditor.map.MapControl; import cfeditor.map.MapModel; import com.visualtek.png.PNGEncoder; Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-09-24 23:04:34 UTC (rev 422) @@ -24,8 +24,8 @@ package cfeditor; +import cfeditor.gameobject.ArchObjectParser; import cfeditor.gameobject.GameObject; -import cfeditor.gameobject.ArchObjectParser; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import java.io.File; Modified: trunk/crossfire/src/cfeditor/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/FaceObject.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/FaceObject.java 2006-09-24 23:04:34 UTC (rev 422) @@ -26,14 +26,13 @@ import com.sixlegs.image.png.PngImage; import java.awt.Toolkit; -import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.lang.ref.Reference; import java.lang.ref.SoftReference; import javax.swing.ImageIcon; +import net.sf.gridarta.io.CFileInputStream; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; -import net.sf.gridarta.io.CFileInputStream; /** * The <code>FaceObject</code> Modified: trunk/crossfire/src/cfeditor/MultiPositionData.java =================================================================== --- trunk/crossfire/src/cfeditor/MultiPositionData.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/MultiPositionData.java 2006-09-24 23:04:34 UTC (rev 422) @@ -28,8 +28,8 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.StringTokenizer; +import net.sf.gridarta.io.CFileReader; import org.apache.log4j.Logger; -import net.sf.gridarta.io.CFileReader; /** * The MultiPositionData class stores an array of numbers which is required Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-09-24 23:04:34 UTC (rev 422) @@ -47,8 +47,8 @@ import javax.swing.JPanel; import javax.swing.JTextField; import static javax.swing.WindowConstants.HIDE_ON_CLOSE; +import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.util.Arrays2; -import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; Modified: trunk/crossfire/src/cfeditor/gameobject/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchObjectParser.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/gameobject/ArchObjectParser.java 2006-09-24 23:04:34 UTC (rev 422) @@ -35,6 +35,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import net.sf.gridarta.io.CFileReader; import org.apache.log4j.Logger; import org.jdom.DataConversionException; import org.jdom.Document; @@ -42,7 +43,6 @@ import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; import org.jetbrains.annotations.Nullable; -import net.sf.gridarta.io.CFileReader; /** * The <code>ArchObjectParser</code> class handles the parsing of arches. It is Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-09-24 23:04:34 UTC (rev 422) @@ -55,10 +55,10 @@ import javax.swing.JPanel; import javax.swing.JProgressBar; import javax.swing.SwingConstants; +import net.sf.gridarta.io.CFileInputStream; +import net.sf.gridarta.io.CFileReader; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; -import net.sf.gridarta.io.CFileInputStream; -import net.sf.gridarta.io.CFileReader; /** * The <code>ArchetypeSet</code> contains all the Archetypes. Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-09-24 23:04:34 UTC (rev 422) @@ -41,8 +41,8 @@ import java.util.List; import javax.swing.JList; import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; /** * The <code>GameObject</code> class handles the Crossfire GameObjects. Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-24 23:04:34 UTC (rev 422) @@ -27,14 +27,14 @@ import cfeditor.CMainControl; import cfeditor.ExitTypes; import cfeditor.IGUIConstants; +import cfeditor.filter.Filter; +import cfeditor.filter.FilterConfig; +import cfeditor.filter.NamedFilterConfig; +import cfeditor.filter.NamedFilterList; import cfeditor.gameobject.GameObject; import cfeditor.gameobject.GameObjectIterator; import cfeditor.gameobject.GameObjectIteratorDeleteGameMapObject; import cfeditor.gameobject.GameObjectIteratorDeleteMapGame; -import cfeditor.filter.Filter; -import cfeditor.filter.FilterConfig; -import cfeditor.filter.NamedFilterConfig; -import cfeditor.filter.NamedFilterList; import java.awt.Point; import java.util.Iterator; import java.util.List; Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-09-24 23:04:34 UTC (rev 422) @@ -27,10 +27,9 @@ import cfeditor.CMainControl; import cfeditor.CMainStatusbar; import cfeditor.CMapViewBasic; +import cfeditor.GridderException; +import cfeditor.IGUIConstants; import cfeditor.MapViewIFrame; -import net.sf.gridarta.CUndoStack; -import cfeditor.IGUIConstants; -import cfeditor.GridderException; import cfeditor.gameobject.GameObject; import cfeditor.gameobject.GameObjectIterator; import cfeditor.gameobject.GameObjectIteratorDeleteMapGame; @@ -38,6 +37,7 @@ import java.io.File; import java.util.Iterator; import java.util.List; +import net.sf.gridarta.CUndoStack; import net.sf.gridarta.Size2D; import org.jetbrains.annotations.NotNull; Modified: trunk/crossfire/src/cfeditor/parameter/ArchParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/ArchParameter.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/crossfire/src/cfeditor/parameter/ArchParameter.java 2006-09-24 23:04:34 UTC (rev 422) @@ -10,8 +10,8 @@ import cfeditor.CMainControl; import cfeditor.PluginParameter; import cfeditor.PluginParameterView; +import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; -import cfeditor.gameobject.ArchetypeSet; import org.jdom.Element; import org.jetbrains.annotations.Nullable; Modified: trunk/daimonin/src/daieditor/CArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanel.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/CArchPanel.java 2006-09-24 23:04:34 UTC (rev 422) @@ -31,13 +31,13 @@ import java.util.List; import javax.swing.BorderFactory; import javax.swing.JPanel; +import javax.swing.JSplitPane; import javax.swing.JTabbedPane; -import javax.swing.JSplitPane; import static javax.swing.SwingConstants.TOP; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import net.sf.gridarta.gui.GSplitPane; import org.jetbrains.annotations.Nullable; -import net.sf.gridarta.gui.GSplitPane; /** * The <code>CArchPanel</code> holds the tile palette. Modified: trunk/daimonin/src/daieditor/CArchPanelPan.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-09-24 23:04:34 UTC (rev 422) @@ -24,8 +24,8 @@ package daieditor; +import daieditor.gameobject.ArchetypeSet; import daieditor.gameobject.GameObject; -import daieditor.gameobject.ArchetypeSet; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.ActionEvent; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-09-24 23:04:34 UTC (rev 422) @@ -28,9 +28,9 @@ import static daieditor.CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT; import static daieditor.CMainView.MAP_TILE_LIST_BOTTOM_KEY; import static daieditor.IGUIConstants.TILE_EDIT_NONE; -import daieditor.gameobject.GameObject; import daieditor.gameobject.ArchObjectParser; import daieditor.gameobject.ArchetypeSet; +import daieditor.gameobject.GameObject; import daieditor.gameobject.anim.AnimationObjects; import daieditor.gameobject.face.FaceFacade; import daieditor.gameobject.face.FaceObjects; @@ -70,7 +70,6 @@ import daieditor.map.validation.checks.SquareWithoutFloorChecker; import daieditor.map.validation.checks.SysObjectOnLayerZeroChecker; import daieditor.map.validation.checks.TilePathsChecker; -import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import java.awt.Image; import java.awt.Point; import java.awt.Toolkit; @@ -97,8 +96,8 @@ import static java.util.prefs.Preferences.userNodeForPackage; import javax.swing.AbstractAction; import javax.swing.ImageIcon; +import javax.swing.JComponent; import javax.swing.JFileChooser; -import javax.swing.JComponent; import static javax.swing.JOptionPane.CANCEL_OPTION; import static javax.swing.JOptionPane.CLOSED_OPTION; import static javax.swing.JOptionPane.ERROR_MESSAGE; @@ -114,10 +113,11 @@ import static javax.swing.JOptionPane.showMessageDialog; import static javax.swing.KeyStroke.getKeyStroke; import javax.swing.filechooser.FileFilter; +import net.sf.gridarta.CUndoStack; +import net.sf.gridarta.MainControl; import net.sf.gridarta.gui.HideFileFilterProxy; -import net.sf.gridarta.MainControl; -import net.sf.gridarta.CUndoStack; import net.sf.gridarta.map.MapType; +import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-09-24 23:04:34 UTC (rev 422) @@ -24,8 +24,8 @@ package daieditor; +import daieditor.gameobject.ArchetypeSet; import daieditor.gameobject.GameObject; -import daieditor.gameobject.ArchetypeSet; import daieditor.gui.AboutDialog; import daieditor.map.MapControl; import daieditor.map.validation.ErrorCollector; Modified: trunk/daimonin/src/daieditor/CMapArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-09-24 23:04:34 UTC (rev 422) @@ -24,8 +24,8 @@ package daieditor; +import daieditor.gameobject.ArchObjectParser; import daieditor.gameobject.GameObject; -import daieditor.gameobject.ArchObjectParser; import daieditor.gui.ConnectionView; import daieditor.gui.ErrorListView; import daieditor.map.validation.ErrorCollector; Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-09-24 23:04:34 UTC (rev 422) @@ -24,8 +24,8 @@ package daieditor; +import daieditor.gameobject.ArchObjectParser; import daieditor.gameobject.GameObject; -import daieditor.gameobject.ArchObjectParser; import daieditor.map.MapArchObject; import java.io.BufferedReader; import java.io.File; @@ -35,9 +35,9 @@ import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; +import net.sf.gridarta.io.CFileReader; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; -import net.sf.gridarta.io.CFileReader; /** * A MapFileDecoder reads a map file and provides access to the information read from the map file. Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-09-24 23:04:34 UTC (rev 422) @@ -50,11 +50,11 @@ import javax.swing.JScrollPane; import javax.swing.JViewport; import net.sf.gridarta.Size2D; +import net.sf.gridarta.gui.MapView; import net.sf.gridarta.gui.map.MapCursor; import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.gridarta.gui.map.MapGrid; -import net.sf.gridarta.gui.MapView; import org.jetbrains.annotations.Nullable; /** Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-09-24 23:04:34 UTC (rev 422) @@ -38,13 +38,13 @@ import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; +import javax.swing.JCheckBox; import javax.swing.JDialog; import javax.swing.JFormattedTextField; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; -import javax.swing.JCheckBox; import javax.swing.border.CompoundBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; Modified: trunk/daimonin/src/daieditor/CPreview.java =================================================================== --- trunk/daimonin/src/daieditor/CPreview.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/CPreview.java 2006-09-24 23:04:34 UTC (rev 422) @@ -45,8 +45,8 @@ import javax.swing.JScrollPane; import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE; import net.sf.japi.swing.ActionFactory; +import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * The map preview of the level editor. Modified: trunk/daimonin/src/daieditor/MultiPositionData.java =================================================================== --- trunk/daimonin/src/daieditor/MultiPositionData.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/MultiPositionData.java 2006-09-24 23:04:34 UTC (rev 422) @@ -29,8 +29,8 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; +import net.sf.gridarta.io.CFileReader; import org.apache.log4j.Logger; -import net.sf.gridarta.io.CFileReader; /** * The MultiPositionData class stores an array of numbers which is required Modified: trunk/daimonin/src/daieditor/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/ScriptArchData.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/ScriptArchData.java 2006-09-24 23:04:34 UTC (rev 422) @@ -25,7 +25,6 @@ package daieditor; import daieditor.gameobject.GameObject; -import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import java.awt.Color; import java.awt.FlowLayout; import java.awt.Insets; @@ -48,6 +47,7 @@ import javax.swing.JPanel; import javax.swing.JTextField; import static javax.swing.WindowConstants.HIDE_ON_CLOSE; +import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.Arrays2; Modified: trunk/daimonin/src/daieditor/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/Spells.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/Spells.java 2006-09-24 23:04:34 UTC (rev 422) @@ -39,11 +39,11 @@ import javax.swing.JFileChooser; import javax.swing.filechooser.FileFilter; import javax.xml.parsers.DocumentBuilder; +import net.sf.gridarta.io.CFileReader; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.filter.file.FilenameFileFilter; import net.sf.japi.xml.NodeListIterator; -import net.sf.gridarta.io.CFileReader; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-09-24 23:04:34 UTC (rev 422) @@ -27,7 +27,6 @@ package daieditor.gameobject; import daieditor.CFTreasureListTree; -import net.sf.gridarta.io.CFileReader; import daieditor.CMainControl; import daieditor.CPickmapPanel; import daieditor.IGUIConstants; @@ -60,6 +59,7 @@ import java.util.Map; import java.util.TreeMap; import javax.swing.ImageIcon; +import net.sf.gridarta.io.CFileReader; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.Progress; Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-09-24 23:04:34 UTC (rev 422) @@ -38,8 +38,8 @@ import java.io.Serializable; import javax.swing.ImageIcon; import javax.swing.JList; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; /** * The <code>GameObject</code> class handles the Daimonin GameObjects. Modified: trunk/daimonin/src/daieditor/gameobject/GameObjectContainer.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObjectContainer.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/gameobject/GameObjectContainer.java 2006-09-24 23:04:34 UTC (rev 422) @@ -22,15 +22,15 @@ package daieditor.gameobject; import daieditor.map.MapSquare; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.Serializable; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import java.util.ArrayList; import java.util.ListIterator; -import java.io.Serializable; -import java.io.ObjectInputStream; -import java.io.IOException; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; /** * Base class for classes that contain GameObjects as children in the sense of containment. Modified: trunk/daimonin/src/daieditor/gameobject/NamedObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/NamedObject.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/gameobject/NamedObject.java 2006-09-24 23:04:34 UTC (rev 422) @@ -21,8 +21,8 @@ package daieditor.gameobject; +import java.io.Serializable; import javax.swing.ImageIcon; -import java.io.Serializable; /** * A <code>NamedObject</code> has a name and tree position source and provides an icon for display. Modified: trunk/daimonin/src/daieditor/gameobject/RecursiveGameObjectIterator.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/RecursiveGameObjectIterator.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/gameobject/RecursiveGameObjectIterator.java 2006-09-24 23:04:34 UTC (rev 422) @@ -1,8 +1,8 @@ package daieditor.gameobject; +import java.util.EmptyStackException; import java.util.Iterator; import java.util.Stack; -import java.util.EmptyStackException; /** * Iterator for recursively iterating over ArchObjectContainers. Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java 2006-09-24 23:04:34 UTC (rev 422) @@ -28,9 +28,9 @@ import daieditor.gameobject.NamedObject; import daieditor.gameobject.face.FaceFacade; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import java.io.Serializable; import javax.swing.ImageIcon; /** Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-09-24 23:04:34 UTC (rev 422) @@ -26,7 +26,6 @@ package daieditor.gameobject.anim; import daieditor.PathManager; -import net.sf.gridarta.io.CFileReader; import daieditor.gameobject.NamedObjects; import java.io.BufferedReader; import java.io.File; @@ -37,6 +36,7 @@ import java.io.Reader; import java.util.HashMap; import java.util.Map; +import net.sf.gridarta.io.CFileReader; import org.jetbrains.annotations.Nullable; Modified: trunk/daimonin/src/daieditor/gui/DirectionLayout.java =================================================================== --- trunk/daimonin/src/daieditor/gui/DirectionLayout.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/gui/DirectionLayout.java 2006-09-24 23:04:34 UTC (rev 422) @@ -35,7 +35,6 @@ import java.awt.Insets; import java.awt.LayoutManager2; import java.io.Serializable; -import static java.lang.Math.max; /** * This class implements a layout that is similar to {@link java.awt.BorderLayout} but implements those directions used in Daimonin. Modified: trunk/daimonin/src/daieditor/gui/map/MapTilePane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-09-24 23:04:34 UTC (rev 422) @@ -26,7 +26,6 @@ import daieditor.CMainControl; import daieditor.IGUIConstants; import daieditor.PathManager; -import net.sf.gridarta.io.CFileReader; import daieditor.gui.DirectionLayout; import daieditor.map.MapArchObject; import daieditor.map.MapControl; @@ -59,6 +58,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import net.sf.gridarta.Size2D; +import net.sf.gridarta.io.CFileReader; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-09-24 23:04:34 UTC (rev 422) @@ -28,8 +28,8 @@ import daieditor.CFArchTypeList; import daieditor.CMainControl; import daieditor.IGUIConstants; +import daieditor.gameobject.ArchObjectParser; import daieditor.gameobject.GameObject; -import daieditor.gameobject.ArchObjectParser; import java.awt.Point; import java.awt.Toolkit; import java.util.ArrayList; Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-09-24 23:04:34 UTC (rev 422) @@ -25,10 +25,10 @@ package daieditor.map; import daieditor.CMainControl; -import daieditor.MapViewIFrame; import daieditor.CPickmapPanel; import daieditor.CopyBuffer; import daieditor.IGUIConstants; +import daieditor.MapViewIFrame; import daieditor.gameobject.GameObject; import daieditor.gui.map.LevelRenderer; import daieditor.gui.map.SimpleLevelRenderer; @@ -45,8 +45,8 @@ import java.util.List; import javax.imageio.ImageIO; import javax.swing.ImageIcon; +import net.sf.gridarta.CUndoStack; import net.sf.gridarta.Size2D; -import net.sf.gridarta.CUndoStack; import net.sf.gridarta.gui.map.MapCursor; import net.sf.gridarta.gui.map.MapGrid; import net.sf.japi.swing.ActionFactory; Modified: trunk/daimonin/src/daieditor/map/MapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapModel.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/map/MapModel.java 2006-09-24 23:04:34 UTC (rev 422) @@ -2,10 +2,10 @@ import daieditor.gameobject.GameObject; import java.awt.Point; +import java.io.Serializable; import java.util.Iterator; -import java.io.Serializable; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; /** * Interface for MapModels. Modified: trunk/daimonin/src/daieditor/map/validation/checks/MapDifficultyChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/MapDifficultyChecker.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/daimonin/src/daieditor/map/validation/checks/MapDifficultyChecker.java 2006-09-24 23:04:34 UTC (rev 422) @@ -1,7 +1,7 @@ package daieditor.map.validation.checks; +import daieditor.map.MapArchObject; import daieditor.map.MapModel; -import daieditor.map.MapArchObject; import daieditor.map.validation.AbstractValidator; import daieditor.map.validation.ErrorCollector; import daieditor.map.validation.MapValidator; Modified: trunk/src/app/net/sf/gridarta/io/CFileReader.java =================================================================== --- trunk/src/app/net/sf/gridarta/io/CFileReader.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/src/app/net/sf/gridarta/io/CFileReader.java 2006-09-24 23:04:34 UTC (rev 422) @@ -32,7 +32,6 @@ import java.io.InputStreamReader; import java.io.Reader; import java.io.UnsupportedEncodingException; -import net.sf.gridarta.io.CFileInputStream; /** * Class for opening and reading a buffered stream to an ASCII resource-file. Modified: trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java 2006-09-24 23:04:34 UTC (rev 422) @@ -1,7 +1,7 @@ package net.sf.gridarta.map; +import net.sf.gridarta.Size2D; import org.jetbrains.annotations.NotNull; -import net.sf.gridarta.Size2D; /** * Base implementation of {@link MapArchObject} that covers similarities between Crossfire maps and Daimonin maps. Modified: trunk/src/app/net/sf/gridarta/map/MapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapArchObject.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/src/app/net/sf/gridarta/map/MapArchObject.java 2006-09-24 23:04:34 UTC (rev 422) @@ -1,7 +1,7 @@ package net.sf.gridarta.map; +import net.sf.gridarta.Size2D; import org.jetbrains.annotations.NotNull; -import net.sf.gridarta.Size2D; /** * Interface for MapArchObjects. Modified: trunk/src/app/net/sf/gridarta/map/MapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapModel.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/src/app/net/sf/gridarta/map/MapModel.java 2006-09-24 23:04:34 UTC (rev 422) @@ -1,9 +1,9 @@ package net.sf.gridarta.map; +import java.awt.Point; +import net.sf.gridarta.Size2D; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import net.sf.gridarta.Size2D; -import java.awt.Point; /** * A MapModel reflects the data of a map. Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java 2006-09-24 23:04:34 UTC (rev 422) @@ -23,7 +23,6 @@ package net.sf.gridarta.textedit.scripteditor; -import net.sf.gridarta.textedit.textarea.JEditTextArea; import java.io.File; import java.io.FileWriter; import java.io.IOException; @@ -32,6 +31,7 @@ import javax.swing.JFileChooser; import javax.swing.JOptionPane; import net.sf.gridarta.MainControl; +import net.sf.gridarta.textedit.textarea.JEditTextArea; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java 2006-09-24 23:04:34 UTC (rev 422) @@ -23,8 +23,6 @@ package net.sf.gridarta.textedit.scripteditor; -import net.sf.gridarta.textedit.textarea.InputHandler; -import net.sf.gridarta.textedit.textarea.JEditTextArea; import java.awt.Event; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -33,6 +31,8 @@ import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.KeyStroke; +import net.sf.gridarta.textedit.textarea.InputHandler; +import net.sf.gridarta.textedit.textarea.JEditTextArea; /** * This class implements the MenuBar of the script editor. Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2006-09-24 23:04:34 UTC (rev 422) @@ -23,9 +23,6 @@ package net.sf.gridarta.textedit.scripteditor; -import net.sf.gridarta.textedit.textarea.JEditTextArea; -import net.sf.gridarta.textedit.textarea.LuaTokenMarker; -import net.sf.gridarta.textedit.textarea.SyntaxDocument; import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.WindowAdapter; @@ -43,6 +40,9 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.text.BadLocationException; +import net.sf.gridarta.textedit.textarea.JEditTextArea; +import net.sf.gridarta.textedit.textarea.LuaTokenMarker; +import net.sf.gridarta.textedit.textarea.SyntaxDocument; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java 2006-09-24 23:04:34 UTC (rev 422) @@ -9,8 +9,6 @@ package net.sf.gridarta.textedit.textarea; -import net.sf.gridarta.textedit.scripteditor.CFPythonPopup; -import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import java.awt.Component; import java.awt.Toolkit; import java.awt.datatransfer.DataFlavor; @@ -28,6 +26,8 @@ import java.util.Map; import javax.swing.JPopupMenu; import javax.swing.text.BadLocationException; +import net.sf.gridarta.textedit.scripteditor.CFPythonPopup; +import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/src/test/net/sf/gridarta/Size2DTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/Size2DTest.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/src/test/net/sf/gridarta/Size2DTest.java 2006-09-24 23:04:34 UTC (rev 422) @@ -1,9 +1,9 @@ package test.net.sf.gridarta; import net.sf.gridarta.Size2D; -import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import org.junit.Test; /** * Test for {@link Size2D}. Modified: trunk/src/test/net/sf/gridarta/gui/HideFileFilterProxyTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/HideFileFilterProxyTest.java 2006-09-24 22:49:38 UTC (rev 421) +++ trunk/src/test/net/sf/gridarta/gui/HideFileFilterProxyTest.java 2006-09-24 23:04:34 UTC (rev 422) @@ -3,8 +3,8 @@ import java.io.File; import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.japi.util.filter.file.AbstractFileFilter; +import static org.junit.Assert.fail; import org.junit.Test; -import static org.junit.Assert.fail; /** * Test for {@link HideFileFilterProxy}. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-24 22:50:07
|
Revision: 421 http://svn.sourceforge.net/gridarta/?rev=421&view=rev Author: christianhujer Date: 2006-09-24 15:49:38 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Adding missing package descriptions for Gridarta core. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/package.html trunk/src/app/net/sf/gridarta/textedit/scripteditor/package.html trunk/src/app/net/sf/gridarta/textedit/textarea/package.html Added Paths: ----------- trunk/src/app/net/sf/gridarta/map/package.html trunk/src/app/net/sf/gridarta/package.html trunk/src/test/net/sf/gridarta/gui/package.html trunk/src/test/net/sf/gridarta/package.html Modified: trunk/src/app/net/sf/gridarta/gui/map/package.html =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/package.html 2006-09-24 22:41:47 UTC (rev 420) +++ trunk/src/app/net/sf/gridarta/gui/map/package.html 2006-09-24 22:49:38 UTC (rev 421) @@ -10,8 +10,8 @@ This package containes classes related to map visualisation. </p> <p> - A <a href="MapGrid">MapGrid</a> contains a 2D array of flags for highlighting tiles on a map. - A <a href="MapCursor">MapCursor</a> is used to modify selection and cursor position flags on this MapGrid. + A {@link MapGrid} contains a 2D array of flags for highlighting tiles on a map. + A {@link MapCursor} is used to modify selection and cursor position flags on this MapGrid. </p> </body> </html> \ No newline at end of file Added: trunk/src/app/net/sf/gridarta/map/package.html =================================================================== --- trunk/src/app/net/sf/gridarta/map/package.html (rev 0) +++ trunk/src/app/net/sf/gridarta/map/package.html 2006-09-24 22:49:38 UTC (rev 421) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <title></title> + </head> + <body> + <p> + This package containes common classes and interfaces for handling maps. + </p> + </body> +</html> Property changes on: trunk/src/app/net/sf/gridarta/map/package.html ___________________________________________________________________ Name: svn:mime-type + text/html Name: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/package.html =================================================================== --- trunk/src/app/net/sf/gridarta/package.html (rev 0) +++ trunk/src/app/net/sf/gridarta/package.html 2006-09-24 22:49:38 UTC (rev 421) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <title></title> + </head> + <body> + <p> + This package containes common classes that do not fit in a particular subpackage. + </p> + </body> +</html> Property changes on: trunk/src/app/net/sf/gridarta/package.html ___________________________________________________________________ Name: svn:mime-type + text/html Name: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/package.html =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/package.html 2006-09-24 22:41:47 UTC (rev 420) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/package.html 2006-09-24 22:49:38 UTC (rev 421) @@ -9,6 +9,7 @@ <p> This package contains the classes for the script editor used within the editor to create and modify Python and Lua scripts. @serial exclude + @see net.sf.gridarta.textedit.textarea </p> </body> </html> Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/package.html =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/package.html 2006-09-24 22:41:47 UTC (rev 420) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/package.html 2006-09-24 22:49:38 UTC (rev 421) @@ -7,8 +7,9 @@ </head> <body> <p> - Unknown package. + This package contains the other part of the script editor. @serial exclude + @see net.sf.gridarta.textedit.scripteditor </p> </body> </html> Added: trunk/src/test/net/sf/gridarta/gui/package.html =================================================================== --- trunk/src/test/net/sf/gridarta/gui/package.html (rev 0) +++ trunk/src/test/net/sf/gridarta/gui/package.html 2006-09-24 22:49:38 UTC (rev 421) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <title></title> + </head> + <body> + <p> + This package containes test classes for {@link net.sf.gridarta.gui}. + </p> + </body> +</html> Property changes on: trunk/src/test/net/sf/gridarta/gui/package.html ___________________________________________________________________ Name: svn:mime-type + text/html Name: svn:eol-style + LF Added: trunk/src/test/net/sf/gridarta/package.html =================================================================== --- trunk/src/test/net/sf/gridarta/package.html (rev 0) +++ trunk/src/test/net/sf/gridarta/package.html 2006-09-24 22:49:38 UTC (rev 421) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <title></title> + </head> + <body> + <p> + This package containes test classes for {@link net.sf.gridarta}. + </p> + </body> +</html> Property changes on: trunk/src/test/net/sf/gridarta/package.html ___________________________________________________________________ Name: svn:mime-type + text/html 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-09-24 22:41:55
|
Revision: 420 http://svn.sourceforge.net/gridarta/?rev=420&view=rev Author: christianhujer Date: 2006-09-24 15:41:47 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Fixed name from Arch to GameObject. Added Paths: ----------- trunk/daimonin/src/daieditor/map/GameObjectOutOfMapBoundsException.java Removed Paths: ------------- trunk/daimonin/src/daieditor/map/ArchOutOfMapBoundsException.java Deleted: trunk/daimonin/src/daieditor/map/ArchOutOfMapBoundsException.java =================================================================== --- trunk/daimonin/src/daieditor/map/ArchOutOfMapBoundsException.java 2006-09-24 22:10:46 UTC (rev 419) +++ trunk/daimonin/src/daieditor/map/ArchOutOfMapBoundsException.java 2006-09-24 22:41:47 UTC (rev 420) @@ -1,53 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2005 Christian Hujer - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package daieditor.map; - -import daieditor.gameobject.GameObject; - -/** - * Exception that's thrown in case an arch is out of its map bounds. - * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> - * @serial exclude - */ -public class ArchOutOfMapBoundsException extends Exception { - - /** GameObject causing the problem. */ - private final GameObject violator; - - /** - * Create an ArchOutOfMapBoundsException. - * @param violator GameObject that was out of bounds - */ - public ArchOutOfMapBoundsException(final GameObject violator) { - super("Arch out of map bounds: " + violator); - this.violator = violator; - } - - /** - * Get the violator that caused this exception. - * @return violator - */ - public GameObject getViolator() { - return violator; - } - -} // class ArchOutOfMapBoundsException Copied: trunk/daimonin/src/daieditor/map/GameObjectOutOfMapBoundsException.java (from rev 419, trunk/daimonin/src/daieditor/map/ArchOutOfMapBoundsException.java) =================================================================== --- trunk/daimonin/src/daieditor/map/GameObjectOutOfMapBoundsException.java (rev 0) +++ trunk/daimonin/src/daieditor/map/GameObjectOutOfMapBoundsException.java 2006-09-24 22:41:47 UTC (rev 420) @@ -0,0 +1,53 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package daieditor.map; + +import daieditor.gameobject.GameObject; + +/** + * Exception that's thrown in case game object is out of its map bounds. + * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> + * @serial exclude + */ +public class GameObjectOutOfMapBoundsException extends Exception { + + /** GameObject causing the problem. */ + private final GameObject violator; + + /** + * Create an GameObjectOutOfMapBoundsException. + * @param violator GameObject that was out of bounds + */ + public GameObjectOutOfMapBoundsException(final GameObject violator) { + super("Object out of map bounds: " + violator); + this.violator = violator; + } + + /** + * Get the violator that caused this exception. + * @return violator + */ + public GameObject getViolator() { + return violator; + } + +} // class GameObjectOutOfMapBoundsException Property changes on: trunk/daimonin/src/daieditor/map/GameObjectOutOfMapBoundsException.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-09-24 22:10:52
|
Revision: 419 http://svn.sourceforge.net/gridarta/?rev=419&view=rev Author: christianhujer Date: 2006-09-24 15:10:46 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Improved terminology in GameObjectContainer. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/GameObjectContainer.java Modified: trunk/daimonin/src/daieditor/gameobject/GameObjectContainer.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObjectContainer.java 2006-09-24 21:59:16 UTC (rev 418) +++ trunk/daimonin/src/daieditor/gameobject/GameObjectContainer.java 2006-09-24 22:10:46 UTC (rev 419) @@ -33,10 +33,10 @@ import org.jetbrains.annotations.NotNull; /** - * Base class for classes that contain ArchObjects as children. + * Base class for classes that contain GameObjects as children in the sense of containment. * The interface serves 2 main purposes: * <ul> - * <li>{@link GameObject} extends this class for containing other arches, like bag contents or attached events.</li> + * <li>{@link GameObject} extends this class for containing other GameObjects, like inventory contents e.g. of a bag or attached events.</li> * <li>{@link MapSquare} extends this class to list the tiles on a MapSquare.</li> * </ul> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -91,11 +91,11 @@ /** * {@inheritDoc} - * The Iterator returned does not recurse, it only containes objects on the first level. + * The Iterator returned does not recurse, it only contains objects on the first level. * The Iterator returned is transparent, that means modifying the iterator's collection actually modifies the underlying GameObjectContainer. */ @NotNull public final Iterator<GameObject> iterator() { - // Do not return contents.iterator() directly because otherwise the remove() operation will not properly unlink the removed arch from its container. + // Do not return contents.iterator() directly because otherwise the remove() operation will not properly unlink the removed GameObject from its container. return new Iterator<GameObject>() { /** The basic iterator. */ @@ -125,7 +125,7 @@ /** * Return an object that is the reverse representation. - * Invoke this method if you want to iterate over the arches in reverse order. + * Invoke this method if you want to iterate over the contained GameObjects in reverse order. * @return reverse representation */ @NotNull public final Iterable<GameObject> reverse() { @@ -134,7 +134,7 @@ /** * Return an object that is a recursive representation. - * Invoke this method if you want to iterate over the contained arches recursively. + * Invoke this method if you want to iterate over the contained GameObjects recursively. * @return recursive representation */ @NotNull public final Iterable<GameObject> recursive() { @@ -150,40 +150,40 @@ } /** - * Return the first object contained in this container. - * @return first object contained or <code>null</code> if {@link #isEmpty()} returns <code>true</code> + * Return the first GameObject contained in this container. + * @return first GameObject contained or <code>null</code> if {@link #isEmpty()} returns <code>true</code> */ @Nullable public final GameObject getFirst() { return contents.isEmpty() ? null : contents.get(0); } /** - * Return the last object contained in this container. - * You should not invoke this method to iterate over ArchObjects, such invocation is regarded deprecated. - * @return last object contained or <code>null</code> if {@link #isEmpty()} returns <code>true</code> + * Return the last GameObject contained in this container. + * You should not invoke this method to iterate over GameObjects, such invocation is regarded deprecated. + * @return last GameObject contained or <code>null</code> if {@link #isEmpty()} returns <code>true</code> */ @Nullable public final GameObject getLast() { return contents.isEmpty() ? null : contents.get(contents.size() - 1); } /** - * Remove an GameObject from this container. - * @param arch GameObject to remove - * @throws IllegalArgumentException if <var>arch</var> isn't in this container + * Remove a GameObject from this container. + * @param gameObject GameObject to remove + * @throws IllegalArgumentException if <var>gameObject</var> isn't in this container */ - final void remove(@NotNull final GameObject arch) { + final void remove(@NotNull final GameObject gameObject) { // keep this in sync with iterator() - if (!contents.remove(arch)) { - throw new IllegalArgumentException(arch + " wasn't inside container " + this); + if (!contents.remove(gameObject)) { + throw new IllegalArgumentException(gameObject + " wasn't inside container " + this); } - arch.setContainer(null); + gameObject.setContainer(null); squareChanged(); } - /** Remove all ArchObjects from this container. */ + /** Remove all GameObjects from this container. */ public final void removeAll() { - for (final GameObject arch : contents) { - arch.setContainer(null); + for (final GameObject gameObject : contents) { + gameObject.setContainer(null); } contents.clear(); squareChanged(); @@ -191,64 +191,64 @@ /** * Move an item to top. - * @param arch item to move to top - * @throws IllegalArgumentException if <var>arch</var> isn't in this container + * @param gameObject item to move to top + * @throws IllegalArgumentException if <var>gameObject</var> isn't in this container */ - public final void moveTop(@NotNull final GameObject arch) { - final int oldIndex = contents.indexOf(arch); + public final void moveTop(@NotNull final GameObject gameObject) { + final int oldIndex = contents.indexOf(gameObject); if (oldIndex != contents.size() - 1) { - if (!contents.remove(arch)) { - throw new IllegalArgumentException(arch + " wasn't inside container " + this); + if (!contents.remove(gameObject)) { + throw new IllegalArgumentException(gameObject + " wasn't inside container " + this); } - contents.add(arch); + contents.add(gameObject); squareChanged(); } } /** * Move an item up. - * @param arch item to move up - * @throws IllegalArgumentException if <var>arch</var> isn't in this container + * @param gameObject item to move up + * @throws IllegalArgumentException if <var>gameObject</var> isn't in this container */ - public final void moveUp(@NotNull final GameObject arch) { - final int oldIndex = contents.indexOf(arch); + public final void moveUp(@NotNull final GameObject gameObject) { + final int oldIndex = contents.indexOf(gameObject); if (oldIndex < contents.size() - 1) { - if (!contents.remove(arch)) { - throw new IllegalArgumentException(arch + " wasn't inside container " + this); + if (!contents.remove(gameObject)) { + throw new IllegalArgumentException(gameObject + " wasn't inside container " + this); } - contents.add(oldIndex + 1, arch); + contents.add(oldIndex + 1, gameObject); squareChanged(); } } /** * Move an item down. - * @param arch item to move down - * @throws IllegalArgumentException if <var>arch</var> isn't in this container + * @param gameObject item to move down + * @throws IllegalArgumentException if <var>gameObject</var> isn't in this container */ - public final void moveDown(@NotNull final GameObject arch) { - final int oldIndex = contents.indexOf(arch); + public final void moveDown(@NotNull final GameObject gameObject) { + final int oldIndex = contents.indexOf(gameObject); if (oldIndex > 0) { - if (!contents.remove(arch)) { - throw new IllegalArgumentException(arch + " wasn't inside container " + this); + if (!contents.remove(gameObject)) { + throw new IllegalArgumentException(gameObject + " wasn't inside container " + this); } - contents.add(oldIndex - 1, arch); + contents.add(oldIndex - 1, gameObject); squareChanged(); } } /** * Move an item to bottom. - * @param arch item to move to bottom - * @throws IllegalArgumentException if <var>arch</var> isn't in this container + * @param gameObject item to move to bottom + * @throws IllegalArgumentException if <var>gameObject</var> isn't in this container */ - public final void moveBottom(@NotNull final GameObject arch) { - final int oldIndex = contents.indexOf(arch); + public final void moveBottom(@NotNull final GameObject gameObject) { + final int oldIndex = contents.indexOf(gameObject); if (oldIndex != 0) { - if (!contents.remove(arch)) { - throw new IllegalArgumentException(arch + " wasn't inside container " + this); + if (!contents.remove(gameObject)) { + throw new IllegalArgumentException(gameObject + " wasn't inside container " + this); } - contents.add(0, arch); + contents.add(0, gameObject); squareChanged(); } } @@ -267,85 +267,85 @@ /** * Add the given GameObject at the end of this Container. - * @param arch the free yet unlinked <code>GameObject</code> to be placed in the inventory - * @throws IllegalArgumentException if <var>arch</var> already is inside another container + * @param gameObject the free yet unlinked <code>GameObject</code> to be placed in the inventory + * @throws IllegalArgumentException if <var>gameObject</var> already is inside another container */ - public void addLast(@NotNull final GameObject arch) { - if (arch.isInContainer()) { - throw new IllegalArgumentException("Can't add " + arch + " to " + this + " because it's already inside " + arch.getContainer()); + public void addLast(@NotNull final GameObject gameObject) { + if (gameObject.isInContainer()) { + throw new IllegalArgumentException("Can't add " + gameObject + " to " + this + " because it's already inside " + gameObject.getContainer()); } - contents.add(arch); - arch.setContainer(this); + contents.add(gameObject); + gameObject.setContainer(this); squareChanged(); } /** * Add the given GameObject at the end of this Container. - * @param arch the free yet unlinked <code>GameObject</code> to be placed in the inventory - * @throws IllegalArgumentException if <var>arch</var> already is inside another container + * @param gameObject the free yet unlinked <code>GameObject</code> to be placed in the inventory + * @throws IllegalArgumentException if <var>gameObject</var> already is inside another container */ - public void addFirst(@NotNull final GameObject arch) { - if (arch.isInContainer()) { - throw new IllegalArgumentException("Can't add " + arch + " to " + this + " because it's already inside " + arch.getContainer()); + public void addFirst(@NotNull final GameObject gameObject) { + if (gameObject.isInContainer()) { + throw new IllegalArgumentException("Can't add " + gameObject + " to " + this + " because it's already inside " + gameObject.getContainer()); } - contents.add(0, arch); - arch.setContainer(this); + contents.add(0, gameObject); + gameObject.setContainer(this); squareChanged(); } /** - * Add an GameObject after another. - * @param prev previous anchor - * @param arch GameObject to insert - * @throws IllegalArgumentException if <var>arch</var> already is inside another container or <var>prev</var> isn't inside this container + * Add a GameObject after another. + * @param previousGameObject previous anchor + * @param newGameObject GameObject to insert + * @throws IllegalArgumentException if <var>newGameObject</var> already is inside another container or <var>previousGameObject</var> isn't inside this container */ - public void insertAfter(@NotNull final GameObject prev, @NotNull final GameObject arch) { - if (arch.isInContainer()) { - throw new IllegalArgumentException("Can't add " + arch + " to " + this + " because it's already inside " + arch.getContainer()); + public void insertAfter(@NotNull final GameObject previousGameObject, @NotNull final GameObject newGameObject) { + if (newGameObject.isInContainer()) { + throw new IllegalArgumentException("Can't add " + newGameObject + " to " + this + " because it's already inside " + newGameObject.getContainer()); } - final int insertIndex = contents.indexOf(prev); + final int insertIndex = contents.indexOf(previousGameObject); if (insertIndex == -1) { - throw new IllegalArgumentException("Can't insert " + arch + " after " + prev + " because that isn't inside " + this); + throw new IllegalArgumentException("Can't insert " + newGameObject + " after " + previousGameObject + " because that isn't inside " + this); } - contents.add(insertIndex, arch); - arch.setContainer(this); + contents.add(insertIndex, newGameObject); + newGameObject.setContainer(this); squareChanged(); } /** - * Add an GameObject before another. - * @param arch GameObject to insert - * @param next next anchor - * @throws IllegalArgumentException if <var>arch</var> already is inside another container or <var>prev</var> isn't inside this container + * Add a GameObject before another. + * @param newGameObject GameObject to insert + * @param nextGameObject nextGameObject anchor + * @throws IllegalArgumentException if <var>newGameObject</var> already is inside another container or <var>prev</var> isn't inside this container */ - public void insertBefore(@NotNull final GameObject arch, @NotNull final GameObject next) { - if (arch.isInContainer()) { - throw new IllegalArgumentException("Can't add " + arch + " to " + this + " because it's already inside " + arch.getContainer()); + public void insertBefore(@NotNull final GameObject newGameObject, @NotNull final GameObject nextGameObject) { + if (newGameObject.isInContainer()) { + throw new IllegalArgumentException("Can't add " + newGameObject + " to " + this + " because it's already inside " + newGameObject.getContainer()); } - final int insertIndex = contents.indexOf(next); + final int insertIndex = contents.indexOf(nextGameObject); if (insertIndex == -1) { - throw new IllegalArgumentException("Can't insert " + arch + " before " + next + " because that isn't inside " + this); + throw new IllegalArgumentException("Can't insert " + newGameObject + " before " + nextGameObject + " because that isn't inside " + this); } - contents.add(insertIndex + 1, arch); - arch.setContainer(this); + contents.add(insertIndex + 1, newGameObject); + newGameObject.setContainer(this); squareChanged(); } /** * Replace an GameObject with another one. - * @param oldArch old GameObject to be replaced - * @param newArch new GameObject that replaces oldArch - * @throws IllegalArgumentException if <var>oldArch</var> isn't in this container + * @param oldGameObject old GameObject to be replaced + * @param newGameObject new GameObject that replaces oldGameObject + * @throws IllegalArgumentException if <var>oldGameObject</var> isn't in this container */ - public void replace(@NotNull final GameObject oldArch, @NotNull final GameObject newArch) { - final int insertIndex = contents.indexOf(oldArch); + public void replace(@NotNull final GameObject oldGameObject, @NotNull final GameObject newGameObject) { + final int insertIndex = contents.indexOf(oldGameObject); if (insertIndex == -1) { - throw new IllegalArgumentException(oldArch + " wasn't inside container " + this); + throw new IllegalArgumentException(oldGameObject + " wasn't inside container " + this); } - contents.remove(oldArch); - oldArch.setContainer(null); - contents.add(insertIndex, newArch); - newArch.setContainer(this); + contents.remove(oldGameObject); + oldGameObject.setContainer(null); + contents.add(insertIndex, newGameObject); + newGameObject.setContainer(this); squareChanged(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-24 21:59:27
|
Revision: 418 http://svn.sourceforge.net/gridarta/?rev=418&view=rev Author: christianhujer Date: 2006-09-24 14:59:16 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Clarified naming in DuplicateArch(etype)Exception. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java Added Paths: ----------- trunk/daimonin/src/daieditor/gameobject/DuplicateArchetypeException.java Removed Paths: ------------- trunk/daimonin/src/daieditor/gameobject/DuplicateArchException.java Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-09-24 21:55:10 UTC (rev 417) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-09-24 21:59:16 UTC (rev 418) @@ -183,10 +183,10 @@ * @param data GameObject with DefaultArch to add * @todo check whether the GameObject is a default arch and reject no default arches with an exception */ - public void addArchToList(final GameObject data) /*throws DuplicateArchException*/ { + public void addArchToList(final GameObject data) /*throws DuplicateArchetypeException*/ { if (arches.containsKey(data.getArchetypeName())) { ACTION_FACTORY.showMessageDialog(mainControl.getMainView(), "loadDuplicateArch", data.getArchetypeName(), currentFile); - //throw new DuplicateArchException(data); + //throw new DuplicateArchetypeException(data); } else { archObjects.add(data); arches.put(data.getArchetypeName(), data); Deleted: trunk/daimonin/src/daieditor/gameobject/DuplicateArchException.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/DuplicateArchException.java 2006-09-24 21:55:10 UTC (rev 417) +++ trunk/daimonin/src/daieditor/gameobject/DuplicateArchException.java 2006-09-24 21:59:16 UTC (rev 418) @@ -1,51 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2005 Christian Hujer - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package daieditor.gameobject; - -/** - * Exception that's thrown in case an arch name was not unique. - * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> - * @serial exclude - */ -public class DuplicateArchException extends Exception { - - /** GameObject causing the problem. */ - private final GameObject duplicate; - - /** - * Create a DuplicateArchException. - * @param duplicate Duplicate arch that's the cause - */ - public DuplicateArchException(final GameObject duplicate) { - super("Non-unique arch " + duplicate.getAnimName()); - this.duplicate = duplicate; - } - - /** - * Get the duplicate that caused this exception. - * @return duplicate - */ - public GameObject getDuplicate() { - return duplicate; - } - -} // class DuplicateArchException Copied: trunk/daimonin/src/daieditor/gameobject/DuplicateArchetypeException.java (from rev 417, trunk/daimonin/src/daieditor/gameobject/DuplicateArchException.java) =================================================================== --- trunk/daimonin/src/daieditor/gameobject/DuplicateArchetypeException.java (rev 0) +++ trunk/daimonin/src/daieditor/gameobject/DuplicateArchetypeException.java 2006-09-24 21:59:16 UTC (rev 418) @@ -0,0 +1,51 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package daieditor.gameobject; + +/** + * Exception that's thrown in case an archetype's name was not unique. + * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> + * @serial exclude + */ +public class DuplicateArchetypeException extends Exception { + + /** GameObject causing the problem. */ + private final GameObject duplicateArchetype; + + /** + * Create a DuplicateArchetypeException. + * @param duplicateArchetype Duplicate archetype that's the cause + */ + public DuplicateArchetypeException(final GameObject duplicateArchetype) { + super("Non-unique archetype " + duplicateArchetype.getAnimName()); + this.duplicateArchetype = duplicateArchetype; + } + + /** + * Get the duplicateArchetype that caused this exception. + * @return duplicateArchetype + */ + public GameObject getDuplicateArchetype() { + return duplicateArchetype; + } + +} // class DuplicateArchetypeException Property changes on: trunk/daimonin/src/daieditor/gameobject/DuplicateArchetypeException.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-09-24 21:55:33
|
Revision: 417 http://svn.sourceforge.net/gridarta/?rev=417&view=rev Author: christianhujer Date: 2006-09-24 14:55:10 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Removed empty ArchUpdater as it's unused and probably will become obsolete due to Webstart. Removed Paths: ------------- trunk/daimonin/src/daieditor/ArchUpdater.java Deleted: trunk/daimonin/src/daieditor/ArchUpdater.java =================================================================== --- trunk/daimonin/src/daieditor/ArchUpdater.java 2006-09-24 21:53:00 UTC (rev 416) +++ trunk/daimonin/src/daieditor/ArchUpdater.java 2006-09-24 21:55:10 UTC (rev 417) @@ -1,23 +0,0 @@ -package daieditor; - -/** - * The ArchUpdater is a class designed for updating the arch/ directory. - * In its first versions, it will only update the <code>arch/dev/editor/conf/</code> directory, but in future versions maybe it will be extended to keep the whole <code>arch/</code> directory tree up to date. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public final class ArchUpdater { - - /** Create a new ArchUpdater. */ - public ArchUpdater() { - - } - - /** - * Start the update. - * Updating means checking whether <code>arch/dev/editor/conf/</code> contains files that need update and updating these. - */ - public void startUpdate() { - // Now two kinds of updates should be choosable: CVS and HTTP (ViewCVS). - } - -} // class ArchUpdater This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-24 21:53:08
|
Revision: 416 http://svn.sourceforge.net/gridarta/?rev=416&view=rev Author: christianhujer Date: 2006-09-24 14:53:00 -0700 (Sun, 24 Sep 2006) Log Message: ----------- I/O writing improvements on daimonin's CMapFileEncode and MapArchObject. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileEncode.java trunk/daimonin/src/daieditor/map/MapArchObject.java Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-09-24 21:33:57 UTC (rev 415) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-09-24 21:53:00 UTC (rev 416) @@ -29,12 +29,9 @@ import daieditor.map.MapModel; import daieditor.map.MapSquare; import java.awt.Point; -import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.OutputStreamWriter; import java.util.Formatter; import net.sf.gridarta.Size2D; import net.sf.gridarta.io.CFileReader; @@ -49,15 +46,8 @@ public final class CMapFileEncode { /** - * Write the map to this writer. - * This is intentionally not a PrintWriter. - * It is important to always append '\n' without '\r' even on windows or Mac. - * The server relies on only '\n' being the line ending. - */ - private BufferedWriter writer; - - /** * Formatter to use for writing maps. + * @note use '\n' for line endings only. The fileformat requires Unix LF only. */ private Formatter format; @@ -73,12 +63,11 @@ public void encodeMapFile(final File file, final MapModel mapModel) throws FileNotFoundException, IOException { final MapArchObject mapArch = mapModel.getMapArchObject(); try { - writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), CFileReader.MAP_ENCODING)); - format = new Formatter(writer); + format = new Formatter(file, CFileReader.MAP_ENCODING); //GameObject multi; // write map header: map arch - mapArch.writeMapArch(writer); // FIXME: It doesn't look like a good idea to mix Push and Pull + mapArch.writeMapArch(format.out()); // FIXME: It doesn't look like a good idea to mix Push and Pull // first, write all one tile parts final Size2D mapSize = mapModel.getMapSize(); @@ -107,8 +96,7 @@ } // y } // x } finally { - writer.close(); - writer = null; + format.close(); format = null; } } @@ -173,7 +161,7 @@ writeGameObject(inventoryItem, 0, 0); } - format.format("%s", "end\n"); + format.out().append("end\n"); } } // class CMapFileEncode Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-09-24 21:33:57 UTC (rev 415) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-09-24 21:53:00 UTC (rev 416) @@ -25,9 +25,9 @@ package daieditor.map; import java.io.BufferedReader; -import java.io.BufferedWriter; import java.io.IOException; import java.io.Serializable; +import java.util.Formatter; import net.sf.gridarta.Size2D; import net.sf.gridarta.map.AbstractMapArchObject; import org.jetbrains.annotations.NotNull; @@ -411,42 +411,40 @@ /** * Writing the MapArchObject into the mapfile - * @param stream <code>BufferedWriter</code> to the mapfile - * @throws IOException an I/O error occured during writing to the file - * @todo use a Formatter instead + * @param stream <code>Appendable</code> to the mapfile + * @throws IOException an I/O error occured during appending or formatting */ - public void writeMapArch(@NotNull final BufferedWriter stream) throws IOException { + public void writeMapArch(@NotNull final Appendable stream) throws IOException { + final Formatter format = new Formatter(stream); stream.append("arch map\n"); if (getMapName().length() > 0) { - stream.append("name ").append(getMapName()).append('\n'); + format.format("name %s\n", getMapName()); } // maptext - stream.append(TAG_START_TEXT + '\n'); - stream.append(msgText.toString().trim()).append('\n'); - stream.append(TAG_END_TEXT + '\n'); + format.format("msg\n%s%sendmsg\n", msgText.toString().trim(), "\n"); - stream.append("width ").append(String.valueOf(getMapSize().getWidth())).append('\n'); - stream.append("height ").append(String.valueOf(getMapSize().getHeight())).append('\n'); + format.format("width %d\n", getMapSize().getWidth()); + format.format("height %d\n", getMapSize().getHeight()); if (getEnterX() > 0) { - stream.append("enter_x ").append(String.valueOf(getEnterX())).append('\n'); + format.format("enter_x %d\n", getEnterX()); } if (getEnterY() > 0) { - stream.append("enter_y ").append(String.valueOf(getEnterY())).append('\n'); + format.format("enter_y %d\n", getEnterY()); } if (getResetTimeout() > 0) { - stream.append("resetTimeout ").append(String.valueOf(getResetTimeout())).append('\n'); + format.format("resetTimeout %d\n", getResetTimeout()); } if (getSwapTime() > 0) { - stream.append("swap_time ").append(String.valueOf(getSwapTime())).append('\n'); + format.format("swap_time %d\n", getSwapTime()); } if (getDifficulty() > 0) { - stream.append("difficulty ").append(String.valueOf(getDifficulty())).append('\n'); + format.format("difficulty %d\n", getDifficulty()); } if (getDarkness() > 0) { - stream.append("darkness ").append(String.valueOf(getDarkness())).append('\n'); + format.format("darkness %d\n", getDarkness()); } if (isFixedReset()) { stream.append("fixed_resettime 1\n"); @@ -492,24 +490,18 @@ // tilePaths for (int i = 0; i < 8; i++) { if (tilePaths[i] != null && tilePaths[i].length() > 0) { - stream - .append("tile_path_") - .append(Integer.toString(i + 1)) - .append(' ') - .append(tilePaths[i]) - .append('\n'); + format.format("tile_path_%d %s\n", i + 1, tilePaths[i]); } } if (tilesetId > 0) { - stream.append("tileset_id ").append(Integer.toString(tilesetId)).append('\n'); - stream.append("tileset_x ").append(Integer.toString(tilesetX)).append('\n'); - stream.append("tileset_y ").append(Integer.toString(tilesetY)).append('\n'); + format.format("tileset_id %d\n", tilesetId); + format.format("tileset_x %d\n", tilesetX); + format.format("tileset_y %d\n", tilesetY); } // end - stream.write("end\n"); - stream.flush(); + stream.append("end\n"); } } // class MapArchObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-24 21:34:03
|
Revision: 415 http://svn.sourceforge.net/gridarta/?rev=415&view=rev Author: christianhujer Date: 2006-09-24 14:33:57 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Cosmetic source format change. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileEncode.java Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-09-24 21:33:24 UTC (rev 414) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-09-24 21:33:57 UTC (rev 415) @@ -45,7 +45,8 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -@SuppressWarnings({"HardcodedLineSeparator"}) public final class CMapFileEncode { +@SuppressWarnings({"HardcodedLineSeparator"}) +public final class CMapFileEncode { /** * Write the map to this writer. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-24 21:33:31
|
Revision: 414 http://svn.sourceforge.net/gridarta/?rev=414&view=rev Author: christianhujer Date: 2006-09-24 14:33:24 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Improved map writing to use a Formatter. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileEncode.java trunk/daimonin/src/daieditor/map/MapArchObject.java Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-09-24 21:04:51 UTC (rev 413) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-09-24 21:33:24 UTC (rev 414) @@ -35,6 +35,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; +import java.util.Formatter; import net.sf.gridarta.Size2D; import net.sf.gridarta.io.CFileReader; @@ -43,7 +44,6 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo use a Formatter, makes life easier and nicer. */ @SuppressWarnings({"HardcodedLineSeparator"}) public final class CMapFileEncode { @@ -55,6 +55,11 @@ */ private BufferedWriter writer; + /** + * Formatter to use for writing maps. + */ + private Formatter format; + /** Create a CMapFileEncode instance. */ public CMapFileEncode() { } @@ -68,6 +73,7 @@ final MapArchObject mapArch = mapModel.getMapArchObject(); try { writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), CFileReader.MAP_ENCODING)); + format = new Formatter(writer); //GameObject multi; // write map header: map arch @@ -102,6 +108,7 @@ } finally { writer.close(); writer = null; + format = null; } } @@ -116,24 +123,16 @@ final GameObject archetype = gameObject.getArchetype(); // ok, we start with the standard parts... this is valid for all types - writer.write("arch " + gameObject.getArchetypeName() + '\n'); + format.format("arch %s\n", gameObject.getArchetypeName()); if (gameObject.getObjName() != null) { - writer.write("name " + gameObject.getObjName() + '\n'); + format.format("name %s\n", gameObject.getObjName()); } // if (gameObject.getFaceName() != null) { - // writer.write("face "+gameObject.getFaceName()+"\n"); + // format.format("face %s\n", gameObject.getFaceName()); // } final String msgText = gameObject.getMsgText(); if (msgText != null && !msgText.trim().equals(archetype.getMsgText() == null ? "" : archetype.getMsgText().trim())) { - // write message text - writer.write("msg\n"); - if (msgText.trim().length() > 0) { - writer.write(msgText); - if (msgText.lastIndexOf('\n') != msgText.length() - 1) { - writer.write("\n"); - } - } - writer.write("endmsg\n"); + format.format("msg\n%s%sendmsg\n", msgText, msgText.endsWith("\n") ? "" : "\n"); } if (archetype != null && gameObject.getArchTypNr() != archetype.getArchTypNr()) { // this gameObject has special type @@ -153,33 +152,27 @@ } // now append the type to the archtext - writer.write("type "); - writer.write(Integer.toString(gameObject.getArchTypNr())); - writer.write("\n"); + format.format("type %d\n", gameObject.getArchTypNr()); } - writer.write(gameObject.getObjectText()); - if (gameObject.getObjectText().lastIndexOf('\n') != gameObject.getObjectText().length() - 1) { - writer.write("\n"); + final String objText = gameObject.getObjectText(); + if (objText.length() > 0) { + format.format("%s%s", objText, objText.endsWith("\n") ? "" : "\n"); } // map coordinates only belong into map arches (not inventory arches) if (x != 0) { - writer.write("x "); - writer.write(Integer.toString(x)); - writer.write("\n"); + format.format("x %d\n", x); } if (y != 0) { - writer.write("y "); - writer.write(Integer.toString(y)); - writer.write("\n"); + format.format("y %d\n", y); } for (final GameObject inventoryItem : gameObject) { writeGameObject(inventoryItem, 0, 0); } - writer.write("end\n"); + format.format("%s", "end\n"); } } // class CMapFileEncode Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-09-24 21:04:51 UTC (rev 413) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-09-24 21:33:24 UTC (rev 414) @@ -413,6 +413,7 @@ * Writing the MapArchObject into the mapfile * @param stream <code>BufferedWriter</code> to the mapfile * @throws IOException an I/O error occured during writing to the file + * @todo use a Formatter instead */ public void writeMapArch(@NotNull final BufferedWriter stream) throws IOException { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-24 21:04:57
|
Revision: 413 http://svn.sourceforge.net/gridarta/?rev=413&view=rev Author: christianhujer Date: 2006-09-24 14:04:51 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Improved symbol naming in code that writes daimonin maps. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileEncode.java Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-09-24 20:55:15 UTC (rev 412) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-09-24 21:04:51 UTC (rev 413) @@ -39,10 +39,11 @@ import net.sf.gridarta.io.CFileReader; /** - * The <code>CMapFileEncode</code> + * The <code>CMapFileEncode</code> is used to write a map to a file. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @todo use a Formatter, makes life easier and nicer. */ @SuppressWarnings({"HardcodedLineSeparator"}) public final class CMapFileEncode { @@ -80,7 +81,7 @@ for (final GameObject node : mapModel.getMapSquare(pos)) { // only non multi suckers if (!node.isMulti()) { - writeMapArch(node, pos.x, pos.y); + writeGameObject(node, pos.x, pos.y); } } // node } // y @@ -94,7 +95,7 @@ if (node.isMulti() && node.isHead()) { // only the heads get stored in the mapfile // (that's much more efficient) - writeMapArch(node, x, y); + writeGameObject(node, x, y); } // node } // y } // x @@ -105,59 +106,60 @@ } /** - * Here the map arch gets written into the file. - * @param arch <code>GameObject</code> to be written into the map - * @param x x position of arch (0 if <var>arch</var> is inside an inventory) - * @param y y position of arch (0 if <var>arch</var> is inside an inventory) + * Here the map gameObject gets written into the file. + * @param gameObject <code>GameObject</code> to be written into the map + * @param x x position of gameObject (0 if <var>gameObject</var> is inside an inventory) + * @param y y position of gameObject (0 if <var>gameObject</var> is inside an inventory) * @throws IOException in case of I/O problems */ - private void writeMapArch(final GameObject arch, final int x, final int y) throws IOException { - final GameObject defarch = arch.getArchetype(); + private void writeGameObject(final GameObject gameObject, final int x, final int y) throws IOException { + final GameObject archetype = gameObject.getArchetype(); // ok, we start with the standard parts... this is valid for all types - writer.write("arch " + arch.getArchetypeName() + '\n'); - if (arch.getObjName() != null) { - writer.write("name " + arch.getObjName() + '\n'); + writer.write("arch " + gameObject.getArchetypeName() + '\n'); + if (gameObject.getObjName() != null) { + writer.write("name " + gameObject.getObjName() + '\n'); } - // if (arch.getFaceName() != null) { - // writer.write("face "+arch.getFaceName()+"\n"); + // if (gameObject.getFaceName() != null) { + // writer.write("face "+gameObject.getFaceName()+"\n"); // } - if (arch.getMsgText() != null && !arch.getMsgText().trim().equals(defarch.getMsgText() == null ? "" : defarch.getMsgText().trim())) { + final String msgText = gameObject.getMsgText(); + if (msgText != null && !msgText.trim().equals(archetype.getMsgText() == null ? "" : archetype.getMsgText().trim())) { // write message text writer.write("msg\n"); - if (arch.getMsgText().trim().length() > 0) { - writer.write(arch.getMsgText()); - if (arch.getMsgText().lastIndexOf('\n') != arch.getMsgText().length() - 1) { + if (msgText.trim().length() > 0) { + writer.write(msgText); + if (msgText.lastIndexOf('\n') != msgText.length() - 1) { writer.write("\n"); } } writer.write("endmsg\n"); } - if (defarch != null && arch.getArchTypNr() != defarch.getArchTypNr()) { - // this arch has special type - if (arch.getObjectText().contains("type ")) { + if (archetype != null && gameObject.getArchTypNr() != archetype.getArchTypNr()) { + // this gameObject has special type + if (gameObject.getObjectText().contains("type ")) { // oh oh - there might also be a type in the archtext which // is conflicting. remove the type from the archtext // FIXME: Isn't the whole stuff about fixing the ArchText something that hasn't directly to do with Map I/O? // Shouldn't it be somewhere else then, e.g. in GameObject? final StringBuilder newArchText = new StringBuilder(); - for (String line : arch.getObjectText().split("\n")) { + for (String line : gameObject.getObjectText().split("\n")) { if (!line.startsWith("type ")) { newArchText.append(line).append('\n'); } } - arch.setObjectText(newArchText.toString()); + gameObject.setObjectText(newArchText.toString()); } // now append the type to the archtext writer.write("type "); - writer.write(Integer.toString(arch.getArchTypNr())); + writer.write(Integer.toString(gameObject.getArchTypNr())); writer.write("\n"); } - writer.write(arch.getObjectText()); - if (arch.getObjectText().lastIndexOf('\n') != arch.getObjectText().length() - 1) { + writer.write(gameObject.getObjectText()); + if (gameObject.getObjectText().lastIndexOf('\n') != gameObject.getObjectText().length() - 1) { writer.write("\n"); } @@ -173,8 +175,8 @@ writer.write("\n"); } - for (final GameObject arch1 : arch) { - writeMapArch(arch1, 0, 0); + for (final GameObject inventoryItem : gameObject) { + writeGameObject(inventoryItem, 0, 0); } writer.write("end\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-24 20:55:28
|
Revision: 412 http://svn.sourceforge.net/gridarta/?rev=412&view=rev Author: christianhujer Date: 2006-09-24 13:55:15 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Extracted MapType enum to a gridarta enum, added COPYBUFFER value. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CNewMapDialog.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/map/MapType.java Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-09-24 20:45:55 UTC (rev 411) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-09-24 20:55:15 UTC (rev 412) @@ -117,6 +117,7 @@ import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.gridarta.MainControl; import net.sf.gridarta.CUndoStack; +import net.sf.gridarta.map.MapType; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; @@ -891,12 +892,12 @@ * @param filename desired filename for the new map, null if not specified */ public void newLevelWanted(final String filename) { - CNewMapDialog.showNewMapDialog(this, mainView, filename, CNewMapDialog.MapType.GAMEMAP); + CNewMapDialog.showNewMapDialog(this, mainView, filename, MapType.GAMEMAP); } /** Invoked when user wants to open a new pickmap. */ public void addNewPickmap() { - CNewMapDialog.showNewMapDialog(this, mainView, null, CNewMapDialog.MapType.PICKMAP); + CNewMapDialog.showNewMapDialog(this, mainView, null, MapType.PICKMAP); } /** Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-09-24 20:45:55 UTC (rev 411) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-09-24 20:55:15 UTC (rev 412) @@ -30,12 +30,9 @@ import daieditor.map.MapArchObject; import java.awt.Component; import java.awt.FlowLayout; -import java.awt.GridLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; import javax.swing.Box; @@ -52,6 +49,7 @@ import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; import net.sf.gridarta.Size2D; +import net.sf.gridarta.map.MapType; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; @@ -79,16 +77,6 @@ */ private boolean mapSizeDefault = true; - /** Map types. */ - public enum MapType { - - /** Map Type for normal game maps. */ - GAMEMAP, - - /** Map Type for pickmaps. */ - PICKMAP - } // enum MapType - /** Preferences. */ private static final Preferences prefs = userNodeForPackage(CMainControl.class); Added: trunk/src/app/net/sf/gridarta/map/MapType.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapType.java (rev 0) +++ trunk/src/app/net/sf/gridarta/map/MapType.java 2006-09-24 20:55:15 UTC (rev 412) @@ -0,0 +1,43 @@ +package net.sf.gridarta.map; + +/** + * Map types. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public enum MapType { + + /** Map Type for normal game maps. */ + GAMEMAP(true), + + /** Map Type for pickmaps. */ + PICKMAP(true), + + /** Map Type for copy buffers. */ + COPYBUFFER(false); + + /** + * Whether multiparts in this map type should be expanded. + * @value <code>true</code> to expand multiparts + * @value <code>false</code> for not expanding + */ + private final boolean expandMulti; + + /** + * Create a MapType enum constant. + * @param expandMulti whether multiparts in this map type should be expanded. + * <code>true</code> to expand multiparts + * <code>false</code> for not expanding + */ + MapType(final boolean expandMulti) { + this.expandMulti = expandMulti; + } + + /** + * Return whether multiparts in this map type should be expanded. + * @return <code>true</code> to expand multiparts, <code>false</code> for not expanding + */ + public boolean isExpandMulti() { + return expandMulti; + } + +} // enum MapType Property changes on: trunk/src/app/net/sf/gridarta/map/MapType.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-09-24 20:46:00
|
Revision: 411 http://svn.sourceforge.net/gridarta/?rev=411&view=rev Author: christianhujer Date: 2006-09-24 13:45:55 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Optical improvement on new map dialog. Modified Paths: -------------- trunk/daimonin/src/daieditor/CNewMapDialog.java Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-09-24 20:15:23 UTC (rev 410) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-09-24 20:45:55 UTC (rev 411) @@ -31,6 +31,9 @@ import java.awt.Component; import java.awt.FlowLayout; import java.awt.GridLayout; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; import java.text.SimpleDateFormat; import java.util.Date; import java.util.prefs.Preferences; @@ -193,10 +196,16 @@ newLevelFromScratchPanel.add(mapSizeDefaultCheckbox); newLevelFromScratchPanel.add(Box.createVerticalStrut(5)); - final JPanel mapSizePanel = new JPanel(new GridLayout(0, 2)); + final JPanel mapSizePanel = new JPanel(new GridBagLayout()); + final GridBagConstraints gbcLabel = new GridBagConstraints(); + final GridBagConstraints gbcField = new GridBagConstraints(); + gbcLabel.insets = new Insets(2, 2, 2, 2); + gbcField.insets = new Insets(2, 2, 2, 2); + gbcLabel.anchor = GridBagConstraints.EAST; + gbcField.gridwidth = GridBagConstraints.REMAINDER; mapSizePanel.setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(), mapType == MapType.PICKMAP ? "Pickmap Size" : "Map Size"), IGUIConstants.DIALOG_BORDER)); // TODO cher: i18n/l10n - mapSizePanel.add(new JLabel(ACTION_FACTORY.getString("mapWidth"))); + mapSizePanel.add(new JLabel(ACTION_FACTORY.getString("mapWidth")), gbcLabel); if (mapType == MapType.PICKMAP) { mapWidthField.setValue(IGUIConstants.DEF_PICKMAP_WIDTH); } else { @@ -204,19 +213,20 @@ mapWidthField.setValue(prefs.getInt(DEFAULT_LEVEL_WIDTH_KEY, IGUIConstants.DEF_MAPSIZE)); } mapWidthField.setColumns(3); - mapSizePanel.add(mapWidthField); - mapSizePanel.add(new JLabel(ACTION_FACTORY.getString("mapHeight"))); + mapSizePanel.add(mapWidthField, gbcField); + mapSizePanel.add(new JLabel(ACTION_FACTORY.getString("mapHeight")), gbcLabel); if (mapType == MapType.PICKMAP) { mapHeightField.setValue(IGUIConstants.DEF_PICKMAP_HEIGHT); } else { mapHeightField.setValue(prefs.getInt(DEFAULT_LEVEL_HEIGHT_KEY, IGUIConstants.DEF_MAPSIZE)); } mapHeightField.setColumns(3); - mapSizePanel.add(mapHeightField); + mapSizePanel.add(mapHeightField, gbcField); if (mapType == MapType.GAMEMAP) { mapDifficultyField.setValue(prefs.getInt(DEFAULT_DIFFICULTY_KEY, IGUIConstants.DEF_MAPDIFFICULTY)); - mapSizePanel.add(new JLabel(ACTION_FACTORY.getString("mapDifficulty"))); - mapSizePanel.add(mapDifficultyField); + mapSizePanel.add(new JLabel(ACTION_FACTORY.getString("mapDifficulty")), gbcLabel); + mapDifficultyField.setColumns(3); + mapSizePanel.add(mapDifficultyField, gbcField); } newLevelFromScratchPanel.add(mapSizePanel); newLevelFromScratchPanel.add(Box.createVerticalStrut(5)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-24 20:15:29
|
Revision: 410 http://svn.sourceforge.net/gridarta/?rev=410&view=rev Author: christianhujer Date: 2006-09-24 13:15:23 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Fixed bug: darkness 0 shouldn't be written. Modified Paths: -------------- trunk/daimonin/src/daieditor/map/MapArchObject.java Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-09-24 20:12:32 UTC (rev 409) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-09-24 20:15:23 UTC (rev 410) @@ -444,7 +444,7 @@ if (getDifficulty() > 0) { stream.append("difficulty ").append(String.valueOf(getDifficulty())).append('\n'); } - if (getDarkness() >= 0) { + if (getDarkness() > 0) { stream.append("darkness ").append(String.valueOf(getDarkness())).append('\n'); } if (isFixedReset()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |