[Jreepad-CVS] jreepad/src/jreepad JreepadViewer.java, 1.43, 1.44 JreepadView.java, 1.33, 1.34 Jreep
Brought to you by:
danstowell
From: PeWu <pe...@us...> - 2007-01-16 23:56:08
|
Update of /cvsroot/jreepad/jreepad/src/jreepad In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26093/src/jreepad Modified Files: JreepadViewer.java JreepadView.java JreepadNode.java find.java TreeView.java Log Message: refactoring: JreepadNode now inherits from DefaultMutableTreeNode and uses its implementation Index: JreepadView.java =================================================================== RCS file: /cvsroot/jreepad/jreepad/src/jreepad/JreepadView.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** JreepadView.java 14 Jan 2007 17:10:21 -0000 1.33 --- JreepadView.java 16 Jan 2007 23:56:03 -0000 1.34 *************** *** 161,165 **** public JreepadView() { ! this(new JreepadNode("<Untitled node>", "", null)); } --- 161,165 ---- public JreepadView() { ! this(new JreepadNode("<Untitled node>", "")); } *************** *** 711,715 **** { //DEL storeForUndo(); ! getCurrentNode().addChild(newKid); treeModel.reload(currentNode); tree.expandPath(tree.getSelectionPath()); --- 711,715 ---- { //DEL storeForUndo(); ! getCurrentNode().add(newKid); treeModel.reload(currentNode); tree.expandPath(tree.getSelectionPath()); *************** *** 725,729 **** while((curLine = bReader.readLine())!=null) if(curLine.trim().length() > 0) ! getCurrentNode().addChild(new JreepadNode(curLine.trim(), "", getCurrentNode())); treeModel.reload(currentNode); --- 725,729 ---- while((curLine = bReader.readLine())!=null) if(curLine.trim().length() > 0) ! getCurrentNode().add(new JreepadNode(curLine.trim(), "")); treeModel.reload(currentNode); *************** *** 1076,1080 **** JreepadNode newNode; TreePath newPath; ! newNode = new JreepadNode(text, "", currentNode); addChild(newNode); TreePath leadPath = tree.getLeadSelectionPath(); --- 1076,1080 ---- JreepadNode newNode; TreePath newPath; ! newNode = new JreepadNode(text, ""); addChild(newNode); TreePath leadPath = tree.getLeadSelectionPath(); Index: TreeView.java =================================================================== RCS file: /cvsroot/jreepad/jreepad/src/jreepad/TreeView.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TreeView.java 14 Jan 2007 17:10:21 -0000 1.1 --- TreeView.java 16 Jan 2007 23:56:03 -0000 1.2 *************** *** 135,139 **** node.removeFromParent(); ! newParent.addChild(node); treeModel.reload(oldParent); --- 135,139 ---- node.removeFromParent(); ! newParent.add(node); treeModel.reload(oldParent); Index: find.java =================================================================== RCS file: /cvsroot/jreepad/jreepad/src/jreepad/find.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** find.java 13 Feb 2005 20:41:39 -0000 1.3 --- find.java 16 Jan 2007 23:56:03 -0000 1.4 *************** *** 37,41 **** /* ! The "Find" class is a command-line utility for searching a single HJT file. Examples of usage: --- 37,41 ---- /* ! The "Find" class is a command-line utility for searching a single HJT file. Examples of usage: *************** *** 47,51 **** The "-f" argument indicates the file to load. ! The remaining arguments are the search terms, which by default are found in EITHER the node title or the article. A "-t" indicates that what follows should only be in the title. --- 47,51 ---- The "-f" argument indicates the file to load. ! The remaining arguments are the search terms, which by default are found in EITHER the node title or the article. A "-t" indicates that what follows should only be in the title. *************** *** 106,113 **** File userFile = null; int outputFormat = OUTPUT_XML; ! Vector titleSearches = new Vector(); Vector articleSearches = new Vector(); ! // Load the arguments and check them out if(args.length==0 || (args.length==1 && (args[0].startsWith("-h") || args[0].startsWith("--h")) )) --- 106,113 ---- File userFile = null; int outputFormat = OUTPUT_XML; ! Vector titleSearches = new Vector(); Vector articleSearches = new Vector(); ! // Load the arguments and check them out if(args.length==0 || (args.length==1 && (args[0].startsWith("-h") || args[0].startsWith("--h")) )) *************** *** 166,170 **** } } ! String inNodes = ""; for(int i=0; i<titleSearches.size(); i++) --- 166,170 ---- } } ! String inNodes = ""; for(int i=0; i<titleSearches.size(); i++) *************** *** 181,185 **** System.out.println("Warning: complicated searches (more than 1 item to find in article, or more than 1 article to find in title) don't currently work properly!"); } ! String encoding = "UTF-8"; File prefsLastFile = null; --- 181,185 ---- System.out.println("Warning: complicated searches (more than 1 item to find in article, or more than 1 article to find in title) don't currently work properly!"); } ! String encoding = "UTF-8"; File prefsLastFile = null; *************** *** 194,198 **** jreepref = (JreepadPrefs)prefsLoader.readObject(); prefsLoader.close(); ! // ...and take some data from it encoding = jreepref.getEncoding(); --- 194,198 ---- jreepref = (JreepadPrefs)prefsLoader.readObject(); prefsLoader.close(); ! // ...and take some data from it encoding = jreepref.getEncoding(); *************** *** 206,214 **** { } ! // If no file specified by user, attempt to take it from the preferences file if(userFile==null) userFile = prefsLastFile; ! // If file unspecified or not found, exit with error if(userFile==null) --- 206,214 ---- { } ! // If no file specified by user, attempt to take it from the preferences file if(userFile==null) userFile = prefsLastFile; ! // If file unspecified or not found, exit with error if(userFile==null) *************** *** 222,226 **** System.exit(1); } ! // Load the file to be searched JreepadNode root = new JreepadNode(); --- 222,226 ---- System.exit(1); } ! // Load the file to be searched JreepadNode root = new JreepadNode(); *************** *** 234,239 **** System.exit(1); } ! ! // Carry out the search JreepadSearcher searcher = new JreepadSearcher(root); --- 234,239 ---- System.exit(1); } ! ! // Carry out the search JreepadSearcher searcher = new JreepadSearcher(root); *************** *** 241,245 **** orNotAnd, caseSensitive, maxResults); JreepadSearcher.JreepadSearchResult[] res = searcher.getSearchResults(); ! if(res.length==0) { --- 241,245 ---- orNotAnd, caseSensitive, maxResults); JreepadSearcher.JreepadSearchResult[] res = searcher.getSearchResults(); ! if(res.length==0) { *************** *** 247,251 **** System.exit(1); } ! // Output the results JreepadNode resultsParent; --- 247,251 ---- System.exit(1); } ! // Output the results JreepadNode resultsParent; *************** *** 261,273 **** break; case OUTPUT_XML: ! resultsParent = new JreepadNode("Search results","",null); for(int i=0; i<res.length; i++) ! resultsParent.addChild(res[i].getNode()); System.out.println(resultsParent.toXml("ISO-8859-1")); // FIXME: What should the encoding be, if anything? break; case OUTPUT_HJT: ! resultsParent = new JreepadNode("Search results","",null); for(int i=0; i<res.length; i++) ! resultsParent.addChild(res[i].getNode()); System.out.println(resultsParent.toTreepadString()); break; --- 261,273 ---- break; case OUTPUT_XML: ! resultsParent = new JreepadNode("Search results",""); for(int i=0; i<res.length; i++) ! resultsParent.add(res[i].getNode()); System.out.println(resultsParent.toXml("ISO-8859-1")); // FIXME: What should the encoding be, if anything? break; case OUTPUT_HJT: ! resultsParent = new JreepadNode("Search results",""); for(int i=0; i<res.length; i++) ! resultsParent.add(res[i].getNode()); System.out.println(resultsParent.toTreepadString()); break; Index: JreepadViewer.java =================================================================== RCS file: /cvsroot/jreepad/jreepad/src/jreepad/JreepadViewer.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** JreepadViewer.java 14 Jan 2007 00:23:19 -0000 1.43 --- JreepadViewer.java 16 Jan 2007 23:56:02 -0000 1.44 *************** *** 1581,1585 **** } content.remove(theJreepad); ! theJreepad = new JreepadView(new JreepadNode("<Untitled node>",theJreepad.getContentForNewNode(), null)); getPrefs().saveLocation = null; content.add(theJreepad); --- 1581,1585 ---- } content.remove(theJreepad); ! theJreepad = new JreepadView(new JreepadNode("<Untitled node>",theJreepad.getContentForNewNode())); getPrefs().saveLocation = null; content.add(theJreepad); *************** *** 2478,2482 **** else titStr = contStr.substring(0, newlinePos-1); ! theJreepad.addChild(new JreepadNode(titStr, contStr, theJreepad.getCurrentNode())); } catch(Exception err) --- 2478,2482 ---- else titStr = contStr.substring(0, newlinePos-1); ! theJreepad.addChild(new JreepadNode(titStr, contStr)); } catch(Exception err) Index: JreepadNode.java =================================================================== RCS file: /cvsroot/jreepad/jreepad/src/jreepad/JreepadNode.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** JreepadNode.java 14 Jan 2007 00:20:41 -0000 1.19 --- JreepadNode.java 16 Jan 2007 23:56:03 -0000 1.20 *************** *** 21,41 **** package jreepad; ! import java.util.*; ! import java.io.*; ! import javax.swing.tree.*; ! import java.text.*; ! import javax.swing.undo.*; import org.philwilson.JTextile; ! public class JreepadNode implements Serializable, TreeNode, MutableTreeNode, Comparable { - private Vector children; private String title; private String content; ! // private int childrenCount=0; ! private JreepadNode parentNode, softLinkTarget; ! private OurSortComparator ourSortComparator; ! protected transient javax.swing.table.TableColumnModel tblColModel; // private String lineSeparator = System.getProperty("line.separator"); --- 21,50 ---- package jreepad; ! import java.io.BufferedReader; ! import java.io.IOException; ! import java.io.InputStreamReader; ! import java.io.ObjectInputStream; ! import java.io.ObjectOutputStream; ! import java.io.Serializable; ! import java.text.CharacterIterator; ! import java.text.StringCharacterIterator; ! import java.util.Comparator; ! import java.util.Enumeration; ! import java.util.Stack; ! ! import javax.swing.tree.DefaultMutableTreeNode; ! import javax.swing.tree.MutableTreeNode; ! import javax.swing.tree.TreeNode; ! import javax.swing.undo.UndoManager; import org.philwilson.JTextile; ! public class JreepadNode extends DefaultMutableTreeNode implements Comparable { private String title; private String content; ! private JreepadNode softLinkTarget; ! private static OurSortComparator ourSortComparator = new OurSortComparator(); ! //protected transient javax.swing.table.TableColumnModel tblColModel; // private String lineSeparator = System.getProperty("line.separator"); *************** *** 50,74 **** // Undo features protected transient UndoManager undoMgr; ! protected transient String lastEditStyle = ""; public JreepadNode() { ! this((JreepadNode)null); ! } ! public JreepadNode(JreepadNode parentNode) ! { ! this("", parentNode); } ! public JreepadNode(String content, JreepadNode parentNode) { ! this("",content, parentNode); } ! public JreepadNode(String title, String content, JreepadNode parentNode) { this.title = title; this.content = content; - this.parentNode = parentNode; - ourSortComparator = new OurSortComparator(); - children = new Vector(); undoMgr = new UndoManager(); } --- 59,76 ---- // Undo features protected transient UndoManager undoMgr; ! //protected transient String lastEditStyle = ""; public JreepadNode() { ! this(""); } ! public JreepadNode(String content) { ! this("",content); } ! public JreepadNode(String title, String content) { this.title = title; this.content = content; undoMgr = new UndoManager(); } *************** *** 82,86 **** int lineNum = 2; BufferedReader bReader = new BufferedReader(treeInputStream); - children = new Vector(); Stack nodeStack = new Stack(); --- 84,87 ---- *************** *** 114,122 **** { constructFromHjtInputStream(treeInputStream, autoDetectHtmlArticles, ! 1, bReader, lineNum, nodeStack, children); } else if((currentLine.toLowerCase().startsWith("<hj-treepad") && currentLine.endsWith(">")) ) constructFromHjtInputStream(treeInputStream, autoDetectHtmlArticles, ! 2, bReader, lineNum, nodeStack, children); else { --- 115,123 ---- { constructFromHjtInputStream(treeInputStream, autoDetectHtmlArticles, ! 1, bReader, lineNum, nodeStack); } else if((currentLine.toLowerCase().startsWith("<hj-treepad") && currentLine.endsWith(">")) ) constructFromHjtInputStream(treeInputStream, autoDetectHtmlArticles, ! 2, bReader, lineNum, nodeStack); else { *************** *** 165,169 **** String title, typeString, content; JreepadNode babyNode; ! children = new Vector(); this.content = ""; --- 166,170 ---- String title, typeString, content; JreepadNode babyNode; ! removeAllChildren(); this.content = ""; *************** *** 234,243 **** // Process the nearest start tag ! babyNode = new JreepadNode(this); //System.out.println("\n\nJust before passing to baby: content is:\n"+currentXmlContent); currentXmlContent = babyNode.recursiveCreateFromXmlStream(bReader, currentXmlContent.substring(startTagOffset), depth+1); //System.out.println("\n\nJust after passing to baby: content is:\n"+currentXmlContent); ! children.add(babyNode); } --- 235,244 ---- // Process the nearest start tag ! babyNode = new JreepadNode(); //System.out.println("\n\nJust before passing to baby: content is:\n"+currentXmlContent); currentXmlContent = babyNode.recursiveCreateFromXmlStream(bReader, currentXmlContent.substring(startTagOffset), depth+1); //System.out.println("\n\nJust after passing to baby: content is:\n"+currentXmlContent); ! add(babyNode); } *************** *** 259,265 **** private void constructFromHjtInputStream(InputStreamReader treeInputStream, boolean autoDetectHtmlArticles, ! int hjtFileFormat, BufferedReader bReader, int lineNum, Stack nodeStack, ! Vector children ! ) throws IOException { int depthMarker; --- 260,264 ---- private void constructFromHjtInputStream(InputStreamReader treeInputStream, boolean autoDetectHtmlArticles, ! int hjtFileFormat, BufferedReader bReader, int lineNum, Stack nodeStack) throws IOException { int depthMarker; *************** *** 296,301 **** // Now, having established the content and the title and the depth, we'll create the child ! babyNode = new JreepadNode(titleLine, currentContent.substring(0, Math.max(currentContent.length()-1,0)), ! (JreepadNode)(nodeStack.peek())); // babyNode = new JreepadNode(titleLine, currentContent.substring(0, Math.max(currentContent.length()-2,0)), // (JreepadNode)(nodeStack.peek())); --- 295,299 ---- // Now, having established the content and the title and the depth, we'll create the child ! babyNode = new JreepadNode(titleLine, currentContent.substring(0, Math.max(currentContent.length()-1,0))); // babyNode = new JreepadNode(titleLine, currentContent.substring(0, Math.max(currentContent.length()-2,0)), // (JreepadNode)(nodeStack.peek())); *************** *** 320,324 **** nodeStack.pop(); ! ((JreepadNode)(nodeStack.peek())).addChild(babyNode); nodeStack.push(babyNode); } --- 318,322 ---- nodeStack.pop(); ! ((JreepadNode)(nodeStack.peek())).add(babyNode); nodeStack.push(babyNode); } *************** *** 327,330 **** --- 325,329 ---- } // End of constructor from HJT FileInputStream + /* private void OLDVERSIONconstructFromInputStream(InputStreamReader treeInputStream, boolean autoDetectHtmlArticles) throws IOException { *************** *** 408,411 **** --- 407,411 ---- } // End of constructor from FileInputStream + */ public String toString() *************** *** 472,476 **** ret.append(articleToHtml(exportMode, urlsToLinks, anchorName, anchorType)); ! if(children.size()>0) ret.append("\n<dl>"); for(int i=0; i<children.size(); i++) --- 472,476 ---- ret.append(articleToHtml(exportMode, urlsToLinks, anchorName, anchorType)); ! if(getChildCount()>0) ret.append("\n<dl>"); for(int i=0; i<children.size(); i++) *************** *** 479,483 **** ret.append(thisKid.exportAsHtml(exportMode, urlsToLinks, anchorName+"/"+htmlSpecialChars(thisKid.getTitle()), anchorType)); } ! if(children.size()>0) ret.append("\n</dl>"); ret.append("</dd>"); --- 479,483 ---- ret.append(thisKid.exportAsHtml(exportMode, urlsToLinks, anchorName+"/"+htmlSpecialChars(thisKid.getTitle()), anchorType)); } ! if(getChildCount()>0) ret.append("\n</dl>"); ret.append("</dd>"); *************** *** 703,715 **** } ! public void addChild(JreepadNode child) { if(articleMode==ARTICLEMODE_SOFTLINK) { ! softLinkTarget.addChild(child); return; } ! children.add(child); ! child.setParent(this); } public JreepadNode removeChild(int child) // Can be used to delete, OR to 'get' one for moving --- 703,714 ---- } ! public void add(JreepadNode child) { if(articleMode==ARTICLEMODE_SOFTLINK) { ! softLinkTarget.add(child); return; } ! super.add(child); } public JreepadNode removeChild(int child) // Can be used to delete, OR to 'get' one for moving *************** *** 720,726 **** } ! if(child<0 || child > children.size()) return null; ! ! JreepadNode ret = (JreepadNode)children.remove(child); return ret; } --- 719,724 ---- } ! JreepadNode ret = (JreepadNode)getChildAt(child); ! remove(child); return ret; } *************** *** 731,738 **** return softLinkTarget.getChildAt(child); } ! if(child<0 || child>= children.size()) ! return null; ! else ! return (JreepadNode)children.get(child); } public int getChildCount() --- 729,733 ---- return softLinkTarget.getChildAt(child); } ! return super.getChildAt(child); } public int getChildCount() *************** *** 742,746 **** return softLinkTarget.getChildCount(); } ! return children.size(); } public boolean indent() --- 737,741 ---- return softLinkTarget.getChildCount(); } ! return super.getChildCount(); } public boolean indent() *************** *** 750,757 **** if(pos<1) return false; // Get sibling node just above, and move self to there. ! getParentNode().removeChild(pos); ! JreepadNode newParent = (JreepadNode)getParentNode().getChildAt(pos-1); ! newParent.addChild(this); ! setParent(newParent); return true; } --- 745,752 ---- if(pos<1) return false; // Get sibling node just above, and move self to there. ! MutableTreeNode oldParent = (MutableTreeNode)getParent(); ! DefaultMutableTreeNode newParent = (DefaultMutableTreeNode)oldParent.getChildAt(pos-1); ! removeFromParent(); ! newParent.add(this); return true; } *************** *** 768,772 **** p.removeChild(getIndex()); pp.insert(this, ppos+1); - setParent(pp); // Also (as in the original treepad) move all the later siblings so they're children of this node --- 763,766 ---- *************** *** 785,792 **** return; } ! if(child<1 || child>= children.size()) return; ! children.add(child-1, children.remove(child)); } public void moveChildDown(int child) --- 779,786 ---- return; } ! if(child<1 || child>= getChildCount()) return; ! insert(removeChild(child), child-1); } public void moveChildDown(int child) *************** *** 797,822 **** return; } ! if(child<0 || child>= children.size()-1) return; ! children.add(child+1, children.remove(child)); } public void moveUp() { ! if(getParentNode()==null) return; int index = getIndex(); if(index<1) return; removeFromParent(); ! getParentNode().insert(this, index-1); } public void moveDown() { ! if(getParentNode()==null) return; int index = getIndex(); ! if(index<0 || index >= getParentNode().getChildCount()-1) return; removeFromParent(); ! getParentNode().insert(this, index+1); } public JreepadNode addChild() --- 791,818 ---- return; } ! if(child<0 || child>= getChildCount()-1) return; ! insert(removeChild(child), child+1); } public void moveUp() { ! MutableTreeNode parent = (MutableTreeNode)getParent(); ! if(parent==null) return; int index = getIndex(); if(index<1) return; removeFromParent(); ! parent.insert(this, index-1); } public void moveDown() { ! MutableTreeNode parent = (MutableTreeNode)getParent(); ! if(parent==null) return; int index = getIndex(); ! if(index<0 || index >= parent.getChildCount()-1) return; removeFromParent(); ! parent.insert(this, index+1); } public JreepadNode addChild() *************** *** 826,832 **** return softLinkTarget.addChild(); } ! JreepadNode theChild = new JreepadNode(this); ! children.add(theChild); ! theChild.setParent(this); return theChild; } --- 822,827 ---- return softLinkTarget.addChild(); } ! JreepadNode theChild = new JreepadNode(); ! add(theChild); return theChild; } *************** *** 837,843 **** return softLinkTarget.addChild(index); } ! JreepadNode theChild = new JreepadNode(this); ! children.add(index, theChild); ! theChild.setParent(this); return theChild; } --- 832,837 ---- return softLinkTarget.addChild(index); } ! JreepadNode theChild = new JreepadNode(); ! insert(theChild, index); return theChild; } *************** *** 849,856 **** return softLinkTarget.getIndex(child); } ! for(int i=0; i<getChildCount(); i++) ! if(((JreepadNode)child).equals(getChildAt(i))) ! return i; ! return -1; } public int getIndex() --- 843,847 ---- return softLinkTarget.getIndex(child); } ! return super.getIndex(child); } public int getIndex() *************** *** 867,877 **** return softLinkTarget.isNodeInSubtree(n); } ! for(int i=0; i<getChildCount(); i++) ! { ! JreepadNode aChild = (JreepadNode)getChildAt(i); ! if(aChild.equals(n) || aChild.isNodeInSubtree(n)) ! return true; ! } ! return false; } --- 858,862 ---- return softLinkTarget.isNodeInSubtree(n); } ! return isNodeDescendant(n); } *************** *** 903,909 **** Object[] childrenArray = children.toArray(); java.util.Arrays.sort(childrenArray, ourSortComparator); ! children = new Vector(); for(int i=0; i<childrenArray.length; i++) ! children.add((JreepadNode)childrenArray[i]); } private static class OurSortComparator implements Comparator, Serializable --- 888,894 ---- Object[] childrenArray = children.toArray(); java.util.Arrays.sort(childrenArray, ourSortComparator); ! removeAllChildren(); for(int i=0; i<childrenArray.length; i++) ! add((JreepadNode)childrenArray[i]); } private static class OurSortComparator implements Comparator, Serializable *************** *** 926,934 **** */ } public int OLDSIMPLEcompareTo(Object o) { return getTitle().compareToIgnoreCase( ((JreepadNode)o).getTitle()); ! } // The following function is a halfway-house on the way to "natural numerical ordering" public int compareTo(Object o) --- 911,920 ---- */ } + /* public int OLDSIMPLEcompareTo(Object o) { return getTitle().compareToIgnoreCase( ((JreepadNode)o).getTitle()); ! }*/ // The following function is a halfway-house on the way to "natural numerical ordering" public int compareTo(Object o) *************** *** 958,965 **** // End of: Stuff to use Java's built-in mergesort - public boolean getAllowsChildren() { return true; } // Required by TreeNode interface public boolean isLeaf() { ! return getChildCount()==0; // Is this the correct behaviour? } --- 944,950 ---- // End of: Stuff to use Java's built-in mergesort public boolean isLeaf() { ! return (getChildCount()==0); } *************** *** 970,983 **** return softLinkTarget.children(); } ! return new JreepadNodeEnumeration(); } // Required by TreeNode interface public JreepadNode getParentNode() { ! return parentNode; ! } ! public TreeNode getParent() ! { ! return parentNode; } --- 955,964 ---- return softLinkTarget.children(); } ! return super.children(); } // Required by TreeNode interface public JreepadNode getParentNode() { ! return (JreepadNode)getParent(); } *************** *** 990,994 **** return; } ! removeChild(child); } public void remove(MutableTreeNode node) --- 971,975 ---- return; } ! super.remove(child); } public void remove(MutableTreeNode node) *************** *** 999,1019 **** return; } ! removeChild(getIndex((JreepadNode)node)); ! } ! public void removeFromParent() ! { ! if(parentNode != null) ! parentNode.remove(this); ! } ! public void setParent(MutableTreeNode parent) ! { ! parentNode = (JreepadNode)parent; // Do we need to do anything more at this point? } - public void setUserObject(Object object) - { - // ? - setContent(object.toString()); - } public void insert(MutableTreeNode child, int index) { --- 980,986 ---- return; } ! super.remove(node); } public void insert(MutableTreeNode child, int index) { *************** *** 1023,1027 **** return; } ! children.insertElementAt((JreepadNode)child, index); } --- 990,994 ---- return; } ! super.insert(child, index); } *************** *** 1040,1044 **** contentString.append(currentLine + "\n"); // Then just create the node ! addChild(new JreepadNode(nodeName, contentString.toString(), this)); } --- 1007,1011 ---- contentString.append(currentLine + "\n"); // Then just create the node ! add(new JreepadNode(nodeName, contentString.toString())); } *************** *** 1046,1053 **** public JreepadNode getCopy() { ! JreepadNode ret = new JreepadNode(getTitle(), getContent(), null); for(int i=0; i<getChildCount(); i++) { ! ret.addChild(((JreepadNode)getChildAt(i)).getCopy()); } return ret; --- 1013,1020 ---- public JreepadNode getCopy() { ! JreepadNode ret = new JreepadNode(getTitle(), getContent()); for(int i=0; i<getChildCount(); i++) { ! ret.add(((JreepadNode)getChildAt(i)).getCopy()); } return ret; *************** *** 1433,1449 **** protected JreepadNode makeSoftLink() { ! JreepadNode link; ! getParentNode().addChild(link = new JreepadNode(getParentNode())); link.makeMeASoftLinkTo(this); return link; } - public class JreepadNodeEnumeration implements Enumeration - { - private int i=0; - public boolean hasMoreElements() { return i<getChildCount(); } - public Object nextElement() { return getChildAt(i++); } - } // This enumerator class is required by the TreeNode interface - /* // Listens for edits that can be undone. --- 1400,1409 ---- protected JreepadNode makeSoftLink() { ! JreepadNode link = new JreepadNode(); ! getParentNode().add(link); link.makeMeASoftLinkTo(this); return link; } /* // Listens for edits that can be undone. |